]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
allow python versions to be specified with --with-python option
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 16 May 2018 14:53:20 +0000 (16:53 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 16 May 2018 15:20:30 +0000 (17:20 +0200)
https://pagure.io/newt/issue/3

configure.ac

index d33489d072848c4599c6ed2cec251b274aefd34e..67bcd23cb7dacc4462bdf644899141348512471d 100644 (file)
@@ -59,12 +59,18 @@ fi
 AC_CHECK_HEADERS([popt.h libintl.h])
 
 AC_MSG_CHECKING([for python versions])
-AC_ARG_WITH([python], [  --without-python        do not compile python support])
+AC_ARG_WITH([python], [  --without-python        do not compile python support],
+            [], [with_python="yes"])
 if test "x$with_python" = "xno"; then
   AC_MSG_RESULT([skipped])
   PYTHONVERS=
 else
-  PYTHONVERS=$(ls /usr/include/python*/Python.h 2> /dev/null | sed 's|.*\(python[[0-9]]*\.[[0-9]]*\).*|\1|g' | tr '\n' ' ')
+  if test "x$with_python" = "xyes"; then
+    PYTHONVERS=$(ls /usr/include/python*/Python.h 2> /dev/null | \
+                 sed 's|.*\(python[[0-9]]*\.[[0-9]]*\).*|\1|g' | tr '\n' ' ')
+  else
+    PYTHONVERS="$with_python"
+  fi
   AC_MSG_RESULT([$PYTHONVERS])
 fi
 AC_SUBST([PYTHONVERS])