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 59 (gettext-0.16.1)
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-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 Checks for special options needed on MacOS X.
379 dnl Defines INTL_MACOSX_LIBS.
380 AC_DEFUN([gt_INTL_MACOSX],
382 dnl Check for API introduced in MacOS X 10.2.
383 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
384 gt_cv_func_CFPreferencesCopyAppValue,
385 [gt_save_LIBS="$LIBS"
386 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
387 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
388 [CFPreferencesCopyAppValue(NULL, NULL)],
389 [gt_cv_func_CFPreferencesCopyAppValue=yes],
390 [gt_cv_func_CFPreferencesCopyAppValue=no])
391 LIBS="$gt_save_LIBS"])
392 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
393 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
394 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
396 dnl Check for API introduced in MacOS X 10.3.
397 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
398 [gt_save_LIBS="$LIBS"
399 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
400 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
401 [gt_cv_func_CFLocaleCopyCurrent=yes],
402 [gt_cv_func_CFLocaleCopyCurrent=no])
403 LIBS="$gt_save_LIBS"])
404 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
405 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
406 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
409 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
410 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
412 AC_SUBST([INTL_MACOSX_LIBS])
416 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
417 m4_define([gt_NEEDS_INIT],
419 m4_divert_text([DEFAULTS], [gt_needs=])
420 m4_define([gt_NEEDS_INIT], [])
424 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
425 AC_DEFUN([AM_GNU_GETTEXT_NEED],
427 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
431 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
432 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
434 # iconv.m4 serial AM4 (gettext-0.11.3)
435 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
436 dnl This file is free software; the Free Software Foundation
437 dnl gives unlimited permission to copy and/or distribute it,
438 dnl with or without modifications, as long as this notice is preserved.
440 dnl From Bruno Haible.
442 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
444 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
445 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
446 AC_REQUIRE([AC_LIB_RPATH])
448 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
450 AC_LIB_LINKFLAGS_BODY([iconv])
453 AC_DEFUN([AM_ICONV_LINK],
455 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
456 dnl those with the standalone portable GNU libiconv installed).
458 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
460 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
462 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
463 dnl because if the user has installed libiconv and not disabled its use
464 dnl via --without-libiconv-prefix, he wants to use it. The first
465 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
466 am_save_CPPFLAGS="$CPPFLAGS"
467 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
469 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
470 am_cv_func_iconv="no, consider installing GNU libiconv"
472 AC_TRY_LINK([#include <stdlib.h>
474 [iconv_t cd = iconv_open("","");
475 iconv(cd,NULL,NULL,NULL,NULL);
477 am_cv_func_iconv=yes)
478 if test "$am_cv_func_iconv" != yes; then
480 LIBS="$LIBS $LIBICONV"
481 AC_TRY_LINK([#include <stdlib.h>
483 [iconv_t cd = iconv_open("","");
484 iconv(cd,NULL,NULL,NULL,NULL);
487 am_cv_func_iconv=yes)
491 if test "$am_cv_func_iconv" = yes; then
492 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
494 if test "$am_cv_lib_iconv" = yes; then
495 AC_MSG_CHECKING([how to link with libiconv])
496 AC_MSG_RESULT([$LIBICONV])
498 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
500 CPPFLAGS="$am_save_CPPFLAGS"
511 if test "$am_cv_func_iconv" = yes; then
512 AC_MSG_CHECKING([for iconv declaration])
513 AC_CACHE_VAL(am_cv_proto_iconv, [
521 #if defined(__STDC__) || defined(__cplusplus)
522 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
526 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
527 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);"])
528 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
529 AC_MSG_RESULT([$]{ac_t:-
530 }[$]am_cv_proto_iconv)
531 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
532 [Define as const if the declaration of iconv() needs const.])
536 # lib-ld.m4 serial 3 (gettext-0.13)
537 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
538 dnl This file is free software; the Free Software Foundation
539 dnl gives unlimited permission to copy and/or distribute it,
540 dnl with or without modifications, as long as this notice is preserved.
542 dnl Subroutines of libtool.m4,
543 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
546 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
547 AC_DEFUN([AC_LIB_PROG_LD_GNU],
548 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
549 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
550 case `$LD -v 2>&1 </dev/null` in
551 *GNU* | *'with BFD'*)
552 acl_cv_prog_gnu_ld=yes ;;
554 acl_cv_prog_gnu_ld=no ;;
556 with_gnu_ld=$acl_cv_prog_gnu_ld
559 dnl From libtool-1.4. Sets the variable LD.
560 AC_DEFUN([AC_LIB_PROG_LD],
562 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
563 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
564 AC_REQUIRE([AC_PROG_CC])dnl
565 AC_REQUIRE([AC_CANONICAL_HOST])dnl
566 # Prepare PATH_SEPARATOR.
567 # The user is always right.
568 if test "${PATH_SEPARATOR+set}" != set; then
569 echo "#! /bin/sh" >conf$$.sh
570 echo "exit 0" >>conf$$.sh
572 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
580 if test "$GCC" = yes; then
581 # Check if gcc -print-prog-name=ld gives a path.
582 AC_MSG_CHECKING([for ld used by GCC])
585 # gcc leaves a trailing carriage return which upsets mingw
586 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
588 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
591 # Accept absolute paths.
592 [[\\/]* | [A-Za-z]:[\\/]*)]
593 [re_direlt='/[^/][^/]*/\.\./']
594 # Canonicalize the path of ld
595 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
596 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
597 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
599 test -z "$LD" && LD="$ac_prog"
602 # If it fails, then pretend we aren't using GCC.
606 # If it is relative, then search for the first ld in PATH.
610 elif test "$with_gnu_ld" = yes; then
611 AC_MSG_CHECKING([for GNU ld])
613 AC_MSG_CHECKING([for non-GNU ld])
615 AC_CACHE_VAL(acl_cv_path_LD,
616 [if test -z "$LD"; then
617 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
618 for ac_dir in $PATH; do
619 test -z "$ac_dir" && ac_dir=.
620 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
621 acl_cv_path_LD="$ac_dir/$ac_prog"
622 # Check to see if the program is GNU ld. I'd rather use --version,
623 # but apparently some GNU ld's only accept -v.
624 # Break only if it was the GNU/non-GNU ld that we prefer.
625 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
626 *GNU* | *'with BFD'*)
627 test "$with_gnu_ld" != no && break ;;
629 test "$with_gnu_ld" != yes && break ;;
635 acl_cv_path_LD="$LD" # Let the user override the test with a path.
638 if test -n "$LD"; then
643 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
647 # lib-link.m4 serial 9 (gettext-0.16)
648 dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
649 dnl This file is free software; the Free Software Foundation
650 dnl gives unlimited permission to copy and/or distribute it,
651 dnl with or without modifications, as long as this notice is preserved.
653 dnl From Bruno Haible.
657 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
658 dnl the libraries corresponding to explicit and implicit dependencies.
659 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
660 dnl augments the CPPFLAGS variable.
661 AC_DEFUN([AC_LIB_LINKFLAGS],
663 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
664 AC_REQUIRE([AC_LIB_RPATH])
665 define([Name],[translit([$1],[./-], [___])])
666 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
667 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
668 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
669 AC_LIB_LINKFLAGS_BODY([$1], [$2])
670 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
671 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
672 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
674 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
675 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
676 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
677 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
679 AC_SUBST([LTLIB]NAME)
680 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
681 dnl results of this search when this library appears as a dependency.
687 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
688 dnl searches for libname and the libraries corresponding to explicit and
689 dnl implicit dependencies, together with the specified include files and
690 dnl the ability to compile and link the specified testcode. If found, it
691 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
692 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
693 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
694 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
695 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
697 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
698 AC_REQUIRE([AC_LIB_RPATH])
699 define([Name],[translit([$1],[./-], [___])])
700 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
701 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
703 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
705 AC_LIB_LINKFLAGS_BODY([$1], [$2])
707 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
708 dnl because if the user has installed lib[]Name and not disabled its use
709 dnl via --without-lib[]Name-prefix, he wants to use it.
710 ac_save_CPPFLAGS="$CPPFLAGS"
711 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
713 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
715 LIBS="$LIBS $LIB[]NAME"
716 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
719 if test "$ac_cv_lib[]Name" = yes; then
721 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
722 AC_MSG_CHECKING([how to link with lib[]$1])
723 AC_MSG_RESULT([$LIB[]NAME])
726 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
727 dnl $INC[]NAME either.
728 CPPFLAGS="$ac_save_CPPFLAGS"
732 AC_SUBST([HAVE_LIB]NAME)
734 AC_SUBST([LTLIB]NAME)
739 dnl Determine the platform dependent parameters needed to use rpath:
740 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
741 dnl hardcode_direct, hardcode_minus_L.
742 AC_DEFUN([AC_LIB_RPATH],
744 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
745 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
746 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
747 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
748 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
749 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
750 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
751 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
752 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
758 libext="$acl_cv_libext"
759 shlibext="$acl_cv_shlibext"
760 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
761 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
762 hardcode_direct="$acl_cv_hardcode_direct"
763 hardcode_minus_L="$acl_cv_hardcode_minus_L"
764 dnl Determine whether the user wants rpath handling at all.
766 [ --disable-rpath do not hardcode runtime library paths],
770 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
771 dnl the libraries corresponding to explicit and implicit dependencies.
772 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
773 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
775 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
776 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
777 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
778 dnl By default, look in $includedir and $libdir.
780 AC_LIB_WITH_FINAL_PREFIX([
781 eval additional_includedir=\"$includedir\"
782 eval additional_libdir=\"$libdir\"
784 AC_LIB_ARG_WITH([lib$1-prefix],
785 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
786 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
788 if test "X$withval" = "Xno"; then
791 if test "X$withval" = "X"; then
792 AC_LIB_WITH_FINAL_PREFIX([
793 eval additional_includedir=\"$includedir\"
794 eval additional_libdir=\"$libdir\"
797 additional_includedir="$withval/include"
798 additional_libdir="$withval/$acl_libdirstem"
802 dnl Search the library and its dependencies in $additional_libdir and
803 dnl $LDFLAGS. Using breadth-first-seach.
809 names_already_handled=
810 names_next_round='$1 $2'
811 while test -n "$names_next_round"; do
812 names_this_round="$names_next_round"
814 for name in $names_this_round; do
816 for n in $names_already_handled; do
817 if test "$n" = "$name"; then
822 if test -z "$already_handled"; then
823 names_already_handled="$names_already_handled $name"
824 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
825 dnl or AC_LIB_HAVE_LINKFLAGS call.
826 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
827 eval value=\"\$HAVE_LIB$uppername\"
828 if test -n "$value"; then
829 if test "$value" = yes; then
830 eval value=\"\$LIB$uppername\"
831 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
832 eval value=\"\$LTLIB$uppername\"
833 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
835 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
836 dnl that this library doesn't exist. So just drop it.
840 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
841 dnl and the already constructed $LIBNAME/$LTLIBNAME.
846 if test $use_additional = yes; then
847 if test -n "$shlibext" \
848 && { test -f "$additional_libdir/lib$name.$shlibext" \
849 || { test "$shlibext" = dll \
850 && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
851 found_dir="$additional_libdir"
852 if test -f "$additional_libdir/lib$name.$shlibext"; then
853 found_so="$additional_libdir/lib$name.$shlibext"
855 found_so="$additional_libdir/lib$name.dll.a"
857 if test -f "$additional_libdir/lib$name.la"; then
858 found_la="$additional_libdir/lib$name.la"
861 if test -f "$additional_libdir/lib$name.$libext"; then
862 found_dir="$additional_libdir"
863 found_a="$additional_libdir/lib$name.$libext"
864 if test -f "$additional_libdir/lib$name.la"; then
865 found_la="$additional_libdir/lib$name.la"
870 if test "X$found_dir" = "X"; then
871 for x in $LDFLAGS $LTLIB[]NAME; do
872 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
875 dir=`echo "X$x" | sed -e 's/^X-L//'`
876 if test -n "$shlibext" \
877 && { test -f "$dir/lib$name.$shlibext" \
878 || { test "$shlibext" = dll \
879 && test -f "$dir/lib$name.dll.a"; }; }; then
881 if test -f "$dir/lib$name.$shlibext"; then
882 found_so="$dir/lib$name.$shlibext"
884 found_so="$dir/lib$name.dll.a"
886 if test -f "$dir/lib$name.la"; then
887 found_la="$dir/lib$name.la"
890 if test -f "$dir/lib$name.$libext"; then
892 found_a="$dir/lib$name.$libext"
893 if test -f "$dir/lib$name.la"; then
894 found_la="$dir/lib$name.la"
900 if test "X$found_dir" != "X"; then
905 if test "X$found_dir" != "X"; then
906 dnl Found the library.
907 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
908 if test "X$found_so" != "X"; then
909 dnl Linking with a shared library. We attempt to hardcode its
910 dnl directory into the executable's runpath, unless it's the
911 dnl standard /usr/lib.
912 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
913 dnl No hardcoding is needed.
914 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
916 dnl Use an explicit option to hardcode DIR into the resulting
918 dnl Potentially add DIR to ltrpathdirs.
919 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
921 for x in $ltrpathdirs; do
922 if test "X$x" = "X$found_dir"; then
927 if test -z "$haveit"; then
928 ltrpathdirs="$ltrpathdirs $found_dir"
930 dnl The hardcoding into $LIBNAME is system dependent.
931 if test "$hardcode_direct" = yes; then
932 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
933 dnl resulting binary.
934 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
936 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
937 dnl Use an explicit option to hardcode DIR into the resulting
939 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
940 dnl Potentially add DIR to rpathdirs.
941 dnl The rpathdirs will be appended to $LIBNAME at the end.
943 for x in $rpathdirs; do
944 if test "X$x" = "X$found_dir"; then
949 if test -z "$haveit"; then
950 rpathdirs="$rpathdirs $found_dir"
953 dnl Rely on "-L$found_dir".
954 dnl But don't add it if it's already contained in the LDFLAGS
955 dnl or the already constructed $LIBNAME
957 for x in $LDFLAGS $LIB[]NAME; do
958 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
959 if test "X$x" = "X-L$found_dir"; then
964 if test -z "$haveit"; then
965 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
967 if test "$hardcode_minus_L" != no; then
968 dnl FIXME: Not sure whether we should use
969 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
971 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
973 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
974 dnl here, because this doesn't fit in flags passed to the
975 dnl compiler. So give up. No hardcoding. This affects only
976 dnl very old systems.
977 dnl FIXME: Not sure whether we should use
978 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
980 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
986 if test "X$found_a" != "X"; then
987 dnl Linking with a static library.
988 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
990 dnl We shouldn't come here, but anyway it's good to have a
992 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
995 dnl Assume the include files are nearby.
996 additional_includedir=
998 */$acl_libdirstem | */$acl_libdirstem/)
999 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1000 additional_includedir="$basedir/include"
1003 if test "X$additional_includedir" != "X"; then
1004 dnl Potentially add $additional_includedir to $INCNAME.
1005 dnl But don't add it
1006 dnl 1. if it's the standard /usr/include,
1007 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1008 dnl 3. if it's already present in $CPPFLAGS or the already
1009 dnl constructed $INCNAME,
1010 dnl 4. if it doesn't exist as a directory.
1011 if test "X$additional_includedir" != "X/usr/include"; then
1013 if test "X$additional_includedir" = "X/usr/local/include"; then
1014 if test -n "$GCC"; then
1016 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1020 if test -z "$haveit"; then
1021 for x in $CPPFLAGS $INC[]NAME; do
1022 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1023 if test "X$x" = "X-I$additional_includedir"; then
1028 if test -z "$haveit"; then
1029 if test -d "$additional_includedir"; then
1030 dnl Really add $additional_includedir to $INCNAME.
1031 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1037 dnl Look for dependencies.
1038 if test -n "$found_la"; then
1039 dnl Read the .la file. It defines the variables
1040 dnl dlname, library_names, old_library, dependency_libs, current,
1041 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1042 save_libdir="$libdir"
1044 */* | *\\*) . "$found_la" ;;
1045 *) . "./$found_la" ;;
1047 libdir="$save_libdir"
1048 dnl We use only dependency_libs.
1049 for dep in $dependency_libs; do
1052 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1053 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1054 dnl But don't add it
1055 dnl 1. if it's the standard /usr/lib,
1056 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1057 dnl 3. if it's already present in $LDFLAGS or the already
1058 dnl constructed $LIBNAME,
1059 dnl 4. if it doesn't exist as a directory.
1060 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1062 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1063 if test -n "$GCC"; then
1065 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1069 if test -z "$haveit"; then
1071 for x in $LDFLAGS $LIB[]NAME; do
1072 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1073 if test "X$x" = "X-L$additional_libdir"; then
1078 if test -z "$haveit"; then
1079 if test -d "$additional_libdir"; then
1080 dnl Really add $additional_libdir to $LIBNAME.
1081 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1085 for x in $LDFLAGS $LTLIB[]NAME; do
1086 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1087 if test "X$x" = "X-L$additional_libdir"; then
1092 if test -z "$haveit"; then
1093 if test -d "$additional_libdir"; then
1094 dnl Really add $additional_libdir to $LTLIBNAME.
1095 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1102 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1103 if test "$enable_rpath" != no; then
1104 dnl Potentially add DIR to rpathdirs.
1105 dnl The rpathdirs will be appended to $LIBNAME at the end.
1107 for x in $rpathdirs; do
1108 if test "X$x" = "X$dir"; then
1113 if test -z "$haveit"; then
1114 rpathdirs="$rpathdirs $dir"
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$dir"; then
1125 if test -z "$haveit"; then
1126 ltrpathdirs="$ltrpathdirs $dir"
1131 dnl Handle this in the next round.
1132 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1135 dnl Handle this in the next round. Throw away the .la's
1136 dnl directory; it is already contained in a preceding -L
1138 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1141 dnl Most likely an immediate library name.
1142 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1143 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1149 dnl Didn't find the library; assume it is in the system directories
1150 dnl known to the linker and runtime loader. (All the system
1151 dnl directories known to the linker should also be known to the
1152 dnl runtime loader, otherwise the system is severely misconfigured.)
1153 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1154 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1160 if test "X$rpathdirs" != "X"; then
1161 if test -n "$hardcode_libdir_separator"; then
1162 dnl Weird platform: only the last -rpath option counts, the user must
1163 dnl pass all path elements in one option. We can arrange that for a
1164 dnl single library, but not when more than one $LIBNAMEs are used.
1166 for found_dir in $rpathdirs; do
1167 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1169 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1170 acl_save_libdir="$libdir"
1172 eval flag=\"$hardcode_libdir_flag_spec\"
1173 libdir="$acl_save_libdir"
1174 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1176 dnl The -rpath options are cumulative.
1177 for found_dir in $rpathdirs; do
1178 acl_save_libdir="$libdir"
1180 eval flag=\"$hardcode_libdir_flag_spec\"
1181 libdir="$acl_save_libdir"
1182 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1186 if test "X$ltrpathdirs" != "X"; then
1187 dnl When using libtool, the option that works for both libraries and
1188 dnl executables is -R. The -R options are cumulative.
1189 for found_dir in $ltrpathdirs; do
1190 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1195 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1196 dnl unless already present in VAR.
1197 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1198 dnl contains two or three consecutive elements that belong together.
1199 AC_DEFUN([AC_LIB_APPENDTOVAR],
1201 for element in [$2]; do
1204 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1205 if test "X$x" = "X$element"; then
1210 if test -z "$haveit"; then
1211 [$1]="${[$1]}${[$1]:+ }$element"
1216 dnl For those cases where a variable contains several -L and -l options
1217 dnl referring to unknown libraries and directories, this macro determines the
1218 dnl necessary additional linker options for the runtime path.
1219 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1220 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1221 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1222 dnl otherwise linking without libtool is assumed.
1223 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1225 AC_REQUIRE([AC_LIB_RPATH])
1226 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1228 if test "$enable_rpath" != no; then
1229 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1230 dnl Use an explicit option to hardcode directories into the resulting
1235 if test -n "$next"; then
1237 dnl No need to hardcode the standard /usr/lib.
1238 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1239 rpathdirs="$rpathdirs $dir"
1245 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1246 dnl No need to hardcode the standard /usr/lib.
1247 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1248 rpathdirs="$rpathdirs $dir"
1255 if test "X$rpathdirs" != "X"; then
1256 if test -n ""$3""; then
1257 dnl libtool is used for linking. Use -R options.
1258 for dir in $rpathdirs; do
1259 $1="${$1}${$1:+ }-R$dir"
1262 dnl The linker is used for linking directly.
1263 if test -n "$hardcode_libdir_separator"; then
1264 dnl Weird platform: only the last -rpath option counts, the user
1265 dnl must pass all path elements in one option.
1267 for dir in $rpathdirs; do
1268 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
1270 acl_save_libdir="$libdir"
1272 eval flag=\"$hardcode_libdir_flag_spec\"
1273 libdir="$acl_save_libdir"
1276 dnl The -rpath options are cumulative.
1277 for dir in $rpathdirs; do
1278 acl_save_libdir="$libdir"
1280 eval flag=\"$hardcode_libdir_flag_spec\"
1281 libdir="$acl_save_libdir"
1282 $1="${$1}${$1:+ }$flag"
1292 # lib-prefix.m4 serial 5 (gettext-0.15)
1293 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1294 dnl This file is free software; the Free Software Foundation
1295 dnl gives unlimited permission to copy and/or distribute it,
1296 dnl with or without modifications, as long as this notice is preserved.
1298 dnl From Bruno Haible.
1300 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1301 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1302 dnl require excessive bracketing.
1303 ifdef([AC_HELP_STRING],
1304 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1305 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1307 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1308 dnl to access previously installed libraries. The basic assumption is that
1309 dnl a user will want packages to use other packages he previously installed
1310 dnl with the same --prefix option.
1311 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1312 dnl libraries, but is otherwise very convenient.
1313 AC_DEFUN([AC_LIB_PREFIX],
1315 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1316 AC_REQUIRE([AC_PROG_CC])
1317 AC_REQUIRE([AC_CANONICAL_HOST])
1318 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1319 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1320 dnl By default, look in $includedir and $libdir.
1322 AC_LIB_WITH_FINAL_PREFIX([
1323 eval additional_includedir=\"$includedir\"
1324 eval additional_libdir=\"$libdir\"
1326 AC_LIB_ARG_WITH([lib-prefix],
1327 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1328 --without-lib-prefix don't search for libraries in includedir and libdir],
1330 if test "X$withval" = "Xno"; then
1333 if test "X$withval" = "X"; then
1334 AC_LIB_WITH_FINAL_PREFIX([
1335 eval additional_includedir=\"$includedir\"
1336 eval additional_libdir=\"$libdir\"
1339 additional_includedir="$withval/include"
1340 additional_libdir="$withval/$acl_libdirstem"
1344 if test $use_additional = yes; then
1345 dnl Potentially add $additional_includedir to $CPPFLAGS.
1346 dnl But don't add it
1347 dnl 1. if it's the standard /usr/include,
1348 dnl 2. if it's already present in $CPPFLAGS,
1349 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1350 dnl 4. if it doesn't exist as a directory.
1351 if test "X$additional_includedir" != "X/usr/include"; then
1353 for x in $CPPFLAGS; do
1354 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1355 if test "X$x" = "X-I$additional_includedir"; then
1360 if test -z "$haveit"; then
1361 if test "X$additional_includedir" = "X/usr/local/include"; then
1362 if test -n "$GCC"; then
1364 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1368 if test -z "$haveit"; then
1369 if test -d "$additional_includedir"; then
1370 dnl Really add $additional_includedir to $CPPFLAGS.
1371 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1376 dnl Potentially add $additional_libdir to $LDFLAGS.
1377 dnl But don't add it
1378 dnl 1. if it's the standard /usr/lib,
1379 dnl 2. if it's already present in $LDFLAGS,
1380 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1381 dnl 4. if it doesn't exist as a directory.
1382 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1384 for x in $LDFLAGS; do
1385 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1386 if test "X$x" = "X-L$additional_libdir"; then
1391 if test -z "$haveit"; then
1392 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1393 if test -n "$GCC"; then
1395 linux*) haveit=yes;;
1399 if test -z "$haveit"; then
1400 if test -d "$additional_libdir"; then
1401 dnl Really add $additional_libdir to $LDFLAGS.
1402 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1410 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1411 dnl acl_final_exec_prefix, containing the values to which $prefix and
1412 dnl $exec_prefix will expand at the end of the configure script.
1413 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1415 dnl Unfortunately, prefix and exec_prefix get only finally determined
1416 dnl at the end of configure.
1417 if test "X$prefix" = "XNONE"; then
1418 acl_final_prefix="$ac_default_prefix"
1420 acl_final_prefix="$prefix"
1422 if test "X$exec_prefix" = "XNONE"; then
1423 acl_final_exec_prefix='${prefix}'
1425 acl_final_exec_prefix="$exec_prefix"
1427 acl_save_prefix="$prefix"
1428 prefix="$acl_final_prefix"
1429 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1430 prefix="$acl_save_prefix"
1433 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1434 dnl variables prefix and exec_prefix bound to the values they will have
1435 dnl at the end of the configure script.
1436 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1438 acl_save_prefix="$prefix"
1439 prefix="$acl_final_prefix"
1440 acl_save_exec_prefix="$exec_prefix"
1441 exec_prefix="$acl_final_exec_prefix"
1443 exec_prefix="$acl_save_exec_prefix"
1444 prefix="$acl_save_prefix"
1447 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
1448 dnl the basename of the libdir, either "lib" or "lib64".
1449 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1451 dnl There is no formal standard regarding lib and lib64. The current
1452 dnl practice is that on a system supporting 32-bit and 64-bit instruction
1453 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
1454 dnl libraries go under $prefix/lib. We determine the compiler's default
1455 dnl mode by looking at the compiler's library search path. If at least
1456 dnl of its elements ends in /lib64 or points to a directory whose absolute
1457 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
1458 dnl default, namely "lib".
1460 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1461 if test -n "$searchpath"; then
1462 acl_save_IFS="${IFS= }"; IFS=":"
1463 for searchdir in $searchpath; do
1464 if test -d "$searchdir"; then
1465 case "$searchdir" in
1466 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1467 *) searchdir=`cd "$searchdir" && pwd`
1468 case "$searchdir" in
1469 */lib64 ) acl_libdirstem=lib64 ;;
1478 # nls.m4 serial 3 (gettext-0.15)
1479 dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
1480 dnl This file is free software; the Free Software Foundation
1481 dnl gives unlimited permission to copy and/or distribute it,
1482 dnl with or without modifications, as long as this notice is preserved.
1484 dnl This file can can be used in projects which are not available under
1485 dnl the GNU General Public License or the GNU Library General Public
1486 dnl License but which still want to provide support for the GNU gettext
1488 dnl Please note that the actual code of the GNU gettext library is covered
1489 dnl by the GNU Library General Public License, and the rest of the GNU
1490 dnl gettext package package is covered by the GNU General Public License.
1491 dnl They are *not* in the public domain.
1494 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1495 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1501 AC_MSG_CHECKING([whether NLS is requested])
1502 dnl Default is enabled NLS
1504 [ --disable-nls do not use Native Language Support],
1505 USE_NLS=$enableval, USE_NLS=yes)
1506 AC_MSG_RESULT($USE_NLS)
1510 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1512 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1514 # This program is free software; you can redistribute it and/or modify
1515 # it under the terms of the GNU General Public License as published by
1516 # the Free Software Foundation; either version 2 of the License, or
1517 # (at your option) any later version.
1519 # This program is distributed in the hope that it will be useful, but
1520 # WITHOUT ANY WARRANTY; without even the implied warranty of
1521 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1522 # General Public License for more details.
1524 # You should have received a copy of the GNU General Public License
1525 # along with this program; if not, write to the Free Software
1526 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1528 # As a special exception to the GNU General Public License, if you
1529 # distribute this file as part of a program that contains a
1530 # configuration script generated by Autoconf, you may include it under
1531 # the same distribution terms that you use for the rest of that program.
1533 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1534 # ----------------------------------
1535 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1536 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1537 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1538 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1539 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1540 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1542 if test -n "$PKG_CONFIG"; then
1543 _pkg_min_version=m4_default([$1], [0.9.0])
1544 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1545 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1546 AC_MSG_RESULT([yes])
1553 ])# PKG_PROG_PKG_CONFIG
1555 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1557 # Check to see whether a particular set of modules exists. Similar
1558 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1561 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
1562 # this or PKG_CHECK_MODULES is called, or make sure to call
1563 # PKG_CHECK_EXISTS manually
1564 # --------------------------------------------------------------
1565 AC_DEFUN([PKG_CHECK_EXISTS],
1566 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1567 if test -n "$PKG_CONFIG" && \
1568 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1569 m4_ifval([$2], [$2], [:])
1570 m4_ifvaln([$3], [else
1575 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1576 # ---------------------------------------------
1577 m4_define([_PKG_CONFIG],
1578 [if test -n "$PKG_CONFIG"; then
1579 if test -n "$$1"; then
1582 PKG_CHECK_EXISTS([$3],
1583 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1591 # _PKG_SHORT_ERRORS_SUPPORTED
1592 # -----------------------------
1593 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1594 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1595 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1596 _pkg_short_errors_supported=yes
1598 _pkg_short_errors_supported=no
1600 ])# _PKG_SHORT_ERRORS_SUPPORTED
1603 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1604 # [ACTION-IF-NOT-FOUND])
1607 # Note that if there is a possibility the first call to
1608 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1609 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1612 # --------------------------------------------------------------
1613 AC_DEFUN([PKG_CHECK_MODULES],
1614 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1615 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1616 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1619 AC_MSG_CHECKING([for $1])
1621 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1622 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1624 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1625 and $1[]_LIBS to avoid the need to call pkg-config.
1626 See the pkg-config man page for more details.])
1628 if test $pkg_failed = yes; then
1629 _PKG_SHORT_ERRORS_SUPPORTED
1630 if test $_pkg_short_errors_supported = yes; then
1631 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
1633 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1635 # Put the nasty error message in config.log where it belongs
1636 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1638 ifelse([$4], , [AC_MSG_ERROR(dnl
1639 [Package requirements ($2) were not met:
1643 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1644 installed software in a non-standard prefix.
1648 [AC_MSG_RESULT([no])
1650 elif test $pkg_failed = untried; then
1651 ifelse([$4], , [AC_MSG_FAILURE(dnl
1652 [The pkg-config script could not be found or is too old. Make sure it
1653 is in your PATH or set the PKG_CONFIG environment variable to the full
1658 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1661 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1662 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1663 AC_MSG_RESULT([yes])
1664 ifelse([$3], , :, [$3])
1666 ])# PKG_CHECK_MODULES
1668 # po.m4 serial 13 (gettext-0.15)
1669 dnl Copyright (C) 1995-2006 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 Perform the following tests also if --disable-nls has been given,
1698 dnl because they are needed for "make dist" to work.
1700 dnl Search for GNU msgfmt in the PATH.
1701 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1702 dnl The second test excludes FreeBSD msgfmt.
1703 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1704 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1705 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1707 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1709 dnl Test whether it is GNU msgfmt >= 0.15.
1711 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1712 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
1713 *) MSGFMT_015=$MSGFMT ;;
1716 AC_SUBST([MSGFMT_015])
1718 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1719 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
1720 *) GMSGFMT_015=$GMSGFMT ;;
1723 AC_SUBST([GMSGFMT_015])
1725 dnl Search for GNU xgettext 0.12 or newer in the PATH.
1726 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1727 dnl The second test excludes FreeBSD xgettext.
1728 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1729 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1730 (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)],
1732 dnl Remove leftover from FreeBSD xgettext call.
1735 dnl Test whether it is GNU xgettext >= 0.15.
1737 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1738 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
1739 *) XGETTEXT_015=$XGETTEXT ;;
1742 AC_SUBST([XGETTEXT_015])
1744 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1745 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1746 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
1748 dnl Installation directories.
1749 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
1750 dnl have to define it here, so that it can be used in po/Makefile.
1751 test -n "$localedir" || localedir='${datadir}/locale'
1752 AC_SUBST([localedir])
1754 AC_CONFIG_COMMANDS([po-directories], [[
1755 for ac_file in $CONFIG_FILES; do
1756 # Support "outfile[:infile[:infile...]]"
1758 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1760 # PO directories have a Makefile.in generated from Makefile.in.in.
1761 case "$ac_file" in */Makefile.in)
1762 # Adjust a relative srcdir.
1763 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1764 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1765 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1766 # In autoconf-2.13 it is called $ac_given_srcdir.
1767 # In autoconf-2.50 it is called $srcdir.
1768 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1769 case "$ac_given_srcdir" in
1770 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1771 /*) top_srcdir="$ac_given_srcdir" ;;
1772 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1774 # Treat a directory as a PO directory if and only if it has a
1775 # POTFILES.in file. This allows packages to have multiple PO
1776 # directories under different names or in different locations.
1777 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1778 rm -f "$ac_dir/POTFILES"
1779 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1780 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1781 POMAKEFILEDEPS="POTFILES.in"
1782 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1783 # on $ac_dir but don't depend on user-specified configuration
1785 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1786 # The LINGUAS file contains the set of available languages.
1787 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1788 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1790 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1791 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1792 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1793 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1795 # The set of available languages was given in configure.in.
1796 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1797 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1800 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1801 # Compute UPDATEPOFILES
1802 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1803 # Compute DUMMYPOFILES
1804 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1806 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1807 case "$ac_given_srcdir" in
1809 *) srcdirpre='$(srcdir)/' ;;
1815 for lang in $ALL_LINGUAS; do
1816 POFILES="$POFILES $srcdirpre$lang.po"
1817 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1818 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1819 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1821 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1822 # environment variable.
1824 if test -n "$ALL_LINGUAS"; then
1825 for presentlang in $ALL_LINGUAS; do
1827 if test "%UNSET%" != "$LINGUAS"; then
1828 desiredlanguages="$LINGUAS"
1830 desiredlanguages="$ALL_LINGUAS"
1832 for desiredlang in $desiredlanguages; do
1833 # Use the presentlang catalog if desiredlang is
1834 # a. equal to presentlang, or
1835 # b. a variant of presentlang (because in this case,
1836 # presentlang can be used as a fallback for messages
1837 # which are not translated in the desiredlang catalog).
1838 case "$desiredlang" in
1839 "$presentlang"*) useit=yes;;
1842 if test $useit = yes; then
1843 INST_LINGUAS="$INST_LINGUAS $presentlang"
1848 if test -n "$INST_LINGUAS"; then
1849 for lang in $INST_LINGUAS; do
1850 CATALOGS="$CATALOGS $lang.gmo"
1853 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1854 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"
1855 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1856 if test -f "$f"; then
1858 *.orig | *.bak | *~) ;;
1859 *) cat "$f" >> "$ac_dir/Makefile" ;;
1867 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1868 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
1869 # from automake < 1.5.
1870 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1871 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1872 LINGUAS="${LINGUAS-%UNSET%}"
1876 dnl Postprocesses a Makefile in a directory containing PO files.
1877 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
1879 # When this code is run, in config.status, two variables have already been
1881 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
1882 # - LINGUAS is the value of the environment variable LINGUAS at configure
1886 # Adjust a relative srcdir.
1887 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1888 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1889 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1890 # In autoconf-2.13 it is called $ac_given_srcdir.
1891 # In autoconf-2.50 it is called $srcdir.
1892 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1893 case "$ac_given_srcdir" in
1894 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1895 /*) top_srcdir="$ac_given_srcdir" ;;
1896 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1899 # Find a way to echo strings without interpreting backslash.
1900 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
1903 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
1904 gt_echo='printf %s\n'
1915 # A sed script that extracts the value of VARIABLE from a Makefile.
1917 # Test if the hold space is empty.
1922 # Yes it was empty. Look if we have the expected variable definition.
1923 /^[ ]*VARIABLE[ ]*=/{
1924 # Seen the first line of the variable definition.
1925 s/^[ ]*VARIABLE[ ]*=//
1930 # Here we are processing a line from the variable definition.
1931 # Remove comment, more precisely replace it with a space.
1933 # See if the line ends in a backslash.
1937 # Print the line, without the trailing backslash.
1940 # There was no trailing backslash. The end of the variable definition is
1941 # reached. Clear the hold space.
1946 # A trailing backslash means that the variable definition continues in the
1947 # next line. Put a nonempty string into the hold space to indicate this.
1954 # Set POTFILES to the value of the Makefile variable POTFILES.
1955 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
1956 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
1957 # Compute POTFILES_DEPS as
1958 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
1960 for file in $POTFILES; do
1961 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
1965 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1966 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1968 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1969 # The LINGUAS file contains the set of available languages.
1970 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1971 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1973 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
1974 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
1975 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
1977 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1978 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1980 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1981 # Compute UPDATEPOFILES
1982 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1983 # Compute DUMMYPOFILES
1984 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1986 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1987 # Compute PROPERTIESFILES
1988 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
1989 # Compute CLASSFILES
1990 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
1992 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
1994 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
1995 # Compute RESOURCESDLLFILES
1996 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
1997 case "$ac_given_srcdir" in
1999 *) srcdirpre='$(srcdir)/' ;;
2010 for lang in $ALL_LINGUAS; do
2011 POFILES="$POFILES $srcdirpre$lang.po"
2012 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2013 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2014 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2015 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2016 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2017 QMFILES="$QMFILES $srcdirpre$lang.qm"
2018 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2019 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2020 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/'`
2021 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2023 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2024 # environment variable.
2026 if test -n "$ALL_LINGUAS"; then
2027 for presentlang in $ALL_LINGUAS; do
2029 if test "%UNSET%" != "$LINGUAS"; then
2030 desiredlanguages="$LINGUAS"
2032 desiredlanguages="$ALL_LINGUAS"
2034 for desiredlang in $desiredlanguages; do
2035 # Use the presentlang catalog if desiredlang is
2036 # a. equal to presentlang, or
2037 # b. a variant of presentlang (because in this case,
2038 # presentlang can be used as a fallback for messages
2039 # which are not translated in the desiredlang catalog).
2040 case "$desiredlang" in
2041 "$presentlang"*) useit=yes;;
2044 if test $useit = yes; then
2045 INST_LINGUAS="$INST_LINGUAS $presentlang"
2054 if test -n "$INST_LINGUAS"; then
2055 for lang in $INST_LINGUAS; do
2056 CATALOGS="$CATALOGS $lang.gmo"
2057 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2058 QTCATALOGS="$QTCATALOGS $lang.qm"
2059 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2060 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2061 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/'`
2062 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2066 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"
2067 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2068 # Add dependencies that cannot be formulated as a simple suffix rule.
2069 for lang in $ALL_LINGUAS; do
2070 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2071 cat >> "$ac_file.tmp" <<EOF
2072 $frobbedlang.msg: $lang.po
2073 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2074 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2078 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2079 # Add dependencies that cannot be formulated as a simple suffix rule.
2080 for lang in $ALL_LINGUAS; do
2081 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/'`
2082 cat >> "$ac_file.tmp" <<EOF
2083 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2084 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2085 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2089 if test -n "$POMAKEFILEDEPS"; then
2090 cat >> "$ac_file.tmp" <<EOF
2091 Makefile: $POMAKEFILEDEPS
2094 mv "$ac_file.tmp" "$ac_file"
2097 # progtest.m4 serial 4 (gettext-0.14.2)
2098 dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
2099 dnl This file is free software; the Free Software Foundation
2100 dnl gives unlimited permission to copy and/or distribute it,
2101 dnl with or without modifications, as long as this notice is preserved.
2103 dnl This file can can be used in projects which are not available under
2104 dnl the GNU General Public License or the GNU Library General Public
2105 dnl License but which still want to provide support for the GNU gettext
2107 dnl Please note that the actual code of the GNU gettext library is covered
2108 dnl by the GNU Library General Public License, and the rest of the GNU
2109 dnl gettext package package is covered by the GNU General Public License.
2110 dnl They are *not* in the public domain.
2113 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2117 # Search path for a program which passes the given test.
2119 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2120 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2121 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2123 # Prepare PATH_SEPARATOR.
2124 # The user is always right.
2125 if test "${PATH_SEPARATOR+set}" != set; then
2126 echo "#! /bin/sh" >conf$$.sh
2127 echo "exit 0" >>conf$$.sh
2129 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2137 # Find out how to test for executable files. Don't use a zero-byte file,
2138 # as systems may use methods other than mode bits to determine executability.
2139 cat >conf$$.file <<_ASEOF
2143 chmod +x conf$$.file
2144 if test -x conf$$.file >/dev/null 2>&1; then
2145 ac_executable_p="test -x"
2147 ac_executable_p="test -f"
2151 # Extract the first word of "$2", so it can be a program name with args.
2152 set dummy $2; ac_word=[$]2
2153 AC_MSG_CHECKING([for $ac_word])
2154 AC_CACHE_VAL(ac_cv_path_$1,
2156 [[\\/]]* | ?:[[\\/]]*)
2157 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2160 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2161 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2163 test -z "$ac_dir" && ac_dir=.
2164 for ac_exec_ext in '' $ac_executable_extensions; do
2165 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2166 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2168 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2175 dnl If no 4th arg is given, leave the cache variable unset,
2176 dnl so AC_PATH_PROGS will keep looking.
2177 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2182 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2183 AC_MSG_RESULT([$]$1)
2190 # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
2192 # This file is free software; the Free Software Foundation
2193 # gives unlimited permission to copy and/or distribute it,
2194 # with or without modifications, as long as this notice is preserved.
2196 # AM_AUTOMAKE_VERSION(VERSION)
2197 # ----------------------------
2198 # Automake X.Y traces this macro to ensure aclocal.m4 has been
2199 # generated from the m4 files accompanying Automake X.Y.
2200 AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
2202 # AM_SET_CURRENT_AUTOMAKE_VERSION
2203 # -------------------------------
2204 # Call AM_AUTOMAKE_VERSION so it can be traced.
2205 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
2206 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2207 [AM_AUTOMAKE_VERSION([1.9.6])])
2209 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
2211 # Copyright (C) 2001, 2003, 2005 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.
2217 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2218 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
2219 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
2221 # Of course, Automake must honor this variable whenever it calls a
2222 # tool from the auxiliary directory. The problem is that $srcdir (and
2223 # therefore $ac_aux_dir as well) can be either absolute or relative,
2224 # depending on how configure is run. This is pretty annoying, since
2225 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
2226 # source directory, any form will work fine, but in subdirectories a
2227 # relative path needs to be adjusted first.
2229 # $ac_aux_dir/missing
2230 # fails when called from a subdirectory if $ac_aux_dir is relative
2231 # $top_srcdir/$ac_aux_dir/missing
2232 # fails if $ac_aux_dir is absolute,
2233 # fails when called from a subdirectory in a VPATH build with
2234 # a relative $ac_aux_dir
2236 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2237 # are both prefixed by $srcdir. In an in-source build this is usually
2238 # harmless because $srcdir is `.', but things will broke when you
2239 # start a VPATH build or use an absolute $srcdir.
2241 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2242 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
2243 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2244 # and then we would define $MISSING as
2245 # MISSING="\${SHELL} $am_aux_dir/missing"
2246 # This will work as long as MISSING is not called from configure, because
2247 # unfortunately $(top_srcdir) has no meaning in configure.
2248 # However there are other variables, like CC, which are often used in
2249 # configure, and could therefore not use this "fixed" $ac_aux_dir.
2251 # Another solution, used here, is to always expand $ac_aux_dir to an
2252 # absolute PATH. The drawback is that using absolute paths prevent a
2253 # configured tree to be moved without reconfiguration.
2255 AC_DEFUN([AM_AUX_DIR_EXPAND],
2256 [dnl Rely on autoconf to set up CDPATH properly.
2257 AC_PREREQ([2.50])dnl
2258 # expand $ac_aux_dir to an absolute path
2259 am_aux_dir=`cd $ac_aux_dir && pwd`
2262 # AM_CONDITIONAL -*- Autoconf -*-
2264 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
2265 # Free Software Foundation, Inc.
2267 # This file is free software; the Free Software Foundation
2268 # gives unlimited permission to copy and/or distribute it,
2269 # with or without modifications, as long as this notice is preserved.
2273 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
2274 # -------------------------------------
2275 # Define a conditional.
2276 AC_DEFUN([AM_CONDITIONAL],
2278 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
2279 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2281 AC_SUBST([$1_FALSE])
2289 AC_CONFIG_COMMANDS_PRE(
2290 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
2291 AC_MSG_ERROR([[conditional "$1" was never defined.
2292 Usually this means the macro was only invoked conditionally.]])
2296 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
2297 # Free Software Foundation, Inc.
2299 # This file is free software; the Free Software Foundation
2300 # gives unlimited permission to copy and/or distribute it,
2301 # with or without modifications, as long as this notice is preserved.
2305 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
2306 # written in clear, in which case automake, when reading aclocal.m4,
2307 # will think it sees a *use*, and therefore will trigger all it's
2308 # C support machinery. Also note that it means that autoscan, seeing
2309 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2312 # _AM_DEPENDENCIES(NAME)
2313 # ----------------------
2314 # See how the compiler implements dependency checking.
2315 # NAME is "CC", "CXX", "GCJ", or "OBJC".
2316 # We try a few techniques and use that to set a single cache variable.
2318 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2319 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2320 # dependency, and given that the user is not expected to run this macro,
2321 # just rely on AC_PROG_CC.
2322 AC_DEFUN([_AM_DEPENDENCIES],
2323 [AC_REQUIRE([AM_SET_DEPDIR])dnl
2324 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2325 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2326 AC_REQUIRE([AM_DEP_TRACK])dnl
2328 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
2329 [$1], CXX, [depcc="$CXX" am_compiler_list=],
2330 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2331 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
2332 [depcc="$$1" am_compiler_list=])
2334 AC_CACHE_CHECK([dependency style of $depcc],
2335 [am_cv_$1_dependencies_compiler_type],
2336 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2337 # We make a subdir and do the tests there. Otherwise we can end up
2338 # making bogus files that we don't know about and never remove. For
2339 # instance it was reported that on HP-UX the gcc test will end up
2340 # making a dummy file named `D' -- because `-MD' means `put the output
2343 # Copy depcomp to subdir because otherwise we won't find it if we're
2344 # using a relative directory.
2345 cp "$am_depcomp" conftest.dir
2347 # We will build objects and dependencies in a subdirectory because
2348 # it helps to detect inapplicable dependency modes. For instance
2349 # both Tru64's cc and ICC support -MD to output dependencies as a
2350 # side effect of compilation, but ICC will put the dependencies in
2351 # the current directory while Tru64 will put them in the object
2355 am_cv_$1_dependencies_compiler_type=none
2356 if test "$am_compiler_list" = ""; then
2357 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2359 for depmode in $am_compiler_list; do
2360 # Setup a source with many dependencies, because some compilers
2361 # like to wrap large dependency lists on column 80 (with \), and
2362 # we should not choose a depcomp mode which is confused by this.
2364 # We need to recreate these files for each test, as the compiler may
2365 # overwrite some of them when testing with obscure command lines.
2366 # This happens at least with the AIX C compiler.
2368 for i in 1 2 3 4 5 6; do
2369 echo '#include "conftst'$i'.h"' >> sub/conftest.c
2370 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2371 # Solaris 8's {/usr,}/bin/sh.
2372 touch sub/conftst$i.h
2374 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2378 # after this tag, mechanisms are not by side-effect, so they'll
2379 # only be used when explicitly requested
2380 if test "x$enable_dependency_tracking" = xyes; then
2388 # We check with `-c' and `-o' for the sake of the "dashmstdout"
2389 # mode. It turns out that the SunPro C++ compiler does not properly
2390 # handle `-M -o', and we need to detect this.
2391 if depmode=$depmode \
2392 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2393 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2394 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2395 >/dev/null 2>conftest.err &&
2396 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2397 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2398 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2399 # icc doesn't choke on unknown options, it will just issue warnings
2400 # or remarks (even with -Werror). So we grep stderr for any message
2401 # that says an option was ignored or not supported.
2402 # When given -MP, icc 7.0 and 7.1 complain thusly:
2403 # icc: Command line warning: ignoring option '-M'; no argument required
2404 # The diagnosis changed in icc 8.0:
2405 # icc: Command line remark: option '-MP' not supported
2406 if (grep 'ignoring option' conftest.err ||
2407 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2408 am_cv_$1_dependencies_compiler_type=$depmode
2417 am_cv_$1_dependencies_compiler_type=none
2420 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2421 AM_CONDITIONAL([am__fastdep$1], [
2422 test "x$enable_dependency_tracking" != xno \
2423 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2429 # Choose a directory name for dependency files.
2430 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
2431 AC_DEFUN([AM_SET_DEPDIR],
2432 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2433 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2439 AC_DEFUN([AM_DEP_TRACK],
2440 [AC_ARG_ENABLE(dependency-tracking,
2441 [ --disable-dependency-tracking speeds up one-time build
2442 --enable-dependency-tracking do not reject slow dependency extractors])
2443 if test "x$enable_dependency_tracking" != xno; then
2444 am_depcomp="$ac_aux_dir/depcomp"
2447 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2448 AC_SUBST([AMDEPBACKSLASH])
2451 # Generate code to set up dependency tracking. -*- Autoconf -*-
2453 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
2454 # Free Software Foundation, Inc.
2456 # This file is free software; the Free Software Foundation
2457 # gives unlimited permission to copy and/or distribute it,
2458 # with or without modifications, as long as this notice is preserved.
2462 # _AM_OUTPUT_DEPENDENCY_COMMANDS
2463 # ------------------------------
2464 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2465 [for mf in $CONFIG_FILES; do
2466 # Strip MF so we end up with the name of the file.
2467 mf=`echo "$mf" | sed -e 's/:.*$//'`
2468 # Check whether this is an Automake generated Makefile or not.
2469 # We used to match only the files named `Makefile.in', but
2470 # some people rename them; so instead we look at the file content.
2471 # Grep'ing the first line is not enough: some people post-process
2472 # each Makefile.in and add a new line on top of each file to say so.
2473 # So let's grep whole file.
2474 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
2475 dirpart=`AS_DIRNAME("$mf")`
2479 # Extract the definition of DEPDIR, am__include, and am__quote
2480 # from the Makefile without running `make'.
2481 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2482 test -z "$DEPDIR" && continue
2483 am__include=`sed -n 's/^am__include = //p' < "$mf"`
2484 test -z "am__include" && continue
2485 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2486 # When using ansi2knr, U may be empty or an underscore; expand it
2487 U=`sed -n 's/^U = //p' < "$mf"`
2488 # Find all dependency output files, they are included files with
2489 # $(DEPDIR) in their names. We invoke sed twice because it is the
2490 # simplest approach to changing $(DEPDIR) to its actual value in the
2492 for file in `sed -n "
2493 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2494 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2495 # Make sure the directory exists.
2496 test -f "$dirpart/$file" && continue
2497 fdir=`AS_DIRNAME(["$file"])`
2498 AS_MKDIR_P([$dirpart/$fdir])
2499 # echo "creating $dirpart/$file"
2500 echo '# dummy' > "$dirpart/$file"
2503 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2506 # AM_OUTPUT_DEPENDENCY_COMMANDS
2507 # -----------------------------
2508 # This macro should only be invoked once -- use via AC_REQUIRE.
2510 # This code is only required when automatic dependency tracking
2511 # is enabled. FIXME. This creates each `.P' file that we will
2512 # need in order to bootstrap the dependency handling code.
2513 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2514 [AC_CONFIG_COMMANDS([depfiles],
2515 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2516 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2519 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
2520 # Free Software Foundation, Inc.
2522 # This file is free software; the Free Software Foundation
2523 # gives unlimited permission to copy and/or distribute it,
2524 # with or without modifications, as long as this notice is preserved.
2528 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
2529 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
2531 # Do all the work for Automake. -*- Autoconf -*-
2533 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
2534 # Free Software Foundation, Inc.
2536 # This file is free software; the Free Software Foundation
2537 # gives unlimited permission to copy and/or distribute it,
2538 # with or without modifications, as long as this notice is preserved.
2542 # This macro actually does too much. Some checks are only needed if
2543 # your package does certain things. But this isn't really a big deal.
2545 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2546 # AM_INIT_AUTOMAKE([OPTIONS])
2547 # -----------------------------------------------
2548 # The call with PACKAGE and VERSION arguments is the old style
2549 # call (pre autoconf-2.50), which is being phased out. PACKAGE
2550 # and VERSION should now be passed to AC_INIT and removed from
2551 # the call to AM_INIT_AUTOMAKE.
2552 # We support both call styles for the transition. After
2553 # the next Automake release, Autoconf can make the AC_INIT
2554 # arguments mandatory, and then we can depend on a new Autoconf
2555 # release and drop the old call support.
2556 AC_DEFUN([AM_INIT_AUTOMAKE],
2557 [AC_PREREQ([2.58])dnl
2558 dnl Autoconf wants to disallow AM_ names. We explicitly allow
2559 dnl the ones we care about.
2560 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2561 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2562 AC_REQUIRE([AC_PROG_INSTALL])dnl
2563 # test to see if srcdir already configured
2564 if test "`cd $srcdir && pwd`" != "`pwd`" &&
2565 test -f $srcdir/config.status; then
2566 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2569 # test whether we have cygpath
2570 if test -z "$CYGPATH_W"; then
2571 if (cygpath --version) >/dev/null 2>/dev/null; then
2572 CYGPATH_W='cygpath -w'
2577 AC_SUBST([CYGPATH_W])
2579 # Define the identity of the package.
2580 dnl Distinguish between old-style and new-style calls.
2582 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2583 AC_SUBST([PACKAGE], [$1])dnl
2584 AC_SUBST([VERSION], [$2])],
2585 [_AM_SET_OPTIONS([$1])dnl
2586 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2587 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2589 _AM_IF_OPTION([no-define],,
2590 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2591 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
2593 # Some tools Automake needs.
2594 AC_REQUIRE([AM_SANITY_CHECK])dnl
2595 AC_REQUIRE([AC_ARG_PROGRAM])dnl
2596 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
2597 AM_MISSING_PROG(AUTOCONF, autoconf)
2598 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
2599 AM_MISSING_PROG(AUTOHEADER, autoheader)
2600 AM_MISSING_PROG(MAKEINFO, makeinfo)
2602 AM_PROG_INSTALL_STRIP
2603 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
2604 # We need awk for the "check" target. The system "awk" is bad on
2606 AC_REQUIRE([AC_PROG_AWK])dnl
2607 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2608 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2609 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2610 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2611 [_AM_PROG_TAR([v7])])])
2612 _AM_IF_OPTION([no-dependencies],,
2613 [AC_PROVIDE_IFELSE([AC_PROG_CC],
2614 [_AM_DEPENDENCIES(CC)],
2615 [define([AC_PROG_CC],
2616 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
2617 AC_PROVIDE_IFELSE([AC_PROG_CXX],
2618 [_AM_DEPENDENCIES(CXX)],
2619 [define([AC_PROG_CXX],
2620 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
2625 # When config.status generates a header, we must update the stamp-h file.
2626 # This file resides in the same directory as the config header
2627 # that is generated. The stamp files are numbered to have different names.
2629 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2630 # loop where config.status creates the headers, so we can generate
2631 # our stamp files there.
2632 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2633 [# Compute $1's index in $config_headers.
2635 for _am_header in $config_headers :; do
2640 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2643 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
2645 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
2647 # This file is free software; the Free Software Foundation
2648 # gives unlimited permission to copy and/or distribute it,
2649 # with or without modifications, as long as this notice is preserved.
2651 # AM_PROG_INSTALL_SH
2652 # ------------------
2653 # Define $install_sh.
2654 AC_DEFUN([AM_PROG_INSTALL_SH],
2655 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2656 install_sh=${install_sh-"$am_aux_dir/install-sh"}
2657 AC_SUBST(install_sh)])
2659 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
2661 # This file is free software; the Free Software Foundation
2662 # gives unlimited permission to copy and/or distribute it,
2663 # with or without modifications, as long as this notice is preserved.
2667 # Check whether the underlying file-system supports filenames
2668 # with a leading dot. For instance MS-DOS doesn't.
2669 AC_DEFUN([AM_SET_LEADING_DOT],
2670 [rm -rf .tst 2>/dev/null
2671 mkdir .tst 2>/dev/null
2672 if test -d .tst; then
2677 rmdir .tst 2>/dev/null
2678 AC_SUBST([am__leading_dot])])
2680 # Check to see how 'make' treats includes. -*- Autoconf -*-
2682 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
2684 # This file is free software; the Free Software Foundation
2685 # gives unlimited permission to copy and/or distribute it,
2686 # with or without modifications, as long as this notice is preserved.
2692 # Check to see how make treats includes.
2693 AC_DEFUN([AM_MAKE_INCLUDE],
2694 [am_make=${MAKE-make}
2695 cat > confinc << 'END'
2700 # If we don't find an include directive, just comment out the code.
2701 AC_MSG_CHECKING([for style of include used by $am_make])
2705 # First try GNU make style include.
2706 echo "include confinc" > confmf
2707 # We grep out `Entering directory' and `Leaving directory'
2708 # messages which can occur if `w' ends up in MAKEFLAGS.
2709 # In particular we don't look at `^make:' because GNU make might
2710 # be invoked under some other name (usually "gmake"), in which
2711 # case it prints its new name instead of `make'.
2712 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
2717 # Now try BSD make style include.
2718 if test "$am__include" = "#"; then
2719 echo '.include "confinc"' > confmf
2720 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
2721 am__include=.include
2726 AC_SUBST([am__include])
2727 AC_SUBST([am__quote])
2728 AC_MSG_RESULT([$_am_result])
2729 rm -f confinc confmf
2732 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
2734 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
2735 # Free Software Foundation, Inc.
2737 # This file is free software; the Free Software Foundation
2738 # gives unlimited permission to copy and/or distribute it,
2739 # with or without modifications, as long as this notice is preserved.
2743 # AM_MISSING_PROG(NAME, PROGRAM)
2744 # ------------------------------
2745 AC_DEFUN([AM_MISSING_PROG],
2746 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2747 $1=${$1-"${am_missing_run}$2"}
2751 # AM_MISSING_HAS_RUN
2752 # ------------------
2753 # Define MISSING if not defined so far and test if it supports --run.
2754 # If it does, set am_missing_run to use it, otherwise, to nothing.
2755 AC_DEFUN([AM_MISSING_HAS_RUN],
2756 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2757 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
2758 # Use eval to expand $SHELL
2759 if eval "$MISSING --run true"; then
2760 am_missing_run="$MISSING --run "
2763 AC_MSG_WARN([`missing' script is too old or missing])
2767 # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
2769 # This file is free software; the Free Software Foundation
2770 # gives unlimited permission to copy and/or distribute it,
2771 # with or without modifications, as long as this notice is preserved.
2775 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
2777 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
2778 # created by `make install' are always world readable, even if the
2779 # installer happens to have an overly restrictive umask (e.g. 077).
2780 # This was a mistake. There are at least two reasons why we must not
2782 # - it causes special bits like SGID to be ignored,
2783 # - it may be too restrictive (some setups expect 775 directories).
2785 # Do not use -m 0755 and let people choose whatever they expect by
2788 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
2789 # Some implementations (such as Solaris 8's) are not thread-safe: if a
2790 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
2791 # concurrently, both version can detect that a/ is missing, but only
2792 # one can create it and the other will error out. Consequently we
2793 # restrict ourselves to GNU make (using the --version option ensures
2795 AC_DEFUN([AM_PROG_MKDIR_P],
2796 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
2797 # We used to keeping the `.' as first argument, in order to
2798 # allow $(mkdir_p) to be used without argument. As in
2799 # $(mkdir_p) $(somedir)
2800 # where $(somedir) is conditionally defined. However this is wrong
2802 # 1. if the package is installed by a user who cannot write `.'
2803 # make install will fail,
2804 # 2. the above comment should most certainly read
2805 # $(mkdir_p) $(DESTDIR)$(somedir)
2806 # so it does not work when $(somedir) is undefined and
2807 # $(DESTDIR) is not.
2808 # To support the latter case, we have to write
2809 # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
2810 # so the `.' trick is pointless.
2811 mkdir_p='mkdir -p --'
2813 # On NextStep and OpenStep, the `mkdir' command does not
2814 # recognize any option. It will interpret all options as
2815 # directories to create, and then abort because `.' already
2817 for d in ./-p ./--version;
2819 test -d $d && rmdir $d
2821 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
2822 if test -f "$ac_aux_dir/mkinstalldirs"; then
2823 mkdir_p='$(mkinstalldirs)'
2825 mkdir_p='$(install_sh) -d'
2828 AC_SUBST([mkdir_p])])
2830 # Helper functions for option handling. -*- Autoconf -*-
2832 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
2834 # This file is free software; the Free Software Foundation
2835 # gives unlimited permission to copy and/or distribute it,
2836 # with or without modifications, as long as this notice is preserved.
2840 # _AM_MANGLE_OPTION(NAME)
2841 # -----------------------
2842 AC_DEFUN([_AM_MANGLE_OPTION],
2843 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2845 # _AM_SET_OPTION(NAME)
2846 # ------------------------------
2847 # Set option NAME. Presently that only means defining a flag for this option.
2848 AC_DEFUN([_AM_SET_OPTION],
2849 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2851 # _AM_SET_OPTIONS(OPTIONS)
2852 # ----------------------------------
2853 # OPTIONS is a space-separated list of Automake options.
2854 AC_DEFUN([_AM_SET_OPTIONS],
2855 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2857 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2858 # -------------------------------------------
2859 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2860 AC_DEFUN([_AM_IF_OPTION],
2861 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2863 # Check to make sure that the build environment is sane. -*- Autoconf -*-
2865 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
2866 # Free Software Foundation, Inc.
2868 # This file is free software; the Free Software Foundation
2869 # gives unlimited permission to copy and/or distribute it,
2870 # with or without modifications, as long as this notice is preserved.
2876 AC_DEFUN([AM_SANITY_CHECK],
2877 [AC_MSG_CHECKING([whether build environment is sane])
2880 echo timestamp > conftest.file
2881 # Do `set' in a subshell so we don't clobber the current shell's
2882 # arguments. Must try -L first in case configure is actually a
2883 # symlink; some systems play weird games with the mod time of symlinks
2884 # (eg FreeBSD returns the mod time of the symlink's containing
2887 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
2888 if test "$[*]" = "X"; then
2890 set X `ls -t $srcdir/configure conftest.file`
2893 if test "$[*]" != "X $srcdir/configure conftest.file" \
2894 && test "$[*]" != "X conftest.file $srcdir/configure"; then
2896 # If neither matched, then we have a broken ls. This can happen
2897 # if, for instance, CONFIG_SHELL is bash and it inherits a
2898 # broken ls alias from the environment. This has actually
2899 # happened. Such a system could not be considered "sane".
2900 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2901 alias in your environment])
2904 test "$[2]" = conftest.file
2910 AC_MSG_ERROR([newly created file is older than distributed files!
2911 Check your system clock])
2913 AC_MSG_RESULT(yes)])
2915 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
2917 # This file is free software; the Free Software Foundation
2918 # gives unlimited permission to copy and/or distribute it,
2919 # with or without modifications, as long as this notice is preserved.
2921 # AM_PROG_INSTALL_STRIP
2922 # ---------------------
2923 # One issue with vendor `install' (even GNU) is that you can't
2924 # specify the program used to strip binaries. This is especially
2925 # annoying in cross-compiling environments, where the build's strip
2926 # is unlikely to handle the host's binaries.
2927 # Fortunately install-sh will honor a STRIPPROG variable, so we
2928 # always use install-sh in `make install-strip', and initialize
2929 # STRIPPROG with the value of the STRIP variable (set by the user).
2930 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2931 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2932 # Installed binaries are usually stripped using `strip' when the user
2933 # run `make install-strip'. However `strip' might not be the right
2934 # tool to use in cross-compilation environments, therefore Automake
2935 # will honor the `STRIP' environment variable to overrule this program.
2936 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2937 if test "$cross_compiling" != no; then
2938 AC_CHECK_TOOL([STRIP], [strip], :)
2940 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
2941 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2943 # Check how to create a tarball. -*- Autoconf -*-
2945 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
2947 # This file is free software; the Free Software Foundation
2948 # gives unlimited permission to copy and/or distribute it,
2949 # with or without modifications, as long as this notice is preserved.
2953 # _AM_PROG_TAR(FORMAT)
2954 # --------------------
2955 # Check how to create a tarball in format FORMAT.
2956 # FORMAT should be one of `v7', `ustar', or `pax'.
2958 # Substitute a variable $(am__tar) that is a command
2959 # writing to stdout a FORMAT-tarball containing the directory
2961 # tardir=directory && $(am__tar) > result.tar
2963 # Substitute a variable $(am__untar) that extract such
2964 # a tarball read from stdin.
2965 # $(am__untar) < result.tar
2966 AC_DEFUN([_AM_PROG_TAR],
2967 [# Always define AMTAR for backward compatibility.
2968 AM_MISSING_PROG([AMTAR], [tar])
2970 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2971 [m4_case([$1], [ustar],, [pax],,
2972 [m4_fatal([Unknown tar format])])
2973 AC_MSG_CHECKING([how to create a $1 tar archive])
2974 # Loop over all known methods to create a tar archive until one works.
2975 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2976 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2977 # Do not fold the above two line into one, because Tru64 sh and
2978 # Solaris sh will not grok spaces in the rhs of `-'.
2979 for _am_tool in $_am_tools
2983 for _am_tar in tar gnutar gtar;
2985 AM_RUN_LOG([$_am_tar --version]) && break
2987 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2988 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2989 am__untar="$_am_tar -xf -"
2992 # Must skip GNU tar: if it does not support --format= it doesn't create
2993 # ustar tarball either.
2994 (tar --version) >/dev/null 2>&1 && continue
2995 am__tar='tar chf - "$$tardir"'
2996 am__tar_='tar chf - "$tardir"'
2997 am__untar='tar xf -'
3000 am__tar='pax -L -x $1 -w "$$tardir"'
3001 am__tar_='pax -L -x $1 -w "$tardir"'
3005 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
3006 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
3007 am__untar='cpio -i -H $1 -d'
3016 # If the value was cached, stop now. We just wanted to have am__tar
3017 # and am__untar set.
3018 test -n "${am_cv_prog_tar_$1}" && break
3020 # tar/untar a dummy directory, and stop if the command works
3023 echo GrepMe > conftest.dir/file
3024 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
3026 if test -s conftest.tar; then
3027 AM_RUN_LOG([$am__untar <conftest.tar])
3028 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3033 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
3034 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
3036 AC_SUBST([am__untar])
3039 m4_include([acinclude.m4])