Fix comments.
[obnox/wireshark/wip.git] / configure.in
index 99437d3cd418d4d570a81be937acbec8e5741012..109965f99f0debcab86b460ca10f2067ba21befd 100644 (file)
@@ -2,7 +2,7 @@
 #
 AC_PREREQ(2.60)
 
-AC_INIT(wireshark, 1.3.3)
+AC_INIT(wireshark, 1.3.6)
 
 dnl Check for CPU / vendor / OS
 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
@@ -31,6 +31,7 @@ AM_DISABLE_STATIC
 dnl Checks for programs.
 AC_PROG_CC
 AM_PROG_CC_C_O
+AC_PROG_CXX
 AC_PROG_CPP
 dnl Work around libtool bug (fixed in the version 1.5a?)
 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
@@ -134,7 +135,7 @@ if test "x$with_gnutls" = "xyes"; then
                 tls_message="yes"
         ]
         , [
-                echo echo "gnuTLS not found, disabling ssl decryption"
+                echo "gnuTLS not found, disabling ssl decryption"
                 tls_message="no"
         ]
   )
@@ -190,9 +191,11 @@ AC_PATH_PROG(ELINKS, elinks)
 AC_CHECK_PROG(HAVE_ELINKS, elinks, "yes", "no")
 AM_CONDITIONAL(HAVE_ELINKS, test x$HAVE_ELINKS = xyes)
 
-AC_PATH_PROG(LINKS, links)
-AC_CHECK_PROG(HAVE_LINKS, links, "yes", "no")
-AM_CONDITIONAL(HAVE_LINKS, test x$HAVE_LINKS = xyes)
+## links: Fails as used in docbook/Makefile.am
+## (Rather than fixing things we'll just disable the use of links).
+##AC_PATH_PROG(LINKS, links)
+##AC_CHECK_PROG(HAVE_LINKS, links, "yes", "no")
+##AM_CONDITIONAL(HAVE_LINKS, test x$HAVE_LINKS = xyes)
 
 AC_PATH_PROG(LYNX, lynx)
 AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
@@ -299,6 +302,8 @@ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-pointer-sign)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
+# Use the faster pre gcc 4.5 floating point precision
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-fexcess-precision=fast)
 
 AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,--as-needed])
 # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-flto])
@@ -647,14 +652,21 @@ AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
 # programs to be built with GTK+.
 #
 if test "x$enable_wireshark" = "xyes"; then
