]> git.saurik.com Git - apt-legacy.git/blame - aclocal.m4
Added iPhone headers to APT and fixed 301 results.
[apt-legacy.git] / aclocal.m4
CommitLineData
da6ee469
JF
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
14# gettext.m4 serial 53 (gettext-0.15)
15dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
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.
31dnl Bruno Haible <haible@clisp.cons.org>, 2000-2005.
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.
110 AC_REQUIRE([AM_NLS])
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],
146[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
147#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
148#endif
149typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
150]], [])[extern int _nl_msg_cat_cntr;
151extern int *_nl_domain_bindings;],
152 [bindtextdomain ("", "");
153return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
154 gt_cv_func_gnugettext_libc=yes,
155 gt_cv_func_gnugettext_libc=no)])
156
157 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
158 dnl Sometimes libintl requires libiconv, so first search for libiconv.
159 ifelse(gt_included_intl, yes, , [
160 AM_ICONV_LINK
161 ])
162 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
163 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
164 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
165 dnl even if libiconv doesn't exist.
166 AC_LIB_LINKFLAGS_BODY([intl])
167 AC_CACHE_CHECK([for GNU gettext in libintl],
168 gt_cv_func_gnugettext_libintl,
169 [gt_save_CPPFLAGS="$CPPFLAGS"
170 CPPFLAGS="$CPPFLAGS $INCINTL"
171 gt_save_LIBS="$LIBS"
172 LIBS="$LIBS $LIBINTL"
173 dnl Now see whether libintl exists and does not depend on libiconv.
174 AC_TRY_LINK([#include <libintl.h>
175]ifelse([$2], [need-formatstring-macros],
176[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
177#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
178#endif
179typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
180]], [])[extern int _nl_msg_cat_cntr;
181extern
182#ifdef __cplusplus
183"C"
184#endif
185const char *_nl_expand_alias (const char *);],
186 [bindtextdomain ("", "");
187return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
188 gt_cv_func_gnugettext_libintl=yes,
189 gt_cv_func_gnugettext_libintl=no)
190 dnl Now see whether libintl exists and depends on libiconv.
191 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
192 LIBS="$LIBS $LIBICONV"
193 AC_TRY_LINK([#include <libintl.h>
194]ifelse([$2], [need-formatstring-macros],
195[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
196#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
197#endif
198typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
199]], [])[extern int _nl_msg_cat_cntr;
200extern
201#ifdef __cplusplus
202"C"
203#endif
204const char *_nl_expand_alias (const char *);],
205 [bindtextdomain ("", "");
206return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
207 [LIBINTL="$LIBINTL $LIBICONV"
208 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
209 gt_cv_func_gnugettext_libintl=yes
210 ])
211 fi
212 CPPFLAGS="$gt_save_CPPFLAGS"
213 LIBS="$gt_save_LIBS"])
214 fi
215
216 dnl If an already present or preinstalled GNU gettext() is found,
217 dnl use it. But if this macro is used in GNU gettext, and GNU
218 dnl gettext is already preinstalled in libintl, we update this
219 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
220 if test "$gt_cv_func_gnugettext_libc" = "yes" \
221 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
222 && test "$PACKAGE" != gettext-runtime \
223 && test "$PACKAGE" != gettext-tools; }; then
224 gt_use_preinstalled_gnugettext=yes
225 else
226 dnl Reset the values set by searching for libintl.
227 LIBINTL=
228 LTLIBINTL=
229 INCINTL=
230 fi
231
232 ifelse(gt_included_intl, yes, [
233 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
234 dnl GNU gettext is not found in the C library.
235 dnl Fall back on included GNU gettext library.
236 nls_cv_use_gnu_gettext=yes
237 fi
238 fi
239
240 if test "$nls_cv_use_gnu_gettext" = "yes"; then
241 dnl Mark actions used to generate GNU NLS library.
242 BUILD_INCLUDED_LIBINTL=yes
243 USE_INCLUDED_LIBINTL=yes
244 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
245 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
246 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
247 fi
248
249 CATOBJEXT=
250 if test "$gt_use_preinstalled_gnugettext" = "yes" \
251 || test "$nls_cv_use_gnu_gettext" = "yes"; then
252 dnl Mark actions to use GNU gettext tools.
253 CATOBJEXT=.gmo
254 fi
255 ])
256
257 if test -n "$INTL_MACOSX_LIBS"; then
258 if test "$gt_use_preinstalled_gnugettext" = "yes" \
259 || test "$nls_cv_use_gnu_gettext" = "yes"; then
260 dnl Some extra flags are needed during linking.
261 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
262 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
263 fi
264 fi
265
266 if test "$gt_use_preinstalled_gnugettext" = "yes" \
267 || test "$nls_cv_use_gnu_gettext" = "yes"; then
268 AC_DEFINE(ENABLE_NLS, 1,
269 [Define to 1 if translation of program messages to the user's native language
270 is requested.])
271 else
272 USE_NLS=no
273 fi
274 fi
275
276 AC_MSG_CHECKING([whether to use NLS])
277 AC_MSG_RESULT([$USE_NLS])
278 if test "$USE_NLS" = "yes"; then
279 AC_MSG_CHECKING([where the gettext function comes from])
280 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
281 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
282 gt_source="external libintl"
283 else
284 gt_source="libc"
285 fi
286 else
287 gt_source="included intl directory"
288 fi
289 AC_MSG_RESULT([$gt_source])
290 fi
291
292 if test "$USE_NLS" = "yes"; then
293
294 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
295 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
296 AC_MSG_CHECKING([how to link with libintl])
297 AC_MSG_RESULT([$LIBINTL])
298 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
299 fi
300
301 dnl For backward compatibility. Some packages may be using this.
302 AC_DEFINE(HAVE_GETTEXT, 1,
303 [Define if the GNU gettext() function is already present or preinstalled.])
304 AC_DEFINE(HAVE_DCGETTEXT, 1,
305 [Define if the GNU dcgettext() function is already present or preinstalled.])
306 fi
307
308 dnl We need to process the po/ directory.
309 POSUB=po
310 fi
311
312 ifelse(gt_included_intl, yes, [
313 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
314 dnl to 'yes' because some of the testsuite requires it.
315 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
316 BUILD_INCLUDED_LIBINTL=yes
317 fi
318
319 dnl Make all variables we use known to autoconf.
320 AC_SUBST(BUILD_INCLUDED_LIBINTL)
321 AC_SUBST(USE_INCLUDED_LIBINTL)
322 AC_SUBST(CATOBJEXT)
323
324 dnl For backward compatibility. Some configure.ins may be using this.
325 nls_cv_header_intl=
326 nls_cv_header_libgt=
327
328 dnl For backward compatibility. Some Makefiles may be using this.
329 DATADIRNAME=share
330 AC_SUBST(DATADIRNAME)
331
332 dnl For backward compatibility. Some Makefiles may be using this.
333 INSTOBJEXT=.mo
334 AC_SUBST(INSTOBJEXT)
335
336 dnl For backward compatibility. Some Makefiles may be using this.
337 GENCAT=gencat
338 AC_SUBST(GENCAT)
339
340 dnl For backward compatibility. Some Makefiles may be using this.
341 INTLOBJS=
342 if test "$USE_INCLUDED_LIBINTL" = yes; then
343 INTLOBJS="\$(GETTOBJS)"
344 fi
345 AC_SUBST(INTLOBJS)
346
347 dnl Enable libtool support if the surrounding package wishes it.
348 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
349 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
350 ])
351
352 dnl For backward compatibility. Some Makefiles may be using this.
353 INTLLIBS="$LIBINTL"
354 AC_SUBST(INTLLIBS)
355
356 dnl Make all documented variables known to autoconf.
357 AC_SUBST(LIBINTL)
358 AC_SUBST(LTLIBINTL)
359 AC_SUBST(POSUB)
360])
361
362
363dnl Checks for all prerequisites of the intl subdirectory,
364dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
365dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
366AC_DEFUN([AM_INTL_SUBDIR],
367[
368 AC_REQUIRE([AC_PROG_INSTALL])dnl
369 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
370 AC_REQUIRE([AC_PROG_CC])dnl
371 AC_REQUIRE([AC_CANONICAL_HOST])dnl
372 AC_REQUIRE([gt_GLIBC2])dnl
373 AC_REQUIRE([AC_PROG_RANLIB])dnl
374 AC_REQUIRE([gl_VISIBILITY])dnl
375 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
376 AC_REQUIRE([bh_C_SIGNED])dnl
377 AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
378 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
379 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
380 AC_REQUIRE([gt_TYPE_WINT_T])dnl
381 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
382 AC_REQUIRE([gt_TYPE_INTMAX_T])
383 AC_REQUIRE([gt_PRINTF_POSIX])
384 AC_REQUIRE([gl_GLIBC21])dnl
385 AC_REQUIRE([gl_XSIZE])dnl
386 AC_REQUIRE([gt_INTL_MACOSX])dnl
387
388 AC_CHECK_TYPE([ptrdiff_t], ,
389 [AC_DEFINE([ptrdiff_t], [long],
390 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
391 ])
392 AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
393 AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
394
395 dnl Use the _snprintf function only if it is declared (because on NetBSD it
396 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
397 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
398 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
399
400 dnl Use the *_unlocked functions only if they are declared.
401 dnl (because some of them were defined without being declared in Solaris
402 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
403 dnl on Solaris 2.5.1 to run on Solaris 2.6).
404 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
405 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
406
407 case $gt_cv_func_printf_posix in
408 *yes) HAVE_POSIX_PRINTF=1 ;;
409 *) HAVE_POSIX_PRINTF=0 ;;
410 esac
411 AC_SUBST([HAVE_POSIX_PRINTF])
412 if test "$ac_cv_func_asprintf" = yes; then
413 HAVE_ASPRINTF=1
414 else
415 HAVE_ASPRINTF=0
416 fi
417 AC_SUBST([HAVE_ASPRINTF])
418 if test "$ac_cv_func_snprintf" = yes; then
419 HAVE_SNPRINTF=1
420 else
421 HAVE_SNPRINTF=0
422 fi
423 AC_SUBST([HAVE_SNPRINTF])
424 if test "$ac_cv_func_wprintf" = yes; then
425 HAVE_WPRINTF=1
426 else
427 HAVE_WPRINTF=0
428 fi
429 AC_SUBST([HAVE_WPRINTF])
430
431 AM_LANGINFO_CODESET
432 gt_LC_MESSAGES
433
434 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
435 dnl 1. when we install a shared library, we must arrange to export
436 dnl auxiliary pointer variables for every exported variable,
437 dnl 2. when we install a shared library and a static library simultaneously,
438 dnl the include file specifies __declspec(dllimport) and therefore we
439 dnl must arrange to define the auxiliary pointer variables for the
440 dnl exported variables _also_ in the static library.
441 if test "$enable_shared" = yes; then
442 case "$host_os" in
443 cygwin*) is_woe32dll=yes ;;
444 *) is_woe32dll=no ;;
445 esac
446 else
447 is_woe32dll=no
448 fi
449 WOE32DLL=$is_woe32dll
450 AC_SUBST([WOE32DLL])
451
452 dnl Rename some macros and functions used for locking.
453 AH_BOTTOM([
454#define __libc_lock_t gl_lock_t
455#define __libc_lock_define gl_lock_define
456#define __libc_lock_define_initialized gl_lock_define_initialized
457#define __libc_lock_init gl_lock_init
458#define __libc_lock_lock gl_lock_lock
459#define __libc_lock_unlock gl_lock_unlock
460#define __libc_lock_recursive_t gl_recursive_lock_t
461#define __libc_lock_define_recursive gl_recursive_lock_define
462#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
463#define __libc_lock_init_recursive gl_recursive_lock_init
464#define __libc_lock_lock_recursive gl_recursive_lock_lock
465#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
466#define glthread_in_use libintl_thread_in_use
467#define glthread_lock_init libintl_lock_init
468#define glthread_lock_lock libintl_lock_lock
469#define glthread_lock_unlock libintl_lock_unlock
470#define glthread_lock_destroy libintl_lock_destroy
471#define glthread_rwlock_init libintl_rwlock_init
472#define glthread_rwlock_rdlock libintl_rwlock_rdlock
473#define glthread_rwlock_wrlock libintl_rwlock_wrlock
474#define glthread_rwlock_unlock libintl_rwlock_unlock
475#define glthread_rwlock_destroy libintl_rwlock_destroy
476#define glthread_recursive_lock_init libintl_recursive_lock_init
477#define glthread_recursive_lock_lock libintl_recursive_lock_lock
478#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
479#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
480#define glthread_once libintl_once
481#define glthread_once_call libintl_once_call
482#define glthread_once_singlethreaded libintl_once_singlethreaded
483])
484])
485
486
487dnl Checks for the core files of the intl subdirectory:
488dnl dcigettext.c
489dnl eval-plural.h
490dnl explodename.c
491dnl finddomain.c
492dnl gettextP.h
493dnl gmo.h
494dnl hash-string.h hash-string.c
495dnl l10nflist.c
496dnl libgnuintl.h.in (except the *printf stuff)
497dnl loadinfo.h
498dnl loadmsgcat.c
499dnl localealias.c
500dnl log.c
501dnl plural-exp.h plural-exp.c
502dnl plural.y
503dnl Used by libglocale.
504AC_DEFUN([gt_INTL_SUBDIR_CORE],
505[
506 AC_REQUIRE([AC_C_INLINE])dnl
507 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
508 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
509 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
510 AC_REQUIRE([AC_FUNC_MMAP])dnl
511 AC_REQUIRE([gt_INTDIV0])dnl
512 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
513 AC_REQUIRE([gl_HEADER_INTTYPES_H])dnl
514 AC_REQUIRE([gt_INTTYPES_PRI])dnl
515 AC_REQUIRE([gl_LOCK])dnl
516
517 AC_TRY_LINK(
518 [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
519 [],
520 [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
521 [Define to 1 if the compiler understands __builtin_expect.])])
522
523 AC_CHECK_HEADERS([argz.h limits.h unistd.h sys/param.h])
524 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
525 stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
526 argz_next __fsetlocking])
527
528 dnl Use the *_unlocked functions only if they are declared.
529 dnl (because some of them were defined without being declared in Solaris
530 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
531 dnl on Solaris 2.5.1 to run on Solaris 2.6).
532 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
533 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
534 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
535
536 AM_ICONV
537
538 dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
539 dnl and a _NL_LOCALE_NAME macro always.
540 AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
541 [AC_TRY_LINK([#include <langinfo.h>
542#include <locale.h>],
543 [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
544 gt_cv_nl_locale_name=yes,
545 gt_cv_nl_locale_name=no)
546 ])
547 if test $gt_cv_nl_locale_name = yes; then
548 AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
549 [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
550 fi
551
552 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
553 dnl because plural.y uses bison specific features. It requires at least
554 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
555 dnl compile.
556 dnl bison is only needed for the maintainer (who touches plural.y). But in
557 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
558 dnl the rule in general Makefile. Now, some people carelessly touch the
559 dnl files or have a broken "make" program, hence the plural.c rule will
560 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
561 dnl present or too old.
562 AC_CHECK_PROGS([INTLBISON], [bison])
563 if test -z "$INTLBISON"; then
564 ac_verc_fail=yes
565 else
566 dnl Found it, now check the version.
567 AC_MSG_CHECKING([version of bison])
568changequote(<<,>>)dnl
569 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
570 case $ac_prog_version in
571 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
572 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
573changequote([,])dnl
574 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
575 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
576 esac
577 AC_MSG_RESULT([$ac_prog_version])
578 fi
579 if test $ac_verc_fail = yes; then
580 INTLBISON=:
581 fi
582])
583
584
585dnl Checks for special options needed on MacOS X.
586dnl Defines INTL_MACOSX_LIBS.
587AC_DEFUN([gt_INTL_MACOSX],
588[
589 dnl Check for API introduced in MacOS X 10.2.
590 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
591 gt_cv_func_CFPreferencesCopyAppValue,
592 [gt_save_LIBS="$LIBS"
593 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
594 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
595 [CFPreferencesCopyAppValue(NULL, NULL)],
596 [gt_cv_func_CFPreferencesCopyAppValue=yes],
597 [gt_cv_func_CFPreferencesCopyAppValue=no])
598 LIBS="$gt_save_LIBS"])
599 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
600 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
601 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
602 fi
603 dnl Check for API introduced in MacOS X 10.3.
604 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
605 [gt_save_LIBS="$LIBS"
606 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
607 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
608 [gt_cv_func_CFLocaleCopyCurrent=yes],
609 [gt_cv_func_CFLocaleCopyCurrent=no])
610 LIBS="$gt_save_LIBS"])
611 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
612 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
613 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
614 fi
615 INTL_MACOSX_LIBS=
616 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
617 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
618 fi
619 AC_SUBST([INTL_MACOSX_LIBS])
620])
621
622
623dnl gt_CHECK_DECL(FUNC, INCLUDES)
624dnl Check whether a function is declared.
625AC_DEFUN([gt_CHECK_DECL],
626[
627 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
628 [AC_TRY_COMPILE([$2], [
629#ifndef $1
630 char *p = (char *) $1;
631#endif
632], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
633 if test $ac_cv_have_decl_$1 = yes; then
634 gt_value=1
635 else
636 gt_value=0
637 fi
638 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
639 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
640])
641
642
643dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
644AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
645
646# iconv.m4 serial AM4 (gettext-0.11.3)
647dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
648dnl This file is free software; the Free Software Foundation
649dnl gives unlimited permission to copy and/or distribute it,
650dnl with or without modifications, as long as this notice is preserved.
651
652dnl From Bruno Haible.
653
654AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
655[
656 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
657 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
658 AC_REQUIRE([AC_LIB_RPATH])
659
660 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
661 dnl accordingly.
662 AC_LIB_LINKFLAGS_BODY([iconv])
663])
664
665AC_DEFUN([AM_ICONV_LINK],
666[
667 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
668 dnl those with the standalone portable GNU libiconv installed).
669
670 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
671 dnl accordingly.
672 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
673
674 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
675 dnl because if the user has installed libiconv and not disabled its use
676 dnl via --without-libiconv-prefix, he wants to use it. The first
677 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
678 am_save_CPPFLAGS="$CPPFLAGS"
679 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
680
681 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
682 am_cv_func_iconv="no, consider installing GNU libiconv"
683 am_cv_lib_iconv=no
684 AC_TRY_LINK([#include <stdlib.h>
685#include <iconv.h>],
686 [iconv_t cd = iconv_open("","");
687 iconv(cd,NULL,NULL,NULL,NULL);
688 iconv_close(cd);],
689 am_cv_func_iconv=yes)
690 if test "$am_cv_func_iconv" != yes; then
691 am_save_LIBS="$LIBS"
692 LIBS="$LIBS $LIBICONV"
693 AC_TRY_LINK([#include <stdlib.h>
694#include <iconv.h>],
695 [iconv_t cd = iconv_open("","");
696 iconv(cd,NULL,NULL,NULL,NULL);
697 iconv_close(cd);],
698 am_cv_lib_iconv=yes
699 am_cv_func_iconv=yes)
700 LIBS="$am_save_LIBS"
701 fi
702 ])
703 if test "$am_cv_func_iconv" = yes; then
704 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
705 fi
706 if test "$am_cv_lib_iconv" = yes; then
707 AC_MSG_CHECKING([how to link with libiconv])
708 AC_MSG_RESULT([$LIBICONV])
709 else
710 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
711 dnl either.
712 CPPFLAGS="$am_save_CPPFLAGS"
713 LIBICONV=
714 LTLIBICONV=
715 fi
716 AC_SUBST(LIBICONV)
717 AC_SUBST(LTLIBICONV)
718])
719
720AC_DEFUN([AM_ICONV],
721[
722 AM_ICONV_LINK
723 if test "$am_cv_func_iconv" = yes; then
724 AC_MSG_CHECKING([for iconv declaration])
725 AC_CACHE_VAL(am_cv_proto_iconv, [
726 AC_TRY_COMPILE([
727#include <stdlib.h>
728#include <iconv.h>
729extern
730#ifdef __cplusplus
731"C"
732#endif
733#if defined(__STDC__) || defined(__cplusplus)
734size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
735#else
736size_t iconv();
737#endif
738], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
739 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
740 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
741 AC_MSG_RESULT([$]{ac_t:-
742 }[$]am_cv_proto_iconv)
743 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
744 [Define as const if the declaration of iconv() needs const.])
745 fi
746])
747
748# lib-ld.m4 serial 3 (gettext-0.13)
749dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
750dnl This file is free software; the Free Software Foundation
751dnl gives unlimited permission to copy and/or distribute it,
752dnl with or without modifications, as long as this notice is preserved.
753
754dnl Subroutines of libtool.m4,
755dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
756dnl with libtool.m4.
757
758dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
759AC_DEFUN([AC_LIB_PROG_LD_GNU],
760[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
761[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
762case `$LD -v 2>&1 </dev/null` in
763*GNU* | *'with BFD'*)
764 acl_cv_prog_gnu_ld=yes ;;
765*)
766 acl_cv_prog_gnu_ld=no ;;
767esac])
768with_gnu_ld=$acl_cv_prog_gnu_ld
769])
770
771dnl From libtool-1.4. Sets the variable LD.
772AC_DEFUN([AC_LIB_PROG_LD],
773[AC_ARG_WITH(gnu-ld,
774[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
775test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
776AC_REQUIRE([AC_PROG_CC])dnl
777AC_REQUIRE([AC_CANONICAL_HOST])dnl
778# Prepare PATH_SEPARATOR.
779# The user is always right.
780if test "${PATH_SEPARATOR+set}" != set; then
781 echo "#! /bin/sh" >conf$$.sh
782 echo "exit 0" >>conf$$.sh
783 chmod +x conf$$.sh
784 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
785 PATH_SEPARATOR=';'
786 else
787 PATH_SEPARATOR=:
788 fi
789 rm -f conf$$.sh
790fi
791ac_prog=ld
792if test "$GCC" = yes; then
793 # Check if gcc -print-prog-name=ld gives a path.
794 AC_MSG_CHECKING([for ld used by GCC])
795 case $host in
796 *-*-mingw*)
797 # gcc leaves a trailing carriage return which upsets mingw
798 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
799 *)
800 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
801 esac
802 case $ac_prog in
803 # Accept absolute paths.
804 [[\\/]* | [A-Za-z]:[\\/]*)]
805 [re_direlt='/[^/][^/]*/\.\./']
806 # Canonicalize the path of ld
807 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
808 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
809 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
810 done
811 test -z "$LD" && LD="$ac_prog"
812 ;;
813 "")
814 # If it fails, then pretend we aren't using GCC.
815 ac_prog=ld
816 ;;
817 *)
818 # If it is relative, then search for the first ld in PATH.
819 with_gnu_ld=unknown
820 ;;
821 esac
822elif test "$with_gnu_ld" = yes; then
823 AC_MSG_CHECKING([for GNU ld])
824else
825 AC_MSG_CHECKING([for non-GNU ld])
826fi
827AC_CACHE_VAL(acl_cv_path_LD,
828[if test -z "$LD"; then
829 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
830 for ac_dir in $PATH; do
831 test -z "$ac_dir" && ac_dir=.
832 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
833 acl_cv_path_LD="$ac_dir/$ac_prog"
834 # Check to see if the program is GNU ld. I'd rather use --version,
835 # but apparently some GNU ld's only accept -v.
836 # Break only if it was the GNU/non-GNU ld that we prefer.
837 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
838 *GNU* | *'with BFD'*)
839 test "$with_gnu_ld" != no && break ;;
840 *)
841 test "$with_gnu_ld" != yes && break ;;
842 esac
843 fi
844 done
845 IFS="$ac_save_ifs"
846else
847 acl_cv_path_LD="$LD" # Let the user override the test with a path.
848fi])
849LD="$acl_cv_path_LD"
850if test -n "$LD"; then
851 AC_MSG_RESULT($LD)
852else
853 AC_MSG_RESULT(no)
854fi
855test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
856AC_LIB_PROG_LD_GNU
857])
858
859# lib-link.m4 serial 8 (gettext-0.15)
860dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
861dnl This file is free software; the Free Software Foundation
862dnl gives unlimited permission to copy and/or distribute it,
863dnl with or without modifications, as long as this notice is preserved.
864
865dnl From Bruno Haible.
866
867AC_PREREQ(2.50)
868
869dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
870dnl the libraries corresponding to explicit and implicit dependencies.
871dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
872dnl augments the CPPFLAGS variable.
873AC_DEFUN([AC_LIB_LINKFLAGS],
874[
875 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
876 AC_REQUIRE([AC_LIB_RPATH])
877 define([Name],[translit([$1],[./-], [___])])
878 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
879 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
880 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
881 AC_LIB_LINKFLAGS_BODY([$1], [$2])
882 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
883 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
884 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
885 ])
886 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
887 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
888 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
889 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
890 AC_SUBST([LIB]NAME)
891 AC_SUBST([LTLIB]NAME)
892 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
893 dnl results of this search when this library appears as a dependency.
894 HAVE_LIB[]NAME=yes
895 undefine([Name])
896 undefine([NAME])
897])
898
899dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
900dnl searches for libname and the libraries corresponding to explicit and
901dnl implicit dependencies, together with the specified include files and
902dnl the ability to compile and link the specified testcode. If found, it
903dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
904dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
905dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
906dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
907AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
908[
909 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
910 AC_REQUIRE([AC_LIB_RPATH])
911 define([Name],[translit([$1],[./-], [___])])
912 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
913 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
914
915 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
916 dnl accordingly.
917 AC_LIB_LINKFLAGS_BODY([$1], [$2])
918
919 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
920 dnl because if the user has installed lib[]Name and not disabled its use
921 dnl via --without-lib[]Name-prefix, he wants to use it.
922 ac_save_CPPFLAGS="$CPPFLAGS"
923 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
924
925 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
926 ac_save_LIBS="$LIBS"
927 LIBS="$LIBS $LIB[]NAME"
928 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
929 LIBS="$ac_save_LIBS"
930 ])
931 if test "$ac_cv_lib[]Name" = yes; then
932 HAVE_LIB[]NAME=yes
933 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
934 AC_MSG_CHECKING([how to link with lib[]$1])
935 AC_MSG_RESULT([$LIB[]NAME])
936 else
937 HAVE_LIB[]NAME=no
938 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
939 dnl $INC[]NAME either.
940 CPPFLAGS="$ac_save_CPPFLAGS"
941 LIB[]NAME=
942 LTLIB[]NAME=
943 fi
944 AC_SUBST([HAVE_LIB]NAME)
945 AC_SUBST([LIB]NAME)
946 AC_SUBST([LTLIB]NAME)
947 undefine([Name])
948 undefine([NAME])
949])
950
951dnl Determine the platform dependent parameters needed to use rpath:
952dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
953dnl hardcode_direct, hardcode_minus_L.
954AC_DEFUN([AC_LIB_RPATH],
955[
956 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
957 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
958 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
959 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
960 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
961 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
962 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
963 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
964 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
965 . ./conftest.sh
966 rm -f ./conftest.sh
967 acl_cv_rpath=done
968 ])
969 wl="$acl_cv_wl"
970 libext="$acl_cv_libext"
971 shlibext="$acl_cv_shlibext"
972 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
973 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
974 hardcode_direct="$acl_cv_hardcode_direct"
975 hardcode_minus_L="$acl_cv_hardcode_minus_L"
976 dnl Determine whether the user wants rpath handling at all.
977 AC_ARG_ENABLE(rpath,
978 [ --disable-rpath do not hardcode runtime library paths],
979 :, enable_rpath=yes)
980])
981
982dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
983dnl the libraries corresponding to explicit and implicit dependencies.
984dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
985AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
986[
987 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
988 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
989 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
990 dnl By default, look in $includedir and $libdir.
991 use_additional=yes
992 AC_LIB_WITH_FINAL_PREFIX([
993 eval additional_includedir=\"$includedir\"
994 eval additional_libdir=\"$libdir\"
995 ])
996 AC_LIB_ARG_WITH([lib$1-prefix],
997[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
998 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
999[
1000 if test "X$withval" = "Xno"; then
1001 use_additional=no
1002 else
1003 if test "X$withval" = "X"; then
1004 AC_LIB_WITH_FINAL_PREFIX([
1005 eval additional_includedir=\"$includedir\"
1006 eval additional_libdir=\"$libdir\"
1007 ])
1008 else
1009 additional_includedir="$withval/include"
1010 additional_libdir="$withval/$acl_libdirstem"
1011 fi
1012 fi
1013])
1014 dnl Search the library and its dependencies in $additional_libdir and
1015 dnl $LDFLAGS. Using breadth-first-seach.
1016 LIB[]NAME=
1017 LTLIB[]NAME=
1018 INC[]NAME=
1019 rpathdirs=
1020 ltrpathdirs=
1021 names_already_handled=
1022 names_next_round='$1 $2'
1023 while test -n "$names_next_round"; do
1024 names_this_round="$names_next_round"
1025 names_next_round=
1026 for name in $names_this_round; do
1027 already_handled=
1028 for n in $names_already_handled; do
1029 if test "$n" = "$name"; then
1030 already_handled=yes
1031 break
1032 fi
1033 done
1034 if test -z "$already_handled"; then
1035 names_already_handled="$names_already_handled $name"
1036 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1037 dnl or AC_LIB_HAVE_LINKFLAGS call.
1038 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1039 eval value=\"\$HAVE_LIB$uppername\"
1040 if test -n "$value"; then
1041 if test "$value" = yes; then
1042 eval value=\"\$LIB$uppername\"
1043 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1044 eval value=\"\$LTLIB$uppername\"
1045 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1046 else
1047 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1048 dnl that this library doesn't exist. So just drop it.
1049 :
1050 fi
1051 else
1052 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1053 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1054 found_dir=
1055 found_la=
1056 found_so=
1057 found_a=
1058 if test $use_additional = yes; then
1059 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1060 found_dir="$additional_libdir"
1061 found_so="$additional_libdir/lib$name.$shlibext"
1062 if test -f "$additional_libdir/lib$name.la"; then
1063 found_la="$additional_libdir/lib$name.la"
1064 fi
1065 else
1066 if test -f "$additional_libdir/lib$name.$libext"; then
1067 found_dir="$additional_libdir"
1068 found_a="$additional_libdir/lib$name.$libext"
1069 if test -f "$additional_libdir/lib$name.la"; then
1070 found_la="$additional_libdir/lib$name.la"
1071 fi
1072 fi
1073 fi
1074 fi
1075 if test "X$found_dir" = "X"; then
1076 for x in $LDFLAGS $LTLIB[]NAME; do
1077 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1078 case "$x" in
1079 -L*)
1080 dir=`echo "X$x" | sed -e 's/^X-L//'`
1081 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1082 found_dir="$dir"
1083 found_so="$dir/lib$name.$shlibext"
1084 if test -f "$dir/lib$name.la"; then
1085 found_la="$dir/lib$name.la"
1086 fi
1087 else
1088 if test -f "$dir/lib$name.$libext"; then
1089 found_dir="$dir"
1090 found_a="$dir/lib$name.$libext"
1091 if test -f "$dir/lib$name.la"; then
1092 found_la="$dir/lib$name.la"
1093 fi
1094 fi
1095 fi
1096 ;;
1097 esac
1098 if test "X$found_dir" != "X"; then
1099 break
1100 fi
1101 done
1102 fi
1103 if test "X$found_dir" != "X"; then
1104 dnl Found the library.
1105 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1106 if test "X$found_so" != "X"; then
1107 dnl Linking with a shared library. We attempt to hardcode its
1108 dnl directory into the executable's runpath, unless it's the
1109 dnl standard /usr/lib.
1110 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
1111 dnl No hardcoding is needed.
1112 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1113 else
1114 dnl Use an explicit option to hardcode DIR into the resulting
1115 dnl binary.
1116 dnl Potentially add DIR to ltrpathdirs.
1117 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1118 haveit=
1119 for x in $ltrpathdirs; do
1120 if test "X$x" = "X$found_dir"; then
1121 haveit=yes
1122 break
1123 fi
1124 done
1125 if test -z "$haveit"; then
1126 ltrpathdirs="$ltrpathdirs $found_dir"
1127 fi
1128 dnl The hardcoding into $LIBNAME is system dependent.
1129 if test "$hardcode_direct" = yes; then
1130 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1131 dnl resulting binary.
1132 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1133 else
1134 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1135 dnl Use an explicit option to hardcode DIR into the resulting
1136 dnl binary.
1137 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1138 dnl Potentially add DIR to rpathdirs.
1139 dnl The rpathdirs will be appended to $LIBNAME at the end.
1140 haveit=
1141 for x in $rpathdirs; do
1142 if test "X$x" = "X$found_dir"; then
1143 haveit=yes
1144 break
1145 fi
1146 done
1147 if test -z "$haveit"; then
1148 rpathdirs="$rpathdirs $found_dir"
1149 fi
1150 else
1151 dnl Rely on "-L$found_dir".
1152 dnl But don't add it if it's already contained in the LDFLAGS
1153 dnl or the already constructed $LIBNAME
1154 haveit=
1155 for x in $LDFLAGS $LIB[]NAME; do
1156 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1157 if test "X$x" = "X-L$found_dir"; then
1158 haveit=yes
1159 break
1160 fi
1161 done
1162 if test -z "$haveit"; then
1163 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1164 fi
1165 if test "$hardcode_minus_L" != no; then
1166 dnl FIXME: Not sure whether we should use
1167 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1168 dnl here.
1169 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1170 else
1171 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1172 dnl here, because this doesn't fit in flags passed to the
1173 dnl compiler. So give up. No hardcoding. This affects only
1174 dnl very old systems.
1175 dnl FIXME: Not sure whether we should use
1176 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1177 dnl here.
1178 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1179 fi
1180 fi
1181 fi
1182 fi
1183 else
1184 if test "X$found_a" != "X"; then
1185 dnl Linking with a static library.
1186 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1187 else
1188 dnl We shouldn't come here, but anyway it's good to have a
1189 dnl fallback.
1190 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1191 fi
1192 fi
1193 dnl Assume the include files are nearby.
1194 additional_includedir=
1195 case "$found_dir" in
1196 */$acl_libdirstem | */$acl_libdirstem/)
1197 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1198 additional_includedir="$basedir/include"
1199 ;;
1200 esac
1201 if test "X$additional_includedir" != "X"; then
1202 dnl Potentially add $additional_includedir to $INCNAME.
1203 dnl But don't add it
1204 dnl 1. if it's the standard /usr/include,
1205 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1206 dnl 3. if it's already present in $CPPFLAGS or the already
1207 dnl constructed $INCNAME,
1208 dnl 4. if it doesn't exist as a directory.
1209 if test "X$additional_includedir" != "X/usr/include"; then
1210 haveit=
1211 if test "X$additional_includedir" = "X/usr/local/include"; then
1212 if test -n "$GCC"; then
1213 case $host_os in
1214 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1215 esac
1216 fi
1217 fi
1218 if test -z "$haveit"; then
1219 for x in $CPPFLAGS $INC[]NAME; do
1220 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1221 if test "X$x" = "X-I$additional_includedir"; then
1222 haveit=yes
1223 break
1224 fi
1225 done
1226 if test -z "$haveit"; then
1227 if test -d "$additional_includedir"; then
1228 dnl Really add $additional_includedir to $INCNAME.
1229 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1230 fi
1231 fi
1232 fi
1233 fi
1234 fi
1235 dnl Look for dependencies.
1236 if test -n "$found_la"; then
1237 dnl Read the .la file. It defines the variables
1238 dnl dlname, library_names, old_library, dependency_libs, current,
1239 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1240 save_libdir="$libdir"
1241 case "$found_la" in
1242 */* | *\\*) . "$found_la" ;;
1243 *) . "./$found_la" ;;
1244 esac
1245 libdir="$save_libdir"
1246 dnl We use only dependency_libs.
1247 for dep in $dependency_libs; do
1248 case "$dep" in
1249 -L*)
1250 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1251 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1252 dnl But don't add it
1253 dnl 1. if it's the standard /usr/lib,
1254 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1255 dnl 3. if it's already present in $LDFLAGS or the already
1256 dnl constructed $LIBNAME,
1257 dnl 4. if it doesn't exist as a directory.
1258 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1259 haveit=
1260 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1261 if test -n "$GCC"; then
1262 case $host_os in
1263 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1264 esac
1265 fi
1266 fi
1267 if test -z "$haveit"; then
1268 haveit=
1269 for x in $LDFLAGS $LIB[]NAME; do
1270 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1271 if test "X$x" = "X-L$additional_libdir"; then
1272 haveit=yes
1273 break
1274 fi
1275 done
1276 if test -z "$haveit"; then
1277 if test -d "$additional_libdir"; then
1278 dnl Really add $additional_libdir to $LIBNAME.
1279 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1280 fi
1281 fi
1282 haveit=
1283 for x in $LDFLAGS $LTLIB[]NAME; do
1284 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1285 if test "X$x" = "X-L$additional_libdir"; then
1286 haveit=yes
1287 break
1288 fi
1289 done
1290 if test -z "$haveit"; then
1291 if test -d "$additional_libdir"; then
1292 dnl Really add $additional_libdir to $LTLIBNAME.
1293 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1294 fi
1295 fi
1296 fi
1297 fi
1298 ;;
1299 -R*)
1300 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1301 if test "$enable_rpath" != no; then
1302 dnl Potentially add DIR to rpathdirs.
1303 dnl The rpathdirs will be appended to $LIBNAME at the end.
1304 haveit=
1305 for x in $rpathdirs; do
1306 if test "X$x" = "X$dir"; then
1307 haveit=yes
1308 break
1309 fi
1310 done
1311 if test -z "$haveit"; then
1312 rpathdirs="$rpathdirs $dir"
1313 fi
1314 dnl Potentially add DIR to ltrpathdirs.
1315 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1316 haveit=
1317 for x in $ltrpathdirs; do
1318 if test "X$x" = "X$dir"; then
1319 haveit=yes
1320 break
1321 fi
1322 done
1323 if test -z "$haveit"; then
1324 ltrpathdirs="$ltrpathdirs $dir"
1325 fi
1326 fi
1327 ;;
1328 -l*)
1329 dnl Handle this in the next round.
1330 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1331 ;;
1332 *.la)
1333 dnl Handle this in the next round. Throw away the .la's
1334 dnl directory; it is already contained in a preceding -L
1335 dnl option.
1336 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1337 ;;
1338 *)
1339 dnl Most likely an immediate library name.
1340 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1341 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1342 ;;
1343 esac
1344 done
1345 fi
1346 else
1347 dnl Didn't find the library; assume it is in the system directories
1348 dnl known to the linker and runtime loader. (All the system
1349 dnl directories known to the linker should also be known to the
1350 dnl runtime loader, otherwise the system is severely misconfigured.)
1351 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1352 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1353 fi
1354 fi
1355 fi
1356 done
1357 done
1358 if test "X$rpathdirs" != "X"; then
1359 if test -n "$hardcode_libdir_separator"; then
1360 dnl Weird platform: only the last -rpath option counts, the user must
1361 dnl pass all path elements in one option. We can arrange that for a
1362 dnl single library, but not when more than one $LIBNAMEs are used.
1363 alldirs=
1364 for found_dir in $rpathdirs; do
1365 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1366 done
1367 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1368 acl_save_libdir="$libdir"
1369 libdir="$alldirs"
1370 eval flag=\"$hardcode_libdir_flag_spec\"
1371 libdir="$acl_save_libdir"
1372 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1373 else
1374 dnl The -rpath options are cumulative.
1375 for found_dir in $rpathdirs; do
1376 acl_save_libdir="$libdir"
1377 libdir="$found_dir"
1378 eval flag=\"$hardcode_libdir_flag_spec\"
1379 libdir="$acl_save_libdir"
1380 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1381 done
1382 fi
1383 fi
1384 if test "X$ltrpathdirs" != "X"; then
1385 dnl When using libtool, the option that works for both libraries and
1386 dnl executables is -R. The -R options are cumulative.
1387 for found_dir in $ltrpathdirs; do
1388 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1389 done
1390 fi
1391])
1392
1393dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1394dnl unless already present in VAR.
1395dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1396dnl contains two or three consecutive elements that belong together.
1397AC_DEFUN([AC_LIB_APPENDTOVAR],
1398[
1399 for element in [$2]; do
1400 haveit=
1401 for x in $[$1]; do
1402 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1403 if test "X$x" = "X$element"; then
1404 haveit=yes
1405 break
1406 fi
1407 done
1408 if test -z "$haveit"; then
1409 [$1]="${[$1]}${[$1]:+ }$element"
1410 fi
1411 done
1412])
1413
1414dnl For those cases where a variable contains several -L and -l options
1415dnl referring to unknown libraries and directories, this macro determines the
1416dnl necessary additional linker options for the runtime path.
1417dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1418dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1419dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1420dnl otherwise linking without libtool is assumed.
1421AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1422[
1423 AC_REQUIRE([AC_LIB_RPATH])
1424 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1425 $1=
1426 if test "$enable_rpath" != no; then
1427 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1428 dnl Use an explicit option to hardcode directories into the resulting
1429 dnl binary.
1430 rpathdirs=
1431 next=
1432 for opt in $2; do
1433 if test -n "$next"; then
1434 dir="$next"
1435 dnl No need to hardcode the standard /usr/lib.
1436 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1437 rpathdirs="$rpathdirs $dir"
1438 fi
1439 next=
1440 else
1441 case $opt in
1442 -L) next=yes ;;
1443 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1444 dnl No need to hardcode the standard /usr/lib.
1445 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1446 rpathdirs="$rpathdirs $dir"
1447 fi
1448 next= ;;
1449 *) next= ;;
1450 esac
1451 fi
1452 done
1453 if test "X$rpathdirs" != "X"; then
1454 if test -n ""$3""; then
1455 dnl libtool is used for linking. Use -R options.
1456 for dir in $rpathdirs; do
1457 $1="${$1}${$1:+ }-R$dir"
1458 done
1459 else
1460 dnl The linker is used for linking directly.
1461 if test -n "$hardcode_libdir_separator"; then
1462 dnl Weird platform: only the last -rpath option counts, the user
1463 dnl must pass all path elements in one option.
1464 alldirs=
1465 for dir in $rpathdirs; do
1466 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
1467 done
1468 acl_save_libdir="$libdir"
1469 libdir="$alldirs"
1470 eval flag=\"$hardcode_libdir_flag_spec\"
1471 libdir="$acl_save_libdir"
1472 $1="$flag"
1473 else
1474 dnl The -rpath options are cumulative.
1475 for dir in $rpathdirs; do
1476 acl_save_libdir="$libdir"
1477 libdir="$dir"
1478 eval flag=\"$hardcode_libdir_flag_spec\"
1479 libdir="$acl_save_libdir"
1480 $1="${$1}${$1:+ }$flag"
1481 done
1482 fi
1483 fi
1484 fi
1485 fi
1486 fi
1487 AC_SUBST([$1])
1488])
1489
1490# lib-prefix.m4 serial 5 (gettext-0.15)
1491dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1492dnl This file is free software; the Free Software Foundation
1493dnl gives unlimited permission to copy and/or distribute it,
1494dnl with or without modifications, as long as this notice is preserved.
1495
1496dnl From Bruno Haible.
1497
1498dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1499dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1500dnl require excessive bracketing.
1501ifdef([AC_HELP_STRING],
1502[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1503[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1504
1505dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1506dnl to access previously installed libraries. The basic assumption is that
1507dnl a user will want packages to use other packages he previously installed
1508dnl with the same --prefix option.
1509dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1510dnl libraries, but is otherwise very convenient.
1511AC_DEFUN([AC_LIB_PREFIX],
1512[
1513 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1514 AC_REQUIRE([AC_PROG_CC])
1515 AC_REQUIRE([AC_CANONICAL_HOST])
1516 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1517 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1518 dnl By default, look in $includedir and $libdir.
1519 use_additional=yes
1520 AC_LIB_WITH_FINAL_PREFIX([
1521 eval additional_includedir=\"$includedir\"
1522 eval additional_libdir=\"$libdir\"
1523 ])
1524 AC_LIB_ARG_WITH([lib-prefix],
1525[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1526 --without-lib-prefix don't search for libraries in includedir and libdir],
1527[
1528 if test "X$withval" = "Xno"; then
1529 use_additional=no
1530 else
1531 if test "X$withval" = "X"; then
1532 AC_LIB_WITH_FINAL_PREFIX([
1533 eval additional_includedir=\"$includedir\"
1534 eval additional_libdir=\"$libdir\"
1535 ])
1536 else
1537 additional_includedir="$withval/include"
1538 additional_libdir="$withval/$acl_libdirstem"
1539 fi
1540 fi
1541])
1542 if test $use_additional = yes; then
1543 dnl Potentially add $additional_includedir to $CPPFLAGS.
1544 dnl But don't add it
1545 dnl 1. if it's the standard /usr/include,
1546 dnl 2. if it's already present in $CPPFLAGS,
1547 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1548 dnl 4. if it doesn't exist as a directory.
1549 if test "X$additional_includedir" != "X/usr/include"; then
1550 haveit=
1551 for x in $CPPFLAGS; do
1552 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1553 if test "X$x" = "X-I$additional_includedir"; then
1554 haveit=yes
1555 break
1556 fi
1557 done
1558 if test -z "$haveit"; then
1559 if test "X$additional_includedir" = "X/usr/local/include"; then
1560 if test -n "$GCC"; then
1561 case $host_os in
1562 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1563 esac
1564 fi
1565 fi
1566 if test -z "$haveit"; then
1567 if test -d "$additional_includedir"; then
1568 dnl Really add $additional_includedir to $CPPFLAGS.
1569 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1570 fi
1571 fi
1572 fi
1573 fi
1574 dnl Potentially add $additional_libdir to $LDFLAGS.
1575 dnl But don't add it
1576 dnl 1. if it's the standard /usr/lib,
1577 dnl 2. if it's already present in $LDFLAGS,
1578 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1579 dnl 4. if it doesn't exist as a directory.
1580 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1581 haveit=
1582 for x in $LDFLAGS; do
1583 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1584 if test "X$x" = "X-L$additional_libdir"; then
1585 haveit=yes
1586 break
1587 fi
1588 done
1589 if test -z "$haveit"; then
1590 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1591 if test -n "$GCC"; then
1592 case $host_os in
1593 linux*) haveit=yes;;
1594 esac
1595 fi
1596 fi
1597 if test -z "$haveit"; then
1598 if test -d "$additional_libdir"; then
1599 dnl Really add $additional_libdir to $LDFLAGS.
1600 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1601 fi
1602 fi
1603 fi
1604 fi
1605 fi
1606])
1607
1608dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1609dnl acl_final_exec_prefix, containing the values to which $prefix and
1610dnl $exec_prefix will expand at the end of the configure script.
1611AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1612[
1613 dnl Unfortunately, prefix and exec_prefix get only finally determined
1614 dnl at the end of configure.
1615 if test "X$prefix" = "XNONE"; then
1616 acl_final_prefix="$ac_default_prefix"
1617 else
1618 acl_final_prefix="$prefix"
1619 fi
1620 if test "X$exec_prefix" = "XNONE"; then
1621 acl_final_exec_prefix='${prefix}'
1622 else
1623 acl_final_exec_prefix="$exec_prefix"
1624 fi
1625 acl_save_prefix="$prefix"
1626 prefix="$acl_final_prefix"
1627 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1628 prefix="$acl_save_prefix"
1629])
1630
1631dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1632dnl variables prefix and exec_prefix bound to the values they will have
1633dnl at the end of the configure script.
1634AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1635[
1636 acl_save_prefix="$prefix"
1637 prefix="$acl_final_prefix"
1638 acl_save_exec_prefix="$exec_prefix"
1639 exec_prefix="$acl_final_exec_prefix"
1640 $1
1641 exec_prefix="$acl_save_exec_prefix"
1642 prefix="$acl_save_prefix"
1643])
1644
1645dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
1646dnl the basename of the libdir, either "lib" or "lib64".
1647AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1648[
1649 dnl There is no formal standard regarding lib and lib64. The current
1650 dnl practice is that on a system supporting 32-bit and 64-bit instruction
1651 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
1652 dnl libraries go under $prefix/lib. We determine the compiler's default
1653 dnl mode by looking at the compiler's library search path. If at least
1654 dnl of its elements ends in /lib64 or points to a directory whose absolute
1655 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
1656 dnl default, namely "lib".
1657 acl_libdirstem=lib
1658 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1659 if test -n "$searchpath"; then
1660 acl_save_IFS="${IFS= }"; IFS=":"
1661 for searchdir in $searchpath; do
1662 if test -d "$searchdir"; then
1663 case "$searchdir" in
1664 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1665 *) searchdir=`cd "$searchdir" && pwd`
1666 case "$searchdir" in
1667 */lib64 ) acl_libdirstem=lib64 ;;
1668 esac ;;
1669 esac
1670 fi
1671 done
1672 IFS="$acl_save_IFS"
1673 fi
1674])
1675
1676# nls.m4 serial 3 (gettext-0.15)
1677dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
1678dnl This file is free software; the Free Software Foundation
1679dnl gives unlimited permission to copy and/or distribute it,
1680dnl with or without modifications, as long as this notice is preserved.
1681dnl
1682dnl This file can can be used in projects which are not available under
1683dnl the GNU General Public License or the GNU Library General Public
1684dnl License but which still want to provide support for the GNU gettext
1685dnl functionality.
1686dnl Please note that the actual code of the GNU gettext library is covered
1687dnl by the GNU Library General Public License, and the rest of the GNU
1688dnl gettext package package is covered by the GNU General Public License.
1689dnl They are *not* in the public domain.
1690
1691dnl Authors:
1692dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1693dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1694
1695AC_PREREQ(2.50)
1696
1697AC_DEFUN([AM_NLS],
1698[
1699 AC_MSG_CHECKING([whether NLS is requested])
1700 dnl Default is enabled NLS
1701 AC_ARG_ENABLE(nls,
1702 [ --disable-nls do not use Native Language Support],
1703 USE_NLS=$enableval, USE_NLS=yes)
1704 AC_MSG_RESULT($USE_NLS)
1705 AC_SUBST(USE_NLS)
1706])
1707
1708# po.m4 serial 13 (gettext-0.15)
1709dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
1710dnl This file is free software; the Free Software Foundation
1711dnl gives unlimited permission to copy and/or distribute it,
1712dnl with or without modifications, as long as this notice is preserved.
1713dnl
1714dnl This file can can be used in projects which are not available under
1715dnl the GNU General Public License or the GNU Library General Public
1716dnl License but which still want to provide support for the GNU gettext
1717dnl functionality.
1718dnl Please note that the actual code of the GNU gettext library is covered
1719dnl by the GNU Library General Public License, and the rest of the GNU
1720dnl gettext package package is covered by the GNU General Public License.
1721dnl They are *not* in the public domain.
1722
1723dnl Authors:
1724dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1725dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1726
1727AC_PREREQ(2.50)
1728
1729dnl Checks for all prerequisites of the po subdirectory.
1730AC_DEFUN([AM_PO_SUBDIRS],
1731[
1732 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1733 AC_REQUIRE([AC_PROG_INSTALL])dnl
1734 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
1735 AC_REQUIRE([AM_NLS])dnl
1736
1737 dnl Perform the following tests also if --disable-nls has been given,
1738 dnl because they are needed for "make dist" to work.
1739
1740 dnl Search for GNU msgfmt in the PATH.
1741 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1742 dnl The second test excludes FreeBSD msgfmt.
1743 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1744 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1745 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1746 :)
1747 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1748
1749 dnl Test whether it is GNU msgfmt >= 0.15.
1750changequote(,)dnl
1751 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1752 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
1753 *) MSGFMT_015=$MSGFMT ;;
1754 esac
1755changequote([,])dnl
1756 AC_SUBST([MSGFMT_015])
1757changequote(,)dnl
1758 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1759 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
1760 *) GMSGFMT_015=$GMSGFMT ;;
1761 esac
1762changequote([,])dnl
1763 AC_SUBST([GMSGFMT_015])
1764
1765 dnl Search for GNU xgettext 0.12 or newer in the PATH.
1766 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1767 dnl The second test excludes FreeBSD xgettext.
1768 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1769 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1770 (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1771 :)
1772 dnl Remove leftover from FreeBSD xgettext call.
1773 rm -f messages.po
1774
1775 dnl Test whether it is GNU xgettext >= 0.15.
1776changequote(,)dnl
1777 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1778 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
1779 *) XGETTEXT_015=$XGETTEXT ;;
1780 esac
1781changequote([,])dnl
1782 AC_SUBST([XGETTEXT_015])
1783
1784 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1785 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1786 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
1787
1788 dnl Installation directories.
1789 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
1790 dnl have to define it here, so that it can be used in po/Makefile.
1791 test -n "$localedir" || localedir='${datadir}/locale'
1792 AC_SUBST([localedir])
1793
1794 AC_CONFIG_COMMANDS([po-directories], [[
1795 for ac_file in $CONFIG_FILES; do
1796 # Support "outfile[:infile[:infile...]]"
1797 case "$ac_file" in
1798 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1799 esac
1800 # PO directories have a Makefile.in generated from Makefile.in.in.
1801 case "$ac_file" in */Makefile.in)
1802 # Adjust a relative srcdir.
1803 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1804 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1805 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1806 # In autoconf-2.13 it is called $ac_given_srcdir.
1807 # In autoconf-2.50 it is called $srcdir.
1808 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1809 case "$ac_given_srcdir" in
1810 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1811 /*) top_srcdir="$ac_given_srcdir" ;;
1812 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1813 esac
1814 # Treat a directory as a PO directory if and only if it has a
1815 # POTFILES.in file. This allows packages to have multiple PO
1816 # directories under different names or in different locations.
1817 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1818 rm -f "$ac_dir/POTFILES"
1819 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1820 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1821 POMAKEFILEDEPS="POTFILES.in"
1822 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1823 # on $ac_dir but don't depend on user-specified configuration
1824 # parameters.
1825 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1826 # The LINGUAS file contains the set of available languages.
1827 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1828 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1829 fi
1830 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1831 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1832 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1833 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1834 else
1835 # The set of available languages was given in configure.in.
1836 # Hide the ALL_LINGUAS assigment from automake < 1.5.
1837 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1838 fi
1839 # Compute POFILES
1840 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1841 # Compute UPDATEPOFILES
1842 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1843 # Compute DUMMYPOFILES
1844 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1845 # Compute GMOFILES
1846 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1847 case "$ac_given_srcdir" in
1848 .) srcdirpre= ;;
1849 *) srcdirpre='$(srcdir)/' ;;
1850 esac
1851 POFILES=
1852 UPDATEPOFILES=
1853 DUMMYPOFILES=
1854 GMOFILES=
1855 for lang in $ALL_LINGUAS; do
1856 POFILES="$POFILES $srcdirpre$lang.po"
1857 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1858 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1859 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1860 done
1861 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1862 # environment variable.
1863 INST_LINGUAS=
1864 if test -n "$ALL_LINGUAS"; then
1865 for presentlang in $ALL_LINGUAS; do
1866 useit=no
1867 if test "%UNSET%" != "$LINGUAS"; then
1868 desiredlanguages="$LINGUAS"
1869 else
1870 desiredlanguages="$ALL_LINGUAS"
1871 fi
1872 for desiredlang in $desiredlanguages; do
1873 # Use the presentlang catalog if desiredlang is
1874 # a. equal to presentlang, or
1875 # b. a variant of presentlang (because in this case,
1876 # presentlang can be used as a fallback for messages
1877 # which are not translated in the desiredlang catalog).
1878 case "$desiredlang" in
1879 "$presentlang"*) useit=yes;;
1880 esac
1881 done
1882 if test $useit = yes; then
1883 INST_LINGUAS="$INST_LINGUAS $presentlang"
1884 fi
1885 done
1886 fi
1887 CATALOGS=
1888 if test -n "$INST_LINGUAS"; then
1889 for lang in $INST_LINGUAS; do
1890 CATALOGS="$CATALOGS $lang.gmo"
1891 done
1892 fi
1893 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1894 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1895 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1896 if test -f "$f"; then
1897 case "$f" in
1898 *.orig | *.bak | *~) ;;
1899 *) cat "$f" >> "$ac_dir/Makefile" ;;
1900 esac
1901 fi
1902 done
1903 fi
1904 ;;
1905 esac
1906 done]],
1907 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1908 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
1909 # from automake < 1.5.
1910 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1911 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1912 LINGUAS="${LINGUAS-%UNSET%}"
1913 ])
1914])
1915
1916dnl Postprocesses a Makefile in a directory containing PO files.
1917AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
1918[
1919 # When this code is run, in config.status, two variables have already been
1920 # set:
1921 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
1922 # - LINGUAS is the value of the environment variable LINGUAS at configure
1923 # time.
1924
1925changequote(,)dnl
1926 # Adjust a relative srcdir.
1927 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1928 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1929 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1930 # In autoconf-2.13 it is called $ac_given_srcdir.
1931 # In autoconf-2.50 it is called $srcdir.
1932 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1933 case "$ac_given_srcdir" in
1934 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1935 /*) top_srcdir="$ac_given_srcdir" ;;
1936 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1937 esac
1938
1939 # Find a way to echo strings without interpreting backslash.
1940 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
1941 gt_echo='echo'
1942 else
1943 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
1944 gt_echo='printf %s\n'
1945 else
1946 echo_func () {
1947 cat <<EOT
1948$*
1949EOT
1950 }
1951 gt_echo='echo_func'
1952 fi
1953 fi
1954
1955 # A sed script that extracts the value of VARIABLE from a Makefile.
1956 sed_x_variable='
1957# Test if the hold space is empty.
1958x
1959s/P/P/
1960x
1961ta
1962# Yes it was empty. Look if we have the expected variable definition.
1963/^[ ]*VARIABLE[ ]*=/{
1964 # Seen the first line of the variable definition.
1965 s/^[ ]*VARIABLE[ ]*=//
1966 ba
1967}
1968bd
1969:a
1970# Here we are processing a line from the variable definition.
1971# Remove comment, more precisely replace it with a space.
1972s/#.*$/ /
1973# See if the line ends in a backslash.
1974tb
1975:b
1976s/\\$//
1977# Print the line, without the trailing backslash.
1978p
1979tc
1980# There was no trailing backslash. The end of the variable definition is
1981# reached. Clear the hold space.
1982s/^.*$//
1983x
1984bd
1985:c
1986# A trailing backslash means that the variable definition continues in the
1987# next line. Put a nonempty string into the hold space to indicate this.
1988s/^.*$/P/
1989x
1990:d
1991'
1992changequote([,])dnl
1993
1994 # Set POTFILES to the value of the Makefile variable POTFILES.
1995 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
1996 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
1997 # Compute POTFILES_DEPS as
1998 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
1999 POTFILES_DEPS=
2000 for file in $POTFILES; do
2001 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2002 done
2003 POMAKEFILEDEPS=""
2004
2005 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2006 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2007 fi
2008 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2009 # The LINGUAS file contains the set of available languages.
2010 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2011 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2012 else
2013 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2014 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2015 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2016 fi
2017 # Hide the ALL_LINGUAS assigment from automake < 1.5.
2018 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2019 # Compute POFILES
2020 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2021 # Compute UPDATEPOFILES
2022 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2023 # Compute DUMMYPOFILES
2024 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2025 # Compute GMOFILES
2026 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2027 # Compute PROPERTIESFILES
2028 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2029 # Compute CLASSFILES
2030 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2031 # Compute QMFILES
2032 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2033 # Compute MSGFILES
2034 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2035 # Compute RESOURCESDLLFILES
2036 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2037 case "$ac_given_srcdir" in
2038 .) srcdirpre= ;;
2039 *) srcdirpre='$(srcdir)/' ;;
2040 esac
2041 POFILES=
2042 UPDATEPOFILES=
2043 DUMMYPOFILES=
2044 GMOFILES=
2045 PROPERTIESFILES=
2046 CLASSFILES=
2047 QMFILES=
2048 MSGFILES=
2049 RESOURCESDLLFILES=
2050 for lang in $ALL_LINGUAS; do
2051 POFILES="$POFILES $srcdirpre$lang.po"
2052 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2053 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2054 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2055 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2056 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2057 QMFILES="$QMFILES $srcdirpre$lang.qm"
2058 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2059 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2060 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2061 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2062 done
2063 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2064 # environment variable.
2065 INST_LINGUAS=
2066 if test -n "$ALL_LINGUAS"; then
2067 for presentlang in $ALL_LINGUAS; do
2068 useit=no
2069 if test "%UNSET%" != "$LINGUAS"; then
2070 desiredlanguages="$LINGUAS"
2071 else
2072 desiredlanguages="$ALL_LINGUAS"
2073 fi
2074 for desiredlang in $desiredlanguages; do
2075 # Use the presentlang catalog if desiredlang is
2076 # a. equal to presentlang, or
2077 # b. a variant of presentlang (because in this case,
2078 # presentlang can be used as a fallback for messages
2079 # which are not translated in the desiredlang catalog).
2080 case "$desiredlang" in
2081 "$presentlang"*) useit=yes;;
2082 esac
2083 done
2084 if test $useit = yes; then
2085 INST_LINGUAS="$INST_LINGUAS $presentlang"
2086 fi
2087 done
2088 fi
2089 CATALOGS=
2090 JAVACATALOGS=
2091 QTCATALOGS=
2092 TCLCATALOGS=
2093 CSHARPCATALOGS=
2094 if test -n "$INST_LINGUAS"; then
2095 for lang in $INST_LINGUAS; do
2096 CATALOGS="$CATALOGS $lang.gmo"
2097 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2098 QTCATALOGS="$QTCATALOGS $lang.qm"
2099 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2100 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2101 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2102 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2103 done
2104 fi
2105
2106 sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
2107 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2108 # Add dependencies that cannot be formulated as a simple suffix rule.
2109 for lang in $ALL_LINGUAS; do
2110 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2111 cat >> "$ac_file.tmp" <<EOF
2112$frobbedlang.msg: $lang.po
2113 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2114 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2115EOF
2116 done
2117 fi
2118 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2119 # Add dependencies that cannot be formulated as a simple suffix rule.
2120 for lang in $ALL_LINGUAS; do
2121 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2122 cat >> "$ac_file.tmp" <<EOF
2123$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2124 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2125 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2126EOF
2127 done
2128 fi
2129 if test -n "$POMAKEFILEDEPS"; then
2130 cat >> "$ac_file.tmp" <<EOF
2131Makefile: $POMAKEFILEDEPS
2132EOF
2133 fi
2134 mv "$ac_file.tmp" "$ac_file"
2135])
2136
2137# progtest.m4 serial 4 (gettext-0.14.2)
2138dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
2139dnl This file is free software; the Free Software Foundation
2140dnl gives unlimited permission to copy and/or distribute it,
2141dnl with or without modifications, as long as this notice is preserved.
2142dnl
2143dnl This file can can be used in projects which are not available under
2144dnl the GNU General Public License or the GNU Library General Public
2145dnl License but which still want to provide support for the GNU gettext
2146dnl functionality.
2147dnl Please note that the actual code of the GNU gettext library is covered
2148dnl by the GNU Library General Public License, and the rest of the GNU
2149dnl gettext package package is covered by the GNU General Public License.
2150dnl They are *not* in the public domain.
2151
2152dnl Authors:
2153dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2154
2155AC_PREREQ(2.50)
2156
2157# Search path for a program which passes the given test.
2158
2159dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2160dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2161AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2162[
2163# Prepare PATH_SEPARATOR.
2164# The user is always right.
2165if test "${PATH_SEPARATOR+set}" != set; then
2166 echo "#! /bin/sh" >conf$$.sh
2167 echo "exit 0" >>conf$$.sh
2168 chmod +x conf$$.sh
2169 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2170 PATH_SEPARATOR=';'
2171 else
2172 PATH_SEPARATOR=:
2173 fi
2174 rm -f conf$$.sh
2175fi
2176
2177# Find out how to test for executable files. Don't use a zero-byte file,
2178# as systems may use methods other than mode bits to determine executability.
2179cat >conf$$.file <<_ASEOF
2180#! /bin/sh
2181exit 0
2182_ASEOF
2183chmod +x conf$$.file
2184if test -x conf$$.file >/dev/null 2>&1; then
2185 ac_executable_p="test -x"
2186else
2187 ac_executable_p="test -f"
2188fi
2189rm -f conf$$.file
2190
2191# Extract the first word of "$2", so it can be a program name with args.
2192set dummy $2; ac_word=[$]2
2193AC_MSG_CHECKING([for $ac_word])
2194AC_CACHE_VAL(ac_cv_path_$1,
2195[case "[$]$1" in
2196 [[\\/]]* | ?:[[\\/]]*)
2197 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2198 ;;
2199 *)
2200 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2201 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2202 IFS="$ac_save_IFS"
2203 test -z "$ac_dir" && ac_dir=.
2204 for ac_exec_ext in '' $ac_executable_extensions; do
2205 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2206 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2207 if [$3]; then
2208 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2209 break 2
2210 fi
2211 fi
2212 done
2213 done
2214 IFS="$ac_save_IFS"
2215dnl If no 4th arg is given, leave the cache variable unset,
2216dnl so AC_PATH_PROGS will keep looking.
2217ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2218])dnl
2219 ;;
2220esac])dnl
2221$1="$ac_cv_path_$1"
2222if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2223 AC_MSG_RESULT([$]$1)
2224else
2225 AC_MSG_RESULT(no)
2226fi
2227AC_SUBST($1)dnl
2228])
2229
2230# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
2231#
2232# This file is free software; the Free Software Foundation
2233# gives unlimited permission to copy and/or distribute it,
2234# with or without modifications, as long as this notice is preserved.
2235
2236# AM_PROG_MKDIR_P
2237# ---------------
2238# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
2239#
2240# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
2241# created by `make install' are always world readable, even if the
2242# installer happens to have an overly restrictive umask (e.g. 077).
2243# This was a mistake. There are at least two reasons why we must not
2244# use `-m 0755':
2245# - it causes special bits like SGID to be ignored,
2246# - it may be too restrictive (some setups expect 775 directories).
2247#
2248# Do not use -m 0755 and let people choose whatever they expect by
2249# setting umask.
2250#
2251# We cannot accept any implementation of `mkdir' that recognizes `-p'.
2252# Some implementations (such as Solaris 8's) are not thread-safe: if a
2253# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
2254# concurrently, both version can detect that a/ is missing, but only
2255# one can create it and the other will error out. Consequently we
2256# restrict ourselves to GNU make (using the --version option ensures
2257# this.)
2258AC_DEFUN([AM_PROG_MKDIR_P],
2259[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
2260 # We used to keeping the `.' as first argument, in order to
2261 # allow $(mkdir_p) to be used without argument. As in
2262 # $(mkdir_p) $(somedir)
2263 # where $(somedir) is conditionally defined. However this is wrong
2264 # for two reasons:
2265 # 1. if the package is installed by a user who cannot write `.'
2266 # make install will fail,
2267 # 2. the above comment should most certainly read
2268 # $(mkdir_p) $(DESTDIR)$(somedir)
2269 # so it does not work when $(somedir) is undefined and
2270 # $(DESTDIR) is not.
2271 # To support the latter case, we have to write
2272 # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
2273 # so the `.' trick is pointless.
2274 mkdir_p='mkdir -p --'
2275else
2276 # On NextStep and OpenStep, the `mkdir' command does not
2277 # recognize any option. It will interpret all options as
2278 # directories to create, and then abort because `.' already
2279 # exists.
2280 for d in ./-p ./--version;
2281 do
2282 test -d $d && rmdir $d
2283 done
2284 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
2285 if test -f "$ac_aux_dir/mkinstalldirs"; then
2286 mkdir_p='$(mkinstalldirs)'
2287 else
2288 mkdir_p='$(install_sh) -d'
2289 fi
2290fi
2291AC_SUBST([mkdir_p])])
2292
2293m4_include([buildlib/tools.m4])