aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authordurner <durner@140774ce-b5e7-0310-ab8b-a85725594a96>2009-05-29 19:20:23 +0000
committerdurner <durner@140774ce-b5e7-0310-ab8b-a85725594a96>2009-05-29 19:20:23 +0000
commita139274843a744df439ba256c66254be6cc3a9f3 (patch)
treedf49518ea91d8a644ecbd0e6a48c26c1e7fe93b3 /m4
parent4b6f9a9625805dd9b2747240e2e1f91687615331 (diff)
cp
git-svn-id: https://gnunet.org/svn/gnunet@8479 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'm4')
-rw-r--r--m4/ChangeLog66
-rw-r--r--m4/Makefile.am36
-rw-r--r--m4/ac_define_dir.m435
-rw-r--r--m4/align.m428
-rw-r--r--m4/argz.m479
-rw-r--r--m4/codeset.m421
-rw-r--r--m4/freetype2.m4178
-rw-r--r--m4/gettext.m4419
-rw-r--r--m4/glib-2.0.m4212
-rw-r--r--m4/glib-gettext.m4380
-rw-r--r--m4/glibc2.m430
-rw-r--r--m4/glibc21.m430
-rw-r--r--m4/gtk-2.0.m4196
-rw-r--r--m4/iconv.m4101
-rw-r--r--m4/intdiv0.m470
-rw-r--r--m4/intl.m4259
-rw-r--r--m4/intldir.m419
-rw-r--r--m4/intmax.m433
-rw-r--r--m4/inttypes-pri.m436
-rw-r--r--m4/inttypes.m427
-rw-r--r--m4/inttypes_h.m426
-rw-r--r--m4/isc-posix.m426
-rw-r--r--m4/lcmessage.m430
-rw-r--r--m4/lib-ld.m4110
-rw-r--r--m4/lib-link.m4644
-rw-r--r--m4/lib-prefix.m4185
-rw-r--r--m4/libcurl.m4239
-rw-r--r--m4/libgcrypt.m4108
-rw-r--r--m4/libltdl-external.m475
-rw-r--r--m4/libtool.m47325
-rw-r--r--m4/libxml2.m4188
-rw-r--r--m4/lock.m4311
-rw-r--r--m4/longdouble.m431
-rw-r--r--m4/longlong.m448
-rw-r--r--m4/ltdl.m4824
-rw-r--r--m4/ltoptions.m4368
-rw-r--r--m4/ltsugar.m4123
-rw-r--r--m4/ltversion.m423
-rw-r--r--m4/lt~obsolete.m492
-rw-r--r--m4/nls.m431
-rw-r--r--m4/pkg.m457
-rw-r--r--m4/po.m4428
-rw-r--r--m4/printf-posix.m444
-rw-r--r--m4/progtest.m492
-rw-r--r--m4/signed.m419
-rw-r--r--m4/size_max.m462
-rw-r--r--m4/stdint_h.m426
-rw-r--r--m4/uintmax_t.m430
-rw-r--r--m4/ulonglong.m448
-rw-r--r--m4/visibility.m452
-rw-r--r--m4/wchar_t.m420
-rw-r--r--m4/wint_t.m420
-rw-r--r--m4/xsize.m413
53 files changed, 13973 insertions, 0 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
new file mode 100644
index 0000000000..e76f4b088f
--- /dev/null
+++ b/m4/ChangeLog
@@ -0,0 +1,66 @@
+2007-02-08 gettextize <bug-gnu-gettext@gnu.org>
+
+ * gettext.m4: Upgrade to gettext-0.16.1.
+ * iconv.m4: Upgrade to gettext-0.16.1.
+ * lib-ld.m4: Upgrade to gettext-0.16.1.
+ * lib-link.m4: Upgrade to gettext-0.16.1.
+ * lib-prefix.m4: Upgrade to gettext-0.16.1.
+ * nls.m4: Upgrade to gettext-0.16.1.
+ * po.m4: Upgrade to gettext-0.16.1.
+ * progtest.m4: Upgrade to gettext-0.16.1.
+ * codeset.m4: Upgrade to gettext-0.16.1.
+ * glibc2.m4: New file, from gettext-0.16.1.
+ * glibc21.m4: Upgrade to gettext-0.16.1.
+ * intdiv0.m4: Upgrade to gettext-0.16.1.
+ * intl.m4: New file, from gettext-0.16.1.
+ * intldir.m4: New file, from gettext-0.16.1.
+ * intmax.m4: Upgrade to gettext-0.16.1.
+ * inttypes_h.m4: Upgrade to gettext-0.16.1.
+ * inttypes-pri.m4: Upgrade to gettext-0.16.1.
+ * lcmessage.m4: Upgrade to gettext-0.16.1.
+ * lock.m4: New file, from gettext-0.16.1.
+ * longdouble.m4: Upgrade to gettext-0.16.1.
+ * longlong.m4: Upgrade to gettext-0.16.1.
+ * printf-posix.m4: Upgrade to gettext-0.16.1.
+ * size_max.m4: Upgrade to gettext-0.16.1.
+ * stdint_h.m4: Upgrade to gettext-0.16.1.
+ * uintmax_t.m4: Upgrade to gettext-0.16.1.
+ * ulonglong.m4: Upgrade to gettext-0.16.1.
+ * visibility.m4: New file, from gettext-0.16.1.
+ * wchar_t.m4: Upgrade to gettext-0.16.1.
+ * wint_t.m4: Upgrade to gettext-0.16.1.
+ * xsize.m4: Upgrade to gettext-0.16.1.
+ * Makefile.am (EXTRA_DIST): Add the new files.
+
+2004-08-21 gettextize <bug-gnu-gettext@gnu.org>
+
+ * codeset.m4: New file, from gettext-0.14.
+ * gettext.m4: New file, from gettext-0.14.
+ * glibc21.m4: New file, from gettext-0.14.
+ * iconv.m4: New file, from gettext-0.14.
+ * intdiv0.m4: New file, from gettext-0.14.
+ * intmax.m4: New file, from gettext-0.14.
+ * inttypes.m4: New file, from gettext-0.14.
+ * inttypes_h.m4: New file, from gettext-0.14.
+ * inttypes-pri.m4: New file, from gettext-0.14.
+ * isc-posix.m4: New file, from gettext-0.14.
+ * lcmessage.m4: New file, from gettext-0.14.
+ * lib-ld.m4: New file, from gettext-0.14.
+ * lib-link.m4: New file, from gettext-0.14.
+ * lib-prefix.m4: New file, from gettext-0.14.
+ * longdouble.m4: New file, from gettext-0.14.
+ * longlong.m4: New file, from gettext-0.14.
+ * nls.m4: New file, from gettext-0.14.
+ * po.m4: New file, from gettext-0.14.
+ * printf-posix.m4: New file, from gettext-0.14.
+ * progtest.m4: New file, from gettext-0.14.
+ * signed.m4: New file, from gettext-0.14.
+ * size_max.m4: New file, from gettext-0.14.
+ * stdint_h.m4: New file, from gettext-0.14.
+ * uintmax_t.m4: New file, from gettext-0.14.
+ * ulonglong.m4: New file, from gettext-0.14.
+ * wchar_t.m4: New file, from gettext-0.14.
+ * wint_t.m4: New file, from gettext-0.14.
+ * xsize.m4: New file, from gettext-0.14.
+ * Makefile.am: New file.
+
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644
index 0000000000..3afad7e810
--- /dev/null
+++ b/m4/Makefile.am
@@ -0,0 +1,36 @@
+EXTRA_DIST = glibc2.m4 intl.m4 intldir.m4 lock.m4 visibility.m4 \
+codeset.m4 \
+freetype2.m4\
+gettext.m4\
+glib-2.0.m4\
+glibc21.m4\
+glib-gettext.m4\
+gtk-2.0.m4\
+iconv.m4\
+intdiv0.m4\
+intmax.m4\
+inttypes_h.m4\
+inttypes.m4\
+inttypes-pri.m4\
+isc-posix.m4\
+lcmessage.m4\
+libgcrypt.m4\
+lib-ld.m4\
+lib-link.m4\
+lib-prefix.m4\
+libxml2.m4\
+longdouble.m4\
+longlong.m4\
+nls.m4\
+pkg.m4\
+po.m4\
+printf-posix.m4\
+progtest.m4\
+signed.m4\
+size_max.m4\
+stdint_h.m4\
+uintmax_t.m4\
+ulonglong.m4\
+wchar_t.m4\
+wint_t.m4\
+xsize.m4
diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4
new file mode 100644
index 0000000000..f7e028fca2
--- /dev/null
+++ b/m4/ac_define_dir.m4
@@ -0,0 +1,35 @@
+dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
+dnl
+dnl This macro _AC_DEFINEs VARNAME to the expansion of the DIR
+dnl variable, taking care of fixing up ${prefix} and such.
+dnl
+dnl VARNAME is offered as both a C preprocessor symbol, and an output
+dnl variable.
+dnl
+dnl Note that the 3 argument form is only supported with autoconf 2.13
+dnl and later (i.e. only where _AC_DEFINE supports 3 arguments).
+dnl
+dnl Examples:
+dnl
+dnl AC_DEFINE_DIR(DATADIR, datadir)
+dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
+dnl
+dnl @category Misc
+dnl @author Stepan Kasal <kasal@ucw.cz>
+dnl @author Andreas Schwab <schwab@suse.de>
+dnl @author Guido Draheim <guidod@gmx.de>
+dnl @author Alexandre Oliva
+dnl @version 2005-01-17
+dnl @license AllPermissive
+
+AC_DEFUN([AC_DEFINE_DIR], [
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+ eval ac_define_dir="\"[$]$2\""
+ AC_SUBST($1, "$ac_define_dir")
+ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
+])
diff --git a/m4/align.m4 b/m4/align.m4
new file mode 100644
index 0000000000..256300e377
--- /dev/null
+++ b/m4/align.m4
@@ -0,0 +1,28 @@
+# align.m4
+dnl Copyright (C) 2008 Christian Grothoff
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Define HAVE_UNALIGNED_64_ACCESS if reading a 64-bit value at a 32-bit aligned offset works
+# Note that the program intentionally causes a SIGBUS (so you may
+# see some message along those lines on the console).
+AC_DEFUN([AC_UNALIGNED_64_ACCESS],
+[AC_CACHE_CHECK([whether unaligned 64-bit access works],
+ ac_cv_unaligned_64_access,
+ [
+ AC_RUN_IFELSE(AC_LANG_PROGRAM([[struct S { int a,b,c;};]],
+ [[struct S s = {0,0,0}; long long * p = &s.b;
+ long long x = *p; return (int) x*x;]]),
+ ac_cv_unaligned_64_access=yes,
+ ac_cv_unaligned_64_access=no,
+ ac_cv_unaligned_64_access=no)
+ ])
+ case "$ac_cv_unaligned_64_access" in
+ *yes) value=1;;
+ *) value=0;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_UNALIGNED_64_ACCESS], $value, [We can access-64 bit values that are only 32-bit aligned])
+])
diff --git a/m4/argz.m4 b/m4/argz.m4
new file mode 100644
index 0000000000..edc99bbce2
--- /dev/null
+++ b/m4/argz.m4
@@ -0,0 +1,79 @@
+# Portability macros for glibc argz. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan <gary@gnu.org>
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 argz.m4
+
+AC_DEFUN([gl_FUNC_ARGZ],
+[gl_PREREQ_ARGZ
+
+AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT])
+
+AC_CHECK_TYPES([error_t],
+ [],
+ [AC_DEFINE([error_t], [int],
+ [Define to a type to use for `error_t' if it is not otherwise available.])
+ AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h
+ does not typedef error_t.])],
+ [#if defined(HAVE_ARGZ_H)
+# include <argz.h>
+#endif])
+
+ARGZ_H=
+AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \
+ argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])])
+
+dnl if have system argz functions, allow forced use of
+dnl libltdl-supplied implementation (and default to do so
+dnl on "known bad" systems). Could use a runtime check, but
+dnl (a) detecting malloc issues is notoriously unreliable
+dnl (b) only known system that declares argz functions,
+dnl provides them, yet they are broken, is cygwin
+dnl releases prior to 16-Mar-2007 (1.5.24 and earlier)
+dnl So, it's more straightforward simply to special case
+dnl this for known bad systems.
+AS_IF([test -z "$ARGZ_H"],
+ [AC_CACHE_CHECK(
+ [if argz actually works],
+ [lt_cv_sys_argz_works],
+ [[case $host_os in #(
+ *cygwin*)
+ lt_cv_sys_argz_works=no
+ if test "$cross_compiling" != no; then
+ lt_cv_sys_argz_works="guessing no"
+ else
+ lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/'
+ save_IFS=$IFS
+ IFS=-.
+ set x `uname -r | sed -e "$lt_sed_extract_leading_digits"`
+ IFS=$save_IFS
+ lt_os_major=${2-0}
+ lt_os_minor=${3-0}
+ lt_os_micro=${4-0}
+ if test "$lt_os_major" -gt 1 \
+ || { test "$lt_os_major" -eq 1 \
+ && { test "$lt_os_minor" -gt 5 \
+ || { test "$lt_os_minor" -eq 5 \
+ && test "$lt_os_micro" -gt 24; }; }; }; then
+ lt_cv_sys_argz_works=yes
+ fi
+ fi
+ ;; #(
+ *) lt_cv_sys_argz_works=yes ;;
+ esac]])
+ AS_IF([test $lt_cv_sys_argz_works = yes],
+ [AC_DEFINE([HAVE_WORKING_ARGZ], 1,
+ [This value is set to 1 to indicate that the system argz facility works])],
+ [ARGZ_H=argz.h
+ AC_LIBOBJ([argz])])])
+
+AC_SUBST([ARGZ_H])
+])
+
+# Prerequisites of lib/argz.c.
+AC_DEFUN([gl_PREREQ_ARGZ], [:])
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644
index 0000000000..223955b454
--- /dev/null
+++ b/m4/codeset.m4
@@ -0,0 +1,21 @@
+# codeset.m4 serial 2 (gettext-0.16)
+dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET); return !cs;],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
diff --git a/m4/freetype2.m4 b/m4/freetype2.m4
new file mode 100644
index 0000000000..7424a32ab5
--- /dev/null
+++ b/m4/freetype2.m4
@@ -0,0 +1,178 @@
+# Configure paths for FreeType2
+# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
+#
+# serial 2
+
+# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
+# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
+# FreeType 2.0.4).
+#
+AC_DEFUN([AC_CHECK_FT2],
+ [# Get the cflags and libraries from the freetype-config script
+ #
+ AC_ARG_WITH([ft-prefix],
+ dnl don't quote AS_HELP_STRING!
+ AS_HELP_STRING([--with-ft-prefix=PREFIX],
+ [Prefix where FreeType is installed (optional)]),
+ [ft_config_prefix="$withval"],
+ [ft_config_prefix=""])
+
+ AC_ARG_WITH([ft-exec-prefix],
+ dnl don't quote AS_HELP_STRING!
+ AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
+ [Exec prefix where FreeType is installed (optional)]),
+ [ft_config_exec_prefix="$withval"],
+ [ft_config_exec_prefix=""])
+
+ AC_ARG_ENABLE([freetypetest],
+ dnl don't quote AS_HELP_STRING!
+ AS_HELP_STRING([--disable-freetypetest],
+ [Do not try to compile and run a test FreeType program]),
+ [],
+ [enable_fttest=yes])
+
+ if test x$ft_config_exec_prefix != x ; then
+ ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
+ if test x${FT2_CONFIG+set} != xset ; then
+ FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
+ fi
+ fi
+
+ if test x$ft_config_prefix != x ; then
+ ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
+ if test x${FT2_CONFIG+set} != xset ; then
+ FT2_CONFIG=$ft_config_prefix/bin/freetype-config
+ fi
+ fi
+
+ AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no])
+
+ min_ft_version=m4_if([$1], [], [7.0.1], [$1])
+ AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version])
+ no_ft=""
+ if test "$FT2_CONFIG" = "no" ; then
+ no_ft=yes
+ else
+ FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
+ FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
+ ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ ft_min_major_version=`echo $min_ft_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ ft_min_minor_version=`echo $min_ft_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ ft_min_micro_version=`echo $min_ft_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test x$enable_fttest = xyes ; then
+ ft_config_is_lt=""
+ if test $ft_config_major_version -lt $ft_min_major_version ; then
+ ft_config_is_lt=yes
+ else
+ if test $ft_config_major_version -eq $ft_min_major_version ; then
+ if test $ft_config_minor_version -lt $ft_min_minor_version ; then
+ ft_config_is_lt=yes
+ else
+ if test $ft_config_minor_version -eq $ft_min_minor_version ; then
+ if test $ft_config_micro_version -lt $ft_min_micro_version ; then
+ ft_config_is_lt=yes
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test x$ft_config_is_lt = xyes ; then
+ no_ft=yes
+ else
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $FT2_CFLAGS"
+ LIBS="$FT2_LIBS $LIBS"
+
+ #
+ # Sanity checks for the results of freetype-config to some extent.
+ #
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([[
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main()
+{
+ FT_Library library;
+ FT_Error error;
+
+ error = FT_Init_FreeType(&library);
+
+ if (error)
+ return 1;
+ else
+ {
+ FT_Done_FreeType(library);
+ return 0;
+ }
+}
+
+ ]])
+ ],
+ [],
+ [no_ft=yes],
+ [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"])
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi # test $ft_config_version -lt $ft_min_version
+ fi # test x$enable_fttest = xyes
+ fi # test "$FT2_CONFIG" = "no"
+
+ if test x$no_ft = x ; then
+ AC_MSG_RESULT([yes])
+ m4_if([$2], [], [:], [$2])
+ else
+ AC_MSG_RESULT([no])
+ if test "$FT2_CONFIG" = "no" ; then
+ AC_MSG_WARN([
+
+ The freetype-config script installed by FreeType 2 could not be found.
+ If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in
+ your path, or set the FT2_CONFIG environment variable to the
+ full path to freetype-config.
+ ])
+ else
+ if test x$ft_config_is_lt = xyes ; then
+ AC_MSG_WARN([
+
+ Your installed version of the FreeType 2 library is too old.
+ If you have different versions of FreeType 2, make sure that
+ correct values for --with-ft-prefix or --with-ft-exec-prefix
+ are used, or set the FT2_CONFIG environment variable to the
+ full path to freetype-config.
+ ])
+ else
+ AC_MSG_WARN([
+
+ The FreeType test program failed to run. If your system uses
+ shared libraries and they are installed outside the normal
+ system library path, make sure the variable LD_LIBRARY_PATH
+ (or whatever is appropiate for your system) is correctly set.
+ ])
+ fi
+ fi
+
+ FT2_CFLAGS=""
+ FT2_LIBS=""
+ m4_if([$3], [], [:], [$3])
+ fi
+
+ AC_SUBST([FT2_CFLAGS])
+ AC_SUBST([FT2_LIBS])])
+
+# end of freetype2.m4
diff --git a/m4/gettext.m4 b/m4/gettext.m4
new file mode 100644
index 0000000000..91c345e992
--- /dev/null
+++ b/m4/gettext.m4
@@ -0,0 +1,419 @@
+# gettext.m4 serial 59 (gettext-0.16.1)
+dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl default (if it is not specified or empty) is 'no-libtool'.
+dnl INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl depending on --{enable,disable}-{shared,static} and on the presence of
+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl implementations (in libc or libintl) without the ngettext() function
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries. If empty,
+dnl the value `$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl and used.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl Catalog format: none
+dnl Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+ dnl Argument checking.
+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+ define([gt_included_intl],
+ ifelse([$1], [external],
+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+ [yes]))
+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
+
+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
+ ifelse(gt_included_intl, yes, [
+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
+ ])
+
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+ dnl documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
+ dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+ gt_INTL_MACOSX
+
+ dnl Set USE_NLS.
+ AC_REQUIRE([AM_NLS])
+
+ ifelse(gt_included_intl, yes, [
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ ])
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+ ifelse(gt_included_intl, yes, [
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH(included-gettext,
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ ])
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If GNU gettext is available we use this. Else we have
+ dnl to fall back to GNU NLS library.
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;],
+ [bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then