Fixes to autotools for python detection

This commit is contained in:
Vincent Castellano 2015-05-17 15:58:32 -07:00
parent d001bcd2ca
commit 77081999c4
7 changed files with 240 additions and 267 deletions

View File

@ -4,8 +4,7 @@ CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@ LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@ CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
DEFS=@DEFS@ DEFS=@DEFS@
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
#TODO re-add -Werror
EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@ EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS} LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS}
LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS} LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}

View File

@ -1 +0,0 @@
aclocal ; autoheader; automake ; autoconf

View File

@ -56,7 +56,8 @@
AC_DEFUN([AX_PYTHON], AC_DEFUN([AX_PYTHON],
[AC_MSG_CHECKING(for python build information) [AC_MSG_CHECKING(for python build information)
AC_MSG_RESULT([]) AC_MSG_RESULT([])
for python in python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do for python in python3.4 python3.3 python3.2 python3.1 python2.7 python2.6 python3, python2, python; do
AC_CHECK_PROGS(PYTHON_BIN, [$python]) AC_CHECK_PROGS(PYTHON_BIN, [$python])
ax_python_bin=$PYTHON_BIN ax_python_bin=$PYTHON_BIN
if test x$ax_python_bin != x; then if test x$ax_python_bin != x; then
@ -87,12 +88,21 @@ AC_MSG_RESULT([ Binary: $ax_python_bin])
AC_MSG_RESULT([ Library: $ax_python_lib]) AC_MSG_RESULT([ Library: $ax_python_lib])
AC_MSG_RESULT([ Include Dir: $ax_python_header]) AC_MSG_RESULT([ Include Dir: $ax_python_header])
PYTHON_FOUND=yes
if test x$ax_python_header != xno; then if test x$ax_python_header != xno; then
PYTHON_INCLUDE_DIR=$ax_python_header PYTHON_INCLUDE_DIR=$ax_python_header
AC_SUBST(PYTHON_INCLUDE_DIR) AC_SUBST(PYTHON_INCLUDE_DIR)
else
PYTHON_FOUND=no
fi fi
if test x$ax_python_lib != xno; then if test x$ax_python_lib != xno; then
PYTHON_LIB=$ax_python_lib PYTHON_LIB=$ax_python_lib
AC_SUBST(PYTHON_LIB) AC_SUBST(PYTHON_LIB)
else
PYTHON_FOUND=no
fi fi
AC_SUBST(PYTHON_FOUND)
])dnl ])dnl

6
bootstrap Executable file
View File

@ -0,0 +1,6 @@
#! /bin/sh
aclocal
autoheader
automake --gnu --add-missing
autoconf

View File

@ -164,12 +164,12 @@
/* use lua */ /* use lua */
#undef USE_LUA #undef USE_LUA
/* fixed for correct valgrind work */
#undef VALGRIND_FIXES
/* use python */ /* use python */
#undef USE_PYTHON #undef USE_PYTHON
/* fixed for correct valgrind work */
#undef VALGRIND_FIXES
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t #undef gid_t

396
configure vendored
View File

