Do the Python embedding similarly to other "default = yes, if available"
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 11 Jun 2011 19:05:17 +0000 (19:05 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 11 Jun 2011 19:05:17 +0000 (19:05 +0000)
items.

Add some quoting to the zlib tests, just in case the argument contains
white space.

Clean up capitalization of Lua and Python.

Link programs that use libwireshark with the Python libraries, and build
Epan with the Python cflags.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37652 f5534014-38df-0310-8fa8-9805f1628bb7

Makefile.am
acinclude.m4
configure.in
epan/Makefile.am

index ac4c031e8768a0a8ef621b11cea7dd6d2453967a..a99ad2d3db556ea49659d57d920d921617cf622e 100644 (file)
@@ -337,6 +337,7 @@ wireshark_LDADD = \
        @KRB5_LIBS@                     \
        @LAUNCHSERVICES_FRAMEWORKS@     \
        @CORESERVICES_FRAMEWORKS@       \
+       @PY_LIBS@                       \
        @LIBGCRYPT_LIBS@                \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@                \
@@ -365,6 +366,7 @@ tshark_LDADD = \
        @ADNS_LIBS@                     \
        @KRB5_LIBS@                     \
        @CORESERVICES_FRAMEWORKS@       \
+       @PY_LIBS@                       \
        @LIBGCRYPT_LIBS@                \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@
@@ -392,6 +394,7 @@ rawshark_LDADD = \
        @ADNS_LIBS@                     \
        @KRB5_LIBS@                     \
        @CORESERVICES_FRAMEWORKS@       \
+       @PY_LIBS@                       \
        @LIBGCRYPT_LIBS@                \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@
@@ -457,6 +460,7 @@ dftest_LDADD = \
        @C_ARES_LIBS@                   \
        @ADNS_LIBS@                     \
        @KRB5_LIBS@                     \
+       @PY_LIBS@                       \
        @LIBGCRYPT_LIBS@                \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@
index 9bd6390932731c9da6ae38496b72ceb8cc63bf22..dbe4810c4fc10e4dce7a6a5ebe374f833e37ba51 100644 (file)
@@ -1867,6 +1867,11 @@ AC_DEFUN([AC_WIRESHARK_PYTHON_CHECK],
            AC_MSG_ERROR("Python test program failed compilation")
          fi
           AC_MSG_RESULT([no])
+          #
+          # Set want_zlib to no, so we report that we aren't using
+          # the Python interpreter.
+          #
+         want_zlib=no
         ])
     fi
 #    ])
index d5fc646331213ecdf733b8bea1cca6f4b539d48d..a57da09cbfa311fce49c8d8856f9553a416d706e 100644 (file)
@@ -1262,15 +1262,15 @@ AC_ARG_WITH(zlib,
   AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
                  [use zlib (located in directory DIR, if supplied) for gzip compression and decompression .  @<:@default=yes, if available@:>@]),
 [
-       if test $withval = no
+       if test "x$withval" = "xno"
        then
                want_zlib=no
-       elif test $withval = yes
+       elif test "x$withval" = "xyes"
        then
                want_zlib=yes
        else
                want_zlib=yes
-               zlib_dir=$withval
+               zlib_dir="$withval"
        fi
 ],[
        #
@@ -1332,12 +1332,12 @@ else
 fi
 
 
-dnl lua check
-AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
+dnl Lua check
+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=yes, if available@:>@]),
+                  [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin.  @<:@default=yes, if available@:>@]),
 [
        if test $withval = no
        then
@@ -1655,23 +1655,38 @@ fi
 AC_SUBST(GEOIP_LIBS)
 
 dnl Python devel Check
+AC_MSG_CHECKING(whether to use the Python interpreter for scripting)
+
 AC_ARG_WITH(python,
     AC_HELP_STRING( [--with-python@<:@=DIR@:>@],
-                    [use python interpreter (installed in DIR, if supplied). @<:@default=yes@:>@ (EXPERIMENTAL)]),
+                    [use Python interpreter (installed in DIR, if supplied). @<:@default=yes, if available@:>@ (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
+       pythondir='${libdir}/wireshark/python/${VERSION}'
+       if test "x$withval" = "xno"
+       then
+               want_python=no
+       elif test "x$withval" = "xyes"
+       then
+               want_python=yes
+       else
+               want_python=yes
+               pythondir="$withval"
+       fi
+],[
+       #
+       # Use the embeddable Python interpreter if it's present,
+       # otherwise don't.
+       #
+       want_pythin=ifavailable
+       pythondir='${libdir}/wireshark/python/${VERSION}'
+])
+if test "x$want_python" = "xno" ; then
+        AC_MSG_RESULT(no)
 else
-  want_python=yes
-  AC_WIRESHARK_PYTHON_CHECK
+        AC_MSG_RESULT(yes)
+       AC_WIRESHARK_PYTHON_CHECK
 fi
-])
-AM_CONDITIONAL(HAVE_LIBPY, test x$want_python = xyes)
+AM_CONDITIONAL(HAVE_LIBPY, test x$want_python != xno)
 AC_SUBST(pythondir)
 
 #
@@ -2091,10 +2106,10 @@ else
        lua_message="no"
 fi
 
-if test "x$want_python" = "xyes"; then
-        python_message="yes"
-else
+if test "x$want_python" = "xno"; then
         python_message="no"
+else
+        python_message="yes"
 fi
 
 if test "x$want_portaudio" = "xyes" ; then
@@ -2161,8 +2176,8 @@ echo "  Install dumpcap with capabilities : $setcap_message"
 echo "             Install dumpcap setuid : $setuid_message"
 echo "                  Use dumpcap group : $dumpcap_group_message"
 echo "                        Use plugins : $have_plugins"
-echo "                    Use lua library : $lua_message"
-echo "                 Use python binding : $python_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"
index 5ef19ec6e339ced482a123fa81d70db8daf521ac..3c7c5ca0355b36dd2b326462890f0d533af0c790 100644 (file)
@@ -61,7 +61,7 @@ include Makefile.common
 
 INCLUDES = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) -I$(builddir)/wslua \
        @LUA_INCLUDES@ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
-       $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS)
+       $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS)
 
 
 if HAVE_WARNINGS_AS_ERRORS