913
698
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
916
# Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
918
# This program is free software; you can redistribute it and/or modify
919
# it under the terms of the GNU General Public License as published by
920
# the Free Software Foundation; either version 2, or (at your option)
923
# This program is distributed in the hope that it will be useful,
924
# but WITHOUT ANY WARRANTY; without even the implied warranty of
925
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
926
# GNU General Public License for more details.
928
# You should have received a copy of the GNU General Public License
929
# along with this program; if not, write to the Free Software
930
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
700
# Check to make sure that the build environment is sane. -*- Autoconf -*-
702
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
703
# Free Software Foundation, Inc.
705
# This file is free software; the Free Software Foundation
706
# gives unlimited permission to copy and/or distribute it,
707
# with or without modifications, as long as this notice is preserved.
713
AC_DEFUN([AM_SANITY_CHECK],
714
[AC_MSG_CHECKING([whether build environment is sane])
717
echo timestamp > conftest.file
718
# Do `set' in a subshell so we don't clobber the current shell's
719
# arguments. Must try -L first in case configure is actually a
720
# symlink; some systems play weird games with the mod time of symlinks
721
# (eg FreeBSD returns the mod time of the symlink's containing
724
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
725
if test "$[*]" = "X"; then
727
set X `ls -t $srcdir/configure conftest.file`
730
if test "$[*]" != "X $srcdir/configure conftest.file" \
731
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
733
# If neither matched, then we have a broken ls. This can happen
734
# if, for instance, CONFIG_SHELL is bash and it inherits a
735
# broken ls alias from the environment. This has actually
736
# happened. Such a system could not be considered "sane".
737
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
738
alias in your environment])
741
test "$[2]" = conftest.file
747
AC_MSG_ERROR([newly created file is older than distributed files!
748
Check your system clock])
752
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
754
# This file is free software; the Free Software Foundation
755
# gives unlimited permission to copy and/or distribute it,
756
# with or without modifications, as long as this notice is preserved.
758
# AM_PROG_INSTALL_STRIP
759
# ---------------------
760
# One issue with vendor `install' (even GNU) is that you can't
761
# specify the program used to strip binaries. This is especially
762
# annoying in cross-compiling environments, where the build's strip
763
# is unlikely to handle the host's binaries.
764
# Fortunately install-sh will honor a STRIPPROG variable, so we
765
# always use install-sh in `make install-strip', and initialize
766
# STRIPPROG with the value of the STRIP variable (set by the user).
767
AC_DEFUN([AM_PROG_INSTALL_STRIP],
768
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
769
# Installed binaries are usually stripped using `strip' when the user
770
# run `make install-strip'. However `strip' might not be the right
771
# tool to use in cross-compilation environments, therefore Automake
772
# will honor the `STRIP' environment variable to overrule this program.
773
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
774
if test "$cross_compiling" != no; then
775
AC_CHECK_TOOL([STRIP], [strip], :)
777
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
778
AC_SUBST([INSTALL_STRIP_PROGRAM])])
780
# Check how to create a tarball. -*- Autoconf -*-
782
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
784
# This file is free software; the Free Software Foundation
785
# gives unlimited permission to copy and/or distribute it,
786
# with or without modifications, as long as this notice is preserved.
935
# @defmac AC_PROG_CC_STDC
936
# @maindex PROG_CC_STDC
938
# If the C compiler in not in ANSI C mode by default, try to add an option
939
# to output variable @code{CC} to make it so. This macro tries various
940
# options that select ANSI C on some system or another. It considers the
941
# compiler to be in ANSI C mode if it handles function prototypes correctly.
943
# If you use this macro, you should check after calling it whether the C
944
# compiler has been set to accept ANSI C; if not, the shell variable
945
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
946
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
947
# program @code{ansi2knr}, which comes with Ghostscript.
950
AC_DEFUN([AM_PROG_CC_STDC],
951
[AC_REQUIRE([AC_PROG_CC])
952
AC_BEFORE([$0], [AC_C_INLINE])
953
AC_BEFORE([$0], [AC_C_CONST])
954
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
955
dnl a magic option to avoid problems with ANSI preprocessor commands
957
dnl FIXME: can't do this because then AC_AIX won't work due to a
958
dnl circular dependency.
959
dnl AC_BEFORE([$0], [AC_PROG_CPP])
960
AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
961
AC_CACHE_VAL(am_cv_prog_cc_stdc,
962
[am_cv_prog_cc_stdc=no
964
# Don't try gcc -ansi; that turns off useful extensions and
965
# breaks some systems' header files.
967
# Ultrix and OSF/1 -std1
968
# HP-UX 10.20 and later -Ae
969
# HP-UX older versions -Aa -D_HPUX_SOURCE
970
# SVR4 -Xc -D__EXTENSIONS__
971
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
790
# _AM_PROG_TAR(FORMAT)
791
# --------------------
792
# Check how to create a tarball in format FORMAT.
793
# FORMAT should be one of `v7', `ustar', or `pax'.
795
# Substitute a variable $(am__tar) that is a command
796
# writing to stdout a FORMAT-tarball containing the directory
798
# tardir=directory && $(am__tar) > result.tar
800
# Substitute a variable $(am__untar) that extract such
801
# a tarball read from stdin.
802
# $(am__untar) < result.tar
803
AC_DEFUN([_AM_PROG_TAR],
804
[# Always define AMTAR for backward compatibility.
805
AM_MISSING_PROG([AMTAR], [tar])
807
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
808
[m4_case([$1], [ustar],, [pax],,
809
[m4_fatal([Unknown tar format])])
810
AC_MSG_CHECKING([how to create a $1 tar archive])
811
# Loop over all known methods to create a tar archive until one works.
812
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
813
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
814
# Do not fold the above two line into one, because Tru64 sh and
815
# Solaris sh will not grok spaces in the rhs of `-'.
816
for _am_tool in $_am_tools
973
CC="$ac_save_CC $ac_arg"
977
#include <sys/types.h>
978
#include <sys/stat.h>
979
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
980
struct buf { int x; };
981
FILE * (*rcsopen) (struct buf *, struct stat *, int);
982
static char *e (p, i)
988
static char *f (char * (*g) (char **, int), char **p, ...)
993
s = g (p, va_arg (v,int));
997
int test (int i, double x);
998
struct s1 {int (*f) (int a);};
999
struct s2 {int (*f) (double a);};
1000
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1004
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
1006
[am_cv_prog_cc_stdc="$ac_arg"; break])
820
for _am_tar in tar gnutar gtar;
822
AM_RUN_LOG([$_am_tar --version]) && break
824
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
825
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
826
am__untar="$_am_tar -xf -"
829
# Must skip GNU tar: if it does not support --format= it doesn't create
830
# ustar tarball either.
831
(tar --version) >/dev/null 2>&1 && continue
832
am__tar='tar chf - "$$tardir"'
833
am__tar_='tar chf - "$tardir"'
837
am__tar='pax -L -x $1 -w "$$tardir"'
838
am__tar_='pax -L -x $1 -w "$tardir"'
842
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
843
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
844
am__untar='cpio -i -H $1 -d'
853
# If the value was cached, stop now. We just wanted to have am__tar
855
test -n "${am_cv_prog_tar_$1}" && break
857
# tar/untar a dummy directory, and stop if the command works
860
echo GrepMe > conftest.dir/file
861
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
863
if test -s conftest.tar; then
864
AM_RUN_LOG([$am__untar <conftest.tar])
865
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1010
if test -z "$am_cv_prog_cc_stdc"; then
1011
AC_MSG_RESULT([none needed])
1013
AC_MSG_RESULT([$am_cv_prog_cc_stdc])
1015
case "x$am_cv_prog_cc_stdc" in
1017
*) CC="$CC $am_cv_prog_cc_stdc" ;;
1021
AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
1023
# gettext.m4 serial 17 (gettext-0.11.5)
1024
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1025
dnl This file is free software, distributed under the terms of the GNU
1026
dnl General Public License. As a special exception to the GNU General
1027
dnl Public License, this file may be distributed as part of a program
1028
dnl that contains a configuration script generated by Autoconf, under
1029
dnl the same distribution terms as the rest of that program.
1031
dnl This file can can be used in projects which are not available under
1032
dnl the GNU General Public License or the GNU Library General Public
1033
dnl License but which still want to provide support for the GNU gettext
1035
dnl Please note that the actual code of the GNU gettext library is covered
1036
dnl by the GNU Library General Public License, and the rest of the GNU
1037
dnl gettext package package is covered by the GNU General Public License.
1038
dnl They are *not* in the public domain.
1041
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1042
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
1044
dnl Macro to add for using GNU gettext.
1046
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1047
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1048
dnl default (if it is not specified or empty) is 'no-libtool'.
1049
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1050
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1051
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1052
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1053
dnl depending on --{enable,disable}-{shared,static} and on the presence of
1054
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1055
dnl $(top_builddir)/intl/libintl.a will be created.
1056
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1057
dnl implementations (in libc or libintl) without the ngettext() function
1058
dnl will be ignored. If NEEDSYMBOL is specified and is
1059
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
1060
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1061
dnl INTLDIR is used to find the intl libraries. If empty,
1062
dnl the value `$(top_builddir)/intl/' is used.
1064
dnl The result of the configuration is one of three cases:
1065
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1067
dnl Catalog format: GNU --> install in $(datadir)
1068
dnl Catalog extension: .mo after installation, .gmo in source tree
1069
dnl 2) GNU gettext has been found in the system's C library.
1070
dnl Catalog format: GNU --> install in $(datadir)
1071
dnl Catalog extension: .mo after installation, .gmo in source tree
1072
dnl 3) No internationalization, always use English msgid.
1073
dnl Catalog format: none
1074
dnl Catalog extension: none
1075
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1076
dnl The use of .gmo is historical (it was needed to avoid overwriting the
1077
dnl GNU format catalogs when building on a platform with an X/Open gettext),
1078
dnl but we keep it in order not to force irrelevant filename changes on the
1081
AC_DEFUN([AM_GNU_GETTEXT],
1083
dnl Argument checking.
1084
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1085
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1087
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1088
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1090
define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1091
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1093
AC_REQUIRE([AM_PO_SUBDIRS])dnl
1094
ifelse(gt_included_intl, yes, [
1095
AC_REQUIRE([AM_INTL_SUBDIR])dnl
1098
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1099
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1100
AC_REQUIRE([AC_LIB_RPATH])
1102
dnl Sometimes libintl requires libiconv, so first search for libiconv.
1103
dnl Ideally we would do this search only after the
1104
dnl if test "$USE_NLS" = "yes"; then
1105
dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1106
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1107
dnl the configure script would need to contain the same shell code
1108
dnl again, outside any 'if'. There are two solutions:
1109
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1110
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1111
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1112
dnl documented, we avoid it.
1113
ifelse(gt_included_intl, yes, , [
1114
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1117
AC_MSG_CHECKING([whether NLS is requested])
1118
dnl Default is enabled NLS
1120
[ --disable-nls do not use Native Language Support],
1121
USE_NLS=$enableval, USE_NLS=yes)
1122
AC_MSG_RESULT($USE_NLS)
1125
ifelse(gt_included_intl, yes, [
1126
BUILD_INCLUDED_LIBINTL=no
1127
USE_INCLUDED_LIBINTL=no
1133
dnl If we use NLS figure out what method
1134
if test "$USE_NLS" = "yes"; then
1135
gt_use_preinstalled_gnugettext=no
1136
ifelse(gt_included_intl, yes, [
1137
AC_MSG_CHECKING([whether included gettext is requested])
1138
AC_ARG_WITH(included-gettext,
1139
[ --with-included-gettext use the GNU gettext library included here],
1140
nls_cv_force_use_gnu_gettext=$withval,
1141
nls_cv_force_use_gnu_gettext=no)
1142
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1144
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1145
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1147
dnl User does not insist on using GNU NLS library. Figure out what
1148
dnl to use. If GNU gettext is available we use this. Else we have
1149
dnl to fall back to GNU NLS library.
1151
dnl Add a version number to the cache macros.
1152
define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1153
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1154
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1156
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1157
[AC_TRY_LINK([#include <libintl.h>
1158
]ifelse([$2], [need-formatstring-macros],
1159
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1160
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1163
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1165
], [])[extern int _nl_msg_cat_cntr;
1166
extern int *_nl_domain_bindings;],
1167
[bindtextdomain ("", "");
1168
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1169
gt_cv_func_gnugettext_libc=yes,
1170
gt_cv_func_gnugettext_libc=no)])
1172
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1173
dnl Sometimes libintl requires libiconv, so first search for libiconv.
1174
ifelse(gt_included_intl, yes, , [
1177
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1178
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1179
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1180
dnl even if libiconv doesn't exist.
1181
AC_LIB_LINKFLAGS_BODY([intl])
1182
AC_CACHE_CHECK([for GNU gettext in libintl],
1183
gt_cv_func_gnugettext_libintl,
1184
[gt_save_CPPFLAGS="$CPPFLAGS"
1185
CPPFLAGS="$CPPFLAGS $INCINTL"
1186
gt_save_LIBS="$LIBS"
1187
LIBS="$LIBS $LIBINTL"
1188
dnl Now see whether libintl exists and does not depend on libiconv.
1189
AC_TRY_LINK([#include <libintl.h>
1190
]ifelse([$2], [need-formatstring-macros],
1191
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1192
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1195
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1197
], [])[extern int _nl_msg_cat_cntr;
1202
const char *_nl_expand_alias ();],
1203
[bindtextdomain ("", "");
1204
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1205
gt_cv_func_gnugettext_libintl=yes,
1206
gt_cv_func_gnugettext_libintl=no)
1207
dnl Now see whether libintl exists and depends on libiconv.
1208
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1209
LIBS="$LIBS $LIBICONV"
1210
AC_TRY_LINK([#include <libintl.h>
1211
]ifelse([$2], [need-formatstring-macros],
1212
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1213
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1216
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1218
], [])[extern int _nl_msg_cat_cntr;
1223
const char *_nl_expand_alias ();],
1224
[bindtextdomain ("", "");
1225
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1226
[LIBINTL="$LIBINTL $LIBICONV"
1227
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1228
gt_cv_func_gnugettext_libintl=yes
1231
CPPFLAGS="$gt_save_CPPFLAGS"
1232
LIBS="$gt_save_LIBS"])
1235
dnl If an already present or preinstalled GNU gettext() is found,
1236
dnl use it. But if this macro is used in GNU gettext, and GNU
1237
dnl gettext is already preinstalled in libintl, we update this
1238
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1239
if test "$gt_cv_func_gnugettext_libc" = "yes" \
1240
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1241
&& test "$PACKAGE" != gettext; }; then
1242
gt_use_preinstalled_gnugettext=yes
1244
dnl Reset the values set by searching for libintl.
1250
ifelse(gt_included_intl, yes, [
1251
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1252
dnl GNU gettext is not found in the C library.
1253
dnl Fall back on included GNU gettext library.
1254
nls_cv_use_gnu_gettext=yes
1258
if test "$nls_cv_use_gnu_gettext" = "yes"; then
1259
dnl Mark actions used to generate GNU NLS library.
1260
INTLOBJS="\$(GETTOBJS)"
1261
BUILD_INCLUDED_LIBINTL=yes
1262
USE_INCLUDED_LIBINTL=yes
1263
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1264
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1265
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1268
if test "$gt_use_preinstalled_gnugettext" = "yes" \
1269
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
1270
dnl Mark actions to use GNU gettext tools.
1275
if test "$gt_use_preinstalled_gnugettext" = "yes" \
1276
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
1277
AC_DEFINE(ENABLE_NLS, 1,
1278
[Define to 1 if translation of program messages to the user's native language
1285
if test "$USE_NLS" = "yes"; then
1287
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1288
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1289
AC_MSG_CHECKING([how to link with libintl])
1290
AC_MSG_RESULT([$LIBINTL])
1291
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1294
dnl For backward compatibility. Some packages may be using this.
1295
AC_DEFINE(HAVE_GETTEXT, 1,
1296
[Define if the GNU gettext() function is already present or preinstalled.])
1297
AC_DEFINE(HAVE_DCGETTEXT, 1,
1298
[Define if the GNU dcgettext() function is already present or preinstalled.])
1301
dnl We need to process the po/ directory.
1305
ifelse(gt_included_intl, yes, [
1306
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1307
dnl to 'yes' because some of the testsuite requires it.
1308
if test "$PACKAGE" = gettext; then
1309
BUILD_INCLUDED_LIBINTL=yes
1312
dnl Make all variables we use known to autoconf.
1313
AC_SUBST(BUILD_INCLUDED_LIBINTL)
1314
AC_SUBST(USE_INCLUDED_LIBINTL)
1318
dnl For backward compatibility. Some configure.ins may be using this.
1320
nls_cv_header_libgt=
1322
dnl For backward compatibility. Some Makefiles may be using this.
1324
AC_SUBST(DATADIRNAME)
1326
dnl For backward compatibility. Some Makefiles may be using this.
1328
AC_SUBST(INSTOBJEXT)
1330
dnl For backward compatibility. Some Makefiles may be using this.
1334
dnl Enable libtool support if the surrounding package wishes it.
1335
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1336
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1339
dnl For backward compatibility. Some Makefiles may be using this.
1343
dnl Make all documented variables known to autoconf.
1350
dnl Checks for all prerequisites of the po subdirectory,
1351
dnl except for USE_NLS.
1352
AC_DEFUN([AM_PO_SUBDIRS],
1354
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1355
AC_REQUIRE([AC_PROG_INSTALL])dnl
1356
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1358
dnl Perform the following tests also if --disable-nls has been given,
1359
dnl because they are needed for "make dist" to work.
1361
dnl Search for GNU msgfmt in the PATH.
1362
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1363
dnl The second test excludes FreeBSD msgfmt.
1364
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1365
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1366
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1368
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1370
dnl Search for GNU xgettext 0.11 or newer in the PATH.
1371
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1372
dnl The second test excludes FreeBSD xgettext.
1373
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1374
[$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1375
(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)],
1377
dnl Remove leftover from FreeBSD xgettext call.
1380
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1381
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1382
[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1384
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1385
dnl Test whether we really found GNU msgfmt.
1386
if test "$GMSGFMT" != ":"; then
1387
dnl If it is no GNU msgfmt we define it as : so that the
1388
dnl Makefiles still can work.
1389
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1390
(if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1393
GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1395
[found $GMSGFMT program is not GNU msgfmt; ignore it])
1400
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1401
dnl Test whether we really found GNU xgettext.
1402
if test "$XGETTEXT" != ":"; then
1403
dnl If it is no GNU xgettext we define it as : so that the
1404
dnl Makefiles still can work.
1405
if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1406
(if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1410
[found xgettext program is not GNU xgettext; ignore it])
1413
dnl Remove leftover from FreeBSD xgettext call.
1417
AC_OUTPUT_COMMANDS([
1418
for ac_file in $CONFIG_FILES; do
1419
# Support "outfile[:infile[:infile...]]"
1421
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1423
# PO directories have a Makefile.in generated from Makefile.in.in.
1424
case "$ac_file" in */Makefile.in)
1425
# Adjust a relative srcdir.
1426
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1427
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1428
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1429
# In autoconf-2.13 it is called $ac_given_srcdir.
1430
# In autoconf-2.50 it is called $srcdir.
1431
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1432
case "$ac_given_srcdir" in
1433
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1434
/*) top_srcdir="$ac_given_srcdir" ;;
1435
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1437
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1438
rm -f "$ac_dir/POTFILES"
1439
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1440
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1441
# ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1442
# on $ac_dir but don't depend on user-specified configuration
1444
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1445
# The LINGUAS file contains the set of available languages.
1446
if test -n "$ALL_LINGUAS"; then
1447
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1449
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1450
# Hide the ALL_LINGUAS assigment from automake.
1451
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1453
case "$ac_given_srcdir" in
1455
*) srcdirpre='$(srcdir)/' ;;
1461
for lang in $ALL_LINGUAS; do
1462
POFILES="$POFILES $srcdirpre$lang.po"
1463
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1464
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1465
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1467
# CATALOGS depends on both $ac_dir and the user's LINGUAS
1468
# environment variable.
1470
if test -n "$ALL_LINGUAS"; then
1471
for presentlang in $ALL_LINGUAS; do
1473
if test "%UNSET%" != "$LINGUAS"; then
1474
desiredlanguages="$LINGUAS"
1476
desiredlanguages="$ALL_LINGUAS"
1478
for desiredlang in $desiredlanguages; do
1479
# Use the presentlang catalog if desiredlang is
1480
# a. equal to presentlang, or
1481
# b. a variant of presentlang (because in this case,
1482
# presentlang can be used as a fallback for messages
1483
# which are not translated in the desiredlang catalog).
1484
case "$desiredlang" in
1485
"$presentlang"*) useit=yes;;
1488
if test $useit = yes; then
1489
INST_LINGUAS="$INST_LINGUAS $presentlang"
1494
if test -n "$INST_LINGUAS"; then
1495
for lang in $INST_LINGUAS; do
1496
CATALOGS="$CATALOGS $lang.gmo"
1499
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1500
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"
1501
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1502
if test -f "$f"; then
1504
*.orig | *.bak | *~) ;;
1505
*) cat "$f" >> "$ac_dir/Makefile" ;;
1513
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1514
# POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1516
eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1517
# Capture the value of LINGUAS because we need it to compute CATALOGS.
1518
LINGUAS="${LINGUAS-%UNSET%}"
1523
dnl Checks for all prerequisites of the intl subdirectory,
1524
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1525
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1526
AC_DEFUN([AM_INTL_SUBDIR],
1528
AC_REQUIRE([AC_PROG_INSTALL])dnl
1529
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1530
AC_REQUIRE([AC_PROG_CC])dnl
1531
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1532
AC_REQUIRE([AC_PROG_RANLIB])dnl
1533
AC_REQUIRE([AC_ISC_POSIX])dnl
1534
AC_REQUIRE([AC_HEADER_STDC])dnl
1535
AC_REQUIRE([AC_C_CONST])dnl
1536
AC_REQUIRE([AC_C_INLINE])dnl
1537
AC_REQUIRE([AC_TYPE_OFF_T])dnl
1538
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1539
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1540
AC_REQUIRE([AC_FUNC_MMAP])dnl
1541
AC_REQUIRE([jm_GLIBC21])dnl
1542
AC_REQUIRE([gt_INTDIV0])dnl
1543
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1544
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1545
AC_REQUIRE([gt_INTTYPES_PRI])dnl
1547
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1548
stdlib.h string.h unistd.h sys/param.h])
1549
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1550
geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1551
strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1555
if test $ac_cv_header_locale_h = yes; then
1559
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1560
dnl because plural.y uses bison specific features. It requires at least
1561
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1563
dnl bison is only needed for the maintainer (who touches plural.y). But in
1564
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1565
dnl the rule in general Makefile. Now, some people carelessly touch the
1566
dnl files or have a broken "make" program, hence the plural.c rule will
1567
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1568
dnl present or too old.
1569
AC_CHECK_PROGS([INTLBISON], [bison])
1570
if test -z "$INTLBISON"; then
1573
dnl Found it, now check the version.
1574
AC_MSG_CHECKING([version of bison])
1575
changequote(<<,>>)dnl
1576
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1577
case $ac_prog_version in
1578
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1579
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1581
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1582
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1584
AC_MSG_RESULT([$ac_prog_version])
1586
if test $ac_verc_fail = yes; then
1592
AC_DEFUN([AM_MKINSTALLDIRS],
1594
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1595
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1596
dnl Try to locate is.
1598
if test -n "$ac_aux_dir"; then
1599
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1601
if test -z "$MKINSTALLDIRS"; then
1602
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1604
AC_SUBST(MKINSTALLDIRS)
1608
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1609
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1611
# lib-prefix.m4 serial 1 (gettext-0.11)
1612
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1613
dnl This file is free software, distributed under the terms of the GNU
1614
dnl General Public License. As a special exception to the GNU General
1615
dnl Public License, this file may be distributed as part of a program
1616
dnl that contains a configuration script generated by Autoconf, under
1617
dnl the same distribution terms as the rest of that program.
1619
dnl From Bruno Haible.
1621
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1622
dnl to access previously installed libraries. The basic assumption is that
1623
dnl a user will want packages to use other packages he previously installed
1624
dnl with the same --prefix option.
1625
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1626
dnl libraries, but is otherwise very convenient.
1627
AC_DEFUN([AC_LIB_PREFIX],
1629
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1630
AC_REQUIRE([AC_PROG_CC])
1631
AC_REQUIRE([AC_CANONICAL_HOST])
1632
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1633
dnl By default, look in $includedir and $libdir.
1635
AC_LIB_WITH_FINAL_PREFIX([
1636
eval additional_includedir=\"$includedir\"
1637
eval additional_libdir=\"$libdir\"
1639
AC_ARG_WITH([lib-prefix],
1640
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1641
--without-lib-prefix don't search for libraries in includedir and libdir],
1643
if test "X$withval" = "Xno"; then
1646
if test "X$withval" = "X"; then
1647
AC_LIB_WITH_FINAL_PREFIX([
1648
eval additional_includedir=\"$includedir\"
1649
eval additional_libdir=\"$libdir\"
1652
additional_includedir="$withval/include"
1653
additional_libdir="$withval/lib"
1657
if test $use_additional = yes; then
1658
dnl Potentially add $additional_includedir to $CPPFLAGS.
1659
dnl But don't add it
1660
dnl 1. if it's the standard /usr/include,
1661
dnl 2. if it's already present in $CPPFLAGS,
1662
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1663
dnl 4. if it doesn't exist as a directory.
1664
if test "X$additional_includedir" != "X/usr/include"; then
1666
for x in $CPPFLAGS; do
1667
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1668
if test "X$x" = "X-I$additional_includedir"; then
1673
if test -z "$haveit"; then
1674
if test "X$additional_includedir" = "X/usr/local/include"; then
1675
if test -n "$GCC"; then
1677
linux*) haveit=yes;;
1681
if test -z "$haveit"; then
1682
if test -d "$additional_includedir"; then
1683
dnl Really add $additional_includedir to $CPPFLAGS.
1684
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1689
dnl Potentially add $additional_libdir to $LDFLAGS.
1690
dnl But don't add it
1691
dnl 1. if it's the standard /usr/lib,
1692
dnl 2. if it's already present in $LDFLAGS,
1693
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1694
dnl 4. if it doesn't exist as a directory.
1695
if test "X$additional_libdir" != "X/usr/lib"; then
1697
for x in $LDFLAGS; do
1698
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1699
if test "X$x" = "X-L$additional_libdir"; then
1704
if test -z "$haveit"; then
1705
if test "X$additional_libdir" = "X/usr/local/lib"; then
1706
if test -n "$GCC"; then
1708
linux*) haveit=yes;;
1712
if test -z "$haveit"; then
1713
if test -d "$additional_libdir"; then
1714
dnl Really add $additional_libdir to $LDFLAGS.
1715
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1723
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1724
dnl acl_final_exec_prefix, containing the values to which $prefix and
1725
dnl $exec_prefix will expand at the end of the configure script.
1726
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1728
dnl Unfortunately, prefix and exec_prefix get only finally determined
1729
dnl at the end of configure.
1730
if test "X$prefix" = "XNONE"; then
1731
acl_final_prefix="$ac_default_prefix"
1733
acl_final_prefix="$prefix"
1735
if test "X$exec_prefix" = "XNONE"; then
1736
acl_final_exec_prefix='${prefix}'
1738
acl_final_exec_prefix="$exec_prefix"
1740
acl_save_prefix="$prefix"
1741
prefix="$acl_final_prefix"
1742
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1743
prefix="$acl_save_prefix"
1746
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1747
dnl variables prefix and exec_prefix bound to the values they will have
1748
dnl at the end of the configure script.
1749
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1751
acl_save_prefix="$prefix"
1752
prefix="$acl_final_prefix"
1753
acl_save_exec_prefix="$exec_prefix"
1754
exec_prefix="$acl_final_exec_prefix"
1756
exec_prefix="$acl_save_exec_prefix"
1757
prefix="$acl_save_prefix"
1760
# lib-link.m4 serial 3 (gettext-0.11.3)
1761
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1762
dnl This file is free software, distributed under the terms of the GNU
1763
dnl General Public License. As a special exception to the GNU General
1764
dnl Public License, this file may be distributed as part of a program
1765
dnl that contains a configuration script generated by Autoconf, under
1766
dnl the same distribution terms as the rest of that program.
1768
dnl From Bruno Haible.
1770
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1771
dnl the libraries corresponding to explicit and implicit dependencies.
1772
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1773
dnl augments the CPPFLAGS variable.
1774
AC_DEFUN([AC_LIB_LINKFLAGS],
1776
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1777
AC_REQUIRE([AC_LIB_RPATH])
1778
define([Name],[translit([$1],[./-], [___])])
1779
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1780
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1781
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1782
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1783
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1784
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1785
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1787
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1788
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1789
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1790
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1792
AC_SUBST([LTLIB]NAME)
1793
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1794
dnl results of this search when this library appears as a dependency.
1800
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1801
dnl searches for libname and the libraries corresponding to explicit and
1802
dnl implicit dependencies, together with the specified include files and
1803
dnl the ability to compile and link the specified testcode. If found, it
1804
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1805
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1806
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1807
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1808
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1810
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1811
AC_REQUIRE([AC_LIB_RPATH])
1812
define([Name],[translit([$1],[./-], [___])])
1813
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1814
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1816
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1818
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1820
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1821
dnl because if the user has installed lib[]Name and not disabled its use
1822
dnl via --without-lib[]Name-prefix, he wants to use it.
1823
ac_save_CPPFLAGS="$CPPFLAGS"
1824
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1826
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1827
ac_save_LIBS="$LIBS"
1828
LIBS="$LIBS $LIB[]NAME"
1829
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1830
LIBS="$ac_save_LIBS"
1832
if test "$ac_cv_lib[]Name" = yes; then
1834
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1835
AC_MSG_CHECKING([how to link with lib[]$1])
1836
AC_MSG_RESULT([$LIB[]NAME])
1839
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1840
dnl $INC[]NAME either.
1841
CPPFLAGS="$ac_save_CPPFLAGS"
1845
AC_SUBST([HAVE_LIB]NAME)
1847
AC_SUBST([LTLIB]NAME)
1852
dnl Determine the platform dependent parameters needed to use rpath:
1853
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1854
dnl hardcode_direct, hardcode_minus_L,
1855
dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1856
AC_DEFUN([AC_LIB_RPATH],
1858
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1859
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1860
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1861
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1862
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1863
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1864
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1870
libext="$acl_cv_libext"
1871
shlibext="$acl_cv_shlibext"
1872
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1873
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1874
hardcode_direct="$acl_cv_hardcode_direct"
1875
hardcode_minus_L="$acl_cv_hardcode_minus_L"
1876
sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1877
sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1878
dnl Determine whether the user wants rpath handling at all.
1879
AC_ARG_ENABLE(rpath,
1880
[ --disable-rpath do not hardcode runtime library paths],
1881
:, enable_rpath=yes)
1884
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1885
dnl the libraries corresponding to explicit and implicit dependencies.
1886
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1887
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1889
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1890
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1891
dnl By default, look in $includedir and $libdir.
1893
AC_LIB_WITH_FINAL_PREFIX([
1894
eval additional_includedir=\"$includedir\"
1895
eval additional_libdir=\"$libdir\"
1897
AC_ARG_WITH([lib$1-prefix],
1898
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1899
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1901
if test "X$withval" = "Xno"; then
1904
if test "X$withval" = "X"; then
1905
AC_LIB_WITH_FINAL_PREFIX([
1906
eval additional_includedir=\"$includedir\"
1907
eval additional_libdir=\"$libdir\"
1910
additional_includedir="$withval/include"
1911
additional_libdir="$withval/lib"
1915
dnl Search the library and its dependencies in $additional_libdir and
1916
dnl $LDFLAGS. Using breadth-first-seach.
1922
names_already_handled=
1923
names_next_round='$1 $2'
1924
while test -n "$names_next_round"; do
1925
names_this_round="$names_next_round"
1927
for name in $names_this_round; do
1929
for n in $names_already_handled; do
1930
if test "$n" = "$name"; then
1935
if test -z "$already_handled"; then
1936
names_already_handled="$names_already_handled $name"
1937
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1938
dnl or AC_LIB_HAVE_LINKFLAGS call.
1939
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1940
eval value=\"\$HAVE_LIB$uppername\"
1941
if test -n "$value"; then
1942
if test "$value" = yes; then
1943
eval value=\"\$LIB$uppername\"
1944
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1945
eval value=\"\$LTLIB$uppername\"
1946
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1948
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1949
dnl that this library doesn't exist. So just drop it.
1953
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1954
dnl and the already constructed $LIBNAME/$LTLIBNAME.
1959
if test $use_additional = yes; then
1960
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1961
found_dir="$additional_libdir"
1962
found_so="$additional_libdir/lib$name.$shlibext"
1963
if test -f "$additional_libdir/lib$name.la"; then
1964
found_la="$additional_libdir/lib$name.la"
1967
if test -f "$additional_libdir/lib$name.$libext"; then
1968
found_dir="$additional_libdir"
1969
found_a="$additional_libdir/lib$name.$libext"
1970
if test -f "$additional_libdir/lib$name.la"; then
1971
found_la="$additional_libdir/lib$name.la"
1976
if test "X$found_dir" = "X"; then
1977
for x in $LDFLAGS $LTLIB[]NAME; do
1978
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1981
dir=`echo "X$x" | sed -e 's/^X-L//'`
1982
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1984
found_so="$dir/lib$name.$shlibext"
1985
if test -f "$dir/lib$name.la"; then
1986
found_la="$dir/lib$name.la"
1989
if test -f "$dir/lib$name.$libext"; then
1991
found_a="$dir/lib$name.$libext"
1992
if test -f "$dir/lib$name.la"; then
1993
found_la="$dir/lib$name.la"
1999
if test "X$found_dir" != "X"; then
2004
if test "X$found_dir" != "X"; then
2005
dnl Found the library.
2006
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2007
if test "X$found_so" != "X"; then
2008
dnl Linking with a shared library. We attempt to hardcode its
2009
dnl directory into the executable's runpath, unless it's the
2010
dnl standard /usr/lib.
2011
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
2012
dnl No hardcoding is needed.
2013
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2015
dnl Use an explicit option to hardcode DIR into the resulting
2017
dnl Potentially add DIR to ltrpathdirs.
2018
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2020
for x in $ltrpathdirs; do
2021
if test "X$x" = "X$found_dir"; then
2026
if test -z "$haveit"; then
2027
ltrpathdirs="$ltrpathdirs $found_dir"
2029
dnl The hardcoding into $LIBNAME is system dependent.
2030
if test "$hardcode_direct" = yes; then
2031
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2032
dnl resulting binary.
2033
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2035
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2036
dnl Use an explicit option to hardcode DIR into the resulting
2038
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2039
dnl Potentially add DIR to rpathdirs.
2040
dnl The rpathdirs will be appended to $LIBNAME at the end.
2042
for x in $rpathdirs; do
2043
if test "X$x" = "X$found_dir"; then
2048
if test -z "$haveit"; then
2049
rpathdirs="$rpathdirs $found_dir"
2052
dnl Rely on "-L$found_dir".
2053
dnl But don't add it if it's already contained in the LDFLAGS
2054
dnl or the already constructed $LIBNAME
2056
for x in $LDFLAGS $LIB[]NAME; do
2057
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2058
if test "X$x" = "X-L$found_dir"; then
2063
if test -z "$haveit"; then
2064
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2066
if test "$hardcode_minus_L" != no; then
2067
dnl FIXME: Not sure whether we should use
2068
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2070
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2072
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2073
dnl here, because this doesn't fit in flags passed to the
2074
dnl compiler. So give up. No hardcoding. This affects only
2075
dnl very old systems.
2076
dnl FIXME: Not sure whether we should use
2077
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2079
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2085
if test "X$found_a" != "X"; then
2086
dnl Linking with a static library.
2087
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2089
dnl We shouldn't come here, but anyway it's good to have a
2091
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2094
dnl Assume the include files are nearby.
2095
additional_includedir=
2096
case "$found_dir" in
2098
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2099
additional_includedir="$basedir/include"
2102
if test "X$additional_includedir" != "X"; then
2103
dnl Potentially add $additional_includedir to $INCNAME.
2104
dnl But don't add it
2105
dnl 1. if it's the standard /usr/include,
2106
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2107
dnl 3. if it's already present in $CPPFLAGS or the already
2108
dnl constructed $INCNAME,
2109
dnl 4. if it doesn't exist as a directory.
2110
if test "X$additional_includedir" != "X/usr/include"; then
2112
if test "X$additional_includedir" = "X/usr/local/include"; then
2113
if test -n "$GCC"; then
2115
linux*) haveit=yes;;
2119
if test -z "$haveit"; then
2120
for x in $CPPFLAGS $INC[]NAME; do
2121
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2122
if test "X$x" = "X-I$additional_includedir"; then
2127
if test -z "$haveit"; then
2128
if test -d "$additional_includedir"; then
2129
dnl Really add $additional_includedir to $INCNAME.
2130
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2136
dnl Look for dependencies.
2137
if test -n "$found_la"; then
2138
dnl Read the .la file. It defines the variables
2139
dnl dlname, library_names, old_library, dependency_libs, current,
2140
dnl age, revision, installed, dlopen, dlpreopen, libdir.
2141
save_libdir="$libdir"
2143
*/* | *\\*) . "$found_la" ;;
2144
*) . "./$found_la" ;;
2146
libdir="$save_libdir"
2147
dnl We use only dependency_libs.
2148
for dep in $dependency_libs; do
2151
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2152
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2153
dnl But don't add it
2154
dnl 1. if it's the standard /usr/lib,
2155
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2156
dnl 3. if it's already present in $LDFLAGS or the already
2157
dnl constructed $LIBNAME,
2158
dnl 4. if it doesn't exist as a directory.
2159
if test "X$additional_libdir" != "X/usr/lib"; then
2161
if test "X$additional_libdir" = "X/usr/local/lib"; then
2162
if test -n "$GCC"; then
2164
linux*) haveit=yes;;
2168
if test -z "$haveit"; then
2170
for x in $LDFLAGS $LIB[]NAME; do
2171
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2172
if test "X$x" = "X-L$additional_libdir"; then
2177
if test -z "$haveit"; then
2178
if test -d "$additional_libdir"; then
2179
dnl Really add $additional_libdir to $LIBNAME.
2180
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2184
for x in $LDFLAGS $LTLIB[]NAME; do
2185
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2186
if test "X$x" = "X-L$additional_libdir"; then
2191
if test -z "$haveit"; then
2192
if test -d "$additional_libdir"; then
2193
dnl Really add $additional_libdir to $LTLIBNAME.
2194
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2201
dir=`echo "X$dep" | sed -e 's/^X-R//'`
2202
if test "$enable_rpath" != no; then
2203
dnl Potentially add DIR to rpathdirs.
2204
dnl The rpathdirs will be appended to $LIBNAME at the end.
2206
for x in $rpathdirs; do
2207
if test "X$x" = "X$dir"; then
2212
if test -z "$haveit"; then
2213
rpathdirs="$rpathdirs $dir"
2215
dnl Potentially add DIR to ltrpathdirs.
2216
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2218
for x in $ltrpathdirs; do
2219
if test "X$x" = "X$dir"; then
2224
if test -z "$haveit"; then
2225
ltrpathdirs="$ltrpathdirs $dir"
2230
dnl Handle this in the next round.
2231
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2234
dnl Handle this in the next round. Throw away the .la's
2235
dnl directory; it is already contained in a preceding -L
2237
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2240
dnl Most likely an immediate library name.
2241
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2242
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2248
dnl Didn't find the library; assume it is in the system directories
2249
dnl known to the linker and runtime loader. (All the system
2250
dnl directories known to the linker should also be known to the
2251
dnl runtime loader, otherwise the system is severely misconfigured.)
2252
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2253
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2259
if test "X$rpathdirs" != "X"; then
2260
if test -n "$hardcode_libdir_separator"; then
2261
dnl Weird platform: only the last -rpath option counts, the user must
2262
dnl pass all path elements in one option. We can arrange that for a
2263
dnl single library, but not when more than one $LIBNAMEs are used.
2265
for found_dir in $rpathdirs; do
2266
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2268
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2269
acl_save_libdir="$libdir"
2271
eval flag=\"$hardcode_libdir_flag_spec\"
2272
libdir="$acl_save_libdir"
2273
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2275
dnl The -rpath options are cumulative.
2276
for found_dir in $rpathdirs; do
2277
acl_save_libdir="$libdir"
2279
eval flag=\"$hardcode_libdir_flag_spec\"
2280
libdir="$acl_save_libdir"
2281
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2285
if test "X$ltrpathdirs" != "X"; then
2286
dnl When using libtool, the option that works for both libraries and
2287
dnl executables is -R. The -R options are cumulative.
2288
for found_dir in $ltrpathdirs; do
2289
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2294
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2295
dnl unless already present in VAR.
2296
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2297
dnl contains two or three consecutive elements that belong together.
2298
AC_DEFUN([AC_LIB_APPENDTOVAR],
2300
for element in [$2]; do
2303
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2304
if test "X$x" = "X$element"; then
2309
if test -z "$haveit"; then
2310
[$1]="${[$1]}${[$1]:+ }$element"
2315
# lib-ld.m4 serial 1 (gettext-0.11)
2316
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2317
dnl This file is free software, distributed under the terms of the GNU
2318
dnl General Public License. As a special exception to the GNU General
2319
dnl Public License, this file may be distributed as part of a program
2320
dnl that contains a configuration script generated by Autoconf, under
2321
dnl the same distribution terms as the rest of that program.
2323
dnl Subroutines of libtool.m4,
2324
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2325
dnl with libtool.m4.
2327
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2328
AC_DEFUN([AC_LIB_PROG_LD_GNU],
2329
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2330
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2331
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2332
acl_cv_prog_gnu_ld=yes
2334
acl_cv_prog_gnu_ld=no
2336
with_gnu_ld=$acl_cv_prog_gnu_ld
2339
dnl From libtool-1.4. Sets the variable LD.
2340
AC_DEFUN([AC_LIB_PROG_LD],
2341
[AC_ARG_WITH(gnu-ld,
2342
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2343
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2344
AC_REQUIRE([AC_PROG_CC])dnl
2345
AC_REQUIRE([AC_CANONICAL_HOST])dnl
2347
if test "$GCC" = yes; then
2348
# Check if gcc -print-prog-name=ld gives a path.
2349
AC_MSG_CHECKING([for ld used by GCC])
2352
# gcc leaves a trailing carriage return which upsets mingw
2353
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2355
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2358
# Accept absolute paths.
2359
[[\\/]* | [A-Za-z]:[\\/]*)]
2360
[re_direlt='/[^/][^/]*/\.\./']
2361
# Canonicalize the path of ld
2362
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2363
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2364
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2366
test -z "$LD" && LD="$ac_prog"
2369
# If it fails, then pretend we aren't using GCC.
2373
# If it is relative, then search for the first ld in PATH.
2377
elif test "$with_gnu_ld" = yes; then
2378
AC_MSG_CHECKING([for GNU ld])
2380
AC_MSG_CHECKING([for non-GNU ld])
2382
AC_CACHE_VAL(acl_cv_path_LD,
2383
[if test -z "$LD"; then
2384
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2385
for ac_dir in $PATH; do
2386
test -z "$ac_dir" && ac_dir=.
2387
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2388
acl_cv_path_LD="$ac_dir/$ac_prog"
2389
# Check to see if the program is GNU ld. I'd rather use --version,
2390
# but apparently some GNU ld's only accept -v.
2391
# Break only if it was the GNU/non-GNU ld that we prefer.
2392
if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2393
test "$with_gnu_ld" != no && break
2395
test "$with_gnu_ld" != yes && break
2401
acl_cv_path_LD="$LD" # Let the user override the test with a path.
2403
LD="$acl_cv_path_LD"
2404
if test -n "$LD"; then
2409
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2413
# iconv.m4 serial AM4 (gettext-0.11.3)
2414
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2415
dnl This file is free software, distributed under the terms of the GNU
2416
dnl General Public License. As a special exception to the GNU General
2417
dnl Public License, this file may be distributed as part of a program
2418
dnl that contains a configuration script generated by Autoconf, under
2419
dnl the same distribution terms as the rest of that program.
2421
dnl From Bruno Haible.
2423
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2425
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2426
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2427
AC_REQUIRE([AC_LIB_RPATH])
2429
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2431
AC_LIB_LINKFLAGS_BODY([iconv])
2434
AC_DEFUN([AM_ICONV_LINK],
2436
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2437
dnl those with the standalone portable GNU libiconv installed).
2439
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2441
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2443
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2444
dnl because if the user has installed libiconv and not disabled its use
2445
dnl via --without-libiconv-prefix, he wants to use it. The first
2446
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2447
am_save_CPPFLAGS="$CPPFLAGS"
2448
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2450
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2451
am_cv_func_iconv="no, consider installing GNU libiconv"
2453
AC_TRY_LINK([#include <stdlib.h>
2454
#include <iconv.h>],
2455
[iconv_t cd = iconv_open("","");
2456
iconv(cd,NULL,NULL,NULL,NULL);
2458
am_cv_func_iconv=yes)
2459
if test "$am_cv_func_iconv" != yes; then
2460
am_save_LIBS="$LIBS"
2461
LIBS="$LIBS $LIBICONV"
2462
AC_TRY_LINK([#include <stdlib.h>
2463
#include <iconv.h>],
2464
[iconv_t cd = iconv_open("","");
2465
iconv(cd,NULL,NULL,NULL,NULL);
2468
am_cv_func_iconv=yes)
2469
LIBS="$am_save_LIBS"
2472
if test "$am_cv_func_iconv" = yes; then
2473
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2475
if test "$am_cv_lib_iconv" = yes; then
2476
AC_MSG_CHECKING([how to link with libiconv])
2477
AC_MSG_RESULT([$LIBICONV])
2479
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2481
CPPFLAGS="$am_save_CPPFLAGS"
2486
AC_SUBST(LTLIBICONV)
2489
AC_DEFUN([AM_ICONV],
2492
if test "$am_cv_func_iconv" = yes; then
2493
AC_MSG_CHECKING([for iconv declaration])
2494
AC_CACHE_VAL(am_cv_proto_iconv, [
2502
#if defined(__STDC__) || defined(__cplusplus)
2503
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2507
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2508
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);"])
2509
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2510
AC_MSG_RESULT([$]{ac_t:-
2511
}[$]am_cv_proto_iconv)
2512
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2513
[Define as const if the declaration of iconv() needs const.])
2517
# progtest.m4 serial 2 (gettext-0.10.40)
2518
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2519
dnl This file is free software, distributed under the terms of the GNU
2520
dnl General Public License. As a special exception to the GNU General
2521
dnl Public License, this file may be distributed as part of a program
2522
dnl that contains a configuration script generated by Autoconf, under
2523
dnl the same distribution terms as the rest of that program.
2525
dnl This file can can be used in projects which are not available under
2526
dnl the GNU General Public License or the GNU Library General Public
2527
dnl License but which still want to provide support for the GNU gettext
2529
dnl Please note that the actual code of the GNU gettext library is covered
2530
dnl by the GNU Library General Public License, and the rest of the GNU
2531
dnl gettext package package is covered by the GNU General Public License.
2532
dnl They are *not* in the public domain.
2535
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2537
# Search path for a program which passes the given test.
2539
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2540
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2541
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2542
[# Extract the first word of "$2", so it can be a program name with args.
2543
set dummy $2; ac_word=[$]2
2544
AC_MSG_CHECKING([for $ac_word])
2545
AC_CACHE_VAL(ac_cv_path_$1,
2548
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2551
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2552
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2553
test -z "$ac_dir" && ac_dir=.
2554
if test -f $ac_dir/$ac_word; then
2556
ac_cv_path_$1="$ac_dir/$ac_word"
2562
dnl If no 4th arg is given, leave the cache variable unset,
2563
dnl so AC_PATH_PROGS will keep looking.
2564
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2569
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2570
AC_MSG_RESULT([$]$1)
2577
# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2578
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2579
dnl This file is free software, distributed under the terms of the GNU
2580
dnl General Public License. As a special exception to the GNU General
2581
dnl Public License, this file may be distributed as part of a program
2582
dnl that contains a configuration script generated by Autoconf, under
2583
dnl the same distribution terms as the rest of that program.
2585
# Test for the GNU C Library, version 2.1 or newer.
2586
# From Bruno Haible.
2588
AC_DEFUN([jm_GLIBC21],
2590
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2591
ac_cv_gnu_library_2_1,
2592
[AC_EGREP_CPP([Lucky GNU user],
2594
#include <features.h>
2595
#ifdef __GNU_LIBRARY__
2596
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2601
ac_cv_gnu_library_2_1=yes,
2602
ac_cv_gnu_library_2_1=no)
2606
GLIBC21="$ac_cv_gnu_library_2_1"
2610
# intdiv0.m4 serial 1 (gettext-0.11.3)
2611
dnl Copyright (C) 2002 Free Software Foundation, Inc.
2612
dnl This file is free software, distributed under the terms of the GNU
2613
dnl General Public License. As a special exception to the GNU General
2614
dnl Public License, this file may be distributed as part of a program
2615
dnl that contains a configuration script generated by Autoconf, under
2616
dnl the same distribution terms as the rest of that program.
2618
dnl From Bruno Haible.
2620
AC_DEFUN([gt_INTDIV0],
2622
AC_REQUIRE([AC_PROG_CC])dnl
2623
AC_REQUIRE([AC_CANONICAL_HOST])dnl
2625
AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2626
gt_cv_int_divbyzero_sigfpe,
2634
sigfpe_handler (int sig)
2636
sigfpe_handler (sig) int sig;
2639
/* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
2640
exit (sig != SIGFPE);
2650
signal (SIGFPE, sigfpe_handler);
2651
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
2652
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2653
signal (SIGTRAP, sigfpe_handler);
2655
/* Linux/SPARC yields signal SIGILL. */
2656
#if defined (__sparc__) && defined (__linux__)
2657
signal (SIGILL, sigfpe_handler);
2664
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2666
# Guess based on the CPU.
2668
alpha* | i[34567]86 | m68k | s390*)
2669
gt_cv_int_divbyzero_sigfpe="guessing yes";;
2671
gt_cv_int_divbyzero_sigfpe="guessing no";;
2675
case "$gt_cv_int_divbyzero_sigfpe" in
2679
AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2680
[Define if integer division by zero raises signal SIGFPE.])
2683
# uintmax_t.m4 serial 6 (gettext-0.11)
2684
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2685
dnl This file is free software, distributed under the terms of the GNU
2686
dnl General Public License. As a special exception to the GNU General
2687
dnl Public License, this file may be distributed as part of a program
2688
dnl that contains a configuration script generated by Autoconf, under
2689
dnl the same distribution terms as the rest of that program.
2691
dnl From Paul Eggert.
2695
# Define uintmax_t to `unsigned long' or `unsigned long long'
2696
# if <inttypes.h> does not exist.
2698
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2700
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2701
AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2702
if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2703
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2704
test $ac_cv_type_unsigned_long_long = yes \
2705
&& ac_type='unsigned long long' \
2706
|| ac_type='unsigned long'
2707
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2708
[Define to unsigned long or unsigned long long
2709
if <inttypes.h> and <stdint.h> don't define.])
2713
# inttypes_h.m4 serial 4 (gettext-0.11.4)
2714
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2715
dnl This file is free software, distributed under the terms of the GNU
2716
dnl General Public License. As a special exception to the GNU General
2717
dnl Public License, this file may be distributed as part of a program
2718
dnl that contains a configuration script generated by Autoconf, under
2719
dnl the same distribution terms as the rest of that program.
2721
dnl From Paul Eggert.
2723
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2724
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2726
AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2728
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2730
[#include <sys/types.h>
2731
#include <inttypes.h>],
2732
[uintmax_t i = (uintmax_t) -1;],
2733
jm_ac_cv_header_inttypes_h=yes,
2734
jm_ac_cv_header_inttypes_h=no)])
2735
if test $jm_ac_cv_header_inttypes_h = yes; then
2736
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2737
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2738
and declares uintmax_t. ])
2742
# stdint_h.m4 serial 2 (gettext-0.11.4)
2743
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2744
dnl This file is free software, distributed under the terms of the GNU
2745
dnl General Public License. As a special exception to the GNU General
2746
dnl Public License, this file may be distributed as part of a program
2747
dnl that contains a configuration script generated by Autoconf, under
2748
dnl the same distribution terms as the rest of that program.
2750
dnl From Paul Eggert.
2752
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2753
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2755
AC_DEFUN([jm_AC_HEADER_STDINT_H],
2757
AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2759
[#include <sys/types.h>
2760
#include <stdint.h>],
2761
[uintmax_t i = (uintmax_t) -1;],
2762
jm_ac_cv_header_stdint_h=yes,
2763
jm_ac_cv_header_stdint_h=no)])
2764
if test $jm_ac_cv_header_stdint_h = yes; then
2765
AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2766
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2767
and declares uintmax_t. ])
2771
# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2772
dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2773
dnl This file is free software, distributed under the terms of the GNU
2774
dnl General Public License. As a special exception to the GNU General
2775
dnl Public License, this file may be distributed as part of a program
2776
dnl that contains a configuration script generated by Autoconf, under
2777
dnl the same distribution terms as the rest of that program.
2779
dnl From Paul Eggert.
2781
AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2783
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2784
[AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2785
[unsigned long long ullmax = (unsigned long long) -1;
2786
return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2787
ac_cv_type_unsigned_long_long=yes,
2788
ac_cv_type_unsigned_long_long=no)])
2789
if test $ac_cv_type_unsigned_long_long = yes; then
2790
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2791
[Define if you have the unsigned long long type.])
2795
# inttypes.m4 serial 1 (gettext-0.11.4)
2796
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2797
dnl This file is free software, distributed under the terms of the GNU
2798
dnl General Public License. As a special exception to the GNU General
2799
dnl Public License, this file may be distributed as part of a program
2800
dnl that contains a configuration script generated by Autoconf, under
2801
dnl the same distribution terms as the rest of that program.
2803
dnl From Paul Eggert.
2805
# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2808
AC_DEFUN([gt_HEADER_INTTYPES_H],
2810
AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2813
[#include <sys/types.h>
2814
#include <inttypes.h>],
2815
[], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2817
if test $gt_cv_header_inttypes_h = yes; then
2818
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2819
[Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2823
# inttypes-pri.m4 serial 1 (gettext-0.11.4)
2824
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2825
dnl This file is free software, distributed under the terms of the GNU
2826
dnl General Public License. As a special exception to the GNU General
2827
dnl Public License, this file may be distributed as part of a program
2828
dnl that contains a configuration script generated by Autoconf, under
2829
dnl the same distribution terms as the rest of that program.
2831
dnl From Bruno Haible.
2833
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2834
# macros to non-string values. This is the case on AIX 4.3.3.
2836
AC_DEFUN([gt_INTTYPES_PRI],
2838
AC_REQUIRE([gt_HEADER_INTTYPES_H])
2839
if test $gt_cv_header_inttypes_h = yes; then
2840
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2841
gt_cv_inttypes_pri_broken,
2843
AC_TRY_COMPILE([#include <inttypes.h>
2847
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2850
if test "$gt_cv_inttypes_pri_broken" = yes; then
2851
AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2852
[Define if <inttypes.h> exists and defines unusable PRI* macros.])
2856
# codeset.m4 serial AM1 (gettext-0.10.40)
2857
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2858
dnl This file is free software, distributed under the terms of the GNU
2859
dnl General Public License. As a special exception to the GNU General
2860
dnl Public License, this file may be distributed as part of a program
2861
dnl that contains a configuration script generated by Autoconf, under
2862
dnl the same distribution terms as the rest of that program.
2864
dnl From Bruno Haible.
2866
AC_DEFUN([AM_LANGINFO_CODESET],
2868
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2869
[AC_TRY_LINK([#include <langinfo.h>],
2870
[char* cs = nl_langinfo(CODESET);],
2871
am_cv_langinfo_codeset=yes,
2872
am_cv_langinfo_codeset=no)
2874
if test $am_cv_langinfo_codeset = yes; then
2875
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2876
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2880
# lcmessage.m4 serial 3 (gettext-0.11.3)
2881
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2882
dnl This file is free software, distributed under the terms of the GNU
2883
dnl General Public License. As a special exception to the GNU General
2884
dnl Public License, this file may be distributed as part of a program
2885
dnl that contains a configuration script generated by Autoconf, under
2886
dnl the same distribution terms as the rest of that program.
2888
dnl This file can can be used in projects which are not available under
2889
dnl the GNU General Public License or the GNU Library General Public
2890
dnl License but which still want to provide support for the GNU gettext
2892
dnl Please note that the actual code of the GNU gettext library is covered
2893
dnl by the GNU Library General Public License, and the rest of the GNU
2894
dnl gettext package package is covered by the GNU General Public License.
2895
dnl They are *not* in the public domain.
2898
dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2900
# Check whether LC_MESSAGES is available in <locale.h>.
2902
AC_DEFUN([AM_LC_MESSAGES],
2904
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2905
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2906
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2907
if test $am_cv_val_LC_MESSAGES = yes; then
2908
AC_DEFINE(HAVE_LC_MESSAGES, 1,
2909
[Define if your <locale.h> file defines LC_MESSAGES.])
870
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
871
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
873
AC_SUBST([am__untar])
876
m4_include([m4/findlib.m4])
877
m4_include([m4/nullsort.m4])
878
m4_include([gnulib/m4/alloca.m4])
879
m4_include([gnulib/m4/atexit.m4])
880
m4_include([gnulib/m4/canonicalize.m4])
881
m4_include([gnulib/m4/closeout.m4])
882
m4_include([gnulib/m4/d-ino.m4])
883
m4_include([gnulib/m4/dirname.m4])
884
m4_include([gnulib/m4/dos.m4])
885
m4_include([gnulib/m4/error.m4])
886
m4_include([gnulib/m4/exitfail.m4])
887
m4_include([gnulib/m4/extensions.m4])
888
m4_include([gnulib/m4/fileblocks.m4])
889
m4_include([gnulib/m4/filemode.m4])
890
m4_include([gnulib/m4/filenamecat.m4])
891
m4_include([gnulib/m4/fnmatch.m4])
892
m4_include([gnulib/m4/fpending.m4])
893
m4_include([gnulib/m4/fstypename.m4])
894
m4_include([gnulib/m4/getcwd-path-max.m4])
895
m4_include([gnulib/m4/getcwd.m4])
896
m4_include([gnulib/m4/getline.m4])
897
m4_include([gnulib/m4/getndelim2.m4])
898
m4_include([gnulib/m4/getopt.m4])
899
m4_include([gnulib/m4/gettext.m4])
900
m4_include([gnulib/m4/gettimeofday.m4])
901
m4_include([gnulib/m4/gnulib.m4])
902
m4_include([gnulib/m4/human.m4])
903
m4_include([gnulib/m4/iconv.m4])
904
m4_include([gnulib/m4/idcache.m4])
905
m4_include([gnulib/m4/intmax_t.m4])
906
m4_include([gnulib/m4/inttypes_h.m4])
907
m4_include([gnulib/m4/lib-ld.m4])
908
m4_include([gnulib/m4/lib-link.m4])
909
m4_include([gnulib/m4/lib-prefix.m4])
910
m4_include([gnulib/m4/longlong.m4])
911
m4_include([gnulib/m4/ls-mntd-fs.m4])
912
m4_include([gnulib/m4/lstat.m4])
913
m4_include([gnulib/m4/mbrtowc.m4])
914
m4_include([gnulib/m4/mbstate_t.m4])
915
m4_include([gnulib/m4/memcmp.m4])
916
m4_include([gnulib/m4/mempcpy.m4])
917
m4_include([gnulib/m4/memset.m4])
918
m4_include([gnulib/m4/mktime.m4])
919
m4_include([gnulib/m4/modechange.m4])
920
m4_include([gnulib/m4/mountlist.m4])
921
m4_include([gnulib/m4/nls.m4])
922
m4_include([gnulib/m4/onceonly_2_57.m4])
923
m4_include([gnulib/m4/pathmax.m4])
924
m4_include([gnulib/m4/po.m4])
925
m4_include([gnulib/m4/progtest.m4])
926
m4_include([gnulib/m4/quote.m4])
927
m4_include([gnulib/m4/quotearg.m4])
928
m4_include([gnulib/m4/readlink.m4])
929
m4_include([gnulib/m4/regex.m4])
930
m4_include([gnulib/m4/restrict.m4])
931
m4_include([gnulib/m4/rpmatch.m4])
932
m4_include([gnulib/m4/savedir.m4])
933
m4_include([gnulib/m4/ssize_t.m4])
934
m4_include([gnulib/m4/stat-macros.m4])
935
m4_include([gnulib/m4/stat.m4])
936
m4_include([gnulib/m4/stdbool.m4])
937
m4_include([gnulib/m4/stdint_h.m4])
938
m4_include([gnulib/m4/stpcpy.m4])
939
m4_include([gnulib/m4/strdup.m4])
940
m4_include([gnulib/m4/strftime.m4])
941
m4_include([gnulib/m4/strstr.m4])
942
m4_include([gnulib/m4/strtoimax.m4])
943
m4_include([gnulib/m4/strtol.m4])
944
m4_include([gnulib/m4/strtoll.m4])
945
m4_include([gnulib/m4/strtoul.m4])
946
m4_include([gnulib/m4/strtoull.m4])
947
m4_include([gnulib/m4/strtoumax.m4])
948
m4_include([gnulib/m4/time_r.m4])
949
m4_include([gnulib/m4/tm_gmtoff.m4])
950
m4_include([gnulib/m4/tzset.m4])
951
m4_include([gnulib/m4/uintmax_t.m4])
952
m4_include([gnulib/m4/ulonglong.m4])
953
m4_include([gnulib/m4/xalloc.m4])
954
m4_include([gnulib/m4/xgetcwd.m4])
955
m4_include([gnulib/m4/xreadlink.m4])
956
m4_include([gnulib/m4/xstrtol.m4])
957
m4_include([gnulib/m4/xstrtoumax.m4])
958
m4_include([gnulib/m4/yesno.m4])