summaryrefslogtreecommitdiff
path: root/macosx-setup.sh
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-06-27 10:30:33 +0000
committerGuy Harris <guy@alum.mit.edu>2013-06-27 10:30:33 +0000
commitf3f156073b7fed7db2e8a7a7364873675dbfb097 (patch)
tree0d64ad4a52cc734d6bf52d01b9197b629c52f2d6 /macosx-setup.sh
parent9334a49cb1ed8548e49f02bba5df73be3193f68a (diff)
downloadwireshark-f3f156073b7fed7db2e8a7a7364873675dbfb097.tar.gz
Don't assume the system include files are under /usr/include; trick the
compiler into saying where they are, and use that. Patch a bug in PortAudio pa_stable_v19_20111121 that clang found. svn path=/trunk/; revision=50186
Diffstat (limited to 'macosx-setup.sh')
-rwxr-xr-xmacosx-setup.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/macosx-setup.sh b/macosx-setup.sh
index 543a469e10..c130edc2bf 100755
--- a/macosx-setup.sh
+++ b/macosx-setup.sh
@@ -327,12 +327,22 @@ if [ ! -f glib-$GLIB_VERSION-done ] ; then
# While we're at it, suppress -Wformat-nonliteral to avoid a clang
# bug where it issues bogus warnings.
#
- if grep -qs '#define.*MACOSX' /usr/include/ffi/fficonfig.h
+ # First, determine where the system include files are. (It's not
+ # necessarily /usr/include.)
+ #
+ testfile=/tmp/test$$.c
+ trap "rm -f $testfile" 0
+ echo "#include <ffi/ffi.h>" > $testfile
+ includedir=`gcc -M $testfile | sed -n -e 's;[\\];;' -e 's/^ *//' -e 's/ *$//' -e 's;/ffi/ffi\.h;;p'`
+ rm -f $testfile
+ if grep -qs '#define.*MACOSX' $includedir/ffi/fficonfig.h
then
# It's defined, nothing to do
- CFLAGS="$CFLAGS -Wno-format-nonliteral" LIBFFI_CFLAGS="$CFLAGS -I/usr/include/ffi" LIBFFI_LIBS="$LDFLAGS -lffi" ./configure || exit 1
+ CFLAGS="$CFLAGS -Wno-format-nonliteral" LIBFFI_CFLAGS="$CFLAGS -I$includedir/ffi" LIBFFI_LIBS="$LDFLAGS -lffi" ./configure || exit 1
+ CFLAGS="$CFLAGS -Wno-format-nonliteral" LIBFFI_CFLAGS="$CFLAGS -I$includedir/ffi" LIBFFI_LIBS="$LDFLAGS -lffi" env | egrep LIBFFI_CFLAGS
else
- CFLAGS="$CFLAGS -DMACOSX -Wno-format-nonliteral" LIBFFI_CFLAGS="$CFLAGS -I/usr/include/ffi" LIBFFI_LIBS="LDFLAGS-lffi" ./configure || exit 1
+ CFLAGS="$CFLAGS -DMACOSX -Wno-format-nonliteral" LIBFFI_CFLAGS="$CFLAGS -I$includedir/ffi" LIBFFI_LIBS="LDFLAGS-lffi" ./configure || exit 1
+ CFLAGS="$CFLAGS -DMACOSX -Wno-format-nonliteral" LIBFFI_CFLAGS="$CFLAGS -I$includedir/ffi" LIBFFI_LIBS="LDFLAGS-lffi" env | egrep LIBFFI_CFLAGS
fi
make $MAKE_BUILD_OPTS || exit 1
# Apply patch: we depend on libffi, but pkg-config doesn't get told.
@@ -663,6 +673,11 @@ if [ "$PORTAUDIO_VERSION" -a ! -f portaudio-done ] ; then
#
patch -p0 include/pa_mac_core.h <../../macosx-support-lib-patches/portaudio-pa_mac_core.h.patch
#
+ # Fix a bug that showed up with clang (but is a bug with any
+ # compiler).
+ #
+ patch -p0 src/hostapi/coreaudio/pa_mac_core.c <../../macosx-support-lib-patches/portaudio-pa_mac_core.c.patch
+ #
# Disable fat builds - the configure script doesn't work right
# with Xcode 4 if you leave them enabled, and we don't build
# any other libraries fat (GLib, for example, would be very