Fix r35690: tvb_get_unicode_string() takes length in 8-bit bytes, not
[obnox/wireshark/wip.git] / configure.in
index 75f7d9a6d79d4e2082467836d890b409f68bd2b8..a4c7a97db344d32e37a478b23401fb431dbbd6c1 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)
@@ -654,6 +671,17 @@ 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+.
@@ -663,6 +691,7 @@ if test "x$enable_wireshark" = "xyes"; then
        [
                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
        GTK_OK=no
@@ -1146,6 +1175,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)
@@ -1508,7 +1543,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
@@ -1533,7 +1568,7 @@ AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external varia
 
 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])
@@ -1573,6 +1608,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="",
@@ -1582,6 +1618,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="",
@@ -1589,6 +1626,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)
@@ -1601,6 +1639,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], [
@@ -1629,6 +1668,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], [
@@ -1658,6 +1698,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="",
@@ -1668,6 +1709,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)
@@ -1736,7 +1778,8 @@ AC_ARG_ENABLE(new-packet-list,
 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"
+       AC_DEFINE(NEW_PACKET_LIST, 1,
+           [Use the new packet list code])
 else
        AC_MSG_RESULT(no)
 fi