2009年10月9日 星期五

macports: unable to compile vim-app on snowleopard

升級到 SnowLeopard 會導致 Macports 出現一些問題。可參考 SnowLeopardProblems

另外 vim-app 也無法 compile 。( https://trac.macports.org/ticket/20947 )

出現的 compile error 如下:
--->  Building vim-app
Starting make in the src directory.
If there are problems, cd to the src directory and run make there
cd src && /usr/bin/make all
mkdir objects
CC="/usr/bin/gcc-4.2 -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MAC -fno-common -fpascal-strings -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe -I. -Iproto -I/opt/local/include -DMACOS_X_UNIX -no-cpp-precomp -I/Developer/Headers/FlatCarbon " srcdir=. sh ./osdef.sh
creating auto/pathdef.c
/usr/bin/gcc-4.2 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MAC -fno-common -fpascal-strings -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe -I. -Iproto -I/opt/local/include -DMACOS_X_UNIX -no-cpp-precomp -I/Developer/Headers/FlatCarbon -O2 -arch x86_64 -D_FORTIFY_SOURCE=1 -o objects/gui_mac.o gui_mac.c
/usr/bin/gcc-4.2 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MAC -fno-common -fpascal-strings -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe -I. -Iproto -I/opt/local/include -DMACOS_X_UNIX -no-cpp-precomp -I/Developer/Headers/FlatCarbon -O2 -arch x86_64 -D_FORTIFY_SOURCE=1 -o objects/os_macosx.o os_macosx.c
/usr/bin/gcc-4.2 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MAC -fno-common -fpascal-strings -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe -I. -Iproto -I/opt/local/include -DMACOS_X_UNIX -no-cpp-precomp -I/Developer/Headers/FlatCarbon -O2 -arch x86_64 -D_FORTIFY_SOURCE=1 -o objects/os_mac_conv.o os_mac_conv.c
gui_mac.c: In function 'new_fnames_from_AEDesc':
gui_mac.c:559: error: 'typeFSS' undeclared (first use in this function)
gui_mac.c:559: error: (Each undeclared identifier is reported only once
gui_mac.c:559: error: for each function it appears in.)
gui_mac.c: In function 'Handle_KAHL_SRCH_AE':
gui_mac.c:637: error: 'FSSpec' has no member named 'parID'
gui_mac.c:637: error: 'FSSpec' has no member named 'parID'
gui_mac.c:638: error: 'FSSpec' has no member named 'name'
gui_mac.c:638: error: 'FSSpec' has no member named 'name'
gui_mac.c:639: error: 'FSSpec' has no member named 'name'
gui_mac.c:639: error: 'FSSpec' has no member named 'name'
gui_mac.c:639: error: 'FSSpec' has no member named 'name'
gui_mac.c: In function 'Handle_KAHL_GTTX_AE':
gui_mac.c:811: error: 'FSSpec' has no member named 'parID'
gui_mac.c:811: error: 'FSSpec' has no member named 'parID'


解法:

$ sudo port deps vim-app # 看 vim-app 相依哪些函式庫 , 使用 +universal variant 來 compile 這些相依的函式庫。如:

$ sudo port -d install libiconv +universal

最後 compile vim-app:

$ sudo port -d install vim-app +cscope+perl+ruby configure.compiler=gcc-4.0 configure.build_arch=i386