11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
14
# gettext.m4 serial 28 (gettext-0.13)
15
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
16
dnl This file is free software, distributed under the terms of the GNU
17
dnl General Public License. As a special exception to the GNU General
18
dnl Public License, this file may be distributed as part of a program
19
dnl that contains a configuration script generated by Autoconf, under
20
dnl the same distribution terms as the rest of that program.
22
dnl This file can can be used in projects which are not available under
23
dnl the GNU General Public License or the GNU Library General Public
24
dnl License but which still want to provide support for the GNU gettext
26
dnl Please note that the actual code of the GNU gettext library is covered
27
dnl by the GNU Library General Public License, and the rest of the GNU
28
dnl gettext package package is covered by the GNU General Public License.
29
dnl They are *not* in the public domain.
32
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
33
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
35
dnl Macro to add for using GNU gettext.
37
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
38
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
39
dnl default (if it is not specified or empty) is 'no-libtool'.
40
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
41
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
42
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
43
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
44
dnl depending on --{enable,disable}-{shared,static} and on the presence of
45
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
46
dnl $(top_builddir)/intl/libintl.a will be created.
47
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
48
dnl implementations (in libc or libintl) without the ngettext() function
49
dnl will be ignored. If NEEDSYMBOL is specified and is
50
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
51
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
52
dnl INTLDIR is used to find the intl libraries. If empty,
53
dnl the value `$(top_builddir)/intl/' is used.
55
dnl The result of the configuration is one of three cases:
56
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
58
dnl Catalog format: GNU --> install in $(datadir)
59
dnl Catalog extension: .mo after installation, .gmo in source tree
60
dnl 2) GNU gettext has been found in the system's C library.
61
dnl Catalog format: GNU --> install in $(datadir)
62
dnl Catalog extension: .mo after installation, .gmo in source tree
63
dnl 3) No internationalization, always use English msgid.
64
dnl Catalog format: none
65
dnl Catalog extension: none
66
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
67
dnl The use of .gmo is historical (it was needed to avoid overwriting the
68
dnl GNU format catalogs when building on a platform with an X/Open gettext),
69
dnl but we keep it in order not to force irrelevant filename changes on the
72
AC_DEFUN([AM_GNU_GETTEXT],
74
dnl Argument checking.
75
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
76
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
78
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
79
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
81
define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
82
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
84
AC_REQUIRE([AM_PO_SUBDIRS])dnl
85
ifelse(gt_included_intl, yes, [
86
AC_REQUIRE([AM_INTL_SUBDIR])dnl
89
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
90
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
91
AC_REQUIRE([AC_LIB_RPATH])
93
dnl Sometimes libintl requires libiconv, so first search for libiconv.
94
dnl Ideally we would do this search only after the
95
dnl if test "$USE_NLS" = "yes"; then
96
dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
97
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
98
dnl the configure script would need to contain the same shell code
99
dnl again, outside any 'if'. There are two solutions:
100
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
101
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
102
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
103
dnl documented, we avoid it.
104
ifelse(gt_included_intl, yes, , [
105
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
111
ifelse(gt_included_intl, yes, [
112
BUILD_INCLUDED_LIBINTL=no
113
USE_INCLUDED_LIBINTL=no
119
dnl If we use NLS figure out what method
120
if test "$USE_NLS" = "yes"; then
121
gt_use_preinstalled_gnugettext=no
122
ifelse(gt_included_intl, yes, [
123
AC_MSG_CHECKING([whether included gettext is requested])
124
AC_ARG_WITH(included-gettext,
125
[ --with-included-gettext use the GNU gettext library included here],
126
nls_cv_force_use_gnu_gettext=$withval,
127
nls_cv_force_use_gnu_gettext=no)
128
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
130
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
131
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
133
dnl User does not insist on using GNU NLS library. Figure out what
134
dnl to use. If GNU gettext is available we use this. Else we have
135
dnl to fall back to GNU NLS library.
137
dnl Add a version number to the cache macros.
138
define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
139
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
140
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
142
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
143
[AC_TRY_LINK([#include <libintl.h>
144
]ifelse([$2], [need-formatstring-macros],
145
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
146
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
149
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
151
], [])[extern int _nl_msg_cat_cntr;
152
extern int *_nl_domain_bindings;],
153
[bindtextdomain ("", "");
154
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
155
gt_cv_func_gnugettext_libc=yes,
156
gt_cv_func_gnugettext_libc=no)])
158
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
159
dnl Sometimes libintl requires libiconv, so first search for libiconv.
160
ifelse(gt_included_intl, yes, , [
163
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
164
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
165
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
166
dnl even if libiconv doesn't exist.
167
AC_LIB_LINKFLAGS_BODY([intl])
168
AC_CACHE_CHECK([for GNU gettext in libintl],
169
gt_cv_func_gnugettext_libintl,
170
[gt_save_CPPFLAGS="$CPPFLAGS"
171
CPPFLAGS="$CPPFLAGS $INCINTL"
173
LIBS="$LIBS $LIBINTL"
174
dnl Now see whether libintl exists and does not depend on libiconv.
175
AC_TRY_LINK([#include <libintl.h>
176
]ifelse([$2], [need-formatstring-macros],
177
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
178
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
181
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
183
], [])[extern int _nl_msg_cat_cntr;
188
const char *_nl_expand_alias ();],
189
[bindtextdomain ("", "");
190
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
191
gt_cv_func_gnugettext_libintl=yes,
192
gt_cv_func_gnugettext_libintl=no)
193
dnl Now see whether libintl exists and depends on libiconv.
194
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
195
LIBS="$LIBS $LIBICONV"
196
AC_TRY_LINK([#include <libintl.h>
197
]ifelse([$2], [need-formatstring-macros],
198
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
199
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
202
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
204
], [])[extern int _nl_msg_cat_cntr;
209
const char *_nl_expand_alias ();],
210
[bindtextdomain ("", "");
211
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
212
[LIBINTL="$LIBINTL $LIBICONV"
213
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
214
gt_cv_func_gnugettext_libintl=yes
217
CPPFLAGS="$gt_save_CPPFLAGS"
218
LIBS="$gt_save_LIBS"])
221
dnl If an already present or preinstalled GNU gettext() is found,
222
dnl use it. But if this macro is used in GNU gettext, and GNU
223
dnl gettext is already preinstalled in libintl, we update this
224
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
225
if test "$gt_cv_func_gnugettext_libc" = "yes" \
226
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
227
&& test "$PACKAGE" != gettext-runtime \
228
&& test "$PACKAGE" != gettext-tools; }; then
229
gt_use_preinstalled_gnugettext=yes
231
dnl Reset the values set by searching for libintl.
237
ifelse(gt_included_intl, yes, [
238
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
239
dnl GNU gettext is not found in the C library.
240
dnl Fall back on included GNU gettext library.
241
nls_cv_use_gnu_gettext=yes
245
if test "$nls_cv_use_gnu_gettext" = "yes"; then
246
dnl Mark actions used to generate GNU NLS library.
247
BUILD_INCLUDED_LIBINTL=yes
248
USE_INCLUDED_LIBINTL=yes
249
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
250
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
251
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
254
if test "$gt_use_preinstalled_gnugettext" = "yes" \
255
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
256
dnl Mark actions to use GNU gettext tools.
261
if test "$gt_use_preinstalled_gnugettext" = "yes" \
262
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
263
AC_DEFINE(ENABLE_NLS, 1,
264
[Define to 1 if translation of program messages to the user's native language
271
AC_MSG_CHECKING([whether to use NLS])
272
AC_MSG_RESULT([$USE_NLS])
273
if test "$USE_NLS" = "yes"; then
274
AC_MSG_CHECKING([where the gettext function comes from])
275
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
276
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
277
gt_source="external libintl"
282
gt_source="included intl directory"
284
AC_MSG_RESULT([$gt_source])
287
if test "$USE_NLS" = "yes"; then
289
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
290
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
291
AC_MSG_CHECKING([how to link with libintl])
292
AC_MSG_RESULT([$LIBINTL])
293
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
296
dnl For backward compatibility. Some packages may be using this.
297
AC_DEFINE(HAVE_GETTEXT, 1,
298
[Define if the GNU gettext() function is already present or preinstalled.])
299
AC_DEFINE(HAVE_DCGETTEXT, 1,
300
[Define if the GNU dcgettext() function is already present or preinstalled.])
303
dnl We need to process the po/ directory.
307
ifelse(gt_included_intl, yes, [
308
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
309
dnl to 'yes' because some of the testsuite requires it.
310
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
311
BUILD_INCLUDED_LIBINTL=yes
314
dnl Make all variables we use known to autoconf.
315
AC_SUBST(BUILD_INCLUDED_LIBINTL)
316
AC_SUBST(USE_INCLUDED_LIBINTL)
319
dnl For backward compatibility. Some configure.ins may be using this.
323
dnl For backward compatibility. Some Makefiles may be using this.
325
AC_SUBST(DATADIRNAME)
327
dnl For backward compatibility. Some Makefiles may be using this.
331
dnl For backward compatibility. Some Makefiles may be using this.
335
dnl For backward compatibility. Some Makefiles may be using this.
336
if test "$USE_INCLUDED_LIBINTL" = yes; then
337
INTLOBJS="\$(GETTOBJS)"
341
dnl Enable libtool support if the surrounding package wishes it.
342
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
343
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
346
dnl For backward compatibility. Some Makefiles may be using this.
350
dnl Make all documented variables known to autoconf.
357
dnl Checks for all prerequisites of the intl subdirectory,
358
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
359
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
360
AC_DEFUN([AM_INTL_SUBDIR],
362
AC_REQUIRE([AC_PROG_INSTALL])dnl
363
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
364
AC_REQUIRE([AC_PROG_CC])dnl
365
AC_REQUIRE([AC_CANONICAL_HOST])dnl
366
AC_REQUIRE([AC_PROG_RANLIB])dnl
367
AC_REQUIRE([AC_ISC_POSIX])dnl
368
AC_REQUIRE([AC_HEADER_STDC])dnl
369
AC_REQUIRE([AC_C_CONST])dnl
370
AC_REQUIRE([bh_C_SIGNED])dnl
371
AC_REQUIRE([AC_C_INLINE])dnl
372
AC_REQUIRE([AC_TYPE_OFF_T])dnl
373
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
374
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
375
AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
376
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
377
AC_REQUIRE([gt_TYPE_WINT_T])dnl
378
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
379
AC_REQUIRE([jm_AC_HEADER_STDINT_H])
380
AC_REQUIRE([gt_TYPE_INTMAX_T])
381
AC_REQUIRE([gt_PRINTF_POSIX])
382
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
383
AC_REQUIRE([AC_FUNC_MMAP])dnl
384
AC_REQUIRE([jm_GLIBC21])dnl
385
AC_REQUIRE([gt_INTDIV0])dnl
386
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
387
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
388
AC_REQUIRE([gt_INTTYPES_PRI])dnl
389
AC_REQUIRE([gl_XSIZE])dnl
391
AC_CHECK_TYPE([ptrdiff_t], ,
392
[AC_DEFINE([ptrdiff_t], [long],
393
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
395
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
396
stdlib.h string.h unistd.h sys/param.h])
397
AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
398
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
399
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
402
dnl Use the _snprintf function only if it is declared (because on NetBSD it
403
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
404
gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
405
gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
407
dnl Use the *_unlocked functions only if they are declared.
408
dnl (because some of them were defined without being declared in Solaris
409
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
410
dnl on Solaris 2.5.1 to run on Solaris 2.6).
411
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
412
gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
413
gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
414
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
416
case $gt_cv_func_printf_posix in
417
*yes) HAVE_POSIX_PRINTF=1 ;;
418
*) HAVE_POSIX_PRINTF=0 ;;
420
AC_SUBST([HAVE_POSIX_PRINTF])
421
if test "$ac_cv_func_asprintf" = yes; then
426
AC_SUBST([HAVE_ASPRINTF])
427
if test "$ac_cv_func_snprintf" = yes; then
432
AC_SUBST([HAVE_SNPRINTF])
433
if test "$ac_cv_func_wprintf" = yes; then
438
AC_SUBST([HAVE_WPRINTF])
442
if test $ac_cv_header_locale_h = yes; then
446
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
447
dnl because plural.y uses bison specific features. It requires at least
448
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
450
dnl bison is only needed for the maintainer (who touches plural.y). But in
451
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
452
dnl the rule in general Makefile. Now, some people carelessly touch the
453
dnl files or have a broken "make" program, hence the plural.c rule will
454
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
455
dnl present or too old.
456
AC_CHECK_PROGS([INTLBISON], [bison])
457
if test -z "$INTLBISON"; then
460
dnl Found it, now check the version.
461
AC_MSG_CHECKING([version of bison])
462
changequote(<<,>>)dnl
463
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
464
case $ac_prog_version in
465
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
466
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
468
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
469
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
471
AC_MSG_RESULT([$ac_prog_version])
473
if test $ac_verc_fail = yes; then
479
dnl gt_CHECK_DECL(FUNC, INCLUDES)
480
dnl Check whether a function is declared.
481
AC_DEFUN([gt_CHECK_DECL],
483
AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
484
[AC_TRY_COMPILE([$2], [
486
char *p = (char *) $1;
488
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
489
if test $ac_cv_have_decl_$1 = yes; then
494
AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
495
[Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
499
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
500
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
14
m4_if(m4_PACKAGE_VERSION, [2.61],,
15
[m4_fatal([this file was generated for autoconf 2.61.
16
You have another version of autoconf. If you want to use that,
17
you should regenerate the build system entirely.], [63])])
502
19
# Configure paths for GTK+
503
20
# Owen Taylor 1997-2001
891
408
rm -f conf.gtktest
894
# iconv.m4 serial AM4 (gettext-0.11.3)
895
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
896
dnl This file is free software, distributed under the terms of the GNU
897
dnl General Public License. As a special exception to the GNU General
898
dnl Public License, this file may be distributed as part of a program
899
dnl that contains a configuration script generated by Autoconf, under
900
dnl the same distribution terms as the rest of that program.
902
dnl From Bruno Haible.
904
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
906
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
907
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
908
AC_REQUIRE([AC_LIB_RPATH])
910
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
912
AC_LIB_LINKFLAGS_BODY([iconv])
915
AC_DEFUN([AM_ICONV_LINK],
917
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
918
dnl those with the standalone portable GNU libiconv installed).
920
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
922
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
924
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
925
dnl because if the user has installed libiconv and not disabled its use
926
dnl via --without-libiconv-prefix, he wants to use it. The first
927
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
928
am_save_CPPFLAGS="$CPPFLAGS"
929
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
931
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
932
am_cv_func_iconv="no, consider installing GNU libiconv"
934
AC_TRY_LINK([#include <stdlib.h>
936
[iconv_t cd = iconv_open("","");
937
iconv(cd,NULL,NULL,NULL,NULL);
939
am_cv_func_iconv=yes)
940
if test "$am_cv_func_iconv" != yes; then
942
LIBS="$LIBS $LIBICONV"
943
AC_TRY_LINK([#include <stdlib.h>
945
[iconv_t cd = iconv_open("","");
946
iconv(cd,NULL,NULL,NULL,NULL);
949
am_cv_func_iconv=yes)
953
if test "$am_cv_func_iconv" = yes; then
954
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
956
if test "$am_cv_lib_iconv" = yes; then
957
AC_MSG_CHECKING([how to link with libiconv])
958
AC_MSG_RESULT([$LIBICONV])
960
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
962
CPPFLAGS="$am_save_CPPFLAGS"
973
if test "$am_cv_func_iconv" = yes; then
974
AC_MSG_CHECKING([for iconv declaration])
975
AC_CACHE_VAL(am_cv_proto_iconv, [
983
#if defined(__STDC__) || defined(__cplusplus)
984
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
988
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
989
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);"])
990
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
991
AC_MSG_RESULT([$]{ac_t:-
992
}[$]am_cv_proto_iconv)
993
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
994
[Define as const if the declaration of iconv() needs const.])
998
# lib-ld.m4 serial 3 (gettext-0.13)
999
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1000
dnl This file is free software, distributed under the terms of the GNU
1001
dnl General Public License. As a special exception to the GNU General
1002
dnl Public License, this file may be distributed as part of a program
1003
dnl that contains a configuration script generated by Autoconf, under
1004
dnl the same distribution terms as the rest of that program.
1006
dnl Subroutines of libtool.m4,
1007
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1008
dnl with libtool.m4.
1010
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1011
AC_DEFUN([AC_LIB_PROG_LD_GNU],
1012
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1013
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1014
case `$LD -v 2>&1 </dev/null` in
1015
*GNU* | *'with BFD'*)
1016
acl_cv_prog_gnu_ld=yes ;;
1018
acl_cv_prog_gnu_ld=no ;;
1020
with_gnu_ld=$acl_cv_prog_gnu_ld
1023
dnl From libtool-1.4. Sets the variable LD.
1024
AC_DEFUN([AC_LIB_PROG_LD],
1025
[AC_ARG_WITH(gnu-ld,
1026
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1027
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1028
AC_REQUIRE([AC_PROG_CC])dnl
1029
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1030
# Prepare PATH_SEPARATOR.
1031
# The user is always right.
1032
if test "${PATH_SEPARATOR+set}" != set; then
1033
echo "#! /bin/sh" >conf$$.sh
1034
echo "exit 0" >>conf$$.sh
1036
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1044
if test "$GCC" = yes; then
1045
# Check if gcc -print-prog-name=ld gives a path.
1046
AC_MSG_CHECKING([for ld used by GCC])
1049
# gcc leaves a trailing carriage return which upsets mingw
1050
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1052
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1055
# Accept absolute paths.
1056
[[\\/]* | [A-Za-z]:[\\/]*)]
1057
[re_direlt='/[^/][^/]*/\.\./']
1058
# Canonicalize the path of ld
1059
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1060
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1061
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1063
test -z "$LD" && LD="$ac_prog"
1066
# If it fails, then pretend we aren't using GCC.
1070
# If it is relative, then search for the first ld in PATH.
1074
elif test "$with_gnu_ld" = yes; then
1075
AC_MSG_CHECKING([for GNU ld])
1077
AC_MSG_CHECKING([for non-GNU ld])
1079
AC_CACHE_VAL(acl_cv_path_LD,
1080
[if test -z "$LD"; then
1081
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1082
for ac_dir in $PATH; do
1083
test -z "$ac_dir" && ac_dir=.
1084
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1085
acl_cv_path_LD="$ac_dir/$ac_prog"
1086
# Check to see if the program is GNU ld. I'd rather use --version,
1087
# but apparently some GNU ld's only accept -v.
1088
# Break only if it was the GNU/non-GNU ld that we prefer.
1089
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1090
*GNU* | *'with BFD'*)
1091
test "$with_gnu_ld" != no && break ;;
1093
test "$with_gnu_ld" != yes && break ;;
1099
acl_cv_path_LD="$LD" # Let the user override the test with a path.
411
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
413
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
415
# This program is free software; you can redistribute it and/or modify
416
# it under the terms of the GNU General Public License as published by
417
# the Free Software Foundation; either version 2 of the License, or
418
# (at your option) any later version.
420
# This program is distributed in the hope that it will be useful, but
421
# WITHOUT ANY WARRANTY; without even the implied warranty of
422
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
423
# General Public License for more details.
425
# You should have received a copy of the GNU General Public License
426
# along with this program; if not, write to the Free Software
427
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
429
# As a special exception to the GNU General Public License, if you
430
# distribute this file as part of a program that contains a
431
# configuration script generated by Autoconf, you may include it under
432
# the same distribution terms that you use for the rest of that program.
434
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
435
# ----------------------------------
436
AC_DEFUN([PKG_PROG_PKG_CONFIG],
437
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
438
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
439
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
440
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
441
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
443
if test -n "$PKG_CONFIG"; then
444
_pkg_min_version=m4_default([$1], [0.9.0])
445
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
446
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
454
])# PKG_PROG_PKG_CONFIG
456
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
458
# Check to see whether a particular set of modules exists. Similar
459
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
462
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
463
# this or PKG_CHECK_MODULES is called, or make sure to call
464
# PKG_CHECK_EXISTS manually
465
# --------------------------------------------------------------
466
AC_DEFUN([PKG_CHECK_EXISTS],
467
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
468
if test -n "$PKG_CONFIG" && \
469
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
470
m4_ifval([$2], [$2], [:])
471
m4_ifvaln([$3], [else
1101
LD="$acl_cv_path_LD"
1102
if test -n "$LD"; then
1107
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1111
# lib-link.m4 serial 4 (gettext-0.12)
1112
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1113
dnl This file is free software, distributed under the terms of the GNU
1114
dnl General Public License. As a special exception to the GNU General
1115
dnl Public License, this file may be distributed as part of a program
1116
dnl that contains a configuration script generated by Autoconf, under
1117
dnl the same distribution terms as the rest of that program.
1119
dnl From Bruno Haible.
1121
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1122
dnl the libraries corresponding to explicit and implicit dependencies.
1123
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1124
dnl augments the CPPFLAGS variable.
1125
AC_DEFUN([AC_LIB_LINKFLAGS],
1127
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1128
AC_REQUIRE([AC_LIB_RPATH])
1129
define([Name],[translit([$1],[./-], [___])])
1130
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1131
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1132
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1133
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1134
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1135
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1136
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1138
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1139
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1140
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1141
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1143
AC_SUBST([LTLIB]NAME)
1144
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1145
dnl results of this search when this library appears as a dependency.
1151
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1152
dnl searches for libname and the libraries corresponding to explicit and
1153
dnl implicit dependencies, together with the specified include files and
1154
dnl the ability to compile and link the specified testcode. If found, it
1155
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1156
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1157
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1158
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1159
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1161
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1162
AC_REQUIRE([AC_LIB_RPATH])
1163
define([Name],[translit([$1],[./-], [___])])
1164
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1165
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1167
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1169
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1171
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1172
dnl because if the user has installed lib[]Name and not disabled its use
1173
dnl via --without-lib[]Name-prefix, he wants to use it.
1174
ac_save_CPPFLAGS="$CPPFLAGS"
1175
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1177
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1178
ac_save_LIBS="$LIBS"
1179
LIBS="$LIBS $LIB[]NAME"
1180
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1181
LIBS="$ac_save_LIBS"
1183
if test "$ac_cv_lib[]Name" = yes; then
1185
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1186
AC_MSG_CHECKING([how to link with lib[]$1])
1187
AC_MSG_RESULT([$LIB[]NAME])
1190
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1191
dnl $INC[]NAME either.
1192
CPPFLAGS="$ac_save_CPPFLAGS"
1196
AC_SUBST([HAVE_LIB]NAME)
1198
AC_SUBST([LTLIB]NAME)
1203
dnl Determine the platform dependent parameters needed to use rpath:
1204
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1205
dnl hardcode_direct, hardcode_minus_L.
1206
AC_DEFUN([AC_LIB_RPATH],
1208
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1209
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1210
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1211
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1212
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1213
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1214
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1220
libext="$acl_cv_libext"
1221
shlibext="$acl_cv_shlibext"
1222
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1223
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1224
hardcode_direct="$acl_cv_hardcode_direct"
1225
hardcode_minus_L="$acl_cv_hardcode_minus_L"
1226
dnl Determine whether the user wants rpath handling at all.
1227
AC_ARG_ENABLE(rpath,
1228
[ --disable-rpath do not hardcode runtime library paths],
1229
:, enable_rpath=yes)
1232
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1233
dnl the libraries corresponding to explicit and implicit dependencies.
1234
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1235
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1237
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1238
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1239
dnl By default, look in $includedir and $libdir.
1241
AC_LIB_WITH_FINAL_PREFIX([
1242
eval additional_includedir=\"$includedir\"
1243
eval additional_libdir=\"$libdir\"
1245
AC_LIB_ARG_WITH([lib$1-prefix],
1246
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1247
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1249
if test "X$withval" = "Xno"; then
1252
if test "X$withval" = "X"; then
1253
AC_LIB_WITH_FINAL_PREFIX([
1254
eval additional_includedir=\"$includedir\"
1255
eval additional_libdir=\"$libdir\"
1258
additional_includedir="$withval/include"
1259
additional_libdir="$withval/lib"
1263
dnl Search the library and its dependencies in $additional_libdir and
1264
dnl $LDFLAGS. Using breadth-first-seach.
1270
names_already_handled=
1271
names_next_round='$1 $2'
1272
while test -n "$names_next_round"; do
1273
names_this_round="$names_next_round"
1275
for name in $names_this_round; do
1277
for n in $names_already_handled; do
1278
if test "$n" = "$name"; then
1283
if test -z "$already_handled"; then
1284
names_already_handled="$names_already_handled $name"
1285
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1286
dnl or AC_LIB_HAVE_LINKFLAGS call.
1287
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1288
eval value=\"\$HAVE_LIB$uppername\"
1289
if test -n "$value"; then
1290
if test "$value" = yes; then
1291
eval value=\"\$LIB$uppername\"
1292
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1293
eval value=\"\$LTLIB$uppername\"
1294
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1296
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1297
dnl that this library doesn't exist. So just drop it.
1301
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1302
dnl and the already constructed $LIBNAME/$LTLIBNAME.
1307
if test $use_additional = yes; then
1308
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1309
found_dir="$additional_libdir"
1310
found_so="$additional_libdir/lib$name.$shlibext"
1311
if test -f "$additional_libdir/lib$name.la"; then
1312
found_la="$additional_libdir/lib$name.la"
1315
if test -f "$additional_libdir/lib$name.$libext"; then
1316
found_dir="$additional_libdir"
1317
found_a="$additional_libdir/lib$name.$libext"
1318
if test -f "$additional_libdir/lib$name.la"; then
1319
found_la="$additional_libdir/lib$name.la"
1324
if test "X$found_dir" = "X"; then
1325
for x in $LDFLAGS $LTLIB[]NAME; do
1326
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1329
dir=`echo "X$x" | sed -e 's/^X-L//'`
1330
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1332
found_so="$dir/lib$name.$shlibext"
1333
if test -f "$dir/lib$name.la"; then
1334
found_la="$dir/lib$name.la"
1337
if test -f "$dir/lib$name.$libext"; then
1339
found_a="$dir/lib$name.$libext"
1340
if test -f "$dir/lib$name.la"; then
1341
found_la="$dir/lib$name.la"
1347
if test "X$found_dir" != "X"; then
1352
if test "X$found_dir" != "X"; then
1353
dnl Found the library.
1354
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1355
if test "X$found_so" != "X"; then
1356
dnl Linking with a shared library. We attempt to hardcode its
1357
dnl directory into the executable's runpath, unless it's the
1358
dnl standard /usr/lib.
1359
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1360
dnl No hardcoding is needed.
1361
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1363
dnl Use an explicit option to hardcode DIR into the resulting
1365
dnl Potentially add DIR to ltrpathdirs.
1366
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1368
for x in $ltrpathdirs; do
1369
if test "X$x" = "X$found_dir"; then
1374
if test -z "$haveit"; then
1375
ltrpathdirs="$ltrpathdirs $found_dir"
1377
dnl The hardcoding into $LIBNAME is system dependent.
1378
if test "$hardcode_direct" = yes; then
1379
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1380
dnl resulting binary.
1381
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1383
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1384
dnl Use an explicit option to hardcode DIR into the resulting
1386
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1387
dnl Potentially add DIR to rpathdirs.
1388
dnl The rpathdirs will be appended to $LIBNAME at the end.
1390
for x in $rpathdirs; do
1391
if test "X$x" = "X$found_dir"; then
1396
if test -z "$haveit"; then
1397
rpathdirs="$rpathdirs $found_dir"
1400
dnl Rely on "-L$found_dir".
1401
dnl But don't add it if it's already contained in the LDFLAGS
1402
dnl or the already constructed $LIBNAME
1404
for x in $LDFLAGS $LIB[]NAME; do
1405
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1406
if test "X$x" = "X-L$found_dir"; then
1411
if test -z "$haveit"; then
1412
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1414
if test "$hardcode_minus_L" != no; then
1415
dnl FIXME: Not sure whether we should use
1416
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1418
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1420
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1421
dnl here, because this doesn't fit in flags passed to the
1422
dnl compiler. So give up. No hardcoding. This affects only
1423
dnl very old systems.
1424
dnl FIXME: Not sure whether we should use
1425
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1427
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1433
if test "X$found_a" != "X"; then
1434
dnl Linking with a static library.
1435
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1437
dnl We shouldn't come here, but anyway it's good to have a
1439
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1442
dnl Assume the include files are nearby.
1443
additional_includedir=
1444
case "$found_dir" in
1446
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1447
additional_includedir="$basedir/include"
1450
if test "X$additional_includedir" != "X"; then
1451
dnl Potentially add $additional_includedir to $INCNAME.
1452
dnl But don't add it
1453
dnl 1. if it's the standard /usr/include,
1454
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1455
dnl 3. if it's already present in $CPPFLAGS or the already
1456
dnl constructed $INCNAME,
1457
dnl 4. if it doesn't exist as a directory.
1458
if test "X$additional_includedir" != "X/usr/include"; then
1460
if test "X$additional_includedir" = "X/usr/local/include"; then
1461
if test -n "$GCC"; then
1463
linux*) haveit=yes;;
1467
if test -z "$haveit"; then
1468
for x in $CPPFLAGS $INC[]NAME; do
1469
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1470
if test "X$x" = "X-I$additional_includedir"; then
1475
if test -z "$haveit"; then
1476
if test -d "$additional_includedir"; then
1477
dnl Really add $additional_includedir to $INCNAME.
1478
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1484
dnl Look for dependencies.
1485
if test -n "$found_la"; then
1486
dnl Read the .la file. It defines the variables
1487
dnl dlname, library_names, old_library, dependency_libs, current,
1488
dnl age, revision, installed, dlopen, dlpreopen, libdir.
1489
save_libdir="$libdir"
1491
*/* | *\\*) . "$found_la" ;;
1492
*) . "./$found_la" ;;
1494
libdir="$save_libdir"
1495
dnl We use only dependency_libs.
1496
for dep in $dependency_libs; do
1499
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1500
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1501
dnl But don't add it
1502
dnl 1. if it's the standard /usr/lib,
1503
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1504
dnl 3. if it's already present in $LDFLAGS or the already
1505
dnl constructed $LIBNAME,
1506
dnl 4. if it doesn't exist as a directory.
1507
if test "X$additional_libdir" != "X/usr/lib"; then
1509
if test "X$additional_libdir" = "X/usr/local/lib"; then
1510
if test -n "$GCC"; then
1512
linux*) haveit=yes;;
1516
if test -z "$haveit"; then
1518
for x in $LDFLAGS $LIB[]NAME; do
1519
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1520
if test "X$x" = "X-L$additional_libdir"; then
1525
if test -z "$haveit"; then
1526
if test -d "$additional_libdir"; then
1527
dnl Really add $additional_libdir to $LIBNAME.
1528
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1532
for x in $LDFLAGS $LTLIB[]NAME; do
1533
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1534
if test "X$x" = "X-L$additional_libdir"; then
1539
if test -z "$haveit"; then
1540
if test -d "$additional_libdir"; then
1541
dnl Really add $additional_libdir to $LTLIBNAME.
1542
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1549
dir=`echo "X$dep" | sed -e 's/^X-R//'`
1550
if test "$enable_rpath" != no; then
1551
dnl Potentially add DIR to rpathdirs.
1552
dnl The rpathdirs will be appended to $LIBNAME at the end.
1554
for x in $rpathdirs; do
1555
if test "X$x" = "X$dir"; then
1560
if test -z "$haveit"; then
1561
rpathdirs="$rpathdirs $dir"
1563
dnl Potentially add DIR to ltrpathdirs.
1564
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1566
for x in $ltrpathdirs; do
1567
if test "X$x" = "X$dir"; then
1572
if test -z "$haveit"; then
1573
ltrpathdirs="$ltrpathdirs $dir"
1578
dnl Handle this in the next round.
1579
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1582
dnl Handle this in the next round. Throw away the .la's
1583
dnl directory; it is already contained in a preceding -L
1585
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1588
dnl Most likely an immediate library name.
1589
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1590
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1596
dnl Didn't find the library; assume it is in the system directories
1597
dnl known to the linker and runtime loader. (All the system
1598
dnl directories known to the linker should also be known to the
1599
dnl runtime loader, otherwise the system is severely misconfigured.)
1600
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1601
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1607
if test "X$rpathdirs" != "X"; then
1608
if test -n "$hardcode_libdir_separator"; then
1609
dnl Weird platform: only the last -rpath option counts, the user must
1610
dnl pass all path elements in one option. We can arrange that for a
1611
dnl single library, but not when more than one $LIBNAMEs are used.
1613
for found_dir in $rpathdirs; do
1614
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1616
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1617
acl_save_libdir="$libdir"
1619
eval flag=\"$hardcode_libdir_flag_spec\"
1620
libdir="$acl_save_libdir"
1621
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1623
dnl The -rpath options are cumulative.
1624
for found_dir in $rpathdirs; do
1625
acl_save_libdir="$libdir"
1627
eval flag=\"$hardcode_libdir_flag_spec\"
1628
libdir="$acl_save_libdir"
1629
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1633
if test "X$ltrpathdirs" != "X"; then
1634
dnl When using libtool, the option that works for both libraries and
1635
dnl executables is -R. The -R options are cumulative.
1636
for found_dir in $ltrpathdirs; do
1637
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1642
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1643
dnl unless already present in VAR.
1644
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1645
dnl contains two or three consecutive elements that belong together.
1646
AC_DEFUN([AC_LIB_APPENDTOVAR],
1648
for element in [$2]; do
1651
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1652
if test "X$x" = "X$element"; then
1657
if test -z "$haveit"; then
1658
[$1]="${[$1]}${[$1]:+ }$element"
1663
# lib-prefix.m4 serial 3 (gettext-0.13)
1664
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1665
dnl This file is free software, distributed under the terms of the GNU
1666
dnl General Public License. As a special exception to the GNU General
1667
dnl Public License, this file may be distributed as part of a program
1668
dnl that contains a configuration script generated by Autoconf, under
1669
dnl the same distribution terms as the rest of that program.
1671
dnl From Bruno Haible.
1673
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1674
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1675
dnl require excessive bracketing.
1676
ifdef([AC_HELP_STRING],
1677
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1678
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1680
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1681
dnl to access previously installed libraries. The basic assumption is that
1682
dnl a user will want packages to use other packages he previously installed
1683
dnl with the same --prefix option.
1684
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1685
dnl libraries, but is otherwise very convenient.
1686
AC_DEFUN([AC_LIB_PREFIX],
1688
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1689
AC_REQUIRE([AC_PROG_CC])
1690
AC_REQUIRE([AC_CANONICAL_HOST])
1691
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1692
dnl By default, look in $includedir and $libdir.
1694
AC_LIB_WITH_FINAL_PREFIX([
1695
eval additional_includedir=\"$includedir\"
1696
eval additional_libdir=\"$libdir\"
1698
AC_LIB_ARG_WITH([lib-prefix],
1699
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1700
--without-lib-prefix don't search for libraries in includedir and libdir],
1702
if test "X$withval" = "Xno"; then
1705
if test "X$withval" = "X"; then
1706
AC_LIB_WITH_FINAL_PREFIX([
1707
eval additional_includedir=\"$includedir\"
1708
eval additional_libdir=\"$libdir\"
1711
additional_includedir="$withval/include"
1712
additional_libdir="$withval/lib"
1716
if test $use_additional = yes; then
1717
dnl Potentially add $additional_includedir to $CPPFLAGS.
1718
dnl But don't add it
1719
dnl 1. if it's the standard /usr/include,
1720
dnl 2. if it's already present in $CPPFLAGS,
1721
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1722
dnl 4. if it doesn't exist as a directory.
1723
if test "X$additional_includedir" != "X/usr/include"; then
1725
for x in $CPPFLAGS; do
1726
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1727
if test "X$x" = "X-I$additional_includedir"; then
1732
if test -z "$haveit"; then
1733
if test "X$additional_includedir" = "X/usr/local/include"; then
1734
if test -n "$GCC"; then
1736
linux*) haveit=yes;;
1740
if test -z "$haveit"; then
1741
if test -d "$additional_includedir"; then
1742
dnl Really add $additional_includedir to $CPPFLAGS.
1743
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1748
dnl Potentially add $additional_libdir to $LDFLAGS.
1749
dnl But don't add it
1750
dnl 1. if it's the standard /usr/lib,
1751
dnl 2. if it's already present in $LDFLAGS,
1752
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1753
dnl 4. if it doesn't exist as a directory.
1754
if test "X$additional_libdir" != "X/usr/lib"; then
1756
for x in $LDFLAGS; do
1757
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1758
if test "X$x" = "X-L$additional_libdir"; then
1763
if test -z "$haveit"; then
1764
if test "X$additional_libdir" = "X/usr/local/lib"; then
1765
if test -n "$GCC"; then
1767
linux*) haveit=yes;;
1771
if test -z "$haveit"; then
1772
if test -d "$additional_libdir"; then
1773
dnl Really add $additional_libdir to $LDFLAGS.
1774
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1782
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1783
dnl acl_final_exec_prefix, containing the values to which $prefix and
1784
dnl $exec_prefix will expand at the end of the configure script.
1785
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1787
dnl Unfortunately, prefix and exec_prefix get only finally determined
1788
dnl at the end of configure.
1789
if test "X$prefix" = "XNONE"; then
1790
acl_final_prefix="$ac_default_prefix"
1792
acl_final_prefix="$prefix"
1794
if test "X$exec_prefix" = "XNONE"; then
1795
acl_final_exec_prefix='${prefix}'
1797
acl_final_exec_prefix="$exec_prefix"
1799
acl_save_prefix="$prefix"
1800
prefix="$acl_final_prefix"
1801
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1802
prefix="$acl_save_prefix"
1805
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1806
dnl variables prefix and exec_prefix bound to the values they will have
1807
dnl at the end of the configure script.
1808
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1810
acl_save_prefix="$prefix"
1811
prefix="$acl_final_prefix"
1812
acl_save_exec_prefix="$exec_prefix"
1813
exec_prefix="$acl_final_exec_prefix"
1815
exec_prefix="$acl_save_exec_prefix"
1816
prefix="$acl_save_prefix"
1819
# nls.m4 serial 1 (gettext-0.12)
1820
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1821
dnl This file is free software, distributed under the terms of the GNU
1822
dnl General Public License. As a special exception to the GNU General
1823
dnl Public License, this file may be distributed as part of a program
1824
dnl that contains a configuration script generated by Autoconf, under
1825
dnl the same distribution terms as the rest of that program.
1827
dnl This file can can be used in projects which are not available under
1828
dnl the GNU General Public License or the GNU Library General Public
1829
dnl License but which still want to provide support for the GNU gettext
1831
dnl Please note that the actual code of the GNU gettext library is covered
1832
dnl by the GNU Library General Public License, and the rest of the GNU
1833
dnl gettext package package is covered by the GNU General Public License.
1834
dnl They are *not* in the public domain.
1837
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1838
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1842
AC_MSG_CHECKING([whether NLS is requested])
1843
dnl Default is enabled NLS
1845
[ --disable-nls do not use Native Language Support],
1846
USE_NLS=$enableval, USE_NLS=yes)
1847
AC_MSG_RESULT($USE_NLS)
1851
AC_DEFUN([AM_MKINSTALLDIRS],
1853
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1854
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1855
dnl Try to locate it.
1857
if test -n "$ac_aux_dir"; then
1858
case "$ac_aux_dir" in
1859
/*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1860
*) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1863
if test -z "$MKINSTALLDIRS"; then
1864
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1866
AC_SUBST(MKINSTALLDIRS)
1870
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1871
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1872
dnl also defines GSTUFF_PKG_ERRORS on error
1873
AC_DEFUN(PKG_CHECK_MODULES, [
1876
if test -z "$PKG_CONFIG"; then
1877
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1880
if test "$PKG_CONFIG" = "no" ; then
1881
echo "*** The pkg-config script could not be found. Make sure it is"
1882
echo "*** in your path, or set the PKG_CONFIG environment variable"
1883
echo "*** to the full path to pkg-config."
1884
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
1886
PKG_CONFIG_MIN_VERSION=0.9.0
1887
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1888
AC_MSG_CHECKING(for $2)
1890
if $PKG_CONFIG --exists "$2" ; then
1894
AC_MSG_CHECKING($1_CFLAGS)
1895
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
1896
AC_MSG_RESULT($$1_CFLAGS)
1898
AC_MSG_CHECKING($1_LIBS)
1899
$1_LIBS=`$PKG_CONFIG --libs "$2"`
1900
AC_MSG_RESULT($$1_LIBS)
1904
## If we have a custom action on failure, don't print errors, but
1905
## do set a variable so people can do so.
1906
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1907
ifelse([$4], ,echo $$1_PKG_ERRORS,)
1913
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1914
echo "*** See http://www.freedesktop.org/software/pkgconfig"
1918
if test $succeeded = yes; then
1919
ifelse([$3], , :, [$3])
1921
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
1927
# po.m4 serial 3 (gettext-0.14)
1928
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1929
dnl This file is free software, distributed under the terms of the GNU
1930
dnl General Public License. As a special exception to the GNU General
1931
dnl Public License, this file may be distributed as part of a program
1932
dnl that contains a configuration script generated by Autoconf, under
1933
dnl the same distribution terms as the rest of that program.
1935
dnl This file can can be used in projects which are not available under
1936
dnl the GNU General Public License or the GNU Library General Public
1937
dnl License but which still want to provide support for the GNU gettext
1939
dnl Please note that the actual code of the GNU gettext library is covered
1940
dnl by the GNU Library General Public License, and the rest of the GNU
1941
dnl gettext package package is covered by the GNU General Public License.
1942
dnl They are *not* in the public domain.
1945
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1946
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1948
dnl Checks for all prerequisites of the po subdirectory.
1949
AC_DEFUN([AM_PO_SUBDIRS],
1951
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1952
AC_REQUIRE([AC_PROG_INSTALL])dnl
1953
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1954
AC_REQUIRE([AM_NLS])dnl
1956
dnl Perform the following tests also if --disable-nls has been given,
1957
dnl because they are needed for "make dist" to work.
1959
dnl Search for GNU msgfmt in the PATH.
1960
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1961
dnl The second test excludes FreeBSD msgfmt.
1962
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1963
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1964
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1966
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1968
dnl Search for GNU xgettext 0.12 or newer in the PATH.
1969
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1970
dnl The second test excludes FreeBSD xgettext.
1971
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1972
[$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1973
(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)],
1975
dnl Remove leftover from FreeBSD xgettext call.
1978
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1979
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1980
[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1982
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1983
dnl Test whether we really found GNU msgfmt.
1984
if test "$GMSGFMT" != ":"; then
1985
dnl If it is no GNU msgfmt we define it as : so that the
1986
dnl Makefiles still can work.
1987
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1988
(if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1991
GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1993
[found $GMSGFMT program is not GNU msgfmt; ignore it])
1998
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1999
dnl Test whether we really found GNU xgettext.
2000
if test "$XGETTEXT" != ":"; then
2001
dnl If it is no GNU xgettext we define it as : so that the
2002
dnl Makefiles still can work.
2003
if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
2004
(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
2008
[found xgettext program is not GNU xgettext; ignore it])
2011
dnl Remove leftover from FreeBSD xgettext call.
2015
AC_OUTPUT_COMMANDS([
2016
for ac_file in $CONFIG_FILES; do
2017
# Support "outfile[:infile[:infile...]]"
2019
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2021
# PO directories have a Makefile.in generated from Makefile.in.in.
2022
case "$ac_file" in */Makefile.in)
2023
# Adjust a relative srcdir.
2024
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2025
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2026
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2027
# In autoconf-2.13 it is called $ac_given_srcdir.
2028
# In autoconf-2.50 it is called $srcdir.
2029
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2030
case "$ac_given_srcdir" in
2031
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2032
/*) top_srcdir="$ac_given_srcdir" ;;
2033
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2035
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2036
rm -f "$ac_dir/POTFILES"
2037
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2038
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2039
POMAKEFILEDEPS="POTFILES.in"
2040
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2041
# on $ac_dir but don't depend on user-specified configuration
2043
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2044
# The LINGUAS file contains the set of available languages.
2045
if test -n "$OBSOLETE_ALL_LINGUAS"; then
2046
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2048
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2049
# Hide the ALL_LINGUAS assigment from automake.
2050
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2051
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2053
# The set of available languages was given in configure.in.
2054
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2057
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2058
# Compute UPDATEPOFILES
2059
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2060
# Compute DUMMYPOFILES
2061
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2063
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2064
case "$ac_given_srcdir" in
2066
*) srcdirpre='$(srcdir)/' ;;
2072
for lang in $ALL_LINGUAS; do
2073
POFILES="$POFILES $srcdirpre$lang.po"
2074
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2075
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2076
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2078
# CATALOGS depends on both $ac_dir and the user's LINGUAS
2079
# environment variable.
2081
if test -n "$ALL_LINGUAS"; then
2082
for presentlang in $ALL_LINGUAS; do
2084
if test "%UNSET%" != "$LINGUAS"; then
2085
desiredlanguages="$LINGUAS"
2087
desiredlanguages="$ALL_LINGUAS"
2089
for desiredlang in $desiredlanguages; do
2090
# Use the presentlang catalog if desiredlang is
2091
# a. equal to presentlang, or
2092
# b. a variant of presentlang (because in this case,
2093
# presentlang can be used as a fallback for messages
2094
# which are not translated in the desiredlang catalog).
2095
case "$desiredlang" in
2096
"$presentlang"*) useit=yes;;
2099
if test $useit = yes; then
2100
INST_LINGUAS="$INST_LINGUAS $presentlang"
2105
if test -n "$INST_LINGUAS"; then
2106
for lang in $INST_LINGUAS; do
2107
CATALOGS="$CATALOGS $lang.gmo"
2110
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2111
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"
2112
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2113
if test -f "$f"; then
2115
*.orig | *.bak | *~) ;;
2116
*) cat "$f" >> "$ac_dir/Makefile" ;;
2124
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2125
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2127
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2128
# Capture the value of LINGUAS because we need it to compute CATALOGS.
2129
LINGUAS="${LINGUAS-%UNSET%}"
2133
dnl Postprocesses a Makefile in a directory containing PO files.
2134
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2136
# When this code is run, in config.status, two variables have already been
2138
# - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2139
# - LINGUAS is the value of the environment variable LINGUAS at configure
2143
# Adjust a relative srcdir.
2144
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2145
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2146
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2147
# In autoconf-2.13 it is called $ac_given_srcdir.
2148
# In autoconf-2.50 it is called $srcdir.
2149
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2150
case "$ac_given_srcdir" in
2151
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2152
/*) top_srcdir="$ac_given_srcdir" ;;
2153
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2156
# Find a way to echo strings without interpreting backslash.
2157
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2160
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2161
gt_echo='printf %s\n'
2172
# A sed script that extracts the value of VARIABLE from a Makefile.
2174
# Test if the hold space is empty.
2179
# Yes it was empty. Look if we have the expected variable definition.
2180
/^[ ]*VARIABLE[ ]*=/{
2181
# Seen the first line of the variable definition.
2182
s/^[ ]*VARIABLE[ ]*=//
2187
# Here we are processing a line from the variable definition.
2188
# Remove comment, more precisely replace it with a space.
2190
# See if the line ends in a backslash.
2194
# Print the line, without the trailing backslash.
2197
# There was no trailing backslash. The end of the variable definition is
2198
# reached. Clear the hold space.
2203
# A trailing backslash means that the variable definition continues in the
2204
# next line. Put a nonempty string into the hold space to indicate this.
2211
# Set POTFILES to the value of the Makefile variable POTFILES.
2212
sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
2213
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2214
# Compute POTFILES_DEPS as
2215
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2217
for file in $POTFILES; do
2218
POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2222
if test -n "$OBSOLETE_ALL_LINGUAS"; then
2223
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2225
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2226
# The LINGUAS file contains the set of available languages.
2227
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2228
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2230
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2231
sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
2232
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2234
# Hide the ALL_LINGUAS assigment from automake.
2235
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2237
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2238
# Compute UPDATEPOFILES
2239
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2240
# Compute DUMMYPOFILES
2241
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2243
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2244
# Compute PROPERTIESFILES
2245
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2246
# Compute CLASSFILES
2247
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2249
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2251
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2252
# Compute RESOURCESDLLFILES
2253
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2254
case "$ac_given_srcdir" in
2256
*) srcdirpre='$(srcdir)/' ;;
2267
for lang in $ALL_LINGUAS; do
2268
POFILES="$POFILES $srcdirpre$lang.po"
2269
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2270
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2271
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2272
PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2273
CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2274
QMFILES="$QMFILES $srcdirpre$lang.qm"
2275
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2276
MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2277
frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2278
RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2280
# CATALOGS depends on both $ac_dir and the user's LINGUAS
2281
# environment variable.
2283
if test -n "$ALL_LINGUAS"; then
2284
for presentlang in $ALL_LINGUAS; do
2286
if test "%UNSET%" != "$LINGUAS"; then
2287
desiredlanguages="$LINGUAS"
2289
desiredlanguages="$ALL_LINGUAS"
2291
for desiredlang in $desiredlanguages; do
2292
# Use the presentlang catalog if desiredlang is
2293
# a. equal to presentlang, or
2294
# b. a variant of presentlang (because in this case,
2295
# presentlang can be used as a fallback for messages
2296
# which are not translated in the desiredlang catalog).
2297
case "$desiredlang" in
2298
"$presentlang"*) useit=yes;;
2301
if test $useit = yes; then
2302
INST_LINGUAS="$INST_LINGUAS $presentlang"
2311
if test -n "$INST_LINGUAS"; then
2312
for lang in $INST_LINGUAS; do
2313
CATALOGS="$CATALOGS $lang.gmo"
2314
JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2315
QTCATALOGS="$QTCATALOGS $lang.qm"
2316
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2317
TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2318
frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2319
CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2323
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"
2324
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2325
# Add dependencies that cannot be formulated as a simple suffix rule.
2326
for lang in $ALL_LINGUAS; do
2327
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2328
cat >> "$ac_file.tmp" <<EOF
2329
$frobbedlang.msg: $lang.po
2330
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2331
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2335
if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2336
# Add dependencies that cannot be formulated as a simple suffix rule.
2337
for lang in $ALL_LINGUAS; do
2338
frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2339
cat >> "$ac_file.tmp" <<EOF
2340
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2341
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2342
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2346
if test -n "$POMAKEFILEDEPS"; then
2347
cat >> "$ac_file.tmp" <<EOF
2348
Makefile: $POMAKEFILEDEPS
2351
mv "$ac_file.tmp" "$ac_file"
2354
# progtest.m4 serial 3 (gettext-0.12)
2355
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2356
dnl This file is free software, distributed under the terms of the GNU
2357
dnl General Public License. As a special exception to the GNU General
2358
dnl Public License, this file may be distributed as part of a program
2359
dnl that contains a configuration script generated by Autoconf, under
2360
dnl the same distribution terms as the rest of that program.
2362
dnl This file can can be used in projects which are not available under
2363
dnl the GNU General Public License or the GNU Library General Public
2364
dnl License but which still want to provide support for the GNU gettext
2366
dnl Please note that the actual code of the GNU gettext library is covered
2367
dnl by the GNU Library General Public License, and the rest of the GNU
2368
dnl gettext package package is covered by the GNU General Public License.
2369
dnl They are *not* in the public domain.
2372
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2374
# Search path for a program which passes the given test.
2376
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2377
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2378
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2380
# Prepare PATH_SEPARATOR.
2381
# The user is always right.
2382
if test "${PATH_SEPARATOR+set}" != set; then
2383
echo "#! /bin/sh" >conf$$.sh
2384
echo "exit 0" >>conf$$.sh
2386
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2394
# Find out how to test for executable files. Don't use a zero-byte file,
2395
# as systems may use methods other than mode bits to determine executability.
2396
cat >conf$$.file <<_ASEOF
2400
chmod +x conf$$.file
2401
if test -x conf$$.file >/dev/null 2>&1; then
2402
ac_executable_p="test -x"
2404
ac_executable_p="test -f"
2408
# Extract the first word of "$2", so it can be a program name with args.
2409
set dummy $2; ac_word=[$]2
2410
AC_MSG_CHECKING([for $ac_word])
2411
AC_CACHE_VAL(ac_cv_path_$1,
2413
[[\\/]]* | ?:[[\\/]]*)
2414
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2417
ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2418
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2420
test -z "$ac_dir" && ac_dir=.
2421
for ac_exec_ext in '' $ac_executable_extensions; do
2422
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2424
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2431
dnl If no 4th arg is given, leave the cache variable unset,
2432
dnl so AC_PATH_PROGS will keep looking.
2433
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2438
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2439
AC_MSG_RESULT([$]$1)
476
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
477
# ---------------------------------------------
478
m4_define([_PKG_CONFIG],
479
[if test -n "$PKG_CONFIG"; then
480
if test -n "$$1"; then
483
PKG_CHECK_EXISTS([$3],
484
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
492
# _PKG_SHORT_ERRORS_SUPPORTED
493
# -----------------------------
494
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
495
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
496
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
497
_pkg_short_errors_supported=yes
499
_pkg_short_errors_supported=no
501
])# _PKG_SHORT_ERRORS_SUPPORTED
504
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
505
# [ACTION-IF-NOT-FOUND])
508
# Note that if there is a possibility the first call to
509
# PKG_CHECK_MODULES might not happen, you should be sure to include an
510
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
513
# --------------------------------------------------------------
514
AC_DEFUN([PKG_CHECK_MODULES],
515
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
516
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
517
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
520
AC_MSG_CHECKING([for $1])
522
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
523
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
525
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
526
and $1[]_LIBS to avoid the need to call pkg-config.
527
See the pkg-config man page for more details.])
529
if test $pkg_failed = yes; then
530
_PKG_SHORT_ERRORS_SUPPORTED
531
if test $_pkg_short_errors_supported = yes; then
532
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
534
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
536
# Put the nasty error message in config.log where it belongs
537
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
539
ifelse([$4], , [AC_MSG_ERROR(dnl
540
[Package requirements ($2) were not met:
544
Consider adjusting the PKG_CONFIG_PATH environment variable if you
545
installed software in a non-standard prefix.
551
elif test $pkg_failed = untried; then
552
ifelse([$4], , [AC_MSG_FAILURE(dnl
553
[The pkg-config script could not be found or is too old. Make sure it
554
is in your PATH or set the PKG_CONFIG environment variable to the full
559
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
562
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
563
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
565
ifelse([$3], , :, [$3])
567
])# PKG_CHECK_MODULES
2446
569
# Configure paths for SDL
2447
570
# Sam Lantinga 9/21/99