At least with the version of Xcode that comes with Leopard,

/usr/include/ffi/fficonfig.h doesn't define MACOSX, which causes the
build of GLib to fail.  If we don't find "#define.*MACOSX" in
/usr/include/ffi/fficonfig.h, explictly define it.

svn path=/trunk/; revision=44693
This commit is contained in:
Guy Harris 2012-08-29 10:31:29 +00:00
parent a5c0d49ac2
commit d0f32eea23
1 changed files with 13 additions and 1 deletions

View File

@ -178,7 +178,19 @@ cd glib-$GLIB_VERSION
# script doesn't try to use pkg-config to get the appropriate
# CFLAGS and LIBS.
#
LIBFFI_CFLAGS="-I/usr/include/ffi" LIBFFI_LIBS="-lffi" ./configure || exit 1
# And, what's worse, at least with the version of Xcode that comes
# with Leopard, /usr/include/ffi/fficonfig.h doesn't define MACOSX,
# which causes the build of GLib to fail. If we don't find
# "#define.*MACOSX" in /usr/include/ffi/fficonfig.h, explictly
# define it.
#
if grep -qs '#define.*MACOSX' /usr/include/ffi/fficonfig.h
then
# It's defined, nothing to do
LIBFFI_CFLAGS="-I/usr/include/ffi" LIBFFI_LIBS="-lffi" ./configure || exit 1
else
CFLAGS="-DMACOSX" LIBFFI_CFLAGS="-I/usr/include/ffi" LIBFFI_LIBS="-lffi" ./configure || exit 1
fi
make -j 3 || exit 1
# Apply patch: we depend on libffi, but pkg-config doesn't get told.
patch -p0 <../../macosx-support-lib-patches/glib-pkgconfig.patch || exit 1