summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-05-01 20:59:59 -0700
committerColin Walters <walters@verbum.org>2015-09-29 23:16:33 -0400
commit899f5d553c65d7097c4137f528e71459a1036d4d (patch)
tree36bd070afdd49c640549ab48a4cfa4f064b7d245 /configure.ac
parent749df9a4c0ad63069cac8c5d17325175584b20d4 (diff)
downloadgobject-introspection-899f5d553c65d7097c4137f528e71459a1036d4d.tar.gz
configure.ac: Add --with-python configure flag
Add --with-python flag which overrides the $PYTHON environment variable when used. https://bugzilla.gnome.org/show_bug.cgi?id=679438
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
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*)