diff options
-rw-r--r-- | configure.ac | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 38bb285f..f6e66613 100644 --- a/configure.ac +++ b/configure.ac @@ -251,6 +251,19 @@ AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull getauxval]) AC_CHECK_FUNCS([backtrace backtrace_symbols]) # Python +# option to specify python interpreter to use; this just sets $PYTHON, so that +# we will fallback to reading $PYTHON if --with-python is not given, and +# python.m4 will get the expected input +AC_ARG_WITH(python, + AS_HELP_STRING([--with-python=PATH],[Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]), + [PYTHON="$withval"], []) +if test x"$PYTHON" = xyes; then + AC_MSG_ERROR([--with-python option requires a path or program argument]) +fi +if test -n "$PYTHON" && ! which "$PYTHON"; then + AC_MSG_ERROR([Python interpreter $PYTHON does not exist]) +fi + AM_PATH_PYTHON([2.7]) case "$host" in *-*-mingw*) |