[cairo] My (unsuccessful) fight with compiling 1.12.0 on OSX 10.7

Dimiter 'malkia' Stanev malkia at gmail.com
Tue Mar 27 21:03:16 PDT 2012


I produce executables working back to 10.5, universal (i386/x86_64, no ppc)

Mine are 16 days old, and the git stamp is written at the end of each 
.dylib (I concat it there to know what I submitted).

Also each module finds each other, as they use @loader_path
https://github.com/malkia/ufo/tree/master/bin/OSX

Here is how I build cairo (built on OSX 10.7.3 with latest XCode)
https://github.com/malkia/ufo/blob/master/build/OSX/cairo.sh

here is my config (from the .sh file above):
CONFIGURATION="\
     --enable-static=no \
     --enable-xlib=no \
     --enable-xlib-xrender=no \
     --enable-xcb=no \
     --enable-xlib-xcb=no \
     --enable-xcb-shm=no \
     --enable-test-surfaces=no \
     --enable-full-testing=no \
\
     --enable-fc=no \
     --enable-ft=no \
\
     --enable-quartz-font=yes \
     --enable-quartz-image=yes \
\
     --enable-gl=yes \
     --enable-quartz=yes \
     --enable-tee=yes \
     --enable-script=yes \
     --enable-png=yes \
     --enable-svg=yes \
     --enable-xml=yes \
"

On 3/27/2012 7:43 PM, Travis Griggs wrote:
> I am not a compiler wizard. I wrote this document
>
> http://www.cairographics.org/end_to_end_build_for_mac_os_x/
>
> a while ago. With the release of Cairo 1.12.0 and the exciting new features, I wanted to build a fresh version for OSX that could be bundled with apps.. I've had a number of issues so far, and the latest has left me wondering where to go next. Any help/hints appreciated. I'm generally logged into the irc channel and can be pinged there too.
>
> My environment is a relatively stock OSX 10.7.3 MBP, with the latest Xcode installed. Here's my gcc version...
>
> iboard17-local:cairo travis$ gcc --version
> i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
>
> 1) I tried to use top-of-trunk versions for the 4 main packages involved. I was unable to configure pkg-config 0.26. When I ran the configure command, I eventually got
>
> ../configure: line 13540: --exists: command not found
> configure: error: pkg-config and glib-2.0 not found, please set GLIB_CFLAGS and GLIB_LIBS to the correct values
>
> Interestingly, at one point, I cleared everything and started over again with the whole thing, but forget to do this step, and got as far as configuring cairo before I discovered it's absence. It's not needed for the pixman or png builds. Is it really necessary for Cairo? If the dependency were simple enough to remove, it would be one less hindrance to compiling Cairo in an "out of Linux environment".
>
> I backed off to the 0.25 version, and things worked fine. Glad I didn't have to work back too many versions.
>
> 2) When I tried to use a modified variant of the flags on that page
> 	export MACOSX_DEPLOYMENT_TARGET=10.5
> 	export LDFLAGS=" -arch i386  -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk"
> 	export CFLAGS="-Os  -arch i386  -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk"
>
> Neither 1.4.2 or 1.5.9 of libpng would compile. Not sure what the issue was.. configure was trying to compile some little program and couldn't.
>
> 3) So I backed off to just using no special flags or env variables there. Success! Kind of. The Smalltalk application I'm trying to load these into is of arch type 386. But lipo informed me that the libraries I built were of arch type x86_64. So… back to the drawing board.
>
> 4) I tried with just
> 	export LDFLAGS=" -arch i386  -arch x86_64"
> 	export CFLAGS="-Os  -arch i386  -arch x86_64"
> No DeploymentTarget or isysroot stuff. That blew up trying to compile libpng with the following:
>
> /bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -DPNG_CONFIGURE_LIBPNG   -Os -arch i386  -arch x86_64 -MT libpng15_la-png.lo -MD -MP -MF .deps/libpng15_la-png.Tpo -c -o libpng15_la-png.lo `test -f 'png.c' || echo './'`png.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DPNG_CONFIGURE_LIBPNG -Os -arch i386 -arch x86_64 -MT libpng15_la-png.lo -MD -MP -MF .deps/libpng15_la-png..Tpo -c png.c  -fno-common -DPIC -o .libs/libpng15_la-png.o
> llvm-gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
> make[1]: *** [libpng15_la-png.lo] Error 1
> make: *** [all] Error 2
>
> 5) So I tried with just
> 	export LDFLAGS=" -arch i386"
> 	export CFLAGS="-Os  -arch i386"
>
> This makes it as far as Cairo compile. And even link I think, where this happens:
>
>    CCLD   libcairo.la
> ld: lto: could not merge in .libs/cairo-analysis-surface.o because Unknown instruction for architecture i386
> collect2: ld returned 1 exit status
> make[3]: *** [libcairo.la] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
>
> Any help or explanation on any of these much appreciated. Is anyone else producing an osx binary with all of the X11/fontconfig features disabled?
>
> --
> Travis Griggs
> Objologist
> I multiply all time estimates by pi, to account for running around in circles.
>
>
>
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>


More information about the cairo mailing list