1
by Adriaan Peeters
Import upstream version 0.11.0 |
1 |
# generated automatically by aclocal 1.9.6 -*- Autoconf -*- |
2 |
||
3 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
|
4 |
# 2005 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 |
||
14 |
dnl AM_GCONF_SOURCE_2 |
|
15 |
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas |
|
16 |
dnl (i.e. pass to gconftool-2 |
|
17 |
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where |
|
18 |
dnl you should install foo.schemas files |
|
19 |
dnl
|
|
20 |
||
21 |
AC_DEFUN([AM_GCONF_SOURCE_2], |
|
22 |
[
|
|
23 |
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
|
|
24 |
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
|
|
25 |
else
|
|
26 |
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
|
|
27 |
fi
|
|
28 |
||
29 |
AC_ARG_WITH(gconf-source,
|
|
30 |
[ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",) |
|
31 |
||
32 |
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE) |
|
33 |
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation]) |
|
34 |
||
35 |
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then |
|
36 |
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas' |
|
37 |
fi |
|
38 |
||
39 |
AC_ARG_WITH(gconf-schema-file-dir, |
|
40 |
[ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",) |
|
41 |
||
42 |
AC_SUBST(GCONF_SCHEMA_FILE_DIR) |
|
43 |
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files]) |
|
44 |
||
45 |
AC_ARG_ENABLE(schemas-install, |
|
46 |
[ --disable-schemas-install Disable the schemas installation], |
|
47 |
[case ${enableval} in |
|
48 |
yes|no) ;;
|
|
49 |
*) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
|
|
50 |
esac]) |
|
51 |
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no]) |
|
52 |
]) |
|
53 |
||
54 |
# Copyright (C) 1995-2002 Free Software Foundation, Inc. |
|
55 |
# Copyright (C) 2001-2003,2004 Red Hat, Inc. |
|
56 |
#
|
|
57 |
# This file is free software, distributed under the terms of the GNU |
|
58 |
# General Public License. As a special exception to the GNU General |
|
59 |
# Public License, this file may be distributed as part of a program |
|
60 |
# that contains a configuration script generated by Autoconf, under |
|
61 |
# the same distribution terms as the rest of that program. |
|
62 |
#
|
|
63 |
# This file can be copied and used freely without restrictions. It can |
|
64 |
# be used in projects which are not available under the GNU Public License |
|
65 |
# but which still want to provide support for the GNU gettext functionality. |
|
66 |
#
|
|
67 |
# Macro to add for using GNU gettext. |
|
68 |
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996 |
|
69 |
#
|
|
70 |
# Modified to never use included libintl. |
|
71 |
# Owen Taylor <otaylor@redhat.com>, 12/15/1998 |
|
72 |
#
|
|
73 |
# Major rework to remove unused code |
|
74 |
# Owen Taylor <otaylor@redhat.com>, 12/11/2002 |
|
75 |
#
|
|
76 |
# Added better handling of ALL_LINGUAS from GNU gettext version |
|
77 |
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002 |
|
78 |
#
|
|
79 |
# Modified to require ngettext |
|
80 |
# Matthias Clasen <mclasen@redhat.com> 08/06/2004 |
|
81 |
#
|
|
82 |
# We need this here as well, since someone might use autoconf-2.5x |
|
83 |
# to configure GLib then an older version to configure a package |
|
84 |
# using AM_GLIB_GNU_GETTEXT |
|
85 |
AC_PREREQ(2.53) |
|
86 |
||
87 |
dnl
|
|
88 |
dnl We go to great lengths to make sure that aclocal won't |
|
89 |
dnl try to pull in the installed version of these macros
|
|
90 |
dnl when running aclocal in the glib directory.
|
|
91 |
dnl
|
|
92 |
m4_copy([AC_DEFUN],[glib_DEFUN])
|
|
93 |
m4_copy([AC_REQUIRE],[glib_REQUIRE])
|
|
94 |
dnl
|
|
95 |
dnl At the end, if we're not within glib, we'll define the public |
|
96 |
dnl definitions in terms of our private definitions.
|
|
97 |
dnl
|
|
98 |
||
99 |
# GLIB_LC_MESSAGES
|
|
100 |
#--------------------
|
|
101 |
glib_DEFUN([GLIB_LC_MESSAGES],
|
|
102 |
[AC_CHECK_HEADERS([locale.h])
|
|
103 |
if test $ac_cv_header_locale_h = yes; then
|
|
104 |
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
|
105 |
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
|
106 |
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
|
107 |
if test $am_cv_val_LC_MESSAGES = yes; then
|
|
108 |
AC_DEFINE(HAVE_LC_MESSAGES, 1,
|
|
109 |
[Define if your <locale.h> file defines LC_MESSAGES.])
|
|
110 |
fi
|
|
111 |
fi])
|
|
112 |
||
113 |
# GLIB_PATH_PROG_WITH_TEST
|
|
114 |
#----------------------------
|
|
115 |
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
|
116 |
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
|
117 |
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
|
|
118 |
[# Extract the first word of "$2", so it can be a program name with args.
|
|
119 |
set dummy $2; ac_word=[$]2
|
|
120 |
AC_MSG_CHECKING([for $ac_word])
|
|
121 |
AC_CACHE_VAL(ac_cv_path_$1,
|
|
122 |
[case "[$]$1" in
|
|
123 |
/*)
|
|
124 |
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
|
125 |
;;
|
|
126 |
*)
|
|
127 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
|
128 |
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
|
129 |
test -z "$ac_dir" && ac_dir=.
|
|
130 |
if test -f $ac_dir/$ac_word; then
|
|
131 |
if [$3]; then
|
|
132 |
ac_cv_path_$1="$ac_dir/$ac_word"
|
|
133 |
break
|
|
134 |
fi
|
|
135 |
fi
|
|
136 |
done
|
|
137 |
IFS="$ac_save_ifs"
|
|
138 |
dnl If no 4th arg is given, leave the cache variable unset,
|
|
139 |
dnl so AC_PATH_PROGS will keep looking.
|
|
140 |
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
|
141 |
])dnl
|
|
142 |
;;
|
|
143 |
esac])dnl
|
|
144 |
$1="$ac_cv_path_$1"
|
|
145 |
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
|
|
146 |
AC_MSG_RESULT([$]$1)
|
|
147 |
else
|
|
148 |
AC_MSG_RESULT(no)
|
|
149 |
fi
|
|
150 |
AC_SUBST($1)dnl
|
|
151 |
])
|
|
152 |
||
153 |
# GLIB_WITH_NLS
|
|
154 |
#-----------------
|
|
155 |
glib_DEFUN([GLIB_WITH_NLS],
|
|
156 |
dnl NLS is obligatory
|
|
157 |
[USE_NLS=yes
|
|
158 |
AC_SUBST(USE_NLS)
|
|
159 |
||
160 |
gt_cv_have_gettext=no
|
|
161 |
||
162 |
CATOBJEXT=NONE
|
|
163 |
XGETTEXT=:
|
|
164 |
INTLLIBS=
|
|
165 |
||
166 |
AC_CHECK_HEADER(libintl.h,
|
|
167 |
[gt_cv_func_dgettext_libintl="no"
|
|
168 |
libintl_extra_libs=""
|
|
169 |
||
170 |
#
|
|
171 |
# First check in libc
|
|
172 |
#
|
|
173 |
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
|
|
174 |
[AC_TRY_LINK([
|
|
175 |
#include <libintl.h>
|
|
176 |
],
|
|
177 |
[return !ngettext ("","", 1)],
|
|
178 |
gt_cv_func_ngettext_libc=yes,
|
|
179 |
gt_cv_func_ngettext_libc=no)
|
|
180 |
])
|
|
181 |
|
|
182 |
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
|
|
183 |
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
|
|
184 |
[AC_TRY_LINK([
|
|
185 |
#include <libintl.h>
|
|
186 |
],
|
|
187 |
[return !dgettext ("","")],
|
|
188 |
gt_cv_func_dgettext_libc=yes,
|
|
189 |
gt_cv_func_dgettext_libc=no)
|
|
190 |
])
|
|
191 |
fi
|
|
192 |
|
|
193 |
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
|
|
194 |
AC_CHECK_FUNCS(bind_textdomain_codeset)
|
|
195 |
fi
|
|
196 |
||
197 |
#
|
|
198 |
# If we don't have everything we want, check in libintl |
|
199 |
# |
|
200 |
if test "$gt_cv_func_dgettext_libc" != "yes" \ |
|
201 |
|| test "$gt_cv_func_ngettext_libc" != "yes" \ |
|
202 |
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then |
|
203 |
|
|
204 |
AC_CHECK_LIB(intl, bindtextdomain, |
|
205 |
[AC_CHECK_LIB(intl, ngettext, |
|
206 |
[AC_CHECK_LIB(intl, dgettext,
|
|
207 |
gt_cv_func_dgettext_libintl=yes)])]) |
|
208 |
||
209 |
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then |
|
210 |
AC_MSG_CHECKING([if -liconv is needed to use gettext]) |
|
211 |
AC_MSG_RESULT([]) |
|
212 |
AC_CHECK_LIB(intl, ngettext, |
|
213 |
[AC_CHECK_LIB(intl, dcgettext, |
|
214 |
[gt_cv_func_dgettext_libintl=yes
|
|
215 |
libintl_extra_libs=-liconv], |
|
216 |
:,-liconv)], |
|
217 |
:,-liconv) |
|
218 |
fi |
|
219 |
||
220 |
# |
|
221 |
# If we found libintl, then check in it for bind_textdomain_codeset(); |
|
222 |
# we'll prefer libc if neither have bind_textdomain_codeset(), |
|
223 |
# and both have dgettext and ngettext
|
|
224 |
#
|
|
225 |
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
|
|
226 |
glib_save_LIBS="$LIBS"
|
|
227 |
LIBS="$LIBS -lintl $libintl_extra_libs"
|
|
228 |
unset ac_cv_func_bind_textdomain_codeset
|
|
229 |
AC_CHECK_FUNCS(bind_textdomain_codeset)
|
|
230 |
LIBS="$glib_save_LIBS"
|
|
231 |
||
232 |
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
|
|
233 |
gt_cv_func_dgettext_libc=no
|
|
234 |
else
|
|
235 |
if test "$gt_cv_func_dgettext_libc" = "yes" \
|
|
236 |
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
|
|
237 |
gt_cv_func_dgettext_libintl=no
|
|
238 |
fi
|
|
239 |
fi
|
|
240 |
fi
|
|
241 |
fi
|
|
242 |
||
243 |
if test "$gt_cv_func_dgettext_libc" = "yes" \
|
|
244 |
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
|
245 |
gt_cv_have_gettext=yes
|
|
246 |
fi
|
|
247 |
|
|
248 |
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
|
249 |
INTLLIBS="-lintl $libintl_extra_libs"
|
|
250 |
fi
|
|
251 |
|
|
252 |
if test "$gt_cv_have_gettext" = "yes"; then
|
|
253 |
AC_DEFINE(HAVE_GETTEXT,1,
|
|
254 |
[Define if the GNU gettext() function is already present or preinstalled.])
|
|
255 |
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
|
256 |
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl |
|
257 |
if test "$MSGFMT" != "no"; then
|
|
258 |
glib_save_LIBS="$LIBS"
|
|
259 |
LIBS="$LIBS $INTLLIBS"
|
|
260 |
AC_CHECK_FUNCS(dcgettext)
|
|
261 |
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
|
262 |
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
|
263 |
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
|
264 |
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
|
|
265 |
return _nl_msg_cat_cntr],
|
|
266 |
[CATOBJEXT=.gmo
|
|
267 |
DATADIRNAME=share],
|
|
268 |
[case $host in
|
|
269 |
*-*-solaris*)
|
|
270 |
dnl On Solaris, if bind_textdomain_codeset is in libc,
|
|
271 |
dnl GNU format message catalog is always supported,
|
|
272 |
dnl since both are added to the libc all together.
|
|
273 |
dnl Hence, we'd like to go with DATADIRNAME=share and |
|
274 |
dnl and CATOBJEXT=.gmo in this case. |
|
275 |
AC_CHECK_FUNC(bind_textdomain_codeset, |
|
276 |
[CATOBJEXT=.gmo |
|
277 |
DATADIRNAME=share], |
|
278 |
[CATOBJEXT=.mo |
|
279 |
DATADIRNAME=lib]) |
|
280 |
;; |
|
281 |
*) |
|
282 |
CATOBJEXT=.mo |
|
283 |
DATADIRNAME=lib |
|
284 |
;; |
|
285 |
esac]) |
|
286 |
LIBS="$glib_save_LIBS" |
|
287 |
INSTOBJEXT=.mo |
|
288 |
else |
|
289 |
gt_cv_have_gettext=no |
|
290 |
fi |
|
291 |
fi |
|
292 |
]) |
|
293 |
||
294 |
if test "$gt_cv_have_gettext" = "yes" ; then |
|
295 |
AC_DEFINE(ENABLE_NLS, 1, |
|
296 |
[always defined to indicate that i18n is enabled]) |
|
297 |
fi |
|
298 |
||
299 |
dnl Test whether we really found GNU xgettext. |
|
300 |
if test "$XGETTEXT" != ":"; then |
|
301 |
dnl If it is not GNU xgettext we define it as : so that the |
|
302 |
dnl Makefiles still can work. |
|
303 |
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then |
|
304 |
: ; |
|
305 |
else |
|
306 |
AC_MSG_RESULT( |
|
307 |
[found xgettext program is not GNU xgettext; ignore it]) |
|
308 |
XGETTEXT=":" |
|
309 |
fi |
|
310 |
fi |
|
311 |
||
312 |
# We need to process the po/ directory. |
|
313 |
POSUB=po |
|
314 |
||
315 |
AC_OUTPUT_COMMANDS( |
|
316 |
[case "$CONFIG_FILES" in *po/Makefile.in*) |
|
317 |
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
|
|
318 |
esac]) |
|
319 |
||
320 |
dnl These rules are solely for the distribution goal. While doing this |
|
321 |
dnl we only have to keep exactly one list of the available catalogs |
|
322 |
dnl in configure.in. |
|
323 |
for lang in $ALL_LINGUAS; do |
|
324 |
GMOFILES="$GMOFILES $lang.gmo" |
|
325 |
POFILES="$POFILES $lang.po" |
|
326 |
done |
|
327 |
||
328 |
dnl Make all variables we use known to autoconf. |
|
329 |
AC_SUBST(CATALOGS) |
|
330 |
AC_SUBST(CATOBJEXT) |
|
331 |
AC_SUBST(DATADIRNAME) |
|
332 |
AC_SUBST(GMOFILES) |
|
333 |
AC_SUBST(INSTOBJEXT) |
|
334 |
AC_SUBST(INTLLIBS) |
|
335 |
AC_SUBST(PO_IN_DATADIR_TRUE) |
|
336 |
AC_SUBST(PO_IN_DATADIR_FALSE) |
|
337 |
AC_SUBST(POFILES) |
|
338 |
AC_SUBST(POSUB) |
|
339 |
]) |
|
340 |
||
341 |
# AM_GLIB_GNU_GETTEXT |
|
342 |
# ------------------- |
|
343 |
# Do checks necessary for use of gettext. If a suitable implementation |
|
344 |
# of gettext is found in either in libintl or in the C library, |
|
345 |
# it will set INTLLIBS to the libraries needed for use of gettext |
|
346 |
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable |
|
347 |
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() |
|
348 |
# on various variables needed by the Makefile.in.in installed by |
|
349 |
# glib-gettextize. |
|
350 |
dnl
|
|
351 |
glib_DEFUN([GLIB_GNU_GETTEXT], |
|
352 |
[AC_REQUIRE([AC_PROG_CC])dnl |
|
353 |
AC_REQUIRE([AC_HEADER_STDC])dnl |
|
354 |
|
|
355 |
GLIB_LC_MESSAGES |
|
356 |
GLIB_WITH_NLS |
|
357 |
||
358 |
if test "$gt_cv_have_gettext" = "yes"; then |
|
359 |
if test "x$ALL_LINGUAS" = "x"; then |
|
360 |
LINGUAS= |
|
361 |
else |
|
362 |
AC_MSG_CHECKING(for catalogs to be installed) |
|
363 |
NEW_LINGUAS= |
|
364 |
for presentlang in $ALL_LINGUAS; do |
|
365 |
useit=no |
|
366 |
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then |
|
367 |
desiredlanguages="$LINGUAS" |
|
368 |
else |
|
369 |
desiredlanguages="$ALL_LINGUAS" |
|
370 |
fi |
|
371 |
for desiredlang in $desiredlanguages; do |
|
372 |
# Use the presentlang catalog if desiredlang is |
|
373 |
# a. equal to presentlang, or |
|
374 |
# b. a variant of presentlang (because in this case, |
|
375 |
# presentlang can be used as a fallback for messages |
|
376 |
# which are not translated in the desiredlang catalog). |
|
377 |
case "$desiredlang" in |
|
378 |
"$presentlang"*) useit=yes;; |
|
379 |
esac |
|
380 |
done |
|
381 |
if test $useit = yes; then |
|
382 |
NEW_LINGUAS="$NEW_LINGUAS $presentlang" |
|
383 |
fi |
|
384 |
done |
|
385 |
LINGUAS=$NEW_LINGUAS |
|
386 |
AC_MSG_RESULT($LINGUAS) |
|
387 |
fi |
|
388 |
||
389 |
dnl Construct list of names of catalog files to be constructed. |
|
390 |
if test -n "$LINGUAS"; then |
|
391 |
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done |
|
392 |
fi |
|
393 |
fi |
|
394 |
||
395 |
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly |
|
396 |
dnl find the mkinstalldirs script in another subdir but ($top_srcdir). |
|
397 |
dnl Try to locate is. |
|
398 |
MKINSTALLDIRS= |
|
399 |
if test -n "$ac_aux_dir"; then |
|
400 |
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" |
|
401 |
fi |
|
402 |
if test -z "$MKINSTALLDIRS"; then |
|
403 |
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" |
|
404 |
fi |
|
405 |
AC_SUBST(MKINSTALLDIRS) |
|
406 |
||
407 |
dnl Generate list of files to be processed by xgettext which will |
|
408 |
dnl be included in po/Makefile. |
|
409 |
test -d po || mkdir po |
|
410 |
if test "x$srcdir" != "x."; then |
|
411 |
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then |
|
412 |
posrcprefix="$srcdir/" |
|
413 |
else |
|
414 |
posrcprefix="../$srcdir/" |
|
415 |
fi |
|
416 |
else |
|
417 |
posrcprefix="../" |
|
418 |
fi |
|
419 |
rm -f po/POTFILES |
|
420 |
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ |
|
421 |
< $srcdir/po/POTFILES.in > po/POTFILES |
|
422 |
]) |
|
423 |
||
424 |
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) |
|
425 |
# ------------------------------- |
|
426 |
# Define VARIABLE to the location where catalog files will |
|
427 |
# be installed by po/Makefile. |
|
428 |
glib_DEFUN([GLIB_DEFINE_LOCALEDIR], |
|
429 |
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl |
|
430 |
glib_save_prefix="$prefix" |
|
431 |
glib_save_exec_prefix="$exec_prefix" |
|
432 |
test "x$prefix" = xNONE && prefix=$ac_default_prefix |
|
433 |
test "x$exec_prefix" = xNONE && exec_prefix=$prefix |
|
434 |
if test "x$CATOBJEXT" = "x.mo" ; then |
|
435 |
localedir=`eval echo "${libdir}/locale"` |
|
436 |
else
|
|
437 |
localedir=`eval echo "${datadir}/locale"` |
|
438 |
fi
|
|
439 |
prefix="$glib_save_prefix" |
|
440 |
exec_prefix="$glib_save_exec_prefix" |
|
441 |
AC_DEFINE_UNQUOTED($1, "$localedir", |
|
442 |
[Define the location where the catalogs will be installed]) |
|
443 |
]) |
|
444 |
||
445 |
dnl
|
|
446 |
dnl Now the definitions that aclocal will find |
|
447 |
dnl
|
|
448 |
ifdef(glib_configure_in,[],[ |
|
449 |
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) |
|
450 |
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) |
|
451 |
])dnl |
|
452 |
||
453 |
||
454 |
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) |
|
455 |
# serial 2 IT_PROG_INTLTOOL |
|
456 |
AC_DEFUN([IT_PROG_INTLTOOL], |
|
457 |
[AC_PREREQ([2.50])dnl |
|
458 |
||
459 |
case "$am__api_version" in |
|
460 |
1.[01234]) |
|
461 |
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) |
|
462 |
;; |
|
463 |
*) |
|
464 |
;; |
|
465 |
esac
|
|
466 |
||
467 |
if test -n "$1"; then |
|
468 |
AC_MSG_CHECKING(for intltool >= $1) |
|
469 |
||
470 |
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 100 + $ 2; }'` |
|
471 |
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in` |
|
472 |
[INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 100 + VERSION[2];}' ${ac_aux_dir}/intltool-update.in` |
|
473 |
] |
|
474 |
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) |
|
475 |
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || |
|
476 |
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) |
|
477 |
fi
|
|
478 |
||
479 |
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
480 |
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
481 |
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
482 |
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
483 |
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' |
|
484 |
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
485 |
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
486 |
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
487 |
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
488 |
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
489 |
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
490 |
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' |
|
491 |
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
492 |
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
493 |
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
494 |
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
495 |
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
496 |
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' |
|
497 |
||
498 |
AC_SUBST(INTLTOOL_DESKTOP_RULE) |
|
499 |
AC_SUBST(INTLTOOL_DIRECTORY_RULE) |
|
500 |
AC_SUBST(INTLTOOL_KEYS_RULE) |
|
501 |
AC_SUBST(INTLTOOL_PROP_RULE) |
|
502 |
AC_SUBST(INTLTOOL_OAF_RULE) |
|
503 |
AC_SUBST(INTLTOOL_PONG_RULE) |
|
504 |
AC_SUBST(INTLTOOL_SERVER_RULE) |
|
505 |
AC_SUBST(INTLTOOL_SHEET_RULE) |
|
506 |
AC_SUBST(INTLTOOL_SOUNDLIST_RULE) |
|
507 |
AC_SUBST(INTLTOOL_UI_RULE) |
|
508 |
AC_SUBST(INTLTOOL_XAM_RULE) |
|
509 |
AC_SUBST(INTLTOOL_KBD_RULE) |
|
510 |
AC_SUBST(INTLTOOL_XML_RULE) |
|
511 |
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE) |
|
512 |
AC_SUBST(INTLTOOL_CAVES_RULE) |
|
513 |
AC_SUBST(INTLTOOL_SCHEMAS_RULE) |
|
514 |
AC_SUBST(INTLTOOL_THEME_RULE) |
|
515 |
AC_SUBST(INTLTOOL_SERVICE_RULE) |
|
516 |
||
517 |
# Use the tools built into the package, not the ones that are installed. |
|
518 |
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract') |
|
519 |
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge') |
|
520 |
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update') |
|
521 |
||
522 |
AC_PATH_PROG(INTLTOOL_PERL, perl) |
|
523 |
if test -z "$INTLTOOL_PERL"; then |
|
524 |
AC_MSG_ERROR([perl not found; required for intltool]) |
|
525 |
fi
|
|
526 |
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then |
|
527 |
AC_MSG_ERROR([perl 5.x required for intltool]) |
|
528 |
fi
|
|
529 |
if test "x$2" != "xno-xml"; then |
|
530 |
AC_MSG_CHECKING([for XML::Parser]) |
|
531 |
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then |
|
532 |
AC_MSG_RESULT([ok]) |
|
533 |
else |
|
534 |
AC_MSG_ERROR([XML::Parser perl module is required for intltool]) |
|
535 |
fi |
|
536 |
fi
|
|
537 |
||
538 |
AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv) |
|
539 |
AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt) |
|
540 |
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge) |
|
541 |
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext) |
|
542 |
||
543 |
IT_PO_SUBDIR([po]) |
|
544 |
||
545 |
dnl The following is very similar to |
|
546 |
dnl
|
|
547 |
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update]) |
|
548 |
dnl
|
|
549 |
dnl with the following slight differences: |
|
550 |
dnl - the *.in files are in ac_aux_dir, |
|
551 |
dnl - if the file haven't changed upon reconfigure, it's not touched, |
|
552 |
dnl - the evaluation of the third parameter enables a hack which computes |
|
553 |
dnl the actual value of $libdir, |
|
554 |
dnl - the user sees "executing intltool commands", instead of |
|
555 |
dnl "creating intltool-extract" and such. |
|
556 |
dnl
|
|
557 |
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were |
|
558 |
dnl a reason for it. |
|
559 |
||
560 |
AC_CONFIG_COMMANDS([intltool], [ |
|
561 |
||
562 |
for file in intltool-extract intltool-merge intltool-update; do
|
|
563 |
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
|
|
564 |
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
|
|
565 |
-e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
|
|
566 |
-e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
|
|
567 |
-e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
|
|
568 |
-e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
|
|
569 |
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
|
|
570 |
< ${ac_aux_dir}/${file}.in > ${file}.out
|
|
571 |
if cmp -s ${file} ${file}.out 2>/dev/null; then
|
|
572 |
rm -f ${file}.out
|
|
573 |
else
|
|
574 |
mv -f ${file}.out ${file}
|
|
575 |
fi
|
|
576 |
chmod ugo+x ${file}
|
|
577 |
chmod u+w ${file}
|
|
578 |
done
|
|
579 |
||
580 |
], |
|
581 |
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}' |
|
582 |
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
|
|
583 |
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
|
|
584 |
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
|
|
585 |
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}']) |
|
586 |
||
587 |
]) |
|
588 |
||
589 |
||
590 |
# IT_PO_SUBDIR(DIRNAME) |
|
591 |
# --------------------- |
|
592 |
# All po subdirs have to be declared with this macro; the subdir "po" is |
|
593 |
# declared by IT_PROG_INTLTOOL. |
|
594 |
#
|
|
595 |
AC_DEFUN([IT_PO_SUBDIR], |
|
596 |
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. |
|
597 |
dnl
|
|
598 |
dnl The following CONFIG_COMMANDS should be exetuted at the very end |
|
599 |
dnl of config.status. |
|
600 |
AC_CONFIG_COMMANDS_PRE([ |
|
601 |
AC_CONFIG_COMMANDS([$1/stamp-it], [ |
|
602 |
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
|
|
603 |
>"$1/stamp-it.tmp"
|
|
604 |
[sed '/^#/d
|
|
605 |
s/^[[].*] *// |
|
606 |
/^[ ]*$/d |
|
607 |
'"s|^| $ac_top_srcdir/|" \ |
|
608 |
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" |
|
609 |
]
|
|
610 |
if test ! -f "$1/Makefile"; then
|
|
611 |
AC_MSG_ERROR([$1/Makefile is not ready.])
|
|
612 |
fi
|
|
613 |
mv "$1/Makefile" "$1/Makefile.tmp"
|
|
614 |
[sed '/^POTFILES =/,/[^\\]$/ { |
|
615 |
/^POTFILES =/!d |
|
616 |
r $1/POTFILES |
|
617 |
} |
|
618 |
' "$1/Makefile.tmp" >"$1/Makefile"] |
|
619 |
rm -f "$1/Makefile.tmp"
|
|
620 |
mv "$1/stamp-it.tmp" "$1/stamp-it"
|
|
621 |
])
|
|
622 |
])dnl
|
|
623 |
])
|
|
624 |
||
625 |
||
626 |
# deprecated macros
|
|
627 |
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
|
|
628 |
# A hint is needed for aclocal from Automake <= 1.9.4:
|
|
629 |
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
|
|
630 |
||
631 |
||
632 |
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
|
633 |
#
|
|
634 |
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
|
635 |
#
|
|
636 |
# This program is free software; you can redistribute it and/or modify
|
|
637 |
# it under the terms of the GNU General Public License as published by
|
|
638 |
# the Free Software Foundation; either version 2 of the License, or
|
|
639 |
# (at your option) any later version.
|
|
640 |
#
|
|
641 |
# This program is distributed in the hope that it will be useful, but
|
|
642 |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
643 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
644 |
# General Public License for more details.
|
|
645 |
#
|
|
646 |
# You should have received a copy of the GNU General Public License
|
|
647 |
# along with this program; if not, write to the Free Software
|
|
648 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
649 |
#
|
|
650 |
# As a special exception to the GNU General Public License, if you
|
|
651 |
# distribute this file as part of a program that contains a
|
|
652 |
# configuration script generated by Autoconf, you may include it under
|
|
653 |
# the same distribution terms that you use for the rest of that program.
|
|
654 |
||
655 |
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
|
656 |
# ----------------------------------
|
|
657 |
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
|
658 |
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
|
659 |
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
|
660 |
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
|
661 |
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
|
662 |
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
|
663 |
fi
|
|
664 |
if test -n "$PKG_CONFIG"; then
|
|
665 |
_pkg_min_version=m4_default([$1], [0.9.0])
|
|
666 |
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
|
667 |
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
|
668 |
AC_MSG_RESULT([yes])
|
|
669 |
else
|
|
670 |
AC_MSG_RESULT([no])
|
|
671 |
PKG_CONFIG=""
|
|
672 |
fi
|
|
673 |
|
|
674 |
fi[]dnl
|
|
675 |
])# PKG_PROG_PKG_CONFIG
|
|
676 |
||
677 |
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
678 |
#
|
|
679 |
# Check to see whether a particular set of modules exists. Similar
|
|
680 |
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
|
681 |
#
|
|
682 |
#
|
|
683 |
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
|
|
684 |
# this or PKG_CHECK_MODULES is called, or make sure to call
|
|
685 |
# PKG_CHECK_EXISTS manually
|
|
686 |
# --------------------------------------------------------------
|
|
687 |
AC_DEFUN([PKG_CHECK_EXISTS],
|
|
688 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
689 |
if test -n "$PKG_CONFIG" && \
|
|
690 |
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
|
691 |
m4_ifval([$2], [$2], [:])
|
|
692 |
m4_ifvaln([$3], [else
|
|
693 |
$3])dnl
|
|
694 |
fi])
|
|
695 |
||
696 |
||
697 |
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
|
698 |
# ---------------------------------------------
|
|
699 |
m4_define([_PKG_CONFIG],
|
|
700 |
[if test -n "$PKG_CONFIG"; then
|
|
701 |
if test -n "$$1"; then
|
|
702 |
pkg_cv_[]$1="$$1"
|
|
703 |
else
|
|
704 |
PKG_CHECK_EXISTS([$3],
|
|
705 |
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
|
706 |
[pkg_failed=yes])
|
|
707 |
fi
|
|
708 |
else
|
|
709 |
pkg_failed=untried
|
|
710 |
fi[]dnl
|
|
711 |
])# _PKG_CONFIG
|
|
712 |
||
713 |
# _PKG_SHORT_ERRORS_SUPPORTED
|
|
714 |
# -----------------------------
|
|
715 |
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
|
716 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
717 |
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
|
718 |
_pkg_short_errors_supported=yes
|
|
719 |
else
|
|
720 |
_pkg_short_errors_supported=no
|
|
721 |
fi[]dnl
|
|
722 |
])# _PKG_SHORT_ERRORS_SUPPORTED
|
|
723 |
||
724 |
||
725 |
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
|
726 |
# [ACTION-IF-NOT-FOUND])
|
|
727 |
#
|
|
728 |
#
|
|
729 |
# Note that if there is a possibility the first call to
|
|
730 |
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
|
731 |
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
|
732 |
#
|
|
733 |
#
|
|
734 |
# --------------------------------------------------------------
|
|
735 |
AC_DEFUN([PKG_CHECK_MODULES],
|
|
736 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
737 |
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
|
738 |
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
|
739 |
||
740 |
pkg_failed=no
|
|
741 |
AC_MSG_CHECKING([for $1])
|
|
742 |
||
743 |
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
|
744 |
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
|
745 |
||
746 |
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
|
747 |
and $1[]_LIBS to avoid the need to call pkg-config.
|
|
748 |
See the pkg-config man page for more details.])
|
|
749 |
||
750 |
if test $pkg_failed = yes; then
|
|
751 |
_PKG_SHORT_ERRORS_SUPPORTED
|
|
752 |
if test $_pkg_short_errors_supported = yes; then
|
|
753 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
|
|
754 |
else
|
|
755 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
|
|
756 |
fi
|
|
757 |
# Put the nasty error message in config.log where it belongs
|
|
758 |
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
|
759 |
||
760 |
ifelse([$4], , [AC_MSG_ERROR(dnl
|
|
761 |
[Package requirements ($2) were not met:
|
|
762 |
||
763 |
$$1_PKG_ERRORS
|
|
764 |
||
765 |
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
|
766 |
installed software in a non-standard prefix.
|
|
767 |
||
768 |
_PKG_TEXT
|
|
769 |
])],
|
|
770 |
[$4])
|
|
771 |
elif test $pkg_failed = untried; then
|
|
772 |
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
|
773 |
[The pkg-config script could not be found or is too old. Make sure it
|
|
774 |
is in your PATH or set the PKG_CONFIG environment variable to the full
|
|
775 |
path to pkg-config.
|
|
776 |
||
777 |
_PKG_TEXT
|
|
778 |
||
779 |
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
|
|
780 |
[$4])
|
|
781 |
else
|
|
782 |
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
|
783 |
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
|
784 |
AC_MSG_RESULT([yes])
|
|
785 |
ifelse([$3], , :, [$3])
|
|
786 |
fi[]dnl
|
|
787 |
])# PKG_CHECK_MODULES
|
|
788 |
||
789 |
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
|
790 |
#
|
|
791 |
# This file is free software; the Free Software Foundation
|
|
792 |
# gives unlimited permission to copy and/or distribute it,
|
|
793 |
# with or without modifications, as long as this notice is preserved.
|
|
794 |
||
795 |
# AM_AUTOMAKE_VERSION(VERSION)
|
|
796 |
# ----------------------------
|
|
797 |
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
|
798 |
# generated from the m4 files accompanying Automake X.Y.
|
|
799 |
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
|
800 |
||
801 |
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
|
802 |
# -------------------------------
|
|
803 |
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
|
804 |
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
|
805 |
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
|
806 |
[AM_AUTOMAKE_VERSION([1.9.6])])
|
|
807 |
||
808 |
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
|
809 |
||
810 |
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
|
811 |
#
|
|
812 |
# This file is free software; the Free Software Foundation
|
|
813 |
# gives unlimited permission to copy and/or distribute it,
|
|
814 |
# with or without modifications, as long as this notice is preserved.
|
|
815 |
||
816 |
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
|
817 |
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to |
|
818 |
# `$srcdir', `$srcdir/..', or `$srcdir/../..'. |
|
819 |
#
|
|
820 |
# Of course, Automake must honor this variable whenever it calls a
|
|
821 |
# tool from the auxiliary directory. The problem is that $srcdir (and
|
|
822 |
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
|
823 |
# depending on how configure is run. This is pretty annoying, since
|
|
824 |
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
|
825 |
# source directory, any form will work fine, but in subdirectories a
|
|
826 |
# relative path needs to be adjusted first.
|
|
827 |
#
|
|
828 |
# $ac_aux_dir/missing
|
|
829 |
# fails when called from a subdirectory if $ac_aux_dir is relative
|
|
830 |
# $top_srcdir/$ac_aux_dir/missing
|
|
831 |
# fails if $ac_aux_dir is absolute,
|
|
832 |
# fails when called from a subdirectory in a VPATH build with
|
|
833 |
# a relative $ac_aux_dir
|
|
834 |
#
|
|
835 |
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
|
836 |
# are both prefixed by $srcdir. In an in-source build this is usually
|
|
837 |
# harmless because $srcdir is `.', but things will broke when you |
|
838 |
# start a VPATH build or use an absolute $srcdir. |
|
839 |
#
|
|
840 |
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, |
|
841 |
# iff we strip the leading $srcdir from $ac_aux_dir. That would be: |
|
842 |
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` |
|
843 |
# and then we would define $MISSING as |
|
844 |
# MISSING="\${SHELL} $am_aux_dir/missing" |
|
845 |
# This will work as long as MISSING is not called from configure, because |
|
846 |
# unfortunately $(top_srcdir) has no meaning in configure. |
|
847 |
# However there are other variables, like CC, which are often used in |
|
848 |
# configure, and could therefore not use this "fixed" $ac_aux_dir. |
|
849 |
#
|
|
850 |
# Another solution, used here, is to always expand $ac_aux_dir to an |
|
851 |
# absolute PATH. The drawback is that using absolute paths prevent a |
|
852 |
# configured tree to be moved without reconfiguration. |
|
853 |
||
854 |
AC_DEFUN([AM_AUX_DIR_EXPAND], |
|
855 |
[dnl Rely on autoconf to set up CDPATH properly. |
|
856 |
AC_PREREQ([2.50])dnl |
|
857 |
# expand $ac_aux_dir to an absolute path |
|
858 |
am_aux_dir=`cd $ac_aux_dir && pwd` |
|
859 |
]) |
|
860 |
||
861 |
# AM_CONDITIONAL -*- Autoconf -*- |
|
862 |
||
863 |
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 |
|
864 |
# Free Software Foundation, Inc. |
|
865 |
#
|
|
866 |
# This file is free software; the Free Software Foundation |
|
867 |
# gives unlimited permission to copy and/or distribute it, |
|
868 |
# with or without modifications, as long as this notice is preserved. |
|
869 |
||
870 |
# serial 7 |
|
871 |
||
872 |
# AM_CONDITIONAL(NAME, SHELL-CONDITION) |
|
873 |
# ------------------------------------- |
|
874 |
# Define a conditional. |
|
875 |
AC_DEFUN([AM_CONDITIONAL], |
|
876 |
[AC_PREREQ(2.52)dnl |
|
877 |
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], |
|
878 |
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl |
|
879 |
AC_SUBST([$1_TRUE]) |
|
880 |
AC_SUBST([$1_FALSE]) |
|
881 |
if $2; then |
|
882 |
$1_TRUE= |
|
883 |
$1_FALSE='#' |
|
884 |
else
|
|
885 |
$1_TRUE='#' |
|
886 |
$1_FALSE= |
|
887 |
fi
|
|
888 |
AC_CONFIG_COMMANDS_PRE( |
|
889 |
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then |
|
890 |
AC_MSG_ERROR([[conditional "$1" was never defined.
|
|
891 |
Usually this means the macro was only invoked conditionally.]]) |
|
892 |
fi])]) |
|
893 |
||
894 |
||
895 |
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
|
896 |
# Free Software Foundation, Inc. |
|
897 |
#
|
|
898 |
# This file is free software; the Free Software Foundation |
|
899 |
# gives unlimited permission to copy and/or distribute it, |
|
900 |
# with or without modifications, as long as this notice is preserved. |
|
901 |
||
902 |
# serial 8 |
|
903 |
||
904 |
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be |
|
905 |
# written in clear, in which case automake, when reading aclocal.m4,
|
|
906 |
# will think it sees a *use*, and therefore will trigger all it's |
|
907 |
# C support machinery. Also note that it means that autoscan, seeing |
|
908 |
# CC etc. in the Makefile, will ask for an AC_PROG_CC use... |
|
909 |
||
910 |
||
911 |
# _AM_DEPENDENCIES(NAME) |
|
912 |
# ---------------------- |
|
913 |
# See how the compiler implements dependency checking. |
|
914 |
# NAME is "CC", "CXX", "GCJ", or "OBJC". |
|
915 |
# We try a few techniques and use that to set a single cache variable. |
|
916 |
#
|
|
917 |
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was |
|
918 |
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
|
919 |
# dependency, and given that the user is not expected to run this macro,
|
|
920 |
# just rely on AC_PROG_CC.
|
|
921 |
AC_DEFUN([_AM_DEPENDENCIES],
|
|
922 |
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
|
923 |
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
|
924 |
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
|
925 |
AC_REQUIRE([AM_DEP_TRACK])dnl
|
|
926 |
||
927 |
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
|
928 |
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
|
929 |
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], |
|
930 |
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], |
|
931 |
[depcc="$$1" am_compiler_list=])
|
|
932 |
||
933 |
AC_CACHE_CHECK([dependency style of $depcc],
|
|
934 |
[am_cv_$1_dependencies_compiler_type],
|
|
935 |
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
|
936 |
# We make a subdir and do the tests there. Otherwise we can end up
|
|
937 |
# making bogus files that we don't know about and never remove. For |
|
938 |
# instance it was reported that on HP-UX the gcc test will end up |
|
939 |
# making a dummy file named `D' -- because `-MD' means `put the output |
|
940 |
# in D'. |
|
941 |
mkdir conftest.dir
|
|
942 |
# Copy depcomp to subdir because otherwise we won't find it if we're |
|
943 |
# using a relative directory.
|
|
944 |
cp "$am_depcomp" conftest.dir
|
|
945 |
cd conftest.dir
|
|
946 |
# We will build objects and dependencies in a subdirectory because
|
|
947 |
# it helps to detect inapplicable dependency modes. For instance
|
|
948 |
# both Tru64's cc and ICC support -MD to output dependencies as a |
|
949 |
# side effect of compilation, but ICC will put the dependencies in |
|
950 |
# the current directory while Tru64 will put them in the object |
|
951 |
# directory. |
|
952 |
mkdir sub |
|
953 |
||
954 |
am_cv_$1_dependencies_compiler_type=none |
|
955 |
if test "$am_compiler_list" = ""; then |
|
956 |
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` |
|
957 |
fi
|
|
958 |
for depmode in $am_compiler_list; do
|
|
959 |
# Setup a source with many dependencies, because some compilers
|
|
960 |
# like to wrap large dependency lists on column 80 (with \), and
|
|
961 |
# we should not choose a depcomp mode which is confused by this.
|
|
962 |
#
|
|
963 |
# We need to recreate these files for each test, as the compiler may
|
|
964 |
# overwrite some of them when testing with obscure command lines.
|
|
965 |
# This happens at least with the AIX C compiler.
|
|
966 |
: > sub/conftest.c
|
|
967 |
for i in 1 2 3 4 5 6; do
|
|
968 |
echo '#include "conftst'$i'.h"' >> sub/conftest.c |
|
969 |
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with |
|
970 |
# Solaris 8's {/usr,}/bin/sh. |
|
971 |
touch sub/conftst$i.h
|
|
972 |
done
|
|
973 |
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
|
974 |
||
975 |
case $depmode in
|
|
976 |
nosideeffect)
|
|
977 |
# after this tag, mechanisms are not by side-effect, so they'll |
|
978 |
# only be used when explicitly requested |
|
979 |
if test "x$enable_dependency_tracking" = xyes; then |
|
980 |
continue |
|
981 |
else |
|
982 |
break |
|
983 |
fi |
|
984 |
;; |
|
985 |
none) break ;; |
|
986 |
esac |
|
987 |
# We check with `-c' and `-o' for the sake of the "dashmstdout" |
|
988 |
# mode. It turns out that the SunPro C++ compiler does not properly |
|
989 |
# handle `-M -o', and we need to detect this. |
|
990 |
if depmode=$depmode \
|
|
991 |
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
|
992 |
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
|
993 |
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
|
994 |
>/dev/null 2>conftest.err &&
|
|
995 |
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
|
996 |
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
|
997 |
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
|
998 |
# icc doesn't choke on unknown options, it will just issue warnings |
|
999 |
# or remarks (even with -Werror). So we grep stderr for any message |
|
1000 |
# that says an option was ignored or not supported. |
|
1001 |
# When given -MP, icc 7.0 and 7.1 complain thusly: |
|
1002 |
# icc: Command line warning: ignoring option '-M'; no argument required |
|
1003 |
# The diagnosis changed in icc 8.0: |
|
1004 |
# icc: Command line remark: option '-MP' not supported |
|
1005 |
if (grep 'ignoring option' conftest.err || |
|
1006 |
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else |
|
1007 |
am_cv_$1_dependencies_compiler_type=$depmode |
|
1008 |
break |
|
1009 |
fi |
|
1010 |
fi |
|
1011 |
done |
|
1012 |
||
1013 |
cd .. |
|
1014 |
rm -rf conftest.dir |
|
1015 |
else
|
|
1016 |
am_cv_$1_dependencies_compiler_type=none |
|
1017 |
fi
|
|
1018 |
]) |
|
1019 |
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) |
|
1020 |
AM_CONDITIONAL([am__fastdep$1], [ |
|
1021 |
test "x$enable_dependency_tracking" != xno \
|
|
1022 |
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3]) |
|
1023 |
]) |
|
1024 |
||
1025 |
||
1026 |
# AM_SET_DEPDIR |
|
1027 |
# ------------- |
|
1028 |
# Choose a directory name for dependency files. |
|
1029 |
# This macro is AC_REQUIREd in _AM_DEPENDENCIES |
|
1030 |
AC_DEFUN([AM_SET_DEPDIR], |
|
1031 |
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
|
1032 |
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl |
|
1033 |
]) |
|
1034 |
||
1035 |
||
1036 |
# AM_DEP_TRACK |
|
1037 |
# ------------ |
|
1038 |
AC_DEFUN([AM_DEP_TRACK], |
|
1039 |
[AC_ARG_ENABLE(dependency-tracking, |
|
1040 |
[ --disable-dependency-tracking speeds up one-time build
|
|
1041 |
--enable-dependency-tracking do not reject slow dependency extractors]) |
|
1042 |
if test "x$enable_dependency_tracking" != xno; then |
|
1043 |
am_depcomp="$ac_aux_dir/depcomp" |
|
1044 |
AMDEPBACKSLASH='\' |
|
1045 |
fi
|
|
1046 |
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) |
|
1047 |
AC_SUBST([AMDEPBACKSLASH]) |
|
1048 |
]) |
|
1049 |
||
1050 |
# Generate code to set up dependency tracking. -*- Autoconf -*- |
|
1051 |
||
1052 |
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
|
1053 |
# Free Software Foundation, Inc. |
|
1054 |
#
|
|
1055 |
# This file is free software; the Free Software Foundation |
|
1056 |
# gives unlimited permission to copy and/or distribute it, |
|
1057 |
# with or without modifications, as long as this notice is preserved. |
|
1058 |
||
1059 |
#serial 3 |
|
1060 |
||
1061 |
# _AM_OUTPUT_DEPENDENCY_COMMANDS |
|
1062 |
# ------------------------------ |
|
1063 |
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], |
|
1064 |
[for mf in $CONFIG_FILES; do |
|
1065 |
# Strip MF so we end up with the name of the file.
|
|
1066 |
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
|
1067 |
# Check whether this is an Automake generated Makefile or not.
|
|
1068 |
# We used to match only the files named `Makefile.in', but
|
|
1069 |
# some people rename them; so instead we look at the file content.
|
|
1070 |
# Grep'ing the first line is not enough: some people post-process
|
|
1071 |
# each Makefile.in and add a new line on top of each file to say so.
|
|
1072 |
# So let's grep whole file.
|
|
1073 |
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
|
|
1074 |
dirpart=`AS_DIRNAME("$mf")`
|
|
1075 |
else
|
|
1076 |
continue
|
|
1077 |
fi
|
|
1078 |
# Extract the definition of DEPDIR, am__include, and am__quote
|
|
1079 |
# from the Makefile without running `make'.
|
|
1080 |
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
|
1081 |
test -z "$DEPDIR" && continue
|
|
1082 |
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
|
1083 |
test -z "am__include" && continue
|
|
1084 |
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
|
1085 |
# When using ansi2knr, U may be empty or an underscore; expand it
|
|
1086 |
U=`sed -n 's/^U = //p' < "$mf"`
|
|
1087 |
# Find all dependency output files, they are included files with
|
|
1088 |
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
|
1089 |
# simplest approach to changing $(DEPDIR) to its actual value in the
|
|
1090 |
# expansion.
|
|
1091 |
for file in `sed -n "
|
|
1092 |
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
|
1093 |
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
|
1094 |
# Make sure the directory exists.
|
|
1095 |
test -f "$dirpart/$file" && continue
|
|
1096 |
fdir=`AS_DIRNAME(["$file"])` |
|
1097 |
AS_MKDIR_P([$dirpart/$fdir]) |
|
1098 |
# echo "creating $dirpart/$file" |
|
1099 |
echo '# dummy' > "$dirpart/$file" |
|
1100 |
done |
|
1101 |
done
|
|
1102 |
])# _AM_OUTPUT_DEPENDENCY_COMMANDS |
|
1103 |
||
1104 |
||
1105 |
# AM_OUTPUT_DEPENDENCY_COMMANDS |
|
1106 |
# ----------------------------- |
|
1107 |
# This macro should only be invoked once -- use via AC_REQUIRE. |
|
1108 |
#
|
|
1109 |
# This code is only required when automatic dependency tracking |
|
1110 |
# is enabled. FIXME. This creates each `.P' file that we will |
|
1111 |
# need in order to bootstrap the dependency handling code.
|
|
1112 |
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|
1113 |
[AC_CONFIG_COMMANDS([depfiles],
|
|
1114 |
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|
1115 |
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
|
1116 |
])
|
|
1117 |
||
1118 |
# Do all the work for Automake. -*- Autoconf -*-
|
|
1119 |
||
1120 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
|
1121 |
# Free Software Foundation, Inc.
|
|
1122 |
#
|
|
1123 |
# This file is free software; the Free Software Foundation
|
|
1124 |
# gives unlimited permission to copy and/or distribute it,
|
|
1125 |
# with or without modifications, as long as this notice is preserved.
|
|
1126 |
||
1127 |
# serial 12
|
|
1128 |
||
1129 |
# This macro actually does too much. Some checks are only needed if
|
|
1130 |
# your package does certain things. But this isn't really a big deal. |
|
1131 |
||
1132 |
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) |
|
1133 |
# AM_INIT_AUTOMAKE([OPTIONS]) |
|
1134 |
# ----------------------------------------------- |
|
1135 |
# The call with PACKAGE and VERSION arguments is the old style |
|
1136 |
# call (pre autoconf-2.50), which is being phased out. PACKAGE |
|
1137 |
# and VERSION should now be passed to AC_INIT and removed from |
|
1138 |
# the call to AM_INIT_AUTOMAKE. |
|
1139 |
# We support both call styles for the transition. After |
|
1140 |
# the next Automake release, Autoconf can make the AC_INIT |
|
1141 |
# arguments mandatory, and then we can depend on a new Autoconf |
|
1142 |
# release and drop the old call support. |
|
1143 |
AC_DEFUN([AM_INIT_AUTOMAKE], |
|
1144 |
[AC_PREREQ([2.58])dnl |
|
1145 |
dnl Autoconf wants to disallow AM_ names. We explicitly allow |
|
1146 |
dnl the ones we care about. |
|
1147 |
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl |
|
1148 |
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl |
|
1149 |
AC_REQUIRE([AC_PROG_INSTALL])dnl |
|
1150 |
# test to see if srcdir already configured |
|
1151 |
if test "`cd $srcdir && pwd`" != "`pwd`" && |
|
1152 |
test -f $srcdir/config.status; then |
|
1153 |
AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
|
1154 |
fi
|
|
1155 |
||
1156 |
# test whether we have cygpath |
|
1157 |
if test -z "$CYGPATH_W"; then |
|
1158 |
if (cygpath --version) >/dev/null 2>/dev/null; then |
|
1159 |
CYGPATH_W='cygpath -w' |
|
1160 |
else |
|
1161 |
CYGPATH_W=echo |
|
1162 |
fi |
|
1163 |
fi
|
|
1164 |
AC_SUBST([CYGPATH_W]) |
|
1165 |
||
1166 |
# Define the identity of the package. |
|
1167 |
dnl Distinguish between old-style and new-style calls. |
|
1168 |
m4_ifval([$2], |
|
1169 |
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl |
|
1170 |
AC_SUBST([PACKAGE], [$1])dnl |
|
1171 |
AC_SUBST([VERSION], [$2])], |
|
1172 |
[_AM_SET_OPTIONS([$1])dnl |
|
1173 |
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl |
|
1174 |
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl |
|
1175 |
||
1176 |
_AM_IF_OPTION([no-define],, |
|
1177 |
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
|
1178 |
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl |
|
1179 |
||
1180 |
# Some tools Automake needs. |
|
1181 |
AC_REQUIRE([AM_SANITY_CHECK])dnl |
|
1182 |
AC_REQUIRE([AC_ARG_PROGRAM])dnl |
|
1183 |
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) |
|
1184 |
AM_MISSING_PROG(AUTOCONF, autoconf) |
|
1185 |
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) |
|
1186 |
AM_MISSING_PROG(AUTOHEADER, autoheader) |
|
1187 |
AM_MISSING_PROG(MAKEINFO, makeinfo) |
|
1188 |
AM_PROG_INSTALL_SH
|
|
1189 |
AM_PROG_INSTALL_STRIP
|
|
1190 |
AC_REQUIRE([AM_PROG_MKDIR_P])dnl |
|
1191 |
# We need awk for the "check" target. The system "awk" is bad on |
|
1192 |
# some platforms. |
|
1193 |
AC_REQUIRE([AC_PROG_AWK])dnl |
|
1194 |
AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
|
1195 |
AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
|
1196 |
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], |
|
1197 |
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], |
|
1198 |
[_AM_PROG_TAR([v7])])]) |
|
1199 |
_AM_IF_OPTION([no-dependencies],, |
|
1200 |
[AC_PROVIDE_IFELSE([AC_PROG_CC], |
|
1201 |
[_AM_DEPENDENCIES(CC)], |
|
1202 |
[define([AC_PROG_CC], |
|
1203 |
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl |
|
1204 |
AC_PROVIDE_IFELSE([AC_PROG_CXX], |
|
1205 |
[_AM_DEPENDENCIES(CXX)], |
|
1206 |
[define([AC_PROG_CXX], |
|
1207 |
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl |
|
1208 |
]) |
|
1209 |
]) |
|
1210 |
||
1211 |
||
1212 |
# When config.status generates a header, we must update the stamp-h file. |
|
1213 |
# This file resides in the same directory as the config header |
|
1214 |
# that is generated. The stamp files are numbered to have different names. |
|
1215 |
||
1216 |
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the |
|
1217 |
# loop where config.status creates the headers, so we can generate |
|
1218 |
# our stamp files there. |
|
1219 |
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], |
|
1220 |
[# Compute $1's index in $config_headers. |
|
1221 |
_am_stamp_count=1
|
|
1222 |
for _am_header in $config_headers :; do
|
|
1223 |
case $_am_header in
|
|
1224 |
$1 | $1:* )
|
|
1225 |
break ;;
|
|
1226 |
* )
|
|
1227 |
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
|
1228 |
esac
|
|
1229 |
done
|
|
1230 |
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) |
|
1231 |
||
1232 |
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. |
|
1233 |
#
|
|
1234 |
# This file is free software; the Free Software Foundation |
|
1235 |
# gives unlimited permission to copy and/or distribute it, |
|
1236 |
# with or without modifications, as long as this notice is preserved. |
|
1237 |
||
1238 |
# AM_PROG_INSTALL_SH |
|
1239 |
# ------------------ |
|
1240 |
# Define $install_sh. |
|
1241 |
AC_DEFUN([AM_PROG_INSTALL_SH], |
|
1242 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
|
1243 |
install_sh=${install_sh-"$am_aux_dir/install-sh"} |
|
1244 |
AC_SUBST(install_sh)]) |
|
1245 |
||
1246 |
# Copyright (C) 2003, 2005 Free Software Foundation, Inc. |
|
1247 |
#
|
|
1248 |
# This file is free software; the Free Software Foundation |
|
1249 |
# gives unlimited permission to copy and/or distribute it, |
|
1250 |
# with or without modifications, as long as this notice is preserved. |
|
1251 |
||
1252 |
# serial 2 |
|
1253 |
||
1254 |
# Check whether the underlying file-system supports filenames |
|
1255 |
# with a leading dot. For instance MS-DOS doesn't. |
|
1256 |
AC_DEFUN([AM_SET_LEADING_DOT],
|
|
1257 |
[rm -rf .tst 2>/dev/null
|
|
1258 |
mkdir .tst 2>/dev/null
|
|
1259 |
if test -d .tst; then
|
|
1260 |
am__leading_dot=.
|
|
1261 |
else
|
|
1262 |
am__leading_dot=_
|
|
1263 |
fi
|
|
1264 |
rmdir .tst 2>/dev/null
|
|
1265 |
AC_SUBST([am__leading_dot])])
|
|
1266 |
||
1267 |
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
|
1268 |
# From Jim Meyering
|
|
1269 |
||
1270 |
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
|
|
1271 |
# Free Software Foundation, Inc.
|
|
1272 |
#
|
|
1273 |
# This file is free software; the Free Software Foundation
|
|
1274 |
# gives unlimited permission to copy and/or distribute it,
|
|
1275 |
# with or without modifications, as long as this notice is preserved.
|
|
1276 |
||
1277 |
# serial 4
|
|
1278 |
||
1279 |
AC_DEFUN([AM_MAINTAINER_MODE],
|
|
1280 |
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
|
1281 |
dnl maintainer-mode is disabled by default
|
|
1282 |
AC_ARG_ENABLE(maintainer-mode,
|
|
1283 |
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
|
1284 |
(and sometimes confusing) to the casual installer],
|
|
1285 |
USE_MAINTAINER_MODE=$enableval,
|
|
1286 |
USE_MAINTAINER_MODE=no)
|
|
1287 |
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
|
|
1288 |
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
|
|
1289 |
MAINT=$MAINTAINER_MODE_TRUE
|
|
1290 |
AC_SUBST(MAINT)dnl
|
|
1291 |
]
|
|
1292 |
)
|
|
1293 |
||
1294 |
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
|
|
1295 |
||
1296 |
# Check to see how 'make' treats includes. -*- Autoconf -*- |
|
1297 |
||
1298 |
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
|
1299 |
#
|
|
1300 |
# This file is free software; the Free Software Foundation
|
|
1301 |
# gives unlimited permission to copy and/or distribute it,
|
|
1302 |
# with or without modifications, as long as this notice is preserved.
|
|
1303 |
||
1304 |
# serial 3
|
|
1305 |
||
1306 |
# AM_MAKE_INCLUDE()
|
|
1307 |
# -----------------
|
|
1308 |
# Check to see how make treats includes.
|
|
1309 |
AC_DEFUN([AM_MAKE_INCLUDE],
|
|
1310 |
[am_make=${MAKE-make}
|
|
1311 |
cat > confinc << 'END' |
|
1312 |
am__doit:
|
|
1313 |
@echo done
|
|
1314 |
.PHONY: am__doit
|
|
1315 |
END
|
|
1316 |
# If we don't find an include directive, just comment out the code. |
|
1317 |
AC_MSG_CHECKING([for style of include used by $am_make]) |
|
1318 |
am__include="#" |
|
1319 |
am__quote= |
|
1320 |
_am_result=none |
|
1321 |
# First try GNU make style include. |
|
1322 |
echo "include confinc" > confmf |
|
1323 |
# We grep out `Entering directory' and `Leaving directory' |
|
1324 |
# messages which can occur if `w' ends up in MAKEFLAGS. |
|
1325 |
# In particular we don't look at `^make:' because GNU make might |
|
1326 |
# be invoked under some other name (usually "gmake"), in which
|
|
1327 |
# case it prints its new name instead of `make'. |
|
1328 |
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then |
|
1329 |
am__include=include |
|
1330 |
am__quote= |
|
1331 |
_am_result=GNU |
|
1332 |
fi
|
|
1333 |
# Now try BSD make style include. |
|
1334 |
if test "$am__include" = "#"; then |
|
1335 |
echo '.include "confinc"' > confmf |
|
1336 |
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then |
|
1337 |
am__include=.include |
|
1338 |
am__quote="\"" |
|
1339 |
_am_result=BSD
|
|
1340 |
fi
|
|
1341 |
fi
|
|
1342 |
AC_SUBST([am__include])
|
|
1343 |
AC_SUBST([am__quote])
|
|
1344 |
AC_MSG_RESULT([$_am_result])
|
|
1345 |
rm -f confinc confmf
|
|
1346 |
])
|
|
1347 |
||
1348 |
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
|
1349 |
||
1350 |
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
|
|
1351 |
# Free Software Foundation, Inc.
|
|
1352 |
#
|
|
1353 |
# This file is free software; the Free Software Foundation
|
|
1354 |
# gives unlimited permission to copy and/or distribute it,
|
|
1355 |
# with or without modifications, as long as this notice is preserved.
|
|
1356 |
||
1357 |
# serial 4
|
|
1358 |
||
1359 |
# AM_MISSING_PROG(NAME, PROGRAM)
|
|
1360 |
# ------------------------------
|
|
1361 |
AC_DEFUN([AM_MISSING_PROG],
|
|
1362 |
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
|
1363 |
$1=${$1-"${am_missing_run}$2"} |
|
1364 |
AC_SUBST($1)])
|
|
1365 |
||
1366 |
||
1367 |
# AM_MISSING_HAS_RUN
|
|
1368 |
# ------------------
|
|
1369 |
# Define MISSING if not defined so far and test if it supports --run.
|
|
1370 |
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
|
1371 |
AC_DEFUN([AM_MISSING_HAS_RUN],
|
|
1372 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
|
1373 |
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" |
|
1374 |
# Use eval to expand $SHELL
|
|
1375 |
if eval "$MISSING --run true"; then |
|
1376 |
am_missing_run="$MISSING --run " |
|
1377 |
else
|
|
1378 |
am_missing_run=
|
|
1379 |
AC_MSG_WARN([`missing' script is too old or missing])
|
|
1380 |
fi
|
|
1381 |
])
|
|
1382 |
||
1383 |
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
|
1384 |
#
|
|
1385 |
# This file is free software; the Free Software Foundation
|
|
1386 |
# gives unlimited permission to copy and/or distribute it,
|
|
1387 |
# with or without modifications, as long as this notice is preserved.
|
|
1388 |
||
1389 |
# AM_PROG_MKDIR_P
|
|
1390 |
# ---------------
|
|
1391 |
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
|
1392 |
#
|
|
1393 |
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
|
1394 |
# created by `make install' are always world readable, even if the
|
|
1395 |
# installer happens to have an overly restrictive umask (e.g. 077).
|
|
1396 |
# This was a mistake. There are at least two reasons why we must not
|
|
1397 |
# use `-m 0755':
|
|
1398 |
# - it causes special bits like SGID to be ignored,
|
|
1399 |
# - it may be too restrictive (some setups expect 775 directories).
|
|
1400 |
#
|
|
1401 |
# Do not use -m 0755 and let people choose whatever they expect by
|
|
1402 |
# setting umask.
|
|
1403 |
#
|
|
1404 |
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
|
|
1405 |
# Some implementations (such as Solaris 8's) are not thread-safe: if a
|
|
1406 |
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
|
|
1407 |
# concurrently, both version can detect that a/ is missing, but only
|
|
1408 |
# one can create it and the other will error out. Consequently we
|
|
1409 |
# restrict ourselves to GNU make (using the --version option ensures
|
|
1410 |
# this.)
|
|
1411 |
AC_DEFUN([AM_PROG_MKDIR_P],
|
|
1412 |
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
|
1413 |
# We used to keeping the `.' as first argument, in order to
|
|
1414 |
# allow $(mkdir_p) to be used without argument. As in
|
|
1415 |
# $(mkdir_p) $(somedir)
|
|
1416 |
# where $(somedir) is conditionally defined. However this is wrong
|
|
1417 |
# for two reasons:
|
|
1418 |
# 1. if the package is installed by a user who cannot write `.'
|
|
1419 |
# make install will fail,
|
|
1420 |
# 2. the above comment should most certainly read
|
|
1421 |
# $(mkdir_p) $(DESTDIR)$(somedir)
|
|
1422 |
# so it does not work when $(somedir) is undefined and
|
|
1423 |
# $(DESTDIR) is not.
|
|
1424 |
# To support the latter case, we have to write
|
|
1425 |
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), |
|
1426 |
# so the `.' trick is pointless.
|
|
1427 |
mkdir_p='mkdir -p --'
|
|
1428 |
else
|
|
1429 |
# On NextStep and OpenStep, the `mkdir' command does not
|
|
1430 |
# recognize any option. It will interpret all options as
|
|
1431 |
# directories to create, and then abort because `.' already
|
|
1432 |
# exists.
|
|
1433 |
for d in ./-p ./--version;
|
|
1434 |
do
|
|
1435 |
test -d $d && rmdir $d
|
|
1436 |
done
|
|
1437 |
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
|
|
1438 |
if test -f "$ac_aux_dir/mkinstalldirs"; then |
|
1439 |
mkdir_p='$(mkinstalldirs)'
|
|
1440 |
else
|
|
1441 |
mkdir_p='$(install_sh) -d'
|
|
1442 |
fi
|
|
1443 |
fi
|
|
1444 |
AC_SUBST([mkdir_p])])
|
|
1445 |
||
1446 |
# Helper functions for option handling. -*- Autoconf -*-
|
|
1447 |
||
1448 |
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
|
1449 |
#
|
|
1450 |
# This file is free software; the Free Software Foundation
|
|
1451 |
# gives unlimited permission to copy and/or distribute it,
|
|
1452 |
# with or without modifications, as long as this notice is preserved.
|
|
1453 |
||
1454 |
# serial 3
|
|
1455 |
||
1456 |
# _AM_MANGLE_OPTION(NAME)
|
|
1457 |
# -----------------------
|
|
1458 |
AC_DEFUN([_AM_MANGLE_OPTION],
|
|
1459 |
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
|
1460 |
||
1461 |
# _AM_SET_OPTION(NAME)
|
|
1462 |
# ------------------------------
|
|
1463 |
# Set option NAME. Presently that only means defining a flag for this option.
|
|
1464 |
AC_DEFUN([_AM_SET_OPTION],
|
|
1465 |
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
|
1466 |
||
1467 |
# _AM_SET_OPTIONS(OPTIONS)
|
|
1468 |
# ----------------------------------
|
|
1469 |
# OPTIONS is a space-separated list of Automake options.
|
|
1470 |
AC_DEFUN([_AM_SET_OPTIONS],
|
|
1471 |
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
|
1472 |
||
1473 |
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
|
1474 |
# -------------------------------------------
|
|
1475 |
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
|
1476 |
AC_DEFUN([_AM_IF_OPTION],
|
|
1477 |
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
|
1478 |
||
1479 |
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
|
1480 |
# Free Software Foundation, Inc.
|
|
1481 |
#
|
|
1482 |
# This file is free software; the Free Software Foundation
|
|
1483 |
# gives unlimited permission to copy and/or distribute it,
|
|
1484 |
# with or without modifications, as long as this notice is preserved.
|
|
1485 |
||
1486 |
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
1487 |
# ---------------------------------------------------------------------------
|
|
1488 |
# Adds support for distributing Python modules and packages. To
|
|
1489 |
# install modules, copy them to $(pythondir), using the python_PYTHON
|
|
1490 |
# automake variable. To install a package with the same name as the
|
|
1491 |
# automake package, install to $(pkgpythondir), or use the
|
|
1492 |
# pkgpython_PYTHON automake variable.
|
|
1493 |
#
|
|
1494 |
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
|
|
1495 |
# locations to install python extension modules (shared libraries).
|
|
1496 |
# Another macro is required to find the appropriate flags to compile
|
|
1497 |
# extension modules.
|
|
1498 |
#
|
|
1499 |
# If your package is configured with a different prefix to python,
|
|
1500 |
# users will have to add the install directory to the PYTHONPATH
|
|
1501 |
# environment variable, or create a .pth file (see the python
|
|
1502 |
# documentation for details).
|
|
1503 |
#
|
|
1504 |
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
|
|
1505 |
# cause an error if the version of python installed on the system
|
|
1506 |
# doesn't meet the requirement. MINIMUM-VERSION should consist of
|
|
1507 |
# numbers and dots only.
|
|
1508 |
AC_DEFUN([AM_PATH_PYTHON],
|
|
1509 |
[
|
|
1510 |
dnl Find a Python interpreter. Python versions prior to 1.5 are not
|
|
1511 |
dnl supported because the default installation locations changed from
|
|
1512 |
dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
|
|
1513 |
dnl in 1.5.
|
|
1514 |
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
|
|
1515 |
[python python2 python2.5 python2.4 python2.3 python2.2 dnl
|
|
1516 |
python2.1 python2.0 python1.6 python1.5])
|
|
1517 |
||
1518 |
m4_if([$1],[],[
|
|
1519 |
dnl No version check is needed.
|
|
1520 |
# Find any Python interpreter.
|
|
1521 |
if test -z "$PYTHON"; then |
|
1522 |
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
|
|
1523 |
fi
|
|
1524 |
am_display_PYTHON=python
|
|
1525 |
], [
|
|
1526 |
dnl A version check is needed.
|
|
1527 |
if test -n "$PYTHON"; then |
|
1528 |
# If the user set $PYTHON, use it and don't search something else.
|
|
1529 |
AC_MSG_CHECKING([whether $PYTHON version >= $1])
|
|
1530 |
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
|
|
1531 |
[AC_MSG_RESULT(yes)],
|
|
1532 |
[AC_MSG_ERROR(too old)])
|
|
1533 |
am_display_PYTHON=$PYTHON
|
|
1534 |
else
|
|
1535 |
# Otherwise, try each interpreter until we find one that satisfies
|
|
1536 |
# VERSION.
|
|
1537 |
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
|
|
1538 |
[am_cv_pathless_PYTHON],[
|
|
1539 |
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
|
|
1540 |
test "$am_cv_pathless_PYTHON" = none && break |
|
1541 |
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
|
|
1542 |
done])
|
|
1543 |
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
|
|
1544 |
if test "$am_cv_pathless_PYTHON" = none; then |
|
1545 |
PYTHON=:
|
|
1546 |
else
|
|
1547 |
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
|
|
1548 |
fi
|
|
1549 |
am_display_PYTHON=$am_cv_pathless_PYTHON
|
|
1550 |
fi
|
|
1551 |
])
|
|
1552 |
||
1553 |
if test "$PYTHON" = :; then |
|
1554 |
dnl Run any user-specified action, or abort.
|
|
1555 |
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
|
|
1556 |
else
|
|
1557 |
||
1558 |
dnl Query Python for its version number. Getting [:3] seems to be
|
|
1559 |
dnl the best way to do this; it's what "site.py" does in the standard |
|
1560 |
dnl library.
|
|
1561 |
||
1562 |
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
|
|
1563 |
[am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) |
|
1564 |
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
|
|
1565 |
||
1566 |
dnl Use the values of $prefix and $exec_prefix for the corresponding
|
|
1567 |
dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
|
|
1568 |
dnl distinct variables so they can be overridden if need be. However,
|
|
1569 |
dnl general consensus is that you shouldn't need this ability.
|
|
1570 |
||
1571 |
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
|
|
1572 |
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
|
|
1573 |
||
1574 |
dnl At times (like when building shared libraries) you may want
|
|
1575 |
dnl to know which OS platform Python thinks this is.
|
|
1576 |
||
1577 |
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
|
|
1578 |
[am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) |
|
1579 |
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
|
|
1580 |
||
1581 |
||
1582 |
dnl Set up 4 directories:
|
|
1583 |
||
1584 |
dnl pythondir -- where to install python scripts. This is the
|
|
1585 |
dnl site-packages directory, not the python standard library
|
|
1586 |
dnl directory like in previous automake betas. This behavior
|
|
1587 |
dnl is more consistent with lispdir.m4 for example.
|
|
1588 |
dnl Query distutils for this directory. distutils does not exist in
|
|
1589 |
dnl Python 1.5, so we fall back to the hardcoded directory if it
|
|
1590 |
dnl doesn't work.
|
|
1591 |
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
|
|
1592 |
[am_cv_python_pythondir],
|
|
1593 |
[am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || |
|
1594 |
echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) |
|
1595 |
AC_SUBST([pythondir], [$am_cv_python_pythondir])
|
|
1596 |
||
1597 |
dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
|
|
1598 |
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
|
|
1599 |
dnl more consistent with the rest of automake.
|
|
1600 |
||
1601 |
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
|
|
1602 |
||
1603 |
dnl pyexecdir -- directory for installing python extension modules
|
|
1604 |
dnl (shared libraries)
|
|
1605 |
dnl Query distutils for this directory. distutils does not exist in
|
|
1606 |
dnl Python 1.5, so we fall back to the hardcoded directory if it
|
|
1607 |
dnl doesn't work.
|
|
1608 |
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
|
|
1609 |
[am_cv_python_pyexecdir],
|
|
1610 |
[am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || |
|
1611 |
echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) |
|
1612 |
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
|
|
1613 |
||
1614 |
dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
|
|
1615 |
||
1616 |
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
|
|
1617 |
||
1618 |
dnl Run any user-specified action.
|
|
1619 |
$2
|
|
1620 |
fi
|
|
1621 |
||
1622 |
])
|
|
1623 |
||
1624 |
||
1625 |
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
|
1626 |
# ---------------------------------------------------------------------------
|
|
1627 |
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
|
|
1628 |
# Run ACTION-IF-FALSE otherwise.
|
|
1629 |
# This test uses sys.hexversion instead of the string equivalent (first
|
|
1630 |
# word of sys.version), in order to cope with versions such as 2.2c1.
|
|
1631 |
# hexversion has been introduced in Python 1.5.2; it's probably not
|
|
1632 |
# worth to support older versions (1.5.1 was released on October 31, 1998).
|
|
1633 |
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
|
|
1634 |
[prog="import sys, string |
|
1635 |
# split strings by '.' and convert to numeric. Append some zeros |
|
1636 |
# because we need at least 4 digits for the hex conversion. |
|
1637 |
minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] |
|
1638 |
minverhex = 0 |
|
1639 |
for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] |
|
1640 |
sys.exit(sys.hexversion < minverhex)" |
|
1641 |
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) |
|
1642 |
||
1643 |
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
|
1644 |
#
|
|
1645 |
# This file is free software; the Free Software Foundation
|
|
1646 |
# gives unlimited permission to copy and/or distribute it,
|
|
1647 |
# with or without modifications, as long as this notice is preserved.
|
|
1648 |
||
1649 |
# AM_RUN_LOG(COMMAND)
|
|
1650 |
# -------------------
|
|
1651 |
# Run COMMAND, save the exit status in ac_status, and log it.
|
|
1652 |
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
|
|
1653 |
AC_DEFUN([AM_RUN_LOG],
|
|
1654 |
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD |
|
1655 |
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
|
|
1656 |
ac_status=$?
|
|
1657 |
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD |
|
1658 |
(exit $ac_status); }])
|
|
1659 |
||
1660 |
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
|
1661 |
||
1662 |
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
|
1663 |
# Free Software Foundation, Inc.
|
|
1664 |
#
|
|
1665 |
# This file is free software; the Free Software Foundation
|
|
1666 |
# gives unlimited permission to copy and/or distribute it,
|
|
1667 |
# with or without modifications, as long as this notice is preserved.
|
|
1668 |
||
1669 |
# serial 4
|
|
1670 |
||
1671 |
# AM_SANITY_CHECK
|
|
1672 |
# ---------------
|
|
1673 |
AC_DEFUN([AM_SANITY_CHECK],
|
|
1674 |
[AC_MSG_CHECKING([whether build environment is sane])
|
|
1675 |
# Just in case
|
|
1676 |
sleep 1
|
|
1677 |
echo timestamp > conftest.file
|
|
1678 |
# Do `set' in a subshell so we don't clobber the current shell's
|
|
1679 |
# arguments. Must try -L first in case configure is actually a
|
|
1680 |
# symlink; some systems play weird games with the mod time of symlinks
|
|
1681 |
# (eg FreeBSD returns the mod time of the symlink's containing
|
|
1682 |
# directory).
|
|
1683 |
if (
|
|
1684 |
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
|
1685 |
if test "$[*]" = "X"; then |
|
1686 |
# -L didn't work.
|
|
1687 |
set X `ls -t $srcdir/configure conftest.file`
|
|
1688 |
fi
|
|
1689 |
rm -f conftest.file
|
|
1690 |
if test "$[*]" != "X $srcdir/configure conftest.file" \ |
|
1691 |
&& test "$[*]" != "X conftest.file $srcdir/configure"; then |
|
1692 |
||
1693 |
# If neither matched, then we have a broken ls. This can happen
|
|
1694 |
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
|
1695 |
# broken ls alias from the environment. This has actually
|
|
1696 |
# happened. Such a system could not be considered "sane". |
|
1697 |
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
|
1698 |
alias in your environment])
|
|
1699 |
fi
|
|
1700 |
||
1701 |
test "$[2]" = conftest.file |
|
1702 |
)
|
|
1703 |
then
|
|
1704 |
# Ok.
|
|
1705 |
:
|
|
1706 |
else
|
|
1707 |
AC_MSG_ERROR([newly created file is older than distributed files!
|
|
1708 |
Check your system clock])
|
|
1709 |
fi
|
|
1710 |
AC_MSG_RESULT(yes)])
|
|
1711 |
||
1712 |
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
|
1713 |
#
|
|
1714 |
# This file is free software; the Free Software Foundation
|
|
1715 |
# gives unlimited permission to copy and/or distribute it,
|
|
1716 |
# with or without modifications, as long as this notice is preserved.
|
|
1717 |
||
1718 |
# AM_PROG_INSTALL_STRIP
|
|
1719 |
# ---------------------
|
|
1720 |
# One issue with vendor `install' (even GNU) is that you can't
|
|
1721 |
# specify the program used to strip binaries. This is especially
|
|
1722 |
# annoying in cross-compiling environments, where the build's strip
|
|
1723 |
# is unlikely to handle the host's binaries.
|
|
1724 |
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
|
1725 |
# always use install-sh in `make install-strip', and initialize
|
|
1726 |
# STRIPPROG with the value of the STRIP variable (set by the user).
|
|
1727 |
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
|
1728 |
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
|
1729 |
# Installed binaries are usually stripped using `strip' when the user
|
|
1730 |
# run `make install-strip'. However `strip' might not be the right
|
|
1731 |
# tool to use in cross-compilation environments, therefore Automake
|
|
1732 |
# will honor the `STRIP' environment variable to overrule this program.
|
|
1733 |
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
|
1734 |
if test "$cross_compiling" != no; then |
|
1735 |
AC_CHECK_TOOL([STRIP], [strip], :)
|
|
1736 |
fi
|
|
1737 |
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" |
|
1738 |
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
|
1739 |
||
1740 |
# Check how to create a tarball. -*- Autoconf -*-
|
|
1741 |
||
1742 |
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
|
1743 |
#
|
|
1744 |
# This file is free software; the Free Software Foundation
|
|
1745 |
# gives unlimited permission to copy and/or distribute it,
|
|
1746 |
# with or without modifications, as long as this notice is preserved.
|
|
1747 |
||
1748 |
# serial 2
|
|
1749 |
||
1750 |
# _AM_PROG_TAR(FORMAT)
|
|
1751 |
# --------------------
|
|
1752 |
# Check how to create a tarball in format FORMAT.
|
|
1753 |
# FORMAT should be one of `v7', `ustar', or `pax'.
|
|
1754 |
#
|
|
1755 |
# Substitute a variable $(am__tar) that is a command
|
|
1756 |
# writing to stdout a FORMAT-tarball containing the directory
|
|
1757 |
# $tardir.
|
|
1758 |
# tardir=directory && $(am__tar) > result.tar
|
|
1759 |
#
|
|
1760 |
# Substitute a variable $(am__untar) that extract such
|
|
1761 |
# a tarball read from stdin.
|
|
1762 |
# $(am__untar) < result.tar
|
|
1763 |
AC_DEFUN([_AM_PROG_TAR],
|
|
1764 |
[# Always define AMTAR for backward compatibility.
|
|
1765 |
AM_MISSING_PROG([AMTAR], [tar])
|
|
1766 |
m4_if([$1], [v7],
|
|
1767 |
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], |
|
1768 |
[m4_case([$1], [ustar],, [pax],,
|
|
1769 |
[m4_fatal([Unknown tar format])])
|
|
1770 |
AC_MSG_CHECKING([how to create a $1 tar archive])
|
|
1771 |
# Loop over all known methods to create a tar archive until one works.
|
|
1772 |
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
|
1773 |
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
|
1774 |
# Do not fold the above two line into one, because Tru64 sh and
|
|
1775 |
# Solaris sh will not grok spaces in the rhs of `-'.
|
|
1776 |
for _am_tool in $_am_tools
|
|
1777 |
do
|
|
1778 |
case $_am_tool in
|
|
1779 |
gnutar)
|
|
1780 |
for _am_tar in tar gnutar gtar;
|
|
1781 |
do
|
|
1782 |
AM_RUN_LOG([$_am_tar --version]) && break
|
|
1783 |
done
|
|
1784 |
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' |
|
1785 |
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' |
|
1786 |
am__untar="$_am_tar -xf -" |
|
1787 |
;;
|
|
1788 |
plaintar)
|
|
1789 |
# Must skip GNU tar: if it does not support --format= it doesn't create
|
|
1790 |
# ustar tarball either.
|
|
1791 |
(tar --version) >/dev/null 2>&1 && continue
|
|
1792 |
am__tar='tar chf - "$$tardir"' |
|
1793 |
am__tar_='tar chf - "$tardir"' |
|
1794 |
am__untar='tar xf -'
|
|
1795 |
;;
|
|
1796 |
pax)
|
|
1797 |
am__tar='pax -L -x $1 -w "$$tardir"' |
|
1798 |
am__tar_='pax -L -x $1 -w "$tardir"' |
|
1799 |
am__untar='pax -r'
|
|
1800 |
;;
|
|
1801 |
cpio)
|
|
1802 |
am__tar='find "$$tardir" -print | cpio -o -H $1 -L' |
|
1803 |
am__tar_='find "$tardir" -print | cpio -o -H $1 -L' |
|
1804 |
am__untar='cpio -i -H $1 -d'
|
|
1805 |
;;
|
|
1806 |
none)
|
|
1807 |
am__tar=false
|
|
1808 |
am__tar_=false
|
|
1809 |
am__untar=false
|
|
1810 |
;;
|
|
1811 |
esac
|
|
1812 |
||
1813 |
# If the value was cached, stop now. We just wanted to have am__tar
|
|
1814 |
# and am__untar set.
|
|
1815 |
test -n "${am_cv_prog_tar_$1}" && break |
|
1816 |
||
1817 |
# tar/untar a dummy directory, and stop if the command works |
|
1818 |
rm -rf conftest.dir |
|
1819 |
mkdir conftest.dir |
|
1820 |
echo GrepMe > conftest.dir/file |
|
1821 |
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) |
|
1822 |
rm -rf conftest.dir |
|
1823 |
if test -s conftest.tar; then |
|
1824 |
AM_RUN_LOG([$am__untar <conftest.tar]) |
|
1825 |
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break |
|
1826 |
fi |
|
1827 |
done
|
|
1828 |
rm -rf conftest.dir |
|
1829 |
||
1830 |
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) |
|
1831 |
AC_MSG_RESULT([$am_cv_prog_tar_$1])]) |
|
1832 |
AC_SUBST([am__tar]) |
|
1833 |
AC_SUBST([am__untar]) |
|
1834 |
]) # _AM_PROG_TAR |
|
1835 |
||
1836 |
m4_include([acinclude.m4]) |