# http://nplab.fh-muenster.de/groups/wiki/wiki/fb7a4/Building_Wireshark_on_SnowLeopard.html
#
-DARWIN_MAJOR_VERSION=`uname -r | sed 's/\([0-9]*\).*/\1/'`
+#
+# To set up a GTK3 environment
+GTK3=1
+# To build cmake
+# CMAKE=1
+#
+# To build all libraries as 32-bit libraries uncomment the following three lines.
+# export CFLAGS="$CFLAGS -arch i386"
+# export CXXFLAGS="$CXXFLAGS -arch i386"
+# export LDFLAGS="$LDFLAGS -arch i386"
+#
#
# Versions to download and install.
#
GEOIP_VERSION=1.4.8
+DARWIN_MAJOR_VERSION=`uname -r | sed 's/\([0-9]*\).*/\1/'`
+
#
# GNU autotools; they're provided with releases up to Snow Leopard, but
# not in later releases.
DO_RM="sudo rm"
fi
+#
+# If we have SDKs available, the default target OS is the major version
+# of the one we're running; get that and strip off the third component.
+#
+for i in /Developer/SDKs \
+ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
+ /Library/Developer/CommandLineTools/SDKs
+do
+ if [ -d "$i" ]
+ then
+ min_osx_target=`sw_vers -productVersion | sed 's/\([[0-9]]*\).\([[0-9]]*\).[[0-9]]*/\1.\2/'`
+ break
+ fi
+done
+
#
# Parse command-line flags:
#
exit 1
fi
-# To set up a GTK3 environment
-GTK3=1
-# To build cmake
-# CMAKE=1
-#
-# To build all libraries as 32-bit libraries uncomment the following three lines.
-# export CFLAGS="$CFLAGS -arch i386"
-# export CXXFLAGS="$CXXFLAGS -arch i386"
-# export LDFLAGS="$LDFLAGS -arch i386"
-#
-
# if no make options are present, set default options
if [ -z "$MAKE_BUILD_OPTS" ] ; then
# by default use 1.5x number of cores for parallel build
fi
#
-# Was a minimum target release specified?
+# If we have a target release, look for its SDK, and build libraries
+# against it rather than against the headers and, more importantly,
+# libraries that come with the OS, so that we don't end up with
+# support libraries that only work on the OS version on which
+# we built them, not earlier versions of the same release, or
+# earlier releases if the minimum is earlier.
#
if [ ! -z "$min_osx_target" ]
then
- #
- # Look for the SDK for that release, and build libraries against
- # it rather than against the headers and, more importantly,
- # libraries that come with the OS, so that we don't end up with
- # support libraries that only work on the OS version on which
- # we built them, not earlier versions of the same release, or
- # earlier releases if the minimum is earlier.
- #
for i in /Developer/SDKs \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
/Library/Developer/CommandLineTools/SDKs
# At least if building on Leopard, you might also find
# that, with various older versions of Cairo, including
# 1.6.4 and at least some 1.8.x versions, when you try to
- # build it, the build fails because it can't find
+ # build it, the build fails because it can't find
# png_set_longjmp_fn(). I vaguely remember dealing with that,
# ages ago, but don't remember what I did.
#
# just ignore unknown --enable/--disable and --with/--without
# options (at least they've always do so up to now).
#
- CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --disable-cups--without-libtiff --without-libjpeg || exit 1
+ CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --disable-cups --without-libtiff --without-libjpeg || exit 1
else
CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --without-libtiff --without-libjpeg || exit 1
fi