-       AM_PATH_GTK_2_0(2.4.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
+       AM_PATH_GTK_2_0(2.4.0,
+       [
+               CFLAGS="$CFLAGS $GTK_CFLAGS"
+               CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
+       ], GTK_OK=no, gthread)
 else
        GTK_OK=no
 fi
 
-# GLib checks
-# This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
-# GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
+# GLib checks; we require GLib 2.4 or later, and require gmodule
+# support, as we need that for dynamically loading plugins.
+# If we found GTK+, this doesn't add GLIB_CFLAGS to CFLAGS, because
+# AM_PATH_GTK will add GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a
+# superset of GLIB_CFLAGS.  If we didn't find GTK+, it does add
+# GLIB_CFLAGS to CFLAGS.
 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
 # set when generating the Makefile, so we can make programs that require
 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
@@ -675,17 +687,46 @@ if test "$GTK_OK" = "no" ; then
        fi
        wireshark_bin=""
        wireshark_man=""
-       # Honor GLIB_CFLAGS
-       AM_PATH_GLIB_2_0(2.4.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
-
+       # Use GLIB_CFLAGS
+       AM_PATH_GLIB_2_0(2.4.0,
+       [
+               CFLAGS="$CFLAGS $GLIB_CFLAGS"
+               CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
+       ], AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
 else
+       #
+       # We have GTK+, and thus will be building Wireshark unless the
+       # user explicitly disabled it.
+       #
        wireshark_bin="wireshark\$(EXEEXT)"
        wireshark_man="wireshark.1"
         wireshark_SUBDIRS="codecs gtk"
-       # Honor GLIB_CFLAGS
+       # Don't use GLIB_CFLAGS
        AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
 fi
 
+#
+# Check whether GLib includes GRegex support.
+# We just assume that everybody builds GLib 2.14.0 and later
+# with GRegex support; it's possible to compile GLib without
+# GRegex but it doesn't look as if anyone does.
+#
+AC_MSG_CHECKING(for GLIB - version >= 2.14.0)
+if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+       echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+       enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version 2.14.0 glib-2.0; then
+       have_gregex=yes
+    else
+       have_gregex=no
+    fi
+    AC_MSG_RESULT($have_gregex)
+fi
+
 #
 # Check whether GLib modules are supported, to determine whether we
 # can support plugins.
@@ -1091,7 +1132,7 @@ AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
 
 AC_ARG_WITH(pcre,
   AC_HELP_STRING( [--with-pcre@<:@=DIR@:>@],
-                  [use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions.  @<:@default=yes, if available@:>@]),
+                  [use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. Not needed if you have GLib 2.14 or later. @<:@default=yes, if available and GLib < 2.14@:>@]),
 [
        if test $withval = no
        then
@@ -1105,10 +1146,13 @@ AC_ARG_WITH(pcre,
        fi
 ],[
        #
-       # Use libpcre if it's present, otherwise don't.
-       # XXX - Should GLib 2.14 take precedence here?
+       # Use libpcre if it's present and GRegex isn't, otherwise don't.
        #
-       want_pcre=ifavailable
+       if test $have_gregex = yes ; then
+               want_pcre=no
+       else
+               want_pcre=ifavailable
+       fi
        pcre_dir=
 ])
 if test "x$want_pcre" = "xno" ; then
@@ -1209,6 +1253,28 @@ else
 fi
 
 
+dnl Check if dumpcap should be installed with filesystem capabilities
+AC_PATH_PROG(SETCAP, setcap)
+AC_ARG_ENABLE(setcap-install,
+  AC_HELP_STRING( [--enable-setcap-install],
+                  [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
+    enable_setcap_install=$enableval,enable_setcap_install=no)
+
+AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
+if test "x$enable_setcap_install" = "xno" ; then
+       AC_MSG_RESULT(no)
+else
+       if test "x$SETCAP" = "x" ; then
+               AC_MSG_RESULT(no. Setcap not found)
+       elif test "x$enable_dumpcap" = "xno" ; then
+               AC_MSG_ERROR(Setcap install works only with dumpcap but dumpcap is disabled)
+       else
+               AC_MSG_RESULT(yes)
+       fi
+fi
+
+AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
+
 dnl Check if dumpcap should be installed setuid
 AC_ARG_ENABLE(setuid-install,
   AC_HELP_STRING( [--enable-setuid-install],
@@ -1219,7 +1285,10 @@ AC_MSG_CHECKING(whether to install dumpcap setuid)
 if test "x$enable_setuid_install" = "xno" ; then
        AC_MSG_RESULT(no)
 else
-       if test "x$enable_dumpcap" = "xno" ; then
+       if test "x$enable_setcap_install" = "xyes" ; then
+               enable_setuid_install=no
+               AC_MSG_RESULT(no; using setcap instead)
+       elif test "x$enable_dumpcap" = "xno" ; then
                AC_MSG_ERROR(Setuid install works only with dumpcap but dumpcap is disabled)
        else
                AC_MSG_RESULT(yes)
@@ -1229,6 +1298,22 @@ fi
 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
 AC_CHECK_FUNCS(setresuid setresgid)
 
+dnl ...but our Network Operations group is named "no"!
+DUMPCAP_GROUP=''
+AC_ARG_WITH(dumpcap-group,
+  AC_HELP_STRING( [--with-dumpcap-group=GROUP],
+                  [restrict dumpcap to GROUP]),
+[
+  if test "x$withval" = "xyes"; then
+      AC_MSG_ERROR([No dumpcap group specified.])
+  elif test "x$withval" != "xno"; then
+      AC_MSG_RESULT($withval)
+      DUMPCAP_GROUP="$withval"
+  fi
+])
+AC_SUBST(DUMPCAP_GROUP)
+AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
+
 dnl libcap (not libpcap) check
 LIBCAP_LIBS=''
 AC_MSG_CHECKING(whether to use the libcap capabilities library)
@@ -1599,6 +1684,7 @@ AC_SUBST(STRPTIME_O)
 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
 AC_CHECK_FUNCS(issetugid)
 AC_CHECK_FUNCS(mmap mprotect sysconf)
+AC_CHECK_FUNCS(strtoll)
 
 dnl blank for now, but will be used in future
 AC_SUBST(wireshark_SUBDIRS)
@@ -1708,7 +1794,10 @@ AC_OUTPUT(
   asn1/h450-ros/Makefile
   asn1/h460/Makefile
   asn1/h501/Makefile
+  asn1/HI2Operations/Makefile
+  asn1/hnbap/Makefile
   asn1/inap/Makefile
+  asn1/kerberos/Makefile
   asn1/ldap/Makefile
   asn1/logotypecertextn/Makefile
   asn1/lte-rrc/Makefile
@@ -1723,6 +1812,7 @@ AC_OUTPUT(
   asn1/pkcs1/Makefile
   asn1/pkcs12/Makefile
   asn1/pkinit/Makefile
+  asn1/pkixac/Makefile
   asn1/pkix1explicit/Makefile
   asn1/pkix1implicit/Makefile
   asn1/pkixproxy/Makefile
@@ -1738,6 +1828,7 @@ AC_OUTPUT(
   asn1/rrc/Makefile
   asn1/rrlp/Makefile
   asn1/rtse/Makefile
+  asn1/rua/Makefile
   asn1/s1ap/Makefile
   asn1/s4406/Makefile
   asn1/sabp/Makefile
@@ -1765,6 +1856,8 @@ AC_OUTPUT(
   epan/doxygen.cfg
   epan/dfilter/Makefile
   epan/dissectors/Makefile
+  epan/dissectors/dcerpc/Makefile
+  epan/dissectors/pidl/Makefile
   epan/ftypes/Makefile
   epan/wslua/Makefile
   epan/wspython/Makefile
@@ -1788,6 +1881,7 @@ AC_OUTPUT(
   plugins/ethercat/Makefile
   plugins/giop/Makefile
   plugins/gryphon/Makefile
+  plugins/interlink/Makefile
   plugins/irda/Makefile
   plugins/m2m/Makefile
   plugins/mate/Makefile
@@ -1810,12 +1904,25 @@ dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
 
 # Pretty messages
 
+if test "x$enable_setcap_install" = "xyes" ; then
+       setcap_message="yes"
+else
+       setcap_message="no"
+fi
+
+
 if test "x$enable_setuid_install" = "xyes" ; then
        setuid_message="yes"
 else
        setuid_message="no"
 fi
 
+if test "x$DUMPCAP_GROUP" = "x" ; then
+       dumpcap_group_message="(none)"
+else
+       dumpcap_group_message="$DUMPCAP_GROUP"
+fi
+
 if test "x$want_zlib" = "xno" ; then
        zlib_message="no"
 else
@@ -1823,7 +1930,12 @@ else
 fi
 
 if test "x$want_pcre" = "xno" ; then
-       pcre_message="no"
+       if test $have_gregex = yes
+       then
+               pcre_message="no (using GRegex instead)"
+       else
+               pcre_message="no"
+       fi
 else
        pcre_message="yes"
 fi
@@ -1896,7 +2008,9 @@ echo "                      Build randpkt : $enable_randpkt"
 echo "                       Build dftest : $enable_dftest"
 echo "                     Build rawshark : $enable_rawshark"
 echo ""
+echo "  Install dumpcap with capabilities : $setcap_message"
 echo "             Install dumpcap setuid : $setuid_message"
+echo "                  Use dumpcap group : $dumpcap_group_message"
 echo "                        Use plugins : $have_plugins"
 echo "                    Use lua library : $lua_message"
 echo "                 Use python binding : $python_message"