]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
--with-python=value now sets PYTHON_TOOLS
authorMark Andrews <marka@isc.org>
Tue, 1 May 2012 06:25:00 +0000 (16:25 +1000)
committerMark Andrews <marka@isc.org>
Thu, 28 Jun 2012 06:52:16 +0000 (16:52 +1000)
configure.in

index 2734aa570a15e9bc32080b7aad70bc9f3b93c44d..7a2b0831d9a7d40a913fa8bbbadd43d831a7870a 100644 (file)
@@ -145,28 +145,49 @@ AC_ARG_WITH(python,
     use_python="$withval", use_python="unspec")
 
 case "$use_python" in
-       unspec)
-                AC_PATH_PROGS(PYTHON, python)
-                AC_SUBST(PYTHON)
+       no)
+               AC_MSG_RESULT(disabled)
+               ;;
+       unspec|yes|*)
+               case "$use_python" in
+               unspec|yes|'')
+                       AC_PATH_PROGS(PYTHON, python)
+                       ;;
+               *)
+                       AC_PATH_PROGS(PYTHON, $use_python)
+                       ;;
+               esac
+               if test "X$PYTHON" == "X"
+               then
+                       case "$use_python" in
+                       unspec)
+                               AC_MSG_RESULT(disabled)
+                               ;;
+                       yes|*)
+                               AC_MSG_ERROR([missing python])
+                               ;;
+                       esac
+                       break
+               fi
                 testscript='try: import argparse
 except: exit(1)'
+               AC_MSG_CHECKING([python module 'argparse'])
                 if $PYTHON -c "$testscript"; then
-                        AC_MSG_RESULT([using $PYTHON])
+                        AC_MSG_RESULT([found, using $PYTHON])
                 else
+                       case "$use_python" in
+                       unspec)
+                               PYTHON=""
+                               AC_SUBST(PYTHON)
+                               AC_MSG_RESULT([not found, python disabled])
+                               ;;
+                       yes)
+                        AC_MSG_RESULT([no found])
                         AC_MSG_ERROR([python 'argparse' module not supported])
+                               ;;
+                       esac
                 fi
                ;;
-       yes)
-               AC_MSG_ERROR([--with-python must specify a path])
-               ;;
-       no)
-               AC_MSG_RESULT(disabled)
-               ;;
-       *)
-               AC_DEFINE_UNQUOTED(PYTHON, "$use_python")
-               AC_MSG_RESULT(using "$use_python")
-                AC_SUBST(PYTHON)
-               ;;
 esac
 
 PYTHON_TOOLS=''