Build Universal GTK+-2 Package for Mac

** I’ve given up to build 10.4u libraries on 10.5… This article is not completed. **
I’m trying to build a universal GTK+ package for MacOS X 10.4 & 10.4, to release my software. This article is the build log from scratch. My current environment is a PPC Mac mini, running MacOS X 10.4 + XCode 2.5.
Note for Leopard macs: According to an article in Apple mailing list, “-mmacosx-version-min=10.4” is necessary to avoid linking libcrt1.10.5.o when using “-isysroot /Developer/SDKs/MacOSX10.4u.sdk”. However, I’ve given up to build on a Leopard/Intel MacBook because GTK+ can’t be built after my 2-days war.
% setenv CFLAGS ‘-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc -I/opt/gtk/include’ ; setenv CXXFLAGS “$CFLAGS” ; setenv LDFLAGS ‘-L/opt/gtk/lib -mmacosx-version-min=10.4 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk ‘; setenv CPPFLAGS ‘-I/opt/gtk/include’
% set path = ( /opt/gtk/bin $path )
% ./configure –prefix=/opt/gtk –with-x-includes=/Developer/SDKs/MacOSX10u.sdk/usr/X11R6/include/ –with-x-libraries=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/
(add –host=i386-apple-darwin8 for i386)
pkg-config-0.19 : should be always native since it must executable! I’ve built for ppc.
libiconv-1.12
gettext-0.17
libxml2-2.6.30
glib-2.18.3 : how about “gtkdoc-rebase: command not found” error?
atk-1.25.2
libpng-1.2.32
jpeg.v6b
tiff-3.8.2
pixman-0.13.2
freetype-2.3.7
fontconfig-2.6.0
renderext-0.9
libXrender-0.9.0
libXft-2.1.13
cairo-1.8.6
pango-1.22.4
gtk+-2.4.16
Hmm, gtk build stops on Leopard/i386 Mac: “gtk-update-icon-cache: The generated cache was invalid.” This may because of incorrect detection of endianness by glib, however I couldn’t find the way out.
[ NOTES ]
glib: crosscompiling glib requires a small hack since ./configure script can’t run several test programs. see: Glib manual. Another issue is that we have to have a native glib-genmarshal in PATH (also, genmarshal is required by ATK and some other stuff).
Configuration for i386 Mac (that I’ve tested with native build on Leopard) is:
glib_cv_long_long_format=ll
glib_cv_stack_grows=no
glib_cv_uscore=no
ac_cv_func_posix_getgrgid_r=yes
ac_cv_func_posix_getpwuid_r=yes
ac_cv_func_posix_memalign=no
And one more thing, make will fail because of an empty command in libtool. This is because global_pipe_symbol is “”. I think this should be:
global_pipe_symbol=”sed -n -e ‘s/^.*[ ]\\([BCDEGRST][BCDEGRST]*\\)[ ][ ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p'”
and it looks ok.
jpeg-6b: included libtool is too old… replacing by libtool bundled in MacOS X, but need one more hack.
% cp /usr/bin/glibtool libtool
% vi libtool : allow_undefined_flag=”$FLAGS” (a stupid patch but it works :p)
% ./configure (maybe we don’t need this)
% ./configure –enable-shared –prefix=/opt/gtk
Carbon Framework, libSystem.B.dylib and MacOSX10.4u.sdk problem: http://www.red-sweater.com/blog/246/missing-link

コメントを残す