summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/ac_python_devel.m430
1 files changed, 14 insertions, 16 deletions
diff --git a/m4/ac_python_devel.m4 b/m4/ac_python_devel.m4
index 99ff7d0..2e7406e 100644
--- a/m4/ac_python_devel.m4
+++ b/m4/ac_python_devel.m4
@@ -89,9 +89,9 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
89 # Check for a version of Python >= 2.1.0 89 # Check for a version of Python >= 2.1.0
90 # 90 #
91 AC_MSG_CHECKING([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, string; \ 92 ac_supports_python_ver=`$PYTHON -c "import sys; \
93 ver = string.split(sys.version)[[0]]; \ 93 ver = sys.version.split()[[0]]; \
94 print ver >= '2.1.0'"` 94 print(ver >= '2.1.0')"`
95 if test "$ac_supports_python_ver" != "True"; then 95 if test "$ac_supports_python_ver" != "True"; then
96 if test -z "$PYTHON_NOVERSIONCHECK"; then 96 if test -z "$PYTHON_NOVERSIONCHECK"; then
97 AC_MSG_RESULT([no]) 97 AC_MSG_RESULT([no])
@@ -116,9 +116,9 @@ to something else than an empty string.
116 # 116 #
117 if test -n "$1"; then 117 if test -n "$1"; then
118 AC_MSG_CHECKING([for a version of Python $1]) 118 AC_MSG_CHECKING([for a version of Python $1])
119 ac_supports_python_ver=`$PYTHON -c "import sys, string; \ 119 ac_supports_python_ver=`$PYTHON -c "import sys; \
120 ver = string.split(sys.version)[[0]]; \ 120 ver = sys.version.split()[[0]]; \
121 print ver $1"` 121 print(ver >= '2.1.0')"`
122 if test "$ac_supports_python_ver" = "True"; then 122 if test "$ac_supports_python_ver" = "True"; then
123 AC_MSG_RESULT([yes]) 123 AC_MSG_RESULT([yes])
124 else 124 else
@@ -153,7 +153,7 @@ $ac_distutils_result])
153 AC_MSG_CHECKING([for Python include path]) 153 AC_MSG_CHECKING([for Python include path])
154 if test -z "$PYTHON_CPPFLAGS"; then 154 if test -z "$PYTHON_CPPFLAGS"; then
155 python_path=`$PYTHON -c "import distutils.sysconfig; \ 155 python_path=`$PYTHON -c "import distutils.sysconfig; \
156 print distutils.sysconfig.get_python_inc();"` 156 print(distutils.sysconfig.get_python_inc());"`
157 if test -n "${python_path}"; then 157 if test -n "${python_path}"; then
158 python_path="-I$python_path" 158 python_path="-I$python_path"
159 fi 159 fi
@@ -170,21 +170,19 @@ $ac_distutils_result])
170 # (makes two attempts to ensure we've got a version number 170 # (makes two attempts to ensure we've got a version number
171 # from the interpreter) 171 # from the interpreter)
172 py_version=`$PYTHON -c "from distutils.sysconfig import *; \ 172 py_version=`$PYTHON -c "from distutils.sysconfig import *; \
173 from string import join; \ 173 print(' '.join(get_config_vars('VERSION')))"`
174 print join(get_config_vars('VERSION'))"`
175 if test "$py_version" = "[None]"; then 174 if test "$py_version" = "[None]"; then
176 if test -n "$PYTHON_VERSION"; then 175 if test -n "$PYTHON_VERSION"; then
177 py_version=$PYTHON_VERSION 176 py_version=$PYTHON_VERSION
178 else 177 else
179 py_version=`$PYTHON -c "import sys; \ 178 py_version=`$PYTHON -c "import sys; \
180 print sys.version[[:3]]"` 179 print(sys.version[[:3]]")`
181 fi 180 fi
182 fi 181 fi
183 182
184 PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \ 183 PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
185 from string import join; \ 184 print('-L' + get_python_lib(0,1) + \
186 print '-L' + get_python_lib(0,1), \ 185 ' -lpython');"`$py_version
187 '-lpython';"`$py_version
188 fi 186 fi
189 AC_MSG_RESULT([$PYTHON_LDFLAGS]) 187 AC_MSG_RESULT([$PYTHON_LDFLAGS])
190 AC_SUBST([PYTHON_LDFLAGS]) 188 AC_SUBST([PYTHON_LDFLAGS])
@@ -195,7 +193,7 @@ $ac_distutils_result])
195 AC_MSG_CHECKING([for Python site-packages path]) 193 AC_MSG_CHECKING([for Python site-packages path])
196 if test -z "$PYTHON_SITE_PKG"; then 194 if test -z "$PYTHON_SITE_PKG"; then
197 PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ 195 PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
198 print distutils.sysconfig.get_python_lib(0,0);"` 196 print(distutils.sysconfig.get_python_lib(0,0))"`
199 fi 197 fi
200 AC_MSG_RESULT([$PYTHON_SITE_PKG]) 198 AC_MSG_RESULT([$PYTHON_SITE_PKG])
201 AC_SUBST([PYTHON_SITE_PKG]) 199 AC_SUBST([PYTHON_SITE_PKG])
@@ -207,7 +205,7 @@ $ac_distutils_result])
207 if test -z "$PYTHON_EXTRA_LIBS"; then 205 if test -z "$PYTHON_EXTRA_LIBS"; then
208 PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ 206 PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
209 conf = distutils.sysconfig.get_config_var; \ 207 conf = distutils.sysconfig.get_config_var; \
210 print conf('LOCALMODLIBS'), conf('LIBS')"` 208 print(conf('LOCALMODLIBS'), conf('LIBS'))"`
211 fi 209 fi
212 AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) 210 AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
213 AC_SUBST(PYTHON_EXTRA_LIBS) 211 AC_SUBST(PYTHON_EXTRA_LIBS)
@@ -219,7 +217,7 @@ $ac_distutils_result])
219 if test -z "$PYTHON_EXTRA_LDFLAGS"; then 217 if test -z "$PYTHON_EXTRA_LDFLAGS"; then
220 PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ 218 PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
221 conf = distutils.sysconfig.get_config_var; \ 219 conf = distutils.sysconfig.get_config_var; \
222 print conf('LINKFORSHARED')"` 220 print(conf('LINKFORSHARED'))"`
223 fi 221 fi
224 AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) 222 AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
225 AC_SUBST(PYTHON_EXTRA_LDFLAGS) 223 AC_SUBST(PYTHON_EXTRA_LDFLAGS)