aclocal.m4 (cdf0e10c) aclocal.m4 (0ea1a209)
1# generated automatically by aclocal 1.9.1 -*- Autoconf -*-
1# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4# Free Software Foundation, Inc.
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
15# serial 1 (pkg-config-0.24)
16#
17# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
18#
19# This program is free software; you can redistribute it and/or modify
20# it under the terms of the GNU General Public License as published by
21# the Free Software Foundation; either version 2 of the License, or
22# (at your option) any later version.
23#
24# This program is distributed in the hope that it will be useful, but
25# WITHOUT ANY WARRANTY; without even the implied warranty of
26# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27# General Public License for more details.
28#
29# You should have received a copy of the GNU General Public License
30# along with this program; if not, write to the Free Software
31# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32#
33# As a special exception to the GNU General Public License, if you
34# distribute this file as part of a program that contains a
35# configuration script generated by Autoconf, you may include it under
36# the same distribution terms that you use for the rest of that program.
14
37
15dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
16dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
17dnl also defines GSTUFF_PKG_ERRORS on error
18AC_DEFUN(PKG_CHECK_MODULES, [
19 succeeded=no
38# PKG_PROG_PKG_CONFIG([MIN-VERSION])
39# ----------------------------------
40AC_DEFUN([PKG_PROG_PKG_CONFIG],
41[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
42m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
43m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
44AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
45AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
46AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
20
47
21 if test -z "$PKG_CONFIG"; then
22 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
23 fi
48if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
49 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
50fi
51if test -n "$PKG_CONFIG"; then
52 _pkg_min_version=m4_default([$1], [0.9.0])
53 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
54 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
55 AC_MSG_RESULT([yes])
56 else
57 AC_MSG_RESULT([no])
58 PKG_CONFIG=""
59 fi
60fi[]dnl
61])# PKG_PROG_PKG_CONFIG
24
62
25 if test "$PKG_CONFIG" = "no" ; then
26 echo "*** The pkg-config script could not be found. Make sure it is"
27 echo "*** in your path, or set the PKG_CONFIG environment variable"
28 echo "*** to the full path to pkg-config."
29 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
30 else
31 PKG_CONFIG_MIN_VERSION=0.9.0
32 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
33 AC_MSG_CHECKING(for $2)
63# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
64#
65# Check to see whether a particular set of modules exists. Similar
66# to PKG_CHECK_MODULES(), but does not set variables or print errors.
67#
68# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
69# only at the first occurence in configure.ac, so if the first place
70# it's called might be skipped (such as if it is within an "if", you
71# have to call PKG_CHECK_EXISTS manually
72# --------------------------------------------------------------
73AC_DEFUN([PKG_CHECK_EXISTS],
74[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
75if test -n "$PKG_CONFIG" && \
76 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
77 m4_default([$2], [:])
78m4_ifvaln([$3], [else
79 $3])dnl
80fi])
34
81
35 if $PKG_CONFIG --exists "$2" ; then
36 AC_MSG_RESULT(yes)
37 succeeded=yes
82# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
83# ---------------------------------------------
84m4_define([_PKG_CONFIG],
85[if test -n "$$1"; then
86 pkg_cv_[]$1="$$1"
87 elif test -n "$PKG_CONFIG"; then
88 PKG_CHECK_EXISTS([$3],
89 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
90 test "x$?" != "x0" && pkg_failed=yes ],
91 [pkg_failed=yes])
92 else
93 pkg_failed=untried
94fi[]dnl
95])# _PKG_CONFIG
38
96
39 AC_MSG_CHECKING($1_CFLAGS)
40 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
41 AC_MSG_RESULT($$1_CFLAGS)
97# _PKG_SHORT_ERRORS_SUPPORTED
98# -----------------------------
99AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
100[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
101if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
102 _pkg_short_errors_supported=yes
103else
104 _pkg_short_errors_supported=no
105fi[]dnl
106])# _PKG_SHORT_ERRORS_SUPPORTED
42
107
43 AC_MSG_CHECKING($1_LIBS)
44 $1_LIBS=`$PKG_CONFIG --libs "$2"`
45 AC_MSG_RESULT($$1_LIBS)
46 else
47 $1_CFLAGS=""
48 $1_LIBS=""
49 ## If we have a custom action on failure, don't print errors, but
50 ## do set a variable so people can do so.
51 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
52 ifelse([$4], ,echo $$1_PKG_ERRORS,)
53 fi
54
108
55 AC_SUBST($1_CFLAGS)
56 AC_SUBST($1_LIBS)
57 else
58 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
59 echo "*** See http://www.freedesktop.org/software/pkgconfig"
60 fi
61 fi
109# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
110# [ACTION-IF-NOT-FOUND])
111#
112#
113# Note that if there is a possibility the first call to
114# PKG_CHECK_MODULES might not happen, you should be sure to include an
115# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
116#
117#
118# --------------------------------------------------------------
119AC_DEFUN([PKG_CHECK_MODULES],
120[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
121AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
122AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
62
123
63 if test $succeeded = yes; then
64 ifelse([$3], , :, [$3])
65 else
66 ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
67 fi
68])
124pkg_failed=no
125AC_MSG_CHECKING([for $1])
69
126
127_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
128_PKG_CONFIG([$1][_LIBS], [libs], [$2])
70
129
130m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
131and $1[]_LIBS to avoid the need to call pkg-config.
132See the pkg-config man page for more details.])
71
133
134if test $pkg_failed = yes; then
135 AC_MSG_RESULT([no])
136 _PKG_SHORT_ERRORS_SUPPORTED
137 if test $_pkg_short_errors_supported = yes; then
138 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
139 else
140 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
141 fi
142 # Put the nasty error message in config.log where it belongs
143 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
72
144
73# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
74# Free Software Foundation, Inc.
145 m4_default([$4], [AC_MSG_ERROR(
146[Package requirements ($2) were not met:
75
147
76# This program is free software; you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
78# the Free Software Foundation; either version 2, or (at your option)
79# any later version.
148$$1_PKG_ERRORS
80
149
81# This program is distributed in the hope that it will be useful,
82# but WITHOUT ANY WARRANTY; without even the implied warranty of
83# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84# GNU General Public License for more details.
150Consider adjusting the PKG_CONFIG_PATH environment variable if you
151installed software in a non-standard prefix.
85
152
86# You should have received a copy of the GNU General Public License
87# along with this program; if not, write to the Free Software
88# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
89# 02111-1307, USA.
153_PKG_TEXT])[]dnl
154 ])
155elif test $pkg_failed = untried; then
156 AC_MSG_RESULT([no])
157 m4_default([$4], [AC_MSG_FAILURE(
158[The pkg-config script could not be found or is too old. Make sure it
159is in your PATH or set the PKG_CONFIG environment variable to the full
160path to pkg-config.
90
161
91# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
162_PKG_TEXT
92
163
164To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
165 ])
166else
167 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
168 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
169 AC_MSG_RESULT([yes])
170 $3
171fi[]dnl
172])# PKG_CHECK_MODULES
173
174# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
175# Free Software Foundation, Inc.
176#
177# This file is free software; the Free Software Foundation
178# gives unlimited permission to copy and/or distribute it,
179# with or without modifications, as long as this notice is preserved.
180
181# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
182# ---------------------------------------------------------------------------
93# Adds support for distributing Python modules and packages. To
94# install modules, copy them to $(pythondir), using the python_PYTHON
95# automake variable. To install a package with the same name as the
96# automake package, install to $(pkgpythondir), or use the
97# pkgpython_PYTHON automake variable.
183# Adds support for distributing Python modules and packages. To
184# install modules, copy them to $(pythondir), using the python_PYTHON
185# automake variable. To install a package with the same name as the
186# automake package, install to $(pkgpythondir), or use the
187# pkgpython_PYTHON automake variable.
98
188#
99# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
100# locations to install python extension modules (shared libraries).
101# Another macro is required to find the appropriate flags to compile
102# extension modules.
189# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
190# locations to install python extension modules (shared libraries).
191# Another macro is required to find the appropriate flags to compile
192# extension modules.
103
193#
104# If your package is configured with a different prefix to python,
105# users will have to add the install directory to the PYTHONPATH
106# environment variable, or create a .pth file (see the python
107# documentation for details).
194# If your package is configured with a different prefix to python,
195# users will have to add the install directory to the PYTHONPATH
196# environment variable, or create a .pth file (see the python
197# documentation for details).
108
198#
109# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
110# cause an error if the version of python installed on the system
111# doesn't meet the requirement. MINIMUM-VERSION should consist of
112# numbers and dots only.
199# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
200# cause an error if the version of python installed on the system
201# doesn't meet the requirement. MINIMUM-VERSION should consist of
202# numbers and dots only.
113
114AC_DEFUN([AM_PATH_PYTHON],
115 [
203AC_DEFUN([AM_PATH_PYTHON],
204 [
116 dnl Find a Python interpreter. Python versions prior to 1.5 are not
117 dnl supported because the default installation locations changed from
118 dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
119 dnl in 1.5.
120 m4_define([_AM_PYTHON_INTERPRETER_LIST],
121 [python python2 python2.6 python2.5 python2.4 python2.3 python2.2 dnl
122python2.1 python2.0 python1.6 python1.5])
205 dnl Find a Python interpreter. Python versions prior to 2.0 are not
206 dnl supported. (2.0 was released on October 16, 2000).
207 m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
208 [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl
209python2.1 python2.0])
123
124 m4_if([$1],[],[
125 dnl No version check is needed.
126 # Find any Python interpreter.
127 if test -z "$PYTHON"; then
210
211 m4_if([$1],[],[
212 dnl No version check is needed.
213 # Find any Python interpreter.
214 if test -z "$PYTHON"; then
128 PYTHON=:
129 AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST)
215 AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
130 fi
131 am_display_PYTHON=python
132 ], [
133 dnl A version check is needed.
134 if test -n "$PYTHON"; then
135 # If the user set $PYTHON, use it and don't search something else.
136 AC_MSG_CHECKING([whether $PYTHON version >= $1])
137 AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],

--- 24 unchanged lines hidden (view full) ---

162 m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
163 else
164
165 dnl Query Python for its version number. Getting [:3] seems to be
166 dnl the best way to do this; it's what "site.py" does in the standard
167 dnl library.
168
169 AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
216 fi
217 am_display_PYTHON=python
218 ], [
219 dnl A version check is needed.
220 if test -n "$PYTHON"; then
221 # If the user set $PYTHON, use it and don't search something else.
222 AC_MSG_CHECKING([whether $PYTHON version >= $1])
223 AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],

--- 24 unchanged lines hidden (view full) ---

248 m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
249 else
250
251 dnl Query Python for its version number. Getting [:3] seems to be
252 dnl the best way to do this; it's what "site.py" does in the standard
253 dnl library.
254
255 AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
170 [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
256 [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
171 AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
172
173 dnl Use the values of $prefix and $exec_prefix for the corresponding
174 dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
175 dnl distinct variables so they can be overridden if need be. However,
176 dnl general consensus is that you shouldn't need this ability.
177
178 AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
179 AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
180
181 dnl At times (like when building shared libraries) you may want
182 dnl to know which OS platform Python thinks this is.
183
184 AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
257 AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
258
259 dnl Use the values of $prefix and $exec_prefix for the corresponding
260 dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
261 dnl distinct variables so they can be overridden if need be. However,
262 dnl general consensus is that you shouldn't need this ability.
263
264 AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
265 AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
266
267 dnl At times (like when building shared libraries) you may want
268 dnl to know which OS platform Python thinks this is.
269
270 AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
185 [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
271 [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
186 AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
187
188
189 dnl Set up 4 directories:
190
191 dnl pythondir -- where to install python scripts. This is the
192 dnl site-packages directory, not the python standard library
193 dnl directory like in previous automake betas. This behavior
194 dnl is more consistent with lispdir.m4 for example.
195 dnl Query distutils for this directory. distutils does not exist in
196 dnl Python 1.5, so we fall back to the hardcoded directory if it
197 dnl doesn't work.
198 AC_CACHE_CHECK([for $am_display_PYTHON script directory],
199 [am_cv_python_pythondir],
272 AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
273
274
275 dnl Set up 4 directories:
276
277 dnl pythondir -- where to install python scripts. This is the
278 dnl site-packages directory, not the python standard library
279 dnl directory like in previous automake betas. This behavior
280 dnl is more consistent with lispdir.m4 for example.
281 dnl Query distutils for this directory. distutils does not exist in
282 dnl Python 1.5, so we fall back to the hardcoded directory if it
283 dnl doesn't work.
284 AC_CACHE_CHECK([for $am_display_PYTHON script directory],
285 [am_cv_python_pythondir],
200 [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
201 echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
286 [if test "x$prefix" = xNONE
287 then
288 am_py_prefix=$ac_default_prefix
289 else
290 am_py_prefix=$prefix
291 fi
292 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 ||
293 echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
294 case $am_cv_python_pythondir in
295 $am_py_prefix*)
296 am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
297 am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
298 ;;
299 *)
300 case $am_py_prefix in
301 /usr|/System*) ;;
302 *)
303 am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
304 ;;
305 esac
306 ;;
307 esac
308 ])
202 AC_SUBST([pythondir], [$am_cv_python_pythondir])
203
204 dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
205 dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
206 dnl more consistent with the rest of automake.
207
208 AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
209
210 dnl pyexecdir -- directory for installing python extension modules
211 dnl (shared libraries)
212 dnl Query distutils for this directory. distutils does not exist in
213 dnl Python 1.5, so we fall back to the hardcoded directory if it
214 dnl doesn't work.
215 AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
216 [am_cv_python_pyexecdir],
309 AC_SUBST([pythondir], [$am_cv_python_pythondir])
310
311 dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
312 dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
313 dnl more consistent with the rest of automake.
314
315 AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
316
317 dnl pyexecdir -- directory for installing python extension modules
318 dnl (shared libraries)
319 dnl Query distutils for this directory. distutils does not exist in
320 dnl Python 1.5, so we fall back to the hardcoded directory if it
321 dnl doesn't work.
322 AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
323 [am_cv_python_pyexecdir],
217 [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
218 echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
324 [if test "x$exec_prefix" = xNONE
325 then
326 am_py_exec_prefix=$am_py_prefix
327 else
328 am_py_exec_prefix=$exec_prefix
329 fi
330 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 ||
331 echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
332 case $am_cv_python_pyexecdir in
333 $am_py_exec_prefix*)
334 am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
335 am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
336 ;;
337 *)
338 case $am_py_exec_prefix in
339 /usr|/System*) ;;
340 *)
341 am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
342 ;;
343 esac
344 ;;
345 esac
346 ])
219 AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
220
221 dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
222
223 AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
224
225 dnl Run any user-specified action.
226 $2
227 fi
228
229])
230
231
232# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
233# ---------------------------------------------------------------------------
234# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
235# Run ACTION-IF-FALSE otherwise.
236# This test uses sys.hexversion instead of the string equivalent (first
237# word of sys.version), in order to cope with versions such as 2.2c1.
347 AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
348
349 dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
350
351 AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
352
353 dnl Run any user-specified action.
354 $2
355 fi
356
357])
358
359
360# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
361# ---------------------------------------------------------------------------
362# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
363# Run ACTION-IF-FALSE otherwise.
364# This test uses sys.hexversion instead of the string equivalent (first
365# word of sys.version), in order to cope with versions such as 2.2c1.
238# hexversion has been introduced in Python 1.5.2; it's probably not
239# worth to support older versions (1.5.1 was released on October 31, 1998).
366# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
240AC_DEFUN([AM_PYTHON_CHECK_VERSION],
367AC_DEFUN([AM_PYTHON_CHECK_VERSION],
241 [prog="import sys, string
368 [prog="import sys
242# split strings by '.' and convert to numeric. Append some zeros
243# because we need at least 4 digits for the hex conversion.
369# split strings by '.' and convert to numeric. Append some zeros
370# because we need at least 4 digits for the hex conversion.
244minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
371# map returns an iterator in Python 3.0 and a list in 2.x
372minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
245minverhex = 0
373minverhex = 0
246for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
374# xrange is not present in Python 3.0 and range returns an iterator
375for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
247sys.exit(sys.hexversion < minverhex)"
248 AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
249
376sys.exit(sys.hexversion < minverhex)"
377 AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
378
250# Copyright (C) 2001, 2003 Free Software Foundation, Inc. -*- Autoconf -*-
379# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
380#
381# This file is free software; the Free Software Foundation
382# gives unlimited permission to copy and/or distribute it,
383# with or without modifications, as long as this notice is preserved.
251
384
252# This program is free software; you can redistribute it and/or modify
253# it under the terms of the GNU General Public License as published by
254# the Free Software Foundation; either version 2, or (at your option)
255# any later version.
256
257# This program is distributed in the hope that it will be useful,
258# but WITHOUT ANY WARRANTY; without even the implied warranty of
259# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
260# GNU General Public License for more details.
261
262# You should have received a copy of the GNU General Public License
263# along with this program; if not, write to the Free Software
264# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
265# 02111-1307, USA.
266
267# AM_RUN_LOG(COMMAND)
268# -------------------
269# Run COMMAND, save the exit status in ac_status, and log it.
270# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
271AC_DEFUN([AM_RUN_LOG],
272[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
273 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
274 ac_status=$?
275 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
276 (exit $ac_status); }])
277
278m4_include([acinclude.m4])
385# AM_RUN_LOG(COMMAND)
386# -------------------
387# Run COMMAND, save the exit status in ac_status, and log it.
388# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
389AC_DEFUN([AM_RUN_LOG],
390[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
391 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
392 ac_status=$?
393 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
394 (exit $ac_status); }])
395
396m4_include([acinclude.m4])