20
33
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22
AC_DEFUN(AM_INIT_AUTOMAKE,
23
[AC_REQUIRE([AC_PROG_INSTALL])
28
dnl test to see if srcdir already configured
29
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
35
# Configure paths for GLIB
36
# Owen Taylor 1997-2001
38
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
39
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
40
dnl gthread is specified in MODULES, pass to pkg-config
42
AC_DEFUN(AM_PATH_GLIB_2_0,
44
dnl Get the cflags and libraries from pkg-config
46
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
47
, enable_glibtest=yes)
49
pkg_config_args=glib-2.0
54
pkg_config_args="$pkg_config_args gmodule-2.0"
57
pkg_config_args="$pkg_config_args gobject-2.0"
60
pkg_config_args="$pkg_config_args gthread-2.0"
65
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
69
if test x$PKG_CONFIG != xno ; then
70
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
73
echo *** pkg-config too old; version 0.7 or better required.
81
min_glib_version=ifelse([$1], ,2.0.0,$1)
82
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
84
if test x$PKG_CONFIG != xno ; then
85
## don't try to run the test against uninstalled libtool libs
86
if $PKG_CONFIG --uninstalled $pkg_config_args; then
87
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
91
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
98
if test x"$no_glib" = x ; then
99
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
100
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
101
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
103
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
104
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
105
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
106
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
107
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
108
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
109
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
110
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
111
if test "x$enable_glibtest" = "xyes" ; then
112
ac_save_CFLAGS="$CFLAGS"
114
CFLAGS="$CFLAGS $GLIB_CFLAGS"
115
LIBS="$GLIB_LIBS $LIBS"
117
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
118
dnl checks the results of pkg-config to some extent)
129
int major, minor, micro;
132
system ("touch conf.glibtest");
134
/* HP/UX 9 (%@#!) writes to sscanf strings */
135
tmp_version = g_strdup("$min_glib_version");
136
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
137
printf("%s, bad version string\n", "$min_glib_version");
141
if ((glib_major_version != $glib_config_major_version) ||
142
(glib_minor_version != $glib_config_minor_version) ||
143
(glib_micro_version != $glib_config_micro_version))
145
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
146
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
147
glib_major_version, glib_minor_version, glib_micro_version);
148
printf ("*** was found! If pkg-config was correct, then it is best\n");
149
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
150
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
151
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
152
printf("*** required on your system.\n");
153
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
154
printf("*** to point to the correct configuration files\n");
156
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
157
(glib_minor_version != GLIB_MINOR_VERSION) ||
158
(glib_micro_version != GLIB_MICRO_VERSION))
160
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
161
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
162
printf("*** library (version %d.%d.%d)\n",
163
glib_major_version, glib_minor_version, glib_micro_version);
167
if ((glib_major_version > major) ||
168
((glib_major_version == major) && (glib_minor_version > minor)) ||
169
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
175
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
176
glib_major_version, glib_minor_version, glib_micro_version);
177
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
178
major, minor, micro);
179
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
181
printf("*** If you have already installed a sufficiently new version, this error\n");
182
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
183
printf("*** being found. The easiest way to fix this is to remove the old version\n");
184
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
185
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
186
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
187
printf("*** so that the correct libraries are found at run-time))\n");
192
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
193
CFLAGS="$ac_save_CFLAGS"
197
if test "x$no_glib" = x ; then
198
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
199
ifelse([$2], , :, [$2])
202
if test "$PKG_CONFIG" = "no" ; then
203
echo "*** A new enough version of pkg-config was not found."
204
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
206
if test -f conf.glibtest ; then
209
echo "*** Could not run GLIB test program, checking why..."
210
CFLAGS="$CFLAGS $GLIB_CFLAGS"
211
LIBS="$LIBS $GLIB_LIBS"
215
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
216
[ echo "*** The test program compiled, but did not run. This usually means"
217
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
218
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
219
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
220
echo "*** to the installed location Also, make sure you have run ldconfig if that"
221
echo "*** is required on your system"
223
echo "*** If you have an old version installed, it is best to remove it, although"
224
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
225
[ echo "*** The test program failed to compile or link. See the file config.log for the"
226
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
227
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
228
echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
229
CFLAGS="$ac_save_CFLAGS"
238
ifelse([$3], , :, [$3])
240
AC_SUBST(GLIB_CFLAGS)
242
AC_SUBST(GLIB_GENMARSHAL)
243
AC_SUBST(GOBJECT_QUERY)
244
AC_SUBST(GLIB_MKENUMS)
248
# Configure paths for GTK+
249
# Owen Taylor 1997-2001
251
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
252
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
253
dnl pass to pkg-config
255
AC_DEFUN(AM_PATH_GTK_2_0,
257
dnl Get the cflags and libraries from pkg-config
259
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
260
, enable_gtktest=yes)
262
pkg_config_args=gtk+-2.0
267
pkg_config_args="$pkg_config_args gthread-2.0"
274
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
276
if test x$PKG_CONFIG != xno ; then
277
if pkg-config --atleast-pkgconfig-version 0.7 ; then
280
echo *** pkg-config too old; version 0.7 or better required.
288
min_gtk_version=ifelse([$1], ,2.0.0,$1)
289
AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
291
if test x$PKG_CONFIG != xno ; then
292
## don't try to run the test against uninstalled libtool libs
293
if $PKG_CONFIG --uninstalled $pkg_config_args; then
294
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
298
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
305
if test x"$no_gtk" = x ; then
306
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
307
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
308
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
309
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
310
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
311
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
312
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
313
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
314
if test "x$enable_gtktest" = "xyes" ; then
315
ac_save_CFLAGS="$CFLAGS"
317
CFLAGS="$CFLAGS $GTK_CFLAGS"
318
LIBS="$GTK_LIBS $LIBS"
320
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
321
dnl checks the results of pkg-config to some extent)
332
int major, minor, micro;
335
system ("touch conf.gtktest");
337
/* HP/UX 9 (%@#!) writes to sscanf strings */
338
tmp_version = g_strdup("$min_gtk_version");
339
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
340
printf("%s, bad version string\n", "$min_gtk_version");
344
if ((gtk_major_version != $gtk_config_major_version) ||
345
(gtk_minor_version != $gtk_config_minor_version) ||
346
(gtk_micro_version != $gtk_config_micro_version))
348
printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
349
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
350
gtk_major_version, gtk_minor_version, gtk_micro_version);
351
printf ("*** was found! If pkg-config was correct, then it is best\n");
352
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
353
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
354
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
355
printf("*** required on your system.\n");
356
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
357
printf("*** to point to the correct configuration files\n");
359
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
360
(gtk_minor_version != GTK_MINOR_VERSION) ||
361
(gtk_micro_version != GTK_MICRO_VERSION))
363
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
364
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
365
printf("*** library (version %d.%d.%d)\n",
366
gtk_major_version, gtk_minor_version, gtk_micro_version);
370
if ((gtk_major_version > major) ||
371
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
372
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
378
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
379
gtk_major_version, gtk_minor_version, gtk_micro_version);
380
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
381
major, minor, micro);
382
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
384
printf("*** If you have already installed a sufficiently new version, this error\n");
385
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
386
printf("*** being found. The easiest way to fix this is to remove the old version\n");
387
printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
388
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
389
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
390
printf("*** so that the correct libraries are found at run-time))\n");
395
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
396
CFLAGS="$ac_save_CFLAGS"
400
if test "x$no_gtk" = x ; then
401
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
402
ifelse([$2], , :, [$2])
405
if test "$PKG_CONFIG" = "no" ; then
406
echo "*** A new enough version of pkg-config was not found."
407
echo "*** See http://pkgconfig.sourceforge.net"
409
if test -f conf.gtktest ; then
412
echo "*** Could not run GTK+ test program, checking why..."
413
CFLAGS="$CFLAGS $GTK_CFLAGS"
414
LIBS="$LIBS $GTK_LIBS"
418
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
419
[ echo "*** The test program compiled, but did not run. This usually means"
420
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
421
echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
422
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
423
echo "*** to the installed location Also, make sure you have run ldconfig if that"
424
echo "*** is required on your system"
426
echo "*** If you have an old version installed, it is best to remove it, although"
427
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
428
[ echo "*** The test program failed to compile or link. See the file config.log for the"
429
echo "*** exact error that occured. This usually means GTK+ was incorrectly installed"
430
echo "*** or that you have moved GTK+ since it was installed. In the latter case, you"
431
echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
432
CFLAGS="$ac_save_CFLAGS"
438
ifelse([$3], , :, [$3])
446
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
447
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
448
dnl also defines GSTUFF_PKG_ERRORS on error
449
AC_DEFUN(PKG_CHECK_MODULES, [
452
if test -z "$PKG_CONFIG"; then
453
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
456
if test "$PKG_CONFIG" = "no" ; then
457
echo "*** The pkg-config script could not be found. Make sure it is"
458
echo "*** in your path, or set the PKG_CONFIG environment variable"
459
echo "*** to the full path to pkg-config."
460
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
462
PKG_CONFIG_MIN_VERSION=0.9.0
463
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
464
AC_MSG_CHECKING(for $2)
466
if $PKG_CONFIG --exists "$2" ; then
470
AC_MSG_CHECKING($1_CFLAGS)
471
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
472
AC_MSG_RESULT($$1_CFLAGS)
474
AC_MSG_CHECKING($1_LIBS)
475
$1_LIBS=`$PKG_CONFIG --libs "$2"`
476
AC_MSG_RESULT($$1_LIBS)
480
## If we have a custom action on failure, don't print errors, but
481
## do set a variable so people can do so.
482
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
483
ifelse([$4], ,echo $$1_PKG_ERRORS,)
489
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
490
echo "*** See http://www.freedesktop.org/software/pkgconfig"
494
if test $succeeded = yes; then
495
ifelse([$3], , :, [$3])
497
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
502
# Do all the work for Automake. -*- Autoconf -*-
504
# This macro actually does too much some checks are only needed if
505
# your package does certain things. But this isn't really a big deal.
507
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
508
# Free Software Foundation, Inc.
510
# This program is free software; you can redistribute it and/or modify
511
# it under the terms of the GNU General Public License as published by
512
# the Free Software Foundation; either version 2, or (at your option)
515
# This program is distributed in the hope that it will be useful,
516
# but WITHOUT ANY WARRANTY; without even the implied warranty of
517
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
518
# GNU General Public License for more details.
520
# You should have received a copy of the GNU General Public License
521
# along with this program; if not, write to the Free Software
522
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
527
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
528
# written in clear, in which case automake, when reading aclocal.m4,
529
# will think it sees a *use*, and therefore will trigger all it's
530
# C support machinery. Also note that it means that autoscan, seeing
531
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
536
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
537
# the ones we care about.
538
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
540
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
541
# AM_INIT_AUTOMAKE([OPTIONS])
542
# -----------------------------------------------
543
# The call with PACKAGE and VERSION arguments is the old style
544
# call (pre autoconf-2.50), which is being phased out. PACKAGE
545
# and VERSION should now be passed to AC_INIT and removed from
546
# the call to AM_INIT_AUTOMAKE.
547
# We support both call styles for the transition. After
548
# the next Automake release, Autoconf can make the AC_INIT
549
# arguments mandatory, and then we can depend on a new Autoconf
550
# release and drop the old call support.
551
AC_DEFUN([AM_INIT_AUTOMAKE],
552
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
553
AC_REQUIRE([AC_PROG_INSTALL])dnl
554
# test to see if srcdir already configured
555
if test "`cd $srcdir && pwd`" != "`pwd`" &&
556
test -f $srcdir/config.status; then
30
557
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35
AC_REQUIRE([AM_SANITY_CHECK])
36
AC_REQUIRE([AC_ARG_PROGRAM])
37
dnl FIXME This is truly gross.
38
missing_dir=`cd $ac_aux_dir && pwd`
39
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44
AC_REQUIRE([AC_PROG_MAKE_SET])])
560
# Define the identity of the package.
561
dnl Distinguish between old-style and new-style calls.
563
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
564
AC_SUBST([PACKAGE], [$1])dnl
565
AC_SUBST([VERSION], [$2])],
566
[_AM_SET_OPTIONS([$1])dnl
567
AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
568
AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
570
_AM_IF_OPTION([no-define],,
571
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
572
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
574
# Some tools Automake needs.
575
AC_REQUIRE([AM_SANITY_CHECK])dnl
576
AC_REQUIRE([AC_ARG_PROGRAM])dnl
577
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
578
AM_MISSING_PROG(AUTOCONF, autoconf)
579
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
580
AM_MISSING_PROG(AUTOHEADER, autoheader)
581
AM_MISSING_PROG(MAKEINFO, makeinfo)
582
AM_MISSING_PROG(AMTAR, tar)
584
AM_PROG_INSTALL_STRIP
585
# We need awk for the "check" target. The system "awk" is bad on
587
AC_REQUIRE([AC_PROG_AWK])dnl
588
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
590
_AM_IF_OPTION([no-dependencies],,
591
[AC_PROVIDE_IFELSE([AC_PROG_][CC],
592
[_AM_DEPENDENCIES(CC)],
593
[define([AC_PROG_][CC],
594
defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
595
AC_PROVIDE_IFELSE([AC_PROG_][CXX],
596
[_AM_DEPENDENCIES(CXX)],
597
[define([AC_PROG_][CXX],
598
defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
602
# Copyright 2002 Free Software Foundation, Inc.
604
# This program is free software; you can redistribute it and/or modify
605
# it under the terms of the GNU General Public License as published by
606
# the Free Software Foundation; either version 2, or (at your option)
609
# This program is distributed in the hope that it will be useful,
610
# but WITHOUT ANY WARRANTY; without even the implied warranty of
611
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
612
# GNU General Public License for more details.
614
# You should have received a copy of the GNU General Public License
615
# along with this program; if not, write to the Free Software
616
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
618
# AM_AUTOMAKE_VERSION(VERSION)
619
# ----------------------------
620
# Automake X.Y traces this macro to ensure aclocal.m4 has been
621
# generated from the m4 files accompanying Automake X.Y.
622
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
624
# AM_SET_CURRENT_AUTOMAKE_VERSION
625
# -------------------------------
626
# Call AM_AUTOMAKE_VERSION so it can be traced.
627
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
628
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
629
[AM_AUTOMAKE_VERSION([1.6.1])])
631
# Helper functions for option handling. -*- Autoconf -*-
633
# Copyright 2001, 2002 Free Software Foundation, Inc.
635
# This program is free software; you can redistribute it and/or modify
636
# it under the terms of the GNU General Public License as published by
637
# the Free Software Foundation; either version 2, or (at your option)
640
# This program is distributed in the hope that it will be useful,
641
# but WITHOUT ANY WARRANTY; without even the implied warranty of
642
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
# GNU General Public License for more details.
645
# You should have received a copy of the GNU General Public License
646
# along with this program; if not, write to the Free Software
647
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
652
# _AM_MANGLE_OPTION(NAME)
653
# -----------------------
654
AC_DEFUN([_AM_MANGLE_OPTION],
655
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
657
# _AM_SET_OPTION(NAME)
658
# ------------------------------
659
# Set option NAME. Presently that only means defining a flag for this option.
660
AC_DEFUN([_AM_SET_OPTION],
661
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
663
# _AM_SET_OPTIONS(OPTIONS)
664
# ----------------------------------
665
# OPTIONS is a space-separated list of Automake options.
666
AC_DEFUN([_AM_SET_OPTIONS],
667
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
669
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
670
# -------------------------------------------
671
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
672
AC_DEFUN([_AM_IF_OPTION],
673
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
47
676
# Check to make sure that the build environment is sane.
50
AC_DEFUN(AM_SANITY_CHECK,
679
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
681
# This program is free software; you can redistribute it and/or modify
682
# it under the terms of the GNU General Public License as published by
683
# the Free Software Foundation; either version 2, or (at your option)
686
# This program is distributed in the hope that it will be useful,
687
# but WITHOUT ANY WARRANTY; without even the implied warranty of
688
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
689
# GNU General Public License for more details.
691
# You should have received a copy of the GNU General Public License
692
# along with this program; if not, write to the Free Software
693
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
700
AC_DEFUN([AM_SANITY_CHECK],
51
701
[AC_MSG_CHECKING([whether build environment is sane])
54
echo timestamp > conftestfile
704
echo timestamp > conftest.file
55
705
# Do `set' in a subshell so we don't clobber the current shell's
56
706
# arguments. Must try -L first in case configure is actually a
57
707
# symlink; some systems play weird games with the mod time of symlinks
58
708
# (eg FreeBSD returns the mod time of the symlink's containing
61
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62
if test "[$]*" = "X"; then
711
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
712
if test "$[*]" = "X"; then
64
set X `ls -t $srcdir/configure conftestfile`
714
set X `ls -t $srcdir/configure conftest.file`
66
if test "[$]*" != "X $srcdir/configure conftestfile" \
67
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
717
if test "$[*]" != "X $srcdir/configure conftest.file" \
718
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
69
720
# If neither matched, then we have a broken ls. This can happen
70
721
# if, for instance, CONFIG_SHELL is bash and it inherits a
83
734
AC_MSG_ERROR([newly created file is older than distributed files!
84
735
Check your system clock])
87
737
AC_MSG_RESULT(yes)])
89
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90
dnl The program must properly implement --version.
91
AC_DEFUN(AM_MISSING_PROG,
92
[AC_MSG_CHECKING(for working $2)
93
# Run test in a subshell; some versions of sh will print an error if
94
# an executable is not found, even if stderr is redirected.
95
# Redirect stdin to placate older versions of autoconf. Sigh.
96
if ($2 --version) < /dev/null > /dev/null 2>&1; then
101
AC_MSG_RESULT(missing)
742
# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
744
# This program is free software; you can redistribute it and/or modify
745
# it under the terms of the GNU General Public License as published by
746
# the Free Software Foundation; either version 2, or (at your option)
749
# This program is distributed in the hope that it will be useful,
750
# but WITHOUT ANY WARRANTY; without even the implied warranty of
751
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
752
# GNU General Public License for more details.
754
# You should have received a copy of the GNU General Public License
755
# along with this program; if not, write to the Free Software
756
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
761
# AM_MISSING_PROG(NAME, PROGRAM)
762
# ------------------------------
763
AC_DEFUN([AM_MISSING_PROG],
764
[AC_REQUIRE([AM_MISSING_HAS_RUN])
765
$1=${$1-"${am_missing_run}$2"}
105
# Like AC_CONFIG_HEADER, but automatically create stamp file.
107
AC_DEFUN(AM_CONFIG_HEADER,
109
AC_CONFIG_HEADER([$1])
110
dnl When config.status generates a header, we must update the stamp-h file.
111
dnl This file resides in the same directory as the config header
112
dnl that is generated. We must strip everything past the first ":",
113
dnl and everything past the last "/".
114
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
118
for am_file in <<$1>>; do
119
case " <<$>>CONFIG_HEADERS " in
120
*" <<$>>am_file "*<<)>>
121
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
124
am_indx=`expr "<<$>>am_indx" + 1`
128
# Macro to add for using GNU gettext.
129
# Ulrich Drepper <drepper@cygnus.com>, 1995.
131
# This file can be copied and used freely without restrictions. It can
132
# be used in projects which are not available under the GNU General Public
133
# License or the GNU Library General Public License but which still want
134
# to provide support for the GNU gettext functionality.
135
# Please note that the actual code of the GNU gettext library is covered
136
# by the GNU Library General Public License, and the rest of the GNU
137
# gettext package package is covered by the GNU General Public License.
138
# They are *not* in the public domain.
142
dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
143
dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
771
# Define MISSING if not defined so far and test if it supports --run.
772
# If it does, set am_missing_run to use it, otherwise, to nothing.
773
AC_DEFUN([AM_MISSING_HAS_RUN],
774
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
775
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
776
# Use eval to expand $SHELL
777
if eval "$MISSING --run true"; then
778
am_missing_run="$MISSING --run "
781
AC_MSG_WARN([`missing' script is too old or missing])
787
# Copyright 2001 Free Software Foundation, Inc.
789
# This program is free software; you can redistribute it and/or modify
790
# it under the terms of the GNU General Public License as published by
791
# the Free Software Foundation; either version 2, or (at your option)
794
# This program is distributed in the hope that it will be useful,
795
# but WITHOUT ANY WARRANTY; without even the implied warranty of
796
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
797
# GNU General Public License for more details.
799
# You should have received a copy of the GNU General Public License
800
# along with this program; if not, write to the Free Software
801
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
804
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
805
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
806
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
808
# Of course, Automake must honor this variable whenever it calls a
809
# tool from the auxiliary directory. The problem is that $srcdir (and
810
# therefore $ac_aux_dir as well) can be either absolute or relative,
811
# depending on how configure is run. This is pretty annoying, since
812
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
813
# source directory, any form will work fine, but in subdirectories a
814
# relative path needs to be adjusted first.
816
# $ac_aux_dir/missing
817
# fails when called from a subdirectory if $ac_aux_dir is relative
818
# $top_srcdir/$ac_aux_dir/missing
819
# fails if $ac_aux_dir is absolute,
820
# fails when called from a subdirectory in a VPATH build with
821
# a relative $ac_aux_dir
823
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
824
# are both prefixed by $srcdir. In an in-source build this is usually
825
# harmless because $srcdir is `.', but things will broke when you
826
# start a VPATH build or use an absolute $srcdir.
828
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
829
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
830
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
831
# and then we would define $MISSING as
832
# MISSING="\${SHELL} $am_aux_dir/missing"
833
# This will work as long as MISSING is not called from configure, because
834
# unfortunately $(top_srcdir) has no meaning in configure.
835
# However there are other variables, like CC, which are often used in
836
# configure, and could therefore not use this "fixed" $ac_aux_dir.
838
# Another solution, used here, is to always expand $ac_aux_dir to an
839
# absolute PATH. The drawback is that using absolute paths prevent a
840
# configured tree to be moved without reconfiguration.
842
# Rely on autoconf to set up CDPATH properly.
845
AC_DEFUN([AM_AUX_DIR_EXPAND], [
846
# expand $ac_aux_dir to an absolute path
847
am_aux_dir=`cd $ac_aux_dir && pwd`
852
# Define $install_sh.
854
# Copyright 2001 Free Software Foundation, Inc.
856
# This program is free software; you can redistribute it and/or modify
857
# it under the terms of the GNU General Public License as published by
858
# the Free Software Foundation; either version 2, or (at your option)
861
# This program is distributed in the hope that it will be useful,
862
# but WITHOUT ANY WARRANTY; without even the implied warranty of
863
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
864
# GNU General Public License for more details.
866
# You should have received a copy of the GNU General Public License
867
# along with this program; if not, write to the Free Software
868
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
871
AC_DEFUN([AM_PROG_INSTALL_SH],
872
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
873
install_sh=${install_sh-"$am_aux_dir/install-sh"}
874
AC_SUBST(install_sh)])
876
# AM_PROG_INSTALL_STRIP
878
# Copyright 2001 Free Software Foundation, Inc.
880
# This program is free software; you can redistribute it and/or modify
881
# it under the terms of the GNU General Public License as published by
882
# the Free Software Foundation; either version 2, or (at your option)
885
# This program is distributed in the hope that it will be useful,
886
# but WITHOUT ANY WARRANTY; without even the implied warranty of
887
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
888
# GNU General Public License for more details.
890
# You should have received a copy of the GNU General Public License
891
# along with this program; if not, write to the Free Software
892
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
895
# One issue with vendor `install' (even GNU) is that you can't
896
# specify the program used to strip binaries. This is especially
897
# annoying in cross-compiling environments, where the build's strip
898
# is unlikely to handle the host's binaries.
899
# Fortunately install-sh will honor a STRIPPROG variable, so we
900
# always use install-sh in `make install-strip', and initialize
901
# STRIPPROG with the value of the STRIP variable (set by the user).
902
AC_DEFUN([AM_PROG_INSTALL_STRIP],
903
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
904
# Installed binaries are usually stripped using `strip' when the user
905
# run `make install-strip'. However `strip' might not be the right
906
# tool to use in cross-compilation environments, therefore Automake
907
# will honor the `STRIP' environment variable to overrule this program.
908
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
909
if test "$cross_compiling" != no; then
910
AC_CHECK_TOOL([STRIP], [strip], :)
912
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
913
AC_SUBST([INSTALL_STRIP_PROGRAM])])
915
# serial 4 -*- Autoconf -*-
917
# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
919
# This program is free software; you can redistribute it and/or modify
920
# it under the terms of the GNU General Public License as published by
921
# the Free Software Foundation; either version 2, or (at your option)
924
# This program is distributed in the hope that it will be useful,
925
# but WITHOUT ANY WARRANTY; without even the implied warranty of
926
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
927
# GNU General Public License for more details.
929
# You should have received a copy of the GNU General Public License
930
# along with this program; if not, write to the Free Software
931
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
935
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
936
# written in clear, in which case automake, when reading aclocal.m4,
937
# will think it sees a *use*, and therefore will trigger all it's
938
# C support machinery. Also note that it means that autoscan, seeing
939
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
943
# _AM_DEPENDENCIES(NAME)
944
# ----------------------
945
# See how the compiler implements dependency checking.
946
# NAME is "CC", "CXX", "GCJ", or "OBJC".
947
# We try a few techniques and use that to set a single cache variable.
949
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
950
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
951
# dependency, and given that the user is not expected to run this macro,
952
# just rely on AC_PROG_CC.
953
AC_DEFUN([_AM_DEPENDENCIES],
954
[AC_REQUIRE([AM_SET_DEPDIR])dnl
955
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
956
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
957
AC_REQUIRE([AM_DEP_TRACK])dnl
959
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
960
[$1], CXX, [depcc="$CXX" am_compiler_list=],
961
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
962
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
963
[depcc="$$1" am_compiler_list=])
965
AC_CACHE_CHECK([dependency style of $depcc],
966
[am_cv_$1_dependencies_compiler_type],
967
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
968
# We make a subdir and do the tests there. Otherwise we can end up
969
# making bogus files that we don't know about and never remove. For
970
# instance it was reported that on HP-UX the gcc test will end up
971
# making a dummy file named `D' -- because `-MD' means `put the output
974
# Copy depcomp to subdir because otherwise we won't find it if we're
975
# using a relative directory.
976
cp "$am_depcomp" conftest.dir
979
am_cv_$1_dependencies_compiler_type=none
980
if test "$am_compiler_list" = ""; then
981
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
983
for depmode in $am_compiler_list; do
984
# We need to recreate these files for each test, as the compiler may
985
# overwrite some of them when testing with obscure command lines.
986
# This happens at least with the AIX C compiler.
987
echo '#include "conftest.h"' > conftest.c
988
echo 'int i;' > conftest.h
989
echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
993
# after this tag, mechanisms are not by side-effect, so they'll
994
# only be used when explicitly requested
995
if test "x$enable_dependency_tracking" = xyes; then
1003
# We check with `-c' and `-o' for the sake of the "dashmstdout"
1004
# mode. It turns out that the SunPro C++ compiler does not properly
1005
# handle `-M -o', and we need to detect this.
1006
if depmode=$depmode \
1007
source=conftest.c object=conftest.o \
1008
depfile=conftest.Po tmpdepfile=conftest.TPo \
1009
$SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
1010
grep conftest.h conftest.Po > /dev/null 2>&1 &&
1011
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1012
am_cv_$1_dependencies_compiler_type=$depmode
1020
am_cv_$1_dependencies_compiler_type=none
1023
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1029
# Choose a directory name for dependency files.
1030
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1031
AC_DEFUN([AM_SET_DEPDIR],
1032
[rm -f .deps 2>/dev/null
1033
mkdir .deps 2>/dev/null
1034
if test -d .deps; then
1037
# MS-DOS does not allow filenames that begin with a dot.
1040
rmdir .deps 2>/dev/null
1047
AC_DEFUN([AM_DEP_TRACK],
1048
[AC_ARG_ENABLE(dependency-tracking,
1049
[ --disable-dependency-tracking Speeds up one-time builds
1050
--enable-dependency-tracking Do not reject slow dependency extractors])
1051
if test "x$enable_dependency_tracking" != xno; then
1052
am_depcomp="$ac_aux_dir/depcomp"
1055
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1056
AC_SUBST([AMDEPBACKSLASH])
1059
# Generate code to set up dependency tracking. -*- Autoconf -*-
1061
# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1063
# This program is free software; you can redistribute it and/or modify
1064
# it under the terms of the GNU General Public License as published by
1065
# the Free Software Foundation; either version 2, or (at your option)
1066
# any later version.
1068
# This program is distributed in the hope that it will be useful,
1069
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1070
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1071
# GNU General Public License for more details.
1073
# You should have received a copy of the GNU General Public License
1074
# along with this program; if not, write to the Free Software
1075
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1080
# _AM_OUTPUT_DEPENDENCY_COMMANDS
1081
# ------------------------------
1082
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1083
[for mf in $CONFIG_FILES; do
1084
# Strip MF so we end up with the name of the file.
1085
mf=`echo "$mf" | sed -e 's/:.*$//'`
1086
if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then
1087
dirpart=`AS_DIRNAME("$mf")`
1091
grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
1092
# Extract the definition of DEP_FILES from the Makefile without
1094
DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
1095
test -z "$DEPDIR" && continue
1096
# When using ansi2knr, U may be empty or an underscore; expand it
1097
U=`sed -n -e '/^U = / s///p' < "$mf"`
1098
test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
1099
# We invoke sed twice because it is the simplest approach to
1100
# changing $(DEPDIR) to its actual value in the expansion.
1101
for file in `sed -n -e '
1102
/^DEP_FILES = .*\\\\$/ {
1111
/^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
1112
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1113
# Make sure the directory exists.
1114
test -f "$dirpart/$file" && continue
1115
fdir=`AS_DIRNAME(["$file"])`
1116
AS_MKDIR_P([$dirpart/$fdir])
1117
# echo "creating $dirpart/$file"
1118
echo '# dummy' > "$dirpart/$file"
1121
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1124
# AM_OUTPUT_DEPENDENCY_COMMANDS
1125
# -----------------------------
1126
# This macro should only be invoked once -- use via AC_REQUIRE.
1128
# This code is only required when automatic dependency tracking
1129
# is enabled. FIXME. This creates each `.P' file that we will
1130
# need in order to bootstrap the dependency handling code.
1131
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1132
[AC_CONFIG_COMMANDS([depfiles],
1133
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1134
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1137
# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
1139
# This program is free software; you can redistribute it and/or modify
1140
# it under the terms of the GNU General Public License as published by
1141
# the Free Software Foundation; either version 2, or (at your option)
1142
# any later version.
1144
# This program is distributed in the hope that it will be useful,
1145
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1146
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1147
# GNU General Public License for more details.
1149
# You should have received a copy of the GNU General Public License
1150
# along with this program; if not, write to the Free Software
1151
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1158
# Check to see how make treats includes.
1159
AC_DEFUN([AM_MAKE_INCLUDE],
1160
[am_make=${MAKE-make}
1161
cat > confinc << 'END'
1165
# If we don't find an include directive, just comment out the code.
1166
AC_MSG_CHECKING([for style of include used by $am_make])
1170
# First try GNU make style include.
1171
echo "include confinc" > confmf
1172
# We grep out `Entering directory' and `Leaving directory'
1173
# messages which can occur if `w' ends up in MAKEFLAGS.
1174
# In particular we don't look at `^make:' because GNU make might
1175
# be invoked under some other name (usually "gmake"), in which
1176
# case it prints its new name instead of `make'.
1177
if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
1182
# Now try BSD make style include.
1183
if test "$am__include" = "#"; then
1184
echo '.include "confinc"' > confmf
1185
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1186
am__include=.include
1191
AC_SUBST(am__include)
1193
AC_MSG_RESULT($_am_result)
1194
rm -f confinc confmf
1197
# AM_CONDITIONAL -*- Autoconf -*-
1199
# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
1201
# This program is free software; you can redistribute it and/or modify
1202
# it under the terms of the GNU General Public License as published by
1203
# the Free Software Foundation; either version 2, or (at your option)
1204
# any later version.
1206
# This program is distributed in the hope that it will be useful,
1207
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1208
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1209
# GNU General Public License for more details.
1211
# You should have received a copy of the GNU General Public License
1212
# along with this program; if not, write to the Free Software
1213
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1220
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1221
# -------------------------------------
1222
# Define a conditional.
1223
AC_DEFUN([AM_CONDITIONAL],
1224
[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1225
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1227
AC_SUBST([$1_FALSE])
1235
AC_CONFIG_COMMANDS_PRE(
1236
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1237
AC_MSG_ERROR([conditional \"$1\" was never defined.
1238
Usually this means the macro was only invoked conditionally.])
1241
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
1243
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
1245
# This program is free software; you can redistribute it and/or modify
1246
# it under the terms of the GNU General Public License as published by
1247
# the Free Software Foundation; either version 2, or (at your option)
1248
# any later version.
1250
# This program is distributed in the hope that it will be useful,
1251
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1252
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1253
# GNU General Public License for more details.
1255
# You should have received a copy of the GNU General Public License
1256
# along with this program; if not, write to the Free Software
1257
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1264
# When config.status generates a header, we must update the stamp-h file.
1265
# This file resides in the same directory as the config header
1266
# that is generated. We must strip everything past the first ":",
1267
# and everything past the last "/".
1271
# Like AS_DIRNAME, only do it during macro expansion
1272
AC_DEFUN([_AM_DIRNAME],
1273
[m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
1274
m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
1275
m4_if(regexp([$1], [^/.*]), -1,
1277
patsubst([$1], [^\(/\).*], [\1])),
1278
patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
1279
patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
1283
# The stamp files are numbered to have different names.
1284
# We could number them on a directory basis, but that's additional
1285
# complications, let's have a unique counter.
1286
m4_define([_AM_STAMP_Count], [0])
1291
# The name of the stamp file for HEADER.
1292
AC_DEFUN([_AM_STAMP],
1293
[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
1294
AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
1295
[:.*])))/stamp-h[]_AM_STAMP_Count])
1298
# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
1299
# ------------------------------------------------------------
1300
# We used to try to get a real timestamp in stamp-h. But the fear is that
1301
# that will cause unnecessary cvs conflicts.
1302
AC_DEFUN([_AM_CONFIG_HEADER],
1303
[# Add the stamp file to the list of files AC keeps track of,
1304
# along with our hook.
1305
AC_CONFIG_HEADERS([$1],
1306
[# update the timestamp
1307
echo 'timestamp for $1' >"_AM_STAMP([$1])"
1310
])# _AM_CONFIG_HEADER
1313
# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
1314
# --------------------------------------------------------------
1315
AC_DEFUN([AM_CONFIG_HEADER],
1316
[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
1317
])# AM_CONFIG_HEADER
1319
# gettext.m4 serial 14 (gettext-0.11.2)
1320
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1321
dnl This file is free software, distributed under the terms of the GNU
1322
dnl General Public License. As a special exception to the GNU General
1323
dnl Public License, this file may be distributed as part of a program
1324
dnl that contains a configuration script generated by Autoconf, under
1325
dnl the same distribution terms as the rest of that program.
1327
dnl This file can can be used in projects which are not available under
1328
dnl the GNU General Public License or the GNU Library General Public
1329
dnl License but which still want to provide support for the GNU gettext
1331
dnl Please note that the actual code of the GNU gettext library is covered
1332
dnl by the GNU Library General Public License, and the rest of the GNU
1333
dnl gettext package package is covered by the GNU General Public License.
1334
dnl They are *not* in the public domain.
1337
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1338
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
1340
dnl Macro to add for using GNU gettext.
1342
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1343
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1344
dnl default (if it is not specified or empty) is 'no-libtool'.
1345
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1346
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1347
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
144
1348
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
145
1349
dnl depending on --{enable,disable}-{shared,static} and on the presence of
146
dnl AM-DISABLE-SHARED). Otherwise, a static library
1350
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
147
1351
dnl $(top_builddir)/intl/libintl.a will be created.
148
1352
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
149
1353
dnl implementations (in libc or libintl) without the ngettext() function
150
1354
dnl will be ignored.
151
dnl LIBDIR is used to find the intl libraries. If empty,
1355
dnl INTLDIR is used to find the intl libraries. If empty,
152
1356
dnl the value `$(top_builddir)/intl/' is used.
154
1358
dnl The result of the configuration is one of three cases:
195
1423
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
196
1424
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
197
1426
dnl User does not insist on using GNU NLS library. Figure out what
198
1427
dnl to use. If GNU gettext is available we use this. Else we have
199
1428
dnl to fall back to GNU NLS library.
202
1430
dnl Add a version number to the cache macros.
203
define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
204
define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
206
AC_CHECK_HEADER(libintl.h,
207
[AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
208
[AC_TRY_LINK([#include <libintl.h>
209
extern int _nl_msg_cat_cntr;],
210
[bindtextdomain ("", "");
211
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
212
gt_cv_func_gnugettext_libc=yes,
213
gt_cv_func_gnugettext_libc=no)])
215
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
216
AC_CACHE_CHECK([for GNU gettext in libintl],
217
gt_cv_func_gnugettext_libintl,
218
[gt_save_LIBS="$LIBS"
219
LIBS="$LIBS -lintl $LIBICONV"
220
AC_TRY_LINK([#include <libintl.h>
221
extern int _nl_msg_cat_cntr;],
222
[bindtextdomain ("", "");
223
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
224
gt_cv_func_gnugettext_libintl=yes,
225
gt_cv_func_gnugettext_libintl=no)
226
LIBS="$gt_save_LIBS"])
229
dnl If an already present or preinstalled GNU gettext() is found,
230
dnl use it. But if this macro is used in GNU gettext, and GNU
231
dnl gettext is already preinstalled in libintl, we update this
232
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
233
if test "$gt_cv_func_gnugettext_libc" = "yes" \
234
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
235
&& test "$PACKAGE" != gettext; }; then
236
AC_DEFINE(HAVE_GETTEXT, 1,
237
[Define if the GNU gettext() function is already present or preinstalled.])
239
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
240
dnl If iconv() is in a separate libiconv library, then anyone
241
dnl linking with libintl{.a,.so} also needs to link with
243
INTLLIBS="-lintl $LIBICONV"
247
LIBS="$LIBS $INTLLIBS"
248
AC_CHECK_FUNCS(dcgettext)
251
dnl Search for GNU msgfmt in the PATH.
252
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
253
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
254
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
256
dnl Search for GNU xgettext in the PATH.
257
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
258
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
264
if test "$CATOBJEXT" = "NONE"; then
265
dnl GNU gettext is not found in the C library.
266
dnl Fall back on GNU gettext library.
267
nls_cv_use_gnu_gettext=yes
1431
define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1))
1432
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1433
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1435
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1436
[AC_TRY_LINK([#include <libintl.h>
1437
extern int _nl_msg_cat_cntr;
1438
extern int *_nl_domain_bindings;],
1439
[bindtextdomain ("", "");
1440
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1441
gt_cv_func_gnugettext_libc=yes,
1442
gt_cv_func_gnugettext_libc=no)])
1444
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1445
dnl Sometimes libintl requires libiconv, so first search for libiconv.
1446
ifelse(gt_included_intl, yes, , [
1449
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1450
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1451
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1452
dnl even if libiconv doesn't exist.
1453
AC_LIB_LINKFLAGS_BODY([intl])
1454
AC_CACHE_CHECK([for GNU gettext in libintl],
1455
gt_cv_func_gnugettext_libintl,
1456
[gt_save_CPPFLAGS="$CPPFLAGS"
1457
CPPFLAGS="$CPPFLAGS $INCINTL"
1458
gt_save_LIBS="$LIBS"
1459
LIBS="$LIBS $LIBINTL"
1460
dnl Now see whether libintl exists and does not depend on libiconv.
1461
AC_TRY_LINK([#include <libintl.h>
1462
extern int _nl_msg_cat_cntr;
1467
const char *_nl_expand_alias ();],
1468
[bindtextdomain ("", "");
1469
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1470
gt_cv_func_gnugettext_libintl=yes,
1471
gt_cv_func_gnugettext_libintl=no)
1472
dnl Now see whether libintl exists and depends on libiconv.
1473
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1474
LIBS="$LIBS $LIBICONV"
1475
AC_TRY_LINK([#include <libintl.h>
1476
extern int _nl_msg_cat_cntr;
1481
const char *_nl_expand_alias ();],
1482
[bindtextdomain ("", "");
1483
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1484
[LIBINTL="$LIBINTL $LIBICONV"
1485
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1486
gt_cv_func_gnugettext_libintl=yes
1489
CPPFLAGS="$gt_save_CPPFLAGS"
1490
LIBS="$gt_save_LIBS"])
1493
dnl If an already present or preinstalled GNU gettext() is found,
1494
dnl use it. But if this macro is used in GNU gettext, and GNU
1495
dnl gettext is already preinstalled in libintl, we update this
1496
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1497
if test "$gt_cv_func_gnugettext_libc" = "yes" \
1498
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1499
&& test "$PACKAGE" != gettext; }; then
1500
gt_use_preinstalled_gnugettext=yes
1502
dnl Reset the values set by searching for libintl.
1508
ifelse(gt_included_intl, yes, [
1509
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1510
dnl GNU gettext is not found in the C library.
1511
dnl Fall back on included GNU gettext library.
1512
nls_cv_use_gnu_gettext=yes
271
1516
if test "$nls_cv_use_gnu_gettext" = "yes"; then
272
1517
dnl Mark actions used to generate GNU NLS library.
273
1518
INTLOBJS="\$(GETTOBJS)"
274
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
275
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
276
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
277
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
278
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
280
BUILD_INCLUDED_LIBINTL=yes
281
USE_INCLUDED_LIBINTL=yes
1519
BUILD_INCLUDED_LIBINTL=yes
1520
USE_INCLUDED_LIBINTL=yes
1521
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1522
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1523
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1526
if test "$gt_use_preinstalled_gnugettext" = "yes" \
1527
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
1528
dnl Mark actions to use GNU gettext tools.
283
INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
284
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
287
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
288
dnl Test whether we really found GNU msgfmt.
289
if test "$GMSGFMT" != ":"; then
290
dnl If it is no GNU msgfmt we define it as : so that the
291
dnl Makefiles still can work.
292
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
296
[found msgfmt program is not GNU msgfmt; ignore it])
301
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
302
dnl Test whether we really found GNU xgettext.
303
if test "$XGETTEXT" != ":"; then
304
dnl If it is no GNU xgettext we define it as : so that the
305
dnl Makefiles still can work.
306
if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
310
[found xgettext program is not GNU xgettext; ignore it])
315
dnl We need to process the po/ directory.
319
[for ac_file in $CONFIG_FILES; do
320
# Support "outfile[:infile[:infile...]]"
322
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
324
# PO directories have a Makefile.in generated from Makefile.in.in.
325
case "$ac_file" in */Makefile.in)
326
# Adjust a relative srcdir.
327
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
328
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
329
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
330
# In autoconf-2.13 it is called $ac_given_srcdir.
331
# In autoconf-2.50 it is called $srcdir.
332
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
333
case "$ac_given_srcdir" in
334
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
335
/*) top_srcdir="$ac_given_srcdir" ;;
336
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
338
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
339
rm -f "$ac_dir/POTFILES"
340
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
341
sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
342
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
343
sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1533
if test "$gt_use_preinstalled_gnugettext" = "yes" \
1534
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
1535
AC_DEFINE(ENABLE_NLS, 1,
1536
[Define to 1 if translation of program messages to the user's native language
1543
if test "$USE_NLS" = "yes"; then
1545
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1546
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1547
AC_MSG_CHECKING([how to link with libintl])
1548
AC_MSG_RESULT([$LIBINTL])
1549
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1552
dnl For backward compatibility. Some packages may be using this.
1553
AC_DEFINE(HAVE_GETTEXT, 1,
1554
[Define if the GNU gettext() function is already present or preinstalled.])
1555
AC_DEFINE(HAVE_DCGETTEXT, 1,
1556
[Define if the GNU dcgettext() function is already present or preinstalled.])
1559
dnl We need to process the po/ directory.
1563
ifelse(gt_included_intl, yes, [
350
1564
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
351
1565
dnl to 'yes' because some of the testsuite requires it.
352
1566
if test "$PACKAGE" = gettext; then
353
1567
BUILD_INCLUDED_LIBINTL=yes
356
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
357
dnl because plural.y uses bison specific features. It requires at least
358
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
360
dnl bison is only needed for the maintainer (who touches plural.y). But in
361
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
362
dnl the rule in general Makefile. Now, some people carelessly touch the
363
dnl files or have a broken "make" program, hence the plural.c rule will
364
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
365
dnl present or too old.
366
AC_CHECK_PROGS([INTLBISON], [bison])
367
if test -z "$INTLBISON"; then
370
dnl Found it, now check the version.
371
AC_MSG_CHECKING([version of bison])
372
changequote(<<,>>)dnl
373
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
374
case $ac_prog_version in
375
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
376
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
378
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
379
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
381
AC_MSG_RESULT([$ac_prog_version])
383
if test $ac_verc_fail = yes; then
387
dnl These rules are solely for the distribution goal. While doing this
388
dnl we only have to keep exactly one list of the available catalogs
390
for lang in $ALL_LINGUAS; do
391
GMOFILES="$GMOFILES $lang.gmo"
392
POFILES="$POFILES $lang.po"
395
1570
dnl Make all variables we use known to autoconf.
396
1571
AC_SUBST(BUILD_INCLUDED_LIBINTL)
397
1572
AC_SUBST(USE_INCLUDED_LIBINTL)
399
1573
AC_SUBST(CATOBJEXT)
402
1574
AC_SUBST(INTLOBJS)
406
1576
dnl For backward compatibility. Some configure.ins may be using this.
407
1577
nls_cv_header_intl=
418
1588
dnl For backward compatibility. Some Makefiles may be using this.
420
1590
AC_SUBST(GENCAT)
1592
dnl Enable libtool support if the surrounding package wishes it.
1593
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1594
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
423
dnl Usage: Just like AM_WITH_NLS, which see.
424
AC_DEFUN([AM_GNU_GETTEXT],
425
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
426
AC_REQUIRE([AC_PROG_CC])dnl
427
AC_REQUIRE([AC_CANONICAL_HOST])dnl
428
AC_REQUIRE([AC_PROG_RANLIB])dnl
429
AC_REQUIRE([AC_ISC_POSIX])dnl
430
AC_REQUIRE([AC_HEADER_STDC])dnl
431
AC_REQUIRE([AC_C_CONST])dnl
432
AC_REQUIRE([AC_C_INLINE])dnl
433
AC_REQUIRE([AC_TYPE_OFF_T])dnl
434
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
435
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
436
AC_REQUIRE([AC_FUNC_MMAP])dnl
437
AC_REQUIRE([jm_GLIBC21])dnl
439
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1597
dnl For backward compatibility. Some Makefiles may be using this.
1601
dnl Make all documented variables known to autoconf.
1608
dnl Checks for all prerequisites of the po subdirectory,
1609
dnl except for USE_NLS.
1610
AC_DEFUN([AM_PO_SUBDIRS],
1612
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1613
AC_REQUIRE([AC_PROG_INSTALL])dnl
1614
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1616
dnl Perform the following tests also if --disable-nls has been given,
1617
dnl because they are needed for "make dist" to work.
1619
dnl Search for GNU msgfmt in the PATH.
1620
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1621
dnl The second test excludes FreeBSD msgfmt.
1622
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1623
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1624
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1626
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1628
dnl Search for GNU xgettext 0.11 or newer in the PATH.
1629
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1630
dnl The second test excludes FreeBSD xgettext.
1631
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1632
[$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1633
(if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1635
dnl Remove leftover from FreeBSD xgettext call.
1638
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1639
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1640
[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1642
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1643
dnl Test whether we really found GNU msgfmt.
1644
if test "$GMSGFMT" != ":"; then
1645
dnl If it is no GNU msgfmt we define it as : so that the
1646
dnl Makefiles still can work.
1647
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1648
(if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1651
GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1653
[found $GMSGFMT program is not GNU msgfmt; ignore it])
1658
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1659
dnl Test whether we really found GNU xgettext.
1660
if test "$XGETTEXT" != ":"; then
1661
dnl If it is no GNU xgettext we define it as : so that the
1662
dnl Makefiles still can work.
1663
if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1664
(if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1668
[found xgettext program is not GNU xgettext; ignore it])
1671
dnl Remove leftover from FreeBSD xgettext call.
1675
AC_OUTPUT_COMMANDS([
1676
for ac_file in $CONFIG_FILES; do
1677
# Support "outfile[:infile[:infile...]]"
1679
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1681
# PO directories have a Makefile.in generated from Makefile.in.in.
1682
case "$ac_file" in */Makefile.in)
1683
# Adjust a relative srcdir.
1684
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1685
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1686
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1687
# In autoconf-2.13 it is called $ac_given_srcdir.
1688
# In autoconf-2.50 it is called $srcdir.
1689
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1690
case "$ac_given_srcdir" in
1691
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1692
/*) top_srcdir="$ac_given_srcdir" ;;
1693
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1695
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1696
rm -f "$ac_dir/POTFILES"
1697
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1698
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1699
# ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1700
# on $ac_dir but don't depend on user-specified configuration
1702
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1703
# The LINGUAS file contains the set of available languages.
1704
if test -n "$ALL_LINGUAS"; then
1705
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1707
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1708
# Hide the ALL_LINGUAS assigment from automake.
1709
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1711
case "$ac_given_srcdir" in
1713
*) srcdirpre='$(srcdir)/' ;;
1719
for lang in $ALL_LINGUAS; do
1720
POFILES="$POFILES $srcdirpre$lang.po"
1721
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1722
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1723
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1725
# CATALOGS depends on both $ac_dir and the user's LINGUAS
1726
# environment variable.
1728
if test -n "$ALL_LINGUAS"; then
1729
for presentlang in $ALL_LINGUAS; do
1731
if test "%UNSET%" != "$LINGUAS"; then
1732
desiredlanguages="$LINGUAS"
1734
desiredlanguages="$ALL_LINGUAS"
1736
for desiredlang in $desiredlanguages; do
1737
# Use the presentlang catalog if desiredlang is
1738
# a. equal to presentlang, or
1739
# b. a variant of presentlang (because in this case,
1740
# presentlang can be used as a fallback for messages
1741
# which are not translated in the desiredlang catalog).
1742
case "$desiredlang" in
1743
"$presentlang"*) useit=yes;;
1746
if test $useit = yes; then
1747
INST_LINGUAS="$INST_LINGUAS $presentlang"
1752
if test -n "$INST_LINGUAS"; then
1753
for lang in $INST_LINGUAS; do
1754
CATALOGS="$CATALOGS $lang.gmo"
1757
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1758
sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1759
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1760
if test -f "$f"; then
1762
*.orig | *.bak | *~) ;;
1763
*) cat "$f" >> "$ac_dir/Makefile" ;;
1771
[# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
1772
# POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1774
eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1775
# Capture the value of LINGUAS because we need it to compute CATALOGS.
1776
LINGUAS="${LINGUAS-%UNSET%}"
1781
dnl Checks for all prerequisites of the intl subdirectory,
1782
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1783
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1784
AC_DEFUN([AM_INTL_SUBDIR],
1786
AC_REQUIRE([AC_PROG_INSTALL])dnl
1787
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1788
AC_REQUIRE([AC_PROG_CC])dnl
1789
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1790
AC_REQUIRE([AC_PROG_RANLIB])dnl
1791
AC_REQUIRE([AC_ISC_POSIX])dnl
1792
AC_REQUIRE([AC_HEADER_STDC])dnl
1793
AC_REQUIRE([AC_C_CONST])dnl
1794
AC_REQUIRE([AC_C_INLINE])dnl
1795
AC_REQUIRE([AC_TYPE_OFF_T])dnl
1796
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1797
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1798
AC_REQUIRE([AC_FUNC_MMAP])dnl
1799
AC_REQUIRE([jm_GLIBC21])dnl
1801
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
440
1802
stdlib.h string.h unistd.h sys/param.h])
441
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
442
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
443
strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
448
AM_WITH_NLS([$1],[$2],[$3])
450
if test "x$CATOBJEXT" != "x"; then
451
if test "x$ALL_LINGUAS" = "x"; then
454
AC_MSG_CHECKING(for catalogs to be installed)
456
for presentlang in $ALL_LINGUAS; do
458
for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
459
# Use the presentlang catalog if desiredlang is
460
# a. equal to presentlang, or
461
# b. a variant of presentlang (because in this case,
462
# presentlang can be used as a fallback for messages
463
# which are not translated in the desiredlang catalog).
464
case "$desiredlang" in
465
"$presentlang"*) useit=yes;;
468
if test $useit = yes; then
469
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
473
AC_MSG_RESULT($LINGUAS)
476
dnl Construct list of names of catalog files to be constructed.
477
if test -n "$LINGUAS"; then
478
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
482
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
483
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
484
dnl Try to locate is.
486
if test -n "$ac_aux_dir"; then
487
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
489
if test -z "$MKINSTALLDIRS"; then
490
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
492
AC_SUBST(MKINSTALLDIRS)
494
dnl Enable libtool support if the surrounding package wishes it.
495
INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
496
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1803
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1804
geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1805
strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1811
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1812
dnl because plural.y uses bison specific features. It requires at least
1813
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1815
dnl bison is only needed for the maintainer (who touches plural.y). But in
1816
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1817
dnl the rule in general Makefile. Now, some people carelessly touch the
1818
dnl files or have a broken "make" program, hence the plural.c rule will
1819
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1820
dnl present or too old.
1821
AC_CHECK_PROGS([INTLBISON], [bison])
1822
if test -z "$INTLBISON"; then
1825
dnl Found it, now check the version.
1826
AC_MSG_CHECKING([version of bison])
1827
changequote(<<,>>)dnl
1828
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1829
case $ac_prog_version in
1830
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1831
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1833
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1834
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1836
AC_MSG_RESULT([$ac_prog_version])
1838
if test $ac_verc_fail = yes; then
1844
AC_DEFUN([AM_MKINSTALLDIRS],
1846
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1847
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1848
dnl Try to locate is.
1850
if test -n "$ac_aux_dir"; then
1851
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1853
if test -z "$MKINSTALLDIRS"; then
1854
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1856
AC_SUBST(MKINSTALLDIRS)
1859
# lib-prefix.m4 serial 1 (gettext-0.11)
1860
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1861
dnl This file is free software, distributed under the terms of the GNU
1862
dnl General Public License. As a special exception to the GNU General
1863
dnl Public License, this file may be distributed as part of a program
1864
dnl that contains a configuration script generated by Autoconf, under
1865
dnl the same distribution terms as the rest of that program.
1867
dnl From Bruno Haible.
1869
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1870
dnl to access previously installed libraries. The basic assumption is that
1871
dnl a user will want packages to use other packages he previously installed
1872
dnl with the same --prefix option.
1873
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1874
dnl libraries, but is otherwise very convenient.
1875
AC_DEFUN([AC_LIB_PREFIX],
1877
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1878
AC_REQUIRE([AC_PROG_CC])
1879
AC_REQUIRE([AC_CANONICAL_HOST])
1880
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1881
dnl By default, look in $includedir and $libdir.
1883
AC_LIB_WITH_FINAL_PREFIX([
1884
eval additional_includedir=\"$includedir\"
1885
eval additional_libdir=\"$libdir\"
1887
AC_ARG_WITH([lib-prefix],
1888
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1889
--without-lib-prefix don't search for libraries in includedir and libdir],
1891
if test "X$withval" = "Xno"; then
1894
if test "X$withval" = "X"; then
1895
AC_LIB_WITH_FINAL_PREFIX([
1896
eval additional_includedir=\"$includedir\"
1897
eval additional_libdir=\"$libdir\"
1900
additional_includedir="$withval/include"
1901
additional_libdir="$withval/lib"
1905
if test $use_additional = yes; then
1906
dnl Potentially add $additional_includedir to $CPPFLAGS.
1907
dnl But don't add it
1908
dnl 1. if it's the standard /usr/include,
1909
dnl 2. if it's already present in $CPPFLAGS,
1910
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1911
dnl 4. if it doesn't exist as a directory.
1912
if test "X$additional_includedir" != "X/usr/include"; then
1914
for x in $CPPFLAGS; do
1915
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1916
if test "X$x" = "X-I$additional_includedir"; then
1921
if test -z "$haveit"; then
1922
if test "X$additional_includedir" = "X/usr/local/include"; then
1923
if test -n "$GCC"; then
1925
linux*) haveit=yes;;
1929
if test -z "$haveit"; then
1930
if test -d "$additional_includedir"; then
1931
dnl Really add $additional_includedir to $CPPFLAGS.
1932
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1937
dnl Potentially add $additional_libdir to $LDFLAGS.
1938
dnl But don't add it
1939
dnl 1. if it's the standard /usr/lib,
1940
dnl 2. if it's already present in $LDFLAGS,
1941
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1942
dnl 4. if it doesn't exist as a directory.
1943
if test "X$additional_libdir" != "X/usr/lib"; then
1945
for x in $LDFLAGS; do
1946
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1947
if test "X$x" = "X-L$additional_libdir"; then
1952
if test -z "$haveit"; then
1953
if test "X$additional_libdir" = "X/usr/local/lib"; then
1954
if test -n "$GCC"; then
1956
linux*) haveit=yes;;
1960
if test -z "$haveit"; then
1961
if test -d "$additional_libdir"; then
1962
dnl Really add $additional_libdir to $LDFLAGS.
1963
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1971
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1972
dnl acl_final_exec_prefix, containing the values to which $prefix and
1973
dnl $exec_prefix will expand at the end of the configure script.
1974
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1976
dnl Unfortunately, prefix and exec_prefix get only finally determined
1977
dnl at the end of configure.
1978
if test "X$prefix" = "XNONE"; then
1979
acl_final_prefix="$ac_default_prefix"
1981
acl_final_prefix="$prefix"
1983
if test "X$exec_prefix" = "XNONE"; then
1984
acl_final_exec_prefix='${prefix}'
1986
acl_final_exec_prefix="$exec_prefix"
1988
acl_save_prefix="$prefix"
1989
prefix="$acl_final_prefix"
1990
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1991
prefix="$acl_save_prefix"
1994
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1995
dnl variables prefix and exec_prefix bound to the values they will have
1996
dnl at the end of the configure script.
1997
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1999
acl_save_prefix="$prefix"
2000
prefix="$acl_final_prefix"
2001
acl_save_exec_prefix="$exec_prefix"
2002
exec_prefix="$acl_final_exec_prefix"
2004
exec_prefix="$acl_save_exec_prefix"
2005
prefix="$acl_save_prefix"
2008
# lib-link.m4 serial 2 (gettext-0.11.2)
2009
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2010
dnl This file is free software, distributed under the terms of the GNU
2011
dnl General Public License. As a special exception to the GNU General
2012
dnl Public License, this file may be distributed as part of a program
2013
dnl that contains a configuration script generated by Autoconf, under
2014
dnl the same distribution terms as the rest of that program.
2016
dnl From Bruno Haible.
2018
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
2019
dnl the libraries corresponding to explicit and implicit dependencies.
2020
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
2021
dnl augments the CPPFLAGS variable.
2022
AC_DEFUN([AC_LIB_LINKFLAGS],
2024
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2025
AC_REQUIRE([AC_LIB_RPATH])
2026
define([Name],[translit([$1],[./-], [___])])
2027
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2028
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2029
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
2030
AC_LIB_LINKFLAGS_BODY([$1], [$2])
2031
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
2032
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
2033
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
2035
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
2036
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
2037
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
2038
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2040
AC_SUBST([LTLIB]NAME)
2041
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
2042
dnl results of this search when this library appears as a dependency.
2048
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
2049
dnl searches for libname and the libraries corresponding to explicit and
2050
dnl implicit dependencies, together with the specified include files and
2051
dnl the ability to compile and link the specified testcode. If found, it
2052
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
2053
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2054
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2055
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2056
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2058
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2059
AC_REQUIRE([AC_LIB_RPATH])
2060
define([Name],[translit([$1],[./-], [___])])
2061
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2062
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2064
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2066
AC_LIB_LINKFLAGS_BODY([$1], [$2])
2068
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2069
dnl because if the user has installed lib[]Name and not disabled its use
2070
dnl via --without-lib[]Name-prefix, he wants to use it.
2071
ac_save_CPPFLAGS="$CPPFLAGS"
2072
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2074
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2075
ac_save_LIBS="$LIBS"
2076
LIBS="$LIBS $LIB[]NAME"
2077
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
2078
LIBS="$ac_save_LIBS"
2080
if test "$ac_cv_lib[]Name" = yes; then
2082
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
2083
AC_MSG_CHECKING([how to link with lib[]$1])
2084
AC_MSG_RESULT([$LIB[]NAME])
2087
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2088
dnl $INC[]NAME either.
2089
CPPFLAGS="$ac_save_CPPFLAGS"
2093
AC_SUBST([HAVE_LIB]NAME)
2095
AC_SUBST([LTLIB]NAME)
2100
dnl Determine the platform dependent parameters needed to use rpath:
2101
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
2102
dnl hardcode_direct, hardcode_minus_L,
2103
dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
2104
AC_DEFUN([AC_LIB_RPATH],
2106
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
2107
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
2108
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
2109
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
2110
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
2111
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
2112
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
2118
libext="$acl_cv_libext"
2119
shlibext="$acl_cv_shlibext"
2120
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
2121
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
2122
hardcode_direct="$acl_cv_hardcode_direct"
2123
hardcode_minus_L="$acl_cv_hardcode_minus_L"
2124
sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
2125
sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
2128
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2129
dnl the libraries corresponding to explicit and implicit dependencies.
2130
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2131
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2133
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2134
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2135
dnl By default, look in $includedir and $libdir.
2137
AC_LIB_WITH_FINAL_PREFIX([
2138
eval additional_includedir=\"$includedir\"
2139
eval additional_libdir=\"$libdir\"
2141
AC_ARG_WITH([lib$1-prefix],
2142
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
2143
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
2145
if test "X$withval" = "Xno"; then
2148
if test "X$withval" = "X"; then
2149
AC_LIB_WITH_FINAL_PREFIX([
2150
eval additional_includedir=\"$includedir\"
2151
eval additional_libdir=\"$libdir\"
2154
additional_includedir="$withval/include"
2155
additional_libdir="$withval/lib"
2159
dnl Search the library and its dependencies in $additional_libdir and
2160
dnl $LDFLAGS. Using breadth-first-seach.
2166
names_already_handled=
2167
names_next_round='$1 $2'
2168
while test -n "$names_next_round"; do
2169
names_this_round="$names_next_round"
2171
for name in $names_this_round; do
2173
for n in $names_already_handled; do
2174
if test "$n" = "$name"; then
2179
if test -z "$already_handled"; then
2180
names_already_handled="$names_already_handled $name"
2181
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2182
dnl or AC_LIB_HAVE_LINKFLAGS call.
2183
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2184
eval value=\"\$HAVE_LIB$uppername\"
2185
if test -n "$value"; then
2186
if test "$value" = yes; then
2187
eval value=\"\$LIB$uppername\"
2188
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2189
eval value=\"\$LTLIB$uppername\"
2190
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2192
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2193
dnl that this library doesn't exist. So just drop it.
2197
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2198
dnl and the already constructed $LIBNAME/$LTLIBNAME.
2203
if test $use_additional = yes; then
2204
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
2205
found_dir="$additional_libdir"
2206
found_so="$additional_libdir/lib$name.$shlibext"
2207
if test -f "$additional_libdir/lib$name.la"; then
2208
found_la="$additional_libdir/lib$name.la"
2211
if test -f "$additional_libdir/lib$name.$libext"; then
2212
found_dir="$additional_libdir"
2213
found_a="$additional_libdir/lib$name.$libext"
2214
if test -f "$additional_libdir/lib$name.la"; then
2215
found_la="$additional_libdir/lib$name.la"
2220
if test "X$found_dir" = "X"; then
2221
for x in $LDFLAGS $LTLIB[]NAME; do
2222
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2225
dir=`echo "X$x" | sed -e 's/^X-L//'`
2226
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
2228
found_so="$dir/lib$name.$shlibext"
2229
if test -f "$dir/lib$name.la"; then
2230
found_la="$dir/lib$name.la"
2233
if test -f "$dir/lib$name.$libext"; then
2235
found_a="$dir/lib$name.$libext"
2236
if test -f "$dir/lib$name.la"; then
2237
found_la="$dir/lib$name.la"
2243
if test "X$found_dir" != "X"; then
2248
if test "X$found_dir" != "X"; then
2249
dnl Found the library.
2250
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2251
if test "X$found_so" != "X"; then
2252
dnl Linking with a shared library. We attempt to hardcode its
2253
dnl directory into the executable's runpath, unless it's the
2254
dnl standard /usr/lib.
2255
if test "X$found_dir" = "X/usr/lib"; then
2256
dnl No hardcoding is needed.
2257
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2259
dnl Use an explicit option to hardcode DIR into the resulting
2261
dnl Potentially add DIR to ltrpathdirs.
2262
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2264
for x in $ltrpathdirs; do
2265
if test "X$x" = "X$found_dir"; then
2270
if test -z "$haveit"; then
2271
ltrpathdirs="$ltrpathdirs $found_dir"
2273
dnl The hardcoding into $LIBNAME is system dependent.
2274
if test "$hardcode_direct" = yes; then
2275
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2276
dnl resulting binary.
2277
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2279
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2280
dnl Use an explicit option to hardcode DIR into the resulting
2282
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2283
dnl Potentially add DIR to rpathdirs.
2284
dnl The rpathdirs will be appended to $LIBNAME at the end.
2286
for x in $rpathdirs; do
2287
if test "X$x" = "X$found_dir"; then
2292
if test -z "$haveit"; then
2293
rpathdirs="$rpathdirs $found_dir"
2296
dnl Rely on "-L$found_dir".
2297
dnl But don't add it if it's already contained in the LDFLAGS
2298
dnl or the already constructed $LIBNAME
2300
for x in $LDFLAGS $LIB[]NAME; do
2301
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2302
if test "X$x" = "X-L$found_dir"; then
2307
if test -z "$haveit"; then
2308
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2310
if test "$hardcode_minus_L" != no; then
2311
dnl FIXME: Not sure whether we should use
2312
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2314
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2316
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2317
dnl here, because this doesn't fit in flags passed to the
2318
dnl compiler. So give up. No hardcoding. This affects only
2319
dnl very old systems.
2320
dnl FIXME: Not sure whether we should use
2321
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2323
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2329
if test "X$found_a" != "X"; then
2330
dnl Linking with a static library.
2331
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2333
dnl We shouldn't come here, but anyway it's good to have a
2335
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2338
dnl Assume the include files are nearby.
2339
additional_includedir=
2340
case "$found_dir" in
2342
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2343
additional_includedir="$basedir/include"
2346
if test "X$additional_includedir" != "X"; then
2347
dnl Potentially add $additional_includedir to $INCNAME.
2348
dnl But don't add it
2349
dnl 1. if it's the standard /usr/include,
2350
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2351
dnl 3. if it's already present in $CPPFLAGS or the already
2352
dnl constructed $INCNAME,
2353
dnl 4. if it doesn't exist as a directory.
2354
if test "X$additional_includedir" != "X/usr/include"; then
2356
if test "X$additional_includedir" = "X/usr/local/include"; then
2357
if test -n "$GCC"; then
2359
linux*) haveit=yes;;
2363
if test -z "$haveit"; then
2364
for x in $CPPFLAGS $INC[]NAME; do
2365
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2366
if test "X$x" = "X-I$additional_includedir"; then
2371
if test -z "$haveit"; then
2372
if test -d "$additional_includedir"; then
2373
dnl Really add $additional_includedir to $INCNAME.
2374
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2380
dnl Look for dependencies.
2381
if test -n "$found_la"; then
2382
dnl Read the .la file. It defines the variables
2383
dnl dlname, library_names, old_library, dependency_libs, current,
2384
dnl age, revision, installed, dlopen, dlpreopen, libdir.
2385
save_libdir="$libdir"
2387
*/* | *\\*) . "$found_la" ;;
2388
*) . "./$found_la" ;;
2390
libdir="$save_libdir"
2391
dnl We use only dependency_libs.
2392
for dep in $dependency_libs; do
2395
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2396
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2397
dnl But don't add it
2398
dnl 1. if it's the standard /usr/lib,
2399
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2400
dnl 3. if it's already present in $LDFLAGS or the already
2401
dnl constructed $LIBNAME,
2402
dnl 4. if it doesn't exist as a directory.
2403
if test "X$additional_libdir" != "X/usr/lib"; then
2405
if test "X$additional_libdir" = "X/usr/local/lib"; then
2406
if test -n "$GCC"; then
2408
linux*) haveit=yes;;
2412
if test -z "$haveit"; then
2414
for x in $LDFLAGS $LIB[]NAME; do
2415
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2416
if test "X$x" = "X-L$additional_libdir"; then
2421
if test -z "$haveit"; then
2422
if test -d "$additional_libdir"; then
2423
dnl Really add $additional_libdir to $LIBNAME.
2424
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2428
for x in $LDFLAGS $LTLIB[]NAME; do
2429
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2430
if test "X$x" = "X-L$additional_libdir"; then
2435
if test -z "$haveit"; then
2436
if test -d "$additional_libdir"; then
2437
dnl Really add $additional_libdir to $LTLIBNAME.
2438
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2445
dir=`echo "X$dep" | sed -e 's/^X-R//'`
2446
dnl Potentially add DIR to rpathdirs.
2447
dnl The rpathdirs will be appended to $LIBNAME at the end.
2449
for x in $rpathdirs; do
2450
if test "X$x" = "X$dir"; then
2455
if test -z "$haveit"; then
2456
rpathdirs="$rpathdirs $dir"
2458
dnl Potentially add DIR to ltrpathdirs.
2459
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2461
for x in $ltrpathdirs; do
2462
if test "X$x" = "X$dir"; then
2467
if test -z "$haveit"; then
2468
ltrpathdirs="$ltrpathdirs $dir"
2472
dnl Handle this in the next round.
2473
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2476
dnl Handle this in the next round. Throw away the .la's
2477
dnl directory; it is already contained in a preceding -L
2479
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2482
dnl Most likely an immediate library name.
2483
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2484
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2490
dnl Didn't find the library; assume it is in the system directories
2491
dnl known to the linker and runtime loader. (All the system
2492
dnl directories known to the linker should also be known to the
2493
dnl runtime loader, otherwise the system is severely misconfigured.)
2494
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2495
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2501
if test "X$rpathdirs" != "X"; then
2502
if test -n "$hardcode_libdir_separator"; then
2503
dnl Weird platform: only the last -rpath option counts, the user must
2504
dnl pass all path elements in one option. We can arrange that for a
2505
dnl single library, but not when more than one $LIBNAMEs are used.
2507
for found_dir in $rpathdirs; do
2508
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2510
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2511
acl_save_libdir="$libdir"
2513
eval flag=\"$hardcode_libdir_flag_spec\"
2514
libdir="$acl_save_libdir"
2515
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2517
dnl The -rpath options are cumulative.
2518
for found_dir in $rpathdirs; do
2519
acl_save_libdir="$libdir"
2521
eval flag=\"$hardcode_libdir_flag_spec\"
2522
libdir="$acl_save_libdir"
2523
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2527
if test "X$ltrpathdirs" != "X"; then
2528
dnl When using libtool, the option that works for both libraries and
2529
dnl executables is -R. The -R options are cumulative.
2530
for found_dir in $ltrpathdirs; do
2531
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2536
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2537
dnl unless already present in VAR.
2538
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2539
dnl contains two or three consecutive elements that belong together.
2540
AC_DEFUN([AC_LIB_APPENDTOVAR],
2542
for element in [$2]; do
2545
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2546
if test "X$x" = "X$element"; then
2551
if test -z "$haveit"; then
2552
[$1]="${[$1]}${[$1]:+ }$element"
2557
# lib-ld.m4 serial 1 (gettext-0.11)
2558
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2559
dnl This file is free software, distributed under the terms of the GNU
2560
dnl General Public License. As a special exception to the GNU General
2561
dnl Public License, this file may be distributed as part of a program
2562
dnl that contains a configuration script generated by Autoconf, under
2563
dnl the same distribution terms as the rest of that program.
2565
dnl Subroutines of libtool.m4,
2566
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2567
dnl with libtool.m4.
2569
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2570
AC_DEFUN([AC_LIB_PROG_LD_GNU],
2571
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2572
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2573
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2574
acl_cv_prog_gnu_ld=yes
2576
acl_cv_prog_gnu_ld=no
2578
with_gnu_ld=$acl_cv_prog_gnu_ld
2581
dnl From libtool-1.4. Sets the variable LD.
2582
AC_DEFUN([AC_LIB_PROG_LD],
2583
[AC_ARG_WITH(gnu-ld,
2584
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2585
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2586
AC_REQUIRE([AC_PROG_CC])dnl
2587
AC_REQUIRE([AC_CANONICAL_HOST])dnl
2589
if test "$GCC" = yes; then
2590
# Check if gcc -print-prog-name=ld gives a path.
2591
AC_MSG_CHECKING([for ld used by GCC])
2594
# gcc leaves a trailing carriage return which upsets mingw
2595
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2597
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2600
# Accept absolute paths.
2601
[[\\/]* | [A-Za-z]:[\\/]*)]
2602
[re_direlt='/[^/][^/]*/\.\./']
2603
# Canonicalize the path of ld
2604
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2605
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2606
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2608
test -z "$LD" && LD="$ac_prog"
2611
# If it fails, then pretend we aren't using GCC.
2615
# If it is relative, then search for the first ld in PATH.
2619
elif test "$with_gnu_ld" = yes; then
2620
AC_MSG_CHECKING([for GNU ld])
2622
AC_MSG_CHECKING([for non-GNU ld])
2624
AC_CACHE_VAL(acl_cv_path_LD,
2625
[if test -z "$LD"; then
2626
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2627
for ac_dir in $PATH; do
2628
test -z "$ac_dir" && ac_dir=.
2629
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2630
acl_cv_path_LD="$ac_dir/$ac_prog"
2631
# Check to see if the program is GNU ld. I'd rather use --version,
2632
# but apparently some GNU ld's only accept -v.
2633
# Break only if it was the GNU/non-GNU ld that we prefer.
2634
if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2635
test "$with_gnu_ld" != no && break
2637
test "$with_gnu_ld" != yes && break
2643
acl_cv_path_LD="$LD" # Let the user override the test with a path.
2645
LD="$acl_cv_path_LD"
2646
if test -n "$LD"; then
2651
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2655
# iconv.m4 serial AM3 (gettext-0.11)
2656
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2657
dnl This file is free software, distributed under the terms of the GNU
2658
dnl General Public License. As a special exception to the GNU General
2659
dnl Public License, this file may be distributed as part of a program
2660
dnl that contains a configuration script generated by Autoconf, under
2661
dnl the same distribution terms as the rest of that program.
2663
dnl From Bruno Haible.
2665
AC_DEFUN([AM_ICONV_LINK],
2667
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2668
dnl those with the standalone portable GNU libiconv installed).
2670
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2671
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2672
AC_REQUIRE([AC_LIB_RPATH])
2674
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2676
AC_LIB_LINKFLAGS_BODY([iconv])
2678
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2679
dnl because if the user has installed libiconv and not disabled its use
2680
dnl via --without-libiconv-prefix, he wants to use it. The first
2681
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2682
am_save_CPPFLAGS="$CPPFLAGS"
2683
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2685
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2686
am_cv_func_iconv="no, consider installing GNU libiconv"
2688
AC_TRY_LINK([#include <stdlib.h>
2689
#include <iconv.h>],
2690
[iconv_t cd = iconv_open("","");
2691
iconv(cd,NULL,NULL,NULL,NULL);
2693
am_cv_func_iconv=yes)
2694
if test "$am_cv_func_iconv" != yes; then
2695
am_save_LIBS="$LIBS"
2696
LIBS="$LIBS $LIBICONV"
2697
AC_TRY_LINK([#include <stdlib.h>
2698
#include <iconv.h>],
2699
[iconv_t cd = iconv_open("","");
2700
iconv(cd,NULL,NULL,NULL,NULL);
2703
am_cv_func_iconv=yes)
2704
LIBS="$am_save_LIBS"
2707
if test "$am_cv_func_iconv" = yes; then
2708
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2710
if test "$am_cv_lib_iconv" = yes; then
2711
AC_MSG_CHECKING([how to link with libiconv])
2712
AC_MSG_RESULT([$LIBICONV])
2714
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2716
CPPFLAGS="$am_save_CPPFLAGS"
2721
AC_SUBST(LTLIBICONV)
2724
AC_DEFUN([AM_ICONV],
2726
AC_REQUIRE([AM_ICONV_LINK])
2727
if test "$am_cv_func_iconv" = yes; then
2728
AC_MSG_CHECKING([for iconv declaration])
2729
AC_CACHE_VAL(am_cv_proto_iconv, [
2737
#if defined(__STDC__) || defined(__cplusplus)
2738
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2742
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2743
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
2744
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2745
AC_MSG_RESULT([$]{ac_t:-
2746
}[$]am_cv_proto_iconv)
2747
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2748
[Define as const if the declaration of iconv() needs const.])
2752
# progtest.m4 serial 2 (gettext-0.10.40)
2753
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2754
dnl This file is free software, distributed under the terms of the GNU
2755
dnl General Public License. As a special exception to the GNU General
2756
dnl Public License, this file may be distributed as part of a program
2757
dnl that contains a configuration script generated by Autoconf, under
2758
dnl the same distribution terms as the rest of that program.
2760
dnl This file can can be used in projects which are not available under
2761
dnl the GNU General Public License or the GNU Library General Public
2762
dnl License but which still want to provide support for the GNU gettext
2764
dnl Please note that the actual code of the GNU gettext library is covered
2765
dnl by the GNU Library General Public License, and the rest of the GNU
2766
dnl gettext package package is covered by the GNU General Public License.
2767
dnl They are *not* in the public domain.
2770
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
499
2772
# Search path for a program which passes the given test.
500
# Ulrich Drepper <drepper@cygnus.com>, 1996.
502
# This file can be copied and used freely without restrictions. It can
503
# be used in projects which are not available under the GNU General Public
504
# License or the GNU Library General Public License but which still want
505
# to provide support for the GNU gettext functionality.
506
# Please note that the actual code of the GNU gettext library is covered
507
# by the GNU Library General Public License, and the rest of the GNU
508
# gettext package package is covered by the GNU General Public License.
509
# They are *not* in the public domain.
513
2774
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
514
2775
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])