Add new netstatus plugin ported from GNOME netstatus panel applet.
[lxde/lxpanel.git] / aclocal.m4
CommitLineData
a52c2257
HJYP
1# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2
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.
8
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
12# PARTICULAR PURPOSE.
13
66c88ea4
HJYP
14# gettext.m4 serial 37 (gettext-0.14.4)
15dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
a52c2257
HJYP
16dnl This file is free software; the Free Software Foundation
17dnl gives unlimited permission to copy and/or distribute it,
18dnl with or without modifications, as long as this notice is preserved.
19dnl
20dnl This file can can be used in projects which are not available under
21dnl the GNU General Public License or the GNU Library General Public
22dnl License but which still want to provide support for the GNU gettext
23dnl functionality.
24dnl Please note that the actual code of the GNU gettext library is covered
25dnl by the GNU Library General Public License, and the rest of the GNU
26dnl gettext package package is covered by the GNU General Public License.
27dnl They are *not* in the public domain.
28
29dnl Authors:
30dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
66c88ea4 31dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
a52c2257
HJYP
32
33dnl Macro to add for using GNU gettext.
34
35dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
36dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
37dnl default (if it is not specified or empty) is 'no-libtool'.
38dnl INTLSYMBOL should be 'external' for packages with no intl directory,
39dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
40dnl If INTLSYMBOL is 'use-libtool', then a libtool library
41dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
42dnl depending on --{enable,disable}-{shared,static} and on the presence of
43dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
44dnl $(top_builddir)/intl/libintl.a will be created.
45dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
46dnl implementations (in libc or libintl) without the ngettext() function
47dnl will be ignored. If NEEDSYMBOL is specified and is
48dnl 'need-formatstring-macros', then GNU gettext implementations that don't
49dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
50dnl INTLDIR is used to find the intl libraries. If empty,
51dnl the value `$(top_builddir)/intl/' is used.
52dnl
53dnl The result of the configuration is one of three cases:
54dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
55dnl and used.
56dnl Catalog format: GNU --> install in $(datadir)
57dnl Catalog extension: .mo after installation, .gmo in source tree
58dnl 2) GNU gettext has been found in the system's C library.
59dnl Catalog format: GNU --> install in $(datadir)
60dnl Catalog extension: .mo after installation, .gmo in source tree
61dnl 3) No internationalization, always use English msgid.
62dnl Catalog format: none
63dnl Catalog extension: none
64dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
65dnl The use of .gmo is historical (it was needed to avoid overwriting the
66dnl GNU format catalogs when building on a platform with an X/Open gettext),
67dnl but we keep it in order not to force irrelevant filename changes on the
68dnl maintainers.
69dnl
70AC_DEFUN([AM_GNU_GETTEXT],
71[
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
75])])])])])
76 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
77 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
78])])])])
79 define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
80 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
81
82 AC_REQUIRE([AM_PO_SUBDIRS])dnl
83 ifelse(gt_included_intl, yes, [
84 AC_REQUIRE([AM_INTL_SUBDIR])dnl
85 ])
86
87 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
88 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
89 AC_REQUIRE([AC_LIB_RPATH])
90
91 dnl Sometimes libintl requires libiconv, so first search for libiconv.
92 dnl Ideally we would do this search only after the
93 dnl if test "$USE_NLS" = "yes"; then
94 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
95 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
96 dnl the configure script would need to contain the same shell code
97 dnl again, outside any 'if'. There are two solutions:
98 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
99 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
100 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
101 dnl documented, we avoid it.
102 ifelse(gt_included_intl, yes, , [
103 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
104 ])
105
106 dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
107 gt_INTL_MACOSX
108
109 dnl Set USE_NLS.
66c88ea4 110 AM_NLS
a52c2257
HJYP
111
112 ifelse(gt_included_intl, yes, [
113 BUILD_INCLUDED_LIBINTL=no
114 USE_INCLUDED_LIBINTL=no
115 ])
116 LIBINTL=
117 LTLIBINTL=
118 POSUB=
119
120 dnl If we use NLS figure out what method
121 if test "$USE_NLS" = "yes"; then
122 gt_use_preinstalled_gnugettext=no
123 ifelse(gt_included_intl, yes, [
124 AC_MSG_CHECKING([whether included gettext is requested])
125 AC_ARG_WITH(included-gettext,
126 [ --with-included-gettext use the GNU gettext library included here],
127 nls_cv_force_use_gnu_gettext=$withval,
128 nls_cv_force_use_gnu_gettext=no)
129 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
130
131 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
132 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
133 ])
134 dnl User does not insist on using GNU NLS library. Figure out what
135 dnl to use. If GNU gettext is available we use this. Else we have
136 dnl to fall back to GNU NLS library.
137
138 dnl Add a version number to the cache macros.
139 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
140 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
141 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
142
143 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
144 [AC_TRY_LINK([#include <libintl.h>
145]ifelse([$2], [need-formatstring-macros],
66c88ea4 146[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
a52c2257
HJYP
147#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
148#endif
66c88ea4 149changequote(,)dnl
a52c2257 150typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
66c88ea4
HJYP
151changequote([,])dnl
152], [])[extern int _nl_msg_cat_cntr;
a52c2257
HJYP
153extern int *_nl_domain_bindings;],
154 [bindtextdomain ("", "");
155return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
156 gt_cv_func_gnugettext_libc=yes,
157 gt_cv_func_gnugettext_libc=no)])
158
159 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
160 dnl Sometimes libintl requires libiconv, so first search for libiconv.
161 ifelse(gt_included_intl, yes, , [
162 AM_ICONV_LINK
163 ])
164 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
165 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
166 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
167 dnl even if libiconv doesn't exist.
168 AC_LIB_LINKFLAGS_BODY([intl])
169 AC_CACHE_CHECK([for GNU gettext in libintl],
170 gt_cv_func_gnugettext_libintl,
171 [gt_save_CPPFLAGS="$CPPFLAGS"
172 CPPFLAGS="$CPPFLAGS $INCINTL"
173 gt_save_LIBS="$LIBS"
174 LIBS="$LIBS $LIBINTL"
175 dnl Now see whether libintl exists and does not depend on libiconv.
176 AC_TRY_LINK([#include <libintl.h>
177]ifelse([$2], [need-formatstring-macros],
66c88ea4 178[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
a52c2257
HJYP
179#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
180#endif
66c88ea4 181changequote(,)dnl
a52c2257 182typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
66c88ea4
HJYP
183changequote([,])dnl
184], [])[extern int _nl_msg_cat_cntr;
a52c2257
HJYP
185extern
186#ifdef __cplusplus
187"C"
188#endif
189const char *_nl_expand_alias (const char *);],
190 [bindtextdomain ("", "");
191return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
192 gt_cv_func_gnugettext_libintl=yes,
193 gt_cv_func_gnugettext_libintl=no)
194 dnl Now see whether libintl exists and depends on libiconv.
195 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
196 LIBS="$LIBS $LIBICONV"
197 AC_TRY_LINK([#include <libintl.h>
198]ifelse([$2], [need-formatstring-macros],
66c88ea4 199[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
a52c2257
HJYP
200#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
201#endif
66c88ea4 202changequote(,)dnl
a52c2257 203typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
66c88ea4
HJYP
204changequote([,])dnl
205], [])[extern int _nl_msg_cat_cntr;
a52c2257
HJYP
206extern
207#ifdef __cplusplus
208"C"
209#endif
210const char *_nl_expand_alias (const char *);],
211 [bindtextdomain ("", "");
212return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
213 [LIBINTL="$LIBINTL $LIBICONV"
214 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
215 gt_cv_func_gnugettext_libintl=yes
216 ])
217 fi
218 CPPFLAGS="$gt_save_CPPFLAGS"
219 LIBS="$gt_save_LIBS"])
220 fi
221
222 dnl If an already present or preinstalled GNU gettext() is found,
223 dnl use it. But if this macro is used in GNU gettext, and GNU
224 dnl gettext is already preinstalled in libintl, we update this
225 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
226 if test "$gt_cv_func_gnugettext_libc" = "yes" \
227 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
228 && test "$PACKAGE" != gettext-runtime \
229 && test "$PACKAGE" != gettext-tools; }; then
230 gt_use_preinstalled_gnugettext=yes
231 else
232 dnl Reset the values set by searching for libintl.
233 LIBINTL=
234 LTLIBINTL=
235 INCINTL=
236 fi
237
238 ifelse(gt_included_intl, yes, [
239 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
240 dnl GNU gettext is not found in the C library.
241 dnl Fall back on included GNU gettext library.
242 nls_cv_use_gnu_gettext=yes
243 fi
244 fi
245
246 if test "$nls_cv_use_gnu_gettext" = "yes"; then
247 dnl Mark actions used to generate GNU NLS library.
248 BUILD_INCLUDED_LIBINTL=yes
249 USE_INCLUDED_LIBINTL=yes
66c88ea4
HJYP
250 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
251 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
a52c2257
HJYP
252 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
253 fi
254
255 CATOBJEXT=
256 if test "$gt_use_preinstalled_gnugettext" = "yes" \
257 || test "$nls_cv_use_gnu_gettext" = "yes"; then
258 dnl Mark actions to use GNU gettext tools.
259 CATOBJEXT=.gmo
260 fi
261 ])
262
263 if test -n "$INTL_MACOSX_LIBS"; then
264 if test "$gt_use_preinstalled_gnugettext" = "yes" \
265 || test "$nls_cv_use_gnu_gettext" = "yes"; then
266 dnl Some extra flags are needed during linking.
267 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
268 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
269 fi
270 fi
271
272 if test "$gt_use_preinstalled_gnugettext" = "yes" \
273 || test "$nls_cv_use_gnu_gettext" = "yes"; then
274 AC_DEFINE(ENABLE_NLS, 1,
275 [Define to 1 if translation of program messages to the user's native language
276 is requested.])
277 else
278 USE_NLS=no
279 fi
280 fi
281
282 AC_MSG_CHECKING([whether to use NLS])
283 AC_MSG_RESULT([$USE_NLS])
284 if test "$USE_NLS" = "yes"; then
285 AC_MSG_CHECKING([where the gettext function comes from])
286 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
287 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
288 gt_source="external libintl"
289 else
290 gt_source="libc"
291 fi
292 else
293 gt_source="included intl directory"
294 fi
295 AC_MSG_RESULT([$gt_source])
296 fi
297
298 if test "$USE_NLS" = "yes"; then
299
300 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
301 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
302 AC_MSG_CHECKING([how to link with libintl])
303 AC_MSG_RESULT([$LIBINTL])
304 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
305 fi
306
307 dnl For backward compatibility. Some packages may be using this.
308 AC_DEFINE(HAVE_GETTEXT, 1,
309 [Define if the GNU gettext() function is already present or preinstalled.])
310 AC_DEFINE(HAVE_DCGETTEXT, 1,
311 [Define if the GNU dcgettext() function is already present or preinstalled.])
312 fi
313
314 dnl We need to process the po/ directory.
315 POSUB=po
316 fi
317
318 ifelse(gt_included_intl, yes, [
319 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
320 dnl to 'yes' because some of the testsuite requires it.
321 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
322 BUILD_INCLUDED_LIBINTL=yes
323 fi
324
325 dnl Make all variables we use known to autoconf.
326 AC_SUBST(BUILD_INCLUDED_LIBINTL)
327 AC_SUBST(USE_INCLUDED_LIBINTL)
328 AC_SUBST(CATOBJEXT)
329
330 dnl For backward compatibility. Some configure.ins may be using this.
331 nls_cv_header_intl=
332 nls_cv_header_libgt=
333
334 dnl For backward compatibility. Some Makefiles may be using this.
335 DATADIRNAME=share
336 AC_SUBST(DATADIRNAME)
337
338 dnl For backward compatibility. Some Makefiles may be using this.
339 INSTOBJEXT=.mo
340 AC_SUBST(INSTOBJEXT)
341
342 dnl For backward compatibility. Some Makefiles may be using this.
343 GENCAT=gencat
344 AC_SUBST(GENCAT)
345
346 dnl For backward compatibility. Some Makefiles may be using this.
347 INTLOBJS=
348 if test "$USE_INCLUDED_LIBINTL" = yes; then
349 INTLOBJS="\$(GETTOBJS)"
350 fi
351 AC_SUBST(INTLOBJS)
352
353 dnl Enable libtool support if the surrounding package wishes it.
354 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
355 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
356 ])
357
358 dnl For backward compatibility. Some Makefiles may be using this.
359 INTLLIBS="$LIBINTL"
360 AC_SUBST(INTLLIBS)
361
362 dnl Make all documented variables known to autoconf.
363 AC_SUBST(LIBINTL)
364 AC_SUBST(LTLIBINTL)
365 AC_SUBST(POSUB)
366])
367
368
369dnl Checks for all prerequisites of the intl subdirectory,
370dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
371dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
372AC_DEFUN([AM_INTL_SUBDIR],
373[
374 AC_REQUIRE([AC_PROG_INSTALL])dnl
66c88ea4 375 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
a52c2257
HJYP
376 AC_REQUIRE([AC_PROG_CC])dnl
377 AC_REQUIRE([AC_CANONICAL_HOST])dnl
378 AC_REQUIRE([gt_GLIBC2])dnl
379 AC_REQUIRE([AC_PROG_RANLIB])dnl
66c88ea4
HJYP
380 AC_REQUIRE([AC_ISC_POSIX])dnl
381 AC_REQUIRE([AC_HEADER_STDC])dnl
382 AC_REQUIRE([AC_C_CONST])dnl
a52c2257 383 AC_REQUIRE([bh_C_SIGNED])dnl
66c88ea4
HJYP
384 AC_REQUIRE([AC_C_INLINE])dnl
385 AC_REQUIRE([AC_TYPE_OFF_T])dnl
386 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
a52c2257
HJYP
387 AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
388 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
389 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
390 AC_REQUIRE([gt_TYPE_WINT_T])dnl
391 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
66c88ea4 392 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
a52c2257
HJYP
393 AC_REQUIRE([gt_TYPE_INTMAX_T])
394 AC_REQUIRE([gt_PRINTF_POSIX])
66c88ea4
HJYP
395 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
396 AC_REQUIRE([AC_FUNC_MMAP])dnl
a52c2257 397 AC_REQUIRE([gl_GLIBC21])dnl
66c88ea4
HJYP
398 AC_REQUIRE([gt_INTDIV0])dnl
399 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
400 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
401 AC_REQUIRE([gt_INTTYPES_PRI])dnl
a52c2257
HJYP
402 AC_REQUIRE([gl_XSIZE])dnl
403 AC_REQUIRE([gt_INTL_MACOSX])dnl
404
405 AC_CHECK_TYPE([ptrdiff_t], ,
406 [AC_DEFINE([ptrdiff_t], [long],
407 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
408 ])
66c88ea4
HJYP
409 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
410stdlib.h string.h unistd.h sys/param.h])
411 AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
412mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
413strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
414__fsetlocking])
a52c2257
HJYP
415
416 dnl Use the _snprintf function only if it is declared (because on NetBSD it
417 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
418 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
419 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
420
421 dnl Use the *_unlocked functions only if they are declared.
422 dnl (because some of them were defined without being declared in Solaris
423 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
424 dnl on Solaris 2.5.1 to run on Solaris 2.6).
425 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
66c88ea4
HJYP
426 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
427 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
a52c2257
HJYP
428 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
429
430 case $gt_cv_func_printf_posix in
431 *yes) HAVE_POSIX_PRINTF=1 ;;
432 *) HAVE_POSIX_PRINTF=0 ;;
433 esac
434 AC_SUBST([HAVE_POSIX_PRINTF])
435 if test "$ac_cv_func_asprintf" = yes; then
436 HAVE_ASPRINTF=1
437 else
438 HAVE_ASPRINTF=0
439 fi
440 AC_SUBST([HAVE_ASPRINTF])
441 if test "$ac_cv_func_snprintf" = yes; then
442 HAVE_SNPRINTF=1
443 else
444 HAVE_SNPRINTF=0
445 fi
446 AC_SUBST([HAVE_SNPRINTF])
447 if test "$ac_cv_func_wprintf" = yes; then
448 HAVE_WPRINTF=1
449 else
450 HAVE_WPRINTF=0
451 fi
452 AC_SUBST([HAVE_WPRINTF])
453
66c88ea4 454 AM_ICONV
a52c2257 455 AM_LANGINFO_CODESET
66c88ea4
HJYP
456 if test $ac_cv_header_locale_h = yes; then
457 gt_LC_MESSAGES
a52c2257 458 fi
a52c2257 459
66c88ea4
HJYP
460 if test -n "$INTL_MACOSX_LIBS"; then
461 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
a52c2257
HJYP
462 fi
463
464 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
465 dnl because plural.y uses bison specific features. It requires at least
466 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
467 dnl compile.
468 dnl bison is only needed for the maintainer (who touches plural.y). But in
469 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
470 dnl the rule in general Makefile. Now, some people carelessly touch the
471 dnl files or have a broken "make" program, hence the plural.c rule will
472 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
473 dnl present or too old.
474 AC_CHECK_PROGS([INTLBISON], [bison])
475 if test -z "$INTLBISON"; then
476 ac_verc_fail=yes
477 else
478 dnl Found it, now check the version.
479 AC_MSG_CHECKING([version of bison])
480changequote(<<,>>)dnl
481 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
482 case $ac_prog_version in
483 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
484 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
485changequote([,])dnl
486 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
487 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
488 esac
489 AC_MSG_RESULT([$ac_prog_version])
490 fi
491 if test $ac_verc_fail = yes; then
492 INTLBISON=:
493 fi
494])
495
496
497dnl Checks for special options needed on MacOS X.
498dnl Defines INTL_MACOSX_LIBS.
499AC_DEFUN([gt_INTL_MACOSX],
500[
501 dnl Check for API introduced in MacOS X 10.2.
502 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
503 gt_cv_func_CFPreferencesCopyAppValue,
66c88ea4
HJYP
504 [gt_save_CPPFLAGS="$CPPFLAGS"
505 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
506 gt_save_LIBS="$LIBS"
507 LIBS="$LIBS -framework CoreFoundation"
508 AC_TRY_LINK([#include <CFPreferences.h>],
a52c2257
HJYP
509 [CFPreferencesCopyAppValue(NULL, NULL)],
510 [gt_cv_func_CFPreferencesCopyAppValue=yes],
511 [gt_cv_func_CFPreferencesCopyAppValue=no])
66c88ea4 512 CPPFLAGS="$gt_save_CPPFLAGS"
a52c2257
HJYP
513 LIBS="$gt_save_LIBS"])
514 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
515 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
516 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
517 fi
518 dnl Check for API introduced in MacOS X 10.3.
519 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
66c88ea4
HJYP
520 [gt_save_CPPFLAGS="$CPPFLAGS"
521 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
522 gt_save_LIBS="$LIBS"
523 LIBS="$LIBS -framework CoreFoundation"
524 AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
a52c2257
HJYP
525 [gt_cv_func_CFLocaleCopyCurrent=yes],
526 [gt_cv_func_CFLocaleCopyCurrent=no])
66c88ea4 527 CPPFLAGS="$gt_save_CPPFLAGS"
a52c2257
HJYP
528 LIBS="$gt_save_LIBS"])
529 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
530 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
531 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
532 fi
533 INTL_MACOSX_LIBS=
534 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
535 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
536 fi
537 AC_SUBST([INTL_MACOSX_LIBS])
538])
539
540
541dnl gt_CHECK_DECL(FUNC, INCLUDES)
542dnl Check whether a function is declared.
543AC_DEFUN([gt_CHECK_DECL],
544[
545 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
546 [AC_TRY_COMPILE([$2], [
547#ifndef $1
548 char *p = (char *) $1;
549#endif
550], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
551 if test $ac_cv_have_decl_$1 = yes; then
552 gt_value=1
553 else
554 gt_value=0
555 fi
556 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
557 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
558])
559
560
561dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
562AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
563
564# Copyright (C) 1995-2002 Free Software Foundation, Inc.
565# Copyright (C) 2001-2003,2004 Red Hat, Inc.
566#
567# This file is free software, distributed under the terms of the GNU
568# General Public License. As a special exception to the GNU General
569# Public License, this file may be distributed as part of a program
570# that contains a configuration script generated by Autoconf, under
571# the same distribution terms as the rest of that program.
572#
573# This file can be copied and used freely without restrictions. It can
574# be used in projects which are not available under the GNU Public License
575# but which still want to provide support for the GNU gettext functionality.
576#
577# Macro to add for using GNU gettext.
578# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
579#
580# Modified to never use included libintl.
581# Owen Taylor <otaylor@redhat.com>, 12/15/1998
582#
583# Major rework to remove unused code
584# Owen Taylor <otaylor@redhat.com>, 12/11/2002
585#
586# Added better handling of ALL_LINGUAS from GNU gettext version
587# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
588#
589# Modified to require ngettext
590# Matthias Clasen <mclasen@redhat.com> 08/06/2004
591#
592# We need this here as well, since someone might use autoconf-2.5x
593# to configure GLib then an older version to configure a package
594# using AM_GLIB_GNU_GETTEXT
595AC_PREREQ(2.53)
596
597dnl
598dnl We go to great lengths to make sure that aclocal won't
599dnl try to pull in the installed version of these macros
600dnl when running aclocal in the glib directory.
601dnl
602m4_copy([AC_DEFUN],[glib_DEFUN])
603m4_copy([AC_REQUIRE],[glib_REQUIRE])
604dnl
605dnl At the end, if we're not within glib, we'll define the public
606dnl definitions in terms of our private definitions.
607dnl
608
609# GLIB_LC_MESSAGES
610#--------------------
611glib_DEFUN([GLIB_LC_MESSAGES],
612 [AC_CHECK_HEADERS([locale.h])
613 if test $ac_cv_header_locale_h = yes; then
614 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
615 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
616 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
617 if test $am_cv_val_LC_MESSAGES = yes; then
618 AC_DEFINE(HAVE_LC_MESSAGES, 1,
619 [Define if your <locale.h> file defines LC_MESSAGES.])
620 fi
621 fi])
622
623# GLIB_PATH_PROG_WITH_TEST
624#----------------------------
625dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
626dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
627glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
628[# Extract the first word of "$2", so it can be a program name with args.
629set dummy $2; ac_word=[$]2
630AC_MSG_CHECKING([for $ac_word])
631AC_CACHE_VAL(ac_cv_path_$1,
632[case "[$]$1" in
633 /*)
634 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
635 ;;
636 *)
637 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
638 for ac_dir in ifelse([$5], , $PATH, [$5]); do
639 test -z "$ac_dir" && ac_dir=.
640 if test -f $ac_dir/$ac_word; then
641 if [$3]; then
642 ac_cv_path_$1="$ac_dir/$ac_word"
643 break
644 fi
645 fi
646 done
647 IFS="$ac_save_ifs"
648dnl If no 4th arg is given, leave the cache variable unset,
649dnl so AC_PATH_PROGS will keep looking.
650ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
651])dnl
652 ;;
653esac])dnl
654$1="$ac_cv_path_$1"
655if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
656 AC_MSG_RESULT([$]$1)
657else
658 AC_MSG_RESULT(no)
659fi
660AC_SUBST($1)dnl
661])
662
663# GLIB_WITH_NLS
664#-----------------
665glib_DEFUN([GLIB_WITH_NLS],
666 dnl NLS is obligatory
667 [USE_NLS=yes
668 AC_SUBST(USE_NLS)
669
670 gt_cv_have_gettext=no
671
672 CATOBJEXT=NONE
673 XGETTEXT=:
674 INTLLIBS=
675
676 AC_CHECK_HEADER(libintl.h,
677 [gt_cv_func_dgettext_libintl="no"
678 libintl_extra_libs=""
679
680 #
681 # First check in libc
682 #
683 AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
684 [AC_TRY_LINK([
685#include <libintl.h>
686],
687 [return !ngettext ("","", 1)],
688 gt_cv_func_ngettext_libc=yes,
689 gt_cv_func_ngettext_libc=no)
690 ])
691
692 if test "$gt_cv_func_ngettext_libc" = "yes" ; then
693 AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
694 [AC_TRY_LINK([
695#include <libintl.h>
696],
697 [return !dgettext ("","")],
698 gt_cv_func_dgettext_libc=yes,
699 gt_cv_func_dgettext_libc=no)
700 ])
701 fi
702
703 if test "$gt_cv_func_ngettext_libc" = "yes" ; then
704 AC_CHECK_FUNCS(bind_textdomain_codeset)
705 fi
706
707 #
708 # If we don't have everything we want, check in libintl
709 #
710 if test "$gt_cv_func_dgettext_libc" != "yes" \
711 || test "$gt_cv_func_ngettext_libc" != "yes" \
712 || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
713
714 AC_CHECK_LIB(intl, bindtextdomain,
715 [AC_CHECK_LIB(intl, ngettext,
716 [AC_CHECK_LIB(intl, dgettext,
717 gt_cv_func_dgettext_libintl=yes)])])
718
719 if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
720 AC_MSG_CHECKING([if -liconv is needed to use gettext])
721 AC_MSG_RESULT([])
722 AC_CHECK_LIB(intl, ngettext,
723 [AC_CHECK_LIB(intl, dcgettext,
724 [gt_cv_func_dgettext_libintl=yes
725 libintl_extra_libs=-liconv],
726 :,-liconv)],
727 :,-liconv)
728 fi
729
730 #
731 # If we found libintl, then check in it for bind_textdomain_codeset();
732 # we'll prefer libc if neither have bind_textdomain_codeset(),
733 # and both have dgettext and ngettext
734 #
735 if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
736 glib_save_LIBS="$LIBS"
737 LIBS="$LIBS -lintl $libintl_extra_libs"
738 unset ac_cv_func_bind_textdomain_codeset
739 AC_CHECK_FUNCS(bind_textdomain_codeset)
740 LIBS="$glib_save_LIBS"
741
742 if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
743 gt_cv_func_dgettext_libc=no
744 else
745 if test "$gt_cv_func_dgettext_libc" = "yes" \
746 && test "$gt_cv_func_ngettext_libc" = "yes"; then
747 gt_cv_func_dgettext_libintl=no
748 fi
749 fi
750 fi
751 fi
752
753 if test "$gt_cv_func_dgettext_libc" = "yes" \
754 || test "$gt_cv_func_dgettext_libintl" = "yes"; then
755 gt_cv_have_gettext=yes
756 fi
757
758 if test "$gt_cv_func_dgettext_libintl" = "yes"; then
759 INTLLIBS="-lintl $libintl_extra_libs"
760 fi
761
762 if test "$gt_cv_have_gettext" = "yes"; then
763 AC_DEFINE(HAVE_GETTEXT,1,
764 [Define if the GNU gettext() function is already present or preinstalled.])
765 GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
766 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
767 if test "$MSGFMT" != "no"; then
768 glib_save_LIBS="$LIBS"
769 LIBS="$LIBS $INTLLIBS"
770 AC_CHECK_FUNCS(dcgettext)
771 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
772 GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
773 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
774 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
775 return _nl_msg_cat_cntr],
776 [CATOBJEXT=.gmo
777 DATADIRNAME=share],
778 [case $host in
779 *-*-solaris*)
780 dnl On Solaris, if bind_textdomain_codeset is in libc,
781 dnl GNU format message catalog is always supported,
782 dnl since both are added to the libc all together.
783 dnl Hence, we'd like to go with DATADIRNAME=share and
784 dnl and CATOBJEXT=.gmo in this case.
785 AC_CHECK_FUNC(bind_textdomain_codeset,
786 [CATOBJEXT=.gmo
787 DATADIRNAME=share],
788 [CATOBJEXT=.mo
789 DATADIRNAME=lib])
790 ;;
791 *)
792 CATOBJEXT=.mo
793 DATADIRNAME=lib
794 ;;
795 esac])
796 LIBS="$glib_save_LIBS"
797 INSTOBJEXT=.mo
798 else
799 gt_cv_have_gettext=no
800 fi
801 fi
802 ])
803
804 if test "$gt_cv_have_gettext" = "yes" ; then
805 AC_DEFINE(ENABLE_NLS, 1,
806 [always defined to indicate that i18n is enabled])
807 fi
808
809 dnl Test whether we really found GNU xgettext.
810 if test "$XGETTEXT" != ":"; then
811 dnl If it is not GNU xgettext we define it as : so that the
812 dnl Makefiles still can work.
813 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
814 : ;
815 else
816 AC_MSG_RESULT(
817 [found xgettext program is not GNU xgettext; ignore it])
818 XGETTEXT=":"
819 fi
820 fi
821
822 # We need to process the po/ directory.
823 POSUB=po
824
825 AC_OUTPUT_COMMANDS(
826 [case "$CONFIG_FILES" in *po/Makefile.in*)
827 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
828 esac])
829
830 dnl These rules are solely for the distribution goal. While doing this
831 dnl we only have to keep exactly one list of the available catalogs
832 dnl in configure.in.
833 for lang in $ALL_LINGUAS; do
834 GMOFILES="$GMOFILES $lang.gmo"
835 POFILES="$POFILES $lang.po"
836 done
837
838 dnl Make all variables we use known to autoconf.
839 AC_SUBST(CATALOGS)
840 AC_SUBST(CATOBJEXT)
841 AC_SUBST(DATADIRNAME)
842 AC_SUBST(GMOFILES)
843 AC_SUBST(INSTOBJEXT)
844 AC_SUBST(INTLLIBS)
845 AC_SUBST(PO_IN_DATADIR_TRUE)
846 AC_SUBST(PO_IN_DATADIR_FALSE)
847 AC_SUBST(POFILES)
848 AC_SUBST(POSUB)
849 ])
850
851# AM_GLIB_GNU_GETTEXT
852# -------------------
853# Do checks necessary for use of gettext. If a suitable implementation
854# of gettext is found in either in libintl or in the C library,
855# it will set INTLLIBS to the libraries needed for use of gettext
856# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
857# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
858# on various variables needed by the Makefile.in.in installed by
859# glib-gettextize.
860dnl
861glib_DEFUN([GLIB_GNU_GETTEXT],
862 [AC_REQUIRE([AC_PROG_CC])dnl
863 AC_REQUIRE([AC_HEADER_STDC])dnl
864
865 GLIB_LC_MESSAGES
866 GLIB_WITH_NLS
867
868 if test "$gt_cv_have_gettext" = "yes"; then
869 if test "x$ALL_LINGUAS" = "x"; then
870 LINGUAS=
871 else
872 AC_MSG_CHECKING(for catalogs to be installed)
873 NEW_LINGUAS=
874 for presentlang in $ALL_LINGUAS; do
875 useit=no
876 if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
877 desiredlanguages="$LINGUAS"
878 else
879 desiredlanguages="$ALL_LINGUAS"
880 fi
881 for desiredlang in $desiredlanguages; do
882 # Use the presentlang catalog if desiredlang is
883 # a. equal to presentlang, or
884 # b. a variant of presentlang (because in this case,
885 # presentlang can be used as a fallback for messages
886 # which are not translated in the desiredlang catalog).
887 case "$desiredlang" in
888 "$presentlang"*) useit=yes;;
889 esac
890 done
891 if test $useit = yes; then
892 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
893 fi
894 done
895 LINGUAS=$NEW_LINGUAS
896 AC_MSG_RESULT($LINGUAS)
897 fi
898
899 dnl Construct list of names of catalog files to be constructed.
900 if test -n "$LINGUAS"; then
901 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
902 fi
903 fi
904
905 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
906 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
907 dnl Try to locate is.
908 MKINSTALLDIRS=
909 if test -n "$ac_aux_dir"; then
910 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
911 fi
912 if test -z "$MKINSTALLDIRS"; then
913 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
914 fi
915 AC_SUBST(MKINSTALLDIRS)
916
917 dnl Generate list of files to be processed by xgettext which will
918 dnl be included in po/Makefile.
919 test -d po || mkdir po
920 if test "x$srcdir" != "x."; then
921 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
922 posrcprefix="$srcdir/"
923 else
924 posrcprefix="../$srcdir/"
925 fi
926 else
927 posrcprefix="../"
928 fi
929 rm -f po/POTFILES
930 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
931 < $srcdir/po/POTFILES.in > po/POTFILES
932 ])
933
934# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
935# -------------------------------
936# Define VARIABLE to the location where catalog files will
937# be installed by po/Makefile.
938glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
939[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
940glib_save_prefix="$prefix"
941glib_save_exec_prefix="$exec_prefix"
942test "x$prefix" = xNONE && prefix=$ac_default_prefix
943test "x$exec_prefix" = xNONE && exec_prefix=$prefix
944if test "x$CATOBJEXT" = "x.mo" ; then
945 localedir=`eval echo "${libdir}/locale"`
946else
947 localedir=`eval echo "${datadir}/locale"`
948fi
949prefix="$glib_save_prefix"
950exec_prefix="$glib_save_exec_prefix"
951AC_DEFINE_UNQUOTED($1, "$localedir",
952 [Define the location where the catalogs will be installed])
953])
954
955dnl
956dnl Now the definitions that aclocal will find
957dnl
958ifdef(glib_configure_in,[],[
959AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
960AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
961])dnl
962
963# iconv.m4 serial AM4 (gettext-0.11.3)
964dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
965dnl This file is free software; the Free Software Foundation
966dnl gives unlimited permission to copy and/or distribute it,
967dnl with or without modifications, as long as this notice is preserved.
968
969dnl From Bruno Haible.
970
971AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
972[
973 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
974 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
975 AC_REQUIRE([AC_LIB_RPATH])
976
977 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
978 dnl accordingly.
979 AC_LIB_LINKFLAGS_BODY([iconv])
980])
981
982AC_DEFUN([AM_ICONV_LINK],
983[
984 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
985 dnl those with the standalone portable GNU libiconv installed).
986
987 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
988 dnl accordingly.
989 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
990
991 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
992 dnl because if the user has installed libiconv and not disabled its use
993 dnl via --without-libiconv-prefix, he wants to use it. The first
994 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
995 am_save_CPPFLAGS="$CPPFLAGS"
996 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
997
998 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
999 am_cv_func_iconv="no, consider installing GNU libiconv"
1000 am_cv_lib_iconv=no
1001 AC_TRY_LINK([#include <stdlib.h>
1002#include <iconv.h>],
1003 [iconv_t cd = iconv_open("","");
1004 iconv(cd,NULL,NULL,NULL,NULL);
1005 iconv_close(cd);],
1006 am_cv_func_iconv=yes)
1007 if test "$am_cv_func_iconv" != yes; then
1008 am_save_LIBS="$LIBS"
1009 LIBS="$LIBS $LIBICONV"
1010 AC_TRY_LINK([#include <stdlib.h>
1011#include <iconv.h>],
1012 [iconv_t cd = iconv_open("","");
1013 iconv(cd,NULL,NULL,NULL,NULL);
1014 iconv_close(cd);],
1015 am_cv_lib_iconv=yes
1016 am_cv_func_iconv=yes)
1017 LIBS="$am_save_LIBS"
1018 fi
1019 ])
1020 if test "$am_cv_func_iconv" = yes; then
1021 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1022 fi
1023 if test "$am_cv_lib_iconv" = yes; then
1024 AC_MSG_CHECKING([how to link with libiconv])
1025 AC_MSG_RESULT([$LIBICONV])
1026 else
1027 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1028 dnl either.
1029 CPPFLAGS="$am_save_CPPFLAGS"
1030 LIBICONV=
1031 LTLIBICONV=
1032 fi
1033 AC_SUBST(LIBICONV)
1034 AC_SUBST(LTLIBICONV)
1035])
1036
1037AC_DEFUN([AM_ICONV],
1038[
1039 AM_ICONV_LINK
1040 if test "$am_cv_func_iconv" = yes; then
1041 AC_MSG_CHECKING([for iconv declaration])
1042 AC_CACHE_VAL(am_cv_proto_iconv, [
1043 AC_TRY_COMPILE([
1044#include <stdlib.h>
1045#include <iconv.h>
1046extern
1047#ifdef __cplusplus
1048"C"
1049#endif
1050#if defined(__STDC__) || defined(__cplusplus)
1051size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1052#else
1053size_t iconv();
1054#endif
1055], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1056 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);"])
1057 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1058 AC_MSG_RESULT([$]{ac_t:-
1059 }[$]am_cv_proto_iconv)
1060 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1061 [Define as const if the declaration of iconv() needs const.])
1062 fi
1063])
1064
1065
1066dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1067# serial 35 IT_PROG_INTLTOOL
1068AC_DEFUN([IT_PROG_INTLTOOL],
1069[AC_PREREQ([2.50])dnl
1070
1071case "$am__api_version" in
1072 1.[01234])
1073 AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
1074 ;;
1075 *)
1076 ;;
1077esac
1078
1079if test -n "$1"; then
1080 AC_MSG_CHECKING(for intltool >= $1)
1081
1082 INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1083 INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
1084 [INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in`
1085 ]
1086 AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1087 test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
1088 AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
1089fi
1090
1091 INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1092INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1093 INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1094 INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1095 INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
1096 INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1097 INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1098 INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1099INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1100 INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1101 INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1102 INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
1103 INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1104 INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1105 INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1106 INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1107 INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1108 INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1109
1110AC_SUBST(INTLTOOL_DESKTOP_RULE)
1111AC_SUBST(INTLTOOL_DIRECTORY_RULE)
1112AC_SUBST(INTLTOOL_KEYS_RULE)
1113AC_SUBST(INTLTOOL_PROP_RULE)
1114AC_SUBST(INTLTOOL_OAF_RULE)
1115AC_SUBST(INTLTOOL_PONG_RULE)
1116AC_SUBST(INTLTOOL_SERVER_RULE)
1117AC_SUBST(INTLTOOL_SHEET_RULE)
1118AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
1119AC_SUBST(INTLTOOL_UI_RULE)
1120AC_SUBST(INTLTOOL_XAM_RULE)
1121AC_SUBST(INTLTOOL_KBD_RULE)
1122AC_SUBST(INTLTOOL_XML_RULE)
1123AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
1124AC_SUBST(INTLTOOL_CAVES_RULE)
1125AC_SUBST(INTLTOOL_SCHEMAS_RULE)
1126AC_SUBST(INTLTOOL_THEME_RULE)
1127AC_SUBST(INTLTOOL_SERVICE_RULE)
1128
1129# Use the tools built into the package, not the ones that are installed.
1130AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
1131AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
1132AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
1133
1134AC_PATH_PROG(INTLTOOL_PERL, perl)
1135if test -z "$INTLTOOL_PERL"; then
1136 AC_MSG_ERROR([perl not found; required for intltool])
1137fi
1138if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
1139 AC_MSG_ERROR([perl 5.x required for intltool])
1140fi
1141if test "x$2" != "xno-xml"; then
1142 AC_MSG_CHECKING([for XML::Parser])
1143 if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
1144 AC_MSG_RESULT([ok])
1145 else
1146 AC_MSG_ERROR([XML::Parser perl module is required for intltool])
1147 fi
1148fi
1149
1150AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv)
1151AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
1152AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
1153AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
1154
1155# Substitute ALL_LINGUAS so we can use it in po/Makefile
1156AC_SUBST(ALL_LINGUAS)
1157
1158IT_PO_SUBDIR([po])
1159
1160dnl The following is very similar to
1161dnl
1162dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
1163dnl
1164dnl with the following slight differences:
1165dnl - the *.in files are in ac_aux_dir,
1166dnl - if the file haven't changed upon reconfigure, it's not touched,
1167dnl - the evaluation of the third parameter enables a hack which computes
1168dnl the actual value of $libdir,
1169dnl - the user sees "executing intltool commands", instead of
1170dnl "creating intltool-extract" and such.
1171dnl
1172dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
1173dnl a reason for it.
1174
1175AC_CONFIG_COMMANDS([intltool], [
1176
1177for file in intltool-extract intltool-merge intltool-update; do
1178 sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
1179 -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
1180 -e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
1181 -e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
1182 -e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
1183 -e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
1184 -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
1185 < ${ac_aux_dir}/${file}.in > ${file}.out
1186 if cmp -s ${file} ${file}.out 2>/dev/null; then
1187 rm -f ${file}.out
1188 else
1189 mv -f ${file}.out ${file}
1190 fi
1191 chmod ugo+x ${file}
1192 chmod u+w ${file}
1193done
1194
1195],
1196[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
1197prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
1198INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
1199INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
1200INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
1201
1202])
1203
1204
1205# IT_PO_SUBDIR(DIRNAME)
1206# ---------------------
1207# All po subdirs have to be declared with this macro; the subdir "po" is
1208# declared by IT_PROG_INTLTOOL.
1209#
1210AC_DEFUN([IT_PO_SUBDIR],
1211[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
1212dnl
1213dnl The following CONFIG_COMMANDS should be exetuted at the very end
1214dnl of config.status.
1215AC_CONFIG_COMMANDS_PRE([
1216 AC_CONFIG_COMMANDS([$1/stamp-it], [
1217 rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
1218 >"$1/stamp-it.tmp"
1219 [sed '/^#/d
1220 s/^[[].*] *//
1221 /^[ ]*$/d
1222 '"s|^| $ac_top_srcdir/|" \
1223 "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
1224 ]
1225 if test ! -f "$1/Makefile"; then
1226 AC_MSG_ERROR([$1/Makefile is not ready.])
1227 fi
1228 mv "$1/Makefile" "$1/Makefile.tmp"
1229 [sed '/^POTFILES =/,/[^\\]$/ {
1230 /^POTFILES =/!d
1231 r $1/POTFILES
1232 }
1233 ' "$1/Makefile.tmp" >"$1/Makefile"]
1234 rm -f "$1/Makefile.tmp"
1235 mv "$1/stamp-it.tmp" "$1/stamp-it"
1236 ])
1237])dnl
1238])
1239
1240
1241# deprecated macros
1242AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
1243# A hint is needed for aclocal from Automake <= 1.9.4:
1244# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1245
1246
1247# lib-ld.m4 serial 3 (gettext-0.13)
1248dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1249dnl This file is free software; the Free Software Foundation
1250dnl gives unlimited permission to copy and/or distribute it,
1251dnl with or without modifications, as long as this notice is preserved.
1252
1253dnl Subroutines of libtool.m4,
1254dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1255dnl with libtool.m4.
1256
1257dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1258AC_DEFUN([AC_LIB_PROG_LD_GNU],
1259[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1260[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1261case `$LD -v 2>&1 </dev/null` in
1262*GNU* | *'with BFD'*)
1263 acl_cv_prog_gnu_ld=yes ;;
1264*)
1265 acl_cv_prog_gnu_ld=no ;;
1266esac])
1267with_gnu_ld=$acl_cv_prog_gnu_ld
1268])
1269
1270dnl From libtool-1.4. Sets the variable LD.
1271AC_DEFUN([AC_LIB_PROG_LD],
1272[AC_ARG_WITH(gnu-ld,
1273[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1274test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1275AC_REQUIRE([AC_PROG_CC])dnl
1276AC_REQUIRE([AC_CANONICAL_HOST])dnl
1277# Prepare PATH_SEPARATOR.
1278# The user is always right.
1279if test "${PATH_SEPARATOR+set}" != set; then
1280 echo "#! /bin/sh" >conf$$.sh
1281 echo "exit 0" >>conf$$.sh
1282 chmod +x conf$$.sh
1283 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1284 PATH_SEPARATOR=';'
1285 else
1286 PATH_SEPARATOR=:
1287 fi
1288 rm -f conf$$.sh
1289fi
1290ac_prog=ld
1291if test "$GCC" = yes; then
1292 # Check if gcc -print-prog-name=ld gives a path.
1293 AC_MSG_CHECKING([for ld used by GCC])
1294 case $host in
1295 *-*-mingw*)
1296 # gcc leaves a trailing carriage return which upsets mingw
1297 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1298 *)
1299 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1300 esac
1301 case $ac_prog in
1302 # Accept absolute paths.
1303 [[\\/]* | [A-Za-z]:[\\/]*)]
1304 [re_direlt='/[^/][^/]*/\.\./']
1305 # Canonicalize the path of ld
1306 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1307 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1308 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1309 done
1310 test -z "$LD" && LD="$ac_prog"
1311 ;;
1312 "")
1313 # If it fails, then pretend we aren't using GCC.
1314 ac_prog=ld
1315 ;;
1316 *)
1317 # If it is relative, then search for the first ld in PATH.
1318 with_gnu_ld=unknown
1319 ;;
1320 esac
1321elif test "$with_gnu_ld" = yes; then
1322 AC_MSG_CHECKING([for GNU ld])
1323else
1324 AC_MSG_CHECKING([for non-GNU ld])
1325fi
1326AC_CACHE_VAL(acl_cv_path_LD,
1327[if test -z "$LD"; then
1328 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1329 for ac_dir in $PATH; do
1330 test -z "$ac_dir" && ac_dir=.
1331 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1332 acl_cv_path_LD="$ac_dir/$ac_prog"
1333 # Check to see if the program is GNU ld. I'd rather use --version,
1334 # but apparently some GNU ld's only accept -v.
1335 # Break only if it was the GNU/non-GNU ld that we prefer.
1336 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1337 *GNU* | *'with BFD'*)
1338 test "$with_gnu_ld" != no && break ;;
1339 *)
1340 test "$with_gnu_ld" != yes && break ;;
1341 esac
1342 fi
1343 done
1344 IFS="$ac_save_ifs"
1345else
1346 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1347fi])
1348LD="$acl_cv_path_LD"
1349if test -n "$LD"; then
1350 AC_MSG_RESULT($LD)
1351else
1352 AC_MSG_RESULT(no)
1353fi
1354test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1355AC_LIB_PROG_LD_GNU
1356])
1357
66c88ea4
HJYP
1358# lib-link.m4 serial 6 (gettext-0.14.3)
1359dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
a52c2257
HJYP
1360dnl This file is free software; the Free Software Foundation
1361dnl gives unlimited permission to copy and/or distribute it,
1362dnl with or without modifications, as long as this notice is preserved.
1363
1364dnl From Bruno Haible.
1365
1366AC_PREREQ(2.50)
1367
1368dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1369dnl the libraries corresponding to explicit and implicit dependencies.
1370dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1371dnl augments the CPPFLAGS variable.
1372AC_DEFUN([AC_LIB_LINKFLAGS],
1373[
1374 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1375 AC_REQUIRE([AC_LIB_RPATH])
1376 define([Name],[translit([$1],[./-], [___])])
1377 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1378 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1379 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1380 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1381 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1382 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1383 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1384 ])
1385 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1386 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1387 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1388 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1389 AC_SUBST([LIB]NAME)
1390 AC_SUBST([LTLIB]NAME)
1391 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1392 dnl results of this search when this library appears as a dependency.
1393 HAVE_LIB[]NAME=yes
1394 undefine([Name])
1395 undefine([NAME])
1396])
1397
1398dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1399dnl searches for libname and the libraries corresponding to explicit and
1400dnl implicit dependencies, together with the specified include files and
1401dnl the ability to compile and link the specified testcode. If found, it
1402dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1403dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1404dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1405dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1406AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1407[
1408 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1409 AC_REQUIRE([AC_LIB_RPATH])
1410 define([Name],[translit([$1],[./-], [___])])
1411 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1412 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1413
1414 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1415 dnl accordingly.
1416 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1417
1418 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1419 dnl because if the user has installed lib[]Name and not disabled its use
1420 dnl via --without-lib[]Name-prefix, he wants to use it.
1421 ac_save_CPPFLAGS="$CPPFLAGS"
1422 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1423
1424 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1425 ac_save_LIBS="$LIBS"
1426 LIBS="$LIBS $LIB[]NAME"
1427 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1428 LIBS="$ac_save_LIBS"
1429 ])
1430 if test "$ac_cv_lib[]Name" = yes; then
1431 HAVE_LIB[]NAME=yes
1432 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1433 AC_MSG_CHECKING([how to link with lib[]$1])
1434 AC_MSG_RESULT([$LIB[]NAME])
1435 else
1436 HAVE_LIB[]NAME=no
1437 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1438 dnl $INC[]NAME either.
1439 CPPFLAGS="$ac_save_CPPFLAGS"
1440 LIB[]NAME=
1441 LTLIB[]NAME=
1442 fi
1443 AC_SUBST([HAVE_LIB]NAME)
1444 AC_SUBST([LIB]NAME)
1445 AC_SUBST([LTLIB]NAME)
1446 undefine([Name])
1447 undefine([NAME])
1448])
1449
1450dnl Determine the platform dependent parameters needed to use rpath:
1451dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1452dnl hardcode_direct, hardcode_minus_L.
1453AC_DEFUN([AC_LIB_RPATH],
1454[
1455 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
1456 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1457 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1458 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1459 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1460 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1461 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1462 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1463 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1464 . ./conftest.sh
1465 rm -f ./conftest.sh
1466 acl_cv_rpath=done
1467 ])
1468 wl="$acl_cv_wl"
1469 libext="$acl_cv_libext"
1470 shlibext="$acl_cv_shlibext"
1471 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1472 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1473 hardcode_direct="$acl_cv_hardcode_direct"
1474 hardcode_minus_L="$acl_cv_hardcode_minus_L"
1475 dnl Determine whether the user wants rpath handling at all.
1476 AC_ARG_ENABLE(rpath,
1477 [ --disable-rpath do not hardcode runtime library paths],
1478 :, enable_rpath=yes)
1479])
1480
1481dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1482dnl the libraries corresponding to explicit and implicit dependencies.
1483dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1484AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1485[
a52c2257
HJYP
1486 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1487 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1488 dnl By default, look in $includedir and $libdir.
1489 use_additional=yes
1490 AC_LIB_WITH_FINAL_PREFIX([
1491 eval additional_includedir=\"$includedir\"
1492 eval additional_libdir=\"$libdir\"
1493 ])
1494 AC_LIB_ARG_WITH([lib$1-prefix],
1495[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1496 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1497[
1498 if test "X$withval" = "Xno"; then
1499 use_additional=no
1500 else
1501 if test "X$withval" = "X"; then
1502 AC_LIB_WITH_FINAL_PREFIX([
1503 eval additional_includedir=\"$includedir\"
1504 eval additional_libdir=\"$libdir\"
1505 ])
1506 else
1507 additional_includedir="$withval/include"
66c88ea4 1508 additional_libdir="$withval/lib"
a52c2257
HJYP
1509 fi
1510 fi
1511])
1512 dnl Search the library and its dependencies in $additional_libdir and
1513 dnl $LDFLAGS. Using breadth-first-seach.
1514 LIB[]NAME=
1515 LTLIB[]NAME=
1516 INC[]NAME=
1517 rpathdirs=
1518 ltrpathdirs=
1519 names_already_handled=
1520 names_next_round='$1 $2'
1521 while test -n "$names_next_round"; do
1522 names_this_round="$names_next_round"
1523 names_next_round=
1524 for name in $names_this_round; do
1525 already_handled=
1526 for n in $names_already_handled; do
1527 if test "$n" = "$name"; then
1528 already_handled=yes
1529 break
1530 fi
1531 done
1532 if test -z "$already_handled"; then
1533 names_already_handled="$names_already_handled $name"
1534 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1535 dnl or AC_LIB_HAVE_LINKFLAGS call.
1536 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1537 eval value=\"\$HAVE_LIB$uppername\"
1538 if test -n "$value"; then
1539 if test "$value" = yes; then
1540 eval value=\"\$LIB$uppername\"
1541 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1542 eval value=\"\$LTLIB$uppername\"
1543 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1544 else
1545 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1546 dnl that this library doesn't exist. So just drop it.
1547 :
1548 fi
1549 else
1550 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1551 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1552 found_dir=
1553 found_la=
1554 found_so=
1555 found_a=
1556 if test $use_additional = yes; then
1557 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1558 found_dir="$additional_libdir"
1559 found_so="$additional_libdir/lib$name.$shlibext"
1560 if test -f "$additional_libdir/lib$name.la"; then
1561 found_la="$additional_libdir/lib$name.la"
1562 fi
1563 else
1564 if test -f "$additional_libdir/lib$name.$libext"; then
1565 found_dir="$additional_libdir"
1566 found_a="$additional_libdir/lib$name.$libext"
1567 if test -f "$additional_libdir/lib$name.la"; then
1568 found_la="$additional_libdir/lib$name.la"
1569 fi
1570 fi
1571 fi
1572 fi
1573 if test "X$found_dir" = "X"; then
1574 for x in $LDFLAGS $LTLIB[]NAME; do
1575 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1576 case "$x" in
1577 -L*)
1578 dir=`echo "X$x" | sed -e 's/^X-L//'`
1579 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1580 found_dir="$dir"
1581 found_so="$dir/lib$name.$shlibext"
1582 if test -f "$dir/lib$name.la"; then
1583 found_la="$dir/lib$name.la"
1584 fi
1585 else
1586 if test -f "$dir/lib$name.$libext"; then
1587 found_dir="$dir"
1588 found_a="$dir/lib$name.$libext"
1589 if test -f "$dir/lib$name.la"; then
1590 found_la="$dir/lib$name.la"
1591 fi
1592 fi
1593 fi
1594 ;;
1595 esac
1596 if test "X$found_dir" != "X"; then
1597 break
1598 fi
1599 done
1600 fi
1601 if test "X$found_dir" != "X"; then
1602 dnl Found the library.
1603 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1604 if test "X$found_so" != "X"; then
1605 dnl Linking with a shared library. We attempt to hardcode its
1606 dnl directory into the executable's runpath, unless it's the
1607 dnl standard /usr/lib.
66c88ea4 1608 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
a52c2257
HJYP
1609 dnl No hardcoding is needed.
1610 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1611 else
1612 dnl Use an explicit option to hardcode DIR into the resulting
1613 dnl binary.
1614 dnl Potentially add DIR to ltrpathdirs.
1615 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1616 haveit=
1617 for x in $ltrpathdirs; do
1618 if test "X$x" = "X$found_dir"; then
1619 haveit=yes
1620 break
1621 fi
1622 done
1623 if test -z "$haveit"; then
1624 ltrpathdirs="$ltrpathdirs $found_dir"
1625 fi
1626 dnl The hardcoding into $LIBNAME is system dependent.
1627 if test "$hardcode_direct" = yes; then
1628 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1629 dnl resulting binary.
1630 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1631 else
1632 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1633 dnl Use an explicit option to hardcode DIR into the resulting
1634 dnl binary.
1635 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1636 dnl Potentially add DIR to rpathdirs.
1637 dnl The rpathdirs will be appended to $LIBNAME at the end.
1638 haveit=
1639 for x in $rpathdirs; do
1640 if test "X$x" = "X$found_dir"; then
1641 haveit=yes
1642 break
1643 fi
1644 done
1645 if test -z "$haveit"; then
1646 rpathdirs="$rpathdirs $found_dir"
1647 fi
1648 else
1649 dnl Rely on "-L$found_dir".
1650 dnl But don't add it if it's already contained in the LDFLAGS
1651 dnl or the already constructed $LIBNAME
1652 haveit=
1653 for x in $LDFLAGS $LIB[]NAME; do
1654 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1655 if test "X$x" = "X-L$found_dir"; then
1656 haveit=yes
1657 break
1658 fi
1659 done
1660 if test -z "$haveit"; then
1661 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1662 fi
1663 if test "$hardcode_minus_L" != no; then
1664 dnl FIXME: Not sure whether we should use
1665 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1666 dnl here.
1667 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1668 else
1669 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1670 dnl here, because this doesn't fit in flags passed to the
1671 dnl compiler. So give up. No hardcoding. This affects only
1672 dnl very old systems.
1673 dnl FIXME: Not sure whether we should use
1674 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1675 dnl here.
1676 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1677 fi
1678 fi
1679 fi
1680 fi
1681 else
1682 if test "X$found_a" != "X"; then
1683 dnl Linking with a static library.
1684 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1685 else
1686 dnl We shouldn't come here, but anyway it's good to have a
1687 dnl fallback.
1688 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1689 fi
1690 fi
1691 dnl Assume the include files are nearby.
1692 additional_includedir=
1693 case "$found_dir" in
66c88ea4
HJYP
1694 */lib | */lib/)
1695 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
a52c2257
HJYP
1696 additional_includedir="$basedir/include"
1697 ;;
1698 esac
1699 if test "X$additional_includedir" != "X"; then
1700 dnl Potentially add $additional_includedir to $INCNAME.
1701 dnl But don't add it
1702 dnl 1. if it's the standard /usr/include,
1703 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1704 dnl 3. if it's already present in $CPPFLAGS or the already
1705 dnl constructed $INCNAME,
1706 dnl 4. if it doesn't exist as a directory.
1707 if test "X$additional_includedir" != "X/usr/include"; then
1708 haveit=
1709 if test "X$additional_includedir" = "X/usr/local/include"; then
1710 if test -n "$GCC"; then
1711 case $host_os in
1712 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1713 esac
1714 fi
1715 fi
1716 if test -z "$haveit"; then
1717 for x in $CPPFLAGS $INC[]NAME; do
1718 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1719 if test "X$x" = "X-I$additional_includedir"; then
1720 haveit=yes
1721 break
1722 fi
1723 done
1724 if test -z "$haveit"; then
1725 if test -d "$additional_includedir"; then
1726 dnl Really add $additional_includedir to $INCNAME.
1727 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1728 fi
1729 fi
1730 fi
1731 fi
1732 fi
1733 dnl Look for dependencies.
1734 if test -n "$found_la"; then
1735 dnl Read the .la file. It defines the variables
1736 dnl dlname, library_names, old_library, dependency_libs, current,
1737 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1738 save_libdir="$libdir"
1739 case "$found_la" in
1740 */* | *\\*) . "$found_la" ;;
1741 *) . "./$found_la" ;;
1742 esac
1743 libdir="$save_libdir"
1744 dnl We use only dependency_libs.
1745 for dep in $dependency_libs; do
1746 case "$dep" in
1747 -L*)
1748 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1749 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1750 dnl But don't add it
1751 dnl 1. if it's the standard /usr/lib,
1752 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1753 dnl 3. if it's already present in $LDFLAGS or the already
1754 dnl constructed $LIBNAME,
1755 dnl 4. if it doesn't exist as a directory.
66c88ea4 1756 if test "X$additional_libdir" != "X/usr/lib"; then
a52c2257 1757 haveit=
66c88ea4 1758 if test "X$additional_libdir" = "X/usr/local/lib"; then
a52c2257
HJYP
1759 if test -n "$GCC"; then
1760 case $host_os in
1761 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1762 esac
1763 fi
1764 fi
1765 if test -z "$haveit"; then
1766 haveit=
1767 for x in $LDFLAGS $LIB[]NAME; do
1768 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1769 if test "X$x" = "X-L$additional_libdir"; then
1770 haveit=yes
1771 break
1772 fi
1773 done
1774 if test -z "$haveit"; then
1775 if test -d "$additional_libdir"; then
1776 dnl Really add $additional_libdir to $LIBNAME.
1777 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1778 fi
1779 fi
1780 haveit=
1781 for x in $LDFLAGS $LTLIB[]NAME; do
1782 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1783 if test "X$x" = "X-L$additional_libdir"; then
1784 haveit=yes
1785 break
1786 fi
1787 done
1788 if test -z "$haveit"; then
1789 if test -d "$additional_libdir"; then
1790 dnl Really add $additional_libdir to $LTLIBNAME.
1791 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1792 fi
1793 fi
1794 fi
1795 fi
1796 ;;
1797 -R*)
1798 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1799 if test "$enable_rpath" != no; then
1800 dnl Potentially add DIR to rpathdirs.
1801 dnl The rpathdirs will be appended to $LIBNAME at the end.
1802 haveit=
1803 for x in $rpathdirs; do
1804 if test "X$x" = "X$dir"; then
1805 haveit=yes
1806 break
1807 fi
1808 done
1809 if test -z "$haveit"; then
1810 rpathdirs="$rpathdirs $dir"
1811 fi
1812 dnl Potentially add DIR to ltrpathdirs.
1813 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1814 haveit=
1815 for x in $ltrpathdirs; do
1816 if test "X$x" = "X$dir"; then
1817 haveit=yes
1818 break
1819 fi
1820 done
1821 if test -z "$haveit"; then
1822 ltrpathdirs="$ltrpathdirs $dir"
1823 fi
1824 fi
1825 ;;
1826 -l*)
1827 dnl Handle this in the next round.
1828 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1829 ;;
1830 *.la)
1831 dnl Handle this in the next round. Throw away the .la's
1832 dnl directory; it is already contained in a preceding -L
1833 dnl option.
1834 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1835 ;;
1836 *)
1837 dnl Most likely an immediate library name.
1838 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1839 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1840 ;;
1841 esac
1842 done
1843 fi
1844 else
1845 dnl Didn't find the library; assume it is in the system directories
1846 dnl known to the linker and runtime loader. (All the system
1847 dnl directories known to the linker should also be known to the
1848 dnl runtime loader, otherwise the system is severely misconfigured.)
1849 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1850 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1851 fi
1852 fi
1853 fi
1854 done
1855 done
1856 if test "X$rpathdirs" != "X"; then
1857 if test -n "$hardcode_libdir_separator"; then
1858 dnl Weird platform: only the last -rpath option counts, the user must
1859 dnl pass all path elements in one option. We can arrange that for a
1860 dnl single library, but not when more than one $LIBNAMEs are used.
1861 alldirs=
1862 for found_dir in $rpathdirs; do
1863 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1864 done
1865 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1866 acl_save_libdir="$libdir"
1867 libdir="$alldirs"
1868 eval flag=\"$hardcode_libdir_flag_spec\"
1869 libdir="$acl_save_libdir"
1870 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1871 else
1872 dnl The -rpath options are cumulative.
1873 for found_dir in $rpathdirs; do
1874 acl_save_libdir="$libdir"
1875 libdir="$found_dir"
1876 eval flag=\"$hardcode_libdir_flag_spec\"
1877 libdir="$acl_save_libdir"
1878 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1879 done
1880 fi
1881 fi
1882 if test "X$ltrpathdirs" != "X"; then
1883 dnl When using libtool, the option that works for both libraries and
1884 dnl executables is -R. The -R options are cumulative.
1885 for found_dir in $ltrpathdirs; do
1886 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1887 done
1888 fi
1889])
1890
1891dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1892dnl unless already present in VAR.
1893dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1894dnl contains two or three consecutive elements that belong together.
1895AC_DEFUN([AC_LIB_APPENDTOVAR],
1896[
1897 for element in [$2]; do
1898 haveit=
1899 for x in $[$1]; do
1900 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1901 if test "X$x" = "X$element"; then
1902 haveit=yes
1903 break
1904 fi
1905 done
1906 if test -z "$haveit"; then
1907 [$1]="${[$1]}${[$1]:+ }$element"
1908 fi
1909 done
1910])
1911
66c88ea4 1912# lib-prefix.m4 serial 4 (gettext-0.14.2)
a52c2257
HJYP
1913dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1914dnl This file is free software; the Free Software Foundation
1915dnl gives unlimited permission to copy and/or distribute it,
1916dnl with or without modifications, as long as this notice is preserved.
1917
1918dnl From Bruno Haible.
1919
1920dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1921dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1922dnl require excessive bracketing.
1923ifdef([AC_HELP_STRING],
1924[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1925[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1926
1927dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1928dnl to access previously installed libraries. The basic assumption is that
1929dnl a user will want packages to use other packages he previously installed
1930dnl with the same --prefix option.
1931dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1932dnl libraries, but is otherwise very convenient.
1933AC_DEFUN([AC_LIB_PREFIX],
1934[
1935 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1936 AC_REQUIRE([AC_PROG_CC])
1937 AC_REQUIRE([AC_CANONICAL_HOST])
a52c2257
HJYP
1938 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1939 dnl By default, look in $includedir and $libdir.
1940 use_additional=yes
1941 AC_LIB_WITH_FINAL_PREFIX([
1942 eval additional_includedir=\"$includedir\"
1943 eval additional_libdir=\"$libdir\"
1944 ])
1945 AC_LIB_ARG_WITH([lib-prefix],
1946[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1947 --without-lib-prefix don't search for libraries in includedir and libdir],
1948[
1949 if test "X$withval" = "Xno"; then
1950 use_additional=no
1951 else
1952 if test "X$withval" = "X"; then
1953 AC_LIB_WITH_FINAL_PREFIX([
1954 eval additional_includedir=\"$includedir\"
1955 eval additional_libdir=\"$libdir\"
1956 ])
1957 else
1958 additional_includedir="$withval/include"
66c88ea4 1959 additional_libdir="$withval/lib"
a52c2257
HJYP
1960 fi
1961 fi
1962])
1963 if test $use_additional = yes; then
1964 dnl Potentially add $additional_includedir to $CPPFLAGS.
1965 dnl But don't add it
1966 dnl 1. if it's the standard /usr/include,
1967 dnl 2. if it's already present in $CPPFLAGS,
1968 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1969 dnl 4. if it doesn't exist as a directory.
1970 if test "X$additional_includedir" != "X/usr/include"; then
1971 haveit=
1972 for x in $CPPFLAGS; do
1973 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1974 if test "X$x" = "X-I$additional_includedir"; then
1975 haveit=yes
1976 break
1977 fi
1978 done
1979 if test -z "$haveit"; then
1980 if test "X$additional_includedir" = "X/usr/local/include"; then
1981 if test -n "$GCC"; then
1982 case $host_os in
1983 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1984 esac
1985 fi
1986 fi
1987 if test -z "$haveit"; then
1988 if test -d "$additional_includedir"; then
1989 dnl Really add $additional_includedir to $CPPFLAGS.
1990 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1991 fi
1992 fi
1993 fi
1994 fi
1995 dnl Potentially add $additional_libdir to $LDFLAGS.
1996 dnl But don't add it
1997 dnl 1. if it's the standard /usr/lib,
1998 dnl 2. if it's already present in $LDFLAGS,
1999 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
2000 dnl 4. if it doesn't exist as a directory.
66c88ea4 2001 if test "X$additional_libdir" != "X/usr/lib"; then
a52c2257
HJYP
2002 haveit=
2003 for x in $LDFLAGS; do
2004 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2005 if test "X$x" = "X-L$additional_libdir"; then
2006 haveit=yes
2007 break
2008 fi
2009 done
2010 if test -z "$haveit"; then
66c88ea4 2011 if test "X$additional_libdir" = "X/usr/local/lib"; then
a52c2257
HJYP
2012 if test -n "$GCC"; then
2013 case $host_os in
2014 linux*) haveit=yes;;
2015 esac
2016 fi
2017 fi
2018 if test -z "$haveit"; then
2019 if test -d "$additional_libdir"; then
2020 dnl Really add $additional_libdir to $LDFLAGS.
2021 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2022 fi
2023 fi
2024 fi
2025 fi
2026 fi
2027])
2028
2029dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2030dnl acl_final_exec_prefix, containing the values to which $prefix and
2031dnl $exec_prefix will expand at the end of the configure script.
2032AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2033[
2034 dnl Unfortunately, prefix and exec_prefix get only finally determined
2035 dnl at the end of configure.
2036 if test "X$prefix" = "XNONE"; then
2037 acl_final_prefix="$ac_default_prefix"
2038 else
2039 acl_final_prefix="$prefix"
2040 fi
2041 if test "X$exec_prefix" = "XNONE"; then
2042 acl_final_exec_prefix='${prefix}'
2043 else
2044 acl_final_exec_prefix="$exec_prefix"
2045 fi
2046 acl_save_prefix="$prefix"
2047 prefix="$acl_final_prefix"
2048 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2049 prefix="$acl_save_prefix"
2050])
2051
2052dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2053dnl variables prefix and exec_prefix bound to the values they will have
2054dnl at the end of the configure script.
2055AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2056[
2057 acl_save_prefix="$prefix"
2058 prefix="$acl_final_prefix"
2059 acl_save_exec_prefix="$exec_prefix"
2060 exec_prefix="$acl_final_exec_prefix"
2061 $1
2062 exec_prefix="$acl_save_exec_prefix"
2063 prefix="$acl_save_prefix"
2064])
2065
66c88ea4
HJYP
2066# nls.m4 serial 2 (gettext-0.14.3)
2067dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc.
a52c2257
HJYP
2068dnl This file is free software; the Free Software Foundation
2069dnl gives unlimited permission to copy and/or distribute it,
2070dnl with or without modifications, as long as this notice is preserved.
2071dnl
2072dnl This file can can be used in projects which are not available under
2073dnl the GNU General Public License or the GNU Library General Public
2074dnl License but which still want to provide support for the GNU gettext
2075dnl functionality.
2076dnl Please note that the actual code of the GNU gettext library is covered
2077dnl by the GNU Library General Public License, and the rest of the GNU
2078dnl gettext package package is covered by the GNU General Public License.
2079dnl They are *not* in the public domain.
2080
2081dnl Authors:
2082dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2083dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2084
2085AC_PREREQ(2.50)
2086
2087AC_DEFUN([AM_NLS],
2088[
2089 AC_MSG_CHECKING([whether NLS is requested])
2090 dnl Default is enabled NLS
2091 AC_ARG_ENABLE(nls,
2092 [ --disable-nls do not use Native Language Support],
2093 USE_NLS=$enableval, USE_NLS=yes)
2094 AC_MSG_RESULT($USE_NLS)
2095 AC_SUBST(USE_NLS)
2096])
2097
66c88ea4
HJYP
2098AC_DEFUN([AM_MKINSTALLDIRS],
2099[
2100 dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing.
2101 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])])
2102 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2103 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
2104 dnl Try to locate it.
2105 MKINSTALLDIRS=
2106 if test -n "$ac_aux_dir"; then
2107 case "$ac_aux_dir" in
2108 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
2109 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
2110 esac
2111 fi
2112 if test -z "$MKINSTALLDIRS"; then
2113 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
2114 fi
2115 AC_SUBST(MKINSTALLDIRS)
2116])
2117
a52c2257
HJYP
2118# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2119#
2120# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2121#
2122# This program is free software; you can redistribute it and/or modify
2123# it under the terms of the GNU General Public License as published by
2124# the Free Software Foundation; either version 2 of the License, or
2125# (at your option) any later version.
2126#
2127# This program is distributed in the hope that it will be useful, but
2128# WITHOUT ANY WARRANTY; without even the implied warranty of
2129# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2130# General Public License for more details.
2131#
2132# You should have received a copy of the GNU General Public License
2133# along with this program; if not, write to the Free Software
2134# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2135#
2136# As a special exception to the GNU General Public License, if you
2137# distribute this file as part of a program that contains a
2138# configuration script generated by Autoconf, you may include it under
2139# the same distribution terms that you use for the rest of that program.
2140
2141# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2142# ----------------------------------
2143AC_DEFUN([PKG_PROG_PKG_CONFIG],
2144[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2145m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2146AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2147if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2148 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2149fi
2150if test -n "$PKG_CONFIG"; then
2151 _pkg_min_version=m4_default([$1], [0.9.0])
2152 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2153 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2154 AC_MSG_RESULT([yes])
2155 else
2156 AC_MSG_RESULT([no])
2157 PKG_CONFIG=""
2158 fi
2159
2160fi[]dnl
2161])# PKG_PROG_PKG_CONFIG
2162
2163# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2164#
2165# Check to see whether a particular set of modules exists. Similar
2166# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2167#
2168#
2169# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2170# this or PKG_CHECK_MODULES is called, or make sure to call
2171# PKG_CHECK_EXISTS manually
2172# --------------------------------------------------------------
2173AC_DEFUN([PKG_CHECK_EXISTS],
2174[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2175if test -n "$PKG_CONFIG" && \
2176 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2177 m4_ifval([$2], [$2], [:])
2178m4_ifvaln([$3], [else
2179 $3])dnl
2180fi])
2181
2182
2183# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2184# ---------------------------------------------
2185m4_define([_PKG_CONFIG],
2186[if test -n "$PKG_CONFIG"; then
2187 if test -n "$$1"; then
2188 pkg_cv_[]$1="$$1"
2189 else
2190 PKG_CHECK_EXISTS([$3],
2191 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2192 [pkg_failed=yes])
2193 fi
2194else
2195 pkg_failed=untried
2196fi[]dnl
2197])# _PKG_CONFIG
2198
2199# _PKG_SHORT_ERRORS_SUPPORTED
2200# -----------------------------
2201AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2202[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2203if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2204 _pkg_short_errors_supported=yes
2205else
2206 _pkg_short_errors_supported=no
2207fi[]dnl
2208])# _PKG_SHORT_ERRORS_SUPPORTED
2209
2210
2211# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2212# [ACTION-IF-NOT-FOUND])
2213#
2214#
2215# Note that if there is a possibility the first call to
2216# PKG_CHECK_MODULES might not happen, you should be sure to include an
2217# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2218#
2219#
2220# --------------------------------------------------------------
2221AC_DEFUN([PKG_CHECK_MODULES],
2222[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2223AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2224AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2225
2226pkg_failed=no
2227AC_MSG_CHECKING([for $1])
2228
2229_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2230_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2231
2232m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2233and $1[]_LIBS to avoid the need to call pkg-config.
2234See the pkg-config man page for more details.])
2235
2236if test $pkg_failed = yes; then
2237 _PKG_SHORT_ERRORS_SUPPORTED
2238 if test $_pkg_short_errors_supported = yes; then
2239 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
2240 else
2241 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
2242 fi
2243 # Put the nasty error message in config.log where it belongs
2244 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2245
2246 ifelse([$4], , [AC_MSG_ERROR(dnl
2247[Package requirements ($2) were not met:
2248
2249$$1_PKG_ERRORS
2250
2251Consider adjusting the PKG_CONFIG_PATH environment variable if you
2252installed software in a non-standard prefix.
2253
2254_PKG_TEXT
2255])],
66c88ea4 2256 [$4])
a52c2257
HJYP
2257elif test $pkg_failed = untried; then
2258 ifelse([$4], , [AC_MSG_FAILURE(dnl
2259[The pkg-config script could not be found or is too old. Make sure it
2260is in your PATH or set the PKG_CONFIG environment variable to the full
2261path to pkg-config.
2262
2263_PKG_TEXT
2264
2265To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
2266 [$4])
2267else
2268 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2269 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2270 AC_MSG_RESULT([yes])
2271 ifelse([$3], , :, [$3])
2272fi[]dnl
2273])# PKG_CHECK_MODULES
2274
66c88ea4
HJYP
2275# po.m4 serial 7 (gettext-0.14.3)
2276dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
a52c2257
HJYP
2277dnl This file is free software; the Free Software Foundation
2278dnl gives unlimited permission to copy and/or distribute it,
2279dnl with or without modifications, as long as this notice is preserved.
2280dnl
2281dnl This file can can be used in projects which are not available under
2282dnl the GNU General Public License or the GNU Library General Public
2283dnl License but which still want to provide support for the GNU gettext
2284dnl functionality.
2285dnl Please note that the actual code of the GNU gettext library is covered
2286dnl by the GNU Library General Public License, and the rest of the GNU
2287dnl gettext package package is covered by the GNU General Public License.
2288dnl They are *not* in the public domain.
2289
2290dnl Authors:
2291dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2292dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2293
2294AC_PREREQ(2.50)
2295
2296dnl Checks for all prerequisites of the po subdirectory.
2297AC_DEFUN([AM_PO_SUBDIRS],
2298[
2299 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2300 AC_REQUIRE([AC_PROG_INSTALL])dnl
66c88ea4 2301 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
a52c2257
HJYP
2302 AC_REQUIRE([AM_NLS])dnl
2303
2304 dnl Perform the following tests also if --disable-nls has been given,
2305 dnl because they are needed for "make dist" to work.
2306
2307 dnl Search for GNU msgfmt in the PATH.
2308 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2309 dnl The second test excludes FreeBSD msgfmt.
2310 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2311 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2312 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2313 :)
2314 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2315
a52c2257
HJYP
2316 dnl Search for GNU xgettext 0.12 or newer in the PATH.
2317 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2318 dnl The second test excludes FreeBSD xgettext.
2319 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2320 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2321 (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)],
2322 :)
2323 dnl Remove leftover from FreeBSD xgettext call.
2324 rm -f messages.po
2325
a52c2257
HJYP
2326 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2327 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2328 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2329
66c88ea4
HJYP
2330 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
2331 dnl Test whether we really found GNU msgfmt.
2332 if test "$GMSGFMT" != ":"; then
2333 dnl If it is no GNU msgfmt we define it as : so that the
2334 dnl Makefiles still can work.
2335 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
2336 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
2337 : ;
2338 else
2339 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
2340 AC_MSG_RESULT(
2341 [found $GMSGFMT program is not GNU msgfmt; ignore it])
2342 GMSGFMT=":"
2343 fi
2344 fi
2345
2346 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
2347 dnl Test whether we really found GNU xgettext.
2348 if test "$XGETTEXT" != ":"; then
2349 dnl If it is no GNU xgettext we define it as : so that the
2350 dnl Makefiles still can work.
2351 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
2352 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
2353 : ;
2354 else
2355 AC_MSG_RESULT(
2356 [found xgettext program is not GNU xgettext; ignore it])
2357 XGETTEXT=":"
2358 fi
2359 dnl Remove leftover from FreeBSD xgettext call.
2360 rm -f messages.po
2361 fi
a52c2257 2362
66c88ea4 2363 AC_OUTPUT_COMMANDS([
a52c2257
HJYP
2364 for ac_file in $CONFIG_FILES; do
2365 # Support "outfile[:infile[:infile...]]"
2366 case "$ac_file" in
2367 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2368 esac
2369 # PO directories have a Makefile.in generated from Makefile.in.in.
2370 case "$ac_file" in */Makefile.in)
2371 # Adjust a relative srcdir.
2372 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2373 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2374 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2375 # In autoconf-2.13 it is called $ac_given_srcdir.
2376 # In autoconf-2.50 it is called $srcdir.
2377 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2378 case "$ac_given_srcdir" in
2379 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2380 /*) top_srcdir="$ac_given_srcdir" ;;
2381 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2382 esac
2383 # Treat a directory as a PO directory if and only if it has a
2384 # POTFILES.in file. This allows packages to have multiple PO
2385 # directories under different names or in different locations.
2386 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2387 rm -f "$ac_dir/POTFILES"
2388 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2389 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2390 POMAKEFILEDEPS="POTFILES.in"
2391 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2392 # on $ac_dir but don't depend on user-specified configuration
2393 # parameters.
2394 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2395 # The LINGUAS file contains the set of available languages.
2396 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2397 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2398 fi
2399 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
66c88ea4 2400 # Hide the ALL_LINGUAS assigment from automake.
a52c2257
HJYP
2401 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2402 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2403 else
2404 # The set of available languages was given in configure.in.
a52c2257
HJYP
2405 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2406 fi
2407 # Compute POFILES
2408 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2409 # Compute UPDATEPOFILES
2410 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2411 # Compute DUMMYPOFILES
2412 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2413 # Compute GMOFILES
2414 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2415 case "$ac_given_srcdir" in
2416 .) srcdirpre= ;;
2417 *) srcdirpre='$(srcdir)/' ;;
2418 esac
2419 POFILES=
2420 UPDATEPOFILES=
2421 DUMMYPOFILES=
2422 GMOFILES=
2423 for lang in $ALL_LINGUAS; do
2424 POFILES="$POFILES $srcdirpre$lang.po"
2425 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2426 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2427 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2428 done
2429 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2430 # environment variable.
2431 INST_LINGUAS=
2432 if test -n "$ALL_LINGUAS"; then
2433 for presentlang in $ALL_LINGUAS; do
2434 useit=no
2435 if test "%UNSET%" != "$LINGUAS"; then
2436 desiredlanguages="$LINGUAS"
2437 else
2438 desiredlanguages="$ALL_LINGUAS"
2439 fi
2440 for desiredlang in $desiredlanguages; do
2441 # Use the presentlang catalog if desiredlang is
2442 # a. equal to presentlang, or
2443 # b. a variant of presentlang (because in this case,
2444 # presentlang can be used as a fallback for messages
2445 # which are not translated in the desiredlang catalog).
2446 case "$desiredlang" in
2447 "$presentlang"*) useit=yes;;
2448 esac
2449 done
2450 if test $useit = yes; then
2451 INST_LINGUAS="$INST_LINGUAS $presentlang"
2452 fi
2453 done
2454 fi
2455 CATALOGS=
2456 if test -n "$INST_LINGUAS"; then
2457 for lang in $INST_LINGUAS; do
2458 CATALOGS="$CATALOGS $lang.gmo"
2459 done
2460 fi
2461 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2462 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"
2463 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2464 if test -f "$f"; then
2465 case "$f" in
2466 *.orig | *.bak | *~) ;;
2467 *) cat "$f" >> "$ac_dir/Makefile" ;;
2468 esac
2469 fi
2470 done
2471 fi
2472 ;;
2473 esac
66c88ea4 2474 done],
a52c2257
HJYP
2475 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2476 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
66c88ea4 2477 # from automake.
a52c2257
HJYP
2478 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2479 # Capture the value of LINGUAS because we need it to compute CATALOGS.
2480 LINGUAS="${LINGUAS-%UNSET%}"
2481 ])
2482])
2483
2484dnl Postprocesses a Makefile in a directory containing PO files.
2485AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2486[
2487 # When this code is run, in config.status, two variables have already been
2488 # set:
2489 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2490 # - LINGUAS is the value of the environment variable LINGUAS at configure
2491 # time.
2492
2493changequote(,)dnl
2494 # Adjust a relative srcdir.
2495 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2496 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2497 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2498 # In autoconf-2.13 it is called $ac_given_srcdir.
2499 # In autoconf-2.50 it is called $srcdir.
2500 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2501 case "$ac_given_srcdir" in
2502 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2503 /*) top_srcdir="$ac_given_srcdir" ;;
2504 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2505 esac
2506
2507 # Find a way to echo strings without interpreting backslash.
2508 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2509 gt_echo='echo'
2510 else
2511 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2512 gt_echo='printf %s\n'
2513 else
2514 echo_func () {
2515 cat <<EOT
2516$*
2517EOT
2518 }
2519 gt_echo='echo_func'
2520 fi
2521 fi
2522
2523 # A sed script that extracts the value of VARIABLE from a Makefile.
2524 sed_x_variable='
2525# Test if the hold space is empty.
2526x
2527s/P/P/
2528x
2529ta
2530# Yes it was empty. Look if we have the expected variable definition.
2531/^[ ]*VARIABLE[ ]*=/{
2532 # Seen the first line of the variable definition.
2533 s/^[ ]*VARIABLE[ ]*=//
2534 ba
2535}
2536bd
2537:a
2538# Here we are processing a line from the variable definition.
2539# Remove comment, more precisely replace it with a space.
2540s/#.*$/ /
2541# See if the line ends in a backslash.
2542tb
2543:b
2544s/\\$//
2545# Print the line, without the trailing backslash.
2546p
2547tc
2548# There was no trailing backslash. The end of the variable definition is
2549# reached. Clear the hold space.
2550s/^.*$//
2551x
2552bd
2553:c
2554# A trailing backslash means that the variable definition continues in the
2555# next line. Put a nonempty string into the hold space to indicate this.
2556s/^.*$/P/
2557x
2558:d
2559'
2560changequote([,])dnl
2561
2562 # Set POTFILES to the value of the Makefile variable POTFILES.
66c88ea4 2563 sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
a52c2257
HJYP
2564 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2565 # Compute POTFILES_DEPS as
2566 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2567 POTFILES_DEPS=
2568 for file in $POTFILES; do
2569 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2570 done
2571 POMAKEFILEDEPS=""
2572
2573 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2574 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2575 fi
2576 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2577 # The LINGUAS file contains the set of available languages.
2578 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2579 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2580 else
2581 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
66c88ea4 2582 sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
a52c2257
HJYP
2583 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2584 fi
66c88ea4 2585 # Hide the ALL_LINGUAS assigment from automake.
a52c2257
HJYP
2586 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2587 # Compute POFILES
2588 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2589 # Compute UPDATEPOFILES
2590 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2591 # Compute DUMMYPOFILES
2592 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2593 # Compute GMOFILES
2594 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2595 # Compute PROPERTIESFILES
2596 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2597 # Compute CLASSFILES
2598 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2599 # Compute QMFILES
2600 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2601 # Compute MSGFILES
2602 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2603 # Compute RESOURCESDLLFILES
2604 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2605 case "$ac_given_srcdir" in
2606 .) srcdirpre= ;;
2607 *) srcdirpre='$(srcdir)/' ;;
2608 esac
2609 POFILES=
2610 UPDATEPOFILES=
2611 DUMMYPOFILES=
2612 GMOFILES=
2613 PROPERTIESFILES=
2614 CLASSFILES=
2615 QMFILES=
2616 MSGFILES=
2617 RESOURCESDLLFILES=
2618 for lang in $ALL_LINGUAS; do
2619 POFILES="$POFILES $srcdirpre$lang.po"
2620 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2621 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2622 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2623 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2624 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2625 QMFILES="$QMFILES $srcdirpre$lang.qm"
2626 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2627 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2628 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/'`
2629 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2630 done
2631 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2632 # environment variable.
2633 INST_LINGUAS=
2634 if test -n "$ALL_LINGUAS"; then
2635 for presentlang in $ALL_LINGUAS; do
2636 useit=no
2637 if test "%UNSET%" != "$LINGUAS"; then
2638 desiredlanguages="$LINGUAS"
2639 else
2640 desiredlanguages="$ALL_LINGUAS"
2641 fi
2642 for desiredlang in $desiredlanguages; do
2643 # Use the presentlang catalog if desiredlang is
2644 # a. equal to presentlang, or
2645 # b. a variant of presentlang (because in this case,
2646 # presentlang can be used as a fallback for messages
2647 # which are not translated in the desiredlang catalog).
2648 case "$desiredlang" in
2649 "$presentlang"*) useit=yes;;
2650 esac
2651 done
2652 if test $useit = yes; then
2653 INST_LINGUAS="$INST_LINGUAS $presentlang"
2654 fi
2655 done
2656 fi
2657 CATALOGS=
2658 JAVACATALOGS=
2659 QTCATALOGS=
2660 TCLCATALOGS=
2661 CSHARPCATALOGS=
2662 if test -n "$INST_LINGUAS"; then
2663 for lang in $INST_LINGUAS; do
2664 CATALOGS="$CATALOGS $lang.gmo"
2665 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2666 QTCATALOGS="$QTCATALOGS $lang.qm"
2667 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2668 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2669 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/'`
2670 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2671 done
2672 fi
2673
2674 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"
2675 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2676 # Add dependencies that cannot be formulated as a simple suffix rule.
2677 for lang in $ALL_LINGUAS; do
2678 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2679 cat >> "$ac_file.tmp" <<EOF
2680$frobbedlang.msg: $lang.po
2681 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2682 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2683EOF
2684 done
2685 fi
2686 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2687 # Add dependencies that cannot be formulated as a simple suffix rule.
2688 for lang in $ALL_LINGUAS; do
2689 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/'`
2690 cat >> "$ac_file.tmp" <<EOF
2691$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2692 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2693 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2694EOF
2695 done
2696 fi
2697 if test -n "$POMAKEFILEDEPS"; then
2698 cat >> "$ac_file.tmp" <<EOF
2699Makefile: $POMAKEFILEDEPS
2700EOF
2701 fi
2702 mv "$ac_file.tmp" "$ac_file"
2703])
2704
2705# progtest.m4 serial 4 (gettext-0.14.2)
2706dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
2707dnl This file is free software; the Free Software Foundation
2708dnl gives unlimited permission to copy and/or distribute it,
2709dnl with or without modifications, as long as this notice is preserved.
2710dnl
2711dnl This file can can be used in projects which are not available under
2712dnl the GNU General Public License or the GNU Library General Public
2713dnl License but which still want to provide support for the GNU gettext
2714dnl functionality.
2715dnl Please note that the actual code of the GNU gettext library is covered
2716dnl by the GNU Library General Public License, and the rest of the GNU
2717dnl gettext package package is covered by the GNU General Public License.
2718dnl They are *not* in the public domain.
2719
2720dnl Authors:
2721dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2722
2723AC_PREREQ(2.50)
2724
2725# Search path for a program which passes the given test.
2726
2727dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2728dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2729AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2730[
2731# Prepare PATH_SEPARATOR.
2732# The user is always right.
2733if test "${PATH_SEPARATOR+set}" != set; then
2734 echo "#! /bin/sh" >conf$$.sh
2735 echo "exit 0" >>conf$$.sh
2736 chmod +x conf$$.sh
2737 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2738 PATH_SEPARATOR=';'
2739 else
2740 PATH_SEPARATOR=:
2741 fi
2742 rm -f conf$$.sh
2743fi
2744
2745# Find out how to test for executable files. Don't use a zero-byte file,
2746# as systems may use methods other than mode bits to determine executability.
2747cat >conf$$.file <<_ASEOF
2748#! /bin/sh
2749exit 0
2750_ASEOF
2751chmod +x conf$$.file
2752if test -x conf$$.file >/dev/null 2>&1; then
2753 ac_executable_p="test -x"
2754else
2755 ac_executable_p="test -f"
2756fi
2757rm -f conf$$.file
2758
2759# Extract the first word of "$2", so it can be a program name with args.
2760set dummy $2; ac_word=[$]2
2761AC_MSG_CHECKING([for $ac_word])
2762AC_CACHE_VAL(ac_cv_path_$1,
2763[case "[$]$1" in
2764 [[\\/]]* | ?:[[\\/]]*)
2765 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2766 ;;
2767 *)
2768 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2769 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2770 IFS="$ac_save_IFS"
2771 test -z "$ac_dir" && ac_dir=.
2772 for ac_exec_ext in '' $ac_executable_extensions; do
2773 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2774 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2775 if [$3]; then
2776 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2777 break 2
2778 fi
2779 fi
2780 done
2781 done
2782 IFS="$ac_save_IFS"
2783dnl If no 4th arg is given, leave the cache variable unset,
2784dnl so AC_PATH_PROGS will keep looking.
2785ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2786])dnl
2787 ;;
2788esac])dnl
2789$1="$ac_cv_path_$1"
2790if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2791 AC_MSG_RESULT([$]$1)
2792else
2793 AC_MSG_RESULT(no)
2794fi
2795AC_SUBST($1)dnl
2796])
2797
2798# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
2799#
2800# This file is free software; the Free Software Foundation
2801# gives unlimited permission to copy and/or distribute it,
2802# with or without modifications, as long as this notice is preserved.
2803
2804# AM_AUTOMAKE_VERSION(VERSION)
2805# ----------------------------
2806# Automake X.Y traces this macro to ensure aclocal.m4 has been
2807# generated from the m4 files accompanying Automake X.Y.
2808AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
2809
2810# AM_SET_CURRENT_AUTOMAKE_VERSION
2811# -------------------------------
2812# Call AM_AUTOMAKE_VERSION so it can be traced.
2813# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
2814AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2815 [AM_AUTOMAKE_VERSION([1.9.6])])
2816
2817# AM_AUX_DIR_EXPAND -*- Autoconf -*-
2818
2819# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
2820#
2821# This file is free software; the Free Software Foundation
2822# gives unlimited permission to copy and/or distribute it,
2823# with or without modifications, as long as this notice is preserved.
2824
2825# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2826# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
2827# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
2828#
2829# Of course, Automake must honor this variable whenever it calls a
2830# tool from the auxiliary directory. The problem is that $srcdir (and
2831# therefore $ac_aux_dir as well) can be either absolute or relative,
2832# depending on how configure is run. This is pretty annoying, since
2833# it makes $ac_aux_dir quite unusable in subdirectories: in the top
2834# source directory, any form will work fine, but in subdirectories a
2835# relative path needs to be adjusted first.
2836#
2837# $ac_aux_dir/missing
2838# fails when called from a subdirectory if $ac_aux_dir is relative
2839# $top_srcdir/$ac_aux_dir/missing
2840# fails if $ac_aux_dir is absolute,
2841# fails when called from a subdirectory in a VPATH build with
2842# a relative $ac_aux_dir
2843#
2844# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2845# are both prefixed by $srcdir. In an in-source build this is usually
2846# harmless because $srcdir is `.', but things will broke when you
2847# start a VPATH build or use an absolute $srcdir.
2848#
2849# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2850# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
2851# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2852# and then we would define $MISSING as
2853# MISSING="\${SHELL} $am_aux_dir/missing"
2854# This will work as long as MISSING is not called from configure, because
2855# unfortunately $(top_srcdir) has no meaning in configure.
2856# However there are other variables, like CC, which are often used in
2857# configure, and could therefore not use this "fixed" $ac_aux_dir.
2858#
2859# Another solution, used here, is to always expand $ac_aux_dir to an
2860# absolute PATH. The drawback is that using absolute paths prevent a
2861# configured tree to be moved without reconfiguration.
2862
2863AC_DEFUN([AM_AUX_DIR_EXPAND],
2864[dnl Rely on autoconf to set up CDPATH properly.
2865AC_PREREQ([2.50])dnl
2866# expand $ac_aux_dir to an absolute path
2867am_aux_dir=`cd $ac_aux_dir && pwd`
2868])
2869
2870# AM_CONDITIONAL -*- Autoconf -*-
2871
2872# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
2873# Free Software Foundation, Inc.
2874#
2875# This file is free software; the Free Software Foundation
2876# gives unlimited permission to copy and/or distribute it,
2877# with or without modifications, as long as this notice is preserved.
2878
2879# serial 7
2880
2881# AM_CONDITIONAL(NAME, SHELL-CONDITION)
2882# -------------------------------------
2883# Define a conditional.
2884AC_DEFUN([AM_CONDITIONAL],
2885[AC_PREREQ(2.52)dnl
2886 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
2887 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2888AC_SUBST([$1_TRUE])
2889AC_SUBST([$1_FALSE])
2890if $2; then
2891 $1_TRUE=
2892 $1_FALSE='#'
2893else
2894 $1_TRUE='#'
2895 $1_FALSE=
2896fi
2897AC_CONFIG_COMMANDS_PRE(
2898[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
2899 AC_MSG_ERROR([[conditional "$1" was never defined.
2900Usually this means the macro was only invoked conditionally.]])
2901fi])])
2902
2903
2904# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
2905# Free Software Foundation, Inc.
2906#
2907# This file is free software; the Free Software Foundation
2908# gives unlimited permission to copy and/or distribute it,
2909# with or without modifications, as long as this notice is preserved.
2910
2911# serial 8
2912
2913# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
2914# written in clear, in which case automake, when reading aclocal.m4,
2915# will think it sees a *use*, and therefore will trigger all it's
2916# C support machinery. Also note that it means that autoscan, seeing
2917# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2918
2919
2920# _AM_DEPENDENCIES(NAME)
2921# ----------------------
2922# See how the compiler implements dependency checking.
2923# NAME is "CC", "CXX", "GCJ", or "OBJC".
2924# We try a few techniques and use that to set a single cache variable.
2925#
2926# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2927# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2928# dependency, and given that the user is not expected to run this macro,
2929# just rely on AC_PROG_CC.
2930AC_DEFUN([_AM_DEPENDENCIES],
2931[AC_REQUIRE([AM_SET_DEPDIR])dnl
2932AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2933AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2934AC_REQUIRE([AM_DEP_TRACK])dnl
2935
2936ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
2937 [$1], CXX, [depcc="$CXX" am_compiler_list=],
2938 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2939 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
2940 [depcc="$$1" am_compiler_list=])
2941
2942AC_CACHE_CHECK([dependency style of $depcc],
2943 [am_cv_$1_dependencies_compiler_type],
2944[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2945 # We make a subdir and do the tests there. Otherwise we can end up
2946 # making bogus files that we don't know about and never remove. For
2947 # instance it was reported that on HP-UX the gcc test will end up
2948 # making a dummy file named `D' -- because `-MD' means `put the output
2949 # in D'.
2950 mkdir conftest.dir
2951 # Copy depcomp to subdir because otherwise we won't find it if we're
2952 # using a relative directory.
2953 cp "$am_depcomp" conftest.dir
2954 cd conftest.dir
2955 # We will build objects and dependencies in a subdirectory because
2956 # it helps to detect inapplicable dependency modes. For instance
2957 # both Tru64's cc and ICC support -MD to output dependencies as a
2958 # side effect of compilation, but ICC will put the dependencies in
2959 # the current directory while Tru64 will put them in the object
2960 # directory.
2961 mkdir sub
2962
2963 am_cv_$1_dependencies_compiler_type=none
2964 if test "$am_compiler_list" = ""; then
2965 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2966 fi
2967 for depmode in $am_compiler_list; do
2968 # Setup a source with many dependencies, because some compilers
2969 # like to wrap large dependency lists on column 80 (with \), and
2970 # we should not choose a depcomp mode which is confused by this.
2971 #
2972 # We need to recreate these files for each test, as the compiler may
2973 # overwrite some of them when testing with obscure command lines.
2974 # This happens at least with the AIX C compiler.
2975 : > sub/conftest.c
2976 for i in 1 2 3 4 5 6; do
2977 echo '#include "conftst'$i'.h"' >> sub/conftest.c
2978 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2979 # Solaris 8's {/usr,}/bin/sh.
2980 touch sub/conftst$i.h
2981 done
2982 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2983
2984 case $depmode in
2985 nosideeffect)
2986 # after this tag, mechanisms are not by side-effect, so they'll
2987 # only be used when explicitly requested
2988 if test "x$enable_dependency_tracking" = xyes; then
2989 continue
2990 else
2991 break
2992 fi
2993 ;;
2994 none) break ;;
2995 esac
2996 # We check with `-c' and `-o' for the sake of the "dashmstdout"
2997 # mode. It turns out that the SunPro C++ compiler does not properly
2998 # handle `-M -o', and we need to detect this.
2999 if depmode=$depmode \
3000 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
3001 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3002 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
3003 >/dev/null 2>conftest.err &&
3004 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3005 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
3006 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3007 # icc doesn't choke on unknown options, it will just issue warnings
3008 # or remarks (even with -Werror). So we grep stderr for any message
3009 # that says an option was ignored or not supported.
3010 # When given -MP, icc 7.0 and 7.1 complain thusly:
3011 # icc: Command line warning: ignoring option '-M'; no argument required
3012 # The diagnosis changed in icc 8.0:
3013 # icc: Command line remark: option '-MP' not supported
3014 if (grep 'ignoring option' conftest.err ||
3015 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3016 am_cv_$1_dependencies_compiler_type=$depmode
3017 break
3018 fi
3019 fi
3020 done
3021
3022 cd ..
3023 rm -rf conftest.dir
3024else
3025 am_cv_$1_dependencies_compiler_type=none
3026fi
3027])
3028AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
3029AM_CONDITIONAL([am__fastdep$1], [
3030 test "x$enable_dependency_tracking" != xno \
3031 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3032])
3033
3034
3035# AM_SET_DEPDIR
3036# -------------
3037# Choose a directory name for dependency files.
3038# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3039AC_DEFUN([AM_SET_DEPDIR],
3040[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3041AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3042])
3043
3044
3045# AM_DEP_TRACK
3046# ------------
3047AC_DEFUN([AM_DEP_TRACK],
3048[AC_ARG_ENABLE(dependency-tracking,
3049[ --disable-dependency-tracking speeds up one-time build
3050 --enable-dependency-tracking do not reject slow dependency extractors])
3051if test "x$enable_dependency_tracking" != xno; then
3052 am_depcomp="$ac_aux_dir/depcomp"
3053 AMDEPBACKSLASH='\'
3054fi
3055AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3056AC_SUBST([AMDEPBACKSLASH])
3057])
3058
3059# Generate code to set up dependency tracking. -*- Autoconf -*-
3060
3061# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3062# Free Software Foundation, Inc.
3063#
3064# This file is free software; the Free Software Foundation
3065# gives unlimited permission to copy and/or distribute it,
3066# with or without modifications, as long as this notice is preserved.
3067
3068#serial 3
3069
3070# _AM_OUTPUT_DEPENDENCY_COMMANDS
3071# ------------------------------
3072AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3073[for mf in $CONFIG_FILES; do
3074 # Strip MF so we end up with the name of the file.
3075 mf=`echo "$mf" | sed -e 's/:.*$//'`
3076 # Check whether this is an Automake generated Makefile or not.
3077 # We used to match only the files named `Makefile.in', but
3078 # some people rename them; so instead we look at the file content.
3079 # Grep'ing the first line is not enough: some people post-process
3080 # each Makefile.in and add a new line on top of each file to say so.
3081 # So let's grep whole file.
3082 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
3083 dirpart=`AS_DIRNAME("$mf")`
3084 else
3085 continue
3086 fi
3087 # Extract the definition of DEPDIR, am__include, and am__quote
3088 # from the Makefile without running `make'.
3089 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3090 test -z "$DEPDIR" && continue
3091 am__include=`sed -n 's/^am__include = //p' < "$mf"`
3092 test -z "am__include" && continue
3093 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3094 # When using ansi2knr, U may be empty or an underscore; expand it
3095 U=`sed -n 's/^U = //p' < "$mf"`
3096 # Find all dependency output files, they are included files with
3097 # $(DEPDIR) in their names. We invoke sed twice because it is the
3098 # simplest approach to changing $(DEPDIR) to its actual value in the
3099 # expansion.
3100 for file in `sed -n "
3101 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3102 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3103 # Make sure the directory exists.
3104 test -f "$dirpart/$file" && continue
3105 fdir=`AS_DIRNAME(["$file"])`
3106 AS_MKDIR_P([$dirpart/$fdir])
3107 # echo "creating $dirpart/$file"
3108 echo '# dummy' > "$dirpart/$file"
3109 done
3110done
3111])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3112
3113
3114# AM_OUTPUT_DEPENDENCY_COMMANDS
3115# -----------------------------
3116# This macro should only be invoked once -- use via AC_REQUIRE.
3117#
3118# This code is only required when automatic dependency tracking
3119# is enabled. FIXME. This creates each `.P' file that we will
3120# need in order to bootstrap the dependency handling code.
3121AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3122[AC_CONFIG_COMMANDS([depfiles],
3123 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3124 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3125])
3126
3127# Do all the work for Automake. -*- Autoconf -*-
3128
3129# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
3130# Free Software Foundation, Inc.
3131#
3132# This file is free software; the Free Software Foundation
3133# gives unlimited permission to copy and/or distribute it,
3134# with or without modifications, as long as this notice is preserved.
3135
3136# serial 12
3137
3138# This macro actually does too much. Some checks are only needed if
3139# your package does certain things. But this isn't really a big deal.
3140
3141# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3142# AM_INIT_AUTOMAKE([OPTIONS])
3143# -----------------------------------------------
3144# The call with PACKAGE and VERSION arguments is the old style
3145# call (pre autoconf-2.50), which is being phased out. PACKAGE
3146# and VERSION should now be passed to AC_INIT and removed from
3147# the call to AM_INIT_AUTOMAKE.
3148# We support both call styles for the transition. After
3149# the next Automake release, Autoconf can make the AC_INIT
3150# arguments mandatory, and then we can depend on a new Autoconf
3151# release and drop the old call support.
3152AC_DEFUN([AM_INIT_AUTOMAKE],
3153[AC_PREREQ([2.58])dnl
3154dnl Autoconf wants to disallow AM_ names. We explicitly allow
3155dnl the ones we care about.
3156m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
3157AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
3158AC_REQUIRE([AC_PROG_INSTALL])dnl
3159# test to see if srcdir already configured
3160if test "`cd $srcdir && pwd`" != "`pwd`" &&
3161 test -f $srcdir/config.status; then
3162 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
3163fi
3164
3165# test whether we have cygpath
3166if test -z "$CYGPATH_W"; then
3167 if (cygpath --version) >/dev/null 2>/dev/null; then
3168 CYGPATH_W='cygpath -w'
3169 else
3170 CYGPATH_W=echo
3171 fi
3172fi
3173AC_SUBST([CYGPATH_W])
3174
3175# Define the identity of the package.
3176dnl Distinguish between old-style and new-style calls.
3177m4_ifval([$2],
3178[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
3179 AC_SUBST([PACKAGE], [$1])dnl
3180 AC_SUBST([VERSION], [$2])],
3181[_AM_SET_OPTIONS([$1])dnl
3182 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
3183 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
3184
3185_AM_IF_OPTION([no-define],,
3186[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
3187 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
3188
3189# Some tools Automake needs.
3190AC_REQUIRE([AM_SANITY_CHECK])dnl
3191AC_REQUIRE([AC_ARG_PROGRAM])dnl
3192AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
3193AM_MISSING_PROG(AUTOCONF, autoconf)
3194AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
3195AM_MISSING_PROG(AUTOHEADER, autoheader)
3196AM_MISSING_PROG(MAKEINFO, makeinfo)
3197AM_PROG_INSTALL_SH
3198AM_PROG_INSTALL_STRIP
3199AC_REQUIRE([AM_PROG_MKDIR_P])dnl
3200# We need awk for the "check" target. The system "awk" is bad on
3201# some platforms.
3202AC_REQUIRE([AC_PROG_AWK])dnl
3203AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3204AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3205_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
3206 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
3207 [_AM_PROG_TAR([v7])])])
3208_AM_IF_OPTION([no-dependencies],,
3209[AC_PROVIDE_IFELSE([AC_PROG_CC],
3210 [_AM_DEPENDENCIES(CC)],
3211 [define([AC_PROG_CC],
3212 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
3213AC_PROVIDE_IFELSE([AC_PROG_CXX],
3214 [_AM_DEPENDENCIES(CXX)],
3215 [define([AC_PROG_CXX],
3216 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
3217])
3218])
3219
3220
3221# When config.status generates a header, we must update the stamp-h file.
3222# This file resides in the same directory as the config header
3223# that is generated. The stamp files are numbered to have different names.
3224
3225# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
3226# loop where config.status creates the headers, so we can generate
3227# our stamp files there.
3228AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
3229[# Compute $1's index in $config_headers.
3230_am_stamp_count=1
3231for _am_header in $config_headers :; do
3232 case $_am_header in
3233 $1 | $1:* )
3234 break ;;
3235 * )
3236 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
3237 esac
3238done
3239echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
3240
3241# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
3242#
3243# This file is free software; the Free Software Foundation
3244# gives unlimited permission to copy and/or distribute it,
3245# with or without modifications, as long as this notice is preserved.
3246
3247# AM_PROG_INSTALL_SH
3248# ------------------
3249# Define $install_sh.
3250AC_DEFUN([AM_PROG_INSTALL_SH],
3251[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3252install_sh=${install_sh-"$am_aux_dir/install-sh"}
3253AC_SUBST(install_sh)])
3254
3255# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
3256#
3257# This file is free software; the Free Software Foundation
3258# gives unlimited permission to copy and/or distribute it,
3259# with or without modifications, as long as this notice is preserved.
3260
3261# serial 2
3262
3263# Check whether the underlying file-system supports filenames
3264# with a leading dot. For instance MS-DOS doesn't.
3265AC_DEFUN([AM_SET_LEADING_DOT],
3266[rm -rf .tst 2>/dev/null
3267mkdir .tst 2>/dev/null
3268if test -d .tst; then
3269 am__leading_dot=.
3270else
3271 am__leading_dot=_
3272fi
3273rmdir .tst 2>/dev/null
3274AC_SUBST([am__leading_dot])])
3275
3276# Check to see how 'make' treats includes. -*- Autoconf -*-
3277
3278# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
3279#
3280# This file is free software; the Free Software Foundation
3281# gives unlimited permission to copy and/or distribute it,
3282# with or without modifications, as long as this notice is preserved.
3283
3284# serial 3
3285
3286# AM_MAKE_INCLUDE()
3287# -----------------
3288# Check to see how make treats includes.
3289AC_DEFUN([AM_MAKE_INCLUDE],
3290[am_make=${MAKE-make}
3291cat > confinc << 'END'
3292am__doit:
3293 @echo done
3294.PHONY: am__doit
3295END
3296# If we don't find an include directive, just comment out the code.
3297AC_MSG_CHECKING([for style of include used by $am_make])
3298am__include="#"
3299am__quote=
3300_am_result=none
3301# First try GNU make style include.
3302echo "include confinc" > confmf
3303# We grep out `Entering directory' and `Leaving directory'
3304# messages which can occur if `w' ends up in MAKEFLAGS.
3305# In particular we don't look at `^make:' because GNU make might
3306# be invoked under some other name (usually "gmake"), in which
3307# case it prints its new name instead of `make'.
3308if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
3309 am__include=include
3310 am__quote=
3311 _am_result=GNU
3312fi
3313# Now try BSD make style include.
3314if test "$am__include" = "#"; then
3315 echo '.include "confinc"' > confmf
3316 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
3317 am__include=.include
3318 am__quote="\""
3319 _am_result=BSD
3320 fi
3321fi
3322AC_SUBST([am__include])
3323AC_SUBST([am__quote])
3324AC_MSG_RESULT([$_am_result])
3325rm -f confinc confmf
3326])
3327
3328# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
3329
3330# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
3331# Free Software Foundation, Inc.
3332#
3333# This file is free software; the Free Software Foundation
3334# gives unlimited permission to copy and/or distribute it,
3335# with or without modifications, as long as this notice is preserved.
3336
3337# serial 4
3338
3339# AM_MISSING_PROG(NAME, PROGRAM)
3340# ------------------------------
3341AC_DEFUN([AM_MISSING_PROG],
3342[AC_REQUIRE([AM_MISSING_HAS_RUN])
3343$1=${$1-"${am_missing_run}$2"}
3344AC_SUBST($1)])
3345
3346
3347# AM_MISSING_HAS_RUN
3348# ------------------
3349# Define MISSING if not defined so far and test if it supports --run.
3350# If it does, set am_missing_run to use it, otherwise, to nothing.
3351AC_DEFUN([AM_MISSING_HAS_RUN],
3352[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3353test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
3354# Use eval to expand $SHELL
3355if eval "$MISSING --run true"; then
3356 am_missing_run="$MISSING --run "
3357else
3358 am_missing_run=
3359 AC_MSG_WARN([`missing' script is too old or missing])
3360fi
3361])
3362
3363# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3364#
3365# This file is free software; the Free Software Foundation
3366# gives unlimited permission to copy and/or distribute it,
3367# with or without modifications, as long as this notice is preserved.
3368
3369# AM_PROG_MKDIR_P
3370# ---------------
3371# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
3372#
3373# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
3374# created by `make install' are always world readable, even if the
3375# installer happens to have an overly restrictive umask (e.g. 077).
3376# This was a mistake. There are at least two reasons why we must not
3377# use `-m 0755':
3378# - it causes special bits like SGID to be ignored,
3379# - it may be too restrictive (some setups expect 775 directories).
3380#
3381# Do not use -m 0755 and let people choose whatever they expect by
3382# setting umask.
3383#
3384# We cannot accept any implementation of `mkdir' that recognizes `-p'.
3385# Some implementations (such as Solaris 8's) are not thread-safe: if a
3386# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
3387# concurrently, both version can detect that a/ is missing, but only
3388# one can create it and the other will error out. Consequently we
3389# restrict ourselves to GNU make (using the --version option ensures
3390# this.)
3391AC_DEFUN([AM_PROG_MKDIR_P],
3392[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
3393 # We used to keeping the `.' as first argument, in order to
3394 # allow $(mkdir_p) to be used without argument. As in
3395 # $(mkdir_p) $(somedir)
3396 # where $(somedir) is conditionally defined. However this is wrong
3397 # for two reasons:
3398 # 1. if the package is installed by a user who cannot write `.'
3399 # make install will fail,
3400 # 2. the above comment should most certainly read
3401 # $(mkdir_p) $(DESTDIR)$(somedir)
3402 # so it does not work when $(somedir) is undefined and
3403 # $(DESTDIR) is not.
3404 # To support the latter case, we have to write
3405 # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
3406 # so the `.' trick is pointless.
3407 mkdir_p='mkdir -p --'
3408else
3409 # On NextStep and OpenStep, the `mkdir' command does not
3410 # recognize any option. It will interpret all options as
3411 # directories to create, and then abort because `.' already
3412 # exists.
3413 for d in ./-p ./--version;
3414 do
3415 test -d $d && rmdir $d
3416 done
3417 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
3418 if test -f "$ac_aux_dir/mkinstalldirs"; then
3419 mkdir_p='$(mkinstalldirs)'
3420 else
3421 mkdir_p='$(install_sh) -d'
3422 fi
3423fi
3424AC_SUBST([mkdir_p])])
3425
3426# Helper functions for option handling. -*- Autoconf -*-
3427
3428# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
3429#
3430# This file is free software; the Free Software Foundation
3431# gives unlimited permission to copy and/or distribute it,
3432# with or without modifications, as long as this notice is preserved.
3433
3434# serial 3
3435
3436# _AM_MANGLE_OPTION(NAME)
3437# -----------------------
3438AC_DEFUN([_AM_MANGLE_OPTION],
3439[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
3440
3441# _AM_SET_OPTION(NAME)
3442# ------------------------------
3443# Set option NAME. Presently that only means defining a flag for this option.
3444AC_DEFUN([_AM_SET_OPTION],
3445[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
3446
3447# _AM_SET_OPTIONS(OPTIONS)
3448# ----------------------------------
3449# OPTIONS is a space-separated list of Automake options.
3450AC_DEFUN([_AM_SET_OPTIONS],
3451[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
3452
3453# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
3454# -------------------------------------------
3455# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
3456AC_DEFUN([_AM_IF_OPTION],
3457[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
3458
3459# Check to make sure that the build environment is sane. -*- Autoconf -*-
3460
3461# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3462# Free Software Foundation, Inc.
3463#
3464# This file is free software; the Free Software Foundation
3465# gives unlimited permission to copy and/or distribute it,
3466# with or without modifications, as long as this notice is preserved.
3467
3468# serial 4
3469
3470# AM_SANITY_CHECK
3471# ---------------
3472AC_DEFUN([AM_SANITY_CHECK],
3473[AC_MSG_CHECKING([whether build environment is sane])
3474# Just in case
3475sleep 1
3476echo timestamp > conftest.file
3477# Do `set' in a subshell so we don't clobber the current shell's
3478# arguments. Must try -L first in case configure is actually a
3479# symlink; some systems play weird games with the mod time of symlinks
3480# (eg FreeBSD returns the mod time of the symlink's containing
3481# directory).
3482if (
3483 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
3484 if test "$[*]" = "X"; then
3485 # -L didn't work.
3486 set X `ls -t $srcdir/configure conftest.file`
3487 fi
3488 rm -f conftest.file
3489 if test "$[*]" != "X $srcdir/configure conftest.file" \
3490 && test "$[*]" != "X conftest.file $srcdir/configure"; then
3491
3492 # If neither matched, then we have a broken ls. This can happen
3493 # if, for instance, CONFIG_SHELL is bash and it inherits a
3494 # broken ls alias from the environment. This has actually
3495 # happened. Such a system could not be considered "sane".
3496 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
3497alias in your environment])
3498 fi
3499
3500 test "$[2]" = conftest.file
3501 )
3502then
3503 # Ok.
3504 :
3505else
3506 AC_MSG_ERROR([newly created file is older than distributed files!
3507Check your system clock])
3508fi
3509AC_MSG_RESULT(yes)])
3510
3511# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
3512#
3513# This file is free software; the Free Software Foundation
3514# gives unlimited permission to copy and/or distribute it,
3515# with or without modifications, as long as this notice is preserved.
3516
3517# AM_PROG_INSTALL_STRIP
3518# ---------------------
3519# One issue with vendor `install' (even GNU) is that you can't
3520# specify the program used to strip binaries. This is especially
3521# annoying in cross-compiling environments, where the build's strip
3522# is unlikely to handle the host's binaries.
3523# Fortunately install-sh will honor a STRIPPROG variable, so we
3524# always use install-sh in `make install-strip', and initialize
3525# STRIPPROG with the value of the STRIP variable (set by the user).
3526AC_DEFUN([AM_PROG_INSTALL_STRIP],
3527[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3528# Installed binaries are usually stripped using `strip' when the user
3529# run `make install-strip'. However `strip' might not be the right
3530# tool to use in cross-compilation environments, therefore Automake
3531# will honor the `STRIP' environment variable to overrule this program.
3532dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
3533if test "$cross_compiling" != no; then
3534 AC_CHECK_TOOL([STRIP], [strip], :)
3535fi
3536INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
3537AC_SUBST([INSTALL_STRIP_PROGRAM])])
3538
3539# Check how to create a tarball. -*- Autoconf -*-
3540
3541# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3542#
3543# This file is free software; the Free Software Foundation
3544# gives unlimited permission to copy and/or distribute it,
3545# with or without modifications, as long as this notice is preserved.
3546
3547# serial 2
3548
3549# _AM_PROG_TAR(FORMAT)
3550# --------------------
3551# Check how to create a tarball in format FORMAT.
3552# FORMAT should be one of `v7', `ustar', or `pax'.
3553#
3554# Substitute a variable $(am__tar) that is a command
3555# writing to stdout a FORMAT-tarball containing the directory
3556# $tardir.
3557# tardir=directory && $(am__tar) > result.tar
3558#
3559# Substitute a variable $(am__untar) that extract such
3560# a tarball read from stdin.
3561# $(am__untar) < result.tar
3562AC_DEFUN([_AM_PROG_TAR],
3563[# Always define AMTAR for backward compatibility.
3564AM_MISSING_PROG([AMTAR], [tar])
3565m4_if([$1], [v7],
3566 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
3567 [m4_case([$1], [ustar],, [pax],,
3568 [m4_fatal([Unknown tar format])])
3569AC_MSG_CHECKING([how to create a $1 tar archive])
3570# Loop over all known methods to create a tar archive until one works.
3571_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
3572_am_tools=${am_cv_prog_tar_$1-$_am_tools}
3573# Do not fold the above two line into one, because Tru64 sh and
3574# Solaris sh will not grok spaces in the rhs of `-'.
3575for _am_tool in $_am_tools
3576do
3577 case $_am_tool in
3578 gnutar)
3579 for _am_tar in tar gnutar gtar;
3580 do
3581 AM_RUN_LOG([$_am_tar --version]) && break
3582 done
3583 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
3584 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
3585 am__untar="$_am_tar -xf -"
3586 ;;
3587 plaintar)
3588 # Must skip GNU tar: if it does not support --format= it doesn't create
3589 # ustar tarball either.
3590 (tar --version) >/dev/null 2>&1 && continue
3591 am__tar='tar chf - "$$tardir"'
3592 am__tar_='tar chf - "$tardir"'
3593 am__untar='tar xf -'
3594 ;;
3595 pax)
3596 am__tar='pax -L -x $1 -w "$$tardir"'
3597 am__tar_='pax -L -x $1 -w "$tardir"'
3598 am__untar='pax -r'
3599 ;;
3600 cpio)
3601 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
3602 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
3603 am__untar='cpio -i -H $1 -d'
3604 ;;
3605 none)
3606 am__tar=false
3607 am__tar_=false
3608 am__untar=false
3609 ;;
3610 esac
3611
3612 # If the value was cached, stop now. We just wanted to have am__tar
3613 # and am__untar set.
3614 test -n "${am_cv_prog_tar_$1}" && break
3615
3616 # tar/untar a dummy directory, and stop if the command works
3617 rm -rf conftest.dir
3618 mkdir conftest.dir
3619 echo GrepMe > conftest.dir/file
3620 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
3621 rm -rf conftest.dir
3622 if test -s conftest.tar; then
3623 AM_RUN_LOG([$am__untar <conftest.tar])
3624 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3625 fi
3626done
3627rm -rf conftest.dir
3628
3629AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
3630AC_MSG_RESULT([$am_cv_prog_tar_$1])])
3631AC_SUBST([am__tar])
3632AC_SUBST([am__untar])
3633]) # _AM_PROG_TAR
3634