1 # nls.m4 serial 1 (gettext-0.12)
2 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License. As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
9 dnl This file can can be used in projects which are not available under
10 dnl the GNU General Public License or the GNU Library General Public
11 dnl License but which still want to provide support for the GNU gettext
13 dnl Please note that the actual code of the GNU gettext library is covered
14 dnl by the GNU Library General Public License, and the rest of the GNU
15 dnl gettext package package is covered by the GNU General Public License.
16 dnl They are *not* in the public domain.
19 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
20 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
24 AC_MSG_CHECKING([whether NLS is requested])
25 dnl Default is enabled NLS
27 [ --disable-nls do not use Native Language Support],
28 USE_NLS=$enableval, USE_NLS=yes)
29 AC_MSG_RESULT($USE_NLS)
33 AC_DEFUN([AM_MKINSTALLDIRS],
35 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
36 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
39 if test -n "$ac_aux_dir"; then
41 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
42 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
45 if test -z "$MKINSTALLDIRS"; then
46 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
48 AC_SUBST(MKINSTALLDIRS)
50 # po.m4 serial 1 (gettext-0.12)
51 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
52 dnl This file is free software, distributed under the terms of the GNU
53 dnl General Public License. As a special exception to the GNU General
54 dnl Public License, this file may be distributed as part of a program
55 dnl that contains a configuration script generated by Autoconf, under
56 dnl the same distribution terms as the rest of that program.
58 dnl This file can can be used in projects which are not available under
59 dnl the GNU General Public License or the GNU Library General Public
60 dnl License but which still want to provide support for the GNU gettext
62 dnl Please note that the actual code of the GNU gettext library is covered
63 dnl by the GNU Library General Public License, and the rest of the GNU
64 dnl gettext package package is covered by the GNU General Public License.
65 dnl They are *not* in the public domain.
68 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
69 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
71 dnl Checks for all prerequisites of the po subdirectory.
72 AC_DEFUN([AM_PO_SUBDIRS],
74 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
75 AC_REQUIRE([AC_PROG_INSTALL])dnl
76 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
77 AC_REQUIRE([AM_NLS])dnl
79 dnl Perform the following tests also if --disable-nls has been given,
80 dnl because they are needed for "make dist" to work.
82 dnl Search for GNU msgfmt in the PATH.
83 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
84 dnl The second test excludes FreeBSD msgfmt.
85 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
86 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
87 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
89 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
91 dnl Search for GNU xgettext 0.12 or newer in the PATH.
92 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
93 dnl The second test excludes FreeBSD xgettext.
94 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
95 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
96 (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)],
98 dnl Remove leftover from FreeBSD xgettext call.
101 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
102 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
103 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
105 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
106 dnl Test whether we really found GNU msgfmt.
107 if test "$GMSGFMT" != ":"; then
108 dnl If it is no GNU msgfmt we define it as : so that the
109 dnl Makefiles still can work.
110 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
111 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
114 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
116 [found $GMSGFMT program is not GNU msgfmt; ignore it])
121 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
122 dnl Test whether we really found GNU xgettext.
123 if test "$XGETTEXT" != ":"; then
124 dnl If it is no GNU xgettext we define it as : so that the
125 dnl Makefiles still can work.
126 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
127 (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
131 [found xgettext program is not GNU xgettext; ignore it])
134 dnl Remove leftover from FreeBSD xgettext call.
139 for ac_file in $CONFIG_FILES; do
140 # Support "outfile[:infile[:infile...]]"
142 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
144 # PO directories have a Makefile.in generated from Makefile.in.in.
145 case "$ac_file" in */Makefile.in)
146 # Adjust a relative srcdir.
147 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
148 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
149 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
150 # In autoconf-2.13 it is called $ac_given_srcdir.
151 # In autoconf-2.50 it is called $srcdir.
152 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
153 case "$ac_given_srcdir" in
154 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
155 /*) top_srcdir="$ac_given_srcdir" ;;
156 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
158 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
159 rm -f "$ac_dir/POTFILES"
160 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
161 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
162 POMAKEFILEDEPS="POTFILES.in"
163 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
164 # on $ac_dir but don't depend on user-specified configuration
166 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
167 # The LINGUAS file contains the set of available languages.
168 if test -n "$OBSOLETE_ALL_LINGUAS"; then
169 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
171 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
172 # Hide the ALL_LINGUAS assigment from automake.
173 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
174 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
176 # The set of available languages was given in configure.in.
177 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
179 case "$ac_given_srcdir" in
181 *) srcdirpre='$(srcdir)/' ;;
187 for lang in $ALL_LINGUAS; do
188 POFILES="$POFILES $srcdirpre$lang.po"
189 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
190 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
191 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
193 # CATALOGS depends on both $ac_dir and the user's LINGUAS
194 # environment variable.
196 if test -n "$ALL_LINGUAS"; then
197 for presentlang in $ALL_LINGUAS; do
199 if test "%UNSET%" != "$LINGUAS"; then
200 desiredlanguages="$LINGUAS"
202 desiredlanguages="$ALL_LINGUAS"
204 for desiredlang in $desiredlanguages; do
205 # Use the presentlang catalog if desiredlang is
206 # a. equal to presentlang, or
207 # b. a variant of presentlang (because in this case,
208 # presentlang can be used as a fallback for messages
209 # which are not translated in the desiredlang catalog).
210 case "$desiredlang" in
211 "$presentlang"*) useit=yes;;
214 if test $useit = yes; then
215 INST_LINGUAS="$INST_LINGUAS $presentlang"
220 if test -n "$INST_LINGUAS"; then
221 for lang in $INST_LINGUAS; do
222 CATALOGS="$CATALOGS $lang.gmo"
225 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
226 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"
227 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
228 if test -f "$f"; then
230 *.orig | *.bak | *~) ;;
231 *) cat "$f" >> "$ac_dir/Makefile" ;;
239 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
240 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
242 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
243 # Capture the value of LINGUAS because we need it to compute CATALOGS.
244 LINGUAS="${LINGUAS-%UNSET%}"
247 # gettext.m4 serial 20 (gettext-0.12)
248 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
249 dnl This file is free software, distributed under the terms of the GNU
250 dnl General Public License. As a special exception to the GNU General
251 dnl Public License, this file may be distributed as part of a program
252 dnl that contains a configuration script generated by Autoconf, under
253 dnl the same distribution terms as the rest of that program.
255 dnl This file can can be used in projects which are not available under
256 dnl the GNU General Public License or the GNU Library General Public
257 dnl License but which still want to provide support for the GNU gettext
259 dnl Please note that the actual code of the GNU gettext library is covered
260 dnl by the GNU Library General Public License, and the rest of the GNU
261 dnl gettext package package is covered by the GNU General Public License.
262 dnl They are *not* in the public domain.
265 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
266 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
268 dnl Macro to add for using GNU gettext.
270 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
271 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
272 dnl default (if it is not specified or empty) is 'no-libtool'.
273 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
274 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
275 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
276 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
277 dnl depending on --{enable,disable}-{shared,static} and on the presence of
278 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
279 dnl $(top_builddir)/intl/libintl.a will be created.
280 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
281 dnl implementations (in libc or libintl) without the ngettext() function
282 dnl will be ignored. If NEEDSYMBOL is specified and is
283 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
284 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
285 dnl INTLDIR is used to find the intl libraries. If empty,
286 dnl the value `$(top_builddir)/intl/' is used.
288 dnl The result of the configuration is one of three cases:
289 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
291 dnl Catalog format: GNU --> install in $(datadir)
292 dnl Catalog extension: .mo after installation, .gmo in source tree
293 dnl 2) GNU gettext has been found in the system's C library.
294 dnl Catalog format: GNU --> install in $(datadir)
295 dnl Catalog extension: .mo after installation, .gmo in source tree
296 dnl 3) No internationalization, always use English msgid.
297 dnl Catalog format: none
298 dnl Catalog extension: none
299 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
300 dnl The use of .gmo is historical (it was needed to avoid overwriting the
301 dnl GNU format catalogs when building on a platform with an X/Open gettext),
302 dnl but we keep it in order not to force irrelevant filename changes on the
305 AC_DEFUN([AM_GNU_GETTEXT],
307 dnl Argument checking.
308 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
309 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
311 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
312 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
314 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
315 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
317 AC_REQUIRE([AM_PO_SUBDIRS])dnl
318 ifelse(gt_included_intl, yes, [
319 AC_REQUIRE([AM_INTL_SUBDIR])dnl
322 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
323 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
324 AC_REQUIRE([AC_LIB_RPATH])
326 dnl Sometimes libintl requires libiconv, so first search for libiconv.
327 dnl Ideally we would do this search only after the
328 dnl if test "$USE_NLS" = "yes"; then
329 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
330 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
331 dnl the configure script would need to contain the same shell code
332 dnl again, outside any 'if'. There are two solutions:
333 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
334 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
335 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
336 dnl documented, we avoid it.
337 ifelse(gt_included_intl, yes, , [
338 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
344 ifelse(gt_included_intl, yes, [
345 BUILD_INCLUDED_LIBINTL=no
346 USE_INCLUDED_LIBINTL=no
352 dnl If we use NLS figure out what method
353 if test "$USE_NLS" = "yes"; then
354 gt_use_preinstalled_gnugettext=no
355 ifelse(gt_included_intl, yes, [
356 AC_MSG_CHECKING([whether included gettext is requested])
357 AC_ARG_WITH(included-gettext,
358 [ --with-included-gettext use the GNU gettext library included here],
359 nls_cv_force_use_gnu_gettext=$withval,
360 nls_cv_force_use_gnu_gettext=no)
361 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
363 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
364 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
366 dnl User does not insist on using GNU NLS library. Figure out what
367 dnl to use. If GNU gettext is available we use this. Else we have
368 dnl to fall back to GNU NLS library.
370 dnl Add a version number to the cache macros.
371 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
372 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
373 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
375 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
376 [AC_TRY_LINK([#include <libintl.h>
377 ]ifelse([$2], [need-formatstring-macros],
378 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
379 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
382 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
384 ], [])[extern int _nl_msg_cat_cntr;
385 extern int *_nl_domain_bindings;],
386 [bindtextdomain ("", "");
387 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
388 gt_cv_func_gnugettext_libc=yes,
389 gt_cv_func_gnugettext_libc=no)])
391 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
392 dnl Sometimes libintl requires libiconv, so first search for libiconv.
393 ifelse(gt_included_intl, yes, , [
396 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
397 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
398 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
399 dnl even if libiconv doesn't exist.
400 AC_LIB_LINKFLAGS_BODY([intl])
401 AC_CACHE_CHECK([for GNU gettext in libintl],
402 gt_cv_func_gnugettext_libintl,
403 [gt_save_CPPFLAGS="$CPPFLAGS"
404 CPPFLAGS="$CPPFLAGS $INCINTL"
406 LIBS="$LIBS $LIBINTL"
407 dnl Now see whether libintl exists and does not depend on libiconv.
408 AC_TRY_LINK([#include <libintl.h>
409 ]ifelse([$2], [need-formatstring-macros],
410 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
411 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
414 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
416 ], [])[extern int _nl_msg_cat_cntr;
421 const char *_nl_expand_alias ();],
422 [bindtextdomain ("", "");
423 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
424 gt_cv_func_gnugettext_libintl=yes,
425 gt_cv_func_gnugettext_libintl=no)
426 dnl Now see whether libintl exists and depends on libiconv.
427 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
428 LIBS="$LIBS $LIBICONV"
429 AC_TRY_LINK([#include <libintl.h>
430 ]ifelse([$2], [need-formatstring-macros],
431 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
432 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
435 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
437 ], [])[extern int _nl_msg_cat_cntr;
442 const char *_nl_expand_alias ();],
443 [bindtextdomain ("", "");
444 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
445 [LIBINTL="$LIBINTL $LIBICONV"
446 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
447 gt_cv_func_gnugettext_libintl=yes
450 CPPFLAGS="$gt_save_CPPFLAGS"
451 LIBS="$gt_save_LIBS"])
454 dnl If an already present or preinstalled GNU gettext() is found,
455 dnl use it. But if this macro is used in GNU gettext, and GNU
456 dnl gettext is already preinstalled in libintl, we update this
457 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
458 if test "$gt_cv_func_gnugettext_libc" = "yes" \
459 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
460 && test "$PACKAGE" != gettext-runtime \
461 && test "$PACKAGE" != gettext-tools; }; then
462 gt_use_preinstalled_gnugettext=yes
464 dnl Reset the values set by searching for libintl.
470 ifelse(gt_included_intl, yes, [
471 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
472 dnl GNU gettext is not found in the C library.
473 dnl Fall back on included GNU gettext library.
474 nls_cv_use_gnu_gettext=yes
478 if test "$nls_cv_use_gnu_gettext" = "yes"; then
479 dnl Mark actions used to generate GNU NLS library.
480 BUILD_INCLUDED_LIBINTL=yes
481 USE_INCLUDED_LIBINTL=yes
482 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
483 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
484 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
487 if test "$gt_use_preinstalled_gnugettext" = "yes" \
488 || test "$nls_cv_use_gnu_gettext" = "yes"; then
489 dnl Mark actions to use GNU gettext tools.
494 if test "$gt_use_preinstalled_gnugettext" = "yes" \
495 || test "$nls_cv_use_gnu_gettext" = "yes"; then
496 AC_DEFINE(ENABLE_NLS, 1,
497 [Define to 1 if translation of program messages to the user's native language
504 AC_MSG_CHECKING([whether to use NLS])
505 AC_MSG_RESULT([$USE_NLS])
506 if test "$USE_NLS" = "yes"; then
507 AC_MSG_CHECKING([where the gettext function comes from])
508 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
509 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
510 gt_source="external libintl"
515 gt_source="included intl directory"
517 AC_MSG_RESULT([$gt_source])
520 if test "$USE_NLS" = "yes"; then
522 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
523 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
524 AC_MSG_CHECKING([how to link with libintl])
525 AC_MSG_RESULT([$LIBINTL])
526 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
529 dnl For backward compatibility. Some packages may be using this.
530 AC_DEFINE(HAVE_GETTEXT, 1,
531 [Define if the GNU gettext() function is already present or preinstalled.])
532 AC_DEFINE(HAVE_DCGETTEXT, 1,
533 [Define if the GNU dcgettext() function is already present or preinstalled.])
536 dnl We need to process the po/ directory.
540 ifelse(gt_included_intl, yes, [
541 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
542 dnl to 'yes' because some of the testsuite requires it.
543 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
544 BUILD_INCLUDED_LIBINTL=yes
547 dnl Make all variables we use known to autoconf.
548 AC_SUBST(BUILD_INCLUDED_LIBINTL)
549 AC_SUBST(USE_INCLUDED_LIBINTL)
552 dnl For backward compatibility. Some configure.ins may be using this.
556 dnl For backward compatibility. Some Makefiles may be using this.
558 AC_SUBST(DATADIRNAME)
560 dnl For backward compatibility. Some Makefiles may be using this.
564 dnl For backward compatibility. Some Makefiles may be using this.
568 dnl For backward compatibility. Some Makefiles may be using this.
569 if test "$USE_INCLUDED_LIBINTL" = yes; then
570 INTLOBJS="\$(GETTOBJS)"
574 dnl Enable libtool support if the surrounding package wishes it.
575 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
576 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
579 dnl For backward compatibility. Some Makefiles may be using this.
583 dnl Make all documented variables known to autoconf.
590 dnl Checks for all prerequisites of the intl subdirectory,
591 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
592 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
593 AC_DEFUN([AM_INTL_SUBDIR],
595 AC_REQUIRE([AC_PROG_INSTALL])dnl
596 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
597 AC_REQUIRE([AC_PROG_CC])dnl
598 AC_REQUIRE([AC_CANONICAL_HOST])dnl
599 AC_REQUIRE([AC_PROG_RANLIB])dnl
600 AC_REQUIRE([AC_ISC_POSIX])dnl
601 AC_REQUIRE([AC_HEADER_STDC])dnl
602 AC_REQUIRE([AC_C_CONST])dnl
603 AC_REQUIRE([AC_C_INLINE])dnl
604 AC_REQUIRE([AC_TYPE_OFF_T])dnl
605 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
606 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
607 AC_REQUIRE([AC_FUNC_MMAP])dnl
608 AC_REQUIRE([jm_GLIBC21])dnl
609 AC_REQUIRE([gt_INTDIV0])dnl
610 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
611 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
612 AC_REQUIRE([gt_INTTYPES_PRI])dnl
614 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
615 stdlib.h string.h unistd.h sys/param.h])
616 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
617 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
618 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
623 if test $ac_cv_header_locale_h = yes; then
627 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
628 dnl because plural.y uses bison specific features. It requires at least
629 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
631 dnl bison is only needed for the maintainer (who touches plural.y). But in
632 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
633 dnl the rule in general Makefile. Now, some people carelessly touch the
634 dnl files or have a broken "make" program, hence the plural.c rule will
635 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
636 dnl present or too old.
637 AC_CHECK_PROGS([INTLBISON], [bison])
638 if test -z "$INTLBISON"; then
641 dnl Found it, now check the version.
642 AC_MSG_CHECKING([version of bison])
643 changequote(<<,>>)dnl
644 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
645 case $ac_prog_version in
646 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
647 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
649 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
650 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
652 AC_MSG_RESULT([$ac_prog_version])
654 if test $ac_verc_fail = yes; then
660 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
661 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
662 # iconv.m4 serial AM4 (gettext-0.11.3)
663 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
664 dnl This file is free software, distributed under the terms of the GNU
665 dnl General Public License. As a special exception to the GNU General
666 dnl Public License, this file may be distributed as part of a program
667 dnl that contains a configuration script generated by Autoconf, under
668 dnl the same distribution terms as the rest of that program.
670 dnl From Bruno Haible.
672 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
674 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
675 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
676 AC_REQUIRE([AC_LIB_RPATH])
678 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
680 AC_LIB_LINKFLAGS_BODY([iconv])
683 AC_DEFUN([AM_ICONV_LINK],
685 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
686 dnl those with the standalone portable GNU libiconv installed).
688 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
690 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
692 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
693 dnl because if the user has installed libiconv and not disabled its use
694 dnl via --without-libiconv-prefix, he wants to use it. The first
695 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
696 am_save_CPPFLAGS="$CPPFLAGS"
697 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
699 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
700 am_cv_func_iconv="no, consider installing GNU libiconv"
702 AC_TRY_LINK([#include <stdlib.h>
704 [iconv_t cd = iconv_open("","");
705 iconv(cd,NULL,NULL,NULL,NULL);
707 am_cv_func_iconv=yes)
708 if test "$am_cv_func_iconv" != yes; then
710 LIBS="$LIBS $LIBICONV"
711 AC_TRY_LINK([#include <stdlib.h>
713 [iconv_t cd = iconv_open("","");
714 iconv(cd,NULL,NULL,NULL,NULL);
717 am_cv_func_iconv=yes)
721 if test "$am_cv_func_iconv" = yes; then
722 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
724 if test "$am_cv_lib_iconv" = yes; then
725 AC_MSG_CHECKING([how to link with libiconv])
726 AC_MSG_RESULT([$LIBICONV])
728 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
730 CPPFLAGS="$am_save_CPPFLAGS"
741 if test "$am_cv_func_iconv" = yes; then
742 AC_MSG_CHECKING([for iconv declaration])
743 AC_CACHE_VAL(am_cv_proto_iconv, [
751 #if defined(__STDC__) || defined(__cplusplus)
752 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
756 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
757 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);"])
758 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
759 AC_MSG_RESULT([$]{ac_t:-
760 }[$]am_cv_proto_iconv)
761 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
762 [Define as const if the declaration of iconv() needs const.])
765 # lib-ld.m4 serial 2 (gettext-0.12)
766 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
767 dnl This file is free software, distributed under the terms of the GNU
768 dnl General Public License. As a special exception to the GNU General
769 dnl Public License, this file may be distributed as part of a program
770 dnl that contains a configuration script generated by Autoconf, under
771 dnl the same distribution terms as the rest of that program.
773 dnl Subroutines of libtool.m4,
774 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
777 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
778 AC_DEFUN([AC_LIB_PROG_LD_GNU],
779 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
780 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
781 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
782 acl_cv_prog_gnu_ld=yes
784 acl_cv_prog_gnu_ld=no
786 with_gnu_ld=$acl_cv_prog_gnu_ld
789 dnl From libtool-1.4. Sets the variable LD.
790 AC_DEFUN([AC_LIB_PROG_LD],
792 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
793 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
794 AC_REQUIRE([AC_PROG_CC])dnl
795 AC_REQUIRE([AC_CANONICAL_HOST])dnl
796 # Prepare PATH_SEPARATOR.
797 # The user is always right.
798 if test "${PATH_SEPARATOR+set}" != set; then
799 echo "#! /bin/sh" >conf$$.sh
800 echo "exit 0" >>conf$$.sh
802 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
810 if test "$GCC" = yes; then
811 # Check if gcc -print-prog-name=ld gives a path.
812 AC_MSG_CHECKING([for ld used by GCC])
815 # gcc leaves a trailing carriage return which upsets mingw
816 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
818 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
821 # Accept absolute paths.
822 [[\\/]* | [A-Za-z]:[\\/]*)]
823 [re_direlt='/[^/][^/]*/\.\./']
824 # Canonicalize the path of ld
825 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
826 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
827 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
829 test -z "$LD" && LD="$ac_prog"
832 # If it fails, then pretend we aren't using GCC.
836 # If it is relative, then search for the first ld in PATH.
840 elif test "$with_gnu_ld" = yes; then
841 AC_MSG_CHECKING([for GNU ld])
843 AC_MSG_CHECKING([for non-GNU ld])
845 AC_CACHE_VAL(acl_cv_path_LD,
846 [if test -z "$LD"; then
847 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
848 for ac_dir in $PATH; do
849 test -z "$ac_dir" && ac_dir=.
850 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
851 acl_cv_path_LD="$ac_dir/$ac_prog"
852 # Check to see if the program is GNU ld. I'd rather use --version,
853 # but apparently some GNU ld's only accept -v.
854 # Break only if it was the GNU/non-GNU ld that we prefer.
855 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
856 test "$with_gnu_ld" != no && break
858 test "$with_gnu_ld" != yes && break
864 acl_cv_path_LD="$LD" # Let the user override the test with a path.
867 if test -n "$LD"; then
872 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
875 # lib-link.m4 serial 4 (gettext-0.12)
876 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
877 dnl This file is free software, distributed under the terms of the GNU
878 dnl General Public License. As a special exception to the GNU General
879 dnl Public License, this file may be distributed as part of a program
880 dnl that contains a configuration script generated by Autoconf, under
881 dnl the same distribution terms as the rest of that program.
883 dnl From Bruno Haible.
885 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
886 dnl the libraries corresponding to explicit and implicit dependencies.
887 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
888 dnl augments the CPPFLAGS variable.
889 AC_DEFUN([AC_LIB_LINKFLAGS],
891 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
892 AC_REQUIRE([AC_LIB_RPATH])
893 define([Name],[translit([$1],[./-], [___])])
894 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
895 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
896 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
897 AC_LIB_LINKFLAGS_BODY([$1], [$2])
898 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
899 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
900 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
902 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
903 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
904 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
905 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
907 AC_SUBST([LTLIB]NAME)
908 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
909 dnl results of this search when this library appears as a dependency.
915 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
916 dnl searches for libname and the libraries corresponding to explicit and
917 dnl implicit dependencies, together with the specified include files and
918 dnl the ability to compile and link the specified testcode. If found, it
919 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
920 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
921 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
922 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
923 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
925 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
926 AC_REQUIRE([AC_LIB_RPATH])
927 define([Name],[translit([$1],[./-], [___])])
928 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
929 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
931 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
933 AC_LIB_LINKFLAGS_BODY([$1], [$2])
935 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
936 dnl because if the user has installed lib[]Name and not disabled its use
937 dnl via --without-lib[]Name-prefix, he wants to use it.
938 ac_save_CPPFLAGS="$CPPFLAGS"
939 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
941 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
943 LIBS="$LIBS $LIB[]NAME"
944 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
947 if test "$ac_cv_lib[]Name" = yes; then
949 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
950 AC_MSG_CHECKING([how to link with lib[]$1])
951 AC_MSG_RESULT([$LIB[]NAME])
954 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
955 dnl $INC[]NAME either.
956 CPPFLAGS="$ac_save_CPPFLAGS"
960 AC_SUBST([HAVE_LIB]NAME)
962 AC_SUBST([LTLIB]NAME)
967 dnl Determine the platform dependent parameters needed to use rpath:
968 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
969 dnl hardcode_direct, hardcode_minus_L.
970 AC_DEFUN([AC_LIB_RPATH],
972 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
973 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
974 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
975 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
976 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
977 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
978 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
984 libext="$acl_cv_libext"
985 shlibext="$acl_cv_shlibext"
986 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
987 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
988 hardcode_direct="$acl_cv_hardcode_direct"
989 hardcode_minus_L="$acl_cv_hardcode_minus_L"
990 dnl Determine whether the user wants rpath handling at all.
992 [ --disable-rpath do not hardcode runtime library paths],
996 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
997 dnl the libraries corresponding to explicit and implicit dependencies.
998 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
999 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1001 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1002 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1003 dnl By default, look in $includedir and $libdir.
1005 AC_LIB_WITH_FINAL_PREFIX([
1006 eval additional_includedir=\"$includedir\"
1007 eval additional_libdir=\"$libdir\"
1009 AC_LIB_ARG_WITH([lib$1-prefix],
1010 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1011 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1013 if test "X$withval" = "Xno"; then
1016 if test "X$withval" = "X"; then
1017 AC_LIB_WITH_FINAL_PREFIX([
1018 eval additional_includedir=\"$includedir\"
1019 eval additional_libdir=\"$libdir\"
1022 additional_includedir="$withval/include"
1023 additional_libdir="$withval/lib"
1027 dnl Search the library and its dependencies in $additional_libdir and
1028 dnl $LDFLAGS. Using breadth-first-seach.
1034 names_already_handled=
1035 names_next_round='$1 $2'
1036 while test -n "$names_next_round"; do
1037 names_this_round="$names_next_round"
1039 for name in $names_this_round; do
1041 for n in $names_already_handled; do
1042 if test "$n" = "$name"; then
1047 if test -z "$already_handled"; then
1048 names_already_handled="$names_already_handled $name"
1049 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1050 dnl or AC_LIB_HAVE_LINKFLAGS call.
1051 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1052 eval value=\"\$HAVE_LIB$uppername\"
1053 if test -n "$value"; then
1054 if test "$value" = yes; then
1055 eval value=\"\$LIB$uppername\"
1056 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1057 eval value=\"\$LTLIB$uppername\"
1058 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1060 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1061 dnl that this library doesn't exist. So just drop it.
1065 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1066 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1071 if test $use_additional = yes; then
1072 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1073 found_dir="$additional_libdir"
1074 found_so="$additional_libdir/lib$name.$shlibext"
1075 if test -f "$additional_libdir/lib$name.la"; then
1076 found_la="$additional_libdir/lib$name.la"
1079 if test -f "$additional_libdir/lib$name.$libext"; then
1080 found_dir="$additional_libdir"
1081 found_a="$additional_libdir/lib$name.$libext"
1082 if test -f "$additional_libdir/lib$name.la"; then
1083 found_la="$additional_libdir/lib$name.la"
1088 if test "X$found_dir" = "X"; then
1089 for x in $LDFLAGS $LTLIB[]NAME; do
1090 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1093 dir=`echo "X$x" | sed -e 's/^X-L//'`
1094 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1096 found_so="$dir/lib$name.$shlibext"
1097 if test -f "$dir/lib$name.la"; then
1098 found_la="$dir/lib$name.la"
1101 if test -f "$dir/lib$name.$libext"; then
1103 found_a="$dir/lib$name.$libext"
1104 if test -f "$dir/lib$name.la"; then
1105 found_la="$dir/lib$name.la"
1111 if test "X$found_dir" != "X"; then
1116 if test "X$found_dir" != "X"; then
1117 dnl Found the library.
1118 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1119 if test "X$found_so" != "X"; then
1120 dnl Linking with a shared library. We attempt to hardcode its
1121 dnl directory into the executable's runpath, unless it's the
1122 dnl standard /usr/lib.
1123 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1124 dnl No hardcoding is needed.
1125 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1127 dnl Use an explicit option to hardcode DIR into the resulting
1129 dnl Potentially add DIR to ltrpathdirs.
1130 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1132 for x in $ltrpathdirs; do
1133 if test "X$x" = "X$found_dir"; then
1138 if test -z "$haveit"; then
1139 ltrpathdirs="$ltrpathdirs $found_dir"
1141 dnl The hardcoding into $LIBNAME is system dependent.
1142 if test "$hardcode_direct" = yes; then
1143 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1144 dnl resulting binary.
1145 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1147 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1148 dnl Use an explicit option to hardcode DIR into the resulting
1150 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1151 dnl Potentially add DIR to rpathdirs.
1152 dnl The rpathdirs will be appended to $LIBNAME at the end.
1154 for x in $rpathdirs; do
1155 if test "X$x" = "X$found_dir"; then
1160 if test -z "$haveit"; then
1161 rpathdirs="$rpathdirs $found_dir"
1164 dnl Rely on "-L$found_dir".
1165 dnl But don't add it if it's already contained in the LDFLAGS
1166 dnl or the already constructed $LIBNAME
1168 for x in $LDFLAGS $LIB[]NAME; do
1169 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1170 if test "X$x" = "X-L$found_dir"; then
1175 if test -z "$haveit"; then
1176 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1178 if test "$hardcode_minus_L" != no; then
1179 dnl FIXME: Not sure whether we should use
1180 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1182 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1184 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1185 dnl here, because this doesn't fit in flags passed to the
1186 dnl compiler. So give up. No hardcoding. This affects only
1187 dnl very old systems.
1188 dnl FIXME: Not sure whether we should use
1189 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1191 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1197 if test "X$found_a" != "X"; then
1198 dnl Linking with a static library.
1199 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1201 dnl We shouldn't come here, but anyway it's good to have a
1203 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1206 dnl Assume the include files are nearby.
1207 additional_includedir=
1208 case "$found_dir" in
1210 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1211 additional_includedir="$basedir/include"
1214 if test "X$additional_includedir" != "X"; then
1215 dnl Potentially add $additional_includedir to $INCNAME.
1216 dnl But don't add it
1217 dnl 1. if it's the standard /usr/include,
1218 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1219 dnl 3. if it's already present in $CPPFLAGS or the already
1220 dnl constructed $INCNAME,
1221 dnl 4. if it doesn't exist as a directory.
1222 if test "X$additional_includedir" != "X/usr/include"; then
1224 if test "X$additional_includedir" = "X/usr/local/include"; then
1225 if test -n "$GCC"; then
1227 linux*) haveit=yes;;
1231 if test -z "$haveit"; then
1232 for x in $CPPFLAGS $INC[]NAME; do
1233 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1234 if test "X$x" = "X-I$additional_includedir"; then
1239 if test -z "$haveit"; then
1240 if test -d "$additional_includedir"; then
1241 dnl Really add $additional_includedir to $INCNAME.
1242 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1248 dnl Look for dependencies.
1249 if test -n "$found_la"; then
1250 dnl Read the .la file. It defines the variables
1251 dnl dlname, library_names, old_library, dependency_libs, current,
1252 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1253 save_libdir="$libdir"
1255 */* | *\\*) . "$found_la" ;;
1256 *) . "./$found_la" ;;
1258 libdir="$save_libdir"
1259 dnl We use only dependency_libs.
1260 for dep in $dependency_libs; do
1263 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1264 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1265 dnl But don't add it
1266 dnl 1. if it's the standard /usr/lib,
1267 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1268 dnl 3. if it's already present in $LDFLAGS or the already
1269 dnl constructed $LIBNAME,
1270 dnl 4. if it doesn't exist as a directory.
1271 if test "X$additional_libdir" != "X/usr/lib"; then
1273 if test "X$additional_libdir" = "X/usr/local/lib"; then
1274 if test -n "$GCC"; then
1276 linux*) haveit=yes;;
1280 if test -z "$haveit"; then
1282 for x in $LDFLAGS $LIB[]NAME; do
1283 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1284 if test "X$x" = "X-L$additional_libdir"; then
1289 if test -z "$haveit"; then
1290 if test -d "$additional_libdir"; then
1291 dnl Really add $additional_libdir to $LIBNAME.
1292 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1296 for x in $LDFLAGS $LTLIB[]NAME; do
1297 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1298 if test "X$x" = "X-L$additional_libdir"; then
1303 if test -z "$haveit"; then
1304 if test -d "$additional_libdir"; then
1305 dnl Really add $additional_libdir to $LTLIBNAME.
1306 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1313 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1314 if test "$enable_rpath" != no; then
1315 dnl Potentially add DIR to rpathdirs.
1316 dnl The rpathdirs will be appended to $LIBNAME at the end.
1318 for x in $rpathdirs; do
1319 if test "X$x" = "X$dir"; then
1324 if test -z "$haveit"; then
1325 rpathdirs="$rpathdirs $dir"
1327 dnl Potentially add DIR to ltrpathdirs.
1328 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1330 for x in $ltrpathdirs; do
1331 if test "X$x" = "X$dir"; then
1336 if test -z "$haveit"; then
1337 ltrpathdirs="$ltrpathdirs $dir"
1342 dnl Handle this in the next round.
1343 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1346 dnl Handle this in the next round. Throw away the .la's
1347 dnl directory; it is already contained in a preceding -L
1349 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1352 dnl Most likely an immediate library name.
1353 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1354 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1360 dnl Didn't find the library; assume it is in the system directories
1361 dnl known to the linker and runtime loader. (All the system
1362 dnl directories known to the linker should also be known to the
1363 dnl runtime loader, otherwise the system is severely misconfigured.)
1364 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1365 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1371 if test "X$rpathdirs" != "X"; then
1372 if test -n "$hardcode_libdir_separator"; then
1373 dnl Weird platform: only the last -rpath option counts, the user must
1374 dnl pass all path elements in one option. We can arrange that for a
1375 dnl single library, but not when more than one $LIBNAMEs are used.
1377 for found_dir in $rpathdirs; do
1378 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1380 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1381 acl_save_libdir="$libdir"
1383 eval flag=\"$hardcode_libdir_flag_spec\"
1384 libdir="$acl_save_libdir"
1385 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1387 dnl The -rpath options are cumulative.
1388 for found_dir in $rpathdirs; do
1389 acl_save_libdir="$libdir"
1391 eval flag=\"$hardcode_libdir_flag_spec\"
1392 libdir="$acl_save_libdir"
1393 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1397 if test "X$ltrpathdirs" != "X"; then
1398 dnl When using libtool, the option that works for both libraries and
1399 dnl executables is -R. The -R options are cumulative.
1400 for found_dir in $ltrpathdirs; do
1401 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1406 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1407 dnl unless already present in VAR.
1408 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1409 dnl contains two or three consecutive elements that belong together.
1410 AC_DEFUN([AC_LIB_APPENDTOVAR],
1412 for element in [$2]; do
1415 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1416 if test "X$x" = "X$element"; then
1421 if test -z "$haveit"; then
1422 [$1]="${[$1]}${[$1]:+ }$element"
1426 # lib-prefix.m4 serial 2 (gettext-0.12)
1427 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1428 dnl This file is free software, distributed under the terms of the GNU
1429 dnl General Public License. As a special exception to the GNU General
1430 dnl Public License, this file may be distributed as part of a program
1431 dnl that contains a configuration script generated by Autoconf, under
1432 dnl the same distribution terms as the rest of that program.
1434 dnl From Bruno Haible.
1436 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1437 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1438 dnl require excessive bracketing.
1439 ifdef([AC_HELP_STRING],
1440 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1441 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1443 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1444 dnl to access previously installed libraries. The basic assumption is that
1445 dnl a user will want packages to use other packages he previously installed
1446 dnl with the same --prefix option.
1447 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1448 dnl libraries, but is otherwise very convenient.
1449 AC_DEFUN([AC_LIB_PREFIX],
1451 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1452 AC_REQUIRE([AC_PROG_CC])
1453 AC_REQUIRE([AC_CANONICAL_HOST])
1454 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1455 dnl By default, look in $includedir and $libdir.
1457 AC_LIB_WITH_FINAL_PREFIX([
1458 eval additional_includedir=\"$includedir\"
1459 eval additional_libdir=\"$libdir\"
1461 AC_LIB_ARG_WITH([lib-prefix],
1462 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1463 --without-lib-prefix don't search for libraries in includedir and libdir],
1465 if test "X$withval" = "Xno"; then
1468 if test "X$withval" = "X"; then
1469 AC_LIB_WITH_FINAL_PREFIX([
1470 eval additional_includedir=\"$includedir\"
1471 eval additional_libdir=\"$libdir\"
1474 additional_includedir="$withval/include"
1475 additional_libdir="$withval/lib"
1479 if test $use_additional = yes; then
1480 dnl Potentially add $additional_includedir to $CPPFLAGS.
1481 dnl But don't add it
1482 dnl 1. if it's the standard /usr/include,
1483 dnl 2. if it's already present in $CPPFLAGS,
1484 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1485 dnl 4. if it doesn't exist as a directory.
1486 if test "X$additional_includedir" != "X/usr/include"; then
1488 for x in $CPPFLAGS; do
1489 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1490 if test "X$x" = "X-I$additional_includedir"; then
1495 if test -z "$haveit"; then
1496 if test "X$additional_includedir" = "X/usr/local/include"; then
1497 if test -n "$GCC"; then
1499 linux*) haveit=yes;;
1503 if test -z "$haveit"; then
1504 if test -d "$additional_includedir"; then
1505 dnl Really add $additional_includedir to $CPPFLAGS.
1506 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1511 dnl Potentially add $additional_libdir to $LDFLAGS.
1512 dnl But don't add it
1513 dnl 1. if it's the standard /usr/lib,
1514 dnl 2. if it's already present in $LDFLAGS,
1515 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1516 dnl 4. if it doesn't exist as a directory.
1517 if test "X$additional_libdir" != "X/usr/lib"; then
1519 for x in $LDFLAGS; do
1520 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1521 if test "X$x" = "X-L$additional_libdir"; then
1526 if test -z "$haveit"; then
1527 if test "X$additional_libdir" = "X/usr/local/lib"; then
1528 if test -n "$GCC"; then
1530 linux*) haveit=yes;;
1534 if test -z "$haveit"; then
1535 if test -d "$additional_libdir"; then
1536 dnl Really add $additional_libdir to $LDFLAGS.
1537 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1545 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1546 dnl acl_final_exec_prefix, containing the values to which $prefix and
1547 dnl $exec_prefix will expand at the end of the configure script.
1548 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1550 dnl Unfortunately, prefix and exec_prefix get only finally determined
1551 dnl at the end of configure.
1552 if test "X$prefix" = "XNONE"; then
1553 acl_final_prefix="$ac_default_prefix"
1555 acl_final_prefix="$prefix"
1557 if test "X$exec_prefix" = "XNONE"; then
1558 acl_final_exec_prefix='${prefix}'
1560 acl_final_exec_prefix="$exec_prefix"
1562 acl_save_prefix="$prefix"
1563 prefix="$acl_final_prefix"
1564 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1565 prefix="$acl_save_prefix"
1568 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1569 dnl variables prefix and exec_prefix bound to the values they will have
1570 dnl at the end of the configure script.
1571 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1573 acl_save_prefix="$prefix"
1574 prefix="$acl_final_prefix"
1575 acl_save_exec_prefix="$exec_prefix"
1576 exec_prefix="$acl_final_exec_prefix"
1578 exec_prefix="$acl_save_exec_prefix"
1579 prefix="$acl_save_prefix"
1581 # progtest.m4 serial 3 (gettext-0.12)
1582 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1583 dnl This file is free software, distributed under the terms of the GNU
1584 dnl General Public License. As a special exception to the GNU General
1585 dnl Public License, this file may be distributed as part of a program
1586 dnl that contains a configuration script generated by Autoconf, under
1587 dnl the same distribution terms as the rest of that program.
1589 dnl This file can can be used in projects which are not available under
1590 dnl the GNU General Public License or the GNU Library General Public
1591 dnl License but which still want to provide support for the GNU gettext
1593 dnl Please note that the actual code of the GNU gettext library is covered
1594 dnl by the GNU Library General Public License, and the rest of the GNU
1595 dnl gettext package package is covered by the GNU General Public License.
1596 dnl They are *not* in the public domain.
1599 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
1601 # Search path for a program which passes the given test.
1603 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1604 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1605 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1607 # Prepare PATH_SEPARATOR.
1608 # The user is always right.
1609 if test "${PATH_SEPARATOR+set}" != set; then
1610 echo "#! /bin/sh" >conf$$.sh
1611 echo "exit 0" >>conf$$.sh
1613 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1621 # Find out how to test for executable files. Don't use a zero-byte file,
1622 # as systems may use methods other than mode bits to determine executability.
1623 cat >conf$$.file <<_ASEOF
1627 chmod +x conf$$.file
1628 if test -x conf$$.file >/dev/null 2>&1; then
1629 ac_executable_p="test -x"
1631 ac_executable_p="test -f"
1635 # Extract the first word of "$2", so it can be a program name with args.
1636 set dummy $2; ac_word=[$]2
1637 AC_MSG_CHECKING([for $ac_word])
1638 AC_CACHE_VAL(ac_cv_path_$1,
1640 [[\\/]]* | ?:[[\\/]]*)
1641 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1644 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
1645 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1647 test -z "$ac_dir" && ac_dir=.
1648 for ac_exec_ext in '' $ac_executable_extensions; do
1649 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
1651 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
1658 dnl If no 4th arg is given, leave the cache variable unset,
1659 dnl so AC_PATH_PROGS will keep looking.
1660 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1665 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1666 AC_MSG_RESULT([$]$1)