Add c-ares. Untested, but it *should* work.
authorGerald Combs <gerald@wireshark.org>
Mon, 28 Oct 2013 22:38:23 +0000 (22:38 -0000)
committerGerald Combs <gerald@wireshark.org>
Mon, 28 Oct 2013 22:38:23 +0000 (22:38 -0000)
svn path=/trunk/; revision=52936

macosx-setup.sh

index 5b6c63454a1a3d5676d1950a22028311cfd7a79a..07ce89d680e815fa4890772a25b936f9060c55de 100755 (executable)
@@ -111,6 +111,8 @@ PORTAUDIO_VERSION=pa_stable_v19_20111121
 #
 GEOIP_VERSION=1.4.8
 
+CARES_VERSION=1.10.0
+
 DARWIN_MAJOR_VERSION=`uname -r | sed 's/\([0-9]*\).*/\1/'`
 
 #
@@ -137,6 +139,17 @@ uninstall() {
         # We also do a "make distclean", so that we don't have leftovers from
         # old configurations.
         #
+
+        installed_cares_version=`ls cares-*-done 2>/dev/null | sed 's/cares-\(.*\)-done/\1/'`
+        if [ ! -z "$installed_cares_version" ] ; then
+            echo "Uninstalling C-Ares API:"
+            cd cares-$installed_cares_version
+            $DO_MAKE_UNINSTALL || exit 1
+            make distclean || exit 1
+            cd ..
+            rm cares-$installed_cares_version-done
+        fi
+
         installed_geoip_version=`ls geoip-*-done 2>/dev/null | sed 's/geoip-\(.*\)-done/\1/'`
         if [ ! -z "$installed_geoip_version" ] ; then
             echo "Uninstalling GeoIP API:"
@@ -1274,6 +1287,19 @@ then
     touch geoip-$GEOIP_VERSION-done
 fi
 
+if [ "$CARES_VERSION" -a ! -f geoip-$CARES_VERSION-done ]
+then
+    echo "Downloading, building, and installing C-Ares API:"
+    [ -f c-ares-$CARES_VERSION.tar.gz ] || curl -L -O http://c-ares.haxx.se/download/c-ares-$CARES_VERSION.tar.gz || exit 1
+    gzcat c-ares-$CARES_VERSION.tar.gz | tar xf - || exit 1
+    cd c-ares-$CARES_VERSION
+    CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
+    make $MAKE_BUILD_OPTS || exit 1
+    $DO_MAKE_INSTALL || exit 1
+    cd ..
+    touch geoip-$CARES_VERSION-done
+fi
+
 echo ""
 
 echo "You are now prepared to build Wireshark. To do so do:"