At least with the version of Xcode that comes with Leopard,
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 29 Aug 2012 10:31:29 +0000 (10:31 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 29 Aug 2012 10:31:29 +0000 (10:31 +0000)
/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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@44693 f5534014-38df-0310-8fa8-9805f1628bb7

macosx-setup.sh

index 8a2f03bd380cb0ed78a81e7aaa71e89548117d94..6c946f55ae10a3251bc3988302462c1ecb0c7e21 100755 (executable)
@@ -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