• Home
  • Raw
  • Download

Lines Matching +full:python +full:- +full:version

2 #     https://www.gnu.org/software/autoconf-archive/ax_python_devel.html
7 # AX_PYTHON_DEVEL([version])
14 # This macro checks for Python and tries to get the include path to
15 # 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LIBS) output
17 # $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
19 # You can search for some particular version of Python by passing a
21 # note that you *have* to pass also an operator along with the version to
23 # version number. Don't use "PYTHON_VERSION" for this: that environment
24 # variable is declared as precious and thus reserved for the end-user.
26 # This macro should work for all versions of Python >= 2.1.0. As an end
27 # user, you can disable the check for the python version by setting the
31 # If you need to use this macro for an older Python version, please
36 # Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
46 # Free Software Foundation, either version 3 of the License, or (at your
47 # option) any later version.
67 # modified version of the Autoconf Macro, you may extend this special
68 # exception to the GPL to apply to your modified version as well.
75 # Allow the use of a (user set) custom python version
77 AC_ARG_VAR([PYTHON_VERSION],[The installed Python
78 version to use, for example '2.3'. This string
79 will be appended to the Python interpreter
82 AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
83 if test -z "$PYTHON"; then
84 AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
89 # Check for a version of Python >= 2.1.0
91 AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
92 ac_supports_python_ver=`$PYTHON -c "import sys; \
93 ver = sys.version.split ()[[0]]; \
96 if test -z "$PYTHON_NOVERSIONCHECK"; then
99 This version of the AC@&t@_PYTHON_DEVEL macro
100 doesn't work properly with versions of Python before
101 2.1.0. You may need to re-run configure, setting the
115 # if the macro parameter ``version'' is set, honour it
117 if test -n "$1"; then
118 AC_MSG_CHECKING([for a version of Python $1])
119 ac_supports_python_ver=`$PYTHON -c "import sys; \
120 ver = sys.version.split ()[[0]]; \
126 AC_MSG_ERROR([this package requires Python $1.
127 If you have it installed, but it isn't the default Python
129 variable to configure. See ``configure --help'' for reference.
138 AC_MSG_CHECKING([for the distutils Python package])
139 ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
140 if test $? -eq 0; then
144 AC_MSG_ERROR([cannot import Python module "distutils".
145 Please check your Python installation. The error was:
151 # Check for Python include path
153 AC_MSG_CHECKING([for Python include path])
154 if test -z "$PYTHON_CPPFLAGS"; then
155 python_path=`$PYTHON -c "import distutils.sysconfig; \
157 plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
159 if test -n "${python_path}"; then
161 python_path="-I$python_path -I$plat_python_path"
163 python_path="-I$python_path"
172 # Check for Python library path
174 AC_MSG_CHECKING([for Python library path])
175 if test -z "$PYTHON_LIBS"; then
176 # (makes two attempts to ensure we've got a version number
178 ac_python_version=`cat<<EOD | $PYTHON -
183 e = get_config_var('VERSION')
188 if test -z "$ac_python_version"; then
189 if test -n "$PYTHON_VERSION"; then
192 ac_python_version=`$PYTHON -c "import sys; \
193 print (sys.version[[:3]])"`
199 … [If available, contains the Python version number currently in use.])
202 ac_python_libdir=`cat<<EOD | $PYTHON -
212 ac_python_library=`cat<<EOD | $PYTHON -
217 print ('python'+c[['LDVERSION']])
219 print ('python'+c[['VERSION']])
222 # This small piece shamelessly adapted from PostgreSQL python macro;
226 if test -n "$ac_python_libdir" -a -n "$ac_python_library"
230 PYTHON_LIBS="-L$ac_python_libdir -l$ac_python_library"
233 ac_python_libdir=`$PYTHON -c \
237 PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
240 if test -z "PYTHON_LIBS"; then
242 Cannot determine location of your Python DSO. Please check it was installed with
253 AC_MSG_CHECKING([for Python site-packages path])
254 if test -z "$PYTHON_SITE_PKG"; then
255 PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
264 AC_MSG_CHECKING(python extra libraries)
265 if test -z "$PYTHON_EXTRA_LIBS"; then
266 PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
276 AC_MSG_CHECKING(python extra linking flags)
277 if test -z "$PYTHON_EXTRA_LDFLAGS"; then
278 PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
288 AC_MSG_CHECKING([consistency of all components of python development environment])
298 AC_LANG_PROGRAM([[#include <Python.h>]],
311 Could not link test program to Python. Maybe the main Python library has been
312 installed in some non-standard library path. If so, pass it to configure,
314 Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
317 You probably have to install the development version of the Python package