configure: disable python by default
This commit is contained in:
parent
c69f2a2326
commit
9fd8a07d33
233
configure
vendored
233
configure
vendored
@ -6106,7 +6106,7 @@ $as_echo_n "checking for python... " >&6; }
|
||||
# Check whether --enable-python was given.
|
||||
if test "${enable_python+set}" = set; then :
|
||||
enableval=$enable_python;
|
||||
if test "x$enableval" = "xno" ; then
|
||||
if test "x$enableval" = "xyes" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
|
||||
$as_echo "disabled" >&6; }
|
||||
else
|
||||
@ -6343,235 +6343,8 @@ $as_echo "#define USE_PYTHON 1" >>confdefs.h
|
||||
|
||||
else
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5
|
||||
$as_echo "enabled" >&6; }
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python build information" >&5
|
||||
$as_echo_n "checking for python build information... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
|
||||
$as_echo "" >&6; }
|
||||
for python in python3.4 python3.3 python3.2 python3.1 python3 python2.7 python2.6 python2 python; do
|
||||
for ac_prog in $python
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; 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_prog_PYTHON_BIN+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$PYTHON_BIN"; then
|
||||
ac_cv_prog_PYTHON_BIN="$PYTHON_BIN" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
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_prog_PYTHON_BIN="$ac_prog"
|
||||
$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
|
||||
|
||||
fi
|
||||
fi
|
||||
PYTHON_BIN=$ac_cv_prog_PYTHON_BIN
|
||||
if test -n "$PYTHON_BIN"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5
|
||||
$as_echo "$PYTHON_BIN" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
test -n "$PYTHON_BIN" && break
|
||||
done
|
||||
|
||||
ax_python_bin=$PYTHON_BIN
|
||||
if test x$ax_python_bin != x; then
|
||||
as_ac_Lib=`$as_echo "ac_cv_lib_$ax_python_bin''_main" | $as_tr_sh`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$ax_python_bin" >&5
|
||||
$as_echo_n "checking for main in -l$ax_python_bin... " >&6; }
|
||||
if eval \${$as_ac_Lib+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-l$ax_python_bin $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return main ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
eval "$as_ac_Lib=yes"
|
||||
else
|
||||
eval "$as_ac_Lib=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
eval ac_res=\$$as_ac_Lib
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
$as_echo "$ac_res" >&6; }
|
||||
if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
|
||||
ax_python_lib=$ax_python_bin
|
||||
else
|
||||
ax_python_lib=no
|
||||
fi
|
||||
|
||||
if test x$ax_python_lib == xno; then
|
||||
as_ac_Lib=`$as_echo "ac_cv_lib_${ax_python_bin}m''_main" | $as_tr_sh`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${ax_python_bin}m" >&5
|
||||
$as_echo_n "checking for main in -l${ax_python_bin}m... " >&6; }
|
||||
if eval \${$as_ac_Lib+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-l${ax_python_bin}m $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return main ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
eval "$as_ac_Lib=yes"
|
||||
else
|
||||
eval "$as_ac_Lib=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
eval ac_res=\$$as_ac_Lib
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
$as_echo "$ac_res" >&6; }
|
||||
if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
|
||||
ax_python_lib=${ax_python_bin}m
|
||||
else
|
||||
ax_python_lib=no
|
||||
fi
|
||||
|
||||
fi
|
||||
if test x$ax_python_lib == xno; then
|
||||
as_ac_Lib=`$as_echo "ac_cv_lib_${ax_python_bin}mu''_main" | $as_tr_sh`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${ax_python_bin}mu" >&5
|
||||
$as_echo_n "checking for main in -l${ax_python_bin}mu... " >&6; }
|
||||
if eval \${$as_ac_Lib+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-l${ax_python_bin}mu $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return main ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
eval "$as_ac_Lib=yes"
|
||||
else
|
||||
eval "$as_ac_Lib=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
eval ac_res=\$$as_ac_Lib
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
$as_echo "$ac_res" >&6; }
|
||||
if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
|
||||
ax_python_lib=${ax_python_bin}mu
|
||||
else
|
||||
ax_python_lib=no
|
||||
fi
|
||||
|
||||
fi
|
||||
if test x$ax_python_lib != xno; then
|
||||
ax_python_header=`$ax_python_bin -c "from distutils.sysconfig import *; print(get_config_var('CONFINCLUDEPY'))"`
|
||||
if test x$ax_python_header != x; then
|
||||
break;
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
unset ac_cv_prog_PYTHON_BIN
|
||||
unset PYTHON_BIN
|
||||
done
|
||||
if test x$ax_python_bin = x; then
|
||||
ax_python_bin=no
|
||||
fi
|
||||
if test x$ax_python_header = x; then
|
||||
ax_python_header=no
|
||||
fi
|
||||
if test x$ax_python_lib = x; then
|
||||
ax_python_lib=no
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: results of the Python check:" >&5
|
||||
$as_echo " results of the Python check:" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Binary: $ax_python_bin" >&5
|
||||
$as_echo " Binary: $ax_python_bin" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Library: $ax_python_lib" >&5
|
||||
$as_echo " Library: $ax_python_lib" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Include Dir: $ax_python_header" >&5
|
||||
$as_echo " Include Dir: $ax_python_header" >&6; }
|
||||
|
||||
|
||||
PYTHON_FOUND=yes
|
||||
if test x$ax_python_header != xno; then
|
||||
PYTHON_INCLUDE_DIR=$ax_python_header
|
||||
|
||||
else
|
||||
PYTHON_FOUND=no
|
||||
fi
|
||||
|
||||
if test x$ax_python_lib != xno; then
|
||||
PYTHON_LIB=$ax_python_lib
|
||||
|
||||
else
|
||||
PYTHON_FOUND=no
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test $PYTHON_FOUND = no ; then
|
||||
as_fn_error $? "No supported python lib version found. Try --disable-python" "$LINENO" 5
|
||||
else
|
||||
|
||||
|
||||
EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
|
||||
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
|
||||
|
||||
$as_echo "#define USE_PYTHON 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
|
||||
$as_echo "disabled" >&6; }
|
||||
|
||||
fi
|
||||
|
||||
|
16
configure.ac
16
configure.ac
@ -109,7 +109,7 @@ AC_ARG_ENABLE(liblua,[--enable-liblua/--disable-liblua],
|
||||
AC_MSG_CHECKING([for python])
|
||||
AC_ARG_ENABLE(python,[--enable-python/--disable-python],
|
||||
[
|
||||
if test "x$enableval" = "xno" ; then
|
||||
if test "x$enableval" = "xyes" ; then
|
||||
AC_MSG_RESULT([disabled])
|
||||
else
|
||||
AC_MSG_RESULT([enabled])
|
||||
@ -127,19 +127,7 @@ AC_ARG_ENABLE(python,[--enable-python/--disable-python],
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT([enabled])
|
||||
|
||||
AX_PYTHON()
|
||||
AC_SUBST([PYTHON_FOUND])
|
||||
if test $PYTHON_FOUND = no ; then
|
||||
AC_MSG_ERROR([No supported python lib version found. Try --disable-python])
|
||||
else
|
||||
AC_SUBST([PYTHON_LIBS])
|
||||
AC_SUBST([PYTHON_CFLAGS])
|
||||
EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
|
||||
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
|
||||
AC_DEFINE(USE_PYTHON,1,[use python])
|
||||
fi
|
||||
AC_MSG_RESULT([disabled])
|
||||
])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user