@ -624,15 +624,7 @@ EXTRA_LIBS
LIBOBJS LIBOBJS
PYTHON_CFLAGS PYTHON_CFLAGS
PYTHON_LIBS PYTHON_LIBS
pkgpyexecdir PYTHON_FOUND
pyexecdir
pkgpythondir
pythondir
PYTHON_PLATFORM
PYTHON_EXEC_PREFIX
PYTHON_PREFIX
PYTHON_VERSION
PYTHON
PYTHON_LIB PYTHON_LIB
PYTHON_INCLUDE_DIR PYTHON_INCLUDE_DIR
PYTHON_BIN PYTHON_BIN
@ -708,8 +700,8 @@ with_zlib
enable_libconfig enable_libconfig
enable_extf enable_extf
enable_liblua enable_liblua
enable_json
enable_python enable_python
enable_json
with_progname with_progname
enable_valgrind enable_valgrind
' '
@ -724,8 +716,7 @@ CPPFLAGS
CPP CPP
LUA LUA
LUA_INCLUDE LUA_INCLUDE
LUA_LIB LUA_LIB'
PYTHON'
# Initialize some variables set by options. # Initialize some variables set by options.
@ -1338,9 +1329,9 @@ Optional Features:
--enable-libconfig/--disable-libconfig --enable-libconfig/--disable-libconfig
--enable-extf/--disable-extf --enable-extf/--disable-extf
--enable-liblua/--disable-liblua --enable-liblua/--disable-liblua
--enable-python/--disable-python
--enable-json/--disable-json --enable-json/--disable-json
--enable-valgrind/--disable-valgrind --enable-valgrind/--disable-valgrind
--enable-python/--disable-python
Optional Packages: Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -1363,7 +1354,6 @@ Some influential environment variables:
LUA The Lua interpreter, e.g. /usr/bin/lua5.1 LUA The Lua interpreter, e.g. /usr/bin/lua5.1
LUA_INCLUDE The Lua includes, e.g. -I/usr/include/lua5.1 LUA_INCLUDE The Lua includes, e.g. -I/usr/include/lua5.1
LUA_LIB The Lua library, e.g. -llua5.1 LUA_LIB The Lua library, e.g. -llua5.1
PYTHON the Python interpreter
Use these variables to override the choices made by `configure' or to help Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. it to find libraries and programs with nonstandard names/locations.
@ -5940,14 +5930,25 @@ fi
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python" >&5
$as_echo_n "checking for python... " >&6; }
# Check whether --enable-python was given. # Check whether --enable-python was given.
if test "${enable_python+set}" = set; then : if test "${enable_python+set}" = set; then :
enableval=$enable_python; enableval=$enable_python;
if test "x$enableval" = "xno" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
$as_echo "disabled" >&6; }
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 "$as_me:${as_lineno-$LINENO}: checking for python build information" >&5
$as_echo_n "checking for python build information... " >&6; } $as_echo_n "checking for python build information... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
$as_echo "" >&6; } $as_echo "" >&6; }
for python in python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do for python in python3.4 python3.3 python3.2 python3.1 python2.7 python2.6 python3, python2, python; do
for ac_prog in $python for ac_prog in $python
do do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
@ -6097,94 +6098,61 @@ $as_echo " Library: $ax_python_lib" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Include Dir: $ax_python_header" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Include Dir: $ax_python_header" >&5
$as_echo " Include Dir: $ax_python_header" >&6; } $as_echo " Include Dir: $ax_python_header" >&6; }
PYTHON_FOUND=yes
if test x$ax_python_header != xno; then if test x$ax_python_header != xno; then
PYTHON_INCLUDE_DIR=$ax_python_header PYTHON_INCLUDE_DIR=$ax_python_header
else
PYTHON_FOUND=no
fi fi
if test x$ax_python_lib != xno; then if test x$ax_python_lib != xno; then
PYTHON_LIB=$ax_python_lib PYTHON_LIB=$ax_python_lib
else
PYTHON_FOUND=no
fi fi
if test $PYTHON_FOUND = no ; then
as_fn_error $? "No supported python lib version found. Try --disable-python" "$LINENO" 5
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.7.0" >&5
$as_echo_n "checking whether $PYTHON version is >= 2.7.0... " >&6; }
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
# map returns an iterator in Python 3.0 and a list in 2.x
minver = list(map(int, '2.7.0'.split('.'))) + [0, 0, 0]
minverhex = 0
# xrange is not present in Python 3.0 and range returns an iterator
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
sys.exit(sys.hexversion < minverhex)"
if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5
($PYTHON -c "$prog") >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
as_fn_error $? "Python interpreter is too old" "$LINENO" 5 EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
$as_echo "#define USE_PYTHON 1" >>confdefs.h
fi fi
am_display_PYTHON=$PYTHON fi
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.7.0" >&5
$as_echo_n "checking for a Python interpreter with version >= 2.7.0... " >&6; }
if ${am_cv_pathless_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else else
for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5
test "$am_cv_pathless_PYTHON" = none && break $as_echo "enabled" >&6; }
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python build information" >&5
# because we need at least 4 digits for the hex conversion. $as_echo_n "checking for python build information... " >&6; }
# map returns an iterator in Python 3.0 and a list in 2.x { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
minver = list(map(int, '2.7.0'.split('.'))) + [0, 0, 0] $as_echo "" >&6; }
minverhex = 0 for python in python3.4 python3.3 python3.2 python3.1 python2.7 python2.6 python3, python2, python; do
# xrange is not present in Python 3.0 and range returns an iterator
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] for ac_prog in $python
sys.exit(sys.hexversion < minverhex)" do
if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 # Extract the first word of "$ac_prog", so it can be a program name with args.
($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 set dummy $ac_prog; ac_word=$2
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then :
break
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5
$as_echo "$am_cv_pathless_PYTHON" >&6; }
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
if test "$am_cv_pathless_PYTHON" = none; then
PYTHON=:
else
# Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args.
set dummy $am_cv_pathless_PYTHON; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; } $as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON+:} false; then : if ${ac_cv_prog_PYTHON_BIN+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
case $PYTHON in if test -n "$PYTHON_BIN"; then
[\\/]* | ?:[\\/]*) ac_cv_prog_PYTHON_BIN="$PYTHON_BIN" # Let the user override the test.
ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. else
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH for as_dir in $PATH
do do
@ -6192,7 +6160,7 @@ do
test -z "$as_dir" && as_dir=. test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" ac_cv_prog_PYTHON_BIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2 break 2
fi fi
@ -6200,185 +6168,164 @@ done
done done
IFS=$as_save_IFS IFS=$as_save_IFS
;;
esac
fi fi
PYTHON=$ac_cv_path_PYTHON fi
if test -n "$PYTHON"; then PYTHON_BIN=$ac_cv_prog_PYTHON_BIN
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 if test -n "$PYTHON_BIN"; then
$as_echo "$PYTHON" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5
$as_echo "$PYTHON_BIN" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; } $as_echo "no" >&6; }
fi fi
fi test -n "$PYTHON_BIN" && break
am_display_PYTHON=$am_cv_pathless_PYTHON done
fi
ax_python_bin=$PYTHON_BIN
if test "$PYTHON" = :; then if test x$ax_python_bin != x; then
as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 as_ac_Lib=`$as_echo "ac_cv_lib_$ax_python_bin''_main" | $as_tr_sh`
else { $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 "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5
$as_echo_n "checking for $am_display_PYTHON version... " >&6; }
if ${am_cv_python_version+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` 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 fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5
$as_echo "$am_cv_python_version" >&6; }
PYTHON_VERSION=$am_cv_python_version
if test x$ax_python_lib == xno; then
as_ac_Lib=`$as_echo "ac_cv_lib_${ax_python_bin}m''_main" | $as_tr_sh`
PYTHON_PREFIX='${prefix}' { $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; }
PYTHON_EXEC_PREFIX='${exec_prefix}' if eval \${$as_ac_Lib+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5
$as_echo_n "checking for $am_display_PYTHON platform... " >&6; }
if ${am_cv_python_platform+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` ac_check_lib_save_LIBS=$LIBS
fi LIBS="-l${ax_python_bin}m $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
$as_echo "$am_cv_python_platform" >&6; } /* end confdefs.h. */
PYTHON_PLATFORM=$am_cv_python_platform
# Just factor out some code duplication. int
am_python_setup_sysconfig="\ main ()
import sys {
# Prefer sysconfig over distutils.sysconfig, for better compatibility return main ();
# with python 3.x. See automake bug#10227. ;
try: return 0;
import sysconfig }
except ImportError: _ACEOF
can_use_sysconfig = 0 if ac_fn_c_try_link "$LINENO"; then :
else: eval "$as_ac_Lib=yes"
can_use_sysconfig = 1
# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
# <https://github.com/pypa/virtualenv/issues/118>
try:
from platform import python_implementation
if python_implementation() == 'CPython' and sys.version[:3] == '2.7':
can_use_sysconfig = 0
except ImportError:
pass"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; }
if ${am_cv_python_pythondir+:} false; then :
$as_echo_n "(cached) " >&6
else else
if test "x$prefix" = xNONE eval "$as_ac_Lib=no"
then fi
am_py_prefix=$ac_default_prefix 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 else
am_py_prefix=$prefix ax_python_lib=no
fi fi
am_cv_python_pythondir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
sys.stdout.write(sitedir)"`
case $am_cv_python_pythondir in
$am_py_prefix*)
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
;;
*)
case $am_py_prefix in
/usr|/System*) ;;
*)
am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
;;
esac
;;
esac
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 if test x$ax_python_lib != xno; then
$as_echo "$am_cv_python_pythondir" >&6; } ax_python_header=`$ax_python_bin -c "from distutils.sysconfig import *; print(get_config_var('CONFINCLUDEPY'))"`
pythondir=$am_cv_python_pythondir if test x$ax_python_header != x; then
break;
fi
fi
fi
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
pkgpythondir=\${pythondir}/$PACKAGE
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5
$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; }
if ${am_cv_python_pyexecdir+:} false; then :
$as_echo_n "(cached) " >&6
else else
if test "x$exec_prefix" = xNONE PYTHON_FOUND=no
then fi
am_py_exec_prefix=$am_py_prefix
if test x$ax_python_lib != xno; then
PYTHON_LIB=$ax_python_lib
else else
am_py_exec_prefix=$exec_prefix PYTHON_FOUND=no
fi
am_cv_python_pyexecdir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
sys.stdout.write(sitedir)"`
case $am_cv_python_pyexecdir in
$am_py_exec_prefix*)
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
;;
*)
case $am_py_exec_prefix in
/usr|/System*) ;;
*)
am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
;;
esac
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5
$as_echo "$am_cv_python_pyexecdir" >&6; }
pyexecdir=$am_cv_python_pyexecdir
pkgpyexecdir=\${pyexecdir}/$PACKAGE
fi fi
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
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}" EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}" CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
$as_echo "#define USE_PYTHON 1" >>confdefs.h $as_echo "#define USE_PYTHON 1" >>confdefs.h
fi
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libjansson" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libjansson" >&5
$as_echo_n "checking for libjansson... " >&6; } $as_echo_n "checking for libjansson... " >&6; }
# Check whether --enable-json was given. # Check whether --enable-json was given.
@ -6499,6 +6446,7 @@ $as_echo "#define USE_JSON 1" >>confdefs.h
fi fi
#check for custom prog name #check for custom prog name
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking progname" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking progname" >&5
$as_echo_n "checking progname... " >&6; } $as_echo_n "checking progname... " >&6; }

