- Some more comments
[obnox/wireshark/wip.git] / configure.in
index 21b655aa48d29e91012d5cf0fef7e09c19148671..b435430ae5b3e5a8f2df4ab63acf95fe2c846b88 100644 (file)
@@ -1,6 +1,6 @@
 # $Id$
 #
-AC_INIT(etypes.h)
+AC_INIT(cfile.h)
 
 AC_PREREQ(2.52)
 
@@ -8,7 +8,7 @@ dnl Check for CPU / vendor / OS
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
-AM_INIT_AUTOMAKE(ethereal, 0.10.12)
+AM_INIT_AUTOMAKE(ethereal, 0.10.14)
 
 AM_DISABLE_STATIC
 
@@ -63,6 +63,24 @@ AC_PATH_PROG(DOXYGEN, doxygen)
 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
 
+# gnu tls
+AM_PATH_LIBGNUTLS(1.0.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
+        ]
+)        
+        
+
 # Check for xsltproc
 AC_PATH_PROG(XSLTPROC, xsltproc)
 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
@@ -121,7 +139,7 @@ AC_ARG_WITH(extra-gcc-checks,
 ],)
 AC_MSG_CHECKING(to see if we can add '-Wall -W $ethereal_extra_gcc_flags' to CFLAGS)
 if test x$GCC != x ; then
-  CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $ethereal_extra_gcc_flags $CFLAGS"
+  CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -Wpointer-arith -W $ethereal_extra_gcc_flags $CFLAGS"
   AC_MSG_RESULT(yes)
 else
   CFLAGS="-D_U_=\"\" $CFLAGS"
@@ -463,6 +481,7 @@ AC_CHECK_HEADERS(inttypes.h,
              printf("%" PRId64 "\n", (gint64)1);
              printf("%" PRIo64 "\n", (guint64)1);
              printf("%" PRIx64 "\n", (guint64)1);
+             printf("%" PRIX64 "\n", (guint64)1);
              printf("%" PRIu64 "\n", (guint64)1);
            }
          ]])
@@ -540,6 +559,22 @@ AC_SUBST(editcap_bin)
 AC_SUBST(editcap_man)
 
 
+# Enable/disable dumpcap
+
+AC_ARG_ENABLE(dumpcap,
+[  --enable-dumpcap        build dumpcap.  [default=yes]],enable_dumpcap=$enableval,enable_dumpcap=yes)
+
+if test "x$enable_dumpcap" = "xyes" ; then
+       dumpcap_bin="dumpcap\$(EXEEXT)"
+       dumpcap_man="dumpcap.1"
+else
+       dumpcap_bin=""
+       dumpcap_man=""
+fi
+AC_SUBST(dumpcap_bin)
+AC_SUBST(dumpcap_man)
+
+
 # Enable/disable capinfos
 
 AC_ARG_ENABLE(capinfos,
@@ -732,6 +767,41 @@ else
 fi
 
 
+dnl lua check
+AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
+
+AC_ARG_WITH(lua,
+[  --with-lua[[=DIR]]        use liblua (located in directory DIR, if supplied) for the lua scripting plugin.  [[default=no]]],
+[
+       if test $withval = no
+       then
+               want_lua=no
+       elif test $withval = yes
+       then
+               want_lua=yes
+       else
+               want_lua=yes
+               lua_dir=$withval
+       fi
+],[
+       #
+       # Don't use liblua by default (it isn't ready yet)
+       #
+       want_lua=no
+       lua_dir=
+])
+if test "x$want_lua" = "xno" ; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+       AC_ETHEREAL_LIBLUA_CHECK
+       if test "x$want_lua" = "xno" ; then
+               AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
+       fi
+fi
+AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
+
+
 dnl ipv6 check
 AC_ARG_ENABLE(ipv6,
 [  --enable-ipv6           use ipv6 name resolution, if available.  [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
@@ -753,7 +823,11 @@ AC_MSG_CHECKING(whether to install ethereal setuid)
 if test "x$enable_setuid_install" = "xno" ; then
        AC_MSG_RESULT(no)
 else
-       AC_MSG_RESULT(yes)
+       if test "x$enable_dumpcap" = "xno" ; then
+               AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap disabled)
+       else
+               AC_MSG_RESULT(yes)
+       fi
 fi
 
 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
@@ -959,6 +1033,19 @@ AC_C_BIGENDIAN
 # XXX - do we need this?
 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])
+])
+if test "$ac_cv_func_getopt" = no ; then
+  GETOPT_C="getopt.c"
+  GETOPT_O="getopt.o"
+fi
+AC_SUBST(GETOPT_C)
+AC_SUBST(GETOPT_O)
+
 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
 # then this won't work.
 SNPRINTF_C=""
@@ -1130,6 +1217,7 @@ AC_SUBST(STRPTIME_C)
 AC_SUBST(STRPTIME_O)
 
 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
+AC_CHECK_FUNCS(issetugid)
 
 dnl blank for now, but will be used in future
 AC_SUBST(ethereal_SUBDIRS)
@@ -1237,7 +1325,9 @@ AC_OUTPUT(
   plugins/enttec/Makefile
   plugins/giop/Makefile
   plugins/gryphon/Makefile
+  plugins/h223/Makefile
   plugins/irda/Makefile
+  plugins/lua/Makefile
   plugins/lwres/Makefile
   plugins/mate/Makefile
   plugins/megaco/Makefile
@@ -1276,6 +1366,12 @@ else
        pcre_message="yes"
 fi
 
+if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
+       lua_message="yes"
+else
+       lua_message="no"
+fi
+
 if test "x$want_ssl" = "xno" ; then
        ssl_message="no"
 else
@@ -1308,6 +1404,7 @@ echo "                    Build ethereal : $enable_ethereal"
 echo "                   Build tethereal : $enable_tethereal"
 echo "                    Build capinfos : $enable_capinfos"
 echo "                     Build editcap : $enable_editcap"
+echo "                     Build dumpcap : $enable_dumpcap"
 echo "                    Build mergecap : $enable_mergecap"
 echo "                   Build text2pcap : $enable_text2pcap"
 echo "                     Build idl2eth : $enable_idl2eth"
@@ -1316,6 +1413,7 @@ echo "                      Build dftest : $enable_dftest"
 echo ""
 echo "                    Install setuid : $setuid_message"
 echo "                       Use plugins : $have_plugins"
+echo "                  Build lua plugin : $lua_message"
 echo "               Use GTK+ v2 library : $enable_gtk2"
 if test "x$enable_gtk2" = "xyes" ; then
 echo "                       Use threads : $enable_threads"
@@ -1329,3 +1427,4 @@ echo "              Use GNU ADNS library : $adns_message"
 echo "            Use SSL crypto library : $ssl_message"
 echo "          Use IPv6 name resolution : $enable_ipv6"
 echo "     Use UCD SNMP/Net-SNMP library : $snmp_libs_message"
+echo "                Use gnutls library : $tls_message"