1 # generated automatically by aclocal 1.10.1 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008 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 60 (gettext-0.17)
15 dnl Copyright (C) 1995-2007 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-2006.
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],
80 ifelse([$1], [external],
81 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
83 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
85 AM_GNU_GETTEXT_NEED([$2])
87 AC_REQUIRE([AM_PO_SUBDIRS])dnl
88 ifelse(gt_included_intl, yes, [
89 AC_REQUIRE([AM_INTL_SUBDIR])dnl
92 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
93 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
94 AC_REQUIRE([AC_LIB_RPATH])
96 dnl Sometimes libintl requires libiconv, so first search for libiconv.
97 dnl Ideally we would do this search only after the
98 dnl if test "$USE_NLS" = "yes"; then
99 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
100 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
101 dnl the configure script would need to contain the same shell code
102 dnl again, outside any 'if'. There are two solutions:
103 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
104 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
105 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
106 dnl documented, we avoid it.
107 ifelse(gt_included_intl, yes, , [
108 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
111 dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
117 ifelse(gt_included_intl, yes, [
118 BUILD_INCLUDED_LIBINTL=no
119 USE_INCLUDED_LIBINTL=no
125 dnl Add a version number to the cache macros.
126 case " $gt_needs " in
127 *" need-formatstring-macros "*) gt_api_version=3 ;;
128 *" need-ngettext "*) gt_api_version=2 ;;
129 *) gt_api_version=1 ;;
131 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
132 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
134 dnl If we use NLS figure out what method
135 if test "$USE_NLS" = "yes"; then
136 gt_use_preinstalled_gnugettext=no
137 ifelse(gt_included_intl, yes, [
138 AC_MSG_CHECKING([whether included gettext is requested])
139 AC_ARG_WITH(included-gettext,
140 [ --with-included-gettext use the GNU gettext library included here],
141 nls_cv_force_use_gnu_gettext=$withval,
142 nls_cv_force_use_gnu_gettext=no)
143 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
145 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
146 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
148 dnl User does not insist on using GNU NLS library. Figure out what
149 dnl to use. If GNU gettext is available we use this. Else we have
150 dnl to fall back to GNU NLS library.
152 if test $gt_api_version -ge 3; then
153 gt_revision_test_code='
154 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
155 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
158 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
162 gt_revision_test_code=
164 if test $gt_api_version -ge 2; then
165 gt_expression_test_code=' + * ngettext ("", "", 0)'
167 gt_expression_test_code=
170 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
171 [AC_TRY_LINK([#include <libintl.h>
172 $gt_revision_test_code
173 extern int _nl_msg_cat_cntr;
174 extern int *_nl_domain_bindings;],
175 [bindtextdomain ("", "");
176 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
177 [eval "$gt_func_gnugettext_libc=yes"],
178 [eval "$gt_func_gnugettext_libc=no"])])
180 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
181 dnl Sometimes libintl requires libiconv, so first search for libiconv.
182 ifelse(gt_included_intl, yes, , [
185 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
186 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
187 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
188 dnl even if libiconv doesn't exist.
189 AC_LIB_LINKFLAGS_BODY([intl])
190 AC_CACHE_CHECK([for GNU gettext in libintl],
191 [$gt_func_gnugettext_libintl],
192 [gt_save_CPPFLAGS="$CPPFLAGS"
193 CPPFLAGS="$CPPFLAGS $INCINTL"
195 LIBS="$LIBS $LIBINTL"
196 dnl Now see whether libintl exists and does not depend on libiconv.
197 AC_TRY_LINK([#include <libintl.h>
198 $gt_revision_test_code
199 extern int _nl_msg_cat_cntr;
204 const char *_nl_expand_alias (const char *);],
205 [bindtextdomain ("", "");
206 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
207 [eval "$gt_func_gnugettext_libintl=yes"],
208 [eval "$gt_func_gnugettext_libintl=no"])
209 dnl Now see whether libintl exists and depends on libiconv.
210 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
211 LIBS="$LIBS $LIBICONV"
212 AC_TRY_LINK([#include <libintl.h>
213 $gt_revision_test_code
214 extern int _nl_msg_cat_cntr;
219 const char *_nl_expand_alias (const char *);],
220 [bindtextdomain ("", "");
221 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
222 [LIBINTL="$LIBINTL $LIBICONV"
223 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
224 eval "$gt_func_gnugettext_libintl=yes"
227 CPPFLAGS="$gt_save_CPPFLAGS"
228 LIBS="$gt_save_LIBS"])
231 dnl If an already present or preinstalled GNU gettext() is found,
232 dnl use it. But if this macro is used in GNU gettext, and GNU
233 dnl gettext is already preinstalled in libintl, we update this
234 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
235 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
236 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
237 && test "$PACKAGE" != gettext-runtime \
238 && test "$PACKAGE" != gettext-tools; }; then
239 gt_use_preinstalled_gnugettext=yes
241 dnl Reset the values set by searching for libintl.
247 ifelse(gt_included_intl, yes, [
248 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
249 dnl GNU gettext is not found in the C library.
250 dnl Fall back on included GNU gettext library.
251 nls_cv_use_gnu_gettext=yes
255 if test "$nls_cv_use_gnu_gettext" = "yes"; then
256 dnl Mark actions used to generate GNU NLS library.
257 BUILD_INCLUDED_LIBINTL=yes
258 USE_INCLUDED_LIBINTL=yes
259 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
260 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
261 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
265 if test "$gt_use_preinstalled_gnugettext" = "yes" \
266 || test "$nls_cv_use_gnu_gettext" = "yes"; then
267 dnl Mark actions to use GNU gettext tools.
272 if test -n "$INTL_MACOSX_LIBS"; then
273 if test "$gt_use_preinstalled_gnugettext" = "yes" \
274 || test "$nls_cv_use_gnu_gettext" = "yes"; then
275 dnl Some extra flags are needed during linking.
276 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
277 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
281 if test "$gt_use_preinstalled_gnugettext" = "yes" \
282 || test "$nls_cv_use_gnu_gettext" = "yes"; then
283 AC_DEFINE(ENABLE_NLS, 1,
284 [Define to 1 if translation of program messages to the user's native language
291 AC_MSG_CHECKING([whether to use NLS])
292 AC_MSG_RESULT([$USE_NLS])
293 if test "$USE_NLS" = "yes"; then
294 AC_MSG_CHECKING([where the gettext function comes from])
295 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
296 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
297 gt_source="external libintl"
302 gt_source="included intl directory"
304 AC_MSG_RESULT([$gt_source])
307 if test "$USE_NLS" = "yes"; then
309 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
310 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
311 AC_MSG_CHECKING([how to link with libintl])
312 AC_MSG_RESULT([$LIBINTL])
313 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
316 dnl For backward compatibility. Some packages may be using this.
317 AC_DEFINE(HAVE_GETTEXT, 1,
318 [Define if the GNU gettext() function is already present or preinstalled.])
319 AC_DEFINE(HAVE_DCGETTEXT, 1,
320 [Define if the GNU dcgettext() function is already present or preinstalled.])
323 dnl We need to process the po/ directory.
327 ifelse(gt_included_intl, yes, [
328 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
329 dnl to 'yes' because some of the testsuite requires it.
330 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
331 BUILD_INCLUDED_LIBINTL=yes
334 dnl Make all variables we use known to autoconf.
335 AC_SUBST(BUILD_INCLUDED_LIBINTL)
336 AC_SUBST(USE_INCLUDED_LIBINTL)
339 dnl For backward compatibility. Some configure.ins may be using this.
343 dnl For backward compatibility. Some Makefiles may be using this.
345 AC_SUBST(DATADIRNAME)
347 dnl For backward compatibility. Some Makefiles may be using this.
351 dnl For backward compatibility. Some Makefiles may be using this.
355 dnl For backward compatibility. Some Makefiles may be using this.
357 if test "$USE_INCLUDED_LIBINTL" = yes; then
358 INTLOBJS="\$(GETTOBJS)"
362 dnl Enable libtool support if the surrounding package wishes it.
363 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
364 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
367 dnl For backward compatibility. Some Makefiles may be using this.
371 dnl Make all documented variables known to autoconf.
378 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
379 m4_define([gt_NEEDS_INIT],
381 m4_divert_text([DEFAULTS], [gt_needs=])
382 m4_define([gt_NEEDS_INIT], [])
386 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
387 AC_DEFUN([AM_GNU_GETTEXT_NEED],
389 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
393 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
394 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
396 # iconv.m4 serial AM6 (gettext-0.17)
397 dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc.
398 dnl This file is free software; the Free Software Foundation
399 dnl gives unlimited permission to copy and/or distribute it,
400 dnl with or without modifications, as long as this notice is preserved.
402 dnl From Bruno Haible.
404 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
406 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
407 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
408 AC_REQUIRE([AC_LIB_RPATH])
410 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
412 AC_LIB_LINKFLAGS_BODY([iconv])
415 AC_DEFUN([AM_ICONV_LINK],
417 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
418 dnl those with the standalone portable GNU libiconv installed).
419 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
421 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
423 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
425 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
426 dnl because if the user has installed libiconv and not disabled its use
427 dnl via --without-libiconv-prefix, he wants to use it. The first
428 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
429 am_save_CPPFLAGS="$CPPFLAGS"
430 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
432 AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
433 am_cv_func_iconv="no, consider installing GNU libiconv"
435 AC_TRY_LINK([#include <stdlib.h>
437 [iconv_t cd = iconv_open("","");
438 iconv(cd,NULL,NULL,NULL,NULL);
440 am_cv_func_iconv=yes)
441 if test "$am_cv_func_iconv" != yes; then
443 LIBS="$LIBS $LIBICONV"
444 AC_TRY_LINK([#include <stdlib.h>
446 [iconv_t cd = iconv_open("","");
447 iconv(cd,NULL,NULL,NULL,NULL);
450 am_cv_func_iconv=yes)
454 if test "$am_cv_func_iconv" = yes; then
455 AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
456 dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
458 if test $am_cv_lib_iconv = yes; then
459 LIBS="$LIBS $LIBICONV"
466 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
469 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
470 if (cd_utf8_to_88591 != (iconv_t)(-1))
472 static const char input[] = "\342\202\254"; /* EURO SIGN */
474 const char *inptr = input;
475 size_t inbytesleft = strlen (input);
477 size_t outbytesleft = sizeof (buf);
478 size_t res = iconv (cd_utf8_to_88591,
479 (char **) &inptr, &inbytesleft,
480 &outptr, &outbytesleft);
485 #if 0 /* This bug could be worked around by the caller. */
486 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
488 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
489 if (cd_88591_to_utf8 != (iconv_t)(-1))
491 static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
493 const char *inptr = input;
494 size_t inbytesleft = strlen (input);
496 size_t outbytesleft = sizeof (buf);
497 size_t res = iconv (cd_88591_to_utf8,
498 (char **) &inptr, &inbytesleft,
499 &outptr, &outbytesleft);
505 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
507 if (/* Try standardized names. */
508 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
509 /* Try IRIX, OSF/1 names. */
510 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
512 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
513 /* Try HP-UX names. */
514 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
517 }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
519 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
520 *) am_cv_func_iconv_works="guessing yes" ;;
524 case "$am_cv_func_iconv_works" in
525 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
526 *) am_func_iconv=yes ;;
529 am_func_iconv=no am_cv_lib_iconv=no
531 if test "$am_func_iconv" = yes; then
532 AC_DEFINE(HAVE_ICONV, 1,
533 [Define if you have the iconv() function and it works.])
535 if test "$am_cv_lib_iconv" = yes; then
536 AC_MSG_CHECKING([how to link with libiconv])
537 AC_MSG_RESULT([$LIBICONV])
539 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
541 CPPFLAGS="$am_save_CPPFLAGS"
552 if test "$am_cv_func_iconv" = yes; then
553 AC_MSG_CHECKING([for iconv declaration])
554 AC_CACHE_VAL(am_cv_proto_iconv, [
562 #if defined(__STDC__) || defined(__cplusplus)
563 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
567 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
568 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);"])
569 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
570 AC_MSG_RESULT([$]{ac_t:-
571 }[$]am_cv_proto_iconv)
572 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
573 [Define as const if the declaration of iconv() needs const.])
577 # intlmacosx.m4 serial 1 (gettext-0.17)
578 dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
579 dnl This file is free software; the Free Software Foundation
580 dnl gives unlimited permission to copy and/or distribute it,
581 dnl with or without modifications, as long as this notice is preserved.
583 dnl This file can can be used in projects which are not available under
584 dnl the GNU General Public License or the GNU Library General Public
585 dnl License but which still want to provide support for the GNU gettext
587 dnl Please note that the actual code of the GNU gettext library is covered
588 dnl by the GNU Library General Public License, and the rest of the GNU
589 dnl gettext package package is covered by the GNU General Public License.
590 dnl They are *not* in the public domain.
592 dnl Checks for special options needed on MacOS X.
593 dnl Defines INTL_MACOSX_LIBS.
594 AC_DEFUN([gt_INTL_MACOSX],
596 dnl Check for API introduced in MacOS X 10.2.
597 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
598 gt_cv_func_CFPreferencesCopyAppValue,
599 [gt_save_LIBS="$LIBS"
600 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
601 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
602 [CFPreferencesCopyAppValue(NULL, NULL)],
603 [gt_cv_func_CFPreferencesCopyAppValue=yes],
604 [gt_cv_func_CFPreferencesCopyAppValue=no])
605 LIBS="$gt_save_LIBS"])
606 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
607 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
608 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
610 dnl Check for API introduced in MacOS X 10.3.
611 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
612 [gt_save_LIBS="$LIBS"
613 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
614 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
615 [gt_cv_func_CFLocaleCopyCurrent=yes],
616 [gt_cv_func_CFLocaleCopyCurrent=no])
617 LIBS="$gt_save_LIBS"])
618 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
619 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
620 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
623 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
624 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
626 AC_SUBST([INTL_MACOSX_LIBS])
629 # lib-ld.m4 serial 3 (gettext-0.13)
630 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
631 dnl This file is free software; the Free Software Foundation
632 dnl gives unlimited permission to copy and/or distribute it,
633 dnl with or without modifications, as long as this notice is preserved.
635 dnl Subroutines of libtool.m4,
636 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
639 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
640 AC_DEFUN([AC_LIB_PROG_LD_GNU],
641 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
642 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
643 case `$LD -v 2>&1 </dev/null` in
644 *GNU* | *'with BFD'*)
645 acl_cv_prog_gnu_ld=yes ;;
647 acl_cv_prog_gnu_ld=no ;;
649 with_gnu_ld=$acl_cv_prog_gnu_ld
652 dnl From libtool-1.4. Sets the variable LD.
653 AC_DEFUN([AC_LIB_PROG_LD],
655 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
656 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
657 AC_REQUIRE([AC_PROG_CC])dnl
658 AC_REQUIRE([AC_CANONICAL_HOST])dnl
659 # Prepare PATH_SEPARATOR.
660 # The user is always right.
661 if test "${PATH_SEPARATOR+set}" != set; then
662 echo "#! /bin/sh" >conf$$.sh
663 echo "exit 0" >>conf$$.sh
665 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
673 if test "$GCC" = yes; then
674 # Check if gcc -print-prog-name=ld gives a path.
675 AC_MSG_CHECKING([for ld used by GCC])
678 # gcc leaves a trailing carriage return which upsets mingw
679 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
681 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
684 # Accept absolute paths.
685 [[\\/]* | [A-Za-z]:[\\/]*)]
686 [re_direlt='/[^/][^/]*/\.\./']
687 # Canonicalize the path of ld
688 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
689 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
690 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
692 test -z "$LD" && LD="$ac_prog"
695 # If it fails, then pretend we aren't using GCC.
699 # If it is relative, then search for the first ld in PATH.
703 elif test "$with_gnu_ld" = yes; then
704 AC_MSG_CHECKING([for GNU ld])
706 AC_MSG_CHECKING([for non-GNU ld])
708 AC_CACHE_VAL(acl_cv_path_LD,
709 [if test -z "$LD"; then
710 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
711 for ac_dir in $PATH; do
712 test -z "$ac_dir" && ac_dir=.
713 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
714 acl_cv_path_LD="$ac_dir/$ac_prog"
715 # Check to see if the program is GNU ld. I'd rather use --version,
716 # but apparently some GNU ld's only accept -v.
717 # Break only if it was the GNU/non-GNU ld that we prefer.
718 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
719 *GNU* | *'with BFD'*)
720 test "$with_gnu_ld" != no && break ;;
722 test "$with_gnu_ld" != yes && break ;;
728 acl_cv_path_LD="$LD" # Let the user override the test with a path.
731 if test -n "$LD"; then
736 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
740 # lib-link.m4 serial 13 (gettext-0.17)
741 dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
742 dnl This file is free software; the Free Software Foundation
743 dnl gives unlimited permission to copy and/or distribute it,
744 dnl with or without modifications, as long as this notice is preserved.
746 dnl From Bruno Haible.
750 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
751 dnl the libraries corresponding to explicit and implicit dependencies.
752 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
753 dnl augments the CPPFLAGS variable.
754 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
755 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
756 AC_DEFUN([AC_LIB_LINKFLAGS],
758 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
759 AC_REQUIRE([AC_LIB_RPATH])
760 define([Name],[translit([$1],[./-], [___])])
761 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
762 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
763 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
764 AC_LIB_LINKFLAGS_BODY([$1], [$2])
765 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
766 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
767 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
768 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
770 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
771 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
772 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
773 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
774 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
776 AC_SUBST([LTLIB]NAME)
777 AC_SUBST([LIB]NAME[_PREFIX])
778 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
779 dnl results of this search when this library appears as a dependency.
785 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
786 dnl searches for libname and the libraries corresponding to explicit and
787 dnl implicit dependencies, together with the specified include files and
788 dnl the ability to compile and link the specified testcode. If found, it
789 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
790 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
791 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
792 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
793 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
794 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
795 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
797 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
798 AC_REQUIRE([AC_LIB_RPATH])
799 define([Name],[translit([$1],[./-], [___])])
800 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
801 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
803 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
805 AC_LIB_LINKFLAGS_BODY([$1], [$2])
807 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
808 dnl because if the user has installed lib[]Name and not disabled its use
809 dnl via --without-lib[]Name-prefix, he wants to use it.
810 ac_save_CPPFLAGS="$CPPFLAGS"
811 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
813 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
815 LIBS="$LIBS $LIB[]NAME"
816 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
819 if test "$ac_cv_lib[]Name" = yes; then
821 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
822 AC_MSG_CHECKING([how to link with lib[]$1])
823 AC_MSG_RESULT([$LIB[]NAME])
826 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
827 dnl $INC[]NAME either.
828 CPPFLAGS="$ac_save_CPPFLAGS"
833 AC_SUBST([HAVE_LIB]NAME)
835 AC_SUBST([LTLIB]NAME)
836 AC_SUBST([LIB]NAME[_PREFIX])
841 dnl Determine the platform dependent parameters needed to use rpath:
844 dnl acl_hardcode_libdir_flag_spec,
845 dnl acl_hardcode_libdir_separator,
846 dnl acl_hardcode_direct,
847 dnl acl_hardcode_minus_L.
848 AC_DEFUN([AC_LIB_RPATH],
850 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
851 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
852 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
853 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
854 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
855 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
856 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
857 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
858 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
864 acl_libext="$acl_cv_libext"
865 acl_shlibext="$acl_cv_shlibext"
866 acl_libname_spec="$acl_cv_libname_spec"
867 acl_library_names_spec="$acl_cv_library_names_spec"
868 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
869 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
870 acl_hardcode_direct="$acl_cv_hardcode_direct"
871 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
872 dnl Determine whether the user wants rpath handling at all.
874 [ --disable-rpath do not hardcode runtime library paths],
878 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
879 dnl the libraries corresponding to explicit and implicit dependencies.
880 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
881 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
882 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
883 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
885 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
886 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
887 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
888 dnl Autoconf >= 2.61 supports dots in --with options.
889 define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
890 dnl By default, look in $includedir and $libdir.
892 AC_LIB_WITH_FINAL_PREFIX([
893 eval additional_includedir=\"$includedir\"
894 eval additional_libdir=\"$libdir\"
896 AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
897 [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
898 --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
900 if test "X$withval" = "Xno"; then
903 if test "X$withval" = "X"; then
904 AC_LIB_WITH_FINAL_PREFIX([
905 eval additional_includedir=\"$includedir\"
906 eval additional_libdir=\"$libdir\"
909 additional_includedir="$withval/include"
910 additional_libdir="$withval/$acl_libdirstem"
914 dnl Search the library and its dependencies in $additional_libdir and
915 dnl $LDFLAGS. Using breadth-first-seach.
922 names_already_handled=
923 names_next_round='$1 $2'
924 while test -n "$names_next_round"; do
925 names_this_round="$names_next_round"
927 for name in $names_this_round; do
929 for n in $names_already_handled; do
930 if test "$n" = "$name"; then
935 if test -z "$already_handled"; then
936 names_already_handled="$names_already_handled $name"
937 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
938 dnl or AC_LIB_HAVE_LINKFLAGS call.
939 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
940 eval value=\"\$HAVE_LIB$uppername\"
941 if test -n "$value"; then
942 if test "$value" = yes; then
943 eval value=\"\$LIB$uppername\"
944 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
945 eval value=\"\$LTLIB$uppername\"
946 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
948 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
949 dnl that this library doesn't exist. So just drop it.
953 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
954 dnl and the already constructed $LIBNAME/$LTLIBNAME.
959 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
960 if test -n "$acl_shlibext"; then
961 shrext=".$acl_shlibext" # typically: shrext=.so
965 if test $use_additional = yes; then
966 dir="$additional_libdir"
967 dnl The same code as in the loop below:
968 dnl First look for a shared library.
969 if test -n "$acl_shlibext"; then
970 if test -f "$dir/$libname$shrext"; then
972 found_so="$dir/$libname$shrext"
974 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
976 for f in "$libname$shrext".*; do echo "$f"; done \
977 | sed -e "s,^$libname$shrext\\\\.,," \
978 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
979 | sed 1q ) 2>/dev/null`
980 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
982 found_so="$dir/$libname$shrext.$ver"
985 eval library_names=\"$acl_library_names_spec\"
986 for f in $library_names; do
987 if test -f "$dir/$f"; then
996 dnl Then look for a static library.
997 if test "X$found_dir" = "X"; then
998 if test -f "$dir/$libname.$acl_libext"; then
1000 found_a="$dir/$libname.$acl_libext"
1003 if test "X$found_dir" != "X"; then
1004 if test -f "$dir/$libname.la"; then
1005 found_la="$dir/$libname.la"
1009 if test "X$found_dir" = "X"; then
1010 for x in $LDFLAGS $LTLIB[]NAME; do
1011 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1014 dir=`echo "X$x" | sed -e 's/^X-L//'`
1015 dnl First look for a shared library.
1016 if test -n "$acl_shlibext"; then
1017 if test -f "$dir/$libname$shrext"; then
1019 found_so="$dir/$libname$shrext"
1021 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1022 ver=`(cd "$dir" && \
1023 for f in "$libname$shrext".*; do echo "$f"; done \
1024 | sed -e "s,^$libname$shrext\\\\.,," \
1025 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1026 | sed 1q ) 2>/dev/null`
1027 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1029 found_so="$dir/$libname$shrext.$ver"
1032 eval library_names=\"$acl_library_names_spec\"
1033 for f in $library_names; do
1034 if test -f "$dir/$f"; then
1043 dnl Then look for a static library.
1044 if test "X$found_dir" = "X"; then
1045 if test -f "$dir/$libname.$acl_libext"; then
1047 found_a="$dir/$libname.$acl_libext"
1050 if test "X$found_dir" != "X"; then
1051 if test -f "$dir/$libname.la"; then
1052 found_la="$dir/$libname.la"
1057 if test "X$found_dir" != "X"; then
1062 if test "X$found_dir" != "X"; then
1063 dnl Found the library.
1064 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1065 if test "X$found_so" != "X"; then
1066 dnl Linking with a shared library. We attempt to hardcode its
1067 dnl directory into the executable's runpath, unless it's the
1068 dnl standard /usr/lib.
1069 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
1070 dnl No hardcoding is needed.
1071 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1073 dnl Use an explicit option to hardcode DIR into the resulting
1075 dnl Potentially add DIR to ltrpathdirs.
1076 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1078 for x in $ltrpathdirs; do
1079 if test "X$x" = "X$found_dir"; then
1084 if test -z "$haveit"; then
1085 ltrpathdirs="$ltrpathdirs $found_dir"
1087 dnl The hardcoding into $LIBNAME is system dependent.
1088 if test "$acl_hardcode_direct" = yes; then
1089 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1090 dnl resulting binary.
1091 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1093 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1094 dnl Use an explicit option to hardcode DIR into the resulting
1096 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1097 dnl Potentially add DIR to rpathdirs.
1098 dnl The rpathdirs will be appended to $LIBNAME at the end.
1100 for x in $rpathdirs; do
1101 if test "X$x" = "X$found_dir"; then
1106 if test -z "$haveit"; then
1107 rpathdirs="$rpathdirs $found_dir"
1110 dnl Rely on "-L$found_dir".
1111 dnl But don't add it if it's already contained in the LDFLAGS
1112 dnl or the already constructed $LIBNAME
1114 for x in $LDFLAGS $LIB[]NAME; do
1115 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1116 if test "X$x" = "X-L$found_dir"; then
1121 if test -z "$haveit"; then
1122 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1124 if test "$acl_hardcode_minus_L" != no; then
1125 dnl FIXME: Not sure whether we should use
1126 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1128 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1130 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1131 dnl here, because this doesn't fit in flags passed to the
1132 dnl compiler. So give up. No hardcoding. This affects only
1133 dnl very old systems.
1134 dnl FIXME: Not sure whether we should use
1135 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1137 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1143 if test "X$found_a" != "X"; then
1144 dnl Linking with a static library.
1145 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1147 dnl We shouldn't come here, but anyway it's good to have a
1149 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1152 dnl Assume the include files are nearby.
1153 additional_includedir=
1154 case "$found_dir" in
1155 */$acl_libdirstem | */$acl_libdirstem/)
1156 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1157 LIB[]NAME[]_PREFIX="$basedir"
1158 additional_includedir="$basedir/include"
1161 if test "X$additional_includedir" != "X"; then
1162 dnl Potentially add $additional_includedir to $INCNAME.
1163 dnl But don't add it
1164 dnl 1. if it's the standard /usr/include,
1165 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1166 dnl 3. if it's already present in $CPPFLAGS or the already
1167 dnl constructed $INCNAME,
1168 dnl 4. if it doesn't exist as a directory.
1169 if test "X$additional_includedir" != "X/usr/include"; then
1171 if test "X$additional_includedir" = "X/usr/local/include"; then
1172 if test -n "$GCC"; then
1174 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1178 if test -z "$haveit"; then
1179 for x in $CPPFLAGS $INC[]NAME; do
1180 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1181 if test "X$x" = "X-I$additional_includedir"; then
1186 if test -z "$haveit"; then
1187 if test -d "$additional_includedir"; then
1188 dnl Really add $additional_includedir to $INCNAME.
1189 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1195 dnl Look for dependencies.
1196 if test -n "$found_la"; then
1197 dnl Read the .la file. It defines the variables
1198 dnl dlname, library_names, old_library, dependency_libs, current,
1199 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1200 save_libdir="$libdir"
1202 */* | *\\*) . "$found_la" ;;
1203 *) . "./$found_la" ;;
1205 libdir="$save_libdir"
1206 dnl We use only dependency_libs.
1207 for dep in $dependency_libs; do
1210 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1211 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1212 dnl But don't add it
1213 dnl 1. if it's the standard /usr/lib,
1214 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1215 dnl 3. if it's already present in $LDFLAGS or the already
1216 dnl constructed $LIBNAME,
1217 dnl 4. if it doesn't exist as a directory.
1218 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1220 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1221 if test -n "$GCC"; then
1223 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1227 if test -z "$haveit"; then
1229 for x in $LDFLAGS $LIB[]NAME; do
1230 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1231 if test "X$x" = "X-L$additional_libdir"; then
1236 if test -z "$haveit"; then
1237 if test -d "$additional_libdir"; then
1238 dnl Really add $additional_libdir to $LIBNAME.
1239 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1243 for x in $LDFLAGS $LTLIB[]NAME; do
1244 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1245 if test "X$x" = "X-L$additional_libdir"; then
1250 if test -z "$haveit"; then
1251 if test -d "$additional_libdir"; then
1252 dnl Really add $additional_libdir to $LTLIBNAME.
1253 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1260 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1261 if test "$enable_rpath" != no; then
1262 dnl Potentially add DIR to rpathdirs.
1263 dnl The rpathdirs will be appended to $LIBNAME at the end.
1265 for x in $rpathdirs; do
1266 if test "X$x" = "X$dir"; then
1271 if test -z "$haveit"; then
1272 rpathdirs="$rpathdirs $dir"
1274 dnl Potentially add DIR to ltrpathdirs.
1275 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1277 for x in $ltrpathdirs; do
1278 if test "X$x" = "X$dir"; then
1283 if test -z "$haveit"; then
1284 ltrpathdirs="$ltrpathdirs $dir"
1289 dnl Handle this in the next round.
1290 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1293 dnl Handle this in the next round. Throw away the .la's
1294 dnl directory; it is already contained in a preceding -L
1296 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1299 dnl Most likely an immediate library name.
1300 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1301 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1307 dnl Didn't find the library; assume it is in the system directories
1308 dnl known to the linker and runtime loader. (All the system
1309 dnl directories known to the linker should also be known to the
1310 dnl runtime loader, otherwise the system is severely misconfigured.)
1311 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1312 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1318 if test "X$rpathdirs" != "X"; then
1319 if test -n "$acl_hardcode_libdir_separator"; then
1320 dnl Weird platform: only the last -rpath option counts, the user must
1321 dnl pass all path elements in one option. We can arrange that for a
1322 dnl single library, but not when more than one $LIBNAMEs are used.
1324 for found_dir in $rpathdirs; do
1325 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1327 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1328 acl_save_libdir="$libdir"
1330 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1331 libdir="$acl_save_libdir"
1332 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1334 dnl The -rpath options are cumulative.
1335 for found_dir in $rpathdirs; do
1336 acl_save_libdir="$libdir"
1338 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1339 libdir="$acl_save_libdir"
1340 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1344 if test "X$ltrpathdirs" != "X"; then
1345 dnl When using libtool, the option that works for both libraries and
1346 dnl executables is -R. The -R options are cumulative.
1347 for found_dir in $ltrpathdirs; do
1348 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1353 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1354 dnl unless already present in VAR.
1355 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1356 dnl contains two or three consecutive elements that belong together.
1357 AC_DEFUN([AC_LIB_APPENDTOVAR],
1359 for element in [$2]; do
1362 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1363 if test "X$x" = "X$element"; then
1368 if test -z "$haveit"; then
1369 [$1]="${[$1]}${[$1]:+ }$element"
1374 dnl For those cases where a variable contains several -L and -l options
1375 dnl referring to unknown libraries and directories, this macro determines the
1376 dnl necessary additional linker options for the runtime path.
1377 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1378 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1379 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1380 dnl otherwise linking without libtool is assumed.
1381 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1383 AC_REQUIRE([AC_LIB_RPATH])
1384 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1386 if test "$enable_rpath" != no; then
1387 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1388 dnl Use an explicit option to hardcode directories into the resulting
1393 if test -n "$next"; then
1395 dnl No need to hardcode the standard /usr/lib.
1396 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1397 rpathdirs="$rpathdirs $dir"
1403 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1404 dnl No need to hardcode the standard /usr/lib.
1405 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1406 rpathdirs="$rpathdirs $dir"
1413 if test "X$rpathdirs" != "X"; then
1414 if test -n ""$3""; then
1415 dnl libtool is used for linking. Use -R options.
1416 for dir in $rpathdirs; do
1417 $1="${$1}${$1:+ }-R$dir"
1420 dnl The linker is used for linking directly.
1421 if test -n "$acl_hardcode_libdir_separator"; then
1422 dnl Weird platform: only the last -rpath option counts, the user
1423 dnl must pass all path elements in one option.
1425 for dir in $rpathdirs; do
1426 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1428 acl_save_libdir="$libdir"
1430 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1431 libdir="$acl_save_libdir"
1434 dnl The -rpath options are cumulative.
1435 for dir in $rpathdirs; do
1436 acl_save_libdir="$libdir"
1438 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1439 libdir="$acl_save_libdir"
1440 $1="${$1}${$1:+ }$flag"
1450 # lib-prefix.m4 serial 5 (gettext-0.15)
1451 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1452 dnl This file is free software; the Free Software Foundation
1453 dnl gives unlimited permission to copy and/or distribute it,
1454 dnl with or without modifications, as long as this notice is preserved.
1456 dnl From Bruno Haible.
1458 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1459 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1460 dnl require excessive bracketing.
1461 ifdef([AC_HELP_STRING],
1462 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1463 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1465 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1466 dnl to access previously installed libraries. The basic assumption is that
1467 dnl a user will want packages to use other packages he previously installed
1468 dnl with the same --prefix option.
1469 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1470 dnl libraries, but is otherwise very convenient.
1471 AC_DEFUN([AC_LIB_PREFIX],
1473 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1474 AC_REQUIRE([AC_PROG_CC])
1475 AC_REQUIRE([AC_CANONICAL_HOST])
1476 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1477 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1478 dnl By default, look in $includedir and $libdir.
1480 AC_LIB_WITH_FINAL_PREFIX([
1481 eval additional_includedir=\"$includedir\"
1482 eval additional_libdir=\"$libdir\"
1484 AC_LIB_ARG_WITH([lib-prefix],
1485 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1486 --without-lib-prefix don't search for libraries in includedir and libdir],
1488 if test "X$withval" = "Xno"; then
1491 if test "X$withval" = "X"; then
1492 AC_LIB_WITH_FINAL_PREFIX([
1493 eval additional_includedir=\"$includedir\"
1494 eval additional_libdir=\"$libdir\"
1497 additional_includedir="$withval/include"
1498 additional_libdir="$withval/$acl_libdirstem"
1502 if test $use_additional = yes; then
1503 dnl Potentially add $additional_includedir to $CPPFLAGS.
1504 dnl But don't add it
1505 dnl 1. if it's the standard /usr/include,
1506 dnl 2. if it's already present in $CPPFLAGS,
1507 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1508 dnl 4. if it doesn't exist as a directory.
1509 if test "X$additional_includedir" != "X/usr/include"; then
1511 for x in $CPPFLAGS; do
1512 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1513 if test "X$x" = "X-I$additional_includedir"; then
1518 if test -z "$haveit"; then
1519 if test "X$additional_includedir" = "X/usr/local/include"; then
1520 if test -n "$GCC"; then
1522 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1526 if test -z "$haveit"; then
1527 if test -d "$additional_includedir"; then
1528 dnl Really add $additional_includedir to $CPPFLAGS.
1529 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1534 dnl Potentially add $additional_libdir to $LDFLAGS.
1535 dnl But don't add it
1536 dnl 1. if it's the standard /usr/lib,
1537 dnl 2. if it's already present in $LDFLAGS,
1538 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1539 dnl 4. if it doesn't exist as a directory.
1540 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1542 for x in $LDFLAGS; do
1543 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1544 if test "X$x" = "X-L$additional_libdir"; then
1549 if test -z "$haveit"; then
1550 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1551 if test -n "$GCC"; then
1553 linux*) haveit=yes;;
1557 if test -z "$haveit"; then
1558 if test -d "$additional_libdir"; then
1559 dnl Really add $additional_libdir to $LDFLAGS.
1560 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1568 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1569 dnl acl_final_exec_prefix, containing the values to which $prefix and
1570 dnl $exec_prefix will expand at the end of the configure script.
1571 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1573 dnl Unfortunately, prefix and exec_prefix get only finally determined
1574 dnl at the end of configure.
1575 if test "X$prefix" = "XNONE"; then
1576 acl_final_prefix="$ac_default_prefix"
1578 acl_final_prefix="$prefix"
1580 if test "X$exec_prefix" = "XNONE"; then
1581 acl_final_exec_prefix='${prefix}'
1583 acl_final_exec_prefix="$exec_prefix"
1585 acl_save_prefix="$prefix"
1586 prefix="$acl_final_prefix"
1587 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1588 prefix="$acl_save_prefix"
1591 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1592 dnl variables prefix and exec_prefix bound to the values they will have
1593 dnl at the end of the configure script.
1594 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1596 acl_save_prefix="$prefix"
1597 prefix="$acl_final_prefix"
1598 acl_save_exec_prefix="$exec_prefix"
1599 exec_prefix="$acl_final_exec_prefix"
1601 exec_prefix="$acl_save_exec_prefix"
1602 prefix="$acl_save_prefix"
1605 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
1606 dnl the basename of the libdir, either "lib" or "lib64".
1607 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1609 dnl There is no formal standard regarding lib and lib64. The current
1610 dnl practice is that on a system supporting 32-bit and 64-bit instruction
1611 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
1612 dnl libraries go under $prefix/lib. We determine the compiler's default
1613 dnl mode by looking at the compiler's library search path. If at least
1614 dnl of its elements ends in /lib64 or points to a directory whose absolute
1615 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
1616 dnl default, namely "lib".
1618 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1619 if test -n "$searchpath"; then
1620 acl_save_IFS="${IFS= }"; IFS=":"
1621 for searchdir in $searchpath; do
1622 if test -d "$searchdir"; then
1623 case "$searchdir" in
1624 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1625 *) searchdir=`cd "$searchdir" && pwd`
1626 case "$searchdir" in
1627 */lib64 ) acl_libdirstem=lib64 ;;
1636 # nls.m4 serial 3 (gettext-0.15)
1637 dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
1638 dnl This file is free software; the Free Software Foundation
1639 dnl gives unlimited permission to copy and/or distribute it,
1640 dnl with or without modifications, as long as this notice is preserved.
1642 dnl This file can can be used in projects which are not available under
1643 dnl the GNU General Public License or the GNU Library General Public
1644 dnl License but which still want to provide support for the GNU gettext
1646 dnl Please note that the actual code of the GNU gettext library is covered
1647 dnl by the GNU Library General Public License, and the rest of the GNU
1648 dnl gettext package package is covered by the GNU General Public License.
1649 dnl They are *not* in the public domain.
1652 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1653 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1659 AC_MSG_CHECKING([whether NLS is requested])
1660 dnl Default is enabled NLS
1662 [ --disable-nls do not use Native Language Support],
1663 USE_NLS=$enableval, USE_NLS=yes)
1664 AC_MSG_RESULT($USE_NLS)
1668 # po.m4 serial 15 (gettext-0.17)
1669 dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
1670 dnl This file is free software; the Free Software Foundation
1671 dnl gives unlimited permission to copy and/or distribute it,
1672 dnl with or without modifications, as long as this notice is preserved.
1674 dnl This file can can be used in projects which are not available under
1675 dnl the GNU General Public License or the GNU Library General Public
1676 dnl License but which still want to provide support for the GNU gettext
1678 dnl Please note that the actual code of the GNU gettext library is covered
1679 dnl by the GNU Library General Public License, and the rest of the GNU
1680 dnl gettext package package is covered by the GNU General Public License.
1681 dnl They are *not* in the public domain.
1684 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1685 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1689 dnl Checks for all prerequisites of the po subdirectory.
1690 AC_DEFUN([AM_PO_SUBDIRS],
1692 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1693 AC_REQUIRE([AC_PROG_INSTALL])dnl
1694 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
1695 AC_REQUIRE([AM_NLS])dnl
1697 dnl Release version of the gettext macros. This is used to ensure that
1698 dnl the gettext macros and po/Makefile.in.in are in sync.
1699 AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
1701 dnl Perform the following tests also if --disable-nls has been given,
1702 dnl because they are needed for "make dist" to work.
1704 dnl Search for GNU msgfmt in the PATH.
1705 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1706 dnl The second test excludes FreeBSD msgfmt.
1707 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1708 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1709 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1711 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1713 dnl Test whether it is GNU msgfmt >= 0.15.
1715 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1716 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
1717 *) MSGFMT_015=$MSGFMT ;;
1720 AC_SUBST([MSGFMT_015])
1722 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1723 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
1724 *) GMSGFMT_015=$GMSGFMT ;;
1727 AC_SUBST([GMSGFMT_015])
1729 dnl Search for GNU xgettext 0.12 or newer in the PATH.
1730 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1731 dnl The second test excludes FreeBSD xgettext.
1732 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1733 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1734 (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)],
1736 dnl Remove leftover from FreeBSD xgettext call.
1739 dnl Test whether it is GNU xgettext >= 0.15.
1741 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1742 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
1743 *) XGETTEXT_015=$XGETTEXT ;;
1746 AC_SUBST([XGETTEXT_015])
1748 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1749 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1750 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
1752 dnl Installation directories.
1753 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
1754 dnl have to define it here, so that it can be used in po/Makefile.
1755 test -n "$localedir" || localedir='${datadir}/locale'
1756 AC_SUBST([localedir])
1758 dnl Support for AM_XGETTEXT_OPTION.
1759 test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
1760 AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
1762 AC_CONFIG_COMMANDS([po-directories], [[
1763 for ac_file in $CONFIG_FILES; do
1764 # Support "outfile[:infile[:infile...]]"
1766 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1768 # PO directories have a Makefile.in generated from Makefile.in.in.
1769 case "$ac_file" in */Makefile.in)
1770 # Adjust a relative srcdir.
1771 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1772 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1773 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1774 # In autoconf-2.13 it is called $ac_given_srcdir.
1775 # In autoconf-2.50 it is called $srcdir.
1776 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1777 case "$ac_given_srcdir" in
1778 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1779 /*) top_srcdir="$ac_given_srcdir" ;;
1780 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1782 # Treat a directory as a PO directory if and only if it has a
1783 # POTFILES.in file. This allows packages to have multiple PO
1784 # directories under different names or in different locations.
1785 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1786 rm -f "$ac_dir/POTFILES"
1787 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1788 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1789 POMAKEFILEDEPS="POTFILES.in"
1790 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1791 # on $ac_dir but don't depend on user-specified configuration
1793 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1794 # The LINGUAS file contains the set of available languages.
1795 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1796 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1798 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1799 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1800 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1801 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1803 # The set of available languages was given in configure.in.
1804 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1805 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1808 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1809 # Compute UPDATEPOFILES
1810 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1811 # Compute DUMMYPOFILES
1812 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1814 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1815 case "$ac_given_srcdir" in
1817 *) srcdirpre='$(srcdir)/' ;;
1823 for lang in $ALL_LINGUAS; do
1824 POFILES="$POFILES $srcdirpre$lang.po"
1825 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1826 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1827 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1829 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1830 # environment variable.
1832 if test -n "$ALL_LINGUAS"; then
1833 for presentlang in $ALL_LINGUAS; do
1835 if test "%UNSET%" != "$LINGUAS"; then
1836 desiredlanguages="$LINGUAS"
1838 desiredlanguages="$ALL_LINGUAS"
1840 for desiredlang in $desiredlanguages; do
1841 # Use the presentlang catalog if desiredlang is
1842 # a. equal to presentlang, or
1843 # b. a variant of presentlang (because in this case,
1844 # presentlang can be used as a fallback for messages
1845 # which are not translated in the desiredlang catalog).
1846 case "$desiredlang" in
1847 "$presentlang"*) useit=yes;;
1850 if test $useit = yes; then
1851 INST_LINGUAS="$INST_LINGUAS $presentlang"
1856 if test -n "$INST_LINGUAS"; then
1857 for lang in $INST_LINGUAS; do
1858 CATALOGS="$CATALOGS $lang.gmo"
1861 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1862 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"
1863 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1864 if test -f "$f"; then
1866 *.orig | *.bak | *~) ;;
1867 *) cat "$f" >> "$ac_dir/Makefile" ;;
1875 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1876 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
1877 # from automake < 1.5.
1878 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1879 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1880 LINGUAS="${LINGUAS-%UNSET%}"
1884 dnl Postprocesses a Makefile in a directory containing PO files.
1885 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
1887 # When this code is run, in config.status, two variables have already been
1889 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
1890 # - LINGUAS is the value of the environment variable LINGUAS at configure
1894 # Adjust a relative srcdir.
1895 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1896 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1897 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1898 # In autoconf-2.13 it is called $ac_given_srcdir.
1899 # In autoconf-2.50 it is called $srcdir.
1900 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1901 case "$ac_given_srcdir" in
1902 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1903 /*) top_srcdir="$ac_given_srcdir" ;;
1904 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1907 # Find a way to echo strings without interpreting backslash.
1908 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
1911 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
1912 gt_echo='printf %s\n'
1923 # A sed script that extracts the value of VARIABLE from a Makefile.
1925 # Test if the hold space is empty.
1930 # Yes it was empty. Look if we have the expected variable definition.
1931 /^[ ]*VARIABLE[ ]*=/{
1932 # Seen the first line of the variable definition.
1933 s/^[ ]*VARIABLE[ ]*=//
1938 # Here we are processing a line from the variable definition.
1939 # Remove comment, more precisely replace it with a space.
1941 # See if the line ends in a backslash.
1945 # Print the line, without the trailing backslash.
1948 # There was no trailing backslash. The end of the variable definition is
1949 # reached. Clear the hold space.
1954 # A trailing backslash means that the variable definition continues in the
1955 # next line. Put a nonempty string into the hold space to indicate this.
1962 # Set POTFILES to the value of the Makefile variable POTFILES.
1963 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
1964 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
1965 # Compute POTFILES_DEPS as
1966 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
1968 for file in $POTFILES; do
1969 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
1973 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1974 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1976 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1977 # The LINGUAS file contains the set of available languages.
1978 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1979 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1981 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
1982 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
1983 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
1985 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1986 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1988 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1989 # Compute UPDATEPOFILES
1990 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1991 # Compute DUMMYPOFILES
1992 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1994 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1995 # Compute PROPERTIESFILES
1996 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
1997 # Compute CLASSFILES
1998 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2000 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2002 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2003 # Compute RESOURCESDLLFILES
2004 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2005 case "$ac_given_srcdir" in
2007 *) srcdirpre='$(srcdir)/' ;;
2018 for lang in $ALL_LINGUAS; do
2019 POFILES="$POFILES $srcdirpre$lang.po"
2020 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2021 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2022 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2023 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2024 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2025 QMFILES="$QMFILES $srcdirpre$lang.qm"
2026 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2027 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2028 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/'`
2029 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2031 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2032 # environment variable.
2034 if test -n "$ALL_LINGUAS"; then
2035 for presentlang in $ALL_LINGUAS; do
2037 if test "%UNSET%" != "$LINGUAS"; then
2038 desiredlanguages="$LINGUAS"
2040 desiredlanguages="$ALL_LINGUAS"
2042 for desiredlang in $desiredlanguages; do
2043 # Use the presentlang catalog if desiredlang is
2044 # a. equal to presentlang, or
2045 # b. a variant of presentlang (because in this case,
2046 # presentlang can be used as a fallback for messages
2047 # which are not translated in the desiredlang catalog).
2048 case "$desiredlang" in
2049 "$presentlang"*) useit=yes;;
2052 if test $useit = yes; then
2053 INST_LINGUAS="$INST_LINGUAS $presentlang"
2062 if test -n "$INST_LINGUAS"; then
2063 for lang in $INST_LINGUAS; do
2064 CATALOGS="$CATALOGS $lang.gmo"
2065 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2066 QTCATALOGS="$QTCATALOGS $lang.qm"
2067 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2068 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2069 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/'`
2070 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2074 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"
2075 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2076 # Add dependencies that cannot be formulated as a simple suffix rule.
2077 for lang in $ALL_LINGUAS; do
2078 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2079 cat >> "$ac_file.tmp" <<EOF
2080 $frobbedlang.msg: $lang.po
2081 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2082 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2086 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2087 # Add dependencies that cannot be formulated as a simple suffix rule.
2088 for lang in $ALL_LINGUAS; do
2089 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/'`
2090 cat >> "$ac_file.tmp" <<EOF
2091 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2092 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2093 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2097 if test -n "$POMAKEFILEDEPS"; then
2098 cat >> "$ac_file.tmp" <<EOF
2099 Makefile: $POMAKEFILEDEPS
2102 mv "$ac_file.tmp" "$ac_file"
2105 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
2106 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
2108 XGETTEXT_EXTRA_OPTIONS=
2111 dnl Registers an option to be passed to xgettext in the po subdirectory.
2112 AC_DEFUN([AM_XGETTEXT_OPTION],
2114 AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
2115 XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
2118 # progtest.m4 serial 4 (gettext-0.14.2)
2119 dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
2120 dnl This file is free software; the Free Software Foundation
2121 dnl gives unlimited permission to copy and/or distribute it,
2122 dnl with or without modifications, as long as this notice is preserved.
2124 dnl This file can can be used in projects which are not available under
2125 dnl the GNU General Public License or the GNU Library General Public
2126 dnl License but which still want to provide support for the GNU gettext
2128 dnl Please note that the actual code of the GNU gettext library is covered
2129 dnl by the GNU Library General Public License, and the rest of the GNU
2130 dnl gettext package package is covered by the GNU General Public License.
2131 dnl They are *not* in the public domain.
2134 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2138 # Search path for a program which passes the given test.
2140 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2141 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2142 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2144 # Prepare PATH_SEPARATOR.
2145 # The user is always right.
2146 if test "${PATH_SEPARATOR+set}" != set; then
2147 echo "#! /bin/sh" >conf$$.sh
2148 echo "exit 0" >>conf$$.sh
2150 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2158 # Find out how to test for executable files. Don't use a zero-byte file,
2159 # as systems may use methods other than mode bits to determine executability.
2160 cat >conf$$.file <<_ASEOF
2164 chmod +x conf$$.file
2165 if test -x conf$$.file >/dev/null 2>&1; then
2166 ac_executable_p="test -x"
2168 ac_executable_p="test -f"
2172 # Extract the first word of "$2", so it can be a program name with args.
2173 set dummy $2; ac_word=[$]2
2174 AC_MSG_CHECKING([for $ac_word])
2175 AC_CACHE_VAL(ac_cv_path_$1,
2177 [[\\/]]* | ?:[[\\/]]*)
2178 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2181 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2182 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2184 test -z "$ac_dir" && ac_dir=.
2185 for ac_exec_ext in '' $ac_executable_extensions; do
2186 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2187 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2189 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2196 dnl If no 4th arg is given, leave the cache variable unset,
2197 dnl so AC_PATH_PROGS will keep looking.
2198 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2203 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2204 AC_MSG_RESULT([$]$1)
2211 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2213 # This file is free software; the Free Software Foundation
2214 # gives unlimited permission to copy and/or distribute it,
2215 # with or without modifications, as long as this notice is preserved.
2219 # Check for `mkdir -p'.
2220 AC_DEFUN([AM_PROG_MKDIR_P],
2221 [AC_PREREQ([2.60])dnl
2222 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2223 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
2224 dnl while keeping a definition of mkdir_p for backward compatibility.
2225 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2226 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2227 dnl Makefile.ins that do not define MKDIR_P, so we do our own
2228 dnl adjustment using top_builddir (which is defined more often than
2230 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2232 [[\\/$]]* | ?:[[\\/]]*) ;;
2233 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2237 m4_include([buildlib/tools.m4])