--with-python (#970)

add --with-python configure option #969
This commit is contained in:
Scott Fennell 2020-03-17 12:28:34 -05:00 committed by GitHub
parent 255a53f34d
commit 3aa32b673e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 253 additions and 18 deletions

View File

@ -360,6 +360,44 @@ AS_IF([test "$ac_cv_path_CURL" = "nocurl"],AC_MSG_ERROR([could not find curl]),[
AC_PATH_PROG(PERL, perl)
AX_PROG_PERL_VERSION([5.14.0], [], [AC_MSG_ERROR([Trick requires perl version >= 5.14.0])])
AC_ARG_WITH(
[python],
AS_HELP_STRING(
[--with-python@<:@=DIR@:>@],
[python root directory],
),
[
PYTHON_HOME="$withval"
AC_PATH_PROG(PYTHON, python${PYTHON_VERSION}, nopython, "$PYTHON_HOME")
AS_IF(
[test "$ac_cv_path_PYTHON" = "nopython"],
[
AC_PATH_PROG(PYTHON, python, nopython, "$PYTHON_HOME")
AS_IF(
[test "$ac_cv_path_PYTHON" = "nopython"],
AC_MSG_ERROR([could not find python<version> or python in specified path]),
[]
)
],
[]
)
AC_PATH_PROG(PYTHON_CONFIG, python${PYTHON_VERSION}-config, nopython-config, "$PYTHON_HOME")
AS_IF(
[test "$ac_cv_path_PYTHON_CONFIG" = "nopython-config"],
[
AC_PATH_PROG(PYTHON_CONFIG, python-config, nopython-config, "$PYTHON_HOME")
AS_IF(
[test "$ac_cv_path_PYTHON_CONFIG" = "nopython-config"],
AC_MSG_ERROR([could not find python<version>-config or python-config in specified path please install python${PYTHON_VERSION}-dev]),
[]
)
],
[]
)
PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes`
PYTHON_LIBS=`${PYTHON_CONFIG} --libs`
],
[
AC_PATH_PROG(PYTHON, python${PYTHON_VERSION}, nopython)
AS_IF([test "$ac_cv_path_PYTHON" = "nopython"],
[
@ -375,6 +413,8 @@ AS_IF([test "$ac_cv_path_PYTHON" = "nopython"],
],
[AX_PYTHON_DEVEL([>='2.5'])]
)
]
)
AC_PATH_PROG(GNUPLOT, gnuplot, nognuplot)
AS_IF([test "$ac_cv_path_GNUPLOT" = "nognuplot"],AC_MSG_NOTICE([could not find gnuplot]),[])

197
configure vendored
View File

@ -658,6 +658,7 @@ PYTHON_LIBS
PYTHON_CPPFLAGS
PYTHON_VERSION
PYTHON3
PYTHON_CONFIG
PYTHON
PERL_VERSION
SED
@ -747,6 +748,7 @@ with_x
enable_32bit
enable_offline
enable_mongoose
with_python
with_swig
enable_java
with_llvm
@ -1417,6 +1419,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-x use the X Window System
--with-python[=DIR] python root directory
--with-swig[=DIR] path of directory containing the SWIG executable.
--with-llvm[=DIR] LLVM root directory
--with-zlib=DIR root directory path of zlib installation [defaults to
@ -5364,6 +5367,195 @@ $as_echo "$as_me: WARNING: could not find the perl interpreter" >&2;}
fi
# Check whether --with-python was given.
if test "${with_python+set}" = set; then :
withval=$with_python;
PYTHON_HOME="$withval"
# Extract the first word of "python${PYTHON_VERSION}", so it can be a program name with args.
set dummy python${PYTHON_VERSION}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PYTHON in
[\\/]* | ?:[\\/]*)
ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in "$PYTHON_HOME"
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="nopython"
;;
esac
fi
PYTHON=$ac_cv_path_PYTHON
if test -n "$PYTHON"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
$as_echo "$PYTHON" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$ac_cv_path_PYTHON" = "nopython"; then :
# Extract the first word of "python", so it can be a program name with args.
set dummy python; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PYTHON in
[\\/]* | ?:[\\/]*)
ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in "$PYTHON_HOME"
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="nopython"
;;
esac
fi
PYTHON=$ac_cv_path_PYTHON
if test -n "$PYTHON"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
$as_echo "$PYTHON" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$ac_cv_path_PYTHON" = "nopython"; then :
as_fn_error $? "could not find python<version> or python in specified path" "$LINENO" 5
fi
fi
# Extract the first word of "python${PYTHON_VERSION}-config", so it can be a program name with args.
set dummy python${PYTHON_VERSION}-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PYTHON_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PYTHON_CONFIG="$PYTHON_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in "$PYTHON_HOME"
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_PYTHON_CONFIG" && ac_cv_path_PYTHON_CONFIG="nopython-config"
;;
esac
fi
PYTHON_CONFIG=$ac_cv_path_PYTHON_CONFIG
if test -n "$PYTHON_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5
$as_echo "$PYTHON_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$ac_cv_path_PYTHON_CONFIG" = "nopython-config"; then :
# Extract the first word of "python-config", so it can be a program name with args.
set dummy python-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PYTHON_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PYTHON_CONFIG="$PYTHON_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in "$PYTHON_HOME"
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_PYTHON_CONFIG" && ac_cv_path_PYTHON_CONFIG="nopython-config"
;;
esac
fi
PYTHON_CONFIG=$ac_cv_path_PYTHON_CONFIG
if test -n "$PYTHON_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5
$as_echo "$PYTHON_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$ac_cv_path_PYTHON_CONFIG" = "nopython-config"; then :
as_fn_error $? "could not find python<version>-config or python-config in specified path please install python${PYTHON_VERSION}-dev" "$LINENO" 5
fi
fi
PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes`
PYTHON_LIBS=`${PYTHON_CONFIG} --libs`
else
# Extract the first word of "python${PYTHON_VERSION}", so it can be a program name with args.
set dummy python${PYTHON_VERSION}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@ -5405,7 +5597,6 @@ $as_echo "no" >&6; }
fi
if test "$ac_cv_path_PYTHON" = "nopython"; then :
# Extract the first word of "python3", so it can be a program name with args.
@ -5812,6 +6003,10 @@ See \`config.log' for more details" "$LINENO" 5; }
fi
fi
# Extract the first word of "gnuplot", so it can be a program name with args.
set dummy gnuplot; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5