Contents
4. Source Setup
- Get the source code (download)
Download 받은 source는 아래와 같은 방법으로 압축을 푼다.
1 2 | $ tar xvzf OOo_2.0.2_src.tar.gz $ cd OOB680_m5 |
이제부터 $SRC_ROOT를 OpenOffice.org source directory로 지칭하겠다. (여기서는 OOB680_m5)
- External Library
Build 환경이 갖추어 졌다고 해서 compile되지는 않는다. License 등의 문제로 source에서 빠진 외부 라이브러리를 source안에 설치해 줘야 한다.
- General Polygon Clipper Library (GPC) (download)
압축을 풀어서 나온 gpc.c gpc.h를 $SRC_ROOT/external/gpc에 복사한다. - Microsoft Layer for Unicode (download)
unicows.dll을 $SRC_ROOT/external/unicows에 복사한다. - dbghelp.dll (download)
dbghelp.dll을 $SRC_ROOT/external/dbghelp에 복사한다. - Mozilla Libraries (download)
WNTMSCI{inc,lib,runtime}.zip을 받아서 $SRC_ROOT/moz/zipped에 복사한다.
- Generating the Build Environment and Build Tools
OpenOffice.org도 다른 Open Source program들과 마찬가지로 configure script로 build 환경을 check하고 준비하며, make로 build를 한다.
다만 특이한 것은 config_office directory에서 configure 를 실행해서 build 환경 check와 build 순서 file을 $SRC_ROOT에 생성한다. 그리고 생성된 파일을 가지고 OpenOffice.org source에 포함된 dmake를 가지고 빌드를 하게 되어있다. 한마디로 configure, make 유틸리티도 자기들에 맞게 수정해서 사용한다는 이야기다.
배경 설명은 이정도로 하고, 시작해 보자.
- Cygwin shell을 시작한다. bash가 기본 shell로 되어 있을 것이다.
- 압축을 해제한 directory로 이동한다.
- config_office direcotry로 이동한다. 여기에 있는 configure script를 이용해서 실제 compile시에 사용할 configure script를 생성할 것이다.
1[$SRC_ROOT] cd config_office
- configure script에 들어갈 인자가 많기 때문에 편하게 사용하기 위해서 shell script를 작성한다.
1
2
3
4
5
6
7
8
9
10
11
12[$SRC_ROOT/config_office] vi configure_my.sh
#!/bin/bash
./configure --with-jdk-home='/cygdrive/c/j2sdk1.4.2_11' \
--with-psdk-home='/cygdrive/c/Program Files/Microsoft Platform SDK' \
--with-directx-home='/cygdrive/c/DirectXSDK' \
--with-frame-home='/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/SDK/v.1.1' \
--with-use-shell=tcsh \
--with-lang=ko \
--with-mspdb-path='/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Common7/IDE' \
--with-midl-path='/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Common7/Tools' \
--with-csc-path='/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v1.1.4322' \
--with-cl-home='/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Vc7' - 작성했다면 저장하고 나온 후, 실행 permission을 주고 실행한다.
1
2[$SRC_ROOT/config_office] chmod 755 configure_my.sh
[$SRC_ROOT/config_office] ./configure_my.sh - 성공적으로 script가 수행되었다면 $SRC_ROOT에 bootstrap, winenv.set file이 생성되었을 것이다. 그후에 다음을 실행한다.
1
2
3
4
5
6
7
8[$SRC_ROOT/config_office] cd ../
[$SRC_ROOT] tcsh
(build를 위해서 default shell인 bash를 사용하지 않고 tcsh를 사용한다.)
[$SRC_ROOT] ./bootstrap
(configure script를 통해서 만들어진 script로 OpenOffice.org를 build할 system의 환경을 체크하고, build시 사용할 dmake를 compile한다.)
[$SRC_ROOT] source winenv.set
(build에 필요한 환경 변수들을 설정한다.)
[$SRC_ROOT] rehash
이제야 겨우 build 환경이 다 갖추어 졌다. 일단 여기까지 제대로 따라했다면 절반 이상은 성공한 것이나 다름없다.
5. Build Instructions
- Building a Full Build
전체 모든 source를 build하기 위해서는 다음을 입력한다.
1 | [$SRC_ROOT] dmake |
build가 완료될 때까지 걸리는 시간은 원문에 나와있기를…
Architecture : Intel
Processor : Athlon XP1700
Processor speed : 1466 MHz
RAM : 512 MB
Hard Disk : 160 GB 7200 RPM IDE
Time : about 17 hour
테스트한 컴퓨터의 사양과 빌드시간은,
Architecture : Intel
Processor : Pentium 4
Processor speed : 2.66 GHz
RAM : 1GB
Hard Disk : 60 GB 7200 RPM IDE
Time : about 14 hour
결론은… 때려주고 싶을 정도로 오래 걸린다. ㅡㅡ;
Build가 error없이 성공했다면 아래의 directory에 MSI install package가 생성되어 있을 것이다. 실행하여 설치하자. 그럼 build는 끝..
1 2 | [$SRC_ROOT] cd instsetoo_native/wntmsci10.pro/OpenOffice/msi/install/ko [...ko] ./setup.exe |
- Building a Project with Debug Information
OpenOffice.org의 module을 debugging하고 싶으면 full build된 source에서 그 module만 debug mode로 build해서 사용한다.
1 2 | [$SRC_ROOT/(module)] rm -rf wntmsci10.pro [$SRC_ROOT/(module)] build debug=true |
왜 전체 module을 debug mode로 build하지 않는가? 이 질문에 대한 대답은 debug mode로 build하는 시간이 너무 오래 걸리고, 비효율적으로 OpenOffice.org가 실행이 되며, 사용공간을 많이 차지 한다는 것이다.
OpenOffice.org는 module화가 잘 되어있어서 굳이 필요없는 module을 debug mode로 compile할 필요 없이 필요한 module만 debug mode로 compile하면 debugging 할 수 있게 되어 있다.
6. Build Trouble Shooting
1) Cygwin의 bug
Cygwin의 bug로 인해서 build 중에 멈추는 현상이 있다. 이 문제를 해결하기 위해서는 build하고 있는 cygwin shell외에 하나 더 띄워서 다음과 같은 script를 만들어서 실행한다.
1 2 3 4 5 6 7 8 9 10 | $ vi fd_ls.sh #!/bin/bash while [ 1 ] do sleep 5 ls /proc/*/fd done (저장) $ chmod 755 fd_ls.sh $ ./fd_ls.sh |
2) Build 중에 생기는 error들…
- $SRC_ROOT/lingucomponent/source/spellcheck/hunspell/hunspell.cxx 에서 Sharp S 문자를 컴파일러에서 인식하지 못해서 에러가 발생한다. 발생하는 구문의 문자를 변경한다.
- $SRC_ROOT/svx/wntmsci10.pro/inc/chinese_direction.hrc 에서 문자를 컴파일러에서 인식하지 못해서 에러가 발생한다. 발생하는 구문의 문자를 변경한다.
- $SRC_ROOT/dbaccess/wntmsci10.pro/inc/AutoControls.hrc 에서 문자를 컴파일러에서 인식하지 못해서 에러가 발생한다. 발생하는 구문의 문자를 변경한다.
7. Files
위에서 Build를 위해 사용하거나 변경한 File들을 Download할 수 있습니다. 포함된 File은 각각 다음과 같습니다.
- Build script : configure_my.sh
- FD refresh script : fd_ls.sh
- Error 수정한 hunspell.cxx : hunspell.cxx
- Error 수정한 chinese_direction.hrc : chinese_direction.hrc
- Error 수정한 AutoControls.hrc : AutoControls.hrc
– God Bless..
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 2.0 Korea.
이 Post와 연관된 Posts:
|
|


