328
dnl Checks for all prerequisites of the po subdirectory,
329
dnl except for USE_NLS.
330
AC_DEFUN([AM_PO_SUBDIRS],
332
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
333
AC_REQUIRE([AC_PROG_INSTALL])dnl
334
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
336
dnl Perform the following tests also if --disable-nls has been given,
337
dnl because they are needed for "make dist" to work.
339
dnl Search for GNU msgfmt in the PATH.
340
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
341
dnl The second test excludes FreeBSD msgfmt.
342
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
343
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
344
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
346
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
348
dnl Search for GNU xgettext 0.11 or newer in the PATH.
349
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
350
dnl The second test excludes FreeBSD xgettext.
351
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
352
[$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
353
(if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
355
dnl Remove leftover from FreeBSD xgettext call.
358
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
359
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
360
[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
362
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
363
dnl Test whether we really found GNU msgfmt.
364
if test "$GMSGFMT" != ":"; then
365
dnl If it is no GNU msgfmt we define it as : so that the
366
dnl Makefiles still can work.
367
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
368
(if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
371
GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
373
[found $GMSGFMT program is not GNU msgfmt; ignore it])
378
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
379
dnl Test whether we really found GNU xgettext.
380
if test "$XGETTEXT" != ":"; then
381
dnl If it is no GNU xgettext we define it as : so that the
382
dnl Makefiles still can work.
383
if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
384
(if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
388
[found xgettext program is not GNU xgettext; ignore it])
391
dnl Remove leftover from FreeBSD xgettext call.
396
for ac_file in $CONFIG_FILES; do
397
# Support "outfile[:infile[:infile...]]"
399
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
401
# PO directories have a Makefile.in generated from Makefile.in.in.
402
case "$ac_file" in */Makefile.in)
403
# Adjust a relative srcdir.
404
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
405
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
406
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
407
# In autoconf-2.13 it is called $ac_given_srcdir.
408
# In autoconf-2.50 it is called $srcdir.
409
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
410
case "$ac_given_srcdir" in
411
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
412
/*) top_srcdir="$ac_given_srcdir" ;;
413
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
415
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
416
rm -f "$ac_dir/POTFILES"
417
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
418
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
419
# ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
420
# on $ac_dir but don't depend on user-specified configuration
422
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
423
# The LINGUAS file contains the set of available languages.
424
if test -n "$ALL_LINGUAS"; then
425
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
427
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
428
# Hide the ALL_LINGUAS assigment from automake.
429
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
431
case "$ac_given_srcdir" in
433
*) srcdirpre='$(srcdir)/' ;;
439
for lang in $ALL_LINGUAS; do
440
POFILES="$POFILES $srcdirpre$lang.po"
441
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
442
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
443
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
445
# CATALOGS depends on both $ac_dir and the user's LINGUAS
446
# environment variable.
448
if test -n "$ALL_LINGUAS"; then
449
for presentlang in $ALL_LINGUAS; do
451
if test "%UNSET%" != "$LINGUAS"; then
452
desiredlanguages="$LINGUAS"
454
desiredlanguages="$ALL_LINGUAS"
456
for desiredlang in $desiredlanguages; do
457
# Use the presentlang catalog if desiredlang is
458
# a. equal to presentlang, or
459
# b. a variant of presentlang (because in this case,
460
# presentlang can be used as a fallback for messages
461
# which are not translated in the desiredlang catalog).
462
case "$desiredlang" in
463
"$presentlang"*) useit=yes;;
466
if test $useit = yes; then
467
INST_LINGUAS="$INST_LINGUAS $presentlang"
472
if test -n "$INST_LINGUAS"; then
473
for lang in $INST_LINGUAS; do
474
CATALOGS="$CATALOGS $lang.gmo"
477
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
478
sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
479
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
480
if test -f "$f"; then
482
*.orig | *.bak | *~) ;;
483
*) cat "$f" >> "$ac_dir/Makefile" ;;
491
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
492
# POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
494
eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
495
# Capture the value of LINGUAS because we need it to compute CATALOGS.
496
LINGUAS="${LINGUAS-%UNSET%}"
501
356
dnl Checks for all prerequisites of the intl subdirectory,
502
357
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
503
358
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
507
362
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
508
363
AC_REQUIRE([AC_PROG_CC])dnl
509
364
AC_REQUIRE([AC_CANONICAL_HOST])dnl
365
AC_REQUIRE([gt_GLIBC2])dnl
510
366
AC_REQUIRE([AC_PROG_RANLIB])dnl
511
367
AC_REQUIRE([AC_ISC_POSIX])dnl
512
368
AC_REQUIRE([AC_HEADER_STDC])dnl
513
369
AC_REQUIRE([AC_C_CONST])dnl
370
AC_REQUIRE([bh_C_SIGNED])dnl
514
371
AC_REQUIRE([AC_C_INLINE])dnl
515
372
AC_REQUIRE([AC_TYPE_OFF_T])dnl
516
373
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
374
AC_REQUIRE([gl_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([gl_AC_HEADER_INTTYPES_H])
379
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
380
AC_REQUIRE([gt_TYPE_INTMAX_T])
381
AC_REQUIRE([gt_PRINTF_POSIX])
517
382
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
518
383
AC_REQUIRE([AC_FUNC_MMAP])dnl
519
AC_REQUIRE([jm_GLIBC21])dnl
384
AC_REQUIRE([gl_GLIBC21])dnl
520
385
AC_REQUIRE([gt_INTDIV0])dnl
521
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
386
AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
522
387
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
523
388
AC_REQUIRE([gt_INTTYPES_PRI])dnl
389
AC_REQUIRE([gl_XSIZE])dnl
390
AC_REQUIRE([gt_INTL_MACOSX])dnl
392
AC_CHECK_TYPE([ptrdiff_t], ,
393
[AC_DEFINE([ptrdiff_t], [long],
394
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
525
396
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
526
397
stdlib.h string.h unistd.h sys/param.h])
527
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
528
geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
529
strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
398
AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
399
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
400
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
403
dnl Use the _snprintf function only if it is declared (because on NetBSD it
404
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
405
gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
406
gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
408
dnl Use the *_unlocked functions only if they are declared.
409
dnl (because some of them were defined without being declared in Solaris
410
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
411
dnl on Solaris 2.5.1 to run on Solaris 2.6).
412
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
413
gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
414
gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
415
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
417
case $gt_cv_func_printf_posix in
418
*yes) HAVE_POSIX_PRINTF=1 ;;
419
*) HAVE_POSIX_PRINTF=0 ;;
421
AC_SUBST([HAVE_POSIX_PRINTF])
422
if test "$ac_cv_func_asprintf" = yes; then
427
AC_SUBST([HAVE_ASPRINTF])
428
if test "$ac_cv_func_snprintf" = yes; then
433
AC_SUBST([HAVE_SNPRINTF])
434
if test "$ac_cv_func_wprintf" = yes; then
439
AC_SUBST([HAVE_WPRINTF])
532
442
AM_LANGINFO_CODESET
533
443
if test $ac_cv_header_locale_h = yes; then
447
if test -n "$INTL_MACOSX_LIBS"; then
448
CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
537
451
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
570
AC_DEFUN([AM_MKINSTALLDIRS],
572
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
573
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
574
dnl Try to locate is.
576
if test -n "$ac_aux_dir"; then
577
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
579
if test -z "$MKINSTALLDIRS"; then
580
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
582
AC_SUBST(MKINSTALLDIRS)
484
dnl Checks for special options needed on MacOS X.
485
dnl Defines INTL_MACOSX_LIBS.
486
AC_DEFUN([gt_INTL_MACOSX],
488
dnl Check for API introduced in MacOS X 10.2.
489
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
490
gt_cv_func_CFPreferencesCopyAppValue,
491
[gt_save_CPPFLAGS="$CPPFLAGS"
492
CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
494
LIBS="$LIBS -framework CoreFoundation"
495
AC_TRY_LINK([#include <CFPreferences.h>],
496
[CFPreferencesCopyAppValue(NULL, NULL)],
497
[gt_cv_func_CFPreferencesCopyAppValue=yes],
498
[gt_cv_func_CFPreferencesCopyAppValue=no])
499
CPPFLAGS="$gt_save_CPPFLAGS"
500
LIBS="$gt_save_LIBS"])
501
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
502
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
503
[Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
505
dnl Check for API introduced in MacOS X 10.3.
506
AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
507
[gt_save_CPPFLAGS="$CPPFLAGS"
508
CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
510
LIBS="$LIBS -framework CoreFoundation"
511
AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
512
[gt_cv_func_CFLocaleCopyCurrent=yes],
513
[gt_cv_func_CFLocaleCopyCurrent=no])
514
CPPFLAGS="$gt_save_CPPFLAGS"
515
LIBS="$gt_save_LIBS"])
516
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
517
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
518
[Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
521
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
522
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
524
AC_SUBST([INTL_MACOSX_LIBS])
528
dnl gt_CHECK_DECL(FUNC, INCLUDES)
529
dnl Check whether a function is declared.
530
AC_DEFUN([gt_CHECK_DECL],
532
AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
533
[AC_TRY_COMPILE([$2], [
535
char *p = (char *) $1;
537
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
538
if test $ac_cv_have_decl_$1 = yes; then
543
AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
544
[Define to 1 if you have the declaration of `$1', and to 0 if you don't.])