From Dirk via bug #5771: Add heuristic dissector for images and HTTP
[obnox/wireshark/wip.git] / configure.in
index 70bfdebb3b7347c8528b13b014d83075d1f77f6c..f0041af9c37abea450043962e91c5908fe3e8601 100644 (file)
@@ -2,7 +2,7 @@
 #
 AC_PREREQ(2.60)
 
-AC_INIT(wireshark, 1.5.0)
+AC_INIT(wireshark, 1.5.1)
 
 dnl Check for CPU / vendor / OS
 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
@@ -38,6 +38,25 @@ AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
 AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
 AC_PATH_PROG(PERL, perl)
+#
+# XXX - should autogen.sh check for YACC/Bison and Flex?  A user building
+# from a distribution tarball shouldn't have to have YACC/Bison or Flex,
+# as the tarball should contain the results of running YACC/Bison on .y
+# files and running Flex on .l files, but a user building from SVN
+# will have to run YACC/Bison and Flex to process those files.
+#
+# On the other hand, what about users who use a distribution tarball to
+# do development?  They *shouldn't* - that's what the SVN repository is
+# for - but they might.  They'd get errors if they modify a .y or .l
+# file and try to do a build - but the error should tell them that they
+# need to get YACC/Bison and/or Flex.
+#
+# Then again, getting them shouldn't be too big of a burden.
+#
+# XXX - is the same true of pod2man and pod2html, or are they needed
+# even when building from a distribution tarball?
+#
+#
 AC_PROG_YACC
 AC_PATH_PROG(YACCDUMMY, $YACC)
 if test "x$YACCDUMMY" = x
@@ -98,14 +117,12 @@ else
        fi
 fi
 
-AC_PATH_PROG(LEX, flex)
 AC_PATH_PROG(PYTHON, python)
 
 AC_SUBST(PERL)
+AC_SUBST(LEX)
 AC_SUBST(POD2MAN)
 AC_SUBST(POD2HTML)
-AC_SUBST(LEX)
-AC_SUBST(FLEX_PATH)
 AC_SUBST(PYTHON)
 AC_SUBST(XSLTPROC)
 AC_SUBST(XMLLINT)
@@ -165,6 +182,12 @@ if test "x$with_gcrypt" = "xyes"; then
   )
 fi
 
+AC_ARG_WITH([gtk3],
+  AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
+                  [use GTK+ 3.0 instead of 2.0 @<:@default=no@:>@]),
+  with_gtk3="$withval", with_gtk="no")
+
+
 # libsmi
 # FIXME: currently the path argument to with-libsmi is being ignored
 AX_LIBSMI
@@ -306,6 +329,8 @@ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-fexcess-precision=fast)
 
 AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,--as-needed])
+###AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,-M])
+###AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,--cref])
 # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-flto])
 # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhopr])
 # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhole-program])
@@ -463,8 +488,9 @@ case "$host_os" in
 darwin*)
        AC_MSG_CHECKING([whether we can build with Core Foundation, Launch Services, and Core Services])
        ac_save_LIBS="$LIBS"
-       ac_frameworks="-framework ApplicationServices -framework CoreFoundation -framework CoreServices"
-       LIBS="$LIBS $ac_frameworks"
+       ac_coreservices_frameworks="-framework CoreServices"
+       ac_launchservices_frameworks="-framework ApplicationServices -framework CoreFoundation $ac_coreservices_frameworks"
+       LIBS="$LIBS $ac_launchservices_frameworks $ac_coreservices_frameworks"
        AC_TRY_LINK(
           [
 #       include <CoreFoundation/CFBase.h>
@@ -490,7 +516,8 @@ darwin*)
           [echo $ac_n "cross compiling; assumed OK... $ac_c"])
        if test "$ac_cv_can_use_osx_frameworks" = yes ; then
                AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
-               FRAMEWORKS="$ac_frameworks"
+               CORESERVICES_FRAMEWORKS="$ac_coreservices_frameworks"
+               LAUNCHSERVICES_FRAMEWORKS="$ac_launchservices_frameworks"
                AC_MSG_RESULT(yes)
        else
                AC_MSG_RESULT(no)
@@ -498,7 +525,8 @@ darwin*)
        LIBS="$ac_save_LIBS"
        ;;
 esac
-AC_SUBST(FRAMEWORKS)
+AC_SUBST(CORESERVICES_FRAMEWORKS)
+AC_SUBST(LAUNCHSERVICES_FRAMEWORKS)
 
 #
 # If using $prefix we add "$prefix/include" to the include search path
