1
## this one is commonly used with AM_PATH_PYTHONDIR ...
1
dnl AC_PYTHON_DEVEL([version])
3
dnl Originally copied from http://autoconf-archive.cryp.to/ac_python_devel.html
4
dnl (Original last modified 2007-07-31)
6
dnl Copyright © 2007 Sebastian Huber <sebastian-huber@web.de>
7
dnl Copyright © 2007 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
8
dnl Copyright © 2007 Rafael Laboissiere <rafael@laboissiere.net>
9
dnl Copyright © 2007 Andrew Collier <colliera@ukzn.ac.za>
10
dnl Copyright © 2007 Matteo Settenvini <matteo@member.fsf.org>
11
dnl Copyright © 2007 Horst Knorr <hk_classes@knoda.org>
13
dnl This program is free software: you can redistribute it and/or modify it
14
dnl under the terms of the GNU General Public License as published by the Free
15
dnl Software Foundation, either version 3 of the License, or (at your option)
16
dnl any later version.
18
dnl This program is distributed in the hope that it will be useful, but WITHOUT
19
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
23
dnl You should have received a copy of the GNU General Public License along with
24
dnl this program. If not, see <http://www.gnu.org/licenses/>.
26
dnl As a special exception, the respective Autoconf Macro's copyright owner
27
dnl gives unlimited permission to copy, distribute and modify the configure
28
dnl scripts that are the output of Autoconf when processing the Macro. You need
29
dnl not follow the terms of the GNU General Public License when using or
30
dnl distributing such scripts, even though portions of the text of the Macro
31
dnl appear in them. The GNU General Public License (GPL) does govern all other
32
dnl use of the material that constitutes the Autoconf Macro.
34
dnl This special exception to the GPL applies to versions of the Autoconf Macro
35
dnl released by the Autoconf Macro Archive. When you make and distribute a
36
dnl modified version of the Autoconf Macro, you may extend this special
37
dnl exception to the GPL to apply to your modified version as well.
39
AC_DEFUN([AC_PYTHON_DEVEL],[
41
# Allow the use of a (user set) custom python version
43
AC_ARG_VAR([PYTHON_VERSION],[The installed Python
44
version to use, for example '2.3'. This string
45
will be appended to the Python interpreter
48
AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
49
if test -z "$PYTHON"; then
50
AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
55
# Check for a version of Python >= 2.1.0
57
AC_MSG_CHECKING([for a version of Python >= 2.1.0])
58
ac_supports_python_ver=`$PYTHON -c "import sys, string; \
59
ver = string.split(sys.version)[[0]]; \
60
print ver >= '2.1.0'"`
61
if test "$ac_supports_python_ver" != "True"; then
62
if test -z "$PYTHON_NOVERSIONCHECK"; then
65
This version of the AC@&t@_PYTHON_DEVEL macro
66
doesn't work properly with versions of Python before
67
2.1.0. You may need to re-run configure, setting the
68
variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
69
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
70
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
71
to something else than an empty string.
74
AC_MSG_RESULT([skip at user request])
81
# if the macro parameter ``version'' is set, honour it
84
AC_MSG_CHECKING([for a version of Python >= $1])
85
ac_supports_python_ver=`$PYTHON -c "import sys, string; \
86
ver = string.split(sys.version)[[0]]; \
88
if test "$ac_supports_python_ver" = "True"; then
92
AC_MSG_ERROR([this package requires Python $1.
93
If you have it installed, but it isn't the default Python
94
interpreter in your system path, please pass the PYTHON_VERSION
95
variable to configure. See ``configure --help'' for reference.
102
# Check if you have distutils, else fail
104
AC_MSG_CHECKING([for the distutils Python package])
105
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
106
if test -z "$ac_distutils_result"; then
110
AC_MSG_ERROR([cannot import Python module "distutils".
111
Please check your Python installation. The error was:
112
$ac_distutils_result])
117
# Check for Python include path
119
AC_MSG_CHECKING([for Python include path])
120
if test -z "$PYTHON_CPPFLAGS"; then
121
python_path=`$PYTHON -c "import distutils.sysconfig; \
122
print distutils.sysconfig.get_python_inc();"`
123
if test -n "${python_path}"; then
124
python_path="-I$python_path"
126
PYTHON_CPPFLAGS=$python_path
128
AC_MSG_RESULT([$PYTHON_CPPFLAGS])
129
AC_SUBST([PYTHON_CPPFLAGS])
132
# Check for Python library path
134
AC_MSG_CHECKING([for Python library path])
135
if test -z "$PYTHON_LDFLAGS"; then
136
# (makes two attempts to ensure we've got a version number
137
# from the interpreter)
138
py_version=`$PYTHON -c "from distutils.sysconfig import *; \
139
from string import join; \
140
print join(get_config_vars('VERSION'))"`
141
if test "$py_version" == "[None]"; then
142
if test -n "$PYTHON_VERSION"; then
143
py_version=$PYTHON_VERSION
145
py_version=`$PYTHON -c "import sys; \
146
print sys.version[[:3]]"`
150
PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
151
from string import join; \
152
print '-L' + get_python_lib(0,1), \
153
'-lpython';"`$py_version
155
AC_MSG_RESULT([$PYTHON_LDFLAGS])
156
AC_SUBST([PYTHON_LDFLAGS])
159
# Check for the site packages
161
AC_MSG_CHECKING([for Python site-packages path])
162
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
163
if test -z "$PYTHON_SITE_PKG"; then
164
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
165
print distutils.sysconfig.get_python_lib(0,0,prefix='${PYTHON_EXEC_PREFIX}');"`
167
AC_MSG_RESULT([$PYTHON_SITE_PKG])
168
AC_SUBST([PYTHON_SITE_PKG])
171
# libraries which must be linked in when embedding
173
AC_MSG_CHECKING(python extra libraries)
174
if test -z "$PYTHON_EXTRA_LIBS"; then
175
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
176
conf = distutils.sysconfig.get_config_var; \
177
print conf('LOCALMODLIBS'), conf('LIBS')"`
179
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
180
AC_SUBST(PYTHON_EXTRA_LIBS)
183
# linking flags needed when embedding
185
AC_MSG_CHECKING(python extra linking flags)
186
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
187
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
188
conf = distutils.sysconfig.get_config_var; \
189
print conf('LINKFORSHARED')"`
191
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
192
AC_SUBST(PYTHON_EXTRA_LDFLAGS)
195
# final check to see if everything compiles alright
197
AC_MSG_CHECKING([consistency of all components of python development environment])
199
# save current global flags
200
LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
201
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
206
],[pythonexists=yes],[pythonexists=no])
208
AC_MSG_RESULT([$pythonexists])
210
if test ! "$pythonexists" = "yes"; then
212
Could not link test program to Python. Maybe the main Python library has been
213
installed in some non-standard library path. If so, pass it to configure,
214
via the LDFLAGS environment variable.
215
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
216
============================================================================
218
You probably have to install the development version of the Python package
219
for your distribution. The exact name of this package varies among them.
220
============================================================================
225
# turn back to default flags
226
CPPFLAGS="$ac_save_CPPFLAGS"
2
234
dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
3
235
dnl Check if a module containing a given symbol is visible to python.
4
236
AC_DEFUN([AM_CHECK_PYMOD],
5
[AC_REQUIRE([AM_PATH_PYTHON])
237
[AC_REQUIRE([AC_PYTHON_DEVEL])
6
238
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
7
239
AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
8
240
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
292
dnl AM_GCONF_SOURCE_2
293
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
294
dnl (i.e. pass to gconftool-2
295
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
296
dnl you should install foo.schemas files
299
AC_DEFUN([AM_GCONF_SOURCE_2],
301
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
302
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
304
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
307
AC_ARG_WITH(gconf-source,
308
[ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
310
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
311
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
313
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
314
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
317
AC_ARG_WITH(gconf-schema-file-dir,
318
[ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
320
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
321
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
323
AC_ARG_ENABLE(schemas-install,
324
[ --disable-schemas-install Disable the schemas installation],
325
[case ${enableval} in
327
*) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
329
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
331
# vala.m4 serial 1 (vala @VERSION@)
332
dnl Autoconf scripts for the Vala compiler
333
dnl Copyright (C) 2007 Mathias Hasselmann
335
dnl This library is free software; you can redistribute it and/or
336
dnl modify it under the terms of the GNU Lesser General Public
337
dnl License as published by the Free Software Foundation; either
338
dnl version 2 of the License, or (at your option) any later version.
340
dnl This library is distributed in the hope that it will be useful,
341
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
342
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
343
dnl Lesser General Public License for more details.
345
dnl You should have received a copy of the GNU Lesser General Public
346
dnl License along with this library; if not, write to the Free Software
347
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
350
dnl Mathias Hasselmann <mathias.hasselmann@gmx.de>
351
dnl --------------------------------------------------------------------------
353
dnl VALA_PROG_VALAC([MINIMUM-VERSION])
355
dnl Check whether the Vala compiler exists in `PATH'. If it is found the
356
dnl variable VALAC is set. Optionally a minimum release number of the compiler
357
dnl can be requested.
358
dnl --------------------------------------------------------------------------
359
AC_DEFUN([VALA_PROG_VALAC],[
360
AC_PATH_PROG([VALAC], [valac], [])
363
if test -z "x${VALAC}"; then
364
AC_MSG_WARN([No Vala compiler found. You will not be able to recompile .vala source files.])
365
elif test -n "x$1"; then
366
AC_REQUIRE([AC_PROG_AWK])
367
AC_MSG_CHECKING([valac is at least version $1])
369
if "${VALAC}" --version | "${AWK}" -v r='$1' 'function vn(s) { if (3 == split(s,v,".")) return (v[1]*1000+v[2])*1000+v[3]; else exit 2; } /^Vala / { exit vn(r) > vn($[2]) }'; then
373
AC_MSG_ERROR([Vala $1 not found.])
377
dnl as-ac-expand.m4 0.2.0 -*- autoconf -*-
378
dnl autostars m4 macro for expanding directories using configure's prefix
380
dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
382
dnl Copying and distribution of this file, with or without modification,
383
dnl are permitted in any medium without royalty provided the copyright
384
dnl notice and this notice are preserved.
386
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
389
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
390
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
391
AC_DEFUN([AS_AC_EXPAND],
396
dnl first expand prefix and exec_prefix if necessary
398
exec_prefix_save=$exec_prefix
400
dnl if no prefix given, then use /usr/local, the default prefix
401
if test "x$prefix" = "xNONE"; then
402
prefix="$ac_default_prefix"
404
dnl if no exec_prefix given, then use prefix
405
if test "x$exec_prefix" = "xNONE"; then
410
dnl loop until it doesn't change anymore
412
new_full_var="`eval echo $full_var`"
413
if test "x$new_full_var" = "x$full_var"; then break; fi
414
full_var=$new_full_var
418
full_var=$new_full_var
419
AC_SUBST([$1], "$full_var")
421
dnl restore prefix and exec_prefix
423
exec_prefix=$exec_prefix_save