12
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
12
# PARTICULAR PURPOSE.
14
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15
15
m4_ifndef([AC_AUTOCONF_VERSION],
16
16
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18
[m4_warning([this file was generated for autoconf 2.68.
17
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18
[m4_warning([this file was generated for autoconf 2.69.
19
19
You have another version of autoconf. It may work, but is not guaranteed to.
20
20
If you have problems, you may need to regenerate the build system entirely.
21
To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
23
dnl -*- mode: autoconf -*-
24
dnl Copyright 2009 Johan Dahlin
26
dnl This file is free software; the author(s) gives unlimited
27
dnl permission to copy and/or distribute it, with or without
28
dnl modifications, as long as this notice is preserved.
33
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
35
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
36
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
37
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
39
dnl enable/disable introspection
40
m4_if([$2], [require],
42
enable_introspection=yes
44
AC_ARG_ENABLE(introspection,
45
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
46
[Enable introspection for this build]),,
47
[enable_introspection=auto])
50
AC_MSG_CHECKING([for gobject-introspection])
52
dnl presence/version checking
53
AS_CASE([$enable_introspection],
55
found_introspection="no (disabled, use --enable-introspection to enable)"
58
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
59
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
60
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
61
found_introspection=yes,
62
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
65
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
66
dnl Canonicalize enable_introspection
67
enable_introspection=$found_introspection
70
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
73
AC_MSG_RESULT([$found_introspection])
75
INTROSPECTION_SCANNER=
76
INTROSPECTION_COMPILER=
77
INTROSPECTION_GENERATE=
79
INTROSPECTION_TYPELIBDIR=
80
if test "x$found_introspection" = "xyes"; then
81
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
82
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
83
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
84
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
85
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
86
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
87
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
88
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
90
AC_SUBST(INTROSPECTION_SCANNER)
91
AC_SUBST(INTROSPECTION_COMPILER)
92
AC_SUBST(INTROSPECTION_GENERATE)
93
AC_SUBST(INTROSPECTION_GIRDIR)
94
AC_SUBST(INTROSPECTION_TYPELIBDIR)
95
AC_SUBST(INTROSPECTION_CFLAGS)
96
AC_SUBST(INTROSPECTION_LIBS)
97
AC_SUBST(INTROSPECTION_MAKEFILE)
99
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
104
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
106
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
108
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
112
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
115
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
117
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
120
dnl Autoconf macros for libgcrypt
121
dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc.
123
dnl This file is free software; as a special exception the author gives
124
dnl unlimited permission to copy and/or distribute it, with or without
125
dnl modifications, as long as this notice is preserved.
127
dnl This file is distributed in the hope that it will be useful, but
128
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
129
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
132
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
133
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
134
dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
135
dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
136
dnl with the API version to also check the API compatibility. Example:
137
dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
138
dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using
139
dnl this features allows to prevent build against newer versions of libgcrypt
140
dnl with a changed API.
142
AC_DEFUN([AM_PATH_LIBGCRYPT],
143
[ AC_ARG_WITH(libgcrypt-prefix,
144
AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
145
[prefix where LIBGCRYPT is installed (optional)]),
146
libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
147
if test x$libgcrypt_config_prefix != x ; then
148
if test x${LIBGCRYPT_CONFIG+set} != xset ; then
149
LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
153
AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
154
tmp=ifelse([$1], ,1:1.2.0,$1)
155
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
156
req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
157
min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
160
min_libgcrypt_version="$tmp"
163
AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
165
if test "$LIBGCRYPT_CONFIG" != "no" ; then
166
req_major=`echo $min_libgcrypt_version | \
167
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
168
req_minor=`echo $min_libgcrypt_version | \
169
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
170
req_micro=`echo $min_libgcrypt_version | \
171
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
172
libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
173
major=`echo $libgcrypt_config_version | \
174
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
175
minor=`echo $libgcrypt_config_version | \
176
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
177
micro=`echo $libgcrypt_config_version | \
178
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
179
if test "$major" -gt "$req_major"; then
182
if test "$major" -eq "$req_major"; then
183
if test "$minor" -gt "$req_minor"; then
186
if test "$minor" -eq "$req_minor"; then
187
if test "$micro" -ge "$req_micro"; then
195
if test $ok = yes; then
196
AC_MSG_RESULT([yes ($libgcrypt_config_version)])
200
if test $ok = yes; then
201
# If we have a recent libgcrypt, we should also check that the
203
if test "$req_libgcrypt_api" -gt 0 ; then
204
tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
205
if test "$tmp" -gt 0 ; then
206
AC_MSG_CHECKING([LIBGCRYPT API version])
207
if test "$req_libgcrypt_api" -eq "$tmp" ; then
208
AC_MSG_RESULT([okay])
211
AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
216
if test $ok = yes; then
217
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
218
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
219
ifelse([$2], , :, [$2])
220
if test x"$host" != x ; then
221
libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
222
if test x"$libgcrypt_config_host" != xnone ; then
223
if test x"$libgcrypt_config_host" != x"$host" ; then
226
*** The config script $LIBGCRYPT_CONFIG was
227
*** built for $libgcrypt_config_host and thus may not match the
229
*** You may want to use the configure option --with-libgcrypt-prefix
230
*** to specify a matching config script.
238
ifelse([$3], , :, [$3])
240
AC_SUBST(LIBGCRYPT_CFLAGS)
241
AC_SUBST(LIBGCRYPT_LIBS)
23
244
# nls.m4 serial 5 (gettext-0.18)
24
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
245
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
26
247
dnl This file is free software; the Free Software Foundation
27
248
dnl gives unlimited permission to copy and/or distribute it,
212
435
])# PKG_CHECK_MODULES
214
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
438
# PKG_INSTALLDIR(DIRECTORY)
439
# -------------------------
440
# Substitutes the variable pkgconfigdir as the location where a module
441
# should install pkg-config .pc files. By default the directory is
442
# $libdir/pkgconfig, but the default can be changed by passing
443
# DIRECTORY. The user can override through the --with-pkgconfigdir
445
AC_DEFUN([PKG_INSTALLDIR],
446
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
447
m4_pushdef([pkg_description],
448
[pkg-config installation directory @<:@]pkg_default[@:>@])
449
AC_ARG_WITH([pkgconfigdir],
450
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
451
[with_pkgconfigdir=]pkg_default)
452
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
453
m4_popdef([pkg_default])
454
m4_popdef([pkg_description])
455
]) dnl PKG_INSTALLDIR
458
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
459
# -------------------------
460
# Substitutes the variable noarch_pkgconfigdir as the location where a
461
# module should install arch-independent pkg-config .pc files. By
462
# default the directory is $datadir/pkgconfig, but the default can be
463
# changed by passing DIRECTORY. The user can override through the
464
# --with-noarch-pkgconfigdir parameter.
465
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
466
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
467
m4_pushdef([pkg_description],
468
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
469
AC_ARG_WITH([noarch-pkgconfigdir],
470
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
471
[with_noarch_pkgconfigdir=]pkg_default)
472
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
473
m4_popdef([pkg_default])
474
m4_popdef([pkg_description])
475
]) dnl PKG_NOARCH_INSTALLDIR
477
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
217
479
# This file is free software; the Free Software Foundation
218
480
# gives unlimited permission to copy and/or distribute it,
219
481
# with or without modifications, as long as this notice is preserved.
223
483
# AM_AUTOMAKE_VERSION(VERSION)
224
484
# ----------------------------
225
485
# Automake X.Y traces this macro to ensure aclocal.m4 has been
226
486
# generated from the m4 files accompanying Automake X.Y.
227
487
# (This private macro should not be called outside this file.)
228
488
AC_DEFUN([AM_AUTOMAKE_VERSION],
229
[am__api_version='1.11'
489
[am__api_version='1.13'
230
490
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
231
491
dnl require some minimum version. Point them to the right macro.
232
m4_if([$1], [1.11.3], [],
492
m4_if([$1], [1.13.1], [],
233
493
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
662
913
# Define the identity of the package.
663
914
dnl Distinguish between old-style and new-style calls.
665
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
916
[AC_DIAGNOSE([obsolete],
917
[$0: two- and three-arguments forms are deprecated.])
918
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
666
919
AC_SUBST([PACKAGE], [$1])dnl
667
920
AC_SUBST([VERSION], [$2])],
668
921
[_AM_SET_OPTIONS([$1])dnl
669
922
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
670
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
924
m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
671
926
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
672
927
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
673
928
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
675
930
_AM_IF_OPTION([no-define],,
676
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
677
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
931
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
932
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
679
934
# Some tools Automake needs.
680
935
AC_REQUIRE([AM_SANITY_CHECK])dnl
681
936
AC_REQUIRE([AC_ARG_PROGRAM])dnl
682
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
683
AM_MISSING_PROG(AUTOCONF, autoconf)
684
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
685
AM_MISSING_PROG(AUTOHEADER, autoheader)
686
AM_MISSING_PROG(MAKEINFO, makeinfo)
937
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
938
AM_MISSING_PROG([AUTOCONF], [autoconf])
939
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
940
AM_MISSING_PROG([AUTOHEADER], [autoheader])
941
AM_MISSING_PROG([MAKEINFO], [makeinfo])
687
942
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
688
943
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
689
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
944
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
945
# For better backward compatibility. To be removed once Automake 1.9.x
946
# dies out for good. For more background, see:
947
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
948
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
949
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
690
950
# We need awk for the "check" target. The system "awk" is bad on
691
951
# some platforms.
692
952
AC_REQUIRE([AC_PROG_AWK])dnl
697
957
[_AM_PROG_TAR([v7])])])
698
958
_AM_IF_OPTION([no-dependencies],,
699
959
[AC_PROVIDE_IFELSE([AC_PROG_CC],
700
[_AM_DEPENDENCIES(CC)],
701
[define([AC_PROG_CC],
702
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
960
[_AM_DEPENDENCIES([CC])],
961
[m4_define([AC_PROG_CC],
962
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
703
963
AC_PROVIDE_IFELSE([AC_PROG_CXX],
704
[_AM_DEPENDENCIES(CXX)],
705
[define([AC_PROG_CXX],
706
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
964
[_AM_DEPENDENCIES([CXX])],
965
[m4_define([AC_PROG_CXX],
966
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
707
967
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
708
[_AM_DEPENDENCIES(OBJC)],
709
[define([AC_PROG_OBJC],
710
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
968
[_AM_DEPENDENCIES([OBJC])],
969
[m4_define([AC_PROG_OBJC],
970
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
971
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
972
[_AM_DEPENDENCIES([OBJCXX])],
973
[m4_define([AC_PROG_OBJCXX],
974
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
712
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
713
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
714
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
715
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
976
AC_REQUIRE([AM_SILENT_RULES])dnl
977
dnl The testsuite driver may need to know about EXEEXT, so add the
978
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
979
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
716
980
AC_CONFIG_COMMANDS_PRE(dnl
717
981
[m4_provide_if([_AM_COMPILER_EXEEXT],
718
982
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
721
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
985
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
722
986
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
723
987
dnl mangled by Autoconf and run in a shell conditional statement.
724
988
m4_define([_AC_COMPILER_EXEEXT],
915
1165
# Use eval to expand $SHELL
916
if eval "$MISSING --run true"; then
917
am_missing_run="$MISSING --run "
1166
if eval "$MISSING --is-lightweight"; then
1167
am_missing_run="$MISSING "
920
AC_MSG_WARN([`missing' script is too old or missing])
1170
AC_MSG_WARN(['missing' script is too old or missing])
924
# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
927
# This file is free software; the Free Software Foundation
928
# gives unlimited permission to copy and/or distribute it,
929
# with or without modifications, as long as this notice is preserved.
935
# Check for `mkdir -p'.
936
AC_DEFUN([AM_PROG_MKDIR_P],
937
[AC_PREREQ([2.60])dnl
938
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
939
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
940
dnl while keeping a definition of mkdir_p for backward compatibility.
941
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
942
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
943
dnl Makefile.ins that do not define MKDIR_P, so we do our own
944
dnl adjustment using top_builddir (which is defined more often than
946
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
948
[[\\/$]]* | ?:[[\\/]]*) ;;
949
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
953
1174
# Helper functions for option handling. -*- Autoconf -*-
955
# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
1176
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
958
1178
# This file is free software; the Free Software Foundation
959
1179
# gives unlimited permission to copy and/or distribute it,
960
1180
# with or without modifications, as long as this notice is preserved.
964
1182
# _AM_MANGLE_OPTION(NAME)
965
1183
# -----------------------
966
1184
AC_DEFUN([_AM_MANGLE_OPTION],
984
1202
AC_DEFUN([_AM_IF_OPTION],
985
1203
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
987
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
989
# This file is free software; the Free Software Foundation
990
# gives unlimited permission to copy and/or distribute it,
991
# with or without modifications, as long as this notice is preserved.
1205
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1207
# This file is free software; the Free Software Foundation
1208
# gives unlimited permission to copy and/or distribute it,
1209
# with or without modifications, as long as this notice is preserved.
1212
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1213
# ---------------------------------------------------------------------------
1214
# Adds support for distributing Python modules and packages. To
1215
# install modules, copy them to $(pythondir), using the python_PYTHON
1216
# automake variable. To install a package with the same name as the
1217
# automake package, install to $(pkgpythondir), or use the
1218
# pkgpython_PYTHON automake variable.
1220
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
1221
# locations to install python extension modules (shared libraries).
1222
# Another macro is required to find the appropriate flags to compile
1223
# extension modules.
1225
# If your package is configured with a different prefix to python,
1226
# users will have to add the install directory to the PYTHONPATH
1227
# environment variable, or create a .pth file (see the python
1228
# documentation for details).
1230
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
1231
# cause an error if the version of python installed on the system
1232
# doesn't meet the requirement. MINIMUM-VERSION should consist of
1233
# numbers and dots only.
1234
AC_DEFUN([AM_PATH_PYTHON],
1236
dnl Find a Python interpreter. Python versions prior to 2.0 are not
1237
dnl supported. (2.0 was released on October 16, 2000).
1238
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
1239
[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
1240
python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
1242
AC_ARG_VAR([PYTHON], [the Python interpreter])
1245
dnl No version check is needed.
1246
# Find any Python interpreter.
1247
if test -z "$PYTHON"; then
1248
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
1250
am_display_PYTHON=python
1252
dnl A version check is needed.
1253
if test -n "$PYTHON"; then
1254
# If the user set $PYTHON, use it and don't search something else.
1255
AC_MSG_CHECKING([whether $PYTHON version is >= $1])
1256
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
1257
[AC_MSG_RESULT([yes])],
1258
[AC_MSG_RESULT([no])
1259
AC_MSG_ERROR([Python interpreter is too old])])
1260
am_display_PYTHON=$PYTHON
1262
# Otherwise, try each interpreter until we find one that satisfies
1264
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
1265
[am_cv_pathless_PYTHON],[
1266
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
1267
test "$am_cv_pathless_PYTHON" = none && break
1268
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
1270
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
1271
if test "$am_cv_pathless_PYTHON" = none; then
1274
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
1276
am_display_PYTHON=$am_cv_pathless_PYTHON
1280
if test "$PYTHON" = :; then
1281
dnl Run any user-specified action, or abort.
1282
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
1285
dnl Query Python for its version number. Getting [:3] seems to be
1286
dnl the best way to do this; it's what "site.py" does in the standard
1289
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
1290
[am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
1291
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
1293
dnl Use the values of $prefix and $exec_prefix for the corresponding
1294
dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
1295
dnl distinct variables so they can be overridden if need be. However,
1296
dnl general consensus is that you shouldn't need this ability.
1298
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
1299
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
1301
dnl At times (like when building shared libraries) you may want
1302
dnl to know which OS platform Python thinks this is.
1304
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
1305
[am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
1306
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
1308
# Just factor out some code duplication.
1309
am_python_setup_sysconfig="\
1311
# Prefer sysconfig over distutils.sysconfig, for better compatibility
1312
# with python 3.x. See automake bug#10227.
1316
can_use_sysconfig = 0
1318
can_use_sysconfig = 1
1319
# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
1320
# <https://github.com/pypa/virtualenv/issues/118>
1322
from platform import python_implementation
1323
if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
1324
can_use_sysconfig = 0
1328
dnl Set up 4 directories:
1330
dnl pythondir -- where to install python scripts. This is the
1331
dnl site-packages directory, not the python standard library
1332
dnl directory like in previous automake betas. This behavior
1333
dnl is more consistent with lispdir.m4 for example.
1334
dnl Query distutils for this directory.
1335
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
1336
[am_cv_python_pythondir],
1337
[if test "x$prefix" = xNONE
1339
am_py_prefix=$ac_default_prefix
1341
am_py_prefix=$prefix
1343
am_cv_python_pythondir=`$PYTHON -c "
1344
$am_python_setup_sysconfig
1345
if can_use_sysconfig:
1346
sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
1348
from distutils import sysconfig
1349
sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
1350
sys.stdout.write(sitedir)"`
1351
case $am_cv_python_pythondir in
1353
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
1354
am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
1357
case $am_py_prefix in
1360
am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
1366
AC_SUBST([pythondir], [$am_cv_python_pythondir])
1368
dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
1369
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
1370
dnl more consistent with the rest of automake.
1372
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
1374
dnl pyexecdir -- directory for installing python extension modules
1375
dnl (shared libraries)
1376
dnl Query distutils for this directory.
1377
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
1378
[am_cv_python_pyexecdir],
1379
[if test "x$exec_prefix" = xNONE
1381
am_py_exec_prefix=$am_py_prefix
1383
am_py_exec_prefix=$exec_prefix
1385
am_cv_python_pyexecdir=`$PYTHON -c "
1386
$am_python_setup_sysconfig
1387
if can_use_sysconfig:
1388
sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
1390
from distutils import sysconfig
1391
sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
1392
sys.stdout.write(sitedir)"`
1393
case $am_cv_python_pyexecdir in
1394
$am_py_exec_prefix*)
1395
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
1396
am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
1399
case $am_py_exec_prefix in
1402
am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
1408
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
1410
dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
1412
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
1414
dnl Run any user-specified action.
1421
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1422
# ---------------------------------------------------------------------------
1423
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
1424
# Run ACTION-IF-FALSE otherwise.
1425
# This test uses sys.hexversion instead of the string equivalent (first
1426
# word of sys.version), in order to cope with versions such as 2.2c1.
1427
# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
1428
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
1430
# split strings by '.' and convert to numeric. Append some zeros
1431
# because we need at least 4 digits for the hex conversion.
1432
# map returns an iterator in Python 3.0 and a list in 2.x
1433
minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
1435
# xrange is not present in Python 3.0 and range returns an iterator
1436
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
1437
sys.exit(sys.hexversion < minverhex)"
1438
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
1440
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1442
# This file is free software; the Free Software Foundation
1443
# gives unlimited permission to copy and/or distribute it,
1444
# with or without modifications, as long as this notice is preserved.
995
1446
# AM_RUN_LOG(COMMAND)
996
1447
# -------------------
1032
1477
case $srcdir in
1033
1478
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
1034
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1479
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
1037
# Do `set' in a subshell so we don't clobber the current shell's
1482
# Do 'set' in a subshell so we don't clobber the current shell's
1038
1483
# arguments. Must try -L first in case configure is actually a
1039
1484
# symlink; some systems play weird games with the mod time of symlinks
1040
1485
# (eg FreeBSD returns the mod time of the symlink's containing
1043
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1044
if test "$[*]" = "X"; then
1046
set X `ls -t "$srcdir/configure" conftest.file`
1049
if test "$[*]" != "X $srcdir/configure conftest.file" \
1050
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
1052
# If neither matched, then we have a broken ls. This can happen
1053
# if, for instance, CONFIG_SHELL is bash and it inherits a
1054
# broken ls alias from the environment. This has actually
1055
# happened. Such a system could not be considered "sane".
1056
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1057
alias in your environment])
1489
for am_try in 1 2; do
1490
echo "timestamp, slept: $am_has_slept" > conftest.file
1491
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1492
if test "$[*]" = "X"; then
1494
set X `ls -t "$srcdir/configure" conftest.file`
1496
if test "$[*]" != "X $srcdir/configure conftest.file" \
1497
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
1499
# If neither matched, then we have a broken ls. This can happen
1500
# if, for instance, CONFIG_SHELL is bash and it inherits a
1501
# broken ls alias from the environment. This has actually
1502
# happened. Such a system could not be considered "sane".
1503
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1504
alias in your environment])
1506
if test "$[2]" = conftest.file || test $am_try -eq 2; then
1060
1513
test "$[2]" = conftest.file
1066
1519
AC_MSG_ERROR([newly created file is older than distributed files!
1067
1520
Check your system clock])
1069
AC_MSG_RESULT(yes)])
1522
AC_MSG_RESULT([yes])
1523
# If we didn't sleep, we still need to ensure time stamps of config.status and
1524
# generated files are strictly newer.
1526
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
1530
AC_CONFIG_COMMANDS_PRE(
1531
[AC_MSG_CHECKING([that generated files are newer than configure])
1532
if test -n "$am_sleep_pid"; then
1533
# Hide warnings about reused PIDs.
1534
wait $am_sleep_pid 2>/dev/null
1536
AC_MSG_RESULT([done])])
1071
# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
1540
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
1073
1542
# This file is free software; the Free Software Foundation
1074
1543
# gives unlimited permission to copy and/or distribute it,
1075
1544
# with or without modifications, as long as this notice is preserved.
1079
1546
# AM_SILENT_RULES([DEFAULT])
1080
1547
# --------------------------
1081
1548
# Enable less verbose build rules; with the default set to DEFAULT
1082
# (`yes' being less verbose, `no' or empty being verbose).
1549
# ("yes" being less verbose, "no" or empty being verbose).
1083
1550
AC_DEFUN([AM_SILENT_RULES],
1084
[AC_ARG_ENABLE([silent-rules],
1085
[ --enable-silent-rules less verbose build output (undo: `make V=1')
1086
--disable-silent-rules verbose build output (undo: `make V=0')])
1087
case $enable_silent_rules in
1088
yes) AM_DEFAULT_VERBOSITY=0;;
1089
no) AM_DEFAULT_VERBOSITY=1;;
1090
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1551
[AC_ARG_ENABLE([silent-rules], [dnl
1553
[--enable-silent-rules],
1554
[less verbose build output (undo: "make V=1")])
1556
[--disable-silent-rules],
1557
[verbose build output (undo: "make V=0")])dnl
1559
case $enable_silent_rules in @%:@ (((
1560
yes) AM_DEFAULT_VERBOSITY=0;;
1561
no) AM_DEFAULT_VERBOSITY=1;;
1562
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1093
dnl A few `make' implementations (e.g., NonStop OS and NextStep)
1565
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1094
1566
dnl do not support nested variable expansions.
1095
1567
dnl See automake bug#9928 and bug#10237.
1096
1568
am_make=${MAKE-make}
1125
1597
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1128
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1600
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1130
1602
# This file is free software; the Free Software Foundation
1131
1603
# gives unlimited permission to copy and/or distribute it,
1132
1604
# with or without modifications, as long as this notice is preserved.
1136
1606
# AM_PROG_INSTALL_STRIP
1137
1607
# ---------------------
1138
# One issue with vendor `install' (even GNU) is that you can't
1608
# One issue with vendor 'install' (even GNU) is that you can't
1139
1609
# specify the program used to strip binaries. This is especially
1140
1610
# annoying in cross-compiling environments, where the build's strip
1141
1611
# is unlikely to handle the host's binaries.
1142
1612
# Fortunately install-sh will honor a STRIPPROG variable, so we
1143
# always use install-sh in `make install-strip', and initialize
1613
# always use install-sh in "make install-strip", and initialize
1144
1614
# STRIPPROG with the value of the STRIP variable (set by the user).
1145
1615
AC_DEFUN([AM_PROG_INSTALL_STRIP],
1146
1616
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1147
# Installed binaries are usually stripped using `strip' when the user
1148
# run `make install-strip'. However `strip' might not be the right
1617
# Installed binaries are usually stripped using 'strip' when the user
1618
# run "make install-strip". However 'strip' might not be the right
1149
1619
# tool to use in cross-compilation environments, therefore Automake
1150
# will honor the `STRIP' environment variable to overrule this program.
1151
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1620
# will honor the 'STRIP' environment variable to overrule this program.
1621
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1152
1622
if test "$cross_compiling" != no; then
1153
1623
AC_CHECK_TOOL([STRIP], [strip], :)
1155
1625
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1156
1626
AC_SUBST([INSTALL_STRIP_PROGRAM])])
1158
# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
1628
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1160
1630
# This file is free software; the Free Software Foundation
1161
1631
# gives unlimited permission to copy and/or distribute it,
1162
1632
# with or without modifications, as long as this notice is preserved.
1166
1634
# _AM_SUBST_NOTMAKE(VARIABLE)
1167
1635
# ---------------------------
1168
1636
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.