1 # generated automatically by aclocal 1.9.6 -*- 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 53 (gettext-0.15)
15 dnl Copyright (C) 1995-2006 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-2005.
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)
149 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
150 ]], [])[extern int _nl_msg_cat_cntr;
151 extern int *_nl_domain_bindings;],
152 [bindtextdomain ("", "");
153 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
154 gt_cv_func_gnugettext_libc=yes,
155 gt_cv_func_gnugettext_libc=no)])
157 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
158 dnl Sometimes libintl requires libiconv, so first search for libiconv.
159 ifelse(gt_included_intl, yes, , [
162 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
163 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
164 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
165 dnl even if libiconv doesn't exist.
166 AC_LIB_LINKFLAGS_BODY([intl])
167 AC_CACHE_CHECK([for GNU gettext in libintl],
168 gt_cv_func_gnugettext_libintl,
169 [gt_save_CPPFLAGS="$CPPFLAGS"
170 CPPFLAGS="$CPPFLAGS $INCINTL"
172 LIBS="$LIBS $LIBINTL"
173 dnl Now see whether libintl exists and does not depend on libiconv.
174 AC_TRY_LINK([#include <libintl.h>
175 ]ifelse([$2], [need-formatstring-macros],
176 [[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
177 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
179 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
180 ]], [])[extern int _nl_msg_cat_cntr;
185 const char *_nl_expand_alias (const char *);],
186 [bindtextdomain ("", "");
187 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
188 gt_cv_func_gnugettext_libintl=yes,
189 gt_cv_func_gnugettext_libintl=no)
190 dnl Now see whether libintl exists and depends on libiconv.
191 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
192 LIBS="$LIBS $LIBICONV"
193 AC_TRY_LINK([#include <libintl.h>
194 ]ifelse([$2], [need-formatstring-macros],
195 [[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
196 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
198 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
199 ]], [])[extern int _nl_msg_cat_cntr;
204 const char *_nl_expand_alias (const char *);],
205 [bindtextdomain ("", "");
206 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
207 [LIBINTL="$LIBINTL $LIBICONV"
208 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
209 gt_cv_func_gnugettext_libintl=yes
212 CPPFLAGS="$gt_save_CPPFLAGS"
213 LIBS="$gt_save_LIBS"])
216 dnl If an already present or preinstalled GNU gettext() is found,
217 dnl use it. But if this macro is used in GNU gettext, and GNU
218 dnl gettext is already preinstalled in libintl, we update this
219 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
220 if test "$gt_cv_func_gnugettext_libc" = "yes" \
221 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
222 && test "$PACKAGE" != gettext-runtime \
223 && test "$PACKAGE" != gettext-tools; }; then
224 gt_use_preinstalled_gnugettext=yes
226 dnl Reset the values set by searching for libintl.
232 ifelse(gt_included_intl, yes, [
233 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
234 dnl GNU gettext is not found in the C library.
235 dnl Fall back on included GNU gettext library.
236 nls_cv_use_gnu_gettext=yes
240 if test "$nls_cv_use_gnu_gettext" = "yes"; then
241 dnl Mark actions used to generate GNU NLS library.
242 BUILD_INCLUDED_LIBINTL=yes
243 USE_INCLUDED_LIBINTL=yes
244 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
245 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
246 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
250 if test "$gt_use_preinstalled_gnugettext" = "yes" \
251 || test "$nls_cv_use_gnu_gettext" = "yes"; then
252 dnl Mark actions to use GNU gettext tools.
257 if test -n "$INTL_MACOSX_LIBS"; then
258 if test "$gt_use_preinstalled_gnugettext" = "yes" \
259 || test "$nls_cv_use_gnu_gettext" = "yes"; then
260 dnl Some extra flags are needed during linking.
261 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
262 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
266 if test "$gt_use_preinstalled_gnugettext" = "yes" \
267 || test "$nls_cv_use_gnu_gettext" = "yes"; then
268 AC_DEFINE(ENABLE_NLS, 1,
269 [Define to 1 if translation of program messages to the user's native language
276 AC_MSG_CHECKING([whether to use NLS])
277 AC_MSG_RESULT([$USE_NLS])
278 if test "$USE_NLS" = "yes"; then
279 AC_MSG_CHECKING([where the gettext function comes from])
280 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
281 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
282 gt_source="external libintl"
287 gt_source="included intl directory"
289 AC_MSG_RESULT([$gt_source])
292 if test "$USE_NLS" = "yes"; then
294 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
295 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
296 AC_MSG_CHECKING([how to link with libintl])
297 AC_MSG_RESULT([$LIBINTL])
298 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
301 dnl For backward compatibility. Some packages may be using this.
302 AC_DEFINE(HAVE_GETTEXT, 1,
303 [Define if the GNU gettext() function is already present or preinstalled.])
304 AC_DEFINE(HAVE_DCGETTEXT, 1,
305 [Define if the GNU dcgettext() function is already present or preinstalled.])
308 dnl We need to process the po/ directory.
312 ifelse(gt_included_intl, yes, [
313 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
314 dnl to 'yes' because some of the testsuite requires it.
315 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
316 BUILD_INCLUDED_LIBINTL=yes
319 dnl Make all variables we use known to autoconf.
320 AC_SUBST(BUILD_INCLUDED_LIBINTL)
321 AC_SUBST(USE_INCLUDED_LIBINTL)
324 dnl For backward compatibility. Some configure.ins may be using this.
328 dnl For backward compatibility. Some Makefiles may be using this.
330 AC_SUBST(DATADIRNAME)
332 dnl For backward compatibility. Some Makefiles may be using this.
336 dnl For backward compatibility. Some Makefiles may be using this.
340 dnl For backward compatibility. Some Makefiles may be using this.
342 if test "$USE_INCLUDED_LIBINTL" = yes; then
343 INTLOBJS="\$(GETTOBJS)"
347 dnl Enable libtool support if the surrounding package wishes it.
348 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
349 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
352 dnl For backward compatibility. Some Makefiles may be using this.
356 dnl Make all documented variables known to autoconf.
363 dnl Checks for all prerequisites of the intl subdirectory,
364 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
365 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
366 AC_DEFUN([AM_INTL_SUBDIR],
368 AC_REQUIRE([AC_PROG_INSTALL])dnl
369 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
370 AC_REQUIRE([AC_PROG_CC])dnl
371 AC_REQUIRE([AC_CANONICAL_HOST])dnl
372 AC_REQUIRE([gt_GLIBC2])dnl
373 AC_REQUIRE([AC_PROG_RANLIB])dnl
374 AC_REQUIRE([gl_VISIBILITY])dnl
375 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
376 AC_REQUIRE([bh_C_SIGNED])dnl
377 AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
378 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
379 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
380 AC_REQUIRE([gt_TYPE_WINT_T])dnl
381 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
382 AC_REQUIRE([gt_TYPE_INTMAX_T])
383 AC_REQUIRE([gt_PRINTF_POSIX])
384 AC_REQUIRE([gl_GLIBC21])dnl
385 AC_REQUIRE([gl_XSIZE])dnl
386 AC_REQUIRE([gt_INTL_MACOSX])dnl
388 AC_CHECK_TYPE([ptrdiff_t], ,
389 [AC_DEFINE([ptrdiff_t], [long],
390 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
392 AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
393 AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
395 dnl Use the _snprintf function only if it is declared (because on NetBSD it
396 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
397 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
398 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
400 dnl Use the *_unlocked functions only if they are declared.
401 dnl (because some of them were defined without being declared in Solaris
402 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
403 dnl on Solaris 2.5.1 to run on Solaris 2.6).
404 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
405 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
407 case $gt_cv_func_printf_posix in
408 *yes) HAVE_POSIX_PRINTF=1 ;;
409 *) HAVE_POSIX_PRINTF=0 ;;
411 AC_SUBST([HAVE_POSIX_PRINTF])
412 if test "$ac_cv_func_asprintf" = yes; then
417 AC_SUBST([HAVE_ASPRINTF])
418 if test "$ac_cv_func_snprintf" = yes; then
423 AC_SUBST([HAVE_SNPRINTF])
424 if test "$ac_cv_func_wprintf" = yes; then
429 AC_SUBST([HAVE_WPRINTF])
434 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
435 dnl 1. when we install a shared library, we must arrange to export
436 dnl auxiliary pointer variables for every exported variable,
437 dnl 2. when we install a shared library and a static library simultaneously,
438 dnl the include file specifies __declspec(dllimport) and therefore we
439 dnl must arrange to define the auxiliary pointer variables for the
440 dnl exported variables _also_ in the static library.
441 if test "$enable_shared" = yes; then
443 cygwin*) is_woe32dll=yes ;;
449 WOE32DLL=$is_woe32dll
452 dnl Rename some macros and functions used for locking.
454 #define __libc_lock_t gl_lock_t
455 #define __libc_lock_define gl_lock_define
456 #define __libc_lock_define_initialized gl_lock_define_initialized
457 #define __libc_lock_init gl_lock_init
458 #define __libc_lock_lock gl_lock_lock
459 #define __libc_lock_unlock gl_lock_unlock
460 #define __libc_lock_recursive_t gl_recursive_lock_t
461 #define __libc_lock_define_recursive gl_recursive_lock_define
462 #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
463 #define __libc_lock_init_recursive gl_recursive_lock_init
464 #define __libc_lock_lock_recursive gl_recursive_lock_lock
465 #define __libc_lock_unlock_recursive gl_recursive_lock_unlock
466 #define glthread_in_use libintl_thread_in_use
467 #define glthread_lock_init libintl_lock_init
468 #define glthread_lock_lock libintl_lock_lock
469 #define glthread_lock_unlock libintl_lock_unlock
470 #define glthread_lock_destroy libintl_lock_destroy
471 #define glthread_rwlock_init libintl_rwlock_init
472 #define glthread_rwlock_rdlock libintl_rwlock_rdlock
473 #define glthread_rwlock_wrlock libintl_rwlock_wrlock
474 #define glthread_rwlock_unlock libintl_rwlock_unlock
475 #define glthread_rwlock_destroy libintl_rwlock_destroy
476 #define glthread_recursive_lock_init libintl_recursive_lock_init
477 #define glthread_recursive_lock_lock libintl_recursive_lock_lock
478 #define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
479 #define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
480 #define glthread_once libintl_once
481 #define glthread_once_call libintl_once_call
482 #define glthread_once_singlethreaded libintl_once_singlethreaded
487 dnl Checks for the core files of the intl subdirectory:
494 dnl hash-string.h hash-string.c
496 dnl libgnuintl.h.in (except the *printf stuff)
501 dnl plural-exp.h plural-exp.c
503 dnl Used by libglocale.
504 AC_DEFUN([gt_INTL_SUBDIR_CORE],
506 AC_REQUIRE([AC_C_INLINE])dnl
507 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
508 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
509 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
510 AC_REQUIRE([AC_FUNC_MMAP])dnl
511 AC_REQUIRE([gt_INTDIV0])dnl
512 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
513 AC_REQUIRE([gl_HEADER_INTTYPES_H])dnl
514 AC_REQUIRE([gt_INTTYPES_PRI])dnl
515 AC_REQUIRE([gl_LOCK])dnl
518 [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
520 [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
521 [Define to 1 if the compiler understands __builtin_expect.])])
523 AC_CHECK_HEADERS([argz.h limits.h unistd.h sys/param.h])
524 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
525 stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
526 argz_next __fsetlocking])
528 dnl Use the *_unlocked functions only if they are declared.
529 dnl (because some of them were defined without being declared in Solaris
530 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
531 dnl on Solaris 2.5.1 to run on Solaris 2.6).
532 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
533 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
534 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
538 dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
539 dnl and a _NL_LOCALE_NAME macro always.
540 AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
541 [AC_TRY_LINK([#include <langinfo.h>
542 #include <locale.h>],
543 [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
544 gt_cv_nl_locale_name=yes,
545 gt_cv_nl_locale_name=no)
547 if test $gt_cv_nl_locale_name = yes; then
548 AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
549 [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
552 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
553 dnl because plural.y uses bison specific features. It requires at least
554 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
556 dnl bison is only needed for the maintainer (who touches plural.y). But in
557 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
558 dnl the rule in general Makefile. Now, some people carelessly touch the
559 dnl files or have a broken "make" program, hence the plural.c rule will
560 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
561 dnl present or too old.
562 AC_CHECK_PROGS([INTLBISON], [bison])
563 if test -z "$INTLBISON"; then
566 dnl Found it, now check the version.
567 AC_MSG_CHECKING([version of bison])
568 changequote(<<,>>)dnl
569 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
570 case $ac_prog_version in
571 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
572 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
574 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
575 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
577 AC_MSG_RESULT([$ac_prog_version])
579 if test $ac_verc_fail = yes; then
585 dnl Checks for special options needed on MacOS X.
586 dnl Defines INTL_MACOSX_LIBS.
587 AC_DEFUN([gt_INTL_MACOSX],
589 dnl Check for API introduced in MacOS X 10.2.
590 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
591 gt_cv_func_CFPreferencesCopyAppValue,
592 [gt_save_LIBS="$LIBS"
593 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
594 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
595 [CFPreferencesCopyAppValue(NULL, NULL)],
596 [gt_cv_func_CFPreferencesCopyAppValue=yes],
597 [gt_cv_func_CFPreferencesCopyAppValue=no])
598 LIBS="$gt_save_LIBS"])
599 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
600 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
601 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
603 dnl Check for API introduced in MacOS X 10.3.
604 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
605 [gt_save_LIBS="$LIBS"
606 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
607 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
608 [gt_cv_func_CFLocaleCopyCurrent=yes],
609 [gt_cv_func_CFLocaleCopyCurrent=no])
610 LIBS="$gt_save_LIBS"])
611 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
612 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
613 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
616 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
617 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
619 AC_SUBST([INTL_MACOSX_LIBS])
623 dnl gt_CHECK_DECL(FUNC, INCLUDES)
624 dnl Check whether a function is declared.
625 AC_DEFUN([gt_CHECK_DECL],
627 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
628 [AC_TRY_COMPILE([$2], [
630 char *p = (char *) $1;
632 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
633 if test $ac_cv_have_decl_$1 = yes; then
638 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
639 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
643 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
644 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
646 # iconv.m4 serial AM4 (gettext-0.11.3)
647 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
648 dnl This file is free software; the Free Software Foundation
649 dnl gives unlimited permission to copy and/or distribute it,
650 dnl with or without modifications, as long as this notice is preserved.
652 dnl From Bruno Haible.
654 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
656 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
657 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
658 AC_REQUIRE([AC_LIB_RPATH])
660 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
662 AC_LIB_LINKFLAGS_BODY([iconv])
665 AC_DEFUN([AM_ICONV_LINK],
667 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
668 dnl those with the standalone portable GNU libiconv installed).
670 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
672 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
674 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
675 dnl because if the user has installed libiconv and not disabled its use
676 dnl via --without-libiconv-prefix, he wants to use it. The first
677 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
678 am_save_CPPFLAGS="$CPPFLAGS"
679 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
681 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
682 am_cv_func_iconv="no, consider installing GNU libiconv"
684 AC_TRY_LINK([#include <stdlib.h>
686 [iconv_t cd = iconv_open("","");
687 iconv(cd,NULL,NULL,NULL,NULL);
689 am_cv_func_iconv=yes)
690 if test "$am_cv_func_iconv" != yes; then
692 LIBS="$LIBS $LIBICONV"
693 AC_TRY_LINK([#include <stdlib.h>
695 [iconv_t cd = iconv_open("","");
696 iconv(cd,NULL,NULL,NULL,NULL);
699 am_cv_func_iconv=yes)
703 if test "$am_cv_func_iconv" = yes; then
704 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
706 if test "$am_cv_lib_iconv" = yes; then
707 AC_MSG_CHECKING([how to link with libiconv])
708 AC_MSG_RESULT([$LIBICONV])
710 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
712 CPPFLAGS="$am_save_CPPFLAGS"
723 if test "$am_cv_func_iconv" = yes; then
724 AC_MSG_CHECKING([for iconv declaration])
725 AC_CACHE_VAL(am_cv_proto_iconv, [
733 #if defined(__STDC__) || defined(__cplusplus)
734 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
738 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
739 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);"])
740 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
741 AC_MSG_RESULT([$]{ac_t:-
742 }[$]am_cv_proto_iconv)
743 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
744 [Define as const if the declaration of iconv() needs const.])
748 # lib-ld.m4 serial 3 (gettext-0.13)
749 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
750 dnl This file is free software; the Free Software Foundation
751 dnl gives unlimited permission to copy and/or distribute it,
752 dnl with or without modifications, as long as this notice is preserved.
754 dnl Subroutines of libtool.m4,
755 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
758 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
759 AC_DEFUN([AC_LIB_PROG_LD_GNU],
760 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
761 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
762 case `$LD -v 2>&1 </dev/null` in
763 *GNU* | *'with BFD'*)
764 acl_cv_prog_gnu_ld=yes ;;
766 acl_cv_prog_gnu_ld=no ;;
768 with_gnu_ld=$acl_cv_prog_gnu_ld
771 dnl From libtool-1.4. Sets the variable LD.
772 AC_DEFUN([AC_LIB_PROG_LD],
774 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
775 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
776 AC_REQUIRE([AC_PROG_CC])dnl
777 AC_REQUIRE([AC_CANONICAL_HOST])dnl
778 # Prepare PATH_SEPARATOR.
779 # The user is always right.
780 if test "${PATH_SEPARATOR+set}" != set; then
781 echo "#! /bin/sh" >conf$$.sh
782 echo "exit 0" >>conf$$.sh
784 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
792 if test "$GCC" = yes; then
793 # Check if gcc -print-prog-name=ld gives a path.
794 AC_MSG_CHECKING([for ld used by GCC])
797 # gcc leaves a trailing carriage return which upsets mingw
798 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
800 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
803 # Accept absolute paths.
804 [[\\/]* | [A-Za-z]:[\\/]*)]
805 [re_direlt='/[^/][^/]*/\.\./']
806 # Canonicalize the path of ld
807 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
808 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
809 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
811 test -z "$LD" && LD="$ac_prog"
814 # If it fails, then pretend we aren't using GCC.
818 # If it is relative, then search for the first ld in PATH.
822 elif test "$with_gnu_ld" = yes; then
823 AC_MSG_CHECKING([for GNU ld])
825 AC_MSG_CHECKING([for non-GNU ld])
827 AC_CACHE_VAL(acl_cv_path_LD,
828 [if test -z "$LD"; then
829 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
830 for ac_dir in $PATH; do
831 test -z "$ac_dir" && ac_dir=.
832 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
833 acl_cv_path_LD="$ac_dir/$ac_prog"
834 # Check to see if the program is GNU ld. I'd rather use --version,
835 # but apparently some GNU ld's only accept -v.
836 # Break only if it was the GNU/non-GNU ld that we prefer.
837 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
838 *GNU* | *'with BFD'*)
839 test "$with_gnu_ld" != no && break ;;
841 test "$with_gnu_ld" != yes && break ;;
847 acl_cv_path_LD="$LD" # Let the user override the test with a path.
850 if test -n "$LD"; then
855 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
859 # lib-link.m4 serial 8 (gettext-0.15)
860 dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
861 dnl This file is free software; the Free Software Foundation
862 dnl gives unlimited permission to copy and/or distribute it,
863 dnl with or without modifications, as long as this notice is preserved.
865 dnl From Bruno Haible.
869 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
870 dnl the libraries corresponding to explicit and implicit dependencies.
871 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
872 dnl augments the CPPFLAGS variable.
873 AC_DEFUN([AC_LIB_LINKFLAGS],
875 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
876 AC_REQUIRE([AC_LIB_RPATH])
877 define([Name],[translit([$1],[./-], [___])])
878 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
879 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
880 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
881 AC_LIB_LINKFLAGS_BODY([$1], [$2])
882 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
883 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
884 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
886 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
887 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
888 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
889 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
891 AC_SUBST([LTLIB]NAME)
892 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
893 dnl results of this search when this library appears as a dependency.
899 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
900 dnl searches for libname and the libraries corresponding to explicit and
901 dnl implicit dependencies, together with the specified include files and
902 dnl the ability to compile and link the specified testcode. If found, it
903 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
904 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
905 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
906 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
907 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
909 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
910 AC_REQUIRE([AC_LIB_RPATH])
911 define([Name],[translit([$1],[./-], [___])])
912 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
913 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
915 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
917 AC_LIB_LINKFLAGS_BODY([$1], [$2])
919 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
920 dnl because if the user has installed lib[]Name and not disabled its use
921 dnl via --without-lib[]Name-prefix, he wants to use it.
922 ac_save_CPPFLAGS="$CPPFLAGS"
923 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
925 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
927 LIBS="$LIBS $LIB[]NAME"
928 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
931 if test "$ac_cv_lib[]Name" = yes; then
933 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
934 AC_MSG_CHECKING([how to link with lib[]$1])
935 AC_MSG_RESULT([$LIB[]NAME])
938 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
939 dnl $INC[]NAME either.
940 CPPFLAGS="$ac_save_CPPFLAGS"
944 AC_SUBST([HAVE_LIB]NAME)
946 AC_SUBST([LTLIB]NAME)
951 dnl Determine the platform dependent parameters needed to use rpath:
952 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
953 dnl hardcode_direct, hardcode_minus_L.
954 AC_DEFUN([AC_LIB_RPATH],
956 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
957 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
958 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
959 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
960 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
961 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
962 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
963 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
964 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
970 libext="$acl_cv_libext"
971 shlibext="$acl_cv_shlibext"
972 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
973 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
974 hardcode_direct="$acl_cv_hardcode_direct"
975 hardcode_minus_L="$acl_cv_hardcode_minus_L"
976 dnl Determine whether the user wants rpath handling at all.
978 [ --disable-rpath do not hardcode runtime library paths],
982 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
983 dnl the libraries corresponding to explicit and implicit dependencies.
984 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
985 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
987 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
988 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
989 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
990 dnl By default, look in $includedir and $libdir.
992 AC_LIB_WITH_FINAL_PREFIX([
993 eval additional_includedir=\"$includedir\"
994 eval additional_libdir=\"$libdir\"
996 AC_LIB_ARG_WITH([lib$1-prefix],
997 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
998 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1000 if test "X$withval" = "Xno"; then
1003 if test "X$withval" = "X"; then
1004 AC_LIB_WITH_FINAL_PREFIX([
1005 eval additional_includedir=\"$includedir\"
1006 eval additional_libdir=\"$libdir\"
1009 additional_includedir="$withval/include"
1010 additional_libdir="$withval/$acl_libdirstem"
1014 dnl Search the library and its dependencies in $additional_libdir and
1015 dnl $LDFLAGS. Using breadth-first-seach.
1021 names_already_handled=
1022 names_next_round='$1 $2'
1023 while test -n "$names_next_round"; do
1024 names_this_round="$names_next_round"
1026 for name in $names_this_round; do
1028 for n in $names_already_handled; do
1029 if test "$n" = "$name"; then
1034 if test -z "$already_handled"; then
1035 names_already_handled="$names_already_handled $name"
1036 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1037 dnl or AC_LIB_HAVE_LINKFLAGS call.
1038 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1039 eval value=\"\$HAVE_LIB$uppername\"
1040 if test -n "$value"; then
1041 if test "$value" = yes; then
1042 eval value=\"\$LIB$uppername\"
1043 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1044 eval value=\"\$LTLIB$uppername\"
1045 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1047 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1048 dnl that this library doesn't exist. So just drop it.
1052 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1053 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1058 if test $use_additional = yes; then
1059 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1060 found_dir="$additional_libdir"
1061 found_so="$additional_libdir/lib$name.$shlibext"
1062 if test -f "$additional_libdir/lib$name.la"; then
1063 found_la="$additional_libdir/lib$name.la"
1066 if test -f "$additional_libdir/lib$name.$libext"; then
1067 found_dir="$additional_libdir"
1068 found_a="$additional_libdir/lib$name.$libext"
1069 if test -f "$additional_libdir/lib$name.la"; then
1070 found_la="$additional_libdir/lib$name.la"
1075 if test "X$found_dir" = "X"; then
1076 for x in $LDFLAGS $LTLIB[]NAME; do
1077 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1080 dir=`echo "X$x" | sed -e 's/^X-L//'`
1081 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1083 found_so="$dir/lib$name.$shlibext"
1084 if test -f "$dir/lib$name.la"; then
1085 found_la="$dir/lib$name.la"
1088 if test -f "$dir/lib$name.$libext"; then
1090 found_a="$dir/lib$name.$libext"
1091 if test -f "$dir/lib$name.la"; then
1092 found_la="$dir/lib$name.la"
1098 if test "X$found_dir" != "X"; then
1103 if test "X$found_dir" != "X"; then
1104 dnl Found the library.
1105 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1106 if test "X$found_so" != "X"; then
1107 dnl Linking with a shared library. We attempt to hardcode its
1108 dnl directory into the executable's runpath, unless it's the
1109 dnl standard /usr/lib.
1110 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
1111 dnl No hardcoding is needed.
1112 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1114 dnl Use an explicit option to hardcode DIR into the resulting
1116 dnl Potentially add DIR to ltrpathdirs.
1117 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1119 for x in $ltrpathdirs; do
1120 if test "X$x" = "X$found_dir"; then
1125 if test -z "$haveit"; then
1126 ltrpathdirs="$ltrpathdirs $found_dir"
1128 dnl The hardcoding into $LIBNAME is system dependent.
1129 if test "$hardcode_direct" = yes; then
1130 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1131 dnl resulting binary.
1132 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1134 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1135 dnl Use an explicit option to hardcode DIR into the resulting
1137 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1138 dnl Potentially add DIR to rpathdirs.
1139 dnl The rpathdirs will be appended to $LIBNAME at the end.
1141 for x in $rpathdirs; do
1142 if test "X$x" = "X$found_dir"; then
1147 if test -z "$haveit"; then
1148 rpathdirs="$rpathdirs $found_dir"
1151 dnl Rely on "-L$found_dir".
1152 dnl But don't add it if it's already contained in the LDFLAGS
1153 dnl or the already constructed $LIBNAME
1155 for x in $LDFLAGS $LIB[]NAME; do
1156 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1157 if test "X$x" = "X-L$found_dir"; then
1162 if test -z "$haveit"; then
1163 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1165 if test "$hardcode_minus_L" != no; then
1166 dnl FIXME: Not sure whether we should use
1167 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1169 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1171 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1172 dnl here, because this doesn't fit in flags passed to the
1173 dnl compiler. So give up. No hardcoding. This affects only
1174 dnl very old systems.
1175 dnl FIXME: Not sure whether we should use
1176 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1178 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1184 if test "X$found_a" != "X"; then
1185 dnl Linking with a static library.
1186 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1188 dnl We shouldn't come here, but anyway it's good to have a
1190 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1193 dnl Assume the include files are nearby.
1194 additional_includedir=
1195 case "$found_dir" in
1196 */$acl_libdirstem | */$acl_libdirstem/)
1197 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1198 additional_includedir="$basedir/include"
1201 if test "X$additional_includedir" != "X"; then
1202 dnl Potentially add $additional_includedir to $INCNAME.
1203 dnl But don't add it
1204 dnl 1. if it's the standard /usr/include,
1205 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1206 dnl 3. if it's already present in $CPPFLAGS or the already
1207 dnl constructed $INCNAME,
1208 dnl 4. if it doesn't exist as a directory.
1209 if test "X$additional_includedir" != "X/usr/include"; then
1211 if test "X$additional_includedir" = "X/usr/local/include"; then
1212 if test -n "$GCC"; then
1214 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1218 if test -z "$haveit"; then
1219 for x in $CPPFLAGS $INC[]NAME; do
1220 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1221 if test "X$x" = "X-I$additional_includedir"; then
1226 if test -z "$haveit"; then
1227 if test -d "$additional_includedir"; then
1228 dnl Really add $additional_includedir to $INCNAME.
1229 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1235 dnl Look for dependencies.
1236 if test -n "$found_la"; then
1237 dnl Read the .la file. It defines the variables
1238 dnl dlname, library_names, old_library, dependency_libs, current,
1239 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1240 save_libdir="$libdir"
1242 */* | *\\*) . "$found_la" ;;
1243 *) . "./$found_la" ;;
1245 libdir="$save_libdir"
1246 dnl We use only dependency_libs.
1247 for dep in $dependency_libs; do
1250 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1251 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1252 dnl But don't add it
1253 dnl 1. if it's the standard /usr/lib,
1254 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1255 dnl 3. if it's already present in $LDFLAGS or the already
1256 dnl constructed $LIBNAME,
1257 dnl 4. if it doesn't exist as a directory.
1258 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1260 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1261 if test -n "$GCC"; then
1263 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1267 if test -z "$haveit"; then
1269 for x in $LDFLAGS $LIB[]NAME; do
1270 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1271 if test "X$x" = "X-L$additional_libdir"; then
1276 if test -z "$haveit"; then
1277 if test -d "$additional_libdir"; then
1278 dnl Really add $additional_libdir to $LIBNAME.
1279 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1283 for x in $LDFLAGS $LTLIB[]NAME; do
1284 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1285 if test "X$x" = "X-L$additional_libdir"; then
1290 if test -z "$haveit"; then
1291 if test -d "$additional_libdir"; then
1292 dnl Really add $additional_libdir to $LTLIBNAME.
1293 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1300 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1301 if test "$enable_rpath" != no; then
1302 dnl Potentially add DIR to rpathdirs.
1303 dnl The rpathdirs will be appended to $LIBNAME at the end.
1305 for x in $rpathdirs; do
1306 if test "X$x" = "X$dir"; then
1311 if test -z "$haveit"; then
1312 rpathdirs="$rpathdirs $dir"
1314 dnl Potentially add DIR to ltrpathdirs.
1315 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1317 for x in $ltrpathdirs; do
1318 if test "X$x" = "X$dir"; then
1323 if test -z "$haveit"; then
1324 ltrpathdirs="$ltrpathdirs $dir"
1329 dnl Handle this in the next round.
1330 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1333 dnl Handle this in the next round. Throw away the .la's
1334 dnl directory; it is already contained in a preceding -L
1336 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1339 dnl Most likely an immediate library name.
1340 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1341 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1347 dnl Didn't find the library; assume it is in the system directories
1348 dnl known to the linker and runtime loader. (All the system
1349 dnl directories known to the linker should also be known to the
1350 dnl runtime loader, otherwise the system is severely misconfigured.)
1351 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1352 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1358 if test "X$rpathdirs" != "X"; then
1359 if test -n "$hardcode_libdir_separator"; then
1360 dnl Weird platform: only the last -rpath option counts, the user must
1361 dnl pass all path elements in one option. We can arrange that for a
1362 dnl single library, but not when more than one $LIBNAMEs are used.
1364 for found_dir in $rpathdirs; do
1365 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1367 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1368 acl_save_libdir="$libdir"
1370 eval flag=\"$hardcode_libdir_flag_spec\"
1371 libdir="$acl_save_libdir"
1372 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1374 dnl The -rpath options are cumulative.
1375 for found_dir in $rpathdirs; do
1376 acl_save_libdir="$libdir"
1378 eval flag=\"$hardcode_libdir_flag_spec\"
1379 libdir="$acl_save_libdir"
1380 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1384 if test "X$ltrpathdirs" != "X"; then
1385 dnl When using libtool, the option that works for both libraries and
1386 dnl executables is -R. The -R options are cumulative.
1387 for found_dir in $ltrpathdirs; do
1388 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1393 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1394 dnl unless already present in VAR.
1395 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1396 dnl contains two or three consecutive elements that belong together.
1397 AC_DEFUN([AC_LIB_APPENDTOVAR],
1399 for element in [$2]; do
1402 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1403 if test "X$x" = "X$element"; then
1408 if test -z "$haveit"; then
1409 [$1]="${[$1]}${[$1]:+ }$element"
1414 dnl For those cases where a variable contains several -L and -l options
1415 dnl referring to unknown libraries and directories, this macro determines the
1416 dnl necessary additional linker options for the runtime path.
1417 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1418 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1419 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1420 dnl otherwise linking without libtool is assumed.
1421 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1423 AC_REQUIRE([AC_LIB_RPATH])
1424 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1426 if test "$enable_rpath" != no; then
1427 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1428 dnl Use an explicit option to hardcode directories into the resulting
1433 if test -n "$next"; then
1435 dnl No need to hardcode the standard /usr/lib.
1436 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1437 rpathdirs="$rpathdirs $dir"
1443 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1444 dnl No need to hardcode the standard /usr/lib.
1445 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1446 rpathdirs="$rpathdirs $dir"
1453 if test "X$rpathdirs" != "X"; then
1454 if test -n ""$3""; then
1455 dnl libtool is used for linking. Use -R options.
1456 for dir in $rpathdirs; do
1457 $1="${$1}${$1:+ }-R$dir"
1460 dnl The linker is used for linking directly.
1461 if test -n "$hardcode_libdir_separator"; then
1462 dnl Weird platform: only the last -rpath option counts, the user
1463 dnl must pass all path elements in one option.
1465 for dir in $rpathdirs; do
1466 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
1468 acl_save_libdir="$libdir"
1470 eval flag=\"$hardcode_libdir_flag_spec\"
1471 libdir="$acl_save_libdir"
1474 dnl The -rpath options are cumulative.
1475 for dir in $rpathdirs; do
1476 acl_save_libdir="$libdir"
1478 eval flag=\"$hardcode_libdir_flag_spec\"
1479 libdir="$acl_save_libdir"
1480 $1="${$1}${$1:+ }$flag"
1490 # lib-prefix.m4 serial 5 (gettext-0.15)
1491 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1492 dnl This file is free software; the Free Software Foundation
1493 dnl gives unlimited permission to copy and/or distribute it,
1494 dnl with or without modifications, as long as this notice is preserved.
1496 dnl From Bruno Haible.
1498 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1499 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1500 dnl require excessive bracketing.
1501 ifdef([AC_HELP_STRING],
1502 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1503 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1505 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1506 dnl to access previously installed libraries. The basic assumption is that
1507 dnl a user will want packages to use other packages he previously installed
1508 dnl with the same --prefix option.
1509 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1510 dnl libraries, but is otherwise very convenient.
1511 AC_DEFUN([AC_LIB_PREFIX],
1513 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1514 AC_REQUIRE([AC_PROG_CC])
1515 AC_REQUIRE([AC_CANONICAL_HOST])
1516 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1517 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1518 dnl By default, look in $includedir and $libdir.
1520 AC_LIB_WITH_FINAL_PREFIX([
1521 eval additional_includedir=\"$includedir\"
1522 eval additional_libdir=\"$libdir\"
1524 AC_LIB_ARG_WITH([lib-prefix],
1525 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1526 --without-lib-prefix don't search for libraries in includedir and libdir],
1528 if test "X$withval" = "Xno"; then
1531 if test "X$withval" = "X"; then
1532 AC_LIB_WITH_FINAL_PREFIX([
1533 eval additional_includedir=\"$includedir\"
1534 eval additional_libdir=\"$libdir\"
1537 additional_includedir="$withval/include"
1538 additional_libdir="$withval/$acl_libdirstem"
1542 if test $use_additional = yes; then
1543 dnl Potentially add $additional_includedir to $CPPFLAGS.
1544 dnl But don't add it
1545 dnl 1. if it's the standard /usr/include,
1546 dnl 2. if it's already present in $CPPFLAGS,
1547 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1548 dnl 4. if it doesn't exist as a directory.
1549 if test "X$additional_includedir" != "X/usr/include"; then
1551 for x in $CPPFLAGS; do
1552 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1553 if test "X$x" = "X-I$additional_includedir"; then
1558 if test -z "$haveit"; then
1559 if test "X$additional_includedir" = "X/usr/local/include"; then
1560 if test -n "$GCC"; then
1562 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1566 if test -z "$haveit"; then
1567 if test -d "$additional_includedir"; then
1568 dnl Really add $additional_includedir to $CPPFLAGS.
1569 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1574 dnl Potentially add $additional_libdir to $LDFLAGS.
1575 dnl But don't add it
1576 dnl 1. if it's the standard /usr/lib,
1577 dnl 2. if it's already present in $LDFLAGS,
1578 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1579 dnl 4. if it doesn't exist as a directory.
1580 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1582 for x in $LDFLAGS; do
1583 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1584 if test "X$x" = "X-L$additional_libdir"; then
1589 if test -z "$haveit"; then
1590 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1591 if test -n "$GCC"; then
1593 linux*) haveit=yes;;
1597 if test -z "$haveit"; then
1598 if test -d "$additional_libdir"; then
1599 dnl Really add $additional_libdir to $LDFLAGS.
1600 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1608 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1609 dnl acl_final_exec_prefix, containing the values to which $prefix and
1610 dnl $exec_prefix will expand at the end of the configure script.
1611 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1613 dnl Unfortunately, prefix and exec_prefix get only finally determined
1614 dnl at the end of configure.
1615 if test "X$prefix" = "XNONE"; then
1616 acl_final_prefix="$ac_default_prefix"
1618 acl_final_prefix="$prefix"
1620 if test "X$exec_prefix" = "XNONE"; then
1621 acl_final_exec_prefix='${prefix}'
1623 acl_final_exec_prefix="$exec_prefix"
1625 acl_save_prefix="$prefix"
1626 prefix="$acl_final_prefix"
1627 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1628 prefix="$acl_save_prefix"
1631 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1632 dnl variables prefix and exec_prefix bound to the values they will have
1633 dnl at the end of the configure script.
1634 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1636 acl_save_prefix="$prefix"
1637 prefix="$acl_final_prefix"
1638 acl_save_exec_prefix="$exec_prefix"
1639 exec_prefix="$acl_final_exec_prefix"
1641 exec_prefix="$acl_save_exec_prefix"
1642 prefix="$acl_save_prefix"
1645 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
1646 dnl the basename of the libdir, either "lib" or "lib64".
1647 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1649 dnl There is no formal standard regarding lib and lib64. The current
1650 dnl practice is that on a system supporting 32-bit and 64-bit instruction
1651 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
1652 dnl libraries go under $prefix/lib. We determine the compiler's default
1653 dnl mode by looking at the compiler's library search path. If at least
1654 dnl of its elements ends in /lib64 or points to a directory whose absolute
1655 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
1656 dnl default, namely "lib".
1658 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1659 if test -n "$searchpath"; then
1660 acl_save_IFS="${IFS= }"; IFS=":"
1661 for searchdir in $searchpath; do
1662 if test -d "$searchdir"; then
1663 case "$searchdir" in
1664 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1665 *) searchdir=`cd "$searchdir" && pwd`
1666 case "$searchdir" in
1667 */lib64 ) acl_libdirstem=lib64 ;;
1676 # nls.m4 serial 3 (gettext-0.15)
1677 dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
1678 dnl This file is free software; the Free Software Foundation
1679 dnl gives unlimited permission to copy and/or distribute it,
1680 dnl with or without modifications, as long as this notice is preserved.
1682 dnl This file can can be used in projects which are not available under
1683 dnl the GNU General Public License or the GNU Library General Public
1684 dnl License but which still want to provide support for the GNU gettext
1686 dnl Please note that the actual code of the GNU gettext library is covered
1687 dnl by the GNU Library General Public License, and the rest of the GNU
1688 dnl gettext package package is covered by the GNU General Public License.
1689 dnl They are *not* in the public domain.
1692 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1693 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1699 AC_MSG_CHECKING([whether NLS is requested])
1700 dnl Default is enabled NLS
1702 [ --disable-nls do not use Native Language Support],
1703 USE_NLS=$enableval, USE_NLS=yes)
1704 AC_MSG_RESULT($USE_NLS)
1708 # po.m4 serial 13 (gettext-0.15)
1709 dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
1710 dnl This file is free software; the Free Software Foundation
1711 dnl gives unlimited permission to copy and/or distribute it,
1712 dnl with or without modifications, as long as this notice is preserved.
1714 dnl This file can can be used in projects which are not available under
1715 dnl the GNU General Public License or the GNU Library General Public
1716 dnl License but which still want to provide support for the GNU gettext
1718 dnl Please note that the actual code of the GNU gettext library is covered
1719 dnl by the GNU Library General Public License, and the rest of the GNU
1720 dnl gettext package package is covered by the GNU General Public License.
1721 dnl They are *not* in the public domain.
1724 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1725 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1729 dnl Checks for all prerequisites of the po subdirectory.
1730 AC_DEFUN([AM_PO_SUBDIRS],
1732 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1733 AC_REQUIRE([AC_PROG_INSTALL])dnl
1734 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
1735 AC_REQUIRE([AM_NLS])dnl
1737 dnl Perform the following tests also if --disable-nls has been given,
1738 dnl because they are needed for "make dist" to work.
1740 dnl Search for GNU msgfmt in the PATH.
1741 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1742 dnl The second test excludes FreeBSD msgfmt.
1743 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1744 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1745 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1747 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1749 dnl Test whether it is GNU msgfmt >= 0.15.
1751 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1752 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
1753 *) MSGFMT_015=$MSGFMT ;;
1756 AC_SUBST([MSGFMT_015])
1758 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1759 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
1760 *) GMSGFMT_015=$GMSGFMT ;;
1763 AC_SUBST([GMSGFMT_015])
1765 dnl Search for GNU xgettext 0.12 or newer in the PATH.
1766 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1767 dnl The second test excludes FreeBSD xgettext.
1768 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1769 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1770 (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)],
1772 dnl Remove leftover from FreeBSD xgettext call.
1775 dnl Test whether it is GNU xgettext >= 0.15.
1777 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1778 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
1779 *) XGETTEXT_015=$XGETTEXT ;;
1782 AC_SUBST([XGETTEXT_015])
1784 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1785 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1786 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
1788 dnl Installation directories.
1789 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
1790 dnl have to define it here, so that it can be used in po/Makefile.
1791 test -n "$localedir" || localedir='${datadir}/locale'
1792 AC_SUBST([localedir])
1794 AC_CONFIG_COMMANDS([po-directories], [[
1795 for ac_file in $CONFIG_FILES; do
1796 # Support "outfile[:infile[:infile...]]"
1798 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1800 # PO directories have a Makefile.in generated from Makefile.in.in.
1801 case "$ac_file" in */Makefile.in)
1802 # Adjust a relative srcdir.
1803 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1804 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1805 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1806 # In autoconf-2.13 it is called $ac_given_srcdir.
1807 # In autoconf-2.50 it is called $srcdir.
1808 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1809 case "$ac_given_srcdir" in
1810 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1811 /*) top_srcdir="$ac_given_srcdir" ;;
1812 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1814 # Treat a directory as a PO directory if and only if it has a
1815 # POTFILES.in file. This allows packages to have multiple PO
1816 # directories under different names or in different locations.
1817 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1818 rm -f "$ac_dir/POTFILES"
1819 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1820 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1821 POMAKEFILEDEPS="POTFILES.in"
1822 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1823 # on $ac_dir but don't depend on user-specified configuration
1825 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1826 # The LINGUAS file contains the set of available languages.
1827 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1828 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1830 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1831 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1832 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1833 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1835 # The set of available languages was given in configure.in.
1836 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1837 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1840 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1841 # Compute UPDATEPOFILES
1842 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1843 # Compute DUMMYPOFILES
1844 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1846 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1847 case "$ac_given_srcdir" in
1849 *) srcdirpre='$(srcdir)/' ;;
1855 for lang in $ALL_LINGUAS; do
1856 POFILES="$POFILES $srcdirpre$lang.po"
1857 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1858 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1859 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1861 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1862 # environment variable.
1864 if test -n "$ALL_LINGUAS"; then
1865 for presentlang in $ALL_LINGUAS; do
1867 if test "%UNSET%" != "$LINGUAS"; then
1868 desiredlanguages="$LINGUAS"
1870 desiredlanguages="$ALL_LINGUAS"
1872 for desiredlang in $desiredlanguages; do
1873 # Use the presentlang catalog if desiredlang is
1874 # a. equal to presentlang, or
1875 # b. a variant of presentlang (because in this case,
1876 # presentlang can be used as a fallback for messages
1877 # which are not translated in the desiredlang catalog).
1878 case "$desiredlang" in
1879 "$presentlang"*) useit=yes;;
1882 if test $useit = yes; then
1883 INST_LINGUAS="$INST_LINGUAS $presentlang"
1888 if test -n "$INST_LINGUAS"; then
1889 for lang in $INST_LINGUAS; do
1890 CATALOGS="$CATALOGS $lang.gmo"
1893 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1894 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"
1895 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1896 if test -f "$f"; then
1898 *.orig | *.bak | *~) ;;
1899 *) cat "$f" >> "$ac_dir/Makefile" ;;
1907 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1908 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
1909 # from automake < 1.5.
1910 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1911 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1912 LINGUAS="${LINGUAS-%UNSET%}"
1916 dnl Postprocesses a Makefile in a directory containing PO files.
1917 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
1919 # When this code is run, in config.status, two variables have already been
1921 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
1922 # - LINGUAS is the value of the environment variable LINGUAS at configure
1926 # Adjust a relative srcdir.
1927 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1928 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1929 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1930 # In autoconf-2.13 it is called $ac_given_srcdir.
1931 # In autoconf-2.50 it is called $srcdir.
1932 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1933 case "$ac_given_srcdir" in
1934 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1935 /*) top_srcdir="$ac_given_srcdir" ;;
1936 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1939 # Find a way to echo strings without interpreting backslash.
1940 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
1943 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
1944 gt_echo='printf %s\n'
1955 # A sed script that extracts the value of VARIABLE from a Makefile.
1957 # Test if the hold space is empty.
1962 # Yes it was empty. Look if we have the expected variable definition.
1963 /^[ ]*VARIABLE[ ]*=/{
1964 # Seen the first line of the variable definition.
1965 s/^[ ]*VARIABLE[ ]*=//
1970 # Here we are processing a line from the variable definition.
1971 # Remove comment, more precisely replace it with a space.
1973 # See if the line ends in a backslash.
1977 # Print the line, without the trailing backslash.
1980 # There was no trailing backslash. The end of the variable definition is
1981 # reached. Clear the hold space.
1986 # A trailing backslash means that the variable definition continues in the
1987 # next line. Put a nonempty string into the hold space to indicate this.
1994 # Set POTFILES to the value of the Makefile variable POTFILES.
1995 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
1996 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
1997 # Compute POTFILES_DEPS as
1998 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2000 for file in $POTFILES; do
2001 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2005 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2006 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2008 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2009 # The LINGUAS file contains the set of available languages.
2010 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2011 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2013 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2014 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2015 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2017 # Hide the ALL_LINGUAS assigment from automake < 1.5.
2018 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2020 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2021 # Compute UPDATEPOFILES
2022 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2023 # Compute DUMMYPOFILES
2024 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2026 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2027 # Compute PROPERTIESFILES
2028 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2029 # Compute CLASSFILES
2030 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2032 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2034 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2035 # Compute RESOURCESDLLFILES
2036 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2037 case "$ac_given_srcdir" in
2039 *) srcdirpre='$(srcdir)/' ;;
2050 for lang in $ALL_LINGUAS; do
2051 POFILES="$POFILES $srcdirpre$lang.po"
2052 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2053 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2054 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2055 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2056 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2057 QMFILES="$QMFILES $srcdirpre$lang.qm"
2058 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2059 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2060 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/'`
2061 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2063 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2064 # environment variable.
2066 if test -n "$ALL_LINGUAS"; then
2067 for presentlang in $ALL_LINGUAS; do
2069 if test "%UNSET%" != "$LINGUAS"; then
2070 desiredlanguages="$LINGUAS"
2072 desiredlanguages="$ALL_LINGUAS"
2074 for desiredlang in $desiredlanguages; do
2075 # Use the presentlang catalog if desiredlang is
2076 # a. equal to presentlang, or
2077 # b. a variant of presentlang (because in this case,
2078 # presentlang can be used as a fallback for messages
2079 # which are not translated in the desiredlang catalog).
2080 case "$desiredlang" in
2081 "$presentlang"*) useit=yes;;
2084 if test $useit = yes; then
2085 INST_LINGUAS="$INST_LINGUAS $presentlang"
2094 if test -n "$INST_LINGUAS"; then
2095 for lang in $INST_LINGUAS; do
2096 CATALOGS="$CATALOGS $lang.gmo"
2097 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2098 QTCATALOGS="$QTCATALOGS $lang.qm"
2099 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2100 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2101 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/'`
2102 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2106 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"
2107 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2108 # Add dependencies that cannot be formulated as a simple suffix rule.
2109 for lang in $ALL_LINGUAS; do
2110 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2111 cat >> "$ac_file.tmp" <<EOF
2112 $frobbedlang.msg: $lang.po
2113 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2114 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2118 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2119 # Add dependencies that cannot be formulated as a simple suffix rule.
2120 for lang in $ALL_LINGUAS; do
2121 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/'`
2122 cat >> "$ac_file.tmp" <<EOF
2123 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2124 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2125 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2129 if test -n "$POMAKEFILEDEPS"; then
2130 cat >> "$ac_file.tmp" <<EOF
2131 Makefile: $POMAKEFILEDEPS
2134 mv "$ac_file.tmp" "$ac_file"
2137 # progtest.m4 serial 4 (gettext-0.14.2)
2138 dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
2139 dnl This file is free software; the Free Software Foundation
2140 dnl gives unlimited permission to copy and/or distribute it,
2141 dnl with or without modifications, as long as this notice is preserved.
2143 dnl This file can can be used in projects which are not available under
2144 dnl the GNU General Public License or the GNU Library General Public
2145 dnl License but which still want to provide support for the GNU gettext
2147 dnl Please note that the actual code of the GNU gettext library is covered
2148 dnl by the GNU Library General Public License, and the rest of the GNU
2149 dnl gettext package package is covered by the GNU General Public License.
2150 dnl They are *not* in the public domain.
2153 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2157 # Search path for a program which passes the given test.
2159 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2160 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2161 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2163 # Prepare PATH_SEPARATOR.
2164 # The user is always right.
2165 if test "${PATH_SEPARATOR+set}" != set; then
2166 echo "#! /bin/sh" >conf$$.sh
2167 echo "exit 0" >>conf$$.sh
2169 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2177 # Find out how to test for executable files. Don't use a zero-byte file,
2178 # as systems may use methods other than mode bits to determine executability.
2179 cat >conf$$.file <<_ASEOF
2183 chmod +x conf$$.file
2184 if test -x conf$$.file >/dev/null 2>&1; then
2185 ac_executable_p="test -x"
2187 ac_executable_p="test -f"
2191 # Extract the first word of "$2", so it can be a program name with args.
2192 set dummy $2; ac_word=[$]2
2193 AC_MSG_CHECKING([for $ac_word])
2194 AC_CACHE_VAL(ac_cv_path_$1,
2196 [[\\/]]* | ?:[[\\/]]*)
2197 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2200 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2201 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2203 test -z "$ac_dir" && ac_dir=.
2204 for ac_exec_ext in '' $ac_executable_extensions; do
2205 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2206 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2208 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2215 dnl If no 4th arg is given, leave the cache variable unset,
2216 dnl so AC_PATH_PROGS will keep looking.
2217 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2222 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2223 AC_MSG_RESULT([$]$1)
2230 # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
2232 # This file is free software; the Free Software Foundation
2233 # gives unlimited permission to copy and/or distribute it,
2234 # with or without modifications, as long as this notice is preserved.
2238 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
2240 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
2241 # created by `make install' are always world readable, even if the
2242 # installer happens to have an overly restrictive umask (e.g. 077).
2243 # This was a mistake. There are at least two reasons why we must not
2245 # - it causes special bits like SGID to be ignored,
2246 # - it may be too restrictive (some setups expect 775 directories).
2248 # Do not use -m 0755 and let people choose whatever they expect by
2251 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
2252 # Some implementations (such as Solaris 8's) are not thread-safe: if a
2253 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
2254 # concurrently, both version can detect that a/ is missing, but only
2255 # one can create it and the other will error out. Consequently we
2256 # restrict ourselves to GNU make (using the --version option ensures
2258 AC_DEFUN([AM_PROG_MKDIR_P],
2259 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
2260 # We used to keeping the `.' as first argument, in order to
2261 # allow $(mkdir_p) to be used without argument. As in
2262 # $(mkdir_p) $(somedir)
2263 # where $(somedir) is conditionally defined. However this is wrong
2265 # 1. if the package is installed by a user who cannot write `.'
2266 # make install will fail,
2267 # 2. the above comment should most certainly read
2268 # $(mkdir_p) $(DESTDIR)$(somedir)
2269 # so it does not work when $(somedir) is undefined and
2270 # $(DESTDIR) is not.
2271 # To support the latter case, we have to write
2272 # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
2273 # so the `.' trick is pointless.
2274 mkdir_p='mkdir -p --'
2276 # On NextStep and OpenStep, the `mkdir' command does not
2277 # recognize any option. It will interpret all options as
2278 # directories to create, and then abort because `.' already
2280 for d in ./-p ./--version;
2282 test -d $d && rmdir $d
2284 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
2285 if test -f "$ac_aux_dir/mkinstalldirs"; then
2286 mkdir_p='$(mkinstalldirs)'
2288 mkdir_p='$(install_sh) -d'
2291 AC_SUBST([mkdir_p])])
2293 m4_include([buildlib/tools.m4])