]> gcc.gnu.org Git - gcc.git/blame - intl/aclocal.m4
c_locale.h (__convert_from_v): Don't use a default for __prec, assume __prec >= 0...
[gcc.git] / intl / aclocal.m4
CommitLineData
6eb95e99
ZW
1dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13# gettext.m4 serial 20 (gettext-0.12)
14dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
15dnl This file is free software, distributed under the terms of the GNU
16dnl General Public License. As a special exception to the GNU General
17dnl Public License, this file may be distributed as part of a program
18dnl that contains a configuration script generated by Autoconf, under
19dnl the same distribution terms as the rest of that program.
20dnl
21dnl This file can can be used in projects which are not available under
22dnl the GNU General Public License or the GNU Library General Public
23dnl License but which still want to provide support for the GNU gettext
24dnl functionality.
25dnl Please note that the actual code of the GNU gettext library is covered
26dnl by the GNU Library General Public License, and the rest of the GNU
27dnl gettext package package is covered by the GNU General Public License.
28dnl They are *not* in the public domain.
29
30dnl Authors:
31dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
32dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
33
34dnl Macro to add for using GNU gettext.
35
36dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
37dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
38dnl default (if it is not specified or empty) is 'no-libtool'.
39dnl INTLSYMBOL should be 'external' for packages with no intl directory,
40dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
41dnl If INTLSYMBOL is 'use-libtool', then a libtool library
42dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
43dnl depending on --{enable,disable}-{shared,static} and on the presence of
44dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
45dnl $(top_builddir)/intl/libintl.a will be created.
46dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
47dnl implementations (in libc or libintl) without the ngettext() function
48dnl will be ignored. If NEEDSYMBOL is specified and is
49dnl 'need-formatstring-macros', then GNU gettext implementations that don't
50dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
51dnl INTLDIR is used to find the intl libraries. If empty,
52dnl the value `$(top_builddir)/intl/' is used.
53dnl
54dnl The result of the configuration is one of three cases:
55dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
56dnl and used.
57dnl Catalog format: GNU --> install in $(datadir)
58dnl Catalog extension: .mo after installation, .gmo in source tree
59dnl 2) GNU gettext has been found in the system's C library.
60dnl Catalog format: GNU --> install in $(datadir)
61dnl Catalog extension: .mo after installation, .gmo in source tree
62dnl 3) No internationalization, always use English msgid.
63dnl Catalog format: none
64dnl Catalog extension: none
65dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
66dnl The use of .gmo is historical (it was needed to avoid overwriting the
67dnl GNU format catalogs when building on a platform with an X/Open gettext),
68dnl but we keep it in order not to force irrelevant filename changes on the
69dnl maintainers.
70dnl
71AC_DEFUN([AM_GNU_GETTEXT],
72[
73 dnl Argument checking.
74 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
75 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
76])])])])])
77 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
78 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
79])])])])
80 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
81 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
82
83 AC_REQUIRE([AM_PO_SUBDIRS])dnl
84 ifelse(gt_included_intl, yes, [
85 AC_REQUIRE([AM_INTL_SUBDIR])dnl
86 ])
87
88 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
89 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
90 AC_REQUIRE([AC_LIB_RPATH])
91
92 dnl Sometimes libintl requires libiconv, so first search for libiconv.
93 dnl Ideally we would do this search only after the
94 dnl if test "$USE_NLS" = "yes"; then
95 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
96 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
97 dnl the configure script would need to contain the same shell code
98 dnl again, outside any 'if'. There are two solutions:
99 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
100 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
101 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
102 dnl documented, we avoid it.
103 ifelse(gt_included_intl, yes, , [
104 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
105 ])
106
107 dnl Set USE_NLS.
108 AM_NLS
109
110 ifelse(gt_included_intl, yes, [
111 BUILD_INCLUDED_LIBINTL=no
112 USE_INCLUDED_LIBINTL=no
113 ])
114 LIBINTL=
115 LTLIBINTL=
116 POSUB=
117
118 dnl If we use NLS figure out what method
119 if test "$USE_NLS" = "yes"; then
120 gt_use_preinstalled_gnugettext=no
121 ifelse(gt_included_intl, yes, [
122 AC_MSG_CHECKING([whether included gettext is requested])
123 AC_ARG_WITH(included-gettext,
124 [ --with-included-gettext use the GNU gettext library included here],
125 nls_cv_force_use_gnu_gettext=$withval,
126 nls_cv_force_use_gnu_gettext=no)
127 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
128
129 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
130 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
131 ])
132 dnl User does not insist on using GNU NLS library. Figure out what
133 dnl to use. If GNU gettext is available we use this. Else we have
134 dnl to fall back to GNU NLS library.
135
136 dnl Add a version number to the cache macros.
137 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
138 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
139 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
140
141 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
142 [AC_TRY_LINK([#include <libintl.h>
143]ifelse([$2], [need-formatstring-macros],
144[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
145#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
146#endif
147changequote(,)dnl
148typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
149changequote([,])dnl
150], [])[extern int _nl_msg_cat_cntr;
151extern int *_nl_domain_bindings;],
152 [bindtextdomain ("", "");
153return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
154 gt_cv_func_gnugettext_libc=yes,
155 gt_cv_func_gnugettext_libc=no)])
156
157 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
158 dnl Sometimes libintl requires libiconv, so first search for libiconv.
159 ifelse(gt_included_intl, yes, , [
160 AM_ICONV_LINK
161 ])
162 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
163 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
164 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
165 dnl even if libiconv doesn't exist.
166 AC_LIB_LINKFLAGS_BODY([intl])
167 AC_CACHE_CHECK([for GNU gettext in libintl],
168 gt_cv_func_gnugettext_libintl,
169 [gt_save_CPPFLAGS="$CPPFLAGS"
170 CPPFLAGS="$CPPFLAGS $INCINTL"
171 gt_save_LIBS="$LIBS"
172 LIBS="$LIBS $LIBINTL"
173 dnl Now see whether libintl exists and does not depend on libiconv.
174 AC_TRY_LINK([#include <libintl.h>
175]ifelse([$2], [need-formatstring-macros],
176[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
177#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
178#endif
179changequote(,)dnl
180typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
181changequote([,])dnl
182], [])[extern int _nl_msg_cat_cntr;
183extern
184#ifdef __cplusplus
185"C"
186#endif
187const char *_nl_expand_alias ();],
188 [bindtextdomain ("", "");
189return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
190 gt_cv_func_gnugettext_libintl=yes,
191 gt_cv_func_gnugettext_libintl=no)
192 dnl Now see whether libintl exists and depends on libiconv.
193 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
194 LIBS="$LIBS $LIBICONV"
195 AC_TRY_LINK([#include <libintl.h>
196]ifelse([$2], [need-formatstring-macros],
197[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
198#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
199#endif
200changequote(,)dnl
201typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
202changequote([,])dnl
203], [])[extern int _nl_msg_cat_cntr;
204extern
205#ifdef __cplusplus
206"C"
207#endif
208const char *_nl_expand_alias ();],
209 [bindtextdomain ("", "");
210return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
211 [LIBINTL="$LIBINTL $LIBICONV"
212 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
213 gt_cv_func_gnugettext_libintl=yes
214 ])
215 fi
216 CPPFLAGS="$gt_save_CPPFLAGS"
217 LIBS="$gt_save_LIBS"])
218 fi
219
220 dnl If an already present or preinstalled GNU gettext() is found,
221 dnl use it. But if this macro is used in GNU gettext, and GNU
222 dnl gettext is already preinstalled in libintl, we update this
223 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
224 if test "$gt_cv_func_gnugettext_libc" = "yes" \
225 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
226 && test "$PACKAGE" != gettext-runtime \
227 && test "$PACKAGE" != gettext-tools; }; then
228 gt_use_preinstalled_gnugettext=yes
229 else
230 dnl Reset the values set by searching for libintl.
231 LIBINTL=
232 LTLIBINTL=
233 INCINTL=
234 fi
235
236 ifelse(gt_included_intl, yes, [
237 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
238 dnl GNU gettext is not found in the C library.
239 dnl Fall back on included GNU gettext library.
240 nls_cv_use_gnu_gettext=yes
241 fi
242 fi
243
244 if test "$nls_cv_use_gnu_gettext" = "yes"; then
245 dnl Mark actions used to generate GNU NLS library.
246 BUILD_INCLUDED_LIBINTL=yes
247 USE_INCLUDED_LIBINTL=yes
248 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
249 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
250 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
251 fi
252
253 if test "$gt_use_preinstalled_gnugettext" = "yes" \
254 || test "$nls_cv_use_gnu_gettext" = "yes"; then
255 dnl Mark actions to use GNU gettext tools.
256 CATOBJEXT=.gmo
257 fi
258 ])
259
260 if test "$gt_use_preinstalled_gnugettext" = "yes" \
261 || test "$nls_cv_use_gnu_gettext" = "yes"; then
262 AC_DEFINE(ENABLE_NLS, 1,
263 [Define to 1 if translation of program messages to the user's native language
264 is requested.])
265 else
266 USE_NLS=no
267 fi
268 fi
269
270 AC_MSG_CHECKING([whether to use NLS])
271 AC_MSG_RESULT([$USE_NLS])
272 if test "$USE_NLS" = "yes"; then
273 AC_MSG_CHECKING([where the gettext function comes from])
274 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
275 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
276 gt_source="external libintl"
277 else
278 gt_source="libc"
279 fi
280 else
281 gt_source="included intl directory"
282 fi
283 AC_MSG_RESULT([$gt_source])
284 fi
285
286 if test "$USE_NLS" = "yes"; then
287
288 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
289 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
290 AC_MSG_CHECKING([how to link with libintl])
291 AC_MSG_RESULT([$LIBINTL])
292 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
293 fi
294
295 dnl For backward compatibility. Some packages may be using this.
296 AC_DEFINE(HAVE_GETTEXT, 1,
297 [Define if the GNU gettext() function is already present or preinstalled.])
298 AC_DEFINE(HAVE_DCGETTEXT, 1,
299 [Define if the GNU dcgettext() function is already present or preinstalled.])
300 fi
301
302 dnl We need to process the po/ directory.
303 POSUB=po
304 fi
305
306 ifelse(gt_included_intl, yes, [
307 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
308 dnl to 'yes' because some of the testsuite requires it.
309 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
310 BUILD_INCLUDED_LIBINTL=yes
311 fi
312
313 dnl Make all variables we use known to autoconf.
314 AC_SUBST(BUILD_INCLUDED_LIBINTL)
315 AC_SUBST(USE_INCLUDED_LIBINTL)
316 AC_SUBST(CATOBJEXT)
317
318 dnl For backward compatibility. Some configure.ins may be using this.
319 nls_cv_header_intl=
320 nls_cv_header_libgt=
321
322 dnl For backward compatibility. Some Makefiles may be using this.
323 DATADIRNAME=share
324 AC_SUBST(DATADIRNAME)
325
326 dnl For backward compatibility. Some Makefiles may be using this.
327 INSTOBJEXT=.mo
328 AC_SUBST(INSTOBJEXT)
329
330 dnl For backward compatibility. Some Makefiles may be using this.
331 GENCAT=gencat
332 AC_SUBST(GENCAT)
333
334 dnl For backward compatibility. Some Makefiles may be using this.
335 if test "$USE_INCLUDED_LIBINTL" = yes; then
336 INTLOBJS="\$(GETTOBJS)"
337 fi
338 AC_SUBST(INTLOBJS)
339
340 dnl Enable libtool support if the surrounding package wishes it.
341 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
342 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
343 ])
344
345 dnl For backward compatibility. Some Makefiles may be using this.
346 INTLLIBS="$LIBINTL"
347 AC_SUBST(INTLLIBS)
348
349 dnl Make all documented variables known to autoconf.
350 AC_SUBST(LIBINTL)
351 AC_SUBST(LTLIBINTL)
352 AC_SUBST(POSUB)
353])
354
355
356dnl Checks for all prerequisites of the intl subdirectory,
357dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
358dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
359AC_DEFUN([AM_INTL_SUBDIR],
360[
361 AC_REQUIRE([AC_PROG_INSTALL])dnl
362 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
363 AC_REQUIRE([AC_PROG_CC])dnl
364 AC_REQUIRE([AC_CANONICAL_HOST])dnl
365 AC_REQUIRE([AC_PROG_RANLIB])dnl
366 AC_REQUIRE([AC_ISC_POSIX])dnl
367 AC_REQUIRE([AC_HEADER_STDC])dnl
368 AC_REQUIRE([AC_C_CONST])dnl
369 AC_REQUIRE([AC_C_INLINE])dnl
370 AC_REQUIRE([AC_TYPE_OFF_T])dnl
371 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
372 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
373 AC_REQUIRE([AC_FUNC_MMAP])dnl
374 AC_REQUIRE([jm_GLIBC21])dnl
375 AC_REQUIRE([gt_INTDIV0])dnl
376 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
377 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
378 AC_REQUIRE([gt_INTTYPES_PRI])dnl
379
380 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
381stdlib.h string.h unistd.h sys/param.h])
382 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
383geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
384strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
385__fsetlocking])
386
387 AM_ICONV
388 AM_LANGINFO_CODESET
389 if test $ac_cv_header_locale_h = yes; then
390 AM_LC_MESSAGES
391 fi
392
393 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
394 dnl because plural.y uses bison specific features. It requires at least
395 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
396 dnl compile.
397 dnl bison is only needed for the maintainer (who touches plural.y). But in
398 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
399 dnl the rule in general Makefile. Now, some people carelessly touch the
400 dnl files or have a broken "make" program, hence the plural.c rule will
401 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
402 dnl present or too old.
403 AC_CHECK_PROGS([INTLBISON], [bison])
404 if test -z "$INTLBISON"; then
405 ac_verc_fail=yes
406 else
407 dnl Found it, now check the version.
408 AC_MSG_CHECKING([version of bison])
409changequote(<<,>>)dnl
410 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
411 case $ac_prog_version in
412 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
413 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
414changequote([,])dnl
415 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
416 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
417 esac
418 AC_MSG_RESULT([$ac_prog_version])
419 fi
420 if test $ac_verc_fail = yes; then
421 INTLBISON=:
422 fi
423])
424
425
426dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
427AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
428
429# po.m4 serial 1 (gettext-0.12)
430dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
431dnl This file is free software, distributed under the terms of the GNU
432dnl General Public License. As a special exception to the GNU General
433dnl Public License, this file may be distributed as part of a program
434dnl that contains a configuration script generated by Autoconf, under
435dnl the same distribution terms as the rest of that program.
436dnl
437dnl This file can can be used in projects which are not available under
438dnl the GNU General Public License or the GNU Library General Public
439dnl License but which still want to provide support for the GNU gettext
440dnl functionality.
441dnl Please note that the actual code of the GNU gettext library is covered
442dnl by the GNU Library General Public License, and the rest of the GNU
443dnl gettext package package is covered by the GNU General Public License.
444dnl They are *not* in the public domain.
445
446dnl Authors:
447dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
448dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
449
450dnl Checks for all prerequisites of the po subdirectory.
451AC_DEFUN([AM_PO_SUBDIRS],
452[
453 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
454 AC_REQUIRE([AC_PROG_INSTALL])dnl
455 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
456 AC_REQUIRE([AM_NLS])dnl
457
458 dnl Perform the following tests also if --disable-nls has been given,
459 dnl because they are needed for "make dist" to work.
460
461 dnl Search for GNU msgfmt in the PATH.
462 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
463 dnl The second test excludes FreeBSD msgfmt.
464 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
465 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
466 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
467 :)
468 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
469
470 dnl Search for GNU xgettext 0.12 or newer in the PATH.
471 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
472 dnl The second test excludes FreeBSD xgettext.
473 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
474 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
475 (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
476 :)
477 dnl Remove leftover from FreeBSD xgettext call.
478 rm -f messages.po
479
480 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
481 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
482 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
483
484 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
485 dnl Test whether we really found GNU msgfmt.
486 if test "$GMSGFMT" != ":"; then
487 dnl If it is no GNU msgfmt we define it as : so that the
488 dnl Makefiles still can work.
489 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
490 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
491 : ;
492 else
493 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
494 AC_MSG_RESULT(
495 [found $GMSGFMT program is not GNU msgfmt; ignore it])
496 GMSGFMT=":"
497 fi
498 fi
499
500 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
501 dnl Test whether we really found GNU xgettext.
502 if test "$XGETTEXT" != ":"; then
503 dnl If it is no GNU xgettext we define it as : so that the
504 dnl Makefiles still can work.
505 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
506 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
507 : ;
508 else
509 AC_MSG_RESULT(
510 [found xgettext program is not GNU xgettext; ignore it])
511 XGETTEXT=":"
512 fi
513 dnl Remove leftover from FreeBSD xgettext call.
514 rm -f messages.po
515 fi
516
517 AC_OUTPUT_COMMANDS([
518 for ac_file in $CONFIG_FILES; do
519 # Support "outfile[:infile[:infile...]]"
520 case "$ac_file" in
521 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
522 esac
523 # PO directories have a Makefile.in generated from Makefile.in.in.
524 case "$ac_file" in */Makefile.in)
525 # Adjust a relative srcdir.
526 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
527 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
528 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
529 # In autoconf-2.13 it is called $ac_given_srcdir.
530 # In autoconf-2.50 it is called $srcdir.
531 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
532 case "$ac_given_srcdir" in
533 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
534 /*) top_srcdir="$ac_given_srcdir" ;;
535 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
536 esac
537 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
538 rm -f "$ac_dir/POTFILES"
539 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
540 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
541 POMAKEFILEDEPS="POTFILES.in"
542 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
543 # on $ac_dir but don't depend on user-specified configuration
544 # parameters.
545 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
546 # The LINGUAS file contains the set of available languages.
547 if test -n "$OBSOLETE_ALL_LINGUAS"; then
548 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
549 fi
550 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
551 # Hide the ALL_LINGUAS assigment from automake.
552 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
553 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
554 else
555 # The set of available languages was given in configure.in.
556 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
557 fi
558 case "$ac_given_srcdir" in
559 .) srcdirpre= ;;
560 *) srcdirpre='$(srcdir)/' ;;
561 esac
562 POFILES=
563 GMOFILES=
564 UPDATEPOFILES=
565 DUMMYPOFILES=
566 for lang in $ALL_LINGUAS; do
567 POFILES="$POFILES $srcdirpre$lang.po"
568 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
569 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
570 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
571 done
572 # CATALOGS depends on both $ac_dir and the user's LINGUAS
573 # environment variable.
574 INST_LINGUAS=
575 if test -n "$ALL_LINGUAS"; then
576 for presentlang in $ALL_LINGUAS; do
577 useit=no
578 if test "%UNSET%" != "$LINGUAS"; then
579 desiredlanguages="$LINGUAS"
580 else
581 desiredlanguages="$ALL_LINGUAS"
582 fi
583 for desiredlang in $desiredlanguages; do
584 # Use the presentlang catalog if desiredlang is
585 # a. equal to presentlang, or
586 # b. a variant of presentlang (because in this case,
587 # presentlang can be used as a fallback for messages
588 # which are not translated in the desiredlang catalog).
589 case "$desiredlang" in
590 "$presentlang"*) useit=yes;;
591 esac
592 done
593 if test $useit = yes; then
594 INST_LINGUAS="$INST_LINGUAS $presentlang"
595 fi
596 done
597 fi
598 CATALOGS=
599 if test -n "$INST_LINGUAS"; then
600 for lang in $INST_LINGUAS; do
601 CATALOGS="$CATALOGS $lang.gmo"
602 done
603 fi
604 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
605 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" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
606 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
607 if test -f "$f"; then
608 case "$f" in
609 *.orig | *.bak | *~) ;;
610 *) cat "$f" >> "$ac_dir/Makefile" ;;
611 esac
612 fi
613 done
614 fi
615 ;;
616 esac
617 done],
618 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
619 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
620 # from automake.
621 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
622 # Capture the value of LINGUAS because we need it to compute CATALOGS.
623 LINGUAS="${LINGUAS-%UNSET%}"
624 ])
625])
626
627# nls.m4 serial 1 (gettext-0.12)
628dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
629dnl This file is free software, distributed under the terms of the GNU
630dnl General Public License. As a special exception to the GNU General
631dnl Public License, this file may be distributed as part of a program
632dnl that contains a configuration script generated by Autoconf, under
633dnl the same distribution terms as the rest of that program.
634dnl
635dnl This file can can be used in projects which are not available under
636dnl the GNU General Public License or the GNU Library General Public
637dnl License but which still want to provide support for the GNU gettext
638dnl functionality.
639dnl Please note that the actual code of the GNU gettext library is covered
640dnl by the GNU Library General Public License, and the rest of the GNU
641dnl gettext package package is covered by the GNU General Public License.
642dnl They are *not* in the public domain.
643
644dnl Authors:
645dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
646dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
647
648AC_DEFUN([AM_NLS],
649[
650 AC_MSG_CHECKING([whether NLS is requested])
651 dnl Default is enabled NLS
652 AC_ARG_ENABLE(nls,
653 [ --disable-nls do not use Native Language Support],
654 USE_NLS=$enableval, USE_NLS=yes)
655 AC_MSG_RESULT($USE_NLS)
656 AC_SUBST(USE_NLS)
657])
658
659AC_DEFUN([AM_MKINSTALLDIRS],
660[
661 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
662 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
663 dnl Try to locate it.
664 MKINSTALLDIRS=
665 if test -n "$ac_aux_dir"; then
666 case "$ac_aux_dir" in
667 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
668 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
669 esac
670 fi
671 if test -z "$MKINSTALLDIRS"; then
672 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
673 fi
674 AC_SUBST(MKINSTALLDIRS)
675])
676
56694dd9 677sinclude(../config/progtest.m4)
6eb95e99
ZW
678
679# lib-link.m4 serial 4 (gettext-0.12)
680dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
681dnl This file is free software, distributed under the terms of the GNU
682dnl General Public License. As a special exception to the GNU General
683dnl Public License, this file may be distributed as part of a program
684dnl that contains a configuration script generated by Autoconf, under
685dnl the same distribution terms as the rest of that program.
686
687dnl From Bruno Haible.
688
689dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
690dnl the libraries corresponding to explicit and implicit dependencies.
691dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
692dnl augments the CPPFLAGS variable.
693AC_DEFUN([AC_LIB_LINKFLAGS],
694[
695 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
696 AC_REQUIRE([AC_LIB_RPATH])
697 define([Name],[translit([$1],[./-], [___])])
698 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
699 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
700 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
701 AC_LIB_LINKFLAGS_BODY([$1], [$2])
702 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
703 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
704 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
705 ])
706 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
707 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
708 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
709 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
710 AC_SUBST([LIB]NAME)
711 AC_SUBST([LTLIB]NAME)
712 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
713 dnl results of this search when this library appears as a dependency.
714 HAVE_LIB[]NAME=yes
715 undefine([Name])
716 undefine([NAME])
717])
718
719dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
720dnl searches for libname and the libraries corresponding to explicit and
721dnl implicit dependencies, together with the specified include files and
722dnl the ability to compile and link the specified testcode. If found, it
723dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
724dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
725dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
726dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
727AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
728[
729 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
730 AC_REQUIRE([AC_LIB_RPATH])
731 define([Name],[translit([$1],[./-], [___])])
732 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
733 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
734
735 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
736 dnl accordingly.
737 AC_LIB_LINKFLAGS_BODY([$1], [$2])
738
739 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
740 dnl because if the user has installed lib[]Name and not disabled its use
741 dnl via --without-lib[]Name-prefix, he wants to use it.
742 ac_save_CPPFLAGS="$CPPFLAGS"
743 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
744
745 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
746 ac_save_LIBS="$LIBS"
747 LIBS="$LIBS $LIB[]NAME"
748 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
749 LIBS="$ac_save_LIBS"
750 ])
751 if test "$ac_cv_lib[]Name" = yes; then
752 HAVE_LIB[]NAME=yes
753 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
754 AC_MSG_CHECKING([how to link with lib[]$1])
755 AC_MSG_RESULT([$LIB[]NAME])
756 else
757 HAVE_LIB[]NAME=no
758 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
759 dnl $INC[]NAME either.
760 CPPFLAGS="$ac_save_CPPFLAGS"
761 LIB[]NAME=
762 LTLIB[]NAME=
763 fi
764 AC_SUBST([HAVE_LIB]NAME)
765 AC_SUBST([LIB]NAME)
766 AC_SUBST([LTLIB]NAME)
767 undefine([Name])
768 undefine([NAME])
769])
770
771dnl Determine the platform dependent parameters needed to use rpath:
772dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
773dnl hardcode_direct, hardcode_minus_L.
774AC_DEFUN([AC_LIB_RPATH],
775[
776 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
777 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
778 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
779 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
780 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
781 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
782 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
783 . ./conftest.sh
784 rm -f ./conftest.sh
785 acl_cv_rpath=done
786 ])
787 wl="$acl_cv_wl"
788 libext="$acl_cv_libext"
789 shlibext="$acl_cv_shlibext"
790 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
791 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
792 hardcode_direct="$acl_cv_hardcode_direct"
793 hardcode_minus_L="$acl_cv_hardcode_minus_L"
794 dnl Determine whether the user wants rpath handling at all.
795 AC_ARG_ENABLE(rpath,
796 [ --disable-rpath do not hardcode runtime library paths],
797 :, enable_rpath=yes)
798])
799
800dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
801dnl the libraries corresponding to explicit and implicit dependencies.
802dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
803AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
804[
805 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
806 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
807 dnl By default, look in $includedir and $libdir.
808 use_additional=yes
809 AC_LIB_WITH_FINAL_PREFIX([
810 eval additional_includedir=\"$includedir\"
811 eval additional_libdir=\"$libdir\"
812 ])
813 AC_LIB_ARG_WITH([lib$1-prefix],
814[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
815 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
816[
817 if test "X$withval" = "Xno"; then
818 use_additional=no
819 else
820 if test "X$withval" = "X"; then
821 AC_LIB_WITH_FINAL_PREFIX([
822 eval additional_includedir=\"$includedir\"
823 eval additional_libdir=\"$libdir\"
824 ])
825 else
826 additional_includedir="$withval/include"
827 additional_libdir="$withval/lib"
828 fi
829 fi
830])
831 dnl Search the library and its dependencies in $additional_libdir and
832 dnl $LDFLAGS. Using breadth-first-seach.
833 LIB[]NAME=
834 LTLIB[]NAME=
835 INC[]NAME=
836 rpathdirs=
837 ltrpathdirs=
838 names_already_handled=
839 names_next_round='$1 $2'
840 while test -n "$names_next_round"; do
841 names_this_round="$names_next_round"
842 names_next_round=
843 for name in $names_this_round; do
844 already_handled=
845 for n in $names_already_handled; do
846 if test "$n" = "$name"; then
847 already_handled=yes
848 break
849 fi
850 done
851 if test -z "$already_handled"; then
852 names_already_handled="$names_already_handled $name"
853 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
854 dnl or AC_LIB_HAVE_LINKFLAGS call.
855 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
856 eval value=\"\$HAVE_LIB$uppername\"
857 if test -n "$value"; then
858 if test "$value" = yes; then
859 eval value=\"\$LIB$uppername\"
860 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
861 eval value=\"\$LTLIB$uppername\"
862 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
863 else
864 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
865 dnl that this library doesn't exist. So just drop it.
866 :
867 fi
868 else
869 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
870 dnl and the already constructed $LIBNAME/$LTLIBNAME.
871 found_dir=
872 found_la=
873 found_so=
874 found_a=
875 if test $use_additional = yes; then
876 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
877 found_dir="$additional_libdir"
878 found_so="$additional_libdir/lib$name.$shlibext"
879 if test -f "$additional_libdir/lib$name.la"; then
880 found_la="$additional_libdir/lib$name.la"
881 fi
882 else
883 if test -f "$additional_libdir/lib$name.$libext"; then
884 found_dir="$additional_libdir"
885 found_a="$additional_libdir/lib$name.$libext"
886 if test -f "$additional_libdir/lib$name.la"; then
887 found_la="$additional_libdir/lib$name.la"
888 fi
889 fi
890 fi
891 fi
892 if test "X$found_dir" = "X"; then
893 for x in $LDFLAGS $LTLIB[]NAME; do
894 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
895 case "$x" in
896 -L*)
897 dir=`echo "X$x" | sed -e 's/^X-L//'`
898 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
899 found_dir="$dir"
900 found_so="$dir/lib$name.$shlibext"
901 if test -f "$dir/lib$name.la"; then
902 found_la="$dir/lib$name.la"
903 fi
904 else
905 if test -f "$dir/lib$name.$libext"; then
906 found_dir="$dir"
907 found_a="$dir/lib$name.$libext"
908 if test -f "$dir/lib$name.la"; then
909 found_la="$dir/lib$name.la"
910 fi
911 fi
912 fi
913 ;;
914 esac
915 if test "X$found_dir" != "X"; then
916 break
917 fi
918 done
919 fi
920 if test "X$found_dir" != "X"; then
921 dnl Found the library.
922 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
923 if test "X$found_so" != "X"; then
924 dnl Linking with a shared library. We attempt to hardcode its
925 dnl directory into the executable's runpath, unless it's the
926 dnl standard /usr/lib.
927 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
928 dnl No hardcoding is needed.
929 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
930 else
931 dnl Use an explicit option to hardcode DIR into the resulting
932 dnl binary.
933 dnl Potentially add DIR to ltrpathdirs.
934 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
935 haveit=
936 for x in $ltrpathdirs; do
937 if test "X$x" = "X$found_dir"; then
938 haveit=yes
939 break
940 fi
941 done
942 if test -z "$haveit"; then
943 ltrpathdirs="$ltrpathdirs $found_dir"
944 fi
945 dnl The hardcoding into $LIBNAME is system dependent.
946 if test "$hardcode_direct" = yes; then
947 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
948 dnl resulting binary.
949 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
950 else
951 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
952 dnl Use an explicit option to hardcode DIR into the resulting
953 dnl binary.
954 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
955 dnl Potentially add DIR to rpathdirs.
956 dnl The rpathdirs will be appended to $LIBNAME at the end.
957 haveit=
958 for x in $rpathdirs; do
959 if test "X$x" = "X$found_dir"; then
960 haveit=yes
961 break
962 fi
963 done
964 if test -z "$haveit"; then
965 rpathdirs="$rpathdirs $found_dir"
966 fi
967 else
968 dnl Rely on "-L$found_dir".
969 dnl But don't add it if it's already contained in the LDFLAGS
970 dnl or the already constructed $LIBNAME
971 haveit=
972 for x in $LDFLAGS $LIB[]NAME; do
973 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
974 if test "X$x" = "X-L$found_dir"; then
975 haveit=yes
976 break
977 fi
978 done
979 if test -z "$haveit"; then
980 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
981 fi
982 if test "$hardcode_minus_L" != no; then
983 dnl FIXME: Not sure whether we should use
984 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
985 dnl here.
986 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
987 else
988 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
989 dnl here, because this doesn't fit in flags passed to the
990 dnl compiler. So give up. No hardcoding. This affects only
991 dnl very old systems.
992 dnl FIXME: Not sure whether we should use
993 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
994 dnl here.
995 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
996 fi
997 fi
998 fi
999 fi
1000 else
1001 if test "X$found_a" != "X"; then
1002 dnl Linking with a static library.
1003 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1004 else
1005 dnl We shouldn't come here, but anyway it's good to have a
1006 dnl fallback.
1007 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1008 fi
1009 fi
1010 dnl Assume the include files are nearby.
1011 additional_includedir=
1012 case "$found_dir" in
1013 */lib | */lib/)
1014 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1015 additional_includedir="$basedir/include"
1016 ;;
1017 esac
1018 if test "X$additional_includedir" != "X"; then
1019 dnl Potentially add $additional_includedir to $INCNAME.
1020 dnl But don't add it
1021 dnl 1. if it's the standard /usr/include,
1022 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1023 dnl 3. if it's already present in $CPPFLAGS or the already
1024 dnl constructed $INCNAME,
1025 dnl 4. if it doesn't exist as a directory.
1026 if test "X$additional_includedir" != "X/usr/include"; then
1027 haveit=
1028 if test "X$additional_includedir" = "X/usr/local/include"; then
1029 if test -n "$GCC"; then
1030 case $host_os in
1031 linux*) haveit=yes;;
1032 esac
1033 fi
1034 fi
1035 if test -z "$haveit"; then
1036 for x in $CPPFLAGS $INC[]NAME; do
1037 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1038 if test "X$x" = "X-I$additional_includedir"; then
1039 haveit=yes
1040 break
1041 fi
1042 done
1043 if test -z "$haveit"; then
1044 if test -d "$additional_includedir"; then
1045 dnl Really add $additional_includedir to $INCNAME.
1046 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1047 fi
1048 fi
1049 fi
1050 fi
1051 fi
1052 dnl Look for dependencies.
1053 if test -n "$found_la"; then
1054 dnl Read the .la file. It defines the variables
1055 dnl dlname, library_names, old_library, dependency_libs, current,
1056 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1057 save_libdir="$libdir"
1058 case "$found_la" in
1059 */* | *\\*) . "$found_la" ;;
1060 *) . "./$found_la" ;;
1061 esac
1062 libdir="$save_libdir"
1063 dnl We use only dependency_libs.
1064 for dep in $dependency_libs; do
1065 case "$dep" in
1066 -L*)
1067 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1068 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1069 dnl But don't add it
1070 dnl 1. if it's the standard /usr/lib,
1071 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1072 dnl 3. if it's already present in $LDFLAGS or the already
1073 dnl constructed $LIBNAME,
1074 dnl 4. if it doesn't exist as a directory.
1075 if test "X$additional_libdir" != "X/usr/lib"; then
1076 haveit=
1077 if test "X$additional_libdir" = "X/usr/local/lib"; then
1078 if test -n "$GCC"; then
1079 case $host_os in
1080 linux*) haveit=yes;;
1081 esac
1082 fi
1083 fi
1084 if test -z "$haveit"; then
1085 haveit=
1086 for x in $LDFLAGS $LIB[]NAME; do
1087 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1088 if test "X$x" = "X-L$additional_libdir"; then
1089 haveit=yes
1090 break
1091 fi
1092 done
1093 if test -z "$haveit"; then
1094 if test -d "$additional_libdir"; then
1095 dnl Really add $additional_libdir to $LIBNAME.
1096 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1097 fi
1098 fi
1099 haveit=
1100 for x in $LDFLAGS $LTLIB[]NAME; do
1101 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1102 if test "X$x" = "X-L$additional_libdir"; then
1103 haveit=yes
1104 break
1105 fi
1106 done
1107 if test -z "$haveit"; then
1108 if test -d "$additional_libdir"; then
1109 dnl Really add $additional_libdir to $LTLIBNAME.
1110 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1111 fi
1112 fi
1113 fi
1114 fi
1115 ;;
1116 -R*)
1117 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1118 if test "$enable_rpath" != no; then
1119 dnl Potentially add DIR to rpathdirs.
1120 dnl The rpathdirs will be appended to $LIBNAME at the end.
1121 haveit=
1122 for x in $rpathdirs; do
1123 if test "X$x" = "X$dir"; then
1124 haveit=yes
1125 break
1126 fi
1127 done
1128 if test -z "$haveit"; then
1129 rpathdirs="$rpathdirs $dir"
1130 fi
1131 dnl Potentially add DIR to ltrpathdirs.
1132 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1133 haveit=
1134 for x in $ltrpathdirs; do
1135 if test "X$x" = "X$dir"; then
1136 haveit=yes
1137 break
1138 fi
1139 done
1140 if test -z "$haveit"; then
1141 ltrpathdirs="$ltrpathdirs $dir"
1142 fi
1143 fi
1144 ;;
1145 -l*)
1146 dnl Handle this in the next round.
1147 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1148 ;;
1149 *.la)
1150 dnl Handle this in the next round. Throw away the .la's
1151 dnl directory; it is already contained in a preceding -L
1152 dnl option.
1153 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1154 ;;
1155 *)
1156 dnl Most likely an immediate library name.
1157 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1158 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1159 ;;
1160 esac
1161 done
1162 fi
1163 else
1164 dnl Didn't find the library; assume it is in the system directories
1165 dnl known to the linker and runtime loader. (All the system
1166 dnl directories known to the linker should also be known to the
1167 dnl runtime loader, otherwise the system is severely misconfigured.)
1168 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1169 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1170 fi
1171 fi
1172 fi
1173 done
1174 done
1175 if test "X$rpathdirs" != "X"; then
1176 if test -n "$hardcode_libdir_separator"; then
1177 dnl Weird platform: only the last -rpath option counts, the user must
1178 dnl pass all path elements in one option. We can arrange that for a
1179 dnl single library, but not when more than one $LIBNAMEs are used.
1180 alldirs=
1181 for found_dir in $rpathdirs; do
1182 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1183 done
1184 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1185 acl_save_libdir="$libdir"
1186 libdir="$alldirs"
1187 eval flag=\"$hardcode_libdir_flag_spec\"
1188 libdir="$acl_save_libdir"
1189 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1190 else
1191 dnl The -rpath options are cumulative.
1192 for found_dir in $rpathdirs; do
1193 acl_save_libdir="$libdir"
1194 libdir="$found_dir"
1195 eval flag=\"$hardcode_libdir_flag_spec\"
1196 libdir="$acl_save_libdir"
1197 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1198 done
1199 fi
1200 fi
1201 if test "X$ltrpathdirs" != "X"; then
1202 dnl When using libtool, the option that works for both libraries and
1203 dnl executables is -R. The -R options are cumulative.
1204 for found_dir in $ltrpathdirs; do
1205 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1206 done
1207 fi
1208])
1209
1210dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1211dnl unless already present in VAR.
1212dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1213dnl contains two or three consecutive elements that belong together.
1214AC_DEFUN([AC_LIB_APPENDTOVAR],
1215[
1216 for element in [$2]; do
1217 haveit=
1218 for x in $[$1]; do
1219 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1220 if test "X$x" = "X$element"; then
1221 haveit=yes
1222 break
1223 fi
1224 done
1225 if test -z "$haveit"; then
1226 [$1]="${[$1]}${[$1]:+ }$element"
1227 fi
1228 done
1229])
1230
1231# lib-prefix.m4 serial 2 (gettext-0.12)
1232dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1233dnl This file is free software, distributed under the terms of the GNU
1234dnl General Public License. As a special exception to the GNU General
1235dnl Public License, this file may be distributed as part of a program
1236dnl that contains a configuration script generated by Autoconf, under
1237dnl the same distribution terms as the rest of that program.
1238
1239dnl From Bruno Haible.
1240
1241dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1242dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1243dnl require excessive bracketing.
1244ifdef([AC_HELP_STRING],
1245[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1246[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1247
1248dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1249dnl to access previously installed libraries. The basic assumption is that
1250dnl a user will want packages to use other packages he previously installed
1251dnl with the same --prefix option.
1252dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1253dnl libraries, but is otherwise very convenient.
1254AC_DEFUN([AC_LIB_PREFIX],
1255[
1256 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1257 AC_REQUIRE([AC_PROG_CC])
1258 AC_REQUIRE([AC_CANONICAL_HOST])
1259 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1260 dnl By default, look in $includedir and $libdir.
1261 use_additional=yes
1262 AC_LIB_WITH_FINAL_PREFIX([
1263 eval additional_includedir=\"$includedir\"
1264 eval additional_libdir=\"$libdir\"
1265 ])
1266 AC_LIB_ARG_WITH([lib-prefix],
1267[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1268 --without-lib-prefix don't search for libraries in includedir and libdir],
1269[
1270 if test "X$withval" = "Xno"; then
1271 use_additional=no
1272 else
1273 if test "X$withval" = "X"; then
1274 AC_LIB_WITH_FINAL_PREFIX([
1275 eval additional_includedir=\"$includedir\"
1276 eval additional_libdir=\"$libdir\"
1277 ])
1278 else
1279 additional_includedir="$withval/include"
1280 additional_libdir="$withval/lib"
1281 fi
1282 fi
1283])
1284 if test $use_additional = yes; then
1285 dnl Potentially add $additional_includedir to $CPPFLAGS.
1286 dnl But don't add it
1287 dnl 1. if it's the standard /usr/include,
1288 dnl 2. if it's already present in $CPPFLAGS,
1289 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1290 dnl 4. if it doesn't exist as a directory.
1291 if test "X$additional_includedir" != "X/usr/include"; then
1292 haveit=
1293 for x in $CPPFLAGS; do
1294 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1295 if test "X$x" = "X-I$additional_includedir"; then
1296 haveit=yes
1297 break
1298 fi
1299 done
1300 if test -z "$haveit"; then
1301 if test "X$additional_includedir" = "X/usr/local/include"; then
1302 if test -n "$GCC"; then
1303 case $host_os in
1304 linux*) haveit=yes;;
1305 esac
1306 fi
1307 fi
1308 if test -z "$haveit"; then
1309 if test -d "$additional_includedir"; then
1310 dnl Really add $additional_includedir to $CPPFLAGS.
1311 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1312 fi
1313 fi
1314 fi
1315 fi
1316 dnl Potentially add $additional_libdir to $LDFLAGS.
1317 dnl But don't add it
1318 dnl 1. if it's the standard /usr/lib,
1319 dnl 2. if it's already present in $LDFLAGS,
1320 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1321 dnl 4. if it doesn't exist as a directory.
1322 if test "X$additional_libdir" != "X/usr/lib"; then
1323 haveit=
1324 for x in $LDFLAGS; do
1325 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1326 if test "X$x" = "X-L$additional_libdir"; then
1327 haveit=yes
1328 break
1329 fi
1330 done
1331 if test -z "$haveit"; then
1332 if test "X$additional_libdir" = "X/usr/local/lib"; then
1333 if test -n "$GCC"; then
1334 case $host_os in
1335 linux*) haveit=yes;;
1336 esac
1337 fi
1338 fi
1339 if test -z "$haveit"; then
1340 if test -d "$additional_libdir"; then
1341 dnl Really add $additional_libdir to $LDFLAGS.
1342 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1343 fi
1344 fi
1345 fi
1346 fi
1347 fi
1348])
1349
1350dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1351dnl acl_final_exec_prefix, containing the values to which $prefix and
1352dnl $exec_prefix will expand at the end of the configure script.
1353AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1354[
1355 dnl Unfortunately, prefix and exec_prefix get only finally determined
1356 dnl at the end of configure.
1357 if test "X$prefix" = "XNONE"; then
1358 acl_final_prefix="$ac_default_prefix"
1359 else
1360 acl_final_prefix="$prefix"
1361 fi
1362 if test "X$exec_prefix" = "XNONE"; then
1363 acl_final_exec_prefix='${prefix}'
1364 else
1365 acl_final_exec_prefix="$exec_prefix"
1366 fi
1367 acl_save_prefix="$prefix"
1368 prefix="$acl_final_prefix"
1369 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1370 prefix="$acl_save_prefix"
1371])
1372
1373dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1374dnl variables prefix and exec_prefix bound to the values they will have
1375dnl at the end of the configure script.
1376AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1377[
1378 acl_save_prefix="$prefix"
1379 prefix="$acl_final_prefix"
1380 acl_save_exec_prefix="$exec_prefix"
1381 exec_prefix="$acl_final_exec_prefix"
1382 $1
1383 exec_prefix="$acl_save_exec_prefix"
1384 prefix="$acl_save_prefix"
1385])
1386
1387# lib-ld.m4 serial 2 (gettext-0.12)
1388dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1389dnl This file is free software, distributed under the terms of the GNU
1390dnl General Public License. As a special exception to the GNU General
1391dnl Public License, this file may be distributed as part of a program
1392dnl that contains a configuration script generated by Autoconf, under
1393dnl the same distribution terms as the rest of that program.
1394
1395dnl Subroutines of libtool.m4,
1396dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1397dnl with libtool.m4.
1398
1399dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1400AC_DEFUN([AC_LIB_PROG_LD_GNU],
1401[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1402[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1403if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1404 acl_cv_prog_gnu_ld=yes
1405else
1406 acl_cv_prog_gnu_ld=no
1407fi])
1408with_gnu_ld=$acl_cv_prog_gnu_ld
1409])
1410
1411dnl From libtool-1.4. Sets the variable LD.
1412AC_DEFUN([AC_LIB_PROG_LD],
1413[AC_ARG_WITH(gnu-ld,
1414[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1415test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1416AC_REQUIRE([AC_PROG_CC])dnl
1417AC_REQUIRE([AC_CANONICAL_HOST])dnl
1418# Prepare PATH_SEPARATOR.
1419# The user is always right.
1420if test "${PATH_SEPARATOR+set}" != set; then
1421 echo "#! /bin/sh" >conf$$.sh
1422 echo "exit 0" >>conf$$.sh
1423 chmod +x conf$$.sh
1424 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1425 PATH_SEPARATOR=';'
1426 else
1427 PATH_SEPARATOR=:
1428 fi
1429 rm -f conf$$.sh
1430fi
1431ac_prog=ld
1432if test "$GCC" = yes; then
1433 # Check if gcc -print-prog-name=ld gives a path.
1434 AC_MSG_CHECKING([for ld used by GCC])
1435 case $host in
1436 *-*-mingw*)
1437 # gcc leaves a trailing carriage return which upsets mingw
1438 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1439 *)
1440 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1441 esac
1442 case $ac_prog in
1443 # Accept absolute paths.
1444 [[\\/]* | [A-Za-z]:[\\/]*)]
1445 [re_direlt='/[^/][^/]*/\.\./']
1446 # Canonicalize the path of ld
1447 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1448 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1449 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1450 done
1451 test -z "$LD" && LD="$ac_prog"
1452 ;;
1453 "")
1454 # If it fails, then pretend we aren't using GCC.
1455 ac_prog=ld
1456 ;;
1457 *)
1458 # If it is relative, then search for the first ld in PATH.
1459 with_gnu_ld=unknown
1460 ;;
1461 esac
1462elif test "$with_gnu_ld" = yes; then
1463 AC_MSG_CHECKING([for GNU ld])
1464else
1465 AC_MSG_CHECKING([for non-GNU ld])
1466fi
1467AC_CACHE_VAL(acl_cv_path_LD,
1468[if test -z "$LD"; then
1469 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1470 for ac_dir in $PATH; do
1471 test -z "$ac_dir" && ac_dir=.
1472 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1473 acl_cv_path_LD="$ac_dir/$ac_prog"
1474 # Check to see if the program is GNU ld. I'd rather use --version,
1475 # but apparently some GNU ld's only accept -v.
1476 # Break only if it was the GNU/non-GNU ld that we prefer.
1477 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1478 test "$with_gnu_ld" != no && break
1479 else
1480 test "$with_gnu_ld" != yes && break
1481 fi
1482 fi
1483 done
1484 IFS="$ac_save_ifs"
1485else
1486 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1487fi])
1488LD="$acl_cv_path_LD"
1489if test -n "$LD"; then
1490 AC_MSG_RESULT($LD)
1491else
1492 AC_MSG_RESULT(no)
1493fi
1494test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1495AC_LIB_PROG_LD_GNU
1496])
1497
1498# iconv.m4 serial AM4 (gettext-0.11.3)
1499dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1500dnl This file is free software, distributed under the terms of the GNU
1501dnl General Public License. As a special exception to the GNU General
1502dnl Public License, this file may be distributed as part of a program
1503dnl that contains a configuration script generated by Autoconf, under
1504dnl the same distribution terms as the rest of that program.
1505
1506dnl From Bruno Haible.
1507
1508AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1509[
1510 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1511 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1512 AC_REQUIRE([AC_LIB_RPATH])
1513
1514 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1515 dnl accordingly.
1516 AC_LIB_LINKFLAGS_BODY([iconv])
1517])
1518
1519AC_DEFUN([AM_ICONV_LINK],
1520[
1521 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1522 dnl those with the standalone portable GNU libiconv installed).
1523
1524 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1525 dnl accordingly.
1526 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1527
1528 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
1529 dnl because if the user has installed libiconv and not disabled its use
1530 dnl via --without-libiconv-prefix, he wants to use it. The first
1531 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
1532 am_save_CPPFLAGS="$CPPFLAGS"
1533 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
1534
1535 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1536 am_cv_func_iconv="no, consider installing GNU libiconv"
1537 am_cv_lib_iconv=no
1538 AC_TRY_LINK([#include <stdlib.h>
1539#include <iconv.h>],
1540 [iconv_t cd = iconv_open("","");
1541 iconv(cd,NULL,NULL,NULL,NULL);
1542 iconv_close(cd);],
1543 am_cv_func_iconv=yes)
1544 if test "$am_cv_func_iconv" != yes; then
1545 am_save_LIBS="$LIBS"
1546 LIBS="$LIBS $LIBICONV"
1547 AC_TRY_LINK([#include <stdlib.h>
1548#include <iconv.h>],
1549 [iconv_t cd = iconv_open("","");
1550 iconv(cd,NULL,NULL,NULL,NULL);
1551 iconv_close(cd);],
1552 am_cv_lib_iconv=yes
1553 am_cv_func_iconv=yes)
1554 LIBS="$am_save_LIBS"
1555 fi
1556 ])
1557 if test "$am_cv_func_iconv" = yes; then
1558 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1559 fi
1560 if test "$am_cv_lib_iconv" = yes; then
1561 AC_MSG_CHECKING([how to link with libiconv])
1562 AC_MSG_RESULT([$LIBICONV])
1563 else
1564 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1565 dnl either.
1566 CPPFLAGS="$am_save_CPPFLAGS"
1567 LIBICONV=
1568 LTLIBICONV=
1569 fi
1570 AC_SUBST(LIBICONV)
1571 AC_SUBST(LTLIBICONV)
1572])
1573
1574AC_DEFUN([AM_ICONV],
1575[
1576 AM_ICONV_LINK
1577 if test "$am_cv_func_iconv" = yes; then
1578 AC_MSG_CHECKING([for iconv declaration])
1579 AC_CACHE_VAL(am_cv_proto_iconv, [
1580 AC_TRY_COMPILE([
1581#include <stdlib.h>
1582#include <iconv.h>
1583extern
1584#ifdef __cplusplus
1585"C"
1586#endif
1587#if defined(__STDC__) || defined(__cplusplus)
1588size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1589#else
1590size_t iconv();
1591#endif
1592], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1593 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);"])
1594 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1595 AC_MSG_RESULT([$]{ac_t:-
1596 }[$]am_cv_proto_iconv)
1597 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1598 [Define as const if the declaration of iconv() needs const.])
1599 fi
1600])
1601
1602# isc-posix.m4 serial 2 (gettext-0.11.2)
1603dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1604dnl This file is free software, distributed under the terms of the GNU
1605dnl General Public License. As a special exception to the GNU General
1606dnl Public License, this file may be distributed as part of a program
1607dnl that contains a configuration script generated by Autoconf, under
1608dnl the same distribution terms as the rest of that program.
1609
1610# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1611
1612# This test replaces the one in autoconf.
1613# Currently this macro should have the same name as the autoconf macro
1614# because gettext's gettext.m4 (distributed in the automake package)
1615# still uses it. Otherwise, the use in gettext.m4 makes autoheader
1616# give these diagnostics:
1617# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1618# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1619
1620undefine([AC_ISC_POSIX])
1621
1622AC_DEFUN([AC_ISC_POSIX],
1623 [
1624 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1625 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1626 ]
1627)
1628
1629# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
1630dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1631dnl This file is free software, distributed under the terms of the GNU
1632dnl General Public License. As a special exception to the GNU General
1633dnl Public License, this file may be distributed as part of a program
1634dnl that contains a configuration script generated by Autoconf, under
1635dnl the same distribution terms as the rest of that program.
1636
1637# Test for the GNU C Library, version 2.1 or newer.
1638# From Bruno Haible.
1639
1640AC_DEFUN([jm_GLIBC21],
1641 [
1642 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1643 ac_cv_gnu_library_2_1,
1644 [AC_EGREP_CPP([Lucky GNU user],
1645 [
1646#include <features.h>
1647#ifdef __GNU_LIBRARY__
1648 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1649 Lucky GNU user
1650 #endif
1651#endif
1652 ],
1653 ac_cv_gnu_library_2_1=yes,
1654 ac_cv_gnu_library_2_1=no)
1655 ]
1656 )
1657 AC_SUBST(GLIBC21)
1658 GLIBC21="$ac_cv_gnu_library_2_1"
1659 ]
1660)
1661
1662# intdiv0.m4 serial 1 (gettext-0.11.3)
1663dnl Copyright (C) 2002 Free Software Foundation, Inc.
1664dnl This file is free software, distributed under the terms of the GNU
1665dnl General Public License. As a special exception to the GNU General
1666dnl Public License, this file may be distributed as part of a program
1667dnl that contains a configuration script generated by Autoconf, under
1668dnl the same distribution terms as the rest of that program.
1669
1670dnl From Bruno Haible.
1671
1672AC_DEFUN([gt_INTDIV0],
1673[
1674 AC_REQUIRE([AC_PROG_CC])dnl
1675 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1676
1677 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
1678 gt_cv_int_divbyzero_sigfpe,
1679 [
1680 AC_TRY_RUN([
1681#include <stdlib.h>
1682#include <signal.h>
1683
1684static void
1685#ifdef __cplusplus
1686sigfpe_handler (int sig)
1687#else
1688sigfpe_handler (sig) int sig;
1689#endif
1690{
1691 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
1692 exit (sig != SIGFPE);
1693}
1694
1695int x = 1;
1696int y = 0;
1697int z;
1698int nan;
1699
1700int main ()
1701{
1702 signal (SIGFPE, sigfpe_handler);
1703/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
1704#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
1705 signal (SIGTRAP, sigfpe_handler);
1706#endif
1707/* Linux/SPARC yields signal SIGILL. */
1708#if defined (__sparc__) && defined (__linux__)
1709 signal (SIGILL, sigfpe_handler);
1710#endif
1711
1712 z = x / y;
1713 nan = y / y;
1714 exit (1);
1715}
1716], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
1717 [
1718 # Guess based on the CPU.
1719 case "$host_cpu" in
1720 alpha* | i[34567]86 | m68k | s390*)
1721 gt_cv_int_divbyzero_sigfpe="guessing yes";;
1722 *)
1723 gt_cv_int_divbyzero_sigfpe="guessing no";;
1724 esac
1725 ])
1726 ])
1727 case "$gt_cv_int_divbyzero_sigfpe" in
1728 *yes) value=1;;
1729 *) value=0;;
1730 esac
1731 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
1732 [Define if integer division by zero raises signal SIGFPE.])
1733])
1734
1735# uintmax_t.m4 serial 7 (gettext-0.12)
1736dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
1737dnl This file is free software, distributed under the terms of the GNU
1738dnl General Public License. As a special exception to the GNU General
1739dnl Public License, this file may be distributed as part of a program
1740dnl that contains a configuration script generated by Autoconf, under
1741dnl the same distribution terms as the rest of that program.
1742
1743dnl From Paul Eggert.
1744
1745AC_PREREQ(2.13)
1746
1747# Define uintmax_t to 'unsigned long' or 'unsigned long long'
1748# if it is not already defined in <stdint.h> or <inttypes.h>.
1749
1750AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
1751[
1752 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
1753 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
1754 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
1755 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1756 test $ac_cv_type_unsigned_long_long = yes \
1757 && ac_type='unsigned long long' \
1758 || ac_type='unsigned long'
1759 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
1760 [Define to unsigned long or unsigned long long
1761 if <stdint.h> and <inttypes.h> don't define.])
1762 else
1763 AC_DEFINE(HAVE_UINTMAX_T, 1,
1764 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
1765 fi
1766])
1767
1768# inttypes_h.m4 serial 5 (gettext-0.12)
1769dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
1770dnl This file is free software, distributed under the terms of the GNU
1771dnl General Public License. As a special exception to the GNU General
1772dnl Public License, this file may be distributed as part of a program
1773dnl that contains a configuration script generated by Autoconf, under
1774dnl the same distribution terms as the rest of that program.
1775
1776dnl From Paul Eggert.
1777
1778# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1779# doesn't clash with <sys/types.h>, and declares uintmax_t.
1780
1781AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
1782[
1783 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
1784 [AC_TRY_COMPILE(
1785 [#include <sys/types.h>
1786#include <inttypes.h>],
1787 [uintmax_t i = (uintmax_t) -1;],
1788 jm_ac_cv_header_inttypes_h=yes,
1789 jm_ac_cv_header_inttypes_h=no)])
1790 if test $jm_ac_cv_header_inttypes_h = yes; then
1791 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
1792 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1793 and declares uintmax_t. ])
1794 fi
1795])
1796
1797# stdint_h.m4 serial 3 (gettext-0.12)
1798dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
1799dnl This file is free software, distributed under the terms of the GNU
1800dnl General Public License. As a special exception to the GNU General
1801dnl Public License, this file may be distributed as part of a program
1802dnl that contains a configuration script generated by Autoconf, under
1803dnl the same distribution terms as the rest of that program.
1804
1805dnl From Paul Eggert.
1806
1807# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
1808# doesn't clash with <sys/types.h>, and declares uintmax_t.
1809
1810AC_DEFUN([jm_AC_HEADER_STDINT_H],
1811[
1812 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
1813 [AC_TRY_COMPILE(
1814 [#include <sys/types.h>
1815#include <stdint.h>],
1816 [uintmax_t i = (uintmax_t) -1;],
1817 jm_ac_cv_header_stdint_h=yes,
1818 jm_ac_cv_header_stdint_h=no)])
1819 if test $jm_ac_cv_header_stdint_h = yes; then
1820 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
1821 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
1822 and declares uintmax_t. ])
1823 fi
1824])
1825
1826# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
1827dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
1828dnl This file is free software, distributed under the terms of the GNU
1829dnl General Public License. As a special exception to the GNU General
1830dnl Public License, this file may be distributed as part of a program
1831dnl that contains a configuration script generated by Autoconf, under
1832dnl the same distribution terms as the rest of that program.
1833
1834dnl From Paul Eggert.
1835
1836AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
1837[
1838 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
1839 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
1840 [unsigned long long ullmax = (unsigned long long) -1;
1841 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
1842 ac_cv_type_unsigned_long_long=yes,
1843 ac_cv_type_unsigned_long_long=no)])
1844 if test $ac_cv_type_unsigned_long_long = yes; then
1845 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
1846 [Define if you have the unsigned long long type.])
1847 fi
1848])
1849
1850# inttypes.m4 serial 1 (gettext-0.11.4)
1851dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1852dnl This file is free software, distributed under the terms of the GNU
1853dnl General Public License. As a special exception to the GNU General
1854dnl Public License, this file may be distributed as part of a program
1855dnl that contains a configuration script generated by Autoconf, under
1856dnl the same distribution terms as the rest of that program.
1857
1858dnl From Paul Eggert.
1859
1860# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
1861# <sys/types.h>.
1862
1863AC_DEFUN([gt_HEADER_INTTYPES_H],
1864[
1865 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
1866 [
1867 AC_TRY_COMPILE(
1868 [#include <sys/types.h>
1869#include <inttypes.h>],
1870 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
1871 ])
1872 if test $gt_cv_header_inttypes_h = yes; then
1873 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
1874 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
1875 fi
1876])
1877
1878# inttypes-pri.m4 serial 1 (gettext-0.11.4)
1879dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1880dnl This file is free software, distributed under the terms of the GNU
1881dnl General Public License. As a special exception to the GNU General
1882dnl Public License, this file may be distributed as part of a program
1883dnl that contains a configuration script generated by Autoconf, under
1884dnl the same distribution terms as the rest of that program.
1885
1886dnl From Bruno Haible.
1887
1888# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1889# macros to non-string values. This is the case on AIX 4.3.3.
1890
1891AC_DEFUN([gt_INTTYPES_PRI],
1892[
1893 AC_REQUIRE([gt_HEADER_INTTYPES_H])
1894 if test $gt_cv_header_inttypes_h = yes; then
1895 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1896 gt_cv_inttypes_pri_broken,
1897 [
1898 AC_TRY_COMPILE([#include <inttypes.h>
1899#ifdef PRId32
1900char *p = PRId32;
1901#endif
1902], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
1903 ])
1904 fi
1905 if test "$gt_cv_inttypes_pri_broken" = yes; then
1906 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
1907 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
1908 fi
1909])
1910
1911# codeset.m4 serial AM1 (gettext-0.10.40)
1912dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1913dnl This file is free software, distributed under the terms of the GNU
1914dnl General Public License. As a special exception to the GNU General
1915dnl Public License, this file may be distributed as part of a program
1916dnl that contains a configuration script generated by Autoconf, under
1917dnl the same distribution terms as the rest of that program.
1918
1919dnl From Bruno Haible.
1920
1921AC_DEFUN([AM_LANGINFO_CODESET],
1922[
1923 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1924 [AC_TRY_LINK([#include <langinfo.h>],
1925 [char* cs = nl_langinfo(CODESET);],
1926 am_cv_langinfo_codeset=yes,
1927 am_cv_langinfo_codeset=no)
1928 ])
1929 if test $am_cv_langinfo_codeset = yes; then
1930 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1931 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1932 fi
1933])
1934
1935# lcmessage.m4 serial 3 (gettext-0.11.3)
1936dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1937dnl This file is free software, distributed under the terms of the GNU
1938dnl General Public License. As a special exception to the GNU General
1939dnl Public License, this file may be distributed as part of a program
1940dnl that contains a configuration script generated by Autoconf, under
1941dnl the same distribution terms as the rest of that program.
1942dnl
1943dnl This file can can be used in projects which are not available under
1944dnl the GNU General Public License or the GNU Library General Public
1945dnl License but which still want to provide support for the GNU gettext
1946dnl functionality.
1947dnl Please note that the actual code of the GNU gettext library is covered
1948dnl by the GNU Library General Public License, and the rest of the GNU
1949dnl gettext package package is covered by the GNU General Public License.
1950dnl They are *not* in the public domain.
1951
1952dnl Authors:
1953dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
1954
1955# Check whether LC_MESSAGES is available in <locale.h>.
1956
1957AC_DEFUN([AM_LC_MESSAGES],
1958[
1959 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1960 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1961 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1962 if test $am_cv_val_LC_MESSAGES = yes; then
1963 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1964 [Define if your <locale.h> file defines LC_MESSAGES.])
1965 fi
1966])
1967
This page took 0.303378 seconds and 5 git commands to generate.