Skip to content

Commit bda5bd9

Browse files
committed
Fix for Python being checked for during cross compilation even when --with-python was not used.
Re-enable SWIG Python bindings generation.
1 parent 0a5df84 commit bda5bd9

File tree

32 files changed

+1414
-192
lines changed

32 files changed

+1414
-192
lines changed

Makefile.in

+19-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
8484
$(top_srcdir)/m4/ax_log4cplus_wrappers.m4 \
8585
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/ax_pkg_swig.m4 \
8686
$(top_srcdir)/m4/ax_python_devel.m4 \
87-
$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
8887
$(top_srcdir)/m4/ax_swig_multi_module_support.m4 \
89-
$(top_srcdir)/m4/ax_swig_python.m4 \
9088
$(top_srcdir)/tests/configure.m4 $(top_srcdir)/configure.ac
9189
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
9290
$(ACLOCAL_M4)
@@ -200,6 +198,8 @@ AUTOHEADER = @AUTOHEADER@
200198
AUTOM4TE = @AUTOM4TE@
201199
AUTOMAKE = @AUTOMAKE@
202200
AWK = @AWK@
201+
AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
202+
AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
203203
CC = @CC@
204204
CCDEPMODE = @CCDEPMODE@
205205
CFLAGS = @CFLAGS@
@@ -261,13 +261,26 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
261261
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
262262
PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@
263263
PTHREAD_LIBS = @PTHREAD_LIBS@
264+
PYTHON = @PYTHON@
265+
PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
266+
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
267+
PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
268+
PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
269+
PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
270+
PYTHON_PLATFORM = @PYTHON_PLATFORM@
271+
PYTHON_PREFIX = @PYTHON_PREFIX@
272+
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
273+
PYTHON_VERSION = @PYTHON_VERSION@
264274
QT_CFLAGS = @QT_CFLAGS@
265275
QT_LIBS = @QT_LIBS@
266276
RANLIB = @RANLIB@
267277
SED = @SED@
268278
SET_MAKE = @SET_MAKE@
269279
SHELL = @SHELL@
270280
STRIP = @STRIP@
281+
SWIG = @SWIG@
282+
SWIG_FLAGS = @SWIG_FLAGS@
283+
SWIG_LIB = @SWIG_LIB@
271284
VERSION = @VERSION@
272285
abs_builddir = @abs_builddir@
273286
abs_srcdir = @abs_srcdir@
@@ -312,9 +325,13 @@ mandir = @mandir@
312325
mkdir_p = @mkdir_p@
313326
oldincludedir = @oldincludedir@
314327
pdfdir = @pdfdir@
328+
pkgpyexecdir = @pkgpyexecdir@
329+
pkgpythondir = @pkgpythondir@
315330
prefix = @prefix@
316331
program_transform_name = @program_transform_name@
317332
psdir = @psdir@
333+
pyexecdir = @pyexecdir@
334+
pythondir = @pythondir@
318335
sbindir = @sbindir@
319336
sharedstatedir = @sharedstatedir@
320337
srcdir = @srcdir@

acinclude.m4

-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ m4_include([m4/ax_log4cplus_wrappers.m4])
1818
m4_include([m4/pkg.m4])
1919
m4_include([m4/ax_pkg_swig.m4])
2020
m4_include([m4/ax_python_devel.m4])
21-
m4_include([m4/ax_swig_enable_cxx.m4])
2221
m4_include([m4/ax_swig_multi_module_support.m4])
23-
m4_include([m4/ax_swig_python.m4])

aclocal.m4