@@ -535,20 +563,24 @@ AC_ARG_ENABLE(usr-local,
 
 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
-       AC_MSG_RESULT(yes)
-       #
-       # Arrange that we search for header files in the source directory
-       # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
-       # as various packages we use ("libpcap", "zlib", "adns", "pcre")
-       # may have been installed under "/usr/local/include".
-       #
-       CFLAGS="$CFLAGS -I/usr/local/include"
-       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+       if test -d "/usr/local"; then
+               AC_MSG_RESULT(yes)
+               #
+               # Arrange that we search for header files in the source directory
+               # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
+               # as various packages we use ("libpcap", "zlib", "adns", "pcre")
+               # may have been installed under "/usr/local/include".
+               #
+               CFLAGS="$CFLAGS -I/usr/local/include"
+               CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 
-       #
-       # Arrange that we search for libraries in "/usr/local/lib".
-       #
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
+               #
+               # Arrange that we search for libraries in "/usr/local/lib".
+               #
+               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
+       else
+               AC_MSG_RESULT(no)
+       fi
 else
        AC_MSG_RESULT(no)
 fi
@@ -647,16 +679,38 @@ datafiledir=`(
 )`
 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
 
+# Create DOC_DIR #define for config.h
+docdir=`(
+    test "x$prefix" = xNONE && prefix=$ac_default_prefix
+    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+    # Ugly hack, but I don't see how this problem can be solved
+    # properly that DOC_DIR had a value starting with
+    # "${prefix}/" instead of e.g. "/usr/local/"
+    eval eval echo "$docdir"
+)`
+AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
+
 # GTK checks; we require GTK+ 2.4 or later.
 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
 # programs to be built with GTK+.
 #
 if test "x$enable_wireshark" = "xyes"; then
+if test "x$with_gtk3" = "xyes"; then
+       AM_PATH_GTK_3_0(3.0.0,
+        [
+                CFLAGS="$CFLAGS $GTK_CFLAGS"
+                CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
+                AC_DEFINE(HAVE_GTK, 1, [Define to 1 if compiling with GTK])
+        ], GTK_OK=no, gthread)
+
+else
        AM_PATH_GTK_2_0(2.4.0,
        [
                CFLAGS="$CFLAGS $GTK_CFLAGS"
                CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
+               AC_DEFINE(HAVE_GTK, 1, [Define to 1 if compiling with GTK])
        ], GTK_OK=no, gthread)
+fi
 else
        GTK_OK=no
 fi
@@ -955,10 +1009,13 @@ AC_ARG_ENABLE(dftest,
 
 if test "x$enable_dftest" = "xyes" ; then
        dftest_bin="dftest\$(EXEEXT)"
+       dftest_man="dftest.1"
 else
        dftest_bin=""
+       dftest_man=""
 fi
 AC_SUBST(dftest_bin)
+AC_SUBST(dftest_man)
 
 
 # Enable/disable randpkt
@@ -970,10 +1027,13 @@ AC_ARG_ENABLE(randpkt,
 
 if test "x$enable_randpkt" = "xyes" ; then
        randpkt_bin="randpkt\$(EXEEXT)"
+       randpkt_man="randpkt.1"
 else
        randpkt_bin=""
+       randpkt_man=""
 fi
 AC_SUBST(randpkt_bin)
+AC_SUBST(randpkt_man)
 
 
 
@@ -1133,6 +1193,12 @@ else
        fi
 fi
 
+if test "x$want_zlib" != "xno" ; then
+       AC_CHECK_LIB(z, gzclearerr,
+       [
+               AC_DEFINE(HAVE_GZCLEARERR, 1, [Define if we have gzclearerr])
+       ])
+fi
 
 dnl pcre check
 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
@@ -1495,7 +1561,7 @@ AC_SUBST(GEOIP_LIBS)
 dnl Python devel Check
 AC_ARG_WITH(python,
     AC_HELP_STRING( [--with-python@<:@=DIR@:>@],
-                    [use python interpretor (installed in DIR, if supplied). @<:@default=no@:>@ (EXPERIMENTAL)]),
+                    [use python interpreter (installed in DIR, if supplied). @<:@default=yes@:>@ (EXPERIMENTAL)]),
 [
 pythondir='${libdir}/wireshark/python/${VERSION}'
 if test "x$withval" = "xno"; then
@@ -1518,9 +1584,20 @@ AC_SUBST(pythondir)
 #
 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
 
+#
+# Define WS_MSVC_NORETURN appropriately for declarations of routines that
+# never return (just like Charlie on the MTA).
+#
+# Note that MSVC++ expects __declspec(noreturn) to precede the function
+# name and GCC, as far as I know, expects __attribute__((noreturn)) to
+# follow the function name, so we need two different flavors of
+# noreturn tag.
+#
+AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
+
 AC_ARG_ENABLE(airpcap,
   AC_HELP_STRING( [--enable-airpcap],
-                  [use airpcap in wireshark.  @<:@default=no@:>@]),
+                  [use airpcap in wireshark.  @<:@default=yes@:>@]),
   enable_airpcap=$enableval
   if test x$enable_airpcap != xno; then
        AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
@@ -1560,6 +1637,7 @@ AC_CHECK_FUNC(getopt,
 if test "$ac_cv_func_getopt" = no ; then
   GETOPT_LO="wsgetopt.lo"
 fi
+AM_CONDITIONAL(NEED_GETOPT_LO, test "x$ac_cv_func_getopt" = "xno")
 AC_SUBST(GETOPT_LO)
 
 AC_CHECK_FUNC(strerror, STRERROR_LO="",
@@ -1569,6 +1647,7 @@ AC_CHECK_FUNC(strerror, STRERROR_LO="",
 if test "$ac_cv_func_strerror" = no ; then
   STRERROR_LO="strerror.lo"
 fi
+AM_CONDITIONAL(NEED_STRERROR_LO, test "x$ac_cv_func_strerror" = "xno")
 AC_SUBST(STRERROR_LO)
 
 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_LO="",
@@ -1576,6 +1655,7 @@ AC_CHECK_FUNC(strncasecmp, STRNCASECMP_LO="",
 if test "$ac_cv_func_strncasecmp" = no ; then
   STRNCASECMP_LO="strncasecmp.lo"
 fi
+AM_CONDITIONAL(NEED_STRNCASECMP_LO, test "x$ac_cv_func_strncasecmp" = "xno")
 AC_SUBST(STRNCASECMP_LO)
 
 AC_CHECK_FUNCS(mkstemp mkdtemp)
@@ -1588,6 +1668,7 @@ if test "$have_inet_aton" = no; then
 else
   INET_ATON_LO=""
 fi
+AM_CONDITIONAL(NEED_INET_ATON_LO, test "x$have_inet_aton" = "xno")
 AC_SUBST(INET_ATON_LO)
 
 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
@@ -1616,6 +1697,7 @@ if test "$have_inet_pton" = no; then
 else
   INET_PTON_LO=""
 fi
+AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
 AC_SUBST(INET_PTON_LO)
 
 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
@@ -1645,6 +1727,7 @@ extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
   INET_NTOP_LO="inet_ntop.lo"
   AC_DEFINE(NEED_INET_V6DEFS_H, 1,
   [Define if inet/v6defs.h needs to be included])])
+AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
 AC_SUBST(INET_NTOP_LO)
 
 AC_CHECK_FUNC(strptime, STRPTIME_LO="",
@@ -1655,6 +1738,7 @@ if test "$ac_cv_func_strptime" = no ; then
   STRPTIME_LO="strptime.lo"
 fi
 AC_SUBST(STRPTIME_C)
+AM_CONDITIONAL(NEED_STRPTIME_LO, test "x$ac_cv_func_strptime" = "no")
 AC_SUBST(STRPTIME_LO)
 
 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
@@ -1716,18 +1800,6 @@ then
 fi
 AC_SUBST(ENABLE_STATIC)
 
-AC_ARG_ENABLE(new-packet-list,
-  AC_HELP_STRING( [--enable-new-packet-list],
-                  [use new packet list feature.  @<:@default=yes@:>@]),
-                  new_packet_list=$enableval,new_packet_list=yes)
-AC_MSG_CHECKING(if new packet list is used);
-if test "x$new_packet_list" = "xyes" ; then
-       AC_MSG_RESULT(yes)
-       CFLAGS=" -DNEW_PACKET_LIST $CFLAGS"
-else
-       AC_MSG_RESULT(no)
-fi
-
 dnl Save the cacheable configure results to config.cache before recursing
 AC_CACHE_SAVE
 
@@ -1758,6 +1830,7 @@ AC_OUTPUT(
   asn1/ftam/Makefile
   asn1/gnm/Makefile
   asn1/goose/Makefile
+  asn1/gprscdr/Makefile
   asn1/gsm_map/Makefile
   asn1/h225/Makefile
   asn1/h235/Makefile
@@ -1784,7 +1857,10 @@ AC_OUTPUT(
   asn1/nbap/Makefile
   asn1/ns_cert_exts/Makefile
   asn1/ocsp/Makefile
+  asn1/p1/Makefile
+  asn1/p22/Makefile
   asn1/p7/Makefile
+  asn1/p772/Makefile
   asn1/pcap/Makefile
   asn1/pkcs1/Makefile
   asn1/pkcs12/Makefile
@@ -1807,7 +1883,6 @@ AC_OUTPUT(
   asn1/rtse/Makefile
   asn1/rua/Makefile
   asn1/s1ap/Makefile
-  asn1/s4406/Makefile
   asn1/sabp/Makefile
   asn1/smrse/Makefile
   asn1/snmp/Makefile
@@ -1816,11 +1891,10 @@ AC_OUTPUT(
   asn1/t125/Makefile
   asn1/t38/Makefile
   asn1/tcap/Makefile
+  asn1/tetra/Makefile
   asn1/ulp/Makefile
   asn1/wlancertextn/Makefile
   asn1/x2ap/Makefile
-  asn1/x411/Makefile
-  asn1/x420/Makefile
   asn1/x509af/Makefile
   asn1/x509ce/Makefile
   asn1/x509if/Makefile
@@ -1957,7 +2031,11 @@ fi
 if test "x$have_good_adns" = "xyes" ; then
        adns_message="yes"
 else
-       adns_message="no"
+       if test "x$have_good_c_ares" = "xyes" ; then
+               adns_message="no (using c-ares instead)"
+       else
+               adns_message="no"
+       fi
 fi
 
 if test "x$have_good_libcap" = "xyes" ; then