1 # generated automatically by aclocal 1.9.5 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # gettext.m4 serial 37 (gettext-0.14.4)
15 dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
16 dnl This file is free software; the Free Software Foundation
17 dnl gives unlimited permission to copy and/or distribute it,
18 dnl with or without modifications, as long as this notice is preserved.
20 dnl This file can can be used in projects which are not available under
21 dnl the GNU General Public License or the GNU Library General Public
22 dnl License but which still want to provide support for the GNU gettext
24 dnl Please note that the actual code of the GNU gettext library is covered
25 dnl by the GNU Library General Public License, and the rest of the GNU
26 dnl gettext package package is covered by the GNU General Public License.
27 dnl They are *not* in the public domain.
30 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
31 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
33 dnl Macro to add for using GNU gettext.
35 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
36 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
37 dnl default (if it is not specified or empty) is 'no-libtool'.
38 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
39 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
40 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
41 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
42 dnl depending on --{enable,disable}-{shared,static} and on the presence of
43 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
44 dnl $(top_builddir)/intl/libintl.a will be created.
45 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
46 dnl implementations (in libc or libintl) without the ngettext() function
47 dnl will be ignored. If NEEDSYMBOL is specified and is
48 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
49 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
50 dnl INTLDIR is used to find the intl libraries. If empty,
51 dnl the value `$(top_builddir)/intl/' is used.
53 dnl The result of the configuration is one of three cases:
54 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
56 dnl Catalog format: GNU --> install in $(datadir)
57 dnl Catalog extension: .mo after installation, .gmo in source tree
58 dnl 2) GNU gettext has been found in the system's C library.
59 dnl Catalog format: GNU --> install in $(datadir)
60 dnl Catalog extension: .mo after installation, .gmo in source tree
61 dnl 3) No internationalization, always use English msgid.
62 dnl Catalog format: none
63 dnl Catalog extension: none
64 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
65 dnl The use of .gmo is historical (it was needed to avoid overwriting the
66 dnl GNU format catalogs when building on a platform with an X/Open gettext),
67 dnl but we keep it in order not to force irrelevant filename changes on the
70 AC_DEFUN([AM_GNU_GETTEXT],
72 dnl Argument checking.
73 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
74 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
76 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
77 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
79 define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
80 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
82 AC_REQUIRE([AM_PO_SUBDIRS])dnl
83 ifelse(gt_included_intl, yes, [
84 AC_REQUIRE([AM_INTL_SUBDIR])dnl
87 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
88 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
89 AC_REQUIRE([AC_LIB_RPATH])
91 dnl Sometimes libintl requires libiconv, so first search for libiconv.
92 dnl Ideally we would do this search only after the
93 dnl if test "$USE_NLS" = "yes"; then
94 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
95 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
96 dnl the configure script would need to contain the same shell code
97 dnl again, outside any 'if'. There are two solutions:
98 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
99 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
100 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
101 dnl documented, we avoid it.
102 ifelse(gt_included_intl, yes, , [
103 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
106 dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
112 ifelse(gt_included_intl, yes, [
113 BUILD_INCLUDED_LIBINTL=no
114 USE_INCLUDED_LIBINTL=no
120 dnl If we use NLS figure out what method
121 if test "$USE_NLS" = "yes"; then
122 gt_use_preinstalled_gnugettext=no
123 ifelse(gt_included_intl, yes, [
124 AC_MSG_CHECKING([whether included gettext is requested])
125 AC_ARG_WITH(included-gettext,
126 [ --with-included-gettext use the GNU gettext library included here],
127 nls_cv_force_use_gnu_gettext=$withval,
128 nls_cv_force_use_gnu_gettext=no)
129 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
131 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
132 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
134 dnl User does not insist on using GNU NLS library. Figure out what
135 dnl to use. If GNU gettext is available we use this. Else we have
136 dnl to fall back to GNU NLS library.
138 dnl Add a version number to the cache macros.
139 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
140 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
141 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
143 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
144 [AC_TRY_LINK([#include <libintl.h>
145 ]ifelse([$2], [need-formatstring-macros],
146 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
147 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
150 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
152 ], [])[extern int _nl_msg_cat_cntr;
153 extern int *_nl_domain_bindings;],
154 [bindtextdomain ("", "");
155 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
156 gt_cv_func_gnugettext_libc=yes,
157 gt_cv_func_gnugettext_libc=no)])
159 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
160 dnl Sometimes libintl requires libiconv, so first search for libiconv.
161 ifelse(gt_included_intl, yes, , [
164 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
165 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
166 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
167 dnl even if libiconv doesn't exist.
168 AC_LIB_LINKFLAGS_BODY([intl])
169 AC_CACHE_CHECK([for GNU gettext in libintl],
170 gt_cv_func_gnugettext_libintl,
171 [gt_save_CPPFLAGS="$CPPFLAGS"
172 CPPFLAGS="$CPPFLAGS $INCINTL"
174 LIBS="$LIBS $LIBINTL"
175 dnl Now see whether libintl exists and does not depend on libiconv.
176 AC_TRY_LINK([#include <libintl.h>
177 ]ifelse([$2], [need-formatstring-macros],
178 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
179 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
182 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
184 ], [])[extern int _nl_msg_cat_cntr;
189 const char *_nl_expand_alias (const char *);],
190 [bindtextdomain ("", "");
191 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
192 gt_cv_func_gnugettext_libintl=yes,
193 gt_cv_func_gnugettext_libintl=no)
194 dnl Now see whether libintl exists and depends on libiconv.
195 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
196 LIBS="$LIBS $LIBICONV"
197 AC_TRY_LINK([#include <libintl.h>
198 ]ifelse([$2], [need-formatstring-macros],
199 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
200 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
203 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
205 ], [])[extern int _nl_msg_cat_cntr;
210 const char *_nl_expand_alias (const char *);],
211 [bindtextdomain ("", "");
212 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
213 [LIBINTL="$LIBINTL $LIBICONV"
214 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
215 gt_cv_func_gnugettext_libintl=yes
218 CPPFLAGS="$gt_save_CPPFLAGS"
219 LIBS="$gt_save_LIBS"])
222 dnl If an already present or preinstalled GNU gettext() is found,
223 dnl use it. But if this macro is used in GNU gettext, and GNU
224 dnl gettext is already preinstalled in libintl, we update this
225 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
226 if test "$gt_cv_func_gnugettext_libc" = "yes" \
227 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
228 && test "$PACKAGE" != gettext-runtime \
229 && test "$PACKAGE" != gettext-tools; }; then
230 gt_use_preinstalled_gnugettext=yes
232 dnl Reset the values set by searching for libintl.
238 ifelse(gt_included_intl, yes, [
239 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
240 dnl GNU gettext is not found in the C library.
241 dnl Fall back on included GNU gettext library.
242 nls_cv_use_gnu_gettext=yes
246 if test "$nls_cv_use_gnu_gettext" = "yes"; then
247 dnl Mark actions used to generate GNU NLS library.
248 BUILD_INCLUDED_LIBINTL=yes
249 USE_INCLUDED_LIBINTL=yes
250 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
251 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
252 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
256 if test "$gt_use_preinstalled_gnugettext" = "yes" \
257 || test "$nls_cv_use_gnu_gettext" = "yes"; then
258 dnl Mark actions to use GNU gettext tools.
263 if test -n "$INTL_MACOSX_LIBS"; then
264 if test "$gt_use_preinstalled_gnugettext" = "yes" \
265 || test "$nls_cv_use_gnu_gettext" = "yes"; then
266 dnl Some extra flags are needed during linking.
267 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
268 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
272 if test "$gt_use_preinstalled_gnugettext" = "yes" \
273 || test "$nls_cv_use_gnu_gettext" = "yes"; then
274 AC_DEFINE(ENABLE_NLS, 1,
275 [Define to 1 if translation of program messages to the user's native language
282 AC_MSG_CHECKING([whether to use NLS])
283 AC_MSG_RESULT([$USE_NLS])
284 if test "$USE_NLS" = "yes"; then
285 AC_MSG_CHECKING([where the gettext function comes from])
286 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
287 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
288 gt_source="external libintl"
293 gt_source="included intl directory"
295 AC_MSG_RESULT([$gt_source])
298 if test "$USE_NLS" = "yes"; then
300 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
301 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
302 AC_MSG_CHECKING([how to link with libintl])
303 AC_MSG_RESULT([$LIBINTL])
304 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
307 dnl For backward compatibility. Some packages may be using this.
308 AC_DEFINE(HAVE_GETTEXT, 1,
309 [Define if the GNU gettext() function is already present or preinstalled.])
310 AC_DEFINE(HAVE_DCGETTEXT, 1,
311 [Define if the GNU dcgettext() function is already present or preinstalled.])
314 dnl We need to process the po/ directory.
318 ifelse(gt_included_intl, yes, [
319 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
320 dnl to 'yes' because some of the testsuite requires it.
321 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
322 BUILD_INCLUDED_LIBINTL=yes
325 dnl Make all variables we use known to autoconf.
326 AC_SUBST(BUILD_INCLUDED_LIBINTL)
327 AC_SUBST(USE_INCLUDED_LIBINTL)
330 dnl For backward compatibility. Some configure.ins may be using this.
334 dnl For backward compatibility. Some Makefiles may be using this.
336 AC_SUBST(DATADIRNAME)
338 dnl For backward compatibility. Some Makefiles may be using this.
342 dnl For backward compatibility. Some Makefiles may be using this.
346 dnl For backward compatibility. Some Makefiles may be using this.
348 if test "$USE_INCLUDED_LIBINTL" = yes; then
349 INTLOBJS="\$(GETTOBJS)"
353 dnl Enable libtool support if the surrounding package wishes it.
354 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
355 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
358 dnl For backward compatibility. Some Makefiles may be using this.
362 dnl Make all documented variables known to autoconf.
369 dnl Checks for all prerequisites of the intl subdirectory,
370 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
371 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
372 AC_DEFUN([AM_INTL_SUBDIR],
374 AC_REQUIRE([AC_PROG_INSTALL])dnl
375 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
376 AC_REQUIRE([AC_PROG_CC])dnl
377 AC_REQUIRE([AC_CANONICAL_HOST])dnl
378 AC_REQUIRE([gt_GLIBC2])dnl
379 AC_REQUIRE([AC_PROG_RANLIB])dnl
380 AC_REQUIRE([AC_ISC_POSIX])dnl
381 AC_REQUIRE([AC_HEADER_STDC])dnl
382 AC_REQUIRE([AC_C_CONST])dnl
383 AC_REQUIRE([bh_C_SIGNED])dnl
384 AC_REQUIRE([AC_C_INLINE])dnl
385 AC_REQUIRE([AC_TYPE_OFF_T])dnl
386 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
387 AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
388 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
389 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
390 AC_REQUIRE([gt_TYPE_WINT_T])dnl
391 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
392 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
393 AC_REQUIRE([gt_TYPE_INTMAX_T])
394 AC_REQUIRE([gt_PRINTF_POSIX])
395 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
396 AC_REQUIRE([AC_FUNC_MMAP])dnl
397 AC_REQUIRE([gl_GLIBC21])dnl
398 AC_REQUIRE([gt_INTDIV0])dnl
399 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
400 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
401 AC_REQUIRE([gt_INTTYPES_PRI])dnl
402 AC_REQUIRE([gl_XSIZE])dnl
403 AC_REQUIRE([gt_INTL_MACOSX])dnl
405 AC_CHECK_TYPE([ptrdiff_t], ,
406 [AC_DEFINE([ptrdiff_t], [long],
407 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
409 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
410 stdlib.h string.h unistd.h sys/param.h])
411 AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
412 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
413 strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
416 dnl Use the _snprintf function only if it is declared (because on NetBSD it
417 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
418 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
419 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
421 dnl Use the *_unlocked functions only if they are declared.
422 dnl (because some of them were defined without being declared in Solaris
423 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
424 dnl on Solaris 2.5.1 to run on Solaris 2.6).
425 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
426 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
427 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
428 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
430 case $gt_cv_func_printf_posix in
431 *yes) HAVE_POSIX_PRINTF=1 ;;
432 *) HAVE_POSIX_PRINTF=0 ;;
434 AC_SUBST([HAVE_POSIX_PRINTF])
435 if test "$ac_cv_func_asprintf" = yes; then
440 AC_SUBST([HAVE_ASPRINTF])
441 if test "$ac_cv_func_snprintf" = yes; then
446 AC_SUBST([HAVE_SNPRINTF])
447 if test "$ac_cv_func_wprintf" = yes; then
452 AC_SUBST([HAVE_WPRINTF])
456 if test $ac_cv_header_locale_h = yes; then
460 if test -n "$INTL_MACOSX_LIBS"; then
461 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
464 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
465 dnl because plural.y uses bison specific features. It requires at least
466 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
468 dnl bison is only needed for the maintainer (who touches plural.y). But in
469 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
470 dnl the rule in general Makefile. Now, some people carelessly touch the
471 dnl files or have a broken "make" program, hence the plural.c rule will
472 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
473 dnl present or too old.
474 AC_CHECK_PROGS([INTLBISON], [bison])
475 if test -z "$INTLBISON"; then
478 dnl Found it, now check the version.
479 AC_MSG_CHECKING([version of bison])
480 changequote(<<,>>)dnl
481 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
482 case $ac_prog_version in
483 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
484 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
486 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
487 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
489 AC_MSG_RESULT([$ac_prog_version])
491 if test $ac_verc_fail = yes; then
497 dnl Checks for special options needed on MacOS X.
498 dnl Defines INTL_MACOSX_LIBS.
499 AC_DEFUN([gt_INTL_MACOSX],
501 dnl Check for API introduced in MacOS X 10.2.
502 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
503 gt_cv_func_CFPreferencesCopyAppValue,
504 [gt_save_CPPFLAGS="$CPPFLAGS"
505 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
507 LIBS="$LIBS -framework CoreFoundation"
508 AC_TRY_LINK([#include <CFPreferences.h>],
509 [CFPreferencesCopyAppValue(NULL, NULL)],
510 [gt_cv_func_CFPreferencesCopyAppValue=yes],
511 [gt_cv_func_CFPreferencesCopyAppValue=no])
512 CPPFLAGS="$gt_save_CPPFLAGS"
513 LIBS="$gt_save_LIBS"])
514 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
515 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
516 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
518 dnl Check for API introduced in MacOS X 10.3.
519 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
520 [gt_save_CPPFLAGS="$CPPFLAGS"
521 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
523 LIBS="$LIBS -framework CoreFoundation"
524 AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
525 [gt_cv_func_CFLocaleCopyCurrent=yes],
526 [gt_cv_func_CFLocaleCopyCurrent=no])
527 CPPFLAGS="$gt_save_CPPFLAGS"
528 LIBS="$gt_save_LIBS"])
529 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
530 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
531 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
534 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
535 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
537 AC_SUBST([INTL_MACOSX_LIBS])
541 dnl gt_CHECK_DECL(FUNC, INCLUDES)
542 dnl Check whether a function is declared.
543 AC_DEFUN([gt_CHECK_DECL],
545 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
546 [AC_TRY_COMPILE([$2], [
548 char *p = (char *) $1;
550 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
551 if test $ac_cv_have_decl_$1 = yes; then
556 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
557 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
561 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
562 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
564 # iconv.m4 serial AM4 (gettext-0.11.3)
565 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
566 dnl This file is free software; the Free Software Foundation
567 dnl gives unlimited permission to copy and/or distribute it,
568 dnl with or without modifications, as long as this notice is preserved.
570 dnl From Bruno Haible.
572 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
574 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
575 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
576 AC_REQUIRE([AC_LIB_RPATH])
578 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
580 AC_LIB_LINKFLAGS_BODY([iconv])
583 AC_DEFUN([AM_ICONV_LINK],
585 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
586 dnl those with the standalone portable GNU libiconv installed).
588 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
590 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
592 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
593 dnl because if the user has installed libiconv and not disabled its use
594 dnl via --without-libiconv-prefix, he wants to use it. The first
595 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
596 am_save_CPPFLAGS="$CPPFLAGS"
597 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
599 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
600 am_cv_func_iconv="no, consider installing GNU libiconv"
602 AC_TRY_LINK([#include <stdlib.h>
604 [iconv_t cd = iconv_open("","");
605 iconv(cd,NULL,NULL,NULL,NULL);
607 am_cv_func_iconv=yes)
608 if test "$am_cv_func_iconv" != yes; then
610 LIBS="$LIBS $LIBICONV"
611 AC_TRY_LINK([#include <stdlib.h>
613 [iconv_t cd = iconv_open("","");
614 iconv(cd,NULL,NULL,NULL,NULL);
617 am_cv_func_iconv=yes)
621 if test "$am_cv_func_iconv" = yes; then
622 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
624 if test "$am_cv_lib_iconv" = yes; then
625 AC_MSG_CHECKING([how to link with libiconv])
626 AC_MSG_RESULT([$LIBICONV])
628 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
630 CPPFLAGS="$am_save_CPPFLAGS"
641 if test "$am_cv_func_iconv" = yes; then
642 AC_MSG_CHECKING([for iconv declaration])
643 AC_CACHE_VAL(am_cv_proto_iconv, [
651 #if defined(__STDC__) || defined(__cplusplus)
652 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
656 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
657 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);"])
658 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
659 AC_MSG_RESULT([$]{ac_t:-
660 }[$]am_cv_proto_iconv)
661 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
662 [Define as const if the declaration of iconv() needs const.])
666 # lib-ld.m4 serial 3 (gettext-0.13)
667 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
668 dnl This file is free software; the Free Software Foundation
669 dnl gives unlimited permission to copy and/or distribute it,
670 dnl with or without modifications, as long as this notice is preserved.
672 dnl Subroutines of libtool.m4,
673 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
676 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
677 AC_DEFUN([AC_LIB_PROG_LD_GNU],
678 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
679 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
680 case `$LD -v 2>&1 </dev/null` in
681 *GNU* | *'with BFD'*)
682 acl_cv_prog_gnu_ld=yes ;;
684 acl_cv_prog_gnu_ld=no ;;
686 with_gnu_ld=$acl_cv_prog_gnu_ld
689 dnl From libtool-1.4. Sets the variable LD.
690 AC_DEFUN([AC_LIB_PROG_LD],
692 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
693 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
694 AC_REQUIRE([AC_PROG_CC])dnl
695 AC_REQUIRE([AC_CANONICAL_HOST])dnl
696 # Prepare PATH_SEPARATOR.
697 # The user is always right.
698 if test "${PATH_SEPARATOR+set}" != set; then
699 echo "#! /bin/sh" >conf$$.sh
700 echo "exit 0" >>conf$$.sh
702 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
710 if test "$GCC" = yes; then
711 # Check if gcc -print-prog-name=ld gives a path.
712 AC_MSG_CHECKING([for ld used by GCC])
715 # gcc leaves a trailing carriage return which upsets mingw
716 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
718 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
721 # Accept absolute paths.
722 [[\\/]* | [A-Za-z]:[\\/]*)]
723 [re_direlt='/[^/][^/]*/\.\./']
724 # Canonicalize the path of ld
725 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
726 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
727 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
729 test -z "$LD" && LD="$ac_prog"
732 # If it fails, then pretend we aren't using GCC.
736 # If it is relative, then search for the first ld in PATH.
740 elif test "$with_gnu_ld" = yes; then
741 AC_MSG_CHECKING([for GNU ld])
743 AC_MSG_CHECKING([for non-GNU ld])
745 AC_CACHE_VAL(acl_cv_path_LD,
746 [if test -z "$LD"; then
747 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
748 for ac_dir in $PATH; do
749 test -z "$ac_dir" && ac_dir=.
750 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
751 acl_cv_path_LD="$ac_dir/$ac_prog"
752 # Check to see if the program is GNU ld. I'd rather use --version,
753 # but apparently some GNU ld's only accept -v.
754 # Break only if it was the GNU/non-GNU ld that we prefer.
755 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
756 *GNU* | *'with BFD'*)
757 test "$with_gnu_ld" != no && break ;;
759 test "$with_gnu_ld" != yes && break ;;
765 acl_cv_path_LD="$LD" # Let the user override the test with a path.
768 if test -n "$LD"; then
773 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
777 # lib-link.m4 serial 6 (gettext-0.14.3)
778 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
779 dnl This file is free software; the Free Software Foundation
780 dnl gives unlimited permission to copy and/or distribute it,
781 dnl with or without modifications, as long as this notice is preserved.
783 dnl From Bruno Haible.
787 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
788 dnl the libraries corresponding to explicit and implicit dependencies.
789 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
790 dnl augments the CPPFLAGS variable.
791 AC_DEFUN([AC_LIB_LINKFLAGS],
793 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
794 AC_REQUIRE([AC_LIB_RPATH])
795 define([Name],[translit([$1],[./-], [___])])
796 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
797 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
798 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
799 AC_LIB_LINKFLAGS_BODY([$1], [$2])
800 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
801 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
802 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
804 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
805 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
806 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
807 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
809 AC_SUBST([LTLIB]NAME)
810 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
811 dnl results of this search when this library appears as a dependency.
817 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
818 dnl searches for libname and the libraries corresponding to explicit and
819 dnl implicit dependencies, together with the specified include files and
820 dnl the ability to compile and link the specified testcode. If found, it
821 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
822 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
823 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
824 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
825 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
827 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
828 AC_REQUIRE([AC_LIB_RPATH])
829 define([Name],[translit([$1],[./-], [___])])
830 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
831 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
833 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
835 AC_LIB_LINKFLAGS_BODY([$1], [$2])
837 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
838 dnl because if the user has installed lib[]Name and not disabled its use
839 dnl via --without-lib[]Name-prefix, he wants to use it.
840 ac_save_CPPFLAGS="$CPPFLAGS"
841 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
843 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
845 LIBS="$LIBS $LIB[]NAME"
846 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
849 if test "$ac_cv_lib[]Name" = yes; then
851 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
852 AC_MSG_CHECKING([how to link with lib[]$1])
853 AC_MSG_RESULT([$LIB[]NAME])
856 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
857 dnl $INC[]NAME either.
858 CPPFLAGS="$ac_save_CPPFLAGS"
862 AC_SUBST([HAVE_LIB]NAME)
864 AC_SUBST([LTLIB]NAME)
869 dnl Determine the platform dependent parameters needed to use rpath:
870 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
871 dnl hardcode_direct, hardcode_minus_L.
872 AC_DEFUN([AC_LIB_RPATH],
874 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
875 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
876 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
877 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
878 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
879 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
880 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
881 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
882 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
888 libext="$acl_cv_libext"
889 shlibext="$acl_cv_shlibext"
890 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
891 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
892 hardcode_direct="$acl_cv_hardcode_direct"
893 hardcode_minus_L="$acl_cv_hardcode_minus_L"
894 dnl Determine whether the user wants rpath handling at all.
896 [ --disable-rpath do not hardcode runtime library paths],
900 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
901 dnl the libraries corresponding to explicit and implicit dependencies.
902 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
903 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
905 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
906 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
907 dnl By default, look in $includedir and $libdir.
909 AC_LIB_WITH_FINAL_PREFIX([
910 eval additional_includedir=\"$includedir\"
911 eval additional_libdir=\"$libdir\"
913 AC_LIB_ARG_WITH([lib$1-prefix],
914 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
915 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
917 if test "X$withval" = "Xno"; then
920 if test "X$withval" = "X"; then
921 AC_LIB_WITH_FINAL_PREFIX([
922 eval additional_includedir=\"$includedir\"
923 eval additional_libdir=\"$libdir\"
926 additional_includedir="$withval/include"
927 additional_libdir="$withval/lib"
931 dnl Search the library and its dependencies in $additional_libdir and
932 dnl $LDFLAGS. Using breadth-first-seach.
938 names_already_handled=
939 names_next_round='$1 $2'
940 while test -n "$names_next_round"; do
941 names_this_round="$names_next_round"
943 for name in $names_this_round; do
945 for n in $names_already_handled; do
946 if test "$n" = "$name"; then
951 if test -z "$already_handled"; then
952 names_already_handled="$names_already_handled $name"
953 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
954 dnl or AC_LIB_HAVE_LINKFLAGS call.
955 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
956 eval value=\"\$HAVE_LIB$uppername\"
957 if test -n "$value"; then
958 if test "$value" = yes; then
959 eval value=\"\$LIB$uppername\"
960 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
961 eval value=\"\$LTLIB$uppername\"
962 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
964 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
965 dnl that this library doesn't exist. So just drop it.
969 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
970 dnl and the already constructed $LIBNAME/$LTLIBNAME.
975 if test $use_additional = yes; then
976 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
977 found_dir="$additional_libdir"
978 found_so="$additional_libdir/lib$name.$shlibext"
979 if test -f "$additional_libdir/lib$name.la"; then
980 found_la="$additional_libdir/lib$name.la"
983 if test -f "$additional_libdir/lib$name.$libext"; then
984 found_dir="$additional_libdir"
985 found_a="$additional_libdir/lib$name.$libext"
986 if test -f "$additional_libdir/lib$name.la"; then
987 found_la="$additional_libdir/lib$name.la"
992 if test "X$found_dir" = "X"; then
993 for x in $LDFLAGS $LTLIB[]NAME; do
994 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
997 dir=`echo "X$x" | sed -e 's/^X-L//'`
998 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1000 found_so="$dir/lib$name.$shlibext"
1001 if test -f "$dir/lib$name.la"; then
1002 found_la="$dir/lib$name.la"
1005 if test -f "$dir/lib$name.$libext"; then
1007 found_a="$dir/lib$name.$libext"
1008 if test -f "$dir/lib$name.la"; then
1009 found_la="$dir/lib$name.la"
1015 if test "X$found_dir" != "X"; then
1020 if test "X$found_dir" != "X"; then
1021 dnl Found the library.
1022 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1023 if test "X$found_so" != "X"; then
1024 dnl Linking with a shared library. We attempt to hardcode its
1025 dnl directory into the executable's runpath, unless it's the
1026 dnl standard /usr/lib.
1027 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1028 dnl No hardcoding is needed.
1029 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1031 dnl Use an explicit option to hardcode DIR into the resulting
1033 dnl Potentially add DIR to ltrpathdirs.
1034 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1036 for x in $ltrpathdirs; do
1037 if test "X$x" = "X$found_dir"; then
1042 if test -z "$haveit"; then
1043 ltrpathdirs="$ltrpathdirs $found_dir"
1045 dnl The hardcoding into $LIBNAME is system dependent.
1046 if test "$hardcode_direct" = yes; then
1047 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1048 dnl resulting binary.
1049 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1051 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1052 dnl Use an explicit option to hardcode DIR into the resulting
1054 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1055 dnl Potentially add DIR to rpathdirs.
1056 dnl The rpathdirs will be appended to $LIBNAME at the end.
1058 for x in $rpathdirs; do
1059 if test "X$x" = "X$found_dir"; then
1064 if test -z "$haveit"; then
1065 rpathdirs="$rpathdirs $found_dir"
1068 dnl Rely on "-L$found_dir".
1069 dnl But don't add it if it's already contained in the LDFLAGS
1070 dnl or the already constructed $LIBNAME
1072 for x in $LDFLAGS $LIB[]NAME; do
1073 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1074 if test "X$x" = "X-L$found_dir"; then
1079 if test -z "$haveit"; then
1080 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1082 if test "$hardcode_minus_L" != no; then
1083 dnl FIXME: Not sure whether we should use
1084 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1086 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1088 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1089 dnl here, because this doesn't fit in flags passed to the
1090 dnl compiler. So give up. No hardcoding. This affects only
1091 dnl very old systems.
1092 dnl FIXME: Not sure whether we should use
1093 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1095 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1101 if test "X$found_a" != "X"; then
1102 dnl Linking with a static library.
1103 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1105 dnl We shouldn't come here, but anyway it's good to have a
1107 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1110 dnl Assume the include files are nearby.
1111 additional_includedir=
1112 case "$found_dir" in
1114 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1115 additional_includedir="$basedir/include"
1118 if test "X$additional_includedir" != "X"; then
1119 dnl Potentially add $additional_includedir to $INCNAME.
1120 dnl But don't add it
1121 dnl 1. if it's the standard /usr/include,
1122 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1123 dnl 3. if it's already present in $CPPFLAGS or the already
1124 dnl constructed $INCNAME,
1125 dnl 4. if it doesn't exist as a directory.
1126 if test "X$additional_includedir" != "X/usr/include"; then
1128 if test "X$additional_includedir" = "X/usr/local/include"; then
1129 if test -n "$GCC"; then
1131 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1135 if test -z "$haveit"; then
1136 for x in $CPPFLAGS $INC[]NAME; do
1137 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1138 if test "X$x" = "X-I$additional_includedir"; then
1143 if test -z "$haveit"; then
1144 if test -d "$additional_includedir"; then
1145 dnl Really add $additional_includedir to $INCNAME.
1146 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1152 dnl Look for dependencies.
1153 if test -n "$found_la"; then
1154 dnl Read the .la file. It defines the variables
1155 dnl dlname, library_names, old_library, dependency_libs, current,
1156 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1157 save_libdir="$libdir"
1159 */* | *\\*) . "$found_la" ;;
1160 *) . "./$found_la" ;;
1162 libdir="$save_libdir"
1163 dnl We use only dependency_libs.
1164 for dep in $dependency_libs; do
1167 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1168 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1169 dnl But don't add it
1170 dnl 1. if it's the standard /usr/lib,
1171 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1172 dnl 3. if it's already present in $LDFLAGS or the already
1173 dnl constructed $LIBNAME,
1174 dnl 4. if it doesn't exist as a directory.
1175 if test "X$additional_libdir" != "X/usr/lib"; then
1177 if test "X$additional_libdir" = "X/usr/local/lib"; then
1178 if test -n "$GCC"; then
1180 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1184 if test -z "$haveit"; then
1186 for x in $LDFLAGS $LIB[]NAME; do
1187 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1188 if test "X$x" = "X-L$additional_libdir"; then
1193 if test -z "$haveit"; then
1194 if test -d "$additional_libdir"; then
1195 dnl Really add $additional_libdir to $LIBNAME.
1196 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1200 for x in $LDFLAGS $LTLIB[]NAME; do
1201 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1202 if test "X$x" = "X-L$additional_libdir"; then
1207 if test -z "$haveit"; then
1208 if test -d "$additional_libdir"; then
1209 dnl Really add $additional_libdir to $LTLIBNAME.
1210 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1217 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1218 if test "$enable_rpath" != no; then
1219 dnl Potentially add DIR to rpathdirs.
1220 dnl The rpathdirs will be appended to $LIBNAME at the end.
1222 for x in $rpathdirs; do
1223 if test "X$x" = "X$dir"; then
1228 if test -z "$haveit"; then
1229 rpathdirs="$rpathdirs $dir"
1231 dnl Potentially add DIR to ltrpathdirs.
1232 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1234 for x in $ltrpathdirs; do
1235 if test "X$x" = "X$dir"; then
1240 if test -z "$haveit"; then
1241 ltrpathdirs="$ltrpathdirs $dir"
1246 dnl Handle this in the next round.
1247 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1250 dnl Handle this in the next round. Throw away the .la's
1251 dnl directory; it is already contained in a preceding -L
1253 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1256 dnl Most likely an immediate library name.
1257 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1258 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1264 dnl Didn't find the library; assume it is in the system directories
1265 dnl known to the linker and runtime loader. (All the system
1266 dnl directories known to the linker should also be known to the
1267 dnl runtime loader, otherwise the system is severely misconfigured.)
1268 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1269 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1275 if test "X$rpathdirs" != "X"; then
1276 if test -n "$hardcode_libdir_separator"; then
1277 dnl Weird platform: only the last -rpath option counts, the user must
1278 dnl pass all path elements in one option. We can arrange that for a
1279 dnl single library, but not when more than one $LIBNAMEs are used.
1281 for found_dir in $rpathdirs; do
1282 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1284 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1285 acl_save_libdir="$libdir"
1287 eval flag=\"$hardcode_libdir_flag_spec\"
1288 libdir="$acl_save_libdir"
1289 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1291 dnl The -rpath options are cumulative.
1292 for found_dir in $rpathdirs; do
1293 acl_save_libdir="$libdir"
1295 eval flag=\"$hardcode_libdir_flag_spec\"
1296 libdir="$acl_save_libdir"
1297 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1301 if test "X$ltrpathdirs" != "X"; then
1302 dnl When using libtool, the option that works for both libraries and
1303 dnl executables is -R. The -R options are cumulative.
1304 for found_dir in $ltrpathdirs; do
1305 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1310 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1311 dnl unless already present in VAR.
1312 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1313 dnl contains two or three consecutive elements that belong together.
1314 AC_DEFUN([AC_LIB_APPENDTOVAR],
1316 for element in [$2]; do
1319 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1320 if test "X$x" = "X$element"; then
1325 if test -z "$haveit"; then
1326 [$1]="${[$1]}${[$1]:+ }$element"
1331 # lib-prefix.m4 serial 4 (gettext-0.14.2)
1332 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1333 dnl This file is free software; the Free Software Foundation
1334 dnl gives unlimited permission to copy and/or distribute it,
1335 dnl with or without modifications, as long as this notice is preserved.
1337 dnl From Bruno Haible.
1339 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1340 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1341 dnl require excessive bracketing.
1342 ifdef([AC_HELP_STRING],
1343 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1344 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1346 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1347 dnl to access previously installed libraries. The basic assumption is that
1348 dnl a user will want packages to use other packages he previously installed
1349 dnl with the same --prefix option.
1350 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1351 dnl libraries, but is otherwise very convenient.
1352 AC_DEFUN([AC_LIB_PREFIX],
1354 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1355 AC_REQUIRE([AC_PROG_CC])
1356 AC_REQUIRE([AC_CANONICAL_HOST])
1357 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1358 dnl By default, look in $includedir and $libdir.
1360 AC_LIB_WITH_FINAL_PREFIX([
1361 eval additional_includedir=\"$includedir\"
1362 eval additional_libdir=\"$libdir\"
1364 AC_LIB_ARG_WITH([lib-prefix],
1365 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1366 --without-lib-prefix don't search for libraries in includedir and libdir],
1368 if test "X$withval" = "Xno"; then
1371 if test "X$withval" = "X"; then
1372 AC_LIB_WITH_FINAL_PREFIX([
1373 eval additional_includedir=\"$includedir\"
1374 eval additional_libdir=\"$libdir\"
1377 additional_includedir="$withval/include"
1378 additional_libdir="$withval/lib"
1382 if test $use_additional = yes; then
1383 dnl Potentially add $additional_includedir to $CPPFLAGS.
1384 dnl But don't add it
1385 dnl 1. if it's the standard /usr/include,
1386 dnl 2. if it's already present in $CPPFLAGS,
1387 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1388 dnl 4. if it doesn't exist as a directory.
1389 if test "X$additional_includedir" != "X/usr/include"; then
1391 for x in $CPPFLAGS; do
1392 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1393 if test "X$x" = "X-I$additional_includedir"; then
1398 if test -z "$haveit"; then
1399 if test "X$additional_includedir" = "X/usr/local/include"; then
1400 if test -n "$GCC"; then
1402 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1406 if test -z "$haveit"; then
1407 if test -d "$additional_includedir"; then
1408 dnl Really add $additional_includedir to $CPPFLAGS.
1409 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1414 dnl Potentially add $additional_libdir to $LDFLAGS.
1415 dnl But don't add it
1416 dnl 1. if it's the standard /usr/lib,
1417 dnl 2. if it's already present in $LDFLAGS,
1418 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1419 dnl 4. if it doesn't exist as a directory.
1420 if test "X$additional_libdir" != "X/usr/lib"; then
1422 for x in $LDFLAGS; do
1423 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1424 if test "X$x" = "X-L$additional_libdir"; then
1429 if test -z "$haveit"; then
1430 if test "X$additional_libdir" = "X/usr/local/lib"; then
1431 if test -n "$GCC"; then
1433 linux*) haveit=yes;;
1437 if test -z "$haveit"; then
1438 if test -d "$additional_libdir"; then
1439 dnl Really add $additional_libdir to $LDFLAGS.
1440 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1448 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1449 dnl acl_final_exec_prefix, containing the values to which $prefix and
1450 dnl $exec_prefix will expand at the end of the configure script.
1451 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1453 dnl Unfortunately, prefix and exec_prefix get only finally determined
1454 dnl at the end of configure.
1455 if test "X$prefix" = "XNONE"; then
1456 acl_final_prefix="$ac_default_prefix"
1458 acl_final_prefix="$prefix"
1460 if test "X$exec_prefix" = "XNONE"; then
1461 acl_final_exec_prefix='${prefix}'
1463 acl_final_exec_prefix="$exec_prefix"
1465 acl_save_prefix="$prefix"
1466 prefix="$acl_final_prefix"
1467 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1468 prefix="$acl_save_prefix"
1471 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1472 dnl variables prefix and exec_prefix bound to the values they will have
1473 dnl at the end of the configure script.
1474 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1476 acl_save_prefix="$prefix"
1477 prefix="$acl_final_prefix"
1478 acl_save_exec_prefix="$exec_prefix"
1479 exec_prefix="$acl_final_exec_prefix"
1481 exec_prefix="$acl_save_exec_prefix"
1482 prefix="$acl_save_prefix"
1485 # nls.m4 serial 2 (gettext-0.14.3)
1486 dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc.
1487 dnl This file is free software; the Free Software Foundation
1488 dnl gives unlimited permission to copy and/or distribute it,
1489 dnl with or without modifications, as long as this notice is preserved.
1491 dnl This file can can be used in projects which are not available under
1492 dnl the GNU General Public License or the GNU Library General Public
1493 dnl License but which still want to provide support for the GNU gettext
1495 dnl Please note that the actual code of the GNU gettext library is covered
1496 dnl by the GNU Library General Public License, and the rest of the GNU
1497 dnl gettext package package is covered by the GNU General Public License.
1498 dnl They are *not* in the public domain.
1501 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1502 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1508 AC_MSG_CHECKING([whether NLS is requested])
1509 dnl Default is enabled NLS
1511 [ --disable-nls do not use Native Language Support],
1512 USE_NLS=$enableval, USE_NLS=yes)
1513 AC_MSG_RESULT($USE_NLS)
1517 AC_DEFUN([AM_MKINSTALLDIRS],
1519 dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing.
1520 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])])
1521 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1522 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1523 dnl Try to locate it.
1525 if test -n "$ac_aux_dir"; then
1526 case "$ac_aux_dir" in
1527 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1528 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1531 if test -z "$MKINSTALLDIRS"; then
1532 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1534 AC_SUBST(MKINSTALLDIRS)
1537 # po.m4 serial 7 (gettext-0.14.3)
1538 dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
1539 dnl This file is free software; the Free Software Foundation
1540 dnl gives unlimited permission to copy and/or distribute it,
1541 dnl with or without modifications, as long as this notice is preserved.
1543 dnl This file can can be used in projects which are not available under
1544 dnl the GNU General Public License or the GNU Library General Public
1545 dnl License but which still want to provide support for the GNU gettext
1547 dnl Please note that the actual code of the GNU gettext library is covered
1548 dnl by the GNU Library General Public License, and the rest of the GNU
1549 dnl gettext package package is covered by the GNU General Public License.
1550 dnl They are *not* in the public domain.
1553 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1554 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1558 dnl Checks for all prerequisites of the po subdirectory.
1559 AC_DEFUN([AM_PO_SUBDIRS],
1561 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1562 AC_REQUIRE([AC_PROG_INSTALL])dnl
1563 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1564 AC_REQUIRE([AM_NLS])dnl
1566 dnl Perform the following tests also if --disable-nls has been given,
1567 dnl because they are needed for "make dist" to work.
1569 dnl Search for GNU msgfmt in the PATH.
1570 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1571 dnl The second test excludes FreeBSD msgfmt.
1572 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1573 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1574 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1576 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1578 dnl Search for GNU xgettext 0.12 or newer in the PATH.
1579 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1580 dnl The second test excludes FreeBSD xgettext.
1581 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1582 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1583 (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)],
1585 dnl Remove leftover from FreeBSD xgettext call.
1588 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1589 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1590 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
1592 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1593 dnl Test whether we really found GNU msgfmt.
1594 if test "$GMSGFMT" != ":"; then
1595 dnl If it is no GNU msgfmt we define it as : so that the
1596 dnl Makefiles still can work.
1597 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1598 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1601 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1603 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1608 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1609 dnl Test whether we really found GNU xgettext.
1610 if test "$XGETTEXT" != ":"; then
1611 dnl If it is no GNU xgettext we define it as : so that the
1612 dnl Makefiles still can work.
1613 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1614 (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
1618 [found xgettext program is not GNU xgettext; ignore it])
1621 dnl Remove leftover from FreeBSD xgettext call.
1625 AC_OUTPUT_COMMANDS([
1626 for ac_file in $CONFIG_FILES; do
1627 # Support "outfile[:infile[:infile...]]"
1629 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1631 # PO directories have a Makefile.in generated from Makefile.in.in.
1632 case "$ac_file" in */Makefile.in)
1633 # Adjust a relative srcdir.
1634 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1635 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1636 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1637 # In autoconf-2.13 it is called $ac_given_srcdir.
1638 # In autoconf-2.50 it is called $srcdir.
1639 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1640 case "$ac_given_srcdir" in
1641 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1642 /*) top_srcdir="$ac_given_srcdir" ;;
1643 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1645 # Treat a directory as a PO directory if and only if it has a
1646 # POTFILES.in file. This allows packages to have multiple PO
1647 # directories under different names or in different locations.
1648 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1649 rm -f "$ac_dir/POTFILES"
1650 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1651 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1652 POMAKEFILEDEPS="POTFILES.in"
1653 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1654 # on $ac_dir but don't depend on user-specified configuration
1656 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1657 # The LINGUAS file contains the set of available languages.
1658 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1659 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1661 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1662 # Hide the ALL_LINGUAS assigment from automake.
1663 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1664 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1666 # The set of available languages was given in configure.in.
1667 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1670 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1671 # Compute UPDATEPOFILES
1672 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1673 # Compute DUMMYPOFILES
1674 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1676 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1677 case "$ac_given_srcdir" in
1679 *) srcdirpre='$(srcdir)/' ;;
1685 for lang in $ALL_LINGUAS; do
1686 POFILES="$POFILES $srcdirpre$lang.po"
1687 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1688 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1689 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1691 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1692 # environment variable.
1694 if test -n "$ALL_LINGUAS"; then
1695 for presentlang in $ALL_LINGUAS; do
1697 if test "%UNSET%" != "$LINGUAS"; then
1698 desiredlanguages="$LINGUAS"
1700 desiredlanguages="$ALL_LINGUAS"
1702 for desiredlang in $desiredlanguages; do
1703 # Use the presentlang catalog if desiredlang is
1704 # a. equal to presentlang, or
1705 # b. a variant of presentlang (because in this case,
1706 # presentlang can be used as a fallback for messages
1707 # which are not translated in the desiredlang catalog).
1708 case "$desiredlang" in
1709 "$presentlang"*) useit=yes;;
1712 if test $useit = yes; then
1713 INST_LINGUAS="$INST_LINGUAS $presentlang"
1718 if test -n "$INST_LINGUAS"; then
1719 for lang in $INST_LINGUAS; do
1720 CATALOGS="$CATALOGS $lang.gmo"
1723 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1724 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1725 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1726 if test -f "$f"; then
1728 *.orig | *.bak | *~) ;;
1729 *) cat "$f" >> "$ac_dir/Makefile" ;;
1737 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1738 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
1740 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1741 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1742 LINGUAS="${LINGUAS-%UNSET%}"
1746 dnl Postprocesses a Makefile in a directory containing PO files.
1747 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
1749 # When this code is run, in config.status, two variables have already been
1751 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
1752 # - LINGUAS is the value of the environment variable LINGUAS at configure
1756 # Adjust a relative srcdir.
1757 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1758 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1759 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1760 # In autoconf-2.13 it is called $ac_given_srcdir.
1761 # In autoconf-2.50 it is called $srcdir.
1762 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1763 case "$ac_given_srcdir" in
1764 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1765 /*) top_srcdir="$ac_given_srcdir" ;;
1766 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1769 # Find a way to echo strings without interpreting backslash.
1770 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
1773 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
1774 gt_echo='printf %s\n'
1785 # A sed script that extracts the value of VARIABLE from a Makefile.
1787 # Test if the hold space is empty.
1792 # Yes it was empty. Look if we have the expected variable definition.
1793 /^[ ]*VARIABLE[ ]*=/{
1794 # Seen the first line of the variable definition.
1795 s/^[ ]*VARIABLE[ ]*=//
1800 # Here we are processing a line from the variable definition.
1801 # Remove comment, more precisely replace it with a space.
1803 # See if the line ends in a backslash.
1807 # Print the line, without the trailing backslash.
1810 # There was no trailing backslash. The end of the variable definition is
1811 # reached. Clear the hold space.
1816 # A trailing backslash means that the variable definition continues in the
1817 # next line. Put a nonempty string into the hold space to indicate this.
1824 # Set POTFILES to the value of the Makefile variable POTFILES.
1825 sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
1826 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
1827 # Compute POTFILES_DEPS as
1828 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
1830 for file in $POTFILES; do
1831 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
1835 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1836 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1838 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1839 # The LINGUAS file contains the set of available languages.
1840 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1841 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1843 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
1844 sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
1845 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
1847 # Hide the ALL_LINGUAS assigment from automake.
1848 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1850 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1851 # Compute UPDATEPOFILES
1852 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1853 # Compute DUMMYPOFILES
1854 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1856 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1857 # Compute PROPERTIESFILES
1858 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
1859 # Compute CLASSFILES
1860 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
1862 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
1864 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
1865 # Compute RESOURCESDLLFILES
1866 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
1867 case "$ac_given_srcdir" in
1869 *) srcdirpre='$(srcdir)/' ;;
1880 for lang in $ALL_LINGUAS; do
1881 POFILES="$POFILES $srcdirpre$lang.po"
1882 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1883 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1884 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1885 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
1886 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
1887 QMFILES="$QMFILES $srcdirpre$lang.qm"
1888 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1889 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
1890 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
1891 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
1893 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1894 # environment variable.
1896 if test -n "$ALL_LINGUAS"; then
1897 for presentlang in $ALL_LINGUAS; do
1899 if test "%UNSET%" != "$LINGUAS"; then
1900 desiredlanguages="$LINGUAS"
1902 desiredlanguages="$ALL_LINGUAS"
1904 for desiredlang in $desiredlanguages; do
1905 # Use the presentlang catalog if desiredlang is
1906 # a. equal to presentlang, or
1907 # b. a variant of presentlang (because in this case,
1908 # presentlang can be used as a fallback for messages
1909 # which are not translated in the desiredlang catalog).
1910 case "$desiredlang" in
1911 "$presentlang"*) useit=yes;;
1914 if test $useit = yes; then
1915 INST_LINGUAS="$INST_LINGUAS $presentlang"
1924 if test -n "$INST_LINGUAS"; then
1925 for lang in $INST_LINGUAS; do
1926 CATALOGS="$CATALOGS $lang.gmo"
1927 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
1928 QTCATALOGS="$QTCATALOGS $lang.qm"
1929 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1930 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
1931 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
1932 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
1936 sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
1937 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
1938 # Add dependencies that cannot be formulated as a simple suffix rule.
1939 for lang in $ALL_LINGUAS; do
1940 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1941 cat >> "$ac_file.tmp" <<EOF
1942 $frobbedlang.msg: $lang.po
1943 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
1944 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1948 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
1949 # Add dependencies that cannot be formulated as a simple suffix rule.
1950 for lang in $ALL_LINGUAS; do
1951 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
1952 cat >> "$ac_file.tmp" <<EOF
1953 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
1954 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
1955 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1959 if test -n "$POMAKEFILEDEPS"; then
1960 cat >> "$ac_file.tmp" <<EOF
1961 Makefile: $POMAKEFILEDEPS
1964 mv "$ac_file.tmp" "$ac_file"
1967 # progtest.m4 serial 4 (gettext-0.14.2)
1968 dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
1969 dnl This file is free software; the Free Software Foundation
1970 dnl gives unlimited permission to copy and/or distribute it,
1971 dnl with or without modifications, as long as this notice is preserved.
1973 dnl This file can can be used in projects which are not available under
1974 dnl the GNU General Public License or the GNU Library General Public
1975 dnl License but which still want to provide support for the GNU gettext
1977 dnl Please note that the actual code of the GNU gettext library is covered
1978 dnl by the GNU Library General Public License, and the rest of the GNU
1979 dnl gettext package package is covered by the GNU General Public License.
1980 dnl They are *not* in the public domain.
1983 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
1987 # Search path for a program which passes the given test.
1989 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1990 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1991 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1993 # Prepare PATH_SEPARATOR.
1994 # The user is always right.
1995 if test "${PATH_SEPARATOR+set}" != set; then
1996 echo "#! /bin/sh" >conf$$.sh
1997 echo "exit 0" >>conf$$.sh
1999 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2007 # Find out how to test for executable files. Don't use a zero-byte file,
2008 # as systems may use methods other than mode bits to determine executability.
2009 cat >conf$$.file <<_ASEOF
2013 chmod +x conf$$.file
2014 if test -x conf$$.file >/dev/null 2>&1; then
2015 ac_executable_p="test -x"
2017 ac_executable_p="test -f"
2021 # Extract the first word of "$2", so it can be a program name with args.
2022 set dummy $2; ac_word=[$]2
2023 AC_MSG_CHECKING([for $ac_word])
2024 AC_CACHE_VAL(ac_cv_path_$1,
2026 [[\\/]]* | ?:[[\\/]]*)
2027 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2030 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2031 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2033 test -z "$ac_dir" && ac_dir=.
2034 for ac_exec_ext in '' $ac_executable_extensions; do
2035 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2036 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2038 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2045 dnl If no 4th arg is given, leave the cache variable unset,
2046 dnl so AC_PATH_PROGS will keep looking.
2047 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2052 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2053 AC_MSG_RESULT([$]$1)
2060 m4_include([bacula-macros/db.m4])
2061 m4_include([bacula-macros/largefiles.m4])
2062 m4_include([bacula-macros/os.m4])