+219
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,225 @@ AC_DEFUN([_AM_SET_OPTIONS],
778778
AC_DEFUN([_AM_IF_OPTION],
779779
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
780780

781+
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
782+
#
783+
# This file is free software; the Free Software Foundation
784+
# gives unlimited permission to copy and/or distribute it,
785+
# with or without modifications, as long as this notice is preserved.
786+
787+
788+
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
789+
# ---------------------------------------------------------------------------
790+
# Adds support for distributing Python modules and packages. To
791+
# install modules, copy them to $(pythondir), using the python_PYTHON
792+
# automake variable. To install a package with the same name as the
793+
# automake package, install to $(pkgpythondir), or use the
794+
# pkgpython_PYTHON automake variable.
795+
#
796+
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
797+
# locations to install python extension modules (shared libraries).
798+
# Another macro is required to find the appropriate flags to compile
799+
# extension modules.
800+
#
801+
# If your package is configured with a different prefix to python,
802+
# users will have to add the install directory to the PYTHONPATH
803+
# environment variable, or create a .pth file (see the python
804+
# documentation for details).
805+
#
806+
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
807+
# cause an error if the version of python installed on the system
808+
# doesn't meet the requirement. MINIMUM-VERSION should consist of
809+
# numbers and dots only.
810+
AC_DEFUN([AM_PATH_PYTHON],
811+
[
812+
dnl Find a Python interpreter. Python versions prior to 2.0 are not
813+
dnl supported. (2.0 was released on October 16, 2000).
814+
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
815+
[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
816+
python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
817+
818+
AC_ARG_VAR([PYTHON], [the Python interpreter])
819+
820+
m4_if([$1],[],[
821+
dnl No version check is needed.
822+
# Find any Python interpreter.
823+
if test -z "$PYTHON"; then
824+
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
825+
fi
826+
am_display_PYTHON=python
827+
], [
828+
dnl A version check is needed.
829+
if test -n "$PYTHON"; then
830+
# If the user set $PYTHON, use it and don't search something else.
831+
AC_MSG_CHECKING([whether $PYTHON version is >= $1])
832+
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
833+
[AC_MSG_RESULT([yes])],
834+
[AC_MSG_RESULT([no])
835+
AC_MSG_ERROR([Python interpreter is too old])])
836+
am_display_PYTHON=$PYTHON
837+
else
838+
# Otherwise, try each interpreter until we find one that satisfies
839+
# VERSION.
840+
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
841+
[am_cv_pathless_PYTHON],[
842+
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
843+
test "$am_cv_pathless_PYTHON" = none && break
844+
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
845+
done])
846+
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
847+
if test "$am_cv_pathless_PYTHON" = none; then
848+
PYTHON=:
849+
else
850+
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
851+
fi
852+
am_display_PYTHON=$am_cv_pathless_PYTHON
853+
fi
854+
])
855+
856+
if test "$PYTHON" = :; then
857+
dnl Run any user-specified action, or abort.
858+
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
859+
else
860+
861+
dnl Query Python for its version number. Getting [:3] seems to be
862+
dnl the best way to do this; it's what "site.py" does in the standard
863+
dnl library.
864+
865+
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
866+
[am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
867+
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
868+
869+
dnl Use the values of $prefix and $exec_prefix for the corresponding
870+
dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
871+
dnl distinct variables so they can be overridden if need be. However,
872+
dnl general consensus is that you shouldn't need this ability.
873+
874+
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
875+
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
876+
877+
dnl At times (like when building shared libraries) you may want
878+
dnl to know which OS platform Python thinks this is.
879+
880+
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
881+
[am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
882+
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
883+
884+
885+
dnl Set up 4 directories:
886+
887+
dnl pythondir -- where to install python scripts. This is the
888+
dnl site-packages directory, not the python standard library
889+
dnl directory like in previous automake betas. This behavior
890+
dnl is more consistent with lispdir.m4 for example.
891+
dnl Query distutils for this directory.
892+
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
893+
[am_cv_python_pythondir],
894+
[if test "x$prefix" = xNONE
895+
then
896+
am_py_prefix=$ac_default_prefix
897+
else
898+
am_py_prefix=$prefix
899+
fi
900+
am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
901+
case $am_cv_python_pythondir in
902+
$am_py_prefix*)
903+
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
904+
am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
905+
;;
906+
*)
907+
case $am_py_prefix in
908+
/usr|/System*) ;;
909+
*)
910+
am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
911+
;;
912+
esac
913+
;;
914+
esac
915+
])
916+
AC_SUBST([pythondir], [$am_cv_python_pythondir])
917+
918+
dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
919+
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
920+
dnl more consistent with the rest of automake.
921+
922+
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
923+
924+
dnl pyexecdir -- directory for installing python extension modules
925+
dnl (shared libraries)
926+
dnl Query distutils for this directory.
927+
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
928+
[am_cv_python_pyexecdir],
929+
[if test "x$exec_prefix" = xNONE
930+
then
931+
am_py_exec_prefix=$am_py_prefix
932+
else
933+
am_py_exec_prefix=$exec_prefix
934+
fi
935+
am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
936+
case $am_cv_python_pyexecdir in
937+
$am_py_exec_prefix*)
938+
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
939+
am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
940+
;;
941+
*)
942+
case $am_py_exec_prefix in
943+
/usr|/System*) ;;
944+
*)
945+
am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
946+
;;
947+
esac
948+
;;
949+
esac
950+
])
951+
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
952+
953+
dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
954+
955+
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
956+
957+
dnl Run any user-specified action.
958+
$2
959+
fi
960+
961+
])
962+
963+
964+
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
965+
# ---------------------------------------------------------------------------
966+
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
967+
# Run ACTION-IF-FALSE otherwise.
968+
# This test uses sys.hexversion instead of the string equivalent (first
969+
# word of sys.version), in order to cope with versions such as 2.2c1.
970+
# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
971+
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
972+
[prog="import sys
973+
# split strings by '.' and convert to numeric. Append some zeros
974+
# because we need at least 4 digits for the hex conversion.
975+
# map returns an iterator in Python 3.0 and a list in 2.x
976+
minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
977+
minverhex = 0
978+
# xrange is not present in Python 3.0 and range returns an iterator
979+
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
980+
sys.exit(sys.hexversion < minverhex)"
981+
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
982+
983+
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
984+
#
985+
# This file is free software; the Free Software Foundation
986+
# gives unlimited permission to copy and/or distribute it,
987+
# with or without modifications, as long as this notice is preserved.
988+
989+
# AM_RUN_LOG(COMMAND)
990+
# -------------------
991+
# Run COMMAND, save the exit status in ac_status, and log it.
992+
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
993+
AC_DEFUN([AM_RUN_LOG],
994+
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
995+
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
996+
ac_status=$?
997+
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
998+
(exit $ac_status); }])
999+
7811000
# Check to make sure that the build environment is sane. -*- Autoconf -*-
7821001

7831002
# Copyright (C) 1996-2012 Free Software Foundation, Inc.

0 commit comments

Comments
 (0)