2 # Setup development environment on Mac OS X (tested with 10.6.8 and Xcode 3.2.6)
4 # Copyright 2011 Michael Tuexen, Joerg Mayer, Guy Harris (see AUTHORS file)
6 # Wireshark - Network traffic analyzer
7 # By Gerald Combs <gerald@wireshark.org>
8 # Copyright 1998 Gerald Combs
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # as published by the Free Software Foundation; either version 2
13 # of the License, or (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 # To install autotools
33 # To build all libraries as 32-bit libraries uncomment the following three lines.
35 # export CFLAGS="$CFLAGS -arch i386"
36 # export CXXFLAGS="$CXXFLAGS -arch i386"
37 # export LDFLAGS="$LDFLAGS -arch i386"
39 # and change "macx-clang" to "macx-clang-32" in the line below.
41 # Note: when building against the 10.6 SDK, clang fails, because there's
42 # a missing libstdc++.dylib in the SDK; this does not bother g++, however.
44 #TARGET_PLATFORM=macx-g++
45 TARGET_PLATFORM=macx-clang
48 # Versions of packages to download and install.
52 # Some packages need xz to unpack their current source.
53 # xz is not yet provided with OS X.
58 # In case we want to build with cmake.
60 CMAKE_VERSION=${CMAKE_VERSION-2.8.12.2}
63 # The following libraries and tools are required even to build only TShark.
65 GETTEXT_VERSION=0.18.2
67 PKG_CONFIG_VERSION=0.28
70 # One or more of the following libraries are required to build Wireshark.
72 # To override the versions of Qt and GTK call the script with some of the
73 # variables set to the new values. Setting a variable to empty will disable
74 # building the toolkit and will un-install any version previously installed
75 # by the script, e.g. "GTK_VERSION=3.5.2 QT_VERSION= ./macos-setup.sh"
76 # will build and install with GTK+ 3.5.2 and will not install Qt (and,
77 # if the script installed Qt earlier, will un-install that version of Qt).
79 # Note that Qt 5, prior to 5.5.0, mishandles context menus in ways that,
80 # for example, cause them not to work reliably in the packet detail or
81 # packet data pane; see, for example, Qt bugs QTBUG-31937, QTBUG-41017,
82 # and QTBUG-43464, all of which seem to be the same bug.
84 QT_VERSION=${QT_VERSION-5.5.0}
85 GTK_VERSION=${GTK_VERSION-2.24.17}
86 if [ "$GTK_VERSION" ]; then
88 # We'll be building GTK+, so we need some additional libraries.
90 GTK_MAJOR_VERSION="`expr $GTK_VERSION : '\([0-9][0-9]*\).*'`"
91 GTK_MINOR_VERSION="`expr $GTK_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
92 GTK_DOTDOT_VERSION="`expr $GTK_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
99 GDK_PIXBUF_VERSION=2.28.0
101 if [ "$QT_VERSION" ]; then
102 QT_MAJOR_VERSION="`expr $QT_VERSION : '\([0-9][0-9]*\).*'`"
103 QT_MINOR_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
104 QT_DOTDOT_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
105 QT_MAJOR_MINOR_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION
106 QT_MAJOR_MINOR_DOTDOT_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION.$QT_DOTDOT_VERSION
110 # The following libraries are optional.
111 # Comment them out if you don't want them, but note that some of
112 # the optional libraries are required by other optional libraries.
116 # libgpg-error is required for libgcrypt.
118 LIBGPG_ERROR_VERSION=1.10
120 # libgcrypt is required for GnuTLS.
122 LIBGCRYPT_VERSION=1.5.0
123 GNUTLS_VERSION=2.12.19
124 # Use 5.2.4, not 5.3, for now; lua_bitop.c hasn't been ported to 5.3
125 # yet, and we need to check for compatibility issues (we'd want Lua
126 # scripts to work with 5.1, 5.2, and 5.3, as long as they only use Lua
127 # features present in all three versions)
129 PORTAUDIO_VERSION=pa_stable_v19_20111121
132 # XXX - they appear to have an unversioned gzipped tarball for the
133 # current version; should we just download that, with some other
134 # way of specifying whether to download the GeoIP API?
142 NGHTTP2_VERSION=1.14.0
144 DARWIN_MAJOR_VERSION=`uname -r | sed 's/\([0-9]*\).*/\1/'`
147 # GNU autotools; they're provided with releases up to Snow Leopard, but
148 # not in later releases, and the Snow Leopard version is too old for
149 # current Wireshark, so we install them unconditionally.
151 AUTOCONF_VERSION=2.69
152 AUTOMAKE_VERSION=1.13.3
153 LIBTOOL_VERSION=2.4.6
156 if [ "$XZ_VERSION" -a ! -f xz-$XZ_VERSION-done ] ; then
157 echo "Downloading, building, and installing xz:"
158 [ -f xz-$XZ_VERSION.tar.bz2 ] || curl -O http://tukaani.org/xz/xz-$XZ_VERSION.tar.bz2 || exit 1
159 bzcat xz-$XZ_VERSION.tar.bz2 | tar xf - || exit 1
161 CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1
162 make $MAKE_BUILD_OPTS || exit 1
163 $DO_MAKE_INSTALL || exit 1
165 touch xz-$XZ_VERSION-done
170 if [ ! -z "$installed_xz_version" ] ; then
171 echo "Uninstalling xz:"
172 cd xz-$installed_xz_version
173 $DO_MAKE_UNINSTALL || exit 1
174 make distclean || exit 1
176 rm xz-$installed_xz_version-done
178 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
180 # Get rid of the previously downloaded and unpacked version.
182 rm -rf xz-$installed_xz_version
183 rm -rf xz-$installed_xz_version.tar.bz2
186 installed_xz_version=""
191 if [ "$SBC_VERSION" -a ! -f sbc-$SBC_VERSION-done ] ; then
192 echo "Downloading, building, and installing sbc:"
193 [ -f sbc-$SBC_VERSION.tar.gz ] || curl -O https://www.kernel.org/pub/linux/bluetooth/sbc-$SBC_VERSION.tar.gz || exit 1
194 gzcat sbc-$SBC_VERSION.tar.gz | tar xf - || exit 1
196 CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure --disable-tools --disable-tester --disable-shared || exit 1
197 make $MAKE_BUILD_OPTS || exit 1
198 $DO_MAKE_INSTALL || exit 1
200 touch sbc-$SBC_VERSION-done
205 if [ ! -z "$installed_sbc_version" ] ; then
206 echo "Uninstalling sbc:"
207 cd sbc-$installed_sbc_version
208 $DO_MAKE_UNINSTALL || exit 1
209 make distclean || exit 1
211 rm sbc-$installed_sbc_version-done
213 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
215 # Get rid of the previously downloaded and unpacked version.
217 rm -rf sbc-$installed_sbc_version
218 rm -rf sbc-$installed_sbc_version.tar.gz
221 installed_sbc_version=""
226 if [ "$AUTOCONF_VERSION" -a ! -f autoconf-$AUTOCONF_VERSION-done ] ; then
227 echo "Downloading, building and installing GNU autoconf..."
228 [ -f autoconf-$AUTOCONF_VERSION.tar.xz ] || curl -O ftp://ftp.gnu.org/gnu/autoconf/autoconf-$AUTOCONF_VERSION.tar.xz || exit 1
229 xzcat autoconf-$AUTOCONF_VERSION.tar.xz | tar xf - || exit 1
230 cd autoconf-$AUTOCONF_VERSION
231 ./configure || exit 1
232 make $MAKE_BUILD_OPTS || exit 1
233 $DO_MAKE_INSTALL || exit 1
235 touch autoconf-$AUTOCONF_VERSION-done
239 uninstall_autoconf() {
240 if [ ! -z "$installed_autoconf_version" ] ; then
242 # automake and libtool depend on this, so uninstall them.
247 echo "Uninstalling GNU autoconf:"
248 cd autoconf-$installed_autoconf_version
249 $DO_MAKE_UNINSTALL || exit 1
250 make distclean || exit 1
252 rm autoconf-$installed_autoconf_version-done
254 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
256 # Get rid of the previously downloaded and unpacked version.
258 rm -rf autoconf-$installed_autoconf_version
259 rm -rf autoconf-$installed_autoconf_version.tar.xz
262 installed_autoconf_version=""
267 if [ "$AUTOMAKE_VERSION" -a ! -f automake-$AUTOMAKE_VERSION-done ] ; then
268 echo "Downloading, building and installing GNU automake..."
269 [ -f automake-$AUTOMAKE_VERSION.tar.xz ] || curl -O ftp://ftp.gnu.org/gnu/automake/automake-$AUTOMAKE_VERSION.tar.xz || exit 1
270 xzcat automake-$AUTOMAKE_VERSION.tar.xz | tar xf - || exit 1
271 cd automake-$AUTOMAKE_VERSION
272 ./configure || exit 1
273 make $MAKE_BUILD_OPTS || exit 1
274 $DO_MAKE_INSTALL || exit 1
276 touch automake-$AUTOMAKE_VERSION-done
280 uninstall_automake() {
281 if [ ! -z "$installed_automake_version" ] ; then
283 # libtool depends on this(?), so uninstall it.
285 uninstall_libtool "$@"
287 echo "Uninstalling GNU automake:"
288 cd automake-$installed_automake_version
289 $DO_MAKE_UNINSTALL || exit 1
290 make distclean || exit 1
292 rm automake-$installed_automake_version-done
294 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
296 # Get rid of the previously downloaded and unpacked version.
298 rm -rf automake-$installed_automake_version
299 rm -rf automake-$installed_automake_version.tar.xz
302 installed_automake_version=""
307 if [ "$LIBTOOL_VERSION" -a ! -f libtool-$LIBTOOL_VERSION-done ] ; then
308 echo "Downloading, building and installing GNU libtool..."
309 [ -f libtool-$LIBTOOL_VERSION.tar.xz ] || curl -O ftp://ftp.gnu.org/gnu/libtool/libtool-$LIBTOOL_VERSION.tar.xz || exit 1
310 xzcat libtool-$LIBTOOL_VERSION.tar.xz | tar xf - || exit 1
311 cd libtool-$LIBTOOL_VERSION
312 ./configure || exit 1
313 make $MAKE_BUILD_OPTS || exit 1
314 $DO_MAKE_INSTALL || exit 1
315 $DO_MV /usr/local/bin/libtool /usr/local/bin/glibtool
316 $DO_MV /usr/local/bin/libtoolize /usr/local/bin/glibtoolize
318 touch libtool-$LIBTOOL_VERSION-done
322 uninstall_libtool() {
323 if [ ! -z "$installed_libtool_version" ] ; then
324 echo "Uninstalling GNU libtool:"
325 cd libtool-$installed_libtool_version
326 $DO_MV /usr/local/bin/glibtool /usr/local/bin/libtool
327 $DO_MV /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
328 $DO_MAKE_UNINSTALL || exit 1
329 make distclean || exit 1
331 rm libtool-$installed_libtool_version-done
333 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
335 # Get rid of the previously downloaded and unpacked version.
337 rm -rf libtool-$installed_libtool_version
338 rm -rf libtool-$installed_libtool_version.tar.xz
341 installed_libtool_version=""
346 if [ -n "$CMAKE" -a ! -f cmake-$CMAKE_VERSION-done ]; then
347 echo "Downloading and installing CMake:"
348 CMAKE_MAJOR_VERSION="`expr $CMAKE_VERSION : '\([0-9][0-9]*\).*'`"
349 CMAKE_MINOR_VERSION="`expr $CMAKE_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
350 CMAKE_DOTDOT_VERSION="`expr $CMAKE_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
351 CMAKE_MAJOR_MINOR_VERSION=$CMAKE_MAJOR_VERSION.$CMAKE_MINOR_VERSION
354 # NOTE: the "64" in "Darwin64" doesn't mean "64-bit-only"; the
355 # package in question supports both 32-bit and 64-bit x86.
357 case "$CMAKE_MAJOR_VERSION" in
360 echo "CMake $CMAKE_VERSION" is too old 1>&2
365 # Download the DMG, run the installer.
367 [ -f cmake-$CMAKE_VERSION-Darwin64-universal.dmg ] || curl -O https://cmake.org/files/v$CMAKE_MAJOR_MINOR_VERSION/cmake-$CMAKE_VERSION-Darwin64-universal.dmg || exit 1
368 sudo hdiutil attach cmake-$CMAKE_VERSION-Darwin64-universal.dmg || exit 1
369 sudo installer -target / -pkg /Volumes/cmake-$CMAKE_VERSION-Darwin64-universal/cmake-$CMAKE_VERSION-Darwin64-universal.pkg || exit 1
370 sudo hdiutil detach /Volumes/cmake-$CMAKE_VERSION-Darwin64-universal
375 # Download the DMG and do a drag install, where "drag" means
378 # 3.0.* and 3.1.0 have a Darwin64-universal DMG.
379 # 3.1.1 and later have a Darwin-x86_64 DMG.
380 # Probably not many people are still developing on 32-bit
381 # Macs, so we don't worry about them.
383 if [ "$CMAKE_MINOR_VERSION" = 0 -o \
384 "$CMAKE_VERSION" = 3.1.0 ]; then
385 type="Darwin64-universal"
389 [ -f cmake-$CMAKE_VERSION-$type.dmg ] || curl -O https://cmake.org/files/v$CMAKE_MAJOR_MINOR_VERSION/cmake-$CMAKE_VERSION-$type.dmg || exit 1
390 sudo hdiutil attach cmake-$CMAKE_VERSION-$type.dmg || exit 1
391 sudo ditto /Volumes/cmake-$CMAKE_VERSION-$type/CMake.app /Applications/CMake.app || exit 1
394 # Plant the appropriate symbolic links in /usr/local/bin.
395 # It's a drag-install, so there's no installer to make them,
396 # and the CMake code to put them in place is lame, as
398 # 1) it defaults to /usr/bin, not /usr/local/bin;
399 # 2) it doesn't request the necessary root privileges;
400 # 3) it can't be run from the command line;
402 # so we do it ourselves.
404 for i in ccmake cmake cmake-gui cmakexbuild cpack ctest
406 sudo ln -s /Applications/CMake.app/Contents/bin/$i /usr/local/bin/$i
408 sudo hdiutil detach /Volumes/cmake-$CMAKE_VERSION-$type
414 touch cmake-$CMAKE_VERSION-done
419 if [ ! -z "$installed_cmake_version" ]; then
420 echo "Uninstalling CMake:"
421 installed_cmake_major_version="`expr $installed_cmake_version : '\([0-9][0-9]*\).*'`"
422 case "$installed_cmake_major_version" in
425 echo "CMake $installed_cmake_version" is too old 1>&2
429 sudo rm -rf "/Applications/CMake "`echo "$installed_cmake_version" | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1.\2-\3/'`.app
430 for i in ccmake cmake cmake-gui cmakexbuild cpack ctest
432 sudo rm -f /usr/bin/$i /usr/local/bin/$i
434 sudo pkgutil --forget com.Kitware.CMake
435 rm cmake-$installed_cmake_version-done
439 sudo rm -rf /Applications/CMake.app
440 for i in ccmake cmake cmake-gui cmakexbuild cpack ctest
442 sudo rm -f /usr/local/bin/$i
444 rm cmake-$installed_cmake_version-done
448 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
450 # Get rid of the previously downloaded and unpacked version,
451 # whatever it might happen to be called.
453 rm -f cmake-$installed_cmake_version-Darwin64-universal.dmg
454 rm -f cmake-$installed_cmake_version-Darwin-x86_64.dmg
457 installed_cmake_version=""
462 if [ ! -f gettext-$GETTEXT_VERSION-done ] ; then
463 echo "Downloading, building, and installing GNU gettext:"
464 [ -f gettext-$GETTEXT_VERSION.tar.gz ] || curl -O http://ftp.gnu.org/pub/gnu/gettext/gettext-$GETTEXT_VERSION.tar.gz || exit 1
465 gzcat gettext-$GETTEXT_VERSION.tar.gz | tar xf - || exit 1
466 cd gettext-$GETTEXT_VERSION
467 CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0 $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
468 make $MAKE_BUILD_OPTS || exit 1
469 $DO_MAKE_INSTALL || exit 1
471 touch gettext-$GETTEXT_VERSION-done
475 uninstall_gettext() {
476 if [ ! -z "$installed_gettext_version" ] ; then
478 # GLib depends on this, so uninstall it.
482 echo "Uninstalling GNU gettext:"
483 cd gettext-$installed_gettext_version
484 $DO_MAKE_UNINSTALL || exit 1
485 make distclean || exit 1
487 rm gettext-$installed_gettext_version-done
489 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
491 # Get rid of the previously downloaded and unpacked version.
493 rm -rf gettext-$installed_gettext_version
494 rm -rf gettext-$installed_gettext_version.tar.gz
497 installed_gettext_version=""
501 install_pkg_config() {
502 if [ ! -f pkg-config-$PKG_CONFIG_VERSION-done ] ; then
503 echo "Downloading, building, and installing pkg-config:"
504 [ -f pkg-config-$PKG_CONFIG_VERSION.tar.gz ] || curl -O https://pkgconfig.freedesktop.org/releases/pkg-config-$PKG_CONFIG_VERSION.tar.gz || exit 1
505 gzcat pkg-config-$PKG_CONFIG_VERSION.tar.gz | tar xf - || exit 1
506 cd pkg-config-$PKG_CONFIG_VERSION
507 ./configure --with-internal-glib || exit 1
508 make $MAKE_BUILD_OPTS || exit 1
509 $DO_MAKE_INSTALL || exit 1
511 touch pkg-config-$PKG_CONFIG_VERSION-done
515 uninstall_pkg_config() {
516 if [ ! -z "$installed_pkg_config_version" ] ; then
517 echo "Uninstalling pkg-config:"
518 cd pkg-config-$installed_pkg_config_version
519 $DO_MAKE_UNINSTALL || exit 1
520 make distclean || exit 1
522 rm pkg-config-$installed_pkg_config_version-done
524 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
526 # Get rid of the previously downloaded and unpacked version.
528 rm -rf pkg-config-$installed_pkg_config_version
529 rm -rf pkg-config-$installed_pkg_config_version.tar.gz
532 installed_pkg_config_version=""
537 if [ ! -f glib-$GLIB_VERSION-done ] ; then
538 echo "Downloading, building, and installing GLib:"
539 glib_dir=`expr $GLIB_VERSION : '\([0-9][0-9]*\.[0-9][0-9]*\).*'`
540 GLIB_MAJOR_VERSION="`expr $GLIB_VERSION : '\([0-9][0-9]*\).*'`"
541 GLIB_MINOR_VERSION="`expr $GLIB_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
542 GLIB_DOTDOT_VERSION="`expr $GLIB_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
543 if [[ $GLIB_MAJOR_VERSION -gt 2 ||
544 $GLIB_MINOR_VERSION -gt 28 ||
545 ($GLIB_MINOR_VERSION -eq 28 && $GLIB_DOTDOT_VERSION -ge 8) ]]
548 # Starting with GLib 2.28.8, xz-compressed tarballs are available.
550 [ -f glib-$GLIB_VERSION.tar.xz ] || curl -L -O http://ftp.gnome.org/pub/gnome/sources/glib/$glib_dir/glib-$GLIB_VERSION.tar.xz || exit 1
551 xzcat glib-$GLIB_VERSION.tar.xz | tar xf - || exit 1
553 [ -f glib-$GLIB_VERSION.tar.bz2 ] || curl -L -O http://ftp.gnome.org/pub/gnome/sources/glib/$glib_dir/glib-$GLIB_VERSION.tar.bz2 || exit 1
554 bzcat glib-$GLIB_VERSION.tar.bz2 | tar xf - || exit 1
556 cd glib-$GLIB_VERSION
558 # OS X ships with libffi, but doesn't provide its pkg-config file;
559 # explicitly specify LIBFFI_CFLAGS and LIBFFI_LIBS, so the configure
560 # script doesn't try to use pkg-config to get the appropriate
561 # C flags and loader flags.
563 # And, what's worse, at least with the version of Xcode that comes
564 # with Leopard, /usr/include/ffi/fficonfig.h doesn't define MACOSX,
565 # which causes the build of GLib to fail. If we don't find
566 # "#define.*MACOSX" in /usr/include/ffi/fficonfig.h, explicitly
569 # While we're at it, suppress -Wformat-nonliteral to avoid a case
570 # where clang's stricter rules on when not to complain about
571 # non-literal format arguments cause it to complain about code
572 # that's safe but it wasn't told that. See my comment #25 in
575 # https://bugzilla.gnome.org/show_bug.cgi?id=691608#c25
577 # First, determine where the system include files are. (It's not
578 # necessarily /usr/include.) There's a bit of a greasy hack here;
579 # pre-5.x versions of the developer tools don't support the
580 # --show-sdk-path option, and will produce no output, so includedir
581 # will be set to /usr/include (in those older versions of the
582 # developer tools, there is a /usr/include directory).
584 includedir=`xcrun --show-sdk-path 2>/dev/null`/usr/include
585 if grep -qs '#define.*MACOSX' $includedir/ffi/fficonfig.h
587 # It's defined, nothing to do
588 LIBFFI_CFLAGS="-I $includedir/ffi" LIBFFI_LIBS="-lffi" CFLAGS="$CFLAGS -Wno-format-nonliteral $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS -Wno-format-nonliteral $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
590 LIBFFI_CFLAGS="-I $includedir/ffi" LIBFFI_LIBS="-lffi" CFLAGS="$CFLAGS -DMACOSX -Wno-format-nonliteral $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS -DMACOSX -Wno-format-nonliteral $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
594 # Apply the fix to GNOME bug 529806:
596 # https://bugzilla.gnome.org/show_bug.cgi?id=529806
598 # if we have a version of GLib prior to 2.30.
600 if [[ $GLIB_MAJOR_VERSION -eq 2 && $GLIB_MINOR_VERSION -le 30 ]]
602 patch -p0 <../../macosx-support-lib-patches/glib-gconvert.c.patch || exit 1
604 make $MAKE_BUILD_OPTS || exit 1
605 $DO_MAKE_INSTALL || exit 1
607 touch glib-$GLIB_VERSION-done
612 if [ ! -z "$installed_glib_version" ] ; then
614 # ATK, Pango, and GTK depend on this, so uninstall them.
620 echo "Uninstalling GLib:"
621 cd glib-$installed_glib_version
622 $DO_MAKE_UNINSTALL || exit 1
623 make distclean || exit 1
625 rm glib-$installed_glib_version-done
627 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
629 # Get rid of the previously downloaded and unpacked version.
631 rm -rf glib-$installed_glib_version
632 rm -rf glib-$installed_glib_version.tar.xz glib-$installed_glib_version.tar.bz2
635 installed_glib_version=""
640 if [ "$QT_VERSION" -a ! -f qt-$QT_VERSION-done ]; then
641 echo "Downloading, building, and installing Qt:"
643 # What you get for this URL might just be a 302 Found reply, so use
644 # -L so we get redirected.
646 if [ "$QT_MAJOR_VERSION" -ge 5 ]
648 QT_VOLUME=qt-opensource-mac-x64-clang-$QT_VERSION
650 QT_VOLUME=qt-opensource-mac-$QT_VERSION
652 [ -f $QT_VOLUME.dmg ] || curl -L -O http://download.qt.io/archive/qt/$QT_MAJOR_MINOR_VERSION/$QT_MAJOR_MINOR_DOTDOT_VERSION/$QT_VOLUME.dmg || exit 1
653 sudo hdiutil attach $QT_VOLUME.dmg || exit 1
655 if [ "$QT_MAJOR_VERSION" -ge 5 ]
658 # Run the installer executable directly, so that we wait for
659 # it to finish. Then unmount the volume.
661 /Volumes/$QT_VOLUME/$QT_VOLUME.app/Contents/MacOS/$QT_VOLUME
662 sudo hdiutil detach /Volumes/$QT_VOLUME
665 # Open the installer package; use -W, so that we wait for
666 # the installer to finish. Then unmount the volume.
668 open -W "/Volumes/Qt $QT_MAJOR_MINOR_DOTDOT_VERSION/Qt.mpkg"
669 sudo hdiutil detach "/Volumes/Qt $QT_MAJOR_MINOR_DOTDOT_VERSION"
673 # Versions 5.3.x through 5.5.0, at least, have bogus .pc files.
674 # See bugs QTBUG-35256 and QTBUG-47162.
678 for i in $HOME/Qt$QT_VERSION/$QT_MAJOR_MINOR_VERSION/clang_64/lib/pkgconfig/*.pc
682 g/Cflags: /s;;Cflags: -F\${libdir} ;
683 g/Cflags: /s;-I\${includedir}/Qt\([a-zA-Z0-9_]*\);-I\${libdir}/Qt\1.framework/Versions/5/Headers;
689 touch qt-$QT_VERSION-done
694 if [ ! -z "$installed_qt_version" ] ; then
695 echo "Uninstalling Qt:"
696 rm -rf $HOME/Qt$installed_qt_version
697 rm qt-$installed_qt_version-done
699 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
701 # Get rid of the previously downloaded version.
703 rm -rf qt-opensource-mac-x64-clang-$installed_qt_version.dmg
706 installed_qt_version=""
711 if [ ! -f libpng-$PNG_VERSION-done ] ; then
712 echo "Downloading, building, and installing libpng:"
714 # The FTP site puts libpng x.y.* into a libpngxy directory.
716 subdir=`echo $PNG_VERSION | sed 's/\([1-9][0-9]*\)\.\([1-9][0-9]*\).*/libpng\1\2'/`
717 [ -f libpng-$PNG_VERSION.tar.xz ] || curl -O ftp://ftp.simplesystems.org/pub/libpng/png/src/$subdir/libpng-$PNG_VERSION.tar.xz
718 xzcat libpng-$PNG_VERSION.tar.xz | tar xf - || exit 1
719 cd libpng-$PNG_VERSION
720 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
721 make $MAKE_BUILD_OPTS || exit 1
722 $DO_MAKE_INSTALL || exit 1
724 touch libpng-$PNG_VERSION-done
729 if [ ! -z "$installed_libpng_version" ] ; then
731 # Cairo depends on this, so uninstall it.
735 echo "Uninstalling libpng:"
736 cd libpng-$installed_libpng_version
737 $DO_MAKE_UNINSTALL || exit 1
738 make distclean || exit 1
740 rm libpng-$installed_libpng_version-done
742 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
744 # Get rid of the previously downloaded and unpacked version.
746 rm -rf libpng-$installed_libpng_version
747 rm -rf libpng-$installed_libpng_version.tar.xz
750 installed_libpng_version=""
755 if [ ! -f pixman-$PIXMAN_VERSION-done ] ; then
756 echo "Downloading, building, and installing pixman:"
757 [ -f pixman-$PIXMAN_VERSION.tar.gz ] || curl -O http://www.cairographics.org/releases/pixman-$PIXMAN_VERSION.tar.gz
758 gzcat pixman-$PIXMAN_VERSION.tar.gz | tar xf - || exit 1
759 cd pixman-$PIXMAN_VERSION
760 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
761 make $MAKE_BUILD_OPTS || exit 1
762 $DO_MAKE_INSTALL || exit 1
764 touch pixman-$PIXMAN_VERSION-done
769 if [ ! -z "$installed_pixman_version" ] ; then
771 # Cairo depends on this, so uninstall it.
775 echo "Uninstalling pixman:"
776 cd pixman-$installed_pixman_version
777 $DO_MAKE_UNINSTALL || exit 1
778 make distclean || exit 1
780 rm pixman-$installed_pixman_version-done
782 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
784 # Get rid of the previously downloaded and unpacked version.
786 rm -rf pixman-$installed_pixman_version
787 rm -rf pixman-$installed_pixman_version.tar.gz
790 installed_pixman_version=""
795 if [ ! -f cairo-$CAIRO_VERSION-done ] ; then
796 echo "Downloading, building, and installing Cairo:"
797 CAIRO_MAJOR_VERSION="`expr $CAIRO_VERSION : '\([0-9][0-9]*\).*'`"
798 CAIRO_MINOR_VERSION="`expr $CAIRO_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
799 CAIRO_DOTDOT_VERSION="`expr $CAIRO_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
800 if [[ $CAIRO_MAJOR_VERSION -gt 1 ||
801 $CAIRO_MINOR_VERSION -gt 12 ||
802 ($CAIRO_MINOR_VERSION -eq 12 && $CAIRO_DOTDOT_VERSION -ge 2) ]]
805 # Starting with Cairo 1.12.2, the tarballs are compressed with
806 # xz rather than gzip.
808 [ -f cairo-$CAIRO_VERSION.tar.xz ] || curl -O http://cairographics.org/releases/cairo-$CAIRO_VERSION.tar.xz || exit 1
809 xzcat cairo-$CAIRO_VERSION.tar.xz | tar xf - || exit 1
811 [ -f cairo-$CAIRO_VERSION.tar.gz ] || curl -O http://cairographics.org/releases/cairo-$CAIRO_VERSION.tar.gz || exit 1
812 gzcat cairo-$CAIRO_VERSION.tar.gz | tar xf - || exit 1
814 cd cairo-$CAIRO_VERSION
815 # CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --enable-quartz=no || exit 1
816 # Maybe follow http://cairographics.org/end_to_end_build_for_mac_os_x/
817 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --enable-quartz=yes || exit 1
819 # We must avoid the version of libpng that comes with X11; the
820 # only way I've found to force that is to forcibly set INCLUDES
821 # when we do the build, so that this comes before CAIRO_CFLAGS,
822 # which has -I/usr/X11/include added to it before anything
823 # connected to libpng is.
825 INCLUDES="-I/usr/local/include/libpng15" make $MAKE_BUILD_OPTS || exit 1
826 $DO_MAKE_INSTALL || exit 1
828 touch cairo-$CAIRO_VERSION-done
833 if [ ! -z "$installed_cairo_version" ] ; then
835 # GTK+ depends on this, so uninstall it.
839 echo "Uninstalling Cairo:"
840 cd cairo-$installed_cairo_version
841 $DO_MAKE_UNINSTALL || exit 1
842 make distclean || exit 1
844 rm cairo-$installed_cairo_version-done
846 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
848 # Get rid of the previously downloaded and unpacked version.
850 rm -rf cairo-$installed_cairo_version
851 rm -rf cairo-$installed_cairo_version.tar.xz cairo-$installed_cairo_version.tar.gz
854 installed_cairo_version=""
859 if [ ! -f atk-$ATK_VERSION-done ] ; then
860 echo "Downloading, building, and installing ATK:"
861 atk_dir=`expr $ATK_VERSION : '\([0-9][0-9]*\.[0-9][0-9]*\).*'`
862 ATK_MAJOR_VERSION="`expr $ATK_VERSION : '\([0-9][0-9]*\).*'`"
863 ATK_MINOR_VERSION="`expr $ATK_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
864 ATK_DOTDOT_VERSION="`expr $ATK_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
865 if [[ $ATK_MAJOR_VERSION -gt 2 ||
866 ($ATK_MAJOR_VERSION -eq 2 && $ATK_MINOR_VERSION -gt 0) ||
867 ($ATK_MANOR_VERSION -eq 2 && $ATK_MINOR_VERSION -eq 0 && $ATK_DOTDOT_VERSION -ge 1) ]]
870 # Starting with ATK 2.0.1, xz-compressed tarballs are available.
872 [ -f atk-$ATK_VERSION.tar.xz ] || curl -O http://ftp.gnome.org/pub/gnome/sources/atk/$atk_dir/atk-$ATK_VERSION.tar.xz || exit 1
873 xzcat atk-$ATK_VERSION.tar.xz | tar xf - || exit 1
875 [ -f atk-$ATK_VERSION.tar.bz2 ] || curl -O http://ftp.gnome.org/pub/gnome/sources/atk/$atk_dir/atk-$ATK_VERSION.tar.bz2 || exit 1
876 bzcat atk-$ATK_VERSION.tar.bz2 | tar xf - || exit 1
879 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
880 make $MAKE_BUILD_OPTS || exit 1
881 $DO_MAKE_INSTALL || exit 1
883 touch atk-$ATK_VERSION-done
888 if [ ! -z "$installed_atk_version" ] ; then
890 # GTK+ depends on this, so uninstall it.
894 echo "Uninstalling ATK:"
895 cd atk-$installed_atk_version
896 $DO_MAKE_UNINSTALL || exit 1
897 make distclean || exit 1
899 rm atk-$installed_atk_version-done
901 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
903 # Get rid of the previously downloaded and unpacked version.
905 rm -rf atk-$installed_atk_version
906 rm -rf atk-$installed_atk_version.tar.xz atk-$installed_atk_version.tar.bz2
909 installed_atk_version=""
914 if [ ! -f pango-$PANGO_VERSION-done ] ; then
915 echo "Downloading, building, and installing Pango:"
916 pango_dir=`expr $PANGO_VERSION : '\([0-9][0-9]*\.[0-9][0-9]*\).*'`
917 PANGO_MAJOR_VERSION="`expr $PANGO_VERSION : '\([0-9][0-9]*\).*'`"
918 PANGO_MINOR_VERSION="`expr $PANGO_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
919 if [[ $PANGO_MAJOR_VERSION -gt 1 ||
920 $PANGO_MINOR_VERSION -ge 29 ]]
923 # Starting with Pango 1.29, the tarballs are compressed with
924 # xz rather than bzip2.
926 [ -f pango-$PANGO_VERSION.tar.xz ] || curl -L -O http://ftp.gnome.org/pub/gnome/sources/pango/$pango_dir/pango-$PANGO_VERSION.tar.xz || exit 1
927 xzcat pango-$PANGO_VERSION.tar.xz | tar xf - || exit 1
929 [ -f pango-$PANGO_VERSION.tar.bz2 ] || curl -L -O http://ftp.gnome.org/pub/gnome/sources/pango/$pango_dir/pango-$PANGO_VERSION.tar.bz2 || exit 1
930 bzcat pango-$PANGO_VERSION.tar.bz2 | tar xf - || exit 1
932 cd pango-$PANGO_VERSION
933 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
934 make $MAKE_BUILD_OPTS || exit 1
935 $DO_MAKE_INSTALL || exit 1
937 touch pango-$PANGO_VERSION-done
942 if [ ! -z "$installed_pango_version" ] ; then
944 # GTK+ depends on this, so uninstall it.
948 echo "Uninstalling Pango:"
949 cd pango-$installed_pango_version
950 $DO_MAKE_UNINSTALL || exit 1
951 make distclean || exit 1
953 rm pango-$installed_pango_version-done
955 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
957 # Get rid of the previously downloaded and unpacked version.
959 rm -rf pango-$installed_pango_version
960 rm -rf pango-$installed_pango_version.tar.xz pango-$installed_pango_version.tar.bz2
963 installed_pango_version=""
967 install_gdk_pixbuf() {
968 if [ "$GDK_PIXBUF_VERSION" -a ! -f gdk-pixbuf-$GDK_PIXBUF_VERSION-done ] ; then
969 echo "Downloading, building, and installing gdk-pixbuf:"
970 gdk_pixbuf_dir=`expr $GDK_PIXBUF_VERSION : '\([0-9][0-9]*\.[0-9][0-9]*\).*'`
971 [ -f gdk-pixbuf-$GDK_PIXBUF_VERSION.tar.xz ] || curl -L -O http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/$gdk_pixbuf_dir/gdk-pixbuf-$GDK_PIXBUF_VERSION.tar.xz || exit 1
972 xzcat gdk-pixbuf-$GDK_PIXBUF_VERSION.tar.xz | tar xf - || exit 1
973 cd gdk-pixbuf-$GDK_PIXBUF_VERSION
975 # If we're building using the 10.6 SDK, force the use of libpng12.
977 # The OS's X11, and corresponding SDK, didn't introduce libpng15,
978 # or pkg-config files, until 10.7, so, for 10.6 have to explicitly
979 # set LIBPNG to override the configure script, and also force the
980 # CFLAGS to look for the header files for libpng12 (note that
981 # -isysroot doesn't affect the arguments to -I, so we need to
982 # include the SDK path explicitly).
984 if [[ "$sdk_target" = 10.6 ]]
986 LIBPNG="-L/usr/X11/lib -lpng12" CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS -I$SDKPATH/usr/X11/include/libpng12" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS -I$SDKPATH/usr/X11/include/libpng12" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --without-libtiff --without-libjpeg || exit 1
988 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --without-libtiff --without-libjpeg || exit 1
990 make $MAKE_BUILD_OPTS || exit 1
991 $DO_MAKE_INSTALL || exit 1
993 touch gdk-pixbuf-$GDK_PIXBUF_VERSION-done
997 uninstall_gdk_pixbuf() {
998 if [ ! -z "$installed_gdk_pixbuf_version" ] ; then
1000 # GTK+ depends on this, so uninstall it.
1004 echo "Uninstalling gdk-pixbuf:"
1005 cd gdk-pixbuf-$installed_gdk_pixbuf_version
1006 $DO_MAKE_UNINSTALL || exit 1
1007 make distclean || exit 1
1009 rm gdk-pixbuf-$installed_gdk_pixbuf_version-done
1011 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1013 # Get rid of the previously downloaded and unpacked version.
1015 rm -rf gdk-pixbuf-$installed_gdk_pixbuf_version
1016 rm -rf gdk-pixbuf-$installed_gdk_pixbuf_version.tar.xz
1019 installed_gdk_pixbuf_version=""
1024 if [ ! -f gtk+-$GTK_VERSION-done ] ; then
1025 echo "Downloading, building, and installing GTK+:"
1026 gtk_dir=`expr $GTK_VERSION : '\([0-9][0-9]*\.[0-9][0-9]*\).*'`
1027 if [[ $GTK_MAJOR_VERSION -gt 2 ||
1028 $GTK_MINOR_VERSION -gt 24 ||
1029 ($GTK_MINOR_VERSION -eq 24 && $GTK_DOTDOT_VERSION -ge 5) ]]
1032 # Starting with GTK+ 2.24.5, the tarballs are compressed with
1033 # xz rather than gzip, in addition to bzip2; use xz, as we've
1034 # built and installed it, and as xz compresses better than
1035 # bzip2 so the tarballs take less time to download.
1037 [ -f gtk+-$GTK_VERSION.tar.xz ] || curl -L -O http://ftp.gnome.org/pub/gnome/sources/gtk+/$gtk_dir/gtk+-$GTK_VERSION.tar.xz || exit 1
1038 xzcat gtk+-$GTK_VERSION.tar.xz | tar xf - || exit 1
1040 [ -f gtk+-$GTK_VERSION.tar.bz2 ] || curl -L -O http://ftp.gnome.org/pub/gnome/sources/gtk+/$gtk_dir/gtk+-$GTK_VERSION.tar.bz2 || exit 1
1041 bzcat gtk+-$GTK_VERSION.tar.bz2 | tar xf - || exit 1
1043 cd gtk+-$GTK_VERSION
1044 if [ $DARWIN_MAJOR_VERSION -ge "12" ]
1047 # GTK+ 2.24.10, at least, doesn't build on Mountain Lion with the
1048 # CUPS printing backend - either the CUPS API changed incompatibly
1049 # or the backend was depending on non-API implementation details.
1051 # Configure it out, on Mountain Lion and later, for now.
1052 # (12 is the Darwin major version number in Mountain Lion.)
1054 # Also, configure out libtiff and libjpeg; configure scripts
1055 # just ignore unknown --enable/--disable and --with/--without
1056 # options (at least they've always do so up to now).
1058 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --disable-cups --without-libtiff --without-libjpeg || exit 1
1060 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --without-libtiff --without-libjpeg || exit 1
1062 make $MAKE_BUILD_OPTS || exit 1
1063 $DO_MAKE_INSTALL || exit 1
1065 touch gtk+-$GTK_VERSION-done
1070 if [ ! -z "$installed_gtk_version" ] ; then
1071 echo "Uninstalling GTK+:"
1072 cd gtk+-$installed_gtk_version
1073 $DO_MAKE_UNINSTALL || exit 1
1074 make distclean || exit 1
1076 rm gtk+-$installed_gtk_version-done
1078 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1080 # Get rid of the previously downloaded and unpacked version.
1082 rm -rf gtk+-$installed_gtk_version
1083 rm -rf gtk+-$installed_gtk_version.tar.xz gtk+-$installed_gtk_version.tar.bz2
1086 installed_gtk_version=""
1091 if [ "$LIBSMI_VERSION" -a ! -f libsmi-$LIBSMI_VERSION-done ] ; then
1092 echo "Downloading, building, and installing libsmi:"
1093 [ -f libsmi-$LIBSMI_VERSION.tar.gz ] || curl -L -O https://www.ibr.cs.tu-bs.de/projects/libsmi/download/libsmi-$LIBSMI_VERSION.tar.gz || exit 1
1094 gzcat libsmi-$LIBSMI_VERSION.tar.gz | tar xf - || exit 1
1095 cd libsmi-$LIBSMI_VERSION
1096 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
1097 make $MAKE_BUILD_OPTS || exit 1
1098 $DO_MAKE_INSTALL || exit 1
1100 touch libsmi-$LIBSMI_VERSION-done
1104 uninstall_libsmi() {
1105 if [ ! -z "$installed_libsmi_version" ] ; then
1106 echo "Uninstalling libsmi:"
1107 cd libsmi-$installed_libsmi_version
1108 $DO_MAKE_UNINSTALL || exit 1
1109 make distclean || exit 1
1111 rm libsmi-$installed_libsmi_version-done
1113 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1115 # Get rid of the previously downloaded and unpacked version.
1117 rm -rf libsmi-$installed_libsmi_version
1118 rm -rf libsmi-$installed_libsmi_version.tar.gz
1121 installed_libsmi_version=""
1125 install_libgpg_error() {
1126 if [ "$LIBGPG_ERROR_VERSION" -a ! -f libgpg-error-$LIBGPG_ERROR_VERSION-done ] ; then
1127 echo "Downloading, building, and installing libgpg-error:"
1128 [ -f libgpg-error-$LIBGPG_ERROR_VERSION.tar.bz2 ] || curl -L -O ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-$LIBGPG_ERROR_VERSION.tar.bz2 || exit 1
1129 bzcat libgpg-error-$LIBGPG_ERROR_VERSION.tar.bz2 | tar xf - || exit 1
1130 cd libgpg-error-$LIBGPG_ERROR_VERSION
1131 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
1132 make $MAKE_BUILD_OPTS || exit 1
1133 $DO_MAKE_INSTALL || exit 1
1135 touch libgpg-error-$LIBGPG_ERROR_VERSION-done
1139 uninstall_libgpg_error() {
1140 if [ ! -z "$installed_libgpg_error_version" ] ; then
1142 # libgcrypt depends on this, so uninstall it.
1144 uninstall_libgcrypt "$@"
1146 echo "Uninstalling libgpg-error:"
1147 cd libgpg-error-$installed_libgpg_error_version
1148 $DO_MAKE_UNINSTALL || exit 1
1149 make distclean || exit 1
1151 rm libgpg-error-$installed_libgpg_error_version-done
1153 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1155 # Get rid of the previously downloaded and unpacked version.
1157 rm -rf libgpg-error-$installed_libgpg_error_version
1158 rm -rf libgpg-error-$installed_libgpg_error_version.tar.bz2
1161 installed_libgpg_error_version=""
1165 install_libgcrypt() {
1166 if [ "$LIBGCRYPT_VERSION" -a ! -f libgcrypt-$LIBGCRYPT_VERSION-done ] ; then
1168 # libgpg-error is required for libgcrypt.
1170 if [ -z $LIBGPG_ERROR_VERSION ]
1172 echo "libgcrypt requires libgpg-error, but you didn't install libgpg-error." 1>&2
1176 echo "Downloading, building, and installing libgcrypt:"
1177 [ -f libgcrypt-$LIBGCRYPT_VERSION.tar.gz ] || curl -L -O ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-$LIBGCRYPT_VERSION.tar.gz || exit 1
1178 gzcat libgcrypt-$LIBGCRYPT_VERSION.tar.gz | tar xf - || exit 1
1179 cd libgcrypt-$LIBGCRYPT_VERSION
1181 # The assembler language code is not compatible with the OS X
1182 # x86 assembler (or is it an x86-64 vs. x86-32 issue?).
1184 # libgcrypt expects gnu89, not c99/gnu99, semantics for
1185 # "inline". See, for example:
1187 # http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2010-October/198809.html
1189 CFLAGS="$CFLAGS -std=gnu89 $VERSION_MIN_FLAGS $SDKFLAGS" CFLAGS="$CFLAGS -std=gnu89 $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --disable-asm || exit 1
1190 make $MAKE_BUILD_OPTS || exit 1
1191 $DO_MAKE_INSTALL || exit 1
1193 touch libgcrypt-$LIBGCRYPT_VERSION-done
1197 uninstall_libgcrypt() {
1198 if [ ! -z "$installed_libgcrypt_version" ] ; then
1200 # GnuTLS depends on this, so uninstall it.
1202 uninstall_gnutls "$@"
1204 echo "Uninstalling libgcrypt:"
1205 cd libgcrypt-$installed_libgcrypt_version
1206 $DO_MAKE_UNINSTALL || exit 1
1207 make distclean || exit 1
1209 rm libgcrypt-$installed_libgcrypt_version-done
1211 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1213 # Get rid of the previously downloaded and unpacked version.
1215 rm -rf libgcrypt-$installed_libgcrypt_version
1216 rm -rf libgcrypt-$installed_libgcrypt_version.tar.gz
1219 installed_libgcrypt_version=""
1224 if [ "$GNUTLS_VERSION" -a ! -f gnutls-$GNUTLS_VERSION-done ] ; then
1226 # GnuTLS requires libgcrypt (or nettle, in newer versions).
1228 if [ -z $LIBGCRYPT_VERSION ]
1230 echo "GnuTLS requires libgcrypt, but you didn't install libgcrypt" 1>&2
1234 echo "Downloading, building, and installing GnuTLS:"
1235 [ -f gnutls-$GNUTLS_VERSION.tar.bz2 ] || curl -L -O http://ftp.gnu.org/gnu/gnutls/gnutls-$GNUTLS_VERSION.tar.bz2 || exit 1
1236 bzcat gnutls-$GNUTLS_VERSION.tar.bz2 | tar xf - || exit 1
1237 cd gnutls-$GNUTLS_VERSION
1239 # Use libgcrypt, not nettle.
1240 # XXX - is there some reason to prefer nettle? Or does
1241 # Wireshark directly use libgcrypt routines?
1243 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --with-libgcrypt --without-p11-kit || exit 1
1244 make $MAKE_BUILD_OPTS || exit 1
1246 # The pkgconfig file for GnuTLS says "requires zlib", but OS X,
1247 # while it supplies zlib, doesn't supply a pkgconfig file for
1250 # Patch the GnuTLS pkgconfig file not to require zlib.
1251 # (If the capabilities of GnuTLS that Wireshark uses don't
1252 # depend on building GnuTLS with zlib, an alternative would be
1253 # to configure it not to use zlib.)
1255 patch -p0 lib/gnutls.pc.in <../../macosx-support-lib-patches/gnutls-pkgconfig.patch || exit 1
1256 $DO_MAKE_INSTALL || exit 1
1258 touch gnutls-$GNUTLS_VERSION-done
1262 uninstall_gnutls() {
1263 if [ ! -z "$installed_gnutls_version" ] ; then
1264 echo "Uninstalling GnuTLS:"
1265 cd gnutls-$installed_gnutls_version
1266 $DO_MAKE_UNINSTALL || exit 1
1267 make distclean || exit 1
1269 rm gnutls-$installed_gnutls_version-done
1271 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1273 # Get rid of the previously downloaded and unpacked version.
1275 rm -rf gnutls-$installed_gnutls_version
1276 rm -rf gnutls-$installed_gnutls_version.tar.bz2
1279 installed_gnutls_version=""
1284 if [ "$LUA_VERSION" -a ! -f lua-$LUA_VERSION-done ] ; then
1285 echo "Downloading, building, and installing Lua:"
1286 [ -f lua-$LUA_VERSION.tar.gz ] || curl -L -O http://www.lua.org/ftp/lua-$LUA_VERSION.tar.gz || exit 1
1287 gzcat lua-$LUA_VERSION.tar.gz | tar xf - || exit 1
1289 make MYCFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" MYLDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" $MAKE_BUILD_OPTS macosx || exit 1
1290 $DO_MAKE_INSTALL || exit 1
1292 touch lua-$LUA_VERSION-done
1297 if [ ! -z "$installed_lua_version" ] ; then
1298 echo "Uninstalling Lua:"
1300 # Lua has no "make uninstall", so just remove stuff manually.
1301 # There's no configure script, so there's no need for
1302 # "make distclean", either; just do "make clean".
1304 (cd /usr/local/bin; $DO_RM -f lua luac)
1305 (cd /usr/local/include; $DO_RM -f lua.h luaconf.h lualib.h lauxlib.h lua.hpp)
1306 (cd /usr/local/lib; $DO_RM -f liblua.a)
1307 (cd /usr/local/man/man1; $DO_RM -f lua.1 luac.1)
1308 cd lua-$installed_lua_version
1309 make clean || exit 1
1311 rm lua-$installed_lua_version-done
1313 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1315 # Get rid of the previously downloaded and unpacked version.
1317 rm -rf lua-$installed_lua_version
1318 rm -rf lua-$installed_lua_version.tar.gz
1321 installed_lua_version=""
1325 install_portaudio() {
1327 # Check for both the old versionless portaudio-done and the new
1328 # versioned -done file.
1330 if [ "$PORTAUDIO_VERSION" -a ! -f portaudio-$PORTAUDIO_VERSION-done ] ; then
1331 echo "Downloading, building, and installing PortAudio:"
1332 [ -f $PORTAUDIO_VERSION.tgz ] || curl -L -O http://www.portaudio.com/archives/$PORTAUDIO_VERSION.tgz || exit 1
1333 gzcat $PORTAUDIO_VERSION.tgz | tar xf - || exit 1
1336 # Un-comment an include that's required on Lion.
1338 patch -p0 include/pa_mac_core.h <../../macosx-support-lib-patches/portaudio-pa_mac_core.h.patch
1340 # Fix a bug that showed up with clang (but is a bug with any
1343 patch -p0 src/hostapi/coreaudio/pa_mac_core.c <../../macosx-support-lib-patches/portaudio-pa_mac_core.c.patch
1345 # Disable fat builds - the configure script doesn't work right
1346 # with Xcode 4 if you leave them enabled, and we don't build
1347 # any other libraries fat (GLib, for example, would be very
1348 # hard to build fat), so there's no advantage to having PortAudio
1351 # Set the minimum OS X version to 10.4, to suppress some
1352 # deprecation warnings. (Good luck trying to make any of
1353 # this build on an OS+Xcode with a pre-10.4 SDK; we don't
1354 # worry about the user requesting that.)
1356 # Explicitly disable deprecation, so the damn thing will build
1357 # on El Capitan with Xcode 7.
1359 CFLAGS="$CFLAGS -Wno-deprecated-declarations -mmacosx-version-min=10.4 $SDKFLAGS" CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.4 $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --disable-mac-universal || exit 1
1360 make $MAKE_BUILD_OPTS || exit 1
1361 $DO_MAKE_INSTALL || exit 1
1363 touch portaudio-$PORTAUDIO_VERSION-done
1367 uninstall_portaudio() {
1368 if [ ! -z "$installed_portaudio_version" ] ; then
1369 echo "Uninstalling PortAudio:"
1371 $DO_MAKE_UNINSTALL || exit 1
1372 make distclean || exit 1
1374 rm portaudio-$installed_portaudio_version-done
1376 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1378 # Get rid of the previously downloaded and unpacked version.
1381 rm -rf $installed_portaudio_version.tgz
1384 installed_portaudio_version=""
1389 if [ "$GEOIP_VERSION" -a ! -f geoip-$GEOIP_VERSION-done ] ; then
1390 echo "Downloading, building, and installing GeoIP API:"
1391 [ -f GeoIP-$GEOIP_VERSION.tar.gz ] || curl -L -O http://geolite.maxmind.com/download/geoip/api/c/GeoIP-$GEOIP_VERSION.tar.gz || exit 1
1392 gzcat GeoIP-$GEOIP_VERSION.tar.gz | tar xf - || exit 1
1393 cd GeoIP-$GEOIP_VERSION
1394 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
1396 # Grr. Their man pages "helpfully" have an ISO 8859-1
1397 # copyright symbol in the copyright notice, but OS X's
1398 # default character encoding is UTF-8. sed on Mountain
1399 # Lion barfs at the "illegal character sequence" represented
1400 # by an ISO 8859-1 copyright symbol, as it's not a valid
1403 # iconv the relevant man pages into UTF-8.
1405 for i in geoipupdate.1.in geoiplookup6.1.in geoiplookup.1.in
1407 iconv -f iso8859-1 -t utf-8 man/"$i" >man/"$i".tmp &&
1408 mv man/"$i".tmp man/"$i"
1410 make $MAKE_BUILD_OPTS || exit 1
1411 $DO_MAKE_INSTALL || exit 1
1413 touch geoip-$GEOIP_VERSION-done
1418 if [ ! -z "$installed_geoip_version" ] ; then
1419 echo "Uninstalling GeoIP API:"
1420 cd GeoIP-$installed_geoip_version
1421 $DO_MAKE_UNINSTALL || exit 1
1422 make distclean || exit 1
1424 rm geoip-$installed_geoip_version-done
1426 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1428 # Get rid of the previously downloaded and unpacked version.
1430 rm -rf GeoIP-$installed_geoip_version
1431 rm -rf GeoIP-$installed_geoip_version.tar.gz
1434 installed_geoip_version=""
1439 if [ "$CARES_VERSION" -a ! -f c-ares-$CARES_VERSION-done ] ; then
1440 echo "Downloading, building, and installing C-Ares API:"
1441 [ -f c-ares-$CARES_VERSION.tar.gz ] || curl -L -O https://c-ares.haxx.se/download/c-ares-$CARES_VERSION.tar.gz || exit 1
1442 gzcat c-ares-$CARES_VERSION.tar.gz | tar xf - || exit 1
1443 cd c-ares-$CARES_VERSION
1444 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
1445 make $MAKE_BUILD_OPTS || exit 1
1446 $DO_MAKE_INSTALL || exit 1
1448 touch c-ares-$CARES_VERSION-done
1452 uninstall_c_ares() {
1453 if [ ! -z "$installed_cares_version" ] ; then
1454 echo "Uninstalling C-Ares API:"
1455 cd c-ares-$installed_cares_version
1456 $DO_MAKE_UNINSTALL || exit 1
1457 make distclean || exit 1
1459 rm c-ares-$installed_cares_version-done
1461 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1463 # Get rid of the previously downloaded and unpacked version.
1465 rm -rf c-ares-$installed_cares_version
1466 rm -rf c-ares-$installed_cares_version.tar.gz
1469 installed_cares_version=""
1474 if [ "$LIBSSH_VERSION" -a ! -f libssh-$LIBSSH_VERSION-done ] ; then
1475 echo "Downloading, building, and installing libssh:"
1476 [ -f libssh-$LIBSSH_VERSION.tar.xz ] || curl -L -O https://red.libssh.org/attachments/download/177/libssh-$LIBSSH_VERSION.tar.xz || exit 1
1477 xzcat libssh-$LIBSSH_VERSION.tar.xz | tar xf - || exit 1
1478 cd libssh-$LIBSSH_VERSION
1481 CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" cmake -DWITH_GCRYPT=1 ../ || exit 1
1482 make $MAKE_BUILD_OPTS || exit 1
1483 $DO_MAKE_INSTALL || exit 1
1485 touch libssh-$LIBSSH_VERSION-done
1489 uninstall_libssh() {
1490 if [ ! -z "$installed_libssh_version" ] ; then
1491 echo "Uninstalling libssh:"
1492 cd libssh-$installed_libssh_version
1493 $DO_MAKE_UNINSTALL || exit 1
1494 make distclean || exit 1
1496 rm libssh-$installed_libssh_version-done
1498 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1500 # Get rid of the previously downloaded and unpacked version.
1502 rm -rf libssh-$installed_libssh_version
1503 rm -rf libssh-$installed_libssh_version.tar.xz
1506 installed_libssh_version=""
1511 if [ "$NGHTTP2_VERSION" -a ! -f nghttp2-$NGHTTP2_VERSION-done ] ; then
1512 echo "Downloading, building, and installing nghttp2:"
1513 [ -f nghttp2-$NGHTTP2_VERSION.tar.xz ] || curl -L -O https://github.com/nghttp2/nghttp2/releases/download/v$NGHTTP2_VERSION/nghttp2-$NGHTTP2_VERSION.tar.xz || exit 1
1514 xzcat nghttp2-$NGHTTP2_VERSION.tar.xz | tar xf - || exit 1
1515 cd nghttp2-$NGHTTP2_VERSION
1516 ./configure || exit 1
1517 make $MAKE_BUILD_OPTS || exit 1
1518 $DO_MAKE_INSTALL || exit 1
1520 touch nghttp2-$NGHTTP2_VERSION-done
1524 uninstall_nghttp2() {
1525 if [ ! -z "$installed_nghttp2_version" ] ; then
1526 echo "Uninstalling nghttp2:"
1527 cd nghttp2-$installed_nghttp2_version
1528 $DO_MAKE_UNINSTALL || exit 1
1529 make distclean || exit 1
1531 rm nghttp2-$installed_nghttp2_version-done
1533 if [ "$#" -eq 1 -a "$1" = "-r" ] ; then
1535 # Get rid of the previously downloaded and unpacked version.
1537 rm -rf nghttp2-$installed_nghttp2_version
1538 rm -rf nghttp2-$installed_nghttp2_version.tar.xz
1541 installed_nghttp2_version=""
1547 # Check whether the versions we have installed are the versions
1548 # requested; if not, uninstall the installed versions.
1550 if [ ! -z "$installed_nghttp2_version" -a \
1551 "$installed_nghttp2_version" != "$NGHTTP2_VERSION" ] ; then
1552 echo "Installed nghttp2 version is $installed_nghttp2_version"
1553 if [ -z "$NGHTTP2_VERSION" ] ; then
1554 echo "nghttp2 is not requested"
1556 echo "Requested nghttp2 version is $NGHTTP2_VERSION"
1558 uninstall_nghttp2 -r
1561 if [ ! -z "$installed_libssh_version" -a \
1562 "$installed_libssh_version" != "$LIBSSH_VERSION" ] ; then
1563 echo "Installed libssh version is $installed_libssh_version"
1564 if [ -z "$LIBSSH_VERSION" ] ; then
1565 echo "libssh is not requested"
1567 echo "Requested libssh version is $LIBSSH_VERSION"
1572 if [ ! -z "$installed_cares_version" -a \
1573 "$installed_cares_version" != "$CARES_VERSION" ] ; then
1574 echo "Installed C-Ares version is $installed_cares_version"
1575 if [ -z "$CARES_VERSION" ] ; then
1576 echo "C-Ares is not requested"
1578 echo "Requested C-Ares version is $CARES_VERSION"
1583 if [ ! -z "$installed_geoip_version" -a \
1584 "$installed_geoip_version" != "$GEOIP_VERSION" ] ; then
1585 echo "Installed GeoIP API version is $installed_geoip_version"
1586 if [ -z "$GEOIP_VERSION" ] ; then
1587 echo "GeoIP is not requested"
1589 echo "Requested GeoIP version is $GEOIP_VERSION"
1594 if [ ! -z "$installed_sbc_version" -a \
1595 "$installed_sbc_version" != "$SBC_VERSION" ] ; then
1596 echo "Installed SBC version is $installed_sbc_version"
1597 if [ -z "$SBC_VERSION" ] ; then
1598 echo "SBC is not requested"
1600 echo "Requested SBC version is $SBC_VERSION"
1605 if [ ! -z "$installed_portaudio_version" -a \
1606 "$installed_portaudio_version" != "$PORTAUDIO_VERSION" ] ; then
1607 echo "Installed PortAudio version is $installed_portaudio_version"
1608 if [ -z "$PORTAUDIO_VERSION" ] ; then
1609 echo "PortAudio is not requested"
1611 echo "Requested PortAudio version is $PORTAUDIO_VERSION"
1613 uninstall_portaudio -r
1616 if [ ! -z "$installed_lua_version" -a \
1617 "$installed_lua_version" != "$LUA_VERSION" ] ; then
1618 echo "Installed Lua version is $installed_lua_version"
1619 if [ -z "$LUA_VERSION" ] ; then
1620 echo "Lua is not requested"
1622 echo "Requested Lua version is $LUA_VERSION"
1627 if [ ! -z "$installed_gnutls_version" -a \
1628 "$installed_gnutls_version" != "$GNUTLS_VERSION" ] ; then
1629 echo "Installed GnuTLS version is $installed_gnutls_version"
1630 if [ -z "$GNUTLS_VERSION" ] ; then
1631 echo "GnuTLS is not requested"
1633 echo "Requested GnuTLS version is $GNUTLS_VERSION"
1638 if [ ! -z "$installed_libgcrypt_version" -a \
1639 "$installed_libgcrypt_version" != "$LIBGCRYPT_VERSION" ] ; then
1640 echo "Installed libgcrypt version is $installed_libgcrypt_version"
1641 if [ -z "$LIBGCRYPT_VERSION" ] ; then
1642 echo "libgcrypt is not requested"
1644 echo "Requested libgcrypt version is $LIBGCRYPT_VERSION"
1646 uninstall_libgcrypt -r
1649 if [ ! -z "$installed_libgpg_error_version" -a \
1650 "$installed_libgpg_error_version" != "$LIBGPG_ERROR_VERSION" ] ; then
1651 echo "Installed libgpg-error version is $installed_libgpg_error_version"
1652 if [ -z "$LIBGPG_ERROR_VERSION" ] ; then
1653 echo "libgpg-error is not requested"
1655 echo "Requested libgpg-error version is $LIBGPG_ERROR_VERSION"
1657 uninstall_libgpg_error -r
1660 if [ ! -z "$installed_libsmi_version" -a \
1661 "$installed_libsmi_version" != "$LIBSMI_VERSION" ] ; then
1662 echo "Installed libsmi version is $installed_libsmi_version"
1663 if [ -z "$LIBSMI_VERSION" ] ; then
1664 echo "libsmi is not requested"
1666 echo "Requested libsmi version is $LIBSMI_VERSION"
1671 if [ ! -z "$installed_gtk_version" -a \
1672 "$installed_gtk_version" != "$GTK_VERSION" ] ; then
1673 echo "Installed GTK+ version is $installed_gtk_version"
1674 if [ -z "$GTK_VERSION" ] ; then
1675 echo "GTK+ is not requested"
1677 echo "Requested GTK+ version is $GTK_VERSION"
1682 if [ ! -z "$installed_gdk_pixbuf_version" -a \
1683 "$installed_gdk_pixbuf_version" != "$GDK_PIXBUF_VERSION" ] ; then
1684 echo "Installed gdk-pixbuf version is $installed_gdk_pixbuf_version"
1685 if [ -z "$GDK_PIXBUF_VERSION" ] ; then
1686 echo "gdk-pixbuf is not requested"
1688 echo "Requested gdk-pixbuf version is $GDK_PIXBUF_VERSION"
1690 uninstall_gdk_pixbuf -r
1693 if [ ! -z "$installed_pango_version" -a \
1694 "$installed_pango_version" != "$PANGO_VERSION" ] ; then
1695 echo "Installed Pango version is $installed_pango_version"
1696 if [ -z "$PANGO_VERSION" ] ; then
1697 echo "Pango is not requested"
1699 echo "Requested Pango version is $PANGO_VERSION"
1704 if [ ! -z "$installed_atk_version" -a \
1705 "$installed_atk_version" != "$ATK_VERSION" ] ; then
1706 echo "Installed ATK version is $installed_atk_version"
1707 if [ -z "$ATK_VERSION" ] ; then
1708 echo "ATK is not requested"
1710 echo "Requested ATK version is $ATK_VERSION"
1715 if [ ! -z "$installed_cairo_version" -a \
1716 "$installed_cairo_version" != "$CAIRO_VERSION" ] ; then
1717 echo "Installed Cairo version is $installed_cairo_version"
1718 if [ -z "$CAIRO_VERSION" ] ; then
1719 echo "Cairo is not requested"
1721 echo "Requested Cairo version is $CAIRO_VERSION"
1726 if [ ! -z "$installed_pixman_version" -a \
1727 "$installed_pixman_version" != "$PIXMAN_VERSION" ] ; then
1728 echo "Installed pixman version is $installed_pixman_version"
1729 if [ -z "$PIXMAN_VERSION" ] ; then
1730 echo "pixman is not requested"
1732 echo "Requested pixman version is $PIXMAN_VERSION"
1737 if [ ! -z "$installed_libpng_version" -a \
1738 "$installed_libpng_version" != "$PNG_VERSION" ] ; then
1739 echo "Installed libpng version is $installed_libpng_version"
1740 if [ -z "$PNG_VERSION" ] ; then
1741 echo "libpng is not requested"
1743 echo "Requested libpng version is $PNG_VERSION"
1748 if [ ! -z "$installed_qt_version" -a \
1749 "$installed_qt_version" != "$QT_VERSION" ] ; then
1750 echo "Installed Qt version is $installed_qt_version"
1751 if [ -z "$QT_VERSION" ] ; then
1752 echo "Qt is not requested"
1754 echo "Requested Qt version is $QT_VERSION"
1759 if [ ! -z "$installed_glib_version" -a \
1760 "$installed_glib_version" != "$GLIB_VERSION" ] ; then
1761 echo "Installed GLib version is $installed_glib_version"
1762 if [ -z "$GLIB_VERSION" ] ; then
1763 echo "GLib is not requested"
1765 echo "Requested GLib version is $GLIB_VERSION"
1770 if [ ! -z "$installed_pkg_config_version" -a \
1771 "$installed_pkg_config_version" != "$PKG_CONFIG_VERSION" ] ; then
1772 echo "Installed pkg-config version is $installed_pkg_config_version"
1773 if [ -z "$PKG_CONFIG_VERSION" ] ; then
1774 echo "pkg-config is not requested"
1776 echo "Requested pkg-config version is $PKG_CONFIG_VERSION"
1778 uninstall_pkg_config -r
1781 if [ ! -z "$installed_gettext_version" -a \
1782 "$installed_gettext_version" != "$GETTEXT_VERSION" ] ; then
1783 echo "Installed GNU gettext version is $installed_gettext_version"
1784 if [ -z "$GETTEXT_VERSION" ] ; then
1785 echo "GNU gettext is not requested"
1787 echo "Requested GNU gettext version is $GETTEXT_VERSION"
1789 uninstall_gettext -r
1792 if [ ! -z "$installed_cmake_version" -a \
1793 "$installed_cmake_version" != "$CMAKE_VERSION" ] ; then
1794 echo "Installed CMake version is $installed_cmake_version"
1795 if [ -z "$CMAKE_VERSION" ] ; then
1796 echo "CMake is not requested"
1798 echo "Requested CMake version is $CMAKE_VERSION"
1801 # XXX - really remove this?
1802 # Or should we remember it as installed only if this script
1808 if [ ! -z "$installed_libtool_version" -a \
1809 "$installed_libtool_version" != "$LIBTOOL_VERSION" ] ; then
1810 echo "Installed GNU libtool version is $installed_libtool_version"
1811 if [ -z "$LIBTOOL_VERSION" ] ; then
1812 echo "GNU libtool is not requested"
1814 echo "Requested GNU libtool version is $LIBTOOL_VERSION"
1816 uninstall_libtool -r
1819 if [ ! -z "$installed_automake_version" -a \
1820 "$installed_automake_version" != "$AUTOMAKE_VERSION" ] ; then
1821 echo "Installed GNU automake version is $installed_automake_version"
1822 if [ -z "$AUTOMAKE_VERSION" ] ; then
1823 echo "GNU automake is not requested"
1825 echo "Requested GNU automake version is $AUTOMAKE_VERSION"
1827 uninstall_automake -r
1830 if [ ! -z "$installed_autoconf_version" -a \
1831 "$installed_autoconf_version" != "$AUTOCONF_VERSION" ] ; then
1832 echo "Installed GNU autoconf version is $installed_autoconf_version"
1833 if [ -z "$AUTOCONF_VERSION" ] ; then
1834 echo "GNU autoconf is not requested"
1836 echo "Requested GNU autoconf version is $AUTOCONF_VERSION"
1838 uninstall_autoconf -r
1841 if [ ! -z "$installed_xz_version" -a \
1842 "$installed_xz_version" != "$XZ_VERSION" ] ; then
1843 echo "Installed xz version is $installed_xz_version"
1844 if [ -z "$XZ_VERSION" ] ; then
1845 echo "xz is not requested"
1847 echo "Requested xz version is $XZ_VERSION"
1853 # Start with xz: It is the sole download format of glib later than 2.31.2
1866 # Start with GNU gettext; GLib requires it, and OS X doesn't have it
1867 # or a BSD-licensed replacement.
1869 # At least on Lion with Xcode 4, _FORTIFY_SOURCE gets defined as 2
1870 # by default, which causes, for example, stpncpy to be defined as
1871 # a hairy macro that collides with the GNU gettext configure script's
1872 # attempts to workaround AIX's lack of a declaration for stpncpy,
1873 # with the result being a huge train wreck. Define _FORTIFY_SOURCE
1874 # as 0 in an attempt to keep the trains on separate tracks.
1879 # GLib depends on pkg-config.
1880 # By default, pkg-config depends on GLib; we break the dependency cycle
1881 # by configuring pkg-config to use its own internal version of GLib.
1888 # Now we have reached a point where we can build everything but
1889 # the GUI (Wireshark).
1893 if [ "$GTK_VERSION" ]; then
1895 # GTK+ 3 requires a newer Cairo build than the one that comes with
1896 # 10.6, so we build Cairo if we are using GTK+ 3.
1898 # In 10.6 and 10.7, it's an X11 library; if we build with "native" GTK+
1899 # rather than X11 GTK+, we might have to build and install Cairo.
1900 # In 10.8 and later, there is no X11, but it's included in Xquartz;
1901 # again, if we build with "native" GTK+, we'd have to build and install
1904 if [[ "$GTK_MAJOR_VERSION" -eq 3 || "$cairo_not_in_the_os" = yes ]]; then
1906 # Requirements for Cairo first
1908 # The libpng that comes with the X11 for Leopard has a bogus
1909 # pkg-config file that lies about where the header files are,
1910 # which causes other packages not to be able to find its
1913 # The libpng in later versions is not what the version of
1914 # libpixman we build below wants - it wants libpng15.
1919 # The libpixman versions that come with the X11s for Leopard,
1920 # Snow Leopard, and Lion is too old to support Cairo's image
1921 # surface backend feature (which requires pixman-1 >= 0.22.0).
1923 # XXX - what about the one that comes with the latest version
1929 # And now Cairo itself.
1930 # XXX - with the libxcb that comes with 10.6,
1931 # xcb_discard_reply() is missing, and the build fails.
1946 # Now we have reached a point where we can build everything including
1947 # the GUI (Wireshark), but not with any optional features such as
1948 # SNMP OID resolution, some forms of decryption, Lua scripting, playback
1949 # of audio, or GeoIP mapping of IP addresses.
1951 # We now conditionally download optional libraries to support them;
1952 # the default is to download them all.
1957 install_libgpg_error
1979 if [ -d macosx-support-libs ]
1981 cd macosx-support-libs
1984 # Uninstall items in the reverse order from the order in which they're
1985 # installed. Only uninstall if the download/build/install process
1986 # completed; uninstall the version that appears in the name of
1989 # We also do a "make distclean", so that we don't have leftovers from
1990 # old configurations.
2010 uninstall_libgpg_error
2016 uninstall_gdk_pixbuf
2032 uninstall_pkg_config
2037 # XXX - really remove this?
2038 # Or should we remember it as installed only if this script
2054 # Do we have permission to write in /usr/local?
2056 # If so, assume we have permission to write in its subdirectories.
2057 # (If that's not the case, this test needs to check the subdirectories
2060 # If not, do "make install", "make uninstall", the removes for Lua,
2061 # and the renames of [g]libtool* with sudo.
2063 if [ -w /usr/local ]
2065 DO_MAKE_INSTALL="make install"
2066 DO_MAKE_UNINSTALL="make uninstall"
2070 DO_MAKE_INSTALL="sudo make install"
2071 DO_MAKE_UNINSTALL="sudo make uninstall"
2077 # If we have SDKs available, the default target OS is the major version
2078 # of the one we're running; get that and strip off the third component
2081 for i in /Developer/SDKs \
2082 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
2083 /Library/Developer/CommandLineTools/SDKs
2087 min_osx_target=`sw_vers -productVersion | sed 's/\([0-9]*\)\.\([0-9]*\)\.[0-9]*/\1.\2/'`
2090 # That's also the OS whose SDK we'd be using.
2092 sdk_target=$min_osx_target
2098 # Parse command-line flags:
2101 # -t <target> - build libraries so that they'll work on the specified
2102 # version of OS X and later versions.
2103 # -u - do an uninstall.
2105 while getopts ht:u name
2112 min_osx_target="$OPTARG"
2115 echo "Usage: macosx-setup.sh [ -t <target> ] [ -u ]" 1>&1
2122 # Get the version numbers of installed packages, if any.
2124 if [ -d macosx-support-libs ]
2126 cd macosx-support-libs
2128 installed_xz_version=`ls xz-*-done 2>/dev/null | sed 's/xz-\(.*\)-done/\1/'`
2129 installed_autoconf_version=`ls autoconf-*-done 2>/dev/null | sed 's/autoconf-\(.*\)-done/\1/'`
2130 installed_automake_version=`ls automake-*-done 2>/dev/null | sed 's/automake-\(.*\)-done/\1/'`
2131 installed_libtool_version=`ls libtool-*-done 2>/dev/null | sed 's/libtool-\(.*\)-done/\1/'`
2132 installed_cmake_version=`ls cmake-*-done 2>/dev/null | sed 's/cmake-\(.*\)-done/\1/'`
2133 installed_gettext_version=`ls gettext-*-done 2>/dev/null | sed 's/gettext-\(.*\)-done/\1/'`
2134 installed_pkg_config_version=`ls pkg-config-*-done 2>/dev/null | sed 's/pkg-config-\(.*\)-done/\1/'`
2135 installed_glib_version=`ls glib-*-done 2>/dev/null | sed 's/glib-\(.*\)-done/\1/'`
2136 installed_qt_version=`ls qt-*-done 2>/dev/null | sed 's/qt-\(.*\)-done/\1/'`
2137 installed_libpng_version=`ls libpng-*-done 2>/dev/null | sed 's/libpng-\(.*\)-done/\1/'`
2138 installed_pixman_version=`ls pixman-*-done 2>/dev/null | sed 's/pixman-\(.*\)-done/\1/'`
2139 installed_cairo_version=`ls cairo-*-done 2>/dev/null | sed 's/cairo-\(.*\)-done/\1/'`
2140 installed_atk_version=`ls atk-*-done 2>/dev/null | sed 's/atk-\(.*\)-done/\1/'`
2141 installed_pango_version=`ls pango-*-done 2>/dev/null | sed 's/pango-\(.*\)-done/\1/'`
2142 installed_gdk_pixbuf_version=`ls gdk-pixbuf-*-done 2>/dev/null | sed 's/gdk-pixbuf-\(.*\)-done/\1/'`
2143 installed_gtk_version=`ls gtk+-*-done 2>/dev/null | sed 's/gtk+-\(.*\)-done/\1/'`
2144 installed_libsmi_version=`ls libsmi-*-done 2>/dev/null | sed 's/libsmi-\(.*\)-done/\1/'`
2145 installed_libgpg_error_version=`ls libgpg-error-*-done 2>/dev/null | sed 's/libgpg-error-\(.*\)-done/\1/'`
2146 installed_libgcrypt_version=`ls libgcrypt-*-done 2>/dev/null | sed 's/libgcrypt-\(.*\)-done/\1/'`
2147 installed_gnutls_version=`ls gnutls-*-done 2>/dev/null | sed 's/gnutls-\(.*\)-done/\1/'`
2148 installed_lua_version=`ls lua-*-done 2>/dev/null | sed 's/lua-\(.*\)-done/\1/'`
2149 installed_portaudio_version=`ls portaudio-*-done 2>/dev/null | sed 's/portaudio-\(.*\)-done/\1/'`
2150 installed_sbc_version=`ls sbc-*-done 2>/dev/null | sed 's/sbc-\(.*\)-done/\1/'`
2151 installed_geoip_version=`ls geoip-*-done 2>/dev/null | sed 's/geoip-\(.*\)-done/\1/'`
2152 installed_cares_version=`ls c-ares-*-done 2>/dev/null | sed 's/c-ares-\(.*\)-done/\1/'`
2153 installed_libssh_version=`ls libssh-*-done 2>/dev/null | sed 's/libssh-\(.*\)-done/\1/'`
2154 installed_nghttp2_version=`ls nghttp2-*-done 2>/dev/null | sed 's/nghttp2-\(.*\)-done/\1/'`
2157 # If we don't have a versioned -done file for portaudio, but do have
2158 # an unversioned -done file for it, assume the installed version is the
2159 # requested version, and rename the -done file to include that version.
2161 if [ -z "$installed_portaudio_version" -a -f portaudio-done ] ; then
2162 mv portaudio-done portaudio-$PORTAUDIO_VERSION-done
2163 installed_portaudio_version=`ls portaudio-*-done 2>/dev/null | sed 's/portaudio-\(.*\)-done/\1/'`
2169 if [ "$do_uninstall" = "yes" ]
2176 # Configure scripts tend to set CFLAGS and CXXFLAGS to "-g -O2" if
2177 # invoked without CFLAGS or CXXFLAGS being set in the environment.
2179 # However, we *are* setting them in the environment, for our own
2180 # nefarious purposes, so start them out as "-g -O2".
2186 # To make this work on Leopard (rather than working *on* Snow Leopard
2187 # when building *for* Leopard) will take more work.
2189 # For one thing, Leopard's /usr/X11/lib/libXdamage.la claims, at least
2190 # with all software updates applied, that the Xdamage shared library
2191 # is libXdamage.1.0.0.dylib, but it is, in fact, libXdamage.1.1.0.dylib.
2192 # This causes problems when building GTK+, so the script would have to
2195 if [[ $DARWIN_MAJOR_VERSION -le 9 ]]; then
2196 echo "This script does not support any versions of OS X before Snow Leopard" 1>&2
2200 # if no make options are present, set default options
2201 if [ -z "$MAKE_BUILD_OPTS" ] ; then
2202 # by default use 1.5x number of cores for parallel build
2203 MAKE_BUILD_OPTS="-j $(( $(sysctl -n hw.logicalcpu) * 3 / 2))"
2207 # If we have a target release, look for the oldest SDK that's for an
2208 # OS equal to or later than that one, and build libraries against it
2209 # rather than against the headers and, more importantly, libraries
2210 # that come with the OS, so that we don't end up with support libraries
2211 # that only work on the OS version on which we built them, not earlier
2212 # versions of the same release, or earlier releases if the minimum is
2215 if [ ! -z "$min_osx_target" ]
2218 # Get the real version - strip off the "10.".
2219 # We'll worry about that if, as, and when there's ever
2222 deploy_real_version=`echo "$min_osx_target" | sed -n 's/10\.\(.*\)/\1/p'`
2225 # Search each directory that might contain SDKs.
2228 for sdksdir in /Developer/SDKs \
2229 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
2230 /Library/Developer/CommandLineTools/SDKs
2233 # Get a list of all the SDKs.
2235 if ! test -d "$sdksdir"
2238 # There is no directory with that name.
2239 # Move on to the next one in the list, if any.
2245 # Get a list of all the SDKs in that directory, if any.
2247 sdklist=`(cd "$sdksdir"; ls -d MacOSX10.[0-9]*.sdk 2>/dev/null)`
2252 # Get the real version for this SDK.
2254 sdk_real_version=`echo "$sdk" | sed -n 's/MacOSX10\.\(.*\)\.sdk/\1/p'`
2257 # Is it for the deployment target or some later release?
2259 if test "$sdk_real_version" -ge "$deploy_real_version"
2264 sdkpath="$sdksdir/$sdk"
2265 qt_sdk_arg="-sdk $sdk"
2271 if [ -z "$sdkpath" ]
2273 echo "macosx-setup.sh: Couldn't find an SDK for OS X $min_osx_target or later" 1>&2
2278 sdk_target=10.$sdk_real_version
2279 echo "Using the 10.$sdk_real_version SDK"
2282 # Make sure there are links to /usr/local/include and /usr/local/lib
2283 # in the SDK's usr/local.
2285 if [ ! -e $SDKPATH/usr/local/include ]
2287 if [ ! -d $SDKPATH/usr/local ]
2289 sudo mkdir $SDKPATH/usr/local
2291 sudo ln -s /usr/local/include $SDKPATH/usr/local/include
2293 if [ ! -e $SDKPATH/usr/local/lib ]
2295 if [ ! -d $SDKPATH/usr/local ]
2297 sudo mkdir $SDKPATH/usr/local
2299 sudo ln -s /usr/local/lib $SDKPATH/usr/local/lib
2303 # Set the minimum OS version for which to build to the specified
2304 # minimum target OS version, so we don't, for example, end up using
2305 # linker features supported by the OS verson on which we're building
2306 # but not by the target version.
2308 VERSION_MIN_FLAGS="-mmacosx-version-min=$min_osx_target"
2311 # Compile and link against the SDK.
2313 SDKFLAGS="-isysroot $SDKPATH"
2315 if [[ "$min_osx_target" == "10.5" ]]
2318 # Cairo is part of Mac OS X 10.6 and later.
2319 # The *headers* are supplied by 10.5, but the *libraries*
2320 # aren't, so we have to build it if we're building for 10.5.
2322 cairo_not_in_the_os=yes
2325 # Build with older versions of the support libraries, as
2326 # were used on the Wireshark Leopard buildbot at one
2327 # point. (Most of these versions come from the About page
2328 # from Wireshark 1.8.6, the last build done on that buildbot;
2329 # the ATK version isn't reported, so this is a guess.)
2331 # If you want to try building with newer versions of
2332 # the libraries, note that:
2334 # The version of fontconfig that comes with Leopard doesn't
2335 # support FC_WEIGHT_EXTRABLACK, so we can't use any version
2336 # of Pango newer than 1.22.4.
2338 # However, Pango 1.22.4 doesn't work with versions of GLib
2339 # after 2.29.6, because Pango 1.22.4 uses G_CONST_RETURN and
2340 # GLib 2.29.8 and later deprecate it (there doesn't appear to
2341 # be a GLib 2.29.7). That means we'd either have to patch
2342 # Pango not to use it (just use "const"; G_CONST_RETURN was
2343 # there to allow code to choose whether to use "const" or not),
2344 # or use GLib 2.29.6 or earlier.
2346 # GLib 2.29.6 includes an implementation of g_bit_lock() that,
2347 # on x86 (32-bit and 64-bit), uses asms in a fashion
2348 # ("asm volatile goto") that requires GCC 4.5 or later, which
2349 # is later than the compilers that come with Leopard and Snow
2350 # Leopard. Recent versions of GLib check for that, but 2.29.6
2351 # doesn't, so, if you want to build GLib 2.29.6 on Leopard or
2352 # Snow Leopard, you would have to patch glib/gbitlock.c to do
2353 # what the newer versions of GLib do:
2355 # define a USE_ASM_GOTO macro that indicates whether "asm goto"
2357 # #if (defined (i386) || defined (__amd64__))
2358 # #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
2359 # #define USE_ASM_GOTO 1
2363 # replace all occurrences of
2365 # #if defined (__GNUC__) && (defined (i386) || defined (__amd64__))
2369 # #ifdef USE_ASM_GOTO
2371 # Using GLib 2.29.6 or earlier, however, means that we can't
2372 # use a version of ATK later than 2.3.93, as those versions
2373 # don't work with GLib 2.29.6. The same applies to gdk-pixbuf;
2374 # versions of gdk-pixbuf after 2.24.1 won't work with GLib
2377 # Then you have to make sure that what you've build doesn't
2378 # cause the X server that comes with Leopard to crash; at
2379 # least one attempt at building for Leopard did.
2381 # At least if building on Leopard, you might also find
2382 # that, with various older versions of Cairo, including
2383 # 1.6.4 and at least some 1.8.x versions, when you try to
2384 # build it, the build fails because it can't find
2385 # png_set_longjmp_fn(). I vaguely remember dealing with that,
2386 # ages ago, but don't remember what I did.
2389 if [ "$CAIRO_VERSION" ]
2393 if [ "$ATK_VERSION" ]
2397 if [ "$PANGO_VERSION" ]
2399 PANGO_VERSION=1.20.2
2401 if [ "$GTK_VERSION" ]
2407 # That version of GTK+ includes gdk-pixbuf.
2408 # XXX - base this on the version of GTK+ requested.
2413 # Libgcrypt 1.5.0 fails to compile due to some problem with an
2414 # asm in rijndael.c, at least with i686-apple-darwin10-gcc-4.2.1
2415 # (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) when building
2418 # We try libgcrypt 1.4.3 instead, as that's what shows up in
2419 # the version from the Leopard buildbot.
2420 LIBGCRYPT_VERSION=1.4.3
2423 # Build 32-bit while we're at it; Leopard has a bug that
2424 # causes some BPF functions not to work with 64-bit userland
2425 # code, so capturing won't work.
2427 CFLAGS="$CFLAGS -arch i386"
2428 CXXFLAGS="$CXXFLAGS -arch i386"
2429 export LDFLAGS="$LDFLAGS -arch i386"
2437 # You need Xcode or the command-line tools installed to get the compilers.
2439 if [ ! -x /usr/bin/xcodebuild ]; then
2440 echo "Please install Xcode first (should be available on DVD or from the Mac App Store)."
2444 if [ "$QT_VERSION" ]; then
2446 # We need Xcode, not just the command-line tools, installed to build
2449 # At least with Xcode 8, /usr/bin/xcodebuild --help fails if only
2450 # the command-line tools are installed and succeeds if Xcode is
2451 # installed. Unfortunately, it fails *with* Xcode 3, but
2452 # /usr/bin/xcodebuild -version works with that and with Xcode 8.
2453 # Hopefully it fails with only the command-line tools installed.
2455 if /usr/bin/xcodebuild -version >/dev/null 2>&1; then
2458 echo "Please install Xcode first (should be available on DVD or from the Mac App Store)."
2459 echo "The command-line build tools are not sufficient to build Qt."
2463 if [ "$GTK_VERSION" ]; then
2465 # If we're building with GTK+, you also need the X11 SDK; with at least
2466 # some versions of OS X and Xcode, that is, I think, an optional install.
2467 # (Or it might be installed with X11, but I think *that* is an optional
2468 # install on at least some versions of OS X.)
2470 if [ ! -d /usr/X11/include ]; then
2471 echo "Please install X11 and the X11 SDK first."
2472 echo " You can either download the latest package from"
2473 echo " http://www.xquartz.org/ and install it or install"
2474 echo " the native Apple package if you are on Lion or below."
2479 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig
2482 # Do all the downloads and untarring in a subdirectory, so all that
2483 # stuff can be removed once we've installed the support libraries.
2485 if [ ! -d macosx-support-libs ]
2487 mkdir macosx-support-libs || exit 1
2489 cd macosx-support-libs
2496 # Indicate what paths to use for pkg-config and cmake.
2498 pkg_config_path=/usr/local/lib/pkgconfig
2499 if [ "$QT_VERSION" ]; then
2500 qt_base_path=$HOME/Qt$QT_VERSION/$QT_MAJOR_MINOR_VERSION/clang_64
2501 pkg_config_path="$pkg_config_path":"$qt_base_path/lib/pkgconfig"
2502 CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH":"$qt_base_path/lib/cmake"
2504 pkg_config_path="$pkg_config_path":/usr/X11/lib/pkgconfig
2506 echo "You are now prepared to build Wireshark."
2508 if [[ $CMAKE ]]; then
2509 echo "To build with CMAKE:"
2511 echo "export PKG_CONFIG_PATH=$pkg_config_path"
2512 echo "export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH"
2513 echo "export PATH=$PATH:$qt_base_path/bin"
2515 echo "mkdir build; cd build"
2517 echo "make $MAKE_BUILD_OPTS app_bundle"
2518 echo "make install/strip"
2521 if [[ $AUTOTOOLS ]]; then
2522 echo "To build with AUTOTOOLS:"
2524 echo "export PKG_CONFIG_PATH=$pkg_config_path"
2527 echo "mkdir build; cd build"
2529 echo "make $MAKE_BUILD_OPTS"
2533 echo "Make sure you are allowed capture access to the network devices"
2534 echo "See: https://wiki.wireshark.org/CaptureSetup/CapturePrivileges"