Update to V9.0.0 (2009-12)
[obnox/wireshark/wip.git] / configure.in
index a995f3d5231ec8d2741868aacfdc219db06dc7e7..e44c00154ad7df7ac5d82bfa6b0fdb396b829197 100644 (file)
@@ -2,18 +2,29 @@
 #
 AC_PREREQ(2.60)
 
+AC_INIT(wireshark, 1.3.3)
+
 dnl Check for CPU / vendor / OS
 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
 dnl needs.  Using `AC_CANONICAL_TARGET' is enough to run the two other
 dnl macros.
+dnl
+dnl As nothing in the Wireshark is itself a build tool (we are not,
+dnl for example, a compiler that generates machine code), we probably
+dnl don't need AC_CANONICAL_TARGET, so, in theory, we should be able
+dnl to use AC_CANONICAL_BUILD and AC_CANONICAL_HOST - or perhaps just
+dnl AC_CANONICAL_HOST - instead.  Note that we do have tools, such as
+dnl lemon, that need to be built for the build machine, not for the
+dnl host machine, so we might need both.
+dnl
+dnl This has to be done *after* AC_INIT, otherwise autogen.sh fails.
 
-dnl AC_CANONICAL_HOST
 dnl AC_CANONICAL_BUILD
-dnl AC_CANONICAL_TARGET
+dnl AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
 
-AC_INIT(wireshark, 1.3.0)
-AM_INIT_AUTOMAKE([1.9 tar-ustar])
+AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip])
 
 AM_DISABLE_STATIC
 
@@ -33,10 +44,10 @@ then
        AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
 fi
 AM_PROG_LEX
-AC_PATH_PROG(LEXDUMMY, $LEX)
-if test "x$LEXDUMMY" = x
+AC_PATH_PROG(LEX, flex)
+if test "x$LEX" = x
 then
-       AC_MSG_ERROR(I couldn't find (f)lex; make sure it's installed and in your path)
+       AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
 fi
 AC_PATH_PROG(POD2MAN, pod2man)
 if test "x$POD2MAN" = x
@@ -116,19 +127,15 @@ AC_ARG_WITH([gnutls],
                  [use gnutls library @<:@default=yes@:>@]),
   with_gnutls="$withval", with_gnutls="yes")
 if test "x$with_gnutls" = "xyes"; then
-  AM_PATH_LIBGNUTLS(1.2.0,
+  PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0],
         [
                 echo "gnuTLS found, enabling ssl decryption"
                 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use gnutls library])
                 tls_message="yes"
         ]
         , [
-                if test x$libgnutls_config_prefix != x ; then
-                       AC_MSG_ERROR([[gnuTLS not found; install gnuTLS-devel package for your system]])
-                else
-                        echo echo "gnuTLS not found, disabling ssl decryption"
-                        tls_message="no"
-                fi
+                echo echo "gnuTLS not found, disabling ssl decryption"
+                tls_message="no"
         ]
   )
 fi
@@ -230,12 +237,26 @@ AC_ARG_ENABLE(extra-gcc-checks,
        then
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Woverflow)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wlogical-op)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-overlength-strings)
 #              AC_WIRESHARK_GCC_CFLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
 #              AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wunreachable-code)
+#              AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wunsafe-loop-optimizations)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Waddress)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wattributes)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdiv-by-zero)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wignored-qualifiers)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpragmas)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wredundant-decls)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wvla)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wc++-compat)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wjump-misses-init)
                #
                # epan/dissectors/packet-ncp2222.inc blocks this one
                # for now.
@@ -254,6 +275,7 @@ AC_ARG_ENABLE(extra-gcc-checks,
        fi
 ],)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wextra) # -W is now known as -Wextra
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wendif-labels)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
@@ -262,6 +284,11 @@ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
 
+AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,--as-needed])
+# AC_WIRESHARK_GCC_LDFLAGS_CHECK([-flto])
+# AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhopr])
+# AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhole-program])
+
 #
 # If we're running gcc add '-D_U_="__attribute__((unused))"' to CFLAGS as well,
 # so we can use _U_ to flag unused function arguments and not get warnings
@@ -277,7 +304,7 @@ fi
 #
 # If we're running gcc, will enable a barrier "stop on warning".
 # This barrier is set for a very large part of the code. However, it is
-# typically not set for "generated" code  (lex, ans2wrs, idl2wrs, ...)
+# typically not set for "generated" code  (flex, ans2wrs, idl2wrs, ...)
 #
 warnings_as_errors_default="yes"
 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
@@ -399,6 +426,9 @@ cygwin*)
 esac
 AC_SUBST(LDFLAGS_SHAREDLIB)
 
+# Control silent compiling
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
+
 #
 # On OS X, if we find the headers for Core Foundation, Launch Services,
 # and Core Services, add -framework options to link with Application
@@ -1060,6 +1090,7 @@ AC_ARG_WITH(pcre,
 ],[
        #
        # Use libpcre if it's present, otherwise don't.
+       # XXX - Should GLib 2.14 take precedence here?
        #
        want_pcre=ifavailable
        pcre_dir=
@@ -1396,6 +1427,9 @@ AC_DEFINE(HAVE_AIRPDCAP, 1, [Enable AirPDcap (WPA/WPA2 decryption)])
 dnl Checks for typedefs, structures, and compiler characteristics.
 # AC_C_CONST
 
+# Check how we can get the time zone abbreviation
+AC_WIRESHARK_TIMEZONE_ABBREV
+
 # We need to know whether "struct sockaddr" has an "sa_len" member
 # for get_interface_list().
 
@@ -1410,13 +1444,15 @@ AC_PROG_GCC_TRADITIONAL
 
 GETOPT_C=""
 GETOPT_O=""
-AC_CHECK_FUNC(getopt, GETOPT_O="",
-  [GETOPT_O="getopt.o"
-   AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
-])
+AC_CHECK_FUNC(getopt,
+  [GETOPT_O=""
+   AC_DEFINE(HAVE_GETOPT_H, 1, [Define to 1 if you have the <getopt.h> header file.])
+  ],
+  GETOPT_O="wsgetopt.o"
+)
 if test "$ac_cv_func_getopt" = no ; then
-  GETOPT_C="getopt.c"
-  GETOPT_O="getopt.o"
+  GETOPT_C="wsgetopt.c"
+  GETOPT_O="wsgetopt.o"
 fi
 AC_SUBST(GETOPT_C)
 AC_SUBST(GETOPT_O)
@@ -1432,15 +1468,6 @@ fi
 AC_SUBST(STRERROR_C)
 AC_SUBST(STRERROR_O)
 
-AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
-  STRCASECMP_O="strcasecmp.o")
-if test "$ac_cv_func_strcasecmp" = no ; then
-  STRCASECMP_C="strcasecmp.c"
-  STRCASECMP_O="strcasecmp.o"
-fi
-AC_SUBST(STRCASECMP_C)
-AC_SUBST(STRCASECMP_O)
-
 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
   STRNCASECMP_O="strncasecmp.o")
 if test "$ac_cv_func_strncasecmp" = no ; then
@@ -1450,14 +1477,7 @@ fi
 AC_SUBST(STRNCASECMP_C)
 AC_SUBST(STRNCASECMP_O)
 
-AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
-  MKSTEMP_O="mkstemp.o")
-if test "$ac_cv_func_mkstemp" = no ; then
-  MKSTEMP_C="mkstemp.c"
-  MKSTEMP_O="mkstemp.o"
-fi
-AC_SUBST(MKSTEMP_C)
-AC_SUBST(MKSTEMP_O)
+AC_CHECK_FUNCS(mkstemp mkdtemp)
 
 #
 # XXX - if inet_aton isn't found, the build fails, with a complaint from
@@ -1618,6 +1638,18 @@ 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
 
@@ -1632,11 +1664,13 @@ AC_OUTPUT(
   asn1/acp133/Makefile
   asn1/acse/Makefile
   asn1/ansi_map/Makefile
-  asn1/ansi-tcap/Makefile
+  asn1/ansi_tcap/Makefile
   asn1/camel/Makefile
   asn1/cdt/Makefile
   asn1/charging_ase/Makefile
   asn1/cmip/Makefile
+  asn1/cmp/Makefile
+  asn1/crmf/Makefile
   asn1/cms/Makefile
   asn1/dap/Makefile
   asn1/disp/Makefile
@@ -1646,7 +1680,7 @@ AC_OUTPUT(
   asn1/ftam/Makefile
   asn1/gnm/Makefile
   asn1/goose/Makefile
-  asn1/gsmmap/Makefile
+  asn1/gsm_map/Makefile
   asn1/h225/Makefile
   asn1/h235/Makefile
   asn1/h245/Makefile
@@ -1660,13 +1694,13 @@ AC_OUTPUT(
   asn1/h501/Makefile
   asn1/inap/Makefile
   asn1/ldap/Makefile
-  asn1/logotype-cert-extn/Makefile
+  asn1/logotypecertextn/Makefile
   asn1/lte-rrc/Makefile
   asn1/mms/Makefile
   asn1/mpeg-audio/Makefile
   asn1/mpeg-pes/Makefile
   asn1/nbap/Makefile
-  asn1/ns-cert-exts/Makefile
+  asn1/ns_cert_exts/Makefile
   asn1/ocsp/Makefile
   asn1/p7/Makefile
   asn1/pcap/Makefile
@@ -1675,8 +1709,6 @@ AC_OUTPUT(
   asn1/pkinit/Makefile
   asn1/pkix1explicit/Makefile
   asn1/pkix1implicit/Makefile
-  asn1/pkixcmp/Makefile
-  asn1/pkixcrmf/Makefile
   asn1/pkixproxy/Makefile
   asn1/pkixqualified/Makefile
   asn1/pkixtsp/Makefile