Add ability to follow UDP stream by index
[metze/wireshark/wip.git] / configure.ac
index cb6a126c2fd8aab492af960839aa9286d9e01f80..89a15d44478e32a1fca70b05762adc53bb9d9155 100644 (file)
@@ -7,7 +7,7 @@
 #
 m4_define([version_major], [1])
 m4_define([version_minor], [99])
-m4_define([version_micro], [1])
+m4_define([version_micro], [2])
 m4_define([version_micro_extra], version_micro)
 m4_append([version_micro_extra], [])
 
@@ -102,7 +102,7 @@ fi
 AC_PATH_PROG(PERL, perl)
 
 # Check for Python.
-AC_PATH_PROG(PYTHON, python)
+AC_PATH_PROGS(PYTHON, python, python3)
 if test ! -z "$PYTHON"; then
        #
        # OK, we found Python; is it Python 2.5 or later?
@@ -239,6 +239,9 @@ AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
 # the comments in acolocal.m4
 #
 PKG_PROG_PKG_CONFIG
+if test -z "$PKG_CONFIG"; then
+       AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
+fi
 
 AC_ARG_ENABLE(osx-deploy-target,
   AC_HELP_STRING( [--enable-osx-deploy-target],
@@ -506,6 +509,23 @@ AC_SUBST(OSX_MIN_VERSION)
 #
 AC_SYS_LARGEFILE
 
+#
+# Look for math functions; use libm if necessary.
+#
+AC_SEARCH_LIBS(floor, m)
+AC_SEARCH_LIBS(ceil, m)
+AC_SEARCH_LIBS(exp, m)
+AC_SEARCH_LIBS(log, m)
+AC_SEARCH_LIBS(log10, m)
+AC_SEARCH_LIBS(floorl, m,
+  [
+    FLOORL_LO=""
+    AC_DEFINE(HAVE_FLOORL, 1, [Define if you have the floorl function.])
+  ],
+  FLOORL_LO="floorl.lo")
+AC_SUBST(FLOORL_LO)
+
+
 #
 # GUI toolkit options
 #
@@ -808,6 +828,14 @@ else
 fi
 AC_SUBST(HAVE_OSX_PACKAGING)
 
+#
+# Use this as a proxy for "is this OS X" (just in case somebody actually
+# built and installed Darwin as an OS, perhaps with some X11-based GUI,
+# don't look for Darwin).
+#
+AC_CHECK_PROG(have_sw_vers, sw_vers, "yes", "no")
+AM_CONDITIONAL(NOT_OS_X, test "x$have_sw_vers" = "xno")
+
 #
 # Some compilers have to be told to fail when passed an unknown -W flag;
 # make sure we do that.
@@ -911,7 +939,7 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wwrite-strings)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
-
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
 #
 # The following are C only, not C++
 #
@@ -1373,6 +1401,7 @@ AC_ARG_ENABLE(wireshark,
   AC_HELP_STRING( [--enable-wireshark],
                   [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
     enable_wireshark=$enableval,enable_wireshark=yes)
+AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
 
 AC_ARG_ENABLE(packet-editor,
   AC_HELP_STRING( [--enable-packet-editor],
@@ -2639,10 +2668,29 @@ AC_C_BIGENDIAN
 # XXX - do we need this?
 AC_PROG_GCC_TRADITIONAL
 
-AC_CHECK_FUNC(getopt,
+AC_CHECK_FUNC(getopt_long,
   [
     GETOPT_LO=""
-    AC_DEFINE(HAVE_GETOPT, 1, [Define to 1 if you have the getopt function.])
+    AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define to 1 if you have the getopt_long function.])
+
+    #
+    # Do we have optreset?
+    #
+    AC_MSG_CHECKING(whether optreset is defined)
+    AC_TRY_LINK([],
+      [
+        extern int optreset;
+
+        return optreset;
+      ],
+      ac_cv_pcap_debug_defined=yes,
+      ac_cv_pcap_debug_defined=no)
+    if test "$ac_cv_pcap_debug_defined" = yes ; then
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
+    else
+      AC_MSG_RESULT(no)
+    fi
   ],
   GETOPT_LO="wsgetopt.lo")
 AC_SUBST(GETOPT_LO)
@@ -2724,6 +2772,14 @@ AC_CHECK_FUNC(strptime,
   STRPTIME_LO="strptime.lo")
 AC_SUBST(STRPTIME_LO)
 
+AC_CHECK_FUNC(popcount,
+  [
+    POPCOUNT_LO=""
+    AC_DEFINE(HAVE_POPCOUNT, 1, [Define if you have the popcount function.])
+  ],
+  POPCOUNT_LO="popcount.lo")
+AC_SUBST(POPCOUNT_LO)
+
 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
 AC_CHECK_FUNCS(issetugid)
 AC_CHECK_FUNCS(mmap mprotect sysconf)