View File

@ -94,20 +94,45 @@ AC_ARG_ENABLE(liblua,[--enable-liblua/--disable-liblua],
AC_MSG_ERROR([No lua found. Try --disable-liblua]) AC_MSG_ERROR([No lua found. Try --disable-liblua])
]) ])
]) ])
AC_MSG_CHECKING([for python])
AC_ARG_ENABLE(python,[--enable-python/--disable-python], AC_ARG_ENABLE(python,[--enable-python/--disable-python],
[ [
if test "x$enableval" = "xno" ; then
AC_MSG_RESULT([disabled])
else
AC_MSG_RESULT([enabled])
AX_PYTHON() AX_PYTHON()
dnl python checks (you can change the required python version bellow) AC_SUBST([PYTHON_FOUND])
AM_PATH_PYTHON(2.7.0) if test $PYTHON_FOUND = no ; then
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'` AC_MSG_ERROR([No supported python lib version found. Try --disable-python])
else
AC_SUBST([PYTHON_LIBS]) AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_CFLAGS]) AC_SUBST([PYTHON_CFLAGS])
EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}" EXTRA_LIBS="${EXTRA_LIBS} -l${PYTHON_LIB}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}" CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE_DIR}"
AC_DEFINE(USE_PYTHON,1,[use python]) AC_DEFINE(USE_PYTHON,1,[use 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_CHECKING([for libjansson]) AC_MSG_CHECKING([for libjansson])
AC_ARG_ENABLE(json,[--enable-json/--disable-json], AC_ARG_ENABLE(json,[--enable-json/--disable-json],
[ [
@ -124,20 +149,6 @@ AC_ARG_ENABLE(json,[--enable-json/--disable-json],
AC_DEFINE(USE_JSON,1,[use json]) AC_DEFINE(USE_JSON,1,[use json])
]) ])
AC_ARG_ENABLE(python,[--enable-python/--disable-python],
[
AX_PYTHON()
dnl python checks (you can change the required python version bellow)
AM_PATH_PYTHON(2.7.0)
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
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])
])
#check for custom prog name #check for custom prog name
AC_MSG_CHECKING([progname]) AC_MSG_CHECKING([progname])
AC_ARG_WITH(progname,[--with-progname=<name>], AC_ARG_WITH(progname,[--with-progname=<name>],