]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
python: use python path found during configure
authorJason Ish <ish@unx.ca>
Thu, 15 Jun 2017 04:59:39 +0000 (22:59 -0600)
committerVictor Julien <victor@inliniac.net>
Fri, 16 Jun 2017 09:29:25 +0000 (11:29 +0200)
Also look for Python under more names. For example, on OpenBSD
if you just install Python 2, you will only get a python2.7
executable.

configure.ac
rust/Makefile.am
scripts/suricatasc/Makefile.am

index 0645750ff4d0534c46ad9827a2a7b77e51daafeb..2720c58e2226a94a93f999d0f0d097b6dc3cc765 100644 (file)
@@ -86,7 +86,7 @@
 
     AC_ARG_ENABLE(python,
            AS_HELP_STRING([--enable-python], [Enable python]),,[enable_python=yes])
-    AC_PATH_PROG(HAVE_PYTHON_CONFIG, python, "no")
+    AC_PATH_PROGS(HAVE_PYTHON, python python2 python2.7, "no")
     if test "x$enable_python" = "xno" ; then
         echo
         echo "   Warning! python disabled, you will not be      "
@@ -94,7 +94,7 @@
         echo
         enable_python="no"
     fi
-    if test "$HAVE_PYTHON_CONFIG" = "no"; then
+    if test "$HAVE_PYTHON" = "no"; then
         echo
         echo "   Warning! python not found, you will not be     "
         echo "   able to install suricatasc unix socket client   "
index 09cfc2554fe50b7f55f956096aab21fb1d335327..8b67c7bed3fe140ac37a7e8dc0369d49e5ff05ae 100644 (file)
@@ -28,7 +28,7 @@ endif
 all-local:
 if HAVE_PYTHON
        cd $(top_srcdir)/rust && CARGO_TARGET_DIR=$(abs_builddir)/target \
-               python ./gen-c-headers.py && \
+               $(HAVE_PYTHON) ./gen-c-headers.py && \
                cargo build $(RELEASE) $(FROZEN) --features "$(FEATURES)"
 else
        cd $(top_srcdir)/rust && CARGO_TARGET_DIR=$(abs_builddir)/target \
@@ -67,7 +67,7 @@ endif # HAVE_RUST
 if HAVE_PYTHON
 EXTRA_DIST +=  gen/c-headers
 gen/c-headers:
-       cd $(top_srcdir)/rust && python ./gen-c-headers.py
+       cd $(top_srcdir)/rust && $(HAVE_PYTHON) ./gen-c-headers.py
 else
 gen/c-headers:
 endif
index 63989347dc9aaed55a4c6dfefb62c302699df5e4..f31e5f059821b09483b255bc99b1d81b8c900eac 100644 (file)
@@ -3,13 +3,13 @@ EXTRA_DIST = setup.py suricatasc.in src/__init__.py src/suricatasc.py
 if HAVE_PYTHON
 all-local:
        mkdir -p $(top_builddir)/scripts/suricatasc/src
-       $(PYTHON) $(srcdir)/setup.py build;
+       $(HAVE_PYTHON) $(srcdir)/setup.py build;
 
 install-exec-local:
-       $(PYTHON) $(srcdir)/setup.py install --prefix $(DESTDIR)$(prefix)
+       $(HAVE_PYTHON) $(srcdir)/setup.py install --prefix $(DESTDIR)$(prefix)
 
 clean-local:
-       $(PYTHON) $(srcdir)/setup.py clean;
+       $(HAVE_PYTHON) $(srcdir)/setup.py clean;
        rm -rf $(top_builddir)/scripts/suricatasc/build
 
 uninstall-local: