Detect gnutls via pkg-config instead of the deprecated libgnutls-config.
[obnox/wireshark/wip.git] / configure.in
index e6e0b0c5dad0f7055faef41ab561c0c011590577..396c732d64fb9a9b66c398b0b0bcb2638dfeefe4 100644 (file)
@@ -12,7 +12,7 @@ dnl AC_CANONICAL_HOST
 dnl AC_CANONICAL_BUILD
 dnl AC_CANONICAL_TARGET
 
-AC_INIT(wireshark, 1.1.3)
+AC_INIT(wireshark, 1.3.0)
 AM_INIT_AUTOMAKE([1.9 tar-ustar])
 
 AM_DISABLE_STATIC
@@ -33,10 +33,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 +116,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,6 +226,7 @@ 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)
@@ -241,19 +238,20 @@ AC_ARG_ENABLE(extra-gcc-checks,
                # for now.
                #
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
-               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
-               #Temporarily put cast-align here waiting eradication of 'cast
-               #increases required alignment of target type' on the Solaris
-               #slave.
                #
                # epan/dissectors/packet-afs.c blocks this one for now.
                #
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshadow)
+               #
+               # More cleanup needed for this on LP64.
+               #
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
        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)
@@ -277,7 +275,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)
@@ -676,6 +674,43 @@ else
   have_plugins=no
 fi
 
+#
+# If we have <dlfcn.h>, check whether we can use dladdr to find a
+# filename (hopefully, a full pathname, but no guarantees) for
+# the executable.
+#
+if test "$ac_cv_header_dlfcn_h" = "yes"
+then
+       AC_MSG_CHECKING(whether dladdr can be used to find the pathname of an executable)
+       ac_save_CFLAGS="$CFLAGS"
+       ac_save_LIBS="$LIBS"
+       CFLAGS="$CFLAGS $GLIB_CFLAGS"
+       LIBS="$GLIB_LIBS $LIBS"
+       AC_TRY_RUN([
+#define _GNU_SOURCE    /* required on Linux, sigh */
+#include <dlfcn.h>
+
+int
+main(void)
+{
+       Dl_info info;
+
+       if (!dladdr((void *)main, &info))
+               return 1;       /* failure */
+       return 0;               /* assume success */
+}
+], ac_cv_dladdr_finds_executable_path=yes, ac_cv_dladdr_finds_executable_path=no,
+   [echo $ac_n "cross compiling; assumed OK... $ac_c"
+    ac_cv_dladdr_finds_executable_path=yes])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+       if test x$ac_cv_dladdr_finds_executable_path = xyes
+       then
+               AC_DEFINE(DLADDR_FINDS_EXECUTABLE_PATH, 1, [Define if dladdr can be used to find the path of the executable])
+       fi
+       AC_MSG_RESULT($ac_cv_dladdr_finds_executable_path)
+fi
+
 dnl IGE Mac integration check
 AC_MSG_CHECKING(whether to use IGE Mac integration functions)
 
@@ -1043,7 +1078,7 @@ AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
 
 AC_ARG_WITH(lua,
   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
-                  [use liblua (located in directory DIR, if supplied) for the lua scripting plugin.  @<:@default=no@:>@]),
+                  [use liblua (located in directory DIR, if supplied) for the lua scripting plugin.  @<:@default=yes, if available@:>@]),
 [
        if test $withval = no
        then
@@ -1057,9 +1092,9 @@ AC_ARG_WITH(lua,
        fi
 ],[
        #
-       # Don't use liblua by default (it isn't ready yet)
+       # Use liblua by default
        #
-       want_lua=no
+       want_lua=ifavailable
        lua_dir=
 ])
 if test "x$want_lua" = "xno" ; then
@@ -1316,12 +1351,40 @@ else
 fi
 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)]),
+[
+pythondir='${libdir}/wireshark/python/${VERSION}'
+if test "x$withval" = "xno"; then
+  want_python=no
+elif test "x$withval" != "xyes"; then
+  pythondir="$withval"
+  want_python=yes
+  AC_WIRESHARK_PYTHON_CHECK
+else
+  want_python=yes
+  AC_WIRESHARK_PYTHON_CHECK
+fi
+])
+AM_CONDITIONAL(HAVE_LIBPY, test x$want_python = xyes)
+AC_SUBST(pythondir)
+
 #
 # Define WS_VAR_IMPORT appropriately for declarations of external
 # variables exported from dynamically-linked libraries.
 #
 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
 
+AC_ARG_ENABLE(airpcap,
+  AC_HELP_STRING( [--enable-airpcap],
+                  [use airpcap in wireshark.  @<:@default=no@:>@]),
+  enable_airpcap=$enableval
+  if test x$enable_airpcap != xno; then
+       AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
+  fi
+)
 #
 # Define HAVE_AIRPDCAP
 # We'll want to remove this eventually.
@@ -1653,6 +1716,7 @@ AC_OUTPUT(
   epan/dissectors/Makefile
   epan/ftypes/Makefile
   epan/wslua/Makefile
+  epan/wspython/Makefile
   codecs/Makefile
   gtk/Makefile
   gtk/doxygen.cfg
@@ -1713,12 +1777,18 @@ else
        pcre_message="yes"
 fi
 
-if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
+if test "x$want_lua" = "xyes" ; then
        lua_message="yes"
 else
        lua_message="no"
 fi
 
+if test "x$want_python" = "xyes"; then
+        python_message="yes"
+else
+        python_message="no"
+fi
+
 if test "x$want_portaudio" = "xyes" ; then
        portaudio_message="yes"
 else
@@ -1777,7 +1847,8 @@ echo "                     Build rawshark : $enable_rawshark"
 echo ""
 echo "             Install dumpcap setuid : $setuid_message"
 echo "                        Use plugins : $have_plugins"
-echo "                   Build lua plugin : $lua_message"
+echo "                    Use lua library : $lua_message"
+echo "                 Use python binding : $python_message"
 echo "                   Build rtp_player : $portaudio_message"
 echo "                        Use threads : $enable_threads"
 echo "             Build profile binaries : $enable_profile_build"