Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 1 | # codeset.m4 serial AM1 (gettext-0.10.40) |
| 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. |
| 3 | dnl This file is free software, distributed under the terms of the GNU |
| 4 | dnl General Public License. As a special exception to the GNU General |
| 5 | dnl Public License, this file may be distributed as part of a program |
| 6 | dnl that contains a configuration script generated by Autoconf, under |
| 7 | dnl the same distribution terms as the rest of that program. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 8 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 9 | dnl From Bruno Haible. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 10 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 11 | AC_DEFUN([AM_LANGINFO_CODESET], |
| 12 | [ |
| 13 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, |
| 14 | [AC_TRY_LINK([#include <langinfo.h>], |
| 15 | [char* cs = nl_langinfo(CODESET);], |
| 16 | am_cv_langinfo_codeset=yes, |
| 17 | am_cv_langinfo_codeset=no) |
| 18 | ]) |
| 19 | if test $am_cv_langinfo_codeset = yes; then |
| 20 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, |
| 21 | [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) |
| 22 | fi |
| 23 | ]) |
| 24 | # gettext.m4 serial 17 (gettext-0.11.5) |
| 25 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
| 26 | dnl This file is free software, distributed under the terms of the GNU |
| 27 | dnl General Public License. As a special exception to the GNU General |
| 28 | dnl Public License, this file may be distributed as part of a program |
| 29 | dnl that contains a configuration script generated by Autoconf, under |
| 30 | dnl the same distribution terms as the rest of that program. |
| 31 | dnl |
| 32 | dnl This file can can be used in projects which are not available under |
| 33 | dnl the GNU General Public License or the GNU Library General Public |
| 34 | dnl License but which still want to provide support for the GNU gettext |
| 35 | dnl functionality. |
| 36 | dnl Please note that the actual code of the GNU gettext library is covered |
| 37 | dnl by the GNU Library General Public License, and the rest of the GNU |
| 38 | dnl gettext package package is covered by the GNU General Public License. |
| 39 | dnl They are *not* in the public domain. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 40 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 41 | dnl Authors: |
| 42 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. |
| 43 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002. |
| 44 | |
| 45 | dnl Macro to add for using GNU gettext. |
| 46 | |
| 47 | dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). |
| 48 | dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The |
| 49 | dnl default (if it is not specified or empty) is 'no-libtool'. |
| 50 | dnl INTLSYMBOL should be 'external' for packages with no intl directory, |
| 51 | dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. |
| 52 | dnl If INTLSYMBOL is 'use-libtool', then a libtool library |
| 53 | dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, |
| 54 | dnl depending on --{enable,disable}-{shared,static} and on the presence of |
| 55 | dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library |
| 56 | dnl $(top_builddir)/intl/libintl.a will be created. |
| 57 | dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext |
| 58 | dnl implementations (in libc or libintl) without the ngettext() function |
| 59 | dnl will be ignored. If NEEDSYMBOL is specified and is |
| 60 | dnl 'need-formatstring-macros', then GNU gettext implementations that don't |
| 61 | dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. |
| 62 | dnl INTLDIR is used to find the intl libraries. If empty, |
| 63 | dnl the value `$(top_builddir)/intl/' is used. |
| 64 | dnl |
| 65 | dnl The result of the configuration is one of three cases: |
| 66 | dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled |
| 67 | dnl and used. |
| 68 | dnl Catalog format: GNU --> install in $(datadir) |
| 69 | dnl Catalog extension: .mo after installation, .gmo in source tree |
| 70 | dnl 2) GNU gettext has been found in the system's C library. |
| 71 | dnl Catalog format: GNU --> install in $(datadir) |
| 72 | dnl Catalog extension: .mo after installation, .gmo in source tree |
| 73 | dnl 3) No internationalization, always use English msgid. |
| 74 | dnl Catalog format: none |
| 75 | dnl Catalog extension: none |
| 76 | dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. |
| 77 | dnl The use of .gmo is historical (it was needed to avoid overwriting the |
| 78 | dnl GNU format catalogs when building on a platform with an X/Open gettext), |
| 79 | dnl but we keep it in order not to force irrelevant filename changes on the |
| 80 | dnl maintainers. |
| 81 | dnl |
| 82 | AC_DEFUN([AM_GNU_GETTEXT], |
| 83 | [ |
| 84 | dnl Argument checking. |
| 85 | ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , |
| 86 | [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT |
| 87 | ])])])])]) |
| 88 | ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
| 89 | [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
| 90 | ])])])]) |
| 91 | define(gt_included_intl, ifelse([$1], [external], [no], [yes])) |
| 92 | define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) |
| 93 | |
| 94 | AC_REQUIRE([AM_PO_SUBDIRS])dnl |
| 95 | ifelse(gt_included_intl, yes, [ |
| 96 | AC_REQUIRE([AM_INTL_SUBDIR])dnl |
| 97 | ]) |
| 98 | |
| 99 | dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. |
| 100 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 101 | AC_REQUIRE([AC_LIB_RPATH]) |
| 102 | |
| 103 | dnl Sometimes libintl requires libiconv, so first search for libiconv. |
| 104 | dnl Ideally we would do this search only after the |
| 105 | dnl if test "$USE_NLS" = "yes"; then |
| 106 | dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then |
| 107 | dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT |
| 108 | dnl the configure script would need to contain the same shell code |
| 109 | dnl again, outside any 'if'. There are two solutions: |
| 110 | dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. |
| 111 | dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. |
| 112 | dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not |
| 113 | dnl documented, we avoid it. |
| 114 | ifelse(gt_included_intl, yes, , [ |
| 115 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
| 116 | ]) |
| 117 | |
| 118 | AC_MSG_CHECKING([whether NLS is requested]) |
| 119 | dnl Default is enabled NLS |
| 120 | AC_ARG_ENABLE(nls, |
| 121 | [ --disable-nls do not use Native Language Support], |
| 122 | USE_NLS=$enableval, USE_NLS=yes) |
| 123 | AC_MSG_RESULT($USE_NLS) |
| 124 | AC_SUBST(USE_NLS) |
| 125 | |
| 126 | ifelse(gt_included_intl, yes, [ |
| 127 | BUILD_INCLUDED_LIBINTL=no |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 128 | USE_INCLUDED_LIBINTL=no |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 129 | ]) |
| 130 | LIBINTL= |
| 131 | LTLIBINTL= |
| 132 | POSUB= |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 133 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 134 | dnl If we use NLS figure out what method |
| 135 | if test "$USE_NLS" = "yes"; then |
| 136 | gt_use_preinstalled_gnugettext=no |
| 137 | ifelse(gt_included_intl, yes, [ |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 138 | AC_MSG_CHECKING([whether included gettext is requested]) |
| 139 | AC_ARG_WITH(included-gettext, |
| 140 | [ --with-included-gettext use the GNU gettext library included here], |
| 141 | nls_cv_force_use_gnu_gettext=$withval, |
| 142 | nls_cv_force_use_gnu_gettext=no) |
| 143 | AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) |
| 144 | |
| 145 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" |
| 146 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 147 | ]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 148 | dnl User does not insist on using GNU NLS library. Figure out what |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 149 | dnl to use. If GNU gettext is available we use this. Else we have |
| 150 | dnl to fall back to GNU NLS library. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 151 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 152 | dnl Add a version number to the cache macros. |
| 153 | define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) |
| 154 | define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) |
| 155 | define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 156 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 157 | AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, |
| 158 | [AC_TRY_LINK([#include <libintl.h> |
| 159 | ]ifelse([$2], [need-formatstring-macros], |
| 160 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
| 161 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
| 162 | #endif |
| 163 | changequote(,)dnl |
| 164 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
| 165 | changequote([,])dnl |
| 166 | ], [])[extern int _nl_msg_cat_cntr; |
| 167 | extern int *_nl_domain_bindings;], |
| 168 | [bindtextdomain ("", ""); |
| 169 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], |
| 170 | gt_cv_func_gnugettext_libc=yes, |
| 171 | gt_cv_func_gnugettext_libc=no)]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 172 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 173 | if test "$gt_cv_func_gnugettext_libc" != "yes"; then |
| 174 | dnl Sometimes libintl requires libiconv, so first search for libiconv. |
| 175 | ifelse(gt_included_intl, yes, , [ |
| 176 | AM_ICONV_LINK |
| 177 | ]) |
| 178 | dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL |
| 179 | dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) |
| 180 | dnl because that would add "-liconv" to LIBINTL and LTLIBINTL |
| 181 | dnl even if libiconv doesn't exist. |
| 182 | AC_LIB_LINKFLAGS_BODY([intl]) |
| 183 | AC_CACHE_CHECK([for GNU gettext in libintl], |
| 184 | gt_cv_func_gnugettext_libintl, |
| 185 | [gt_save_CPPFLAGS="$CPPFLAGS" |
| 186 | CPPFLAGS="$CPPFLAGS $INCINTL" |
| 187 | gt_save_LIBS="$LIBS" |
| 188 | LIBS="$LIBS $LIBINTL" |
| 189 | dnl Now see whether libintl exists and does not depend on libiconv. |
| 190 | AC_TRY_LINK([#include <libintl.h> |
| 191 | ]ifelse([$2], [need-formatstring-macros], |
| 192 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
| 193 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
| 194 | #endif |
| 195 | changequote(,)dnl |
| 196 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
| 197 | changequote([,])dnl |
| 198 | ], [])[extern int _nl_msg_cat_cntr; |
| 199 | extern |
| 200 | #ifdef __cplusplus |
| 201 | "C" |
| 202 | #endif |
| 203 | const char *_nl_expand_alias ();], |
| 204 | [bindtextdomain ("", ""); |
| 205 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], |
| 206 | gt_cv_func_gnugettext_libintl=yes, |
| 207 | gt_cv_func_gnugettext_libintl=no) |
| 208 | dnl Now see whether libintl exists and depends on libiconv. |
| 209 | if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then |
| 210 | LIBS="$LIBS $LIBICONV" |
| 211 | AC_TRY_LINK([#include <libintl.h> |
| 212 | ]ifelse([$2], [need-formatstring-macros], |
| 213 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
| 214 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
| 215 | #endif |
| 216 | changequote(,)dnl |
| 217 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
| 218 | changequote([,])dnl |
| 219 | ], [])[extern int _nl_msg_cat_cntr; |
| 220 | extern |
| 221 | #ifdef __cplusplus |
| 222 | "C" |
| 223 | #endif |
| 224 | const char *_nl_expand_alias ();], |
| 225 | [bindtextdomain ("", ""); |
| 226 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], |
| 227 | [LIBINTL="$LIBINTL $LIBICONV" |
| 228 | LTLIBINTL="$LTLIBINTL $LTLIBICONV" |
| 229 | gt_cv_func_gnugettext_libintl=yes |
| 230 | ]) |
| 231 | fi |
| 232 | CPPFLAGS="$gt_save_CPPFLAGS" |
| 233 | LIBS="$gt_save_LIBS"]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 234 | fi |
| 235 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 236 | dnl If an already present or preinstalled GNU gettext() is found, |
| 237 | dnl use it. But if this macro is used in GNU gettext, and GNU |
| 238 | dnl gettext is already preinstalled in libintl, we update this |
| 239 | dnl libintl. (Cf. the install rule in intl/Makefile.in.) |
| 240 | if test "$gt_cv_func_gnugettext_libc" = "yes" \ |
| 241 | || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ |
| 242 | && test "$PACKAGE" != gettext; }; then |
| 243 | gt_use_preinstalled_gnugettext=yes |
| 244 | else |
| 245 | dnl Reset the values set by searching for libintl. |
| 246 | LIBINTL= |
| 247 | LTLIBINTL= |
| 248 | INCINTL= |
| 249 | fi |
| 250 | |
| 251 | ifelse(gt_included_intl, yes, [ |
| 252 | if test "$gt_use_preinstalled_gnugettext" != "yes"; then |
| 253 | dnl GNU gettext is not found in the C library. |
| 254 | dnl Fall back on included GNU gettext library. |
| 255 | nls_cv_use_gnu_gettext=yes |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 256 | fi |
| 257 | fi |
| 258 | |
| 259 | if test "$nls_cv_use_gnu_gettext" = "yes"; then |
| 260 | dnl Mark actions used to generate GNU NLS library. |
| 261 | INTLOBJS="\$(GETTOBJS)" |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 262 | BUILD_INCLUDED_LIBINTL=yes |
| 263 | USE_INCLUDED_LIBINTL=yes |
| 264 | LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" |
| 265 | LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" |
| 266 | LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` |
| 267 | fi |
| 268 | |
| 269 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
| 270 | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
| 271 | dnl Mark actions to use GNU gettext tools. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 272 | CATOBJEXT=.gmo |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 273 | fi |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 274 | ]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 275 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 276 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
| 277 | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
| 278 | AC_DEFINE(ENABLE_NLS, 1, |
| 279 | [Define to 1 if translation of program messages to the user's native language |
| 280 | is requested.]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 281 | else |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 282 | USE_NLS=no |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 283 | fi |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 284 | fi |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 285 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 286 | if test "$USE_NLS" = "yes"; then |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 287 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 288 | if test "$gt_use_preinstalled_gnugettext" = "yes"; then |
| 289 | if test "$gt_cv_func_gnugettext_libintl" = "yes"; then |
| 290 | AC_MSG_CHECKING([how to link with libintl]) |
| 291 | AC_MSG_RESULT([$LIBINTL]) |
| 292 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) |
| 293 | fi |
| 294 | |
| 295 | dnl For backward compatibility. Some packages may be using this. |
| 296 | AC_DEFINE(HAVE_GETTEXT, 1, |
| 297 | [Define if the GNU gettext() function is already present or preinstalled.]) |
| 298 | AC_DEFINE(HAVE_DCGETTEXT, 1, |
| 299 | [Define if the GNU dcgettext() function is already present or preinstalled.]) |
| 300 | fi |
| 301 | |
| 302 | dnl We need to process the po/ directory. |
| 303 | POSUB=po |
| 304 | fi |
| 305 | |
| 306 | ifelse(gt_included_intl, yes, [ |
| 307 | dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL |
| 308 | dnl to 'yes' because some of the testsuite requires it. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 309 | if test "$PACKAGE" = gettext; then |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 310 | BUILD_INCLUDED_LIBINTL=yes |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 311 | fi |
| 312 | |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 313 | dnl Make all variables we use known to autoconf. |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 314 | AC_SUBST(BUILD_INCLUDED_LIBINTL) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 315 | AC_SUBST(USE_INCLUDED_LIBINTL) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 316 | AC_SUBST(CATOBJEXT) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 317 | AC_SUBST(INTLOBJS) |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 318 | |
| 319 | dnl For backward compatibility. Some configure.ins may be using this. |
| 320 | nls_cv_header_intl= |
| 321 | nls_cv_header_libgt= |
| 322 | |
| 323 | dnl For backward compatibility. Some Makefiles may be using this. |
| 324 | DATADIRNAME=share |
| 325 | AC_SUBST(DATADIRNAME) |
| 326 | |
| 327 | dnl For backward compatibility. Some Makefiles may be using this. |
| 328 | INSTOBJEXT=.mo |
| 329 | AC_SUBST(INSTOBJEXT) |
| 330 | |
| 331 | dnl For backward compatibility. Some Makefiles may be using this. |
| 332 | GENCAT=gencat |
| 333 | AC_SUBST(GENCAT) |
| 334 | |
| 335 | dnl Enable libtool support if the surrounding package wishes it. |
| 336 | INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix |
| 337 | AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 338 | ]) |
| 339 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 340 | dnl For backward compatibility. Some Makefiles may be using this. |
| 341 | INTLLIBS="$LIBINTL" |
| 342 | AC_SUBST(INTLLIBS) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 343 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 344 | dnl Make all documented variables known to autoconf. |
| 345 | AC_SUBST(LIBINTL) |
| 346 | AC_SUBST(LTLIBINTL) |
| 347 | AC_SUBST(POSUB) |
| 348 | ]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 349 | |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 350 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 351 | dnl Checks for all prerequisites of the po subdirectory, |
| 352 | dnl except for USE_NLS. |
| 353 | AC_DEFUN([AM_PO_SUBDIRS], |
| 354 | [ |
| 355 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
| 356 | AC_REQUIRE([AC_PROG_INSTALL])dnl |
| 357 | AC_REQUIRE([AM_MKINSTALLDIRS])dnl |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 358 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 359 | dnl Perform the following tests also if --disable-nls has been given, |
| 360 | dnl because they are needed for "make dist" to work. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 361 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 362 | dnl Search for GNU msgfmt in the PATH. |
| 363 | dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. |
| 364 | dnl The second test excludes FreeBSD msgfmt. |
| 365 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, |
| 366 | [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && |
| 367 | (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], |
| 368 | :) |
| 369 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 370 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 371 | dnl Search for GNU xgettext 0.11 or newer in the PATH. |
| 372 | dnl The first test excludes Solaris xgettext and early GNU xgettext versions. |
| 373 | dnl The second test excludes FreeBSD xgettext. |
| 374 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
| 375 | [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && |
| 376 | (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)], |
| 377 | :) |
| 378 | dnl Remove leftover from FreeBSD xgettext call. |
| 379 | rm -f messages.po |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 380 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 381 | dnl Search for GNU msgmerge 0.11 or newer in the PATH. |
| 382 | AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, |
| 383 | [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 384 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 385 | dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. |
| 386 | dnl Test whether we really found GNU msgfmt. |
| 387 | if test "$GMSGFMT" != ":"; then |
| 388 | dnl If it is no GNU msgfmt we define it as : so that the |
| 389 | dnl Makefiles still can work. |
| 390 | if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && |
| 391 | (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then |
| 392 | : ; |
| 393 | else |
| 394 | GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` |
| 395 | AC_MSG_RESULT( |
| 396 | [found $GMSGFMT program is not GNU msgfmt; ignore it]) |
| 397 | GMSGFMT=":" |
| 398 | fi |
| 399 | fi |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 400 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 401 | dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. |
| 402 | dnl Test whether we really found GNU xgettext. |
| 403 | if test "$XGETTEXT" != ":"; then |
| 404 | dnl If it is no GNU xgettext we define it as : so that the |
| 405 | dnl Makefiles still can work. |
| 406 | if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && |
| 407 | (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then |
| 408 | : ; |
| 409 | else |
| 410 | AC_MSG_RESULT( |
| 411 | [found xgettext program is not GNU xgettext; ignore it]) |
| 412 | XGETTEXT=":" |
| 413 | fi |
| 414 | dnl Remove leftover from FreeBSD xgettext call. |
| 415 | rm -f messages.po |
| 416 | fi |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 417 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 418 | AC_OUTPUT_COMMANDS([ |
| 419 | for ac_file in $CONFIG_FILES; do |
| 420 | # Support "outfile[:infile[:infile...]]" |
| 421 | case "$ac_file" in |
| 422 | *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; |
| 423 | esac |
| 424 | # PO directories have a Makefile.in generated from Makefile.in.in. |
| 425 | case "$ac_file" in */Makefile.in) |
| 426 | # Adjust a relative srcdir. |
| 427 | ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` |
| 428 | ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" |
| 429 | ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` |
| 430 | # In autoconf-2.13 it is called $ac_given_srcdir. |
| 431 | # In autoconf-2.50 it is called $srcdir. |
| 432 | test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" |
| 433 | case "$ac_given_srcdir" in |
| 434 | .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; |
| 435 | /*) top_srcdir="$ac_given_srcdir" ;; |
| 436 | *) top_srcdir="$ac_dots$ac_given_srcdir" ;; |
| 437 | esac |
| 438 | if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then |
| 439 | rm -f "$ac_dir/POTFILES" |
| 440 | test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" |
| 441 | cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" |
| 442 | # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend |
| 443 | # on $ac_dir but don't depend on user-specified configuration |
| 444 | # parameters. |
| 445 | if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then |
| 446 | # The LINGUAS file contains the set of available languages. |
| 447 | if test -n "$ALL_LINGUAS"; then |
| 448 | test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" |
| 449 | fi |
| 450 | ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` |
| 451 | # Hide the ALL_LINGUAS assigment from automake. |
| 452 | eval 'ALL_LINGUAS''=$ALL_LINGUAS_' |
| 453 | fi |
| 454 | case "$ac_given_srcdir" in |
| 455 | .) srcdirpre= ;; |
| 456 | *) srcdirpre='$(srcdir)/' ;; |
| 457 | esac |
| 458 | POFILES= |
| 459 | GMOFILES= |
| 460 | UPDATEPOFILES= |
| 461 | DUMMYPOFILES= |
| 462 | for lang in $ALL_LINGUAS; do |
| 463 | POFILES="$POFILES $srcdirpre$lang.po" |
| 464 | GMOFILES="$GMOFILES $srcdirpre$lang.gmo" |
| 465 | UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" |
| 466 | DUMMYPOFILES="$DUMMYPOFILES $lang.nop" |
| 467 | done |
| 468 | # CATALOGS depends on both $ac_dir and the user's LINGUAS |
| 469 | # environment variable. |
| 470 | INST_LINGUAS= |
| 471 | if test -n "$ALL_LINGUAS"; then |
| 472 | for presentlang in $ALL_LINGUAS; do |
| 473 | useit=no |
| 474 | if test "%UNSET%" != "$LINGUAS"; then |
| 475 | desiredlanguages="$LINGUAS" |
| 476 | else |
| 477 | desiredlanguages="$ALL_LINGUAS" |
| 478 | fi |
| 479 | for desiredlang in $desiredlanguages; do |
| 480 | # Use the presentlang catalog if desiredlang is |
| 481 | # a. equal to presentlang, or |
| 482 | # b. a variant of presentlang (because in this case, |
| 483 | # presentlang can be used as a fallback for messages |
| 484 | # which are not translated in the desiredlang catalog). |
| 485 | case "$desiredlang" in |
| 486 | "$presentlang"*) useit=yes;; |
| 487 | esac |
| 488 | done |
| 489 | if test $useit = yes; then |
| 490 | INST_LINGUAS="$INST_LINGUAS $presentlang" |
| 491 | fi |
| 492 | done |
| 493 | fi |
| 494 | CATALOGS= |
| 495 | if test -n "$INST_LINGUAS"; then |
| 496 | for lang in $INST_LINGUAS; do |
| 497 | CATALOGS="$CATALOGS $lang.gmo" |
| 498 | done |
| 499 | fi |
| 500 | test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" |
| 501 | 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" |
| 502 | for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do |
| 503 | if test -f "$f"; then |
| 504 | case "$f" in |
| 505 | *.orig | *.bak | *~) ;; |
| 506 | *) cat "$f" >> "$ac_dir/Makefile" ;; |
| 507 | esac |
| 508 | fi |
| 509 | done |
| 510 | fi |
| 511 | ;; |
| 512 | esac |
| 513 | done], |
| 514 | [# Capture the value of obsolete ALL_LINGUAS because we need it to compute |
| 515 | # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it |
| 516 | # from automake. |
| 517 | eval 'ALL_LINGUAS''="$ALL_LINGUAS"' |
| 518 | # Capture the value of LINGUAS because we need it to compute CATALOGS. |
| 519 | LINGUAS="${LINGUAS-%UNSET%}" |
| 520 | ]) |
| 521 | ]) |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 522 | |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 523 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 524 | dnl Checks for all prerequisites of the intl subdirectory, |
| 525 | dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, |
| 526 | dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. |
| 527 | AC_DEFUN([AM_INTL_SUBDIR], |
| 528 | [ |
| 529 | AC_REQUIRE([AC_PROG_INSTALL])dnl |
| 530 | AC_REQUIRE([AM_MKINSTALLDIRS])dnl |
| 531 | AC_REQUIRE([AC_PROG_CC])dnl |
| 532 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
| 533 | AC_REQUIRE([AC_PROG_RANLIB])dnl |
| 534 | AC_REQUIRE([AC_ISC_POSIX])dnl |
| 535 | AC_REQUIRE([AC_HEADER_STDC])dnl |
| 536 | AC_REQUIRE([AC_C_CONST])dnl |
| 537 | AC_REQUIRE([AC_C_INLINE])dnl |
| 538 | AC_REQUIRE([AC_TYPE_OFF_T])dnl |
| 539 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl |
| 540 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl |
| 541 | AC_REQUIRE([AC_FUNC_MMAP])dnl |
| 542 | AC_REQUIRE([jm_GLIBC21])dnl |
| 543 | AC_REQUIRE([gt_INTDIV0])dnl |
| 544 | AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl |
| 545 | AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl |
| 546 | AC_REQUIRE([gt_INTTYPES_PRI])dnl |
| 547 | |
| 548 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ |
| 549 | stdlib.h string.h unistd.h sys/param.h]) |
| 550 | AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ |
| 551 | geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ |
| 552 | strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) |
| 553 | |
| 554 | AM_ICONV |
| 555 | AM_LANGINFO_CODESET |
| 556 | if test $ac_cv_header_locale_h = yes; then |
| 557 | AM_LC_MESSAGES |
| 558 | fi |
| 559 | |
| 560 | dnl intl/plural.c is generated from intl/plural.y. It requires bison, |
| 561 | dnl because plural.y uses bison specific features. It requires at least |
| 562 | dnl bison-1.26 because earlier versions generate a plural.c that doesn't |
| 563 | dnl compile. |
| 564 | dnl bison is only needed for the maintainer (who touches plural.y). But in |
| 565 | dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put |
| 566 | dnl the rule in general Makefile. Now, some people carelessly touch the |
| 567 | dnl files or have a broken "make" program, hence the plural.c rule will |
| 568 | dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not |
| 569 | dnl present or too old. |
| 570 | AC_CHECK_PROGS([INTLBISON], [bison]) |
| 571 | if test -z "$INTLBISON"; then |
| 572 | ac_verc_fail=yes |
| 573 | else |
| 574 | dnl Found it, now check the version. |
| 575 | AC_MSG_CHECKING([version of bison]) |
| 576 | changequote(<<,>>)dnl |
| 577 | ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` |
| 578 | case $ac_prog_version in |
| 579 | '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; |
| 580 | 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) |
| 581 | changequote([,])dnl |
| 582 | ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; |
| 583 | *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; |
| 584 | esac |
| 585 | AC_MSG_RESULT([$ac_prog_version]) |
| 586 | fi |
| 587 | if test $ac_verc_fail = yes; then |
| 588 | INTLBISON=: |
| 589 | fi |
| 590 | ]) |
| 591 | |
| 592 | |
| 593 | AC_DEFUN([AM_MKINSTALLDIRS], |
| 594 | [ |
| 595 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly |
| 596 | dnl find the mkinstalldirs script in another subdir but $(top_srcdir). |
| 597 | dnl Try to locate is. |
| 598 | MKINSTALLDIRS= |
| 599 | if test -n "$ac_aux_dir"; then |
| 600 | MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" |
| 601 | fi |
| 602 | if test -z "$MKINSTALLDIRS"; then |
| 603 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" |
| 604 | fi |
| 605 | AC_SUBST(MKINSTALLDIRS) |
| 606 | ]) |
| 607 | |
| 608 | |
| 609 | dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) |
| 610 | AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |
| 611 | # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) |
| 612 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. |
| 613 | dnl This file is free software, distributed under the terms of the GNU |
| 614 | dnl General Public License. As a special exception to the GNU General |
| 615 | dnl Public License, this file may be distributed as part of a program |
| 616 | dnl that contains a configuration script generated by Autoconf, under |
| 617 | dnl the same distribution terms as the rest of that program. |
| 618 | |
| 619 | # Test for the GNU C Library, version 2.1 or newer. |
| 620 | # From Bruno Haible. |
| 621 | |
| 622 | AC_DEFUN([jm_GLIBC21], |
| 623 | [ |
| 624 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, |
| 625 | ac_cv_gnu_library_2_1, |
| 626 | [AC_EGREP_CPP([Lucky GNU user], |
| 627 | [ |
| 628 | #include <features.h> |
| 629 | #ifdef __GNU_LIBRARY__ |
| 630 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) |
| 631 | Lucky GNU user |
| 632 | #endif |
| 633 | #endif |
| 634 | ], |
| 635 | ac_cv_gnu_library_2_1=yes, |
| 636 | ac_cv_gnu_library_2_1=no) |
| 637 | ] |
| 638 | ) |
| 639 | AC_SUBST(GLIBC21) |
| 640 | GLIBC21="$ac_cv_gnu_library_2_1" |
| 641 | ] |
| 642 | ) |
| 643 | # iconv.m4 serial AM4 (gettext-0.11.3) |
| 644 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. |
| 645 | dnl This file is free software, distributed under the terms of the GNU |
| 646 | dnl General Public License. As a special exception to the GNU General |
| 647 | dnl Public License, this file may be distributed as part of a program |
| 648 | dnl that contains a configuration script generated by Autoconf, under |
| 649 | dnl the same distribution terms as the rest of that program. |
| 650 | |
| 651 | dnl From Bruno Haible. |
| 652 | |
| 653 | AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], |
| 654 | [ |
| 655 | dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. |
| 656 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 657 | AC_REQUIRE([AC_LIB_RPATH]) |
| 658 | |
| 659 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV |
| 660 | dnl accordingly. |
| 661 | AC_LIB_LINKFLAGS_BODY([iconv]) |
| 662 | ]) |
| 663 | |
| 664 | AC_DEFUN([AM_ICONV_LINK], |
| 665 | [ |
| 666 | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and |
| 667 | dnl those with the standalone portable GNU libiconv installed). |
| 668 | |
| 669 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV |
| 670 | dnl accordingly. |
| 671 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
| 672 | |
| 673 | dnl Add $INCICONV to CPPFLAGS before performing the following checks, |
| 674 | dnl because if the user has installed libiconv and not disabled its use |
| 675 | dnl via --without-libiconv-prefix, he wants to use it. The first |
| 676 | dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. |
| 677 | am_save_CPPFLAGS="$CPPFLAGS" |
| 678 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) |
| 679 | |
| 680 | AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ |
| 681 | am_cv_func_iconv="no, consider installing GNU libiconv" |
| 682 | am_cv_lib_iconv=no |
| 683 | AC_TRY_LINK([#include <stdlib.h> |
| 684 | #include <iconv.h>], |
| 685 | [iconv_t cd = iconv_open("",""); |
| 686 | iconv(cd,NULL,NULL,NULL,NULL); |
| 687 | iconv_close(cd);], |
| 688 | am_cv_func_iconv=yes) |
| 689 | if test "$am_cv_func_iconv" != yes; then |
| 690 | am_save_LIBS="$LIBS" |
| 691 | LIBS="$LIBS $LIBICONV" |
| 692 | AC_TRY_LINK([#include <stdlib.h> |
| 693 | #include <iconv.h>], |
| 694 | [iconv_t cd = iconv_open("",""); |
| 695 | iconv(cd,NULL,NULL,NULL,NULL); |
| 696 | iconv_close(cd);], |
| 697 | am_cv_lib_iconv=yes |
| 698 | am_cv_func_iconv=yes) |
| 699 | LIBS="$am_save_LIBS" |
| 700 | fi |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 701 | ]) |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 702 | if test "$am_cv_func_iconv" = yes; then |
| 703 | AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) |
| 704 | fi |
| 705 | if test "$am_cv_lib_iconv" = yes; then |
| 706 | AC_MSG_CHECKING([how to link with libiconv]) |
| 707 | AC_MSG_RESULT([$LIBICONV]) |
| 708 | else |
| 709 | dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV |
| 710 | dnl either. |
| 711 | CPPFLAGS="$am_save_CPPFLAGS" |
| 712 | LIBICONV= |
| 713 | LTLIBICONV= |
| 714 | fi |
| 715 | AC_SUBST(LIBICONV) |
| 716 | AC_SUBST(LTLIBICONV) |
| 717 | ]) |
| 718 | |
| 719 | AC_DEFUN([AM_ICONV], |
| 720 | [ |
| 721 | AM_ICONV_LINK |
| 722 | if test "$am_cv_func_iconv" = yes; then |
| 723 | AC_MSG_CHECKING([for iconv declaration]) |
| 724 | AC_CACHE_VAL(am_cv_proto_iconv, [ |
| 725 | AC_TRY_COMPILE([ |
| 726 | #include <stdlib.h> |
| 727 | #include <iconv.h> |
| 728 | extern |
| 729 | #ifdef __cplusplus |
| 730 | "C" |
| 731 | #endif |
| 732 | #if defined(__STDC__) || defined(__cplusplus) |
| 733 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); |
| 734 | #else |
| 735 | size_t iconv(); |
| 736 | #endif |
| 737 | ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") |
| 738 | 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);"]) |
| 739 | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` |
| 740 | AC_MSG_RESULT([$]{ac_t:- |
| 741 | }[$]am_cv_proto_iconv) |
| 742 | AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, |
| 743 | [Define as const if the declaration of iconv() needs const.]) |
| 744 | fi |
| 745 | ]) |
| 746 | # intdiv0.m4 serial 1 (gettext-0.11.3) |
| 747 | dnl Copyright (C) 2002 Free Software Foundation, Inc. |
| 748 | dnl This file is free software, distributed under the terms of the GNU |
| 749 | dnl General Public License. As a special exception to the GNU General |
| 750 | dnl Public License, this file may be distributed as part of a program |
| 751 | dnl that contains a configuration script generated by Autoconf, under |
| 752 | dnl the same distribution terms as the rest of that program. |
| 753 | |
| 754 | dnl From Bruno Haible. |
| 755 | |
| 756 | AC_DEFUN([gt_INTDIV0], |
| 757 | [ |
| 758 | AC_REQUIRE([AC_PROG_CC])dnl |
| 759 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
| 760 | |
| 761 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], |
| 762 | gt_cv_int_divbyzero_sigfpe, |
| 763 | [ |
| 764 | AC_TRY_RUN([ |
| 765 | #include <stdlib.h> |
| 766 | #include <signal.h> |
| 767 | |
| 768 | static void |
| 769 | #ifdef __cplusplus |
| 770 | sigfpe_handler (int sig) |
| 771 | #else |
| 772 | sigfpe_handler (sig) int sig; |
| 773 | #endif |
| 774 | { |
| 775 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ |
| 776 | exit (sig != SIGFPE); |
| 777 | } |
| 778 | |
| 779 | int x = 1; |
| 780 | int y = 0; |
| 781 | int z; |
| 782 | int nan; |
| 783 | |
| 784 | int main () |
| 785 | { |
| 786 | signal (SIGFPE, sigfpe_handler); |
| 787 | /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ |
| 788 | #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) |
| 789 | signal (SIGTRAP, sigfpe_handler); |
| 790 | #endif |
| 791 | /* Linux/SPARC yields signal SIGILL. */ |
| 792 | #if defined (__sparc__) && defined (__linux__) |
| 793 | signal (SIGILL, sigfpe_handler); |
| 794 | #endif |
| 795 | |
| 796 | z = x / y; |
| 797 | nan = y / y; |
| 798 | exit (1); |
| 799 | } |
| 800 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, |
| 801 | [ |
| 802 | # Guess based on the CPU. |
| 803 | case "$host_cpu" in |
| 804 | alpha* | i[34567]86 | m68k | s390*) |
| 805 | gt_cv_int_divbyzero_sigfpe="guessing yes";; |
| 806 | *) |
| 807 | gt_cv_int_divbyzero_sigfpe="guessing no";; |
| 808 | esac |
| 809 | ]) |
| 810 | ]) |
| 811 | case "$gt_cv_int_divbyzero_sigfpe" in |
| 812 | *yes) value=1;; |
| 813 | *) value=0;; |
| 814 | esac |
| 815 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, |
| 816 | [Define if integer division by zero raises signal SIGFPE.]) |
| 817 | ]) |
| 818 | # inttypes.m4 serial 1 (gettext-0.11.4) |
| 819 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. |
| 820 | dnl This file is free software, distributed under the terms of the GNU |
| 821 | dnl General Public License. As a special exception to the GNU General |
| 822 | dnl Public License, this file may be distributed as part of a program |
| 823 | dnl that contains a configuration script generated by Autoconf, under |
| 824 | dnl the same distribution terms as the rest of that program. |
| 825 | |
| 826 | dnl From Paul Eggert. |
| 827 | |
| 828 | # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with |
| 829 | # <sys/types.h>. |
| 830 | |
| 831 | AC_DEFUN([gt_HEADER_INTTYPES_H], |
| 832 | [ |
| 833 | AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, |
| 834 | [ |
| 835 | AC_TRY_COMPILE( |
| 836 | [#include <sys/types.h> |
| 837 | #include <inttypes.h>], |
| 838 | [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) |
| 839 | ]) |
| 840 | if test $gt_cv_header_inttypes_h = yes; then |
| 841 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, |
| 842 | [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.]) |
| 843 | fi |
| 844 | ]) |
| 845 | # inttypes_h.m4 serial 4 (gettext-0.11.4) |
| 846 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. |
| 847 | dnl This file is free software, distributed under the terms of the GNU |
| 848 | dnl General Public License. As a special exception to the GNU General |
| 849 | dnl Public License, this file may be distributed as part of a program |
| 850 | dnl that contains a configuration script generated by Autoconf, under |
| 851 | dnl the same distribution terms as the rest of that program. |
| 852 | |
| 853 | dnl From Paul Eggert. |
| 854 | |
| 855 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, |
| 856 | # doesn't clash with <sys/types.h>, and declares uintmax_t. |
| 857 | |
| 858 | AC_DEFUN([jm_AC_HEADER_INTTYPES_H], |
| 859 | [ |
| 860 | AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, |
| 861 | [AC_TRY_COMPILE( |
| 862 | [#include <sys/types.h> |
| 863 | #include <inttypes.h>], |
| 864 | [uintmax_t i = (uintmax_t) -1;], |
| 865 | jm_ac_cv_header_inttypes_h=yes, |
| 866 | jm_ac_cv_header_inttypes_h=no)]) |
| 867 | if test $jm_ac_cv_header_inttypes_h = yes; then |
| 868 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, |
| 869 | [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, |
| 870 | and declares uintmax_t. ]) |
| 871 | fi |
| 872 | ]) |
| 873 | # inttypes-pri.m4 serial 1 (gettext-0.11.4) |
| 874 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. |
| 875 | dnl This file is free software, distributed under the terms of the GNU |
| 876 | dnl General Public License. As a special exception to the GNU General |
| 877 | dnl Public License, this file may be distributed as part of a program |
| 878 | dnl that contains a configuration script generated by Autoconf, under |
| 879 | dnl the same distribution terms as the rest of that program. |
| 880 | |
| 881 | dnl From Bruno Haible. |
| 882 | |
| 883 | # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* |
| 884 | # macros to non-string values. This is the case on AIX 4.3.3. |
| 885 | |
| 886 | AC_DEFUN([gt_INTTYPES_PRI], |
| 887 | [ |
| 888 | AC_REQUIRE([gt_HEADER_INTTYPES_H]) |
| 889 | if test $gt_cv_header_inttypes_h = yes; then |
| 890 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], |
| 891 | gt_cv_inttypes_pri_broken, |
| 892 | [ |
| 893 | AC_TRY_COMPILE([#include <inttypes.h> |
| 894 | #ifdef PRId32 |
| 895 | char *p = PRId32; |
| 896 | #endif |
| 897 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) |
| 898 | ]) |
| 899 | fi |
| 900 | if test "$gt_cv_inttypes_pri_broken" = yes; then |
| 901 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, |
| 902 | [Define if <inttypes.h> exists and defines unusable PRI* macros.]) |
| 903 | fi |
| 904 | ]) |
| 905 | # isc-posix.m4 serial 2 (gettext-0.11.2) |
| 906 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
| 907 | dnl This file is free software, distributed under the terms of the GNU |
| 908 | dnl General Public License. As a special exception to the GNU General |
| 909 | dnl Public License, this file may be distributed as part of a program |
| 910 | dnl that contains a configuration script generated by Autoconf, under |
| 911 | dnl the same distribution terms as the rest of that program. |
| 912 | |
| 913 | # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. |
| 914 | |
| 915 | # This test replaces the one in autoconf. |
| 916 | # Currently this macro should have the same name as the autoconf macro |
| 917 | # because gettext's gettext.m4 (distributed in the automake package) |
| 918 | # still uses it. Otherwise, the use in gettext.m4 makes autoheader |
| 919 | # give these diagnostics: |
| 920 | # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX |
| 921 | # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX |
| 922 | |
| 923 | undefine([AC_ISC_POSIX]) |
| 924 | |
| 925 | AC_DEFUN([AC_ISC_POSIX], |
| 926 | [ |
| 927 | dnl This test replaces the obsolescent AC_ISC_POSIX kludge. |
| 928 | AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) |
| 929 | ] |
| 930 | ) |
| 931 | # lcmessage.m4 serial 3 (gettext-0.11.3) |
| 932 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
| 933 | dnl This file is free software, distributed under the terms of the GNU |
| 934 | dnl General Public License. As a special exception to the GNU General |
| 935 | dnl Public License, this file may be distributed as part of a program |
| 936 | dnl that contains a configuration script generated by Autoconf, under |
| 937 | dnl the same distribution terms as the rest of that program. |
| 938 | dnl |
| 939 | dnl This file can can be used in projects which are not available under |
| 940 | dnl the GNU General Public License or the GNU Library General Public |
| 941 | dnl License but which still want to provide support for the GNU gettext |
| 942 | dnl functionality. |
| 943 | dnl Please note that the actual code of the GNU gettext library is covered |
| 944 | dnl by the GNU Library General Public License, and the rest of the GNU |
| 945 | dnl gettext package package is covered by the GNU General Public License. |
| 946 | dnl They are *not* in the public domain. |
| 947 | |
| 948 | dnl Authors: |
| 949 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 950 | |
| 951 | # Check whether LC_MESSAGES is available in <locale.h>. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 952 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 953 | AC_DEFUN([AM_LC_MESSAGES], |
| 954 | [ |
| 955 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, |
| 956 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 957 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 958 | if test $am_cv_val_LC_MESSAGES = yes; then |
| 959 | AC_DEFINE(HAVE_LC_MESSAGES, 1, |
| 960 | [Define if your <locale.h> file defines LC_MESSAGES.]) |
| 961 | fi |
| 962 | ]) |
| 963 | # lib-ld.m4 serial 1 (gettext-0.11) |
| 964 | dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. |
| 965 | dnl This file is free software, distributed under the terms of the GNU |
| 966 | dnl General Public License. As a special exception to the GNU General |
| 967 | dnl Public License, this file may be distributed as part of a program |
| 968 | dnl that contains a configuration script generated by Autoconf, under |
| 969 | dnl the same distribution terms as the rest of that program. |
| 970 | |
| 971 | dnl Subroutines of libtool.m4, |
| 972 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision |
| 973 | dnl with libtool.m4. |
| 974 | |
| 975 | dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. |
| 976 | AC_DEFUN([AC_LIB_PROG_LD_GNU], |
| 977 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, |
| 978 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
| 979 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then |
| 980 | acl_cv_prog_gnu_ld=yes |
| 981 | else |
| 982 | acl_cv_prog_gnu_ld=no |
| 983 | fi]) |
| 984 | with_gnu_ld=$acl_cv_prog_gnu_ld |
| 985 | ]) |
| 986 | |
| 987 | dnl From libtool-1.4. Sets the variable LD. |
| 988 | AC_DEFUN([AC_LIB_PROG_LD], |
| 989 | [AC_ARG_WITH(gnu-ld, |
| 990 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
| 991 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
| 992 | AC_REQUIRE([AC_PROG_CC])dnl |
| 993 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
| 994 | ac_prog=ld |
| 995 | if test "$GCC" = yes; then |
| 996 | # Check if gcc -print-prog-name=ld gives a path. |
| 997 | AC_MSG_CHECKING([for ld used by GCC]) |
| 998 | case $host in |
| 999 | *-*-mingw*) |
| 1000 | # gcc leaves a trailing carriage return which upsets mingw |
| 1001 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; |
| 1002 | *) |
| 1003 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; |
| 1004 | esac |
| 1005 | case $ac_prog in |
| 1006 | # Accept absolute paths. |
| 1007 | [[\\/]* | [A-Za-z]:[\\/]*)] |
| 1008 | [re_direlt='/[^/][^/]*/\.\./'] |
| 1009 | # Canonicalize the path of ld |
| 1010 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
| 1011 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
| 1012 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
| 1013 | done |
| 1014 | test -z "$LD" && LD="$ac_prog" |
| 1015 | ;; |
| 1016 | "") |
| 1017 | # If it fails, then pretend we aren't using GCC. |
| 1018 | ac_prog=ld |
| 1019 | ;; |
| 1020 | *) |
| 1021 | # If it is relative, then search for the first ld in PATH. |
| 1022 | with_gnu_ld=unknown |
| 1023 | ;; |
| 1024 | esac |
| 1025 | elif test "$with_gnu_ld" = yes; then |
| 1026 | AC_MSG_CHECKING([for GNU ld]) |
| 1027 | else |
| 1028 | AC_MSG_CHECKING([for non-GNU ld]) |
| 1029 | fi |
| 1030 | AC_CACHE_VAL(acl_cv_path_LD, |
| 1031 | [if test -z "$LD"; then |
| 1032 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
| 1033 | for ac_dir in $PATH; do |
| 1034 | test -z "$ac_dir" && ac_dir=. |
| 1035 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
| 1036 | acl_cv_path_LD="$ac_dir/$ac_prog" |
| 1037 | # Check to see if the program is GNU ld. I'd rather use --version, |
| 1038 | # but apparently some GNU ld's only accept -v. |
| 1039 | # Break only if it was the GNU/non-GNU ld that we prefer. |
| 1040 | if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then |
| 1041 | test "$with_gnu_ld" != no && break |
| 1042 | else |
| 1043 | test "$with_gnu_ld" != yes && break |
| 1044 | fi |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 1045 | fi |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 1046 | done |
| 1047 | IFS="$ac_save_ifs" |
| 1048 | else |
| 1049 | acl_cv_path_LD="$LD" # Let the user override the test with a path. |
| 1050 | fi]) |
| 1051 | LD="$acl_cv_path_LD" |
| 1052 | if test -n "$LD"; then |
| 1053 | AC_MSG_RESULT($LD) |
| 1054 | else |
| 1055 | AC_MSG_RESULT(no) |
| 1056 | fi |
| 1057 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
| 1058 | AC_LIB_PROG_LD_GNU |
| 1059 | ]) |
| 1060 | # lib-link.m4 serial 3 (gettext-0.11.3) |
| 1061 | dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. |
| 1062 | dnl This file is free software, distributed under the terms of the GNU |
| 1063 | dnl General Public License. As a special exception to the GNU General |
| 1064 | dnl Public License, this file may be distributed as part of a program |
| 1065 | dnl that contains a configuration script generated by Autoconf, under |
| 1066 | dnl the same distribution terms as the rest of that program. |
| 1067 | |
| 1068 | dnl From Bruno Haible. |
| 1069 | |
| 1070 | dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and |
| 1071 | dnl the libraries corresponding to explicit and implicit dependencies. |
| 1072 | dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and |
| 1073 | dnl augments the CPPFLAGS variable. |
| 1074 | AC_DEFUN([AC_LIB_LINKFLAGS], |
| 1075 | [ |
| 1076 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 1077 | AC_REQUIRE([AC_LIB_RPATH]) |
| 1078 | define([Name],[translit([$1],[./-], [___])]) |
| 1079 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 1080 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 1081 | AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ |
| 1082 | AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
| 1083 | ac_cv_lib[]Name[]_libs="$LIB[]NAME" |
| 1084 | ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" |
| 1085 | ac_cv_lib[]Name[]_cppflags="$INC[]NAME" |
| 1086 | ]) |
| 1087 | LIB[]NAME="$ac_cv_lib[]Name[]_libs" |
| 1088 | LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" |
| 1089 | INC[]NAME="$ac_cv_lib[]Name[]_cppflags" |
| 1090 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
| 1091 | AC_SUBST([LIB]NAME) |
| 1092 | AC_SUBST([LTLIB]NAME) |
| 1093 | dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the |
| 1094 | dnl results of this search when this library appears as a dependency. |
| 1095 | HAVE_LIB[]NAME=yes |
| 1096 | undefine([Name]) |
| 1097 | undefine([NAME]) |
| 1098 | ]) |
| 1099 | |
| 1100 | dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) |
| 1101 | dnl searches for libname and the libraries corresponding to explicit and |
| 1102 | dnl implicit dependencies, together with the specified include files and |
| 1103 | dnl the ability to compile and link the specified testcode. If found, it |
| 1104 | dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and |
| 1105 | dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and |
| 1106 | dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs |
| 1107 | dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. |
| 1108 | AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], |
| 1109 | [ |
| 1110 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 1111 | AC_REQUIRE([AC_LIB_RPATH]) |
| 1112 | define([Name],[translit([$1],[./-], [___])]) |
| 1113 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 1114 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 1115 | |
| 1116 | dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME |
| 1117 | dnl accordingly. |
| 1118 | AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
| 1119 | |
| 1120 | dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, |
| 1121 | dnl because if the user has installed lib[]Name and not disabled its use |
| 1122 | dnl via --without-lib[]Name-prefix, he wants to use it. |
| 1123 | ac_save_CPPFLAGS="$CPPFLAGS" |
| 1124 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
| 1125 | |
| 1126 | AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ |
| 1127 | ac_save_LIBS="$LIBS" |
| 1128 | LIBS="$LIBS $LIB[]NAME" |
| 1129 | AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) |
| 1130 | LIBS="$ac_save_LIBS" |
| 1131 | ]) |
| 1132 | if test "$ac_cv_lib[]Name" = yes; then |
| 1133 | HAVE_LIB[]NAME=yes |
| 1134 | AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) |
| 1135 | AC_MSG_CHECKING([how to link with lib[]$1]) |
| 1136 | AC_MSG_RESULT([$LIB[]NAME]) |
| 1137 | else |
| 1138 | HAVE_LIB[]NAME=no |
| 1139 | dnl If $LIB[]NAME didn't lead to a usable library, we don't need |
| 1140 | dnl $INC[]NAME either. |
| 1141 | CPPFLAGS="$ac_save_CPPFLAGS" |
| 1142 | LIB[]NAME= |
| 1143 | LTLIB[]NAME= |
| 1144 | fi |
| 1145 | AC_SUBST([HAVE_LIB]NAME) |
| 1146 | AC_SUBST([LIB]NAME) |
| 1147 | AC_SUBST([LTLIB]NAME) |
| 1148 | undefine([Name]) |
| 1149 | undefine([NAME]) |
| 1150 | ]) |
| 1151 | |
| 1152 | dnl Determine the platform dependent parameters needed to use rpath: |
| 1153 | dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, |
| 1154 | dnl hardcode_direct, hardcode_minus_L, |
| 1155 | dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. |
| 1156 | AC_DEFUN([AC_LIB_RPATH], |
| 1157 | [ |
| 1158 | AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS |
| 1159 | AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld |
| 1160 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host |
| 1161 | AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir |
| 1162 | AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ |
| 1163 | CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ |
| 1164 | ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh |
| 1165 | . ./conftest.sh |
| 1166 | rm -f ./conftest.sh |
| 1167 | acl_cv_rpath=done |
| 1168 | ]) |
| 1169 | wl="$acl_cv_wl" |
| 1170 | libext="$acl_cv_libext" |
| 1171 | shlibext="$acl_cv_shlibext" |
| 1172 | hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" |
| 1173 | hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" |
| 1174 | hardcode_direct="$acl_cv_hardcode_direct" |
| 1175 | hardcode_minus_L="$acl_cv_hardcode_minus_L" |
| 1176 | sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" |
| 1177 | sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" |
| 1178 | dnl Determine whether the user wants rpath handling at all. |
| 1179 | AC_ARG_ENABLE(rpath, |
| 1180 | [ --disable-rpath do not hardcode runtime library paths], |
| 1181 | :, enable_rpath=yes) |
| 1182 | ]) |
| 1183 | |
| 1184 | dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and |
| 1185 | dnl the libraries corresponding to explicit and implicit dependencies. |
| 1186 | dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. |
| 1187 | AC_DEFUN([AC_LIB_LINKFLAGS_BODY], |
| 1188 | [ |
| 1189 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 1190 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 1191 | dnl By default, look in $includedir and $libdir. |
| 1192 | use_additional=yes |
| 1193 | AC_LIB_WITH_FINAL_PREFIX([ |
| 1194 | eval additional_includedir=\"$includedir\" |
| 1195 | eval additional_libdir=\"$libdir\" |
| 1196 | ]) |
| 1197 | AC_ARG_WITH([lib$1-prefix], |
| 1198 | [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib |
| 1199 | --without-lib$1-prefix don't search for lib$1 in includedir and libdir], |
| 1200 | [ |
| 1201 | if test "X$withval" = "Xno"; then |
| 1202 | use_additional=no |
| 1203 | else |
| 1204 | if test "X$withval" = "X"; then |
| 1205 | AC_LIB_WITH_FINAL_PREFIX([ |
| 1206 | eval additional_includedir=\"$includedir\" |
| 1207 | eval additional_libdir=\"$libdir\" |
| 1208 | ]) |
| 1209 | else |
| 1210 | additional_includedir="$withval/include" |
| 1211 | additional_libdir="$withval/lib" |
| 1212 | fi |
| 1213 | fi |
| 1214 | ]) |
| 1215 | dnl Search the library and its dependencies in $additional_libdir and |
| 1216 | dnl $LDFLAGS. Using breadth-first-seach. |
| 1217 | LIB[]NAME= |
| 1218 | LTLIB[]NAME= |
| 1219 | INC[]NAME= |
| 1220 | rpathdirs= |
| 1221 | ltrpathdirs= |
| 1222 | names_already_handled= |
| 1223 | names_next_round='$1 $2' |
| 1224 | while test -n "$names_next_round"; do |
| 1225 | names_this_round="$names_next_round" |
| 1226 | names_next_round= |
| 1227 | for name in $names_this_round; do |
| 1228 | already_handled= |
| 1229 | for n in $names_already_handled; do |
| 1230 | if test "$n" = "$name"; then |
| 1231 | already_handled=yes |
| 1232 | break |
| 1233 | fi |
| 1234 | done |
| 1235 | if test -z "$already_handled"; then |
| 1236 | names_already_handled="$names_already_handled $name" |
| 1237 | dnl See if it was already located by an earlier AC_LIB_LINKFLAGS |
| 1238 | dnl or AC_LIB_HAVE_LINKFLAGS call. |
| 1239 | uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` |
| 1240 | eval value=\"\$HAVE_LIB$uppername\" |
| 1241 | if test -n "$value"; then |
| 1242 | if test "$value" = yes; then |
| 1243 | eval value=\"\$LIB$uppername\" |
| 1244 | test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" |
| 1245 | eval value=\"\$LTLIB$uppername\" |
| 1246 | test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" |
| 1247 | else |
| 1248 | dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined |
| 1249 | dnl that this library doesn't exist. So just drop it. |
| 1250 | : |
| 1251 | fi |
| 1252 | else |
| 1253 | dnl Search the library lib$name in $additional_libdir and $LDFLAGS |
| 1254 | dnl and the already constructed $LIBNAME/$LTLIBNAME. |
| 1255 | found_dir= |
| 1256 | found_la= |
| 1257 | found_so= |
| 1258 | found_a= |
| 1259 | if test $use_additional = yes; then |
| 1260 | if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then |
| 1261 | found_dir="$additional_libdir" |
| 1262 | found_so="$additional_libdir/lib$name.$shlibext" |
| 1263 | if test -f "$additional_libdir/lib$name.la"; then |
| 1264 | found_la="$additional_libdir/lib$name.la" |
| 1265 | fi |
| 1266 | else |
| 1267 | if test -f "$additional_libdir/lib$name.$libext"; then |
| 1268 | found_dir="$additional_libdir" |
| 1269 | found_a="$additional_libdir/lib$name.$libext" |
| 1270 | if test -f "$additional_libdir/lib$name.la"; then |
| 1271 | found_la="$additional_libdir/lib$name.la" |
| 1272 | fi |
| 1273 | fi |
| 1274 | fi |
| 1275 | fi |
| 1276 | if test "X$found_dir" = "X"; then |
| 1277 | for x in $LDFLAGS $LTLIB[]NAME; do |
| 1278 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1279 | case "$x" in |
| 1280 | -L*) |
| 1281 | dir=`echo "X$x" | sed -e 's/^X-L//'` |
| 1282 | if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then |
| 1283 | found_dir="$dir" |
| 1284 | found_so="$dir/lib$name.$shlibext" |
| 1285 | if test -f "$dir/lib$name.la"; then |
| 1286 | found_la="$dir/lib$name.la" |
| 1287 | fi |
| 1288 | else |
| 1289 | if test -f "$dir/lib$name.$libext"; then |
| 1290 | found_dir="$dir" |
| 1291 | found_a="$dir/lib$name.$libext" |
| 1292 | if test -f "$dir/lib$name.la"; then |
| 1293 | found_la="$dir/lib$name.la" |
| 1294 | fi |
| 1295 | fi |
| 1296 | fi |
| 1297 | ;; |
| 1298 | esac |
| 1299 | if test "X$found_dir" != "X"; then |
| 1300 | break |
| 1301 | fi |
| 1302 | done |
| 1303 | fi |
| 1304 | if test "X$found_dir" != "X"; then |
| 1305 | dnl Found the library. |
| 1306 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" |
| 1307 | if test "X$found_so" != "X"; then |
| 1308 | dnl Linking with a shared library. We attempt to hardcode its |
| 1309 | dnl directory into the executable's runpath, unless it's the |
| 1310 | dnl standard /usr/lib. |
| 1311 | if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then |
| 1312 | dnl No hardcoding is needed. |
| 1313 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1314 | else |
| 1315 | dnl Use an explicit option to hardcode DIR into the resulting |
| 1316 | dnl binary. |
| 1317 | dnl Potentially add DIR to ltrpathdirs. |
| 1318 | dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
| 1319 | haveit= |
| 1320 | for x in $ltrpathdirs; do |
| 1321 | if test "X$x" = "X$found_dir"; then |
| 1322 | haveit=yes |
| 1323 | break |
| 1324 | fi |
| 1325 | done |
| 1326 | if test -z "$haveit"; then |
| 1327 | ltrpathdirs="$ltrpathdirs $found_dir" |
| 1328 | fi |
| 1329 | dnl The hardcoding into $LIBNAME is system dependent. |
| 1330 | if test "$hardcode_direct" = yes; then |
| 1331 | dnl Using DIR/libNAME.so during linking hardcodes DIR into the |
| 1332 | dnl resulting binary. |
| 1333 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1334 | else |
| 1335 | if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then |
| 1336 | dnl Use an explicit option to hardcode DIR into the resulting |
| 1337 | dnl binary. |
| 1338 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1339 | dnl Potentially add DIR to rpathdirs. |
| 1340 | dnl The rpathdirs will be appended to $LIBNAME at the end. |
| 1341 | haveit= |
| 1342 | for x in $rpathdirs; do |
| 1343 | if test "X$x" = "X$found_dir"; then |
| 1344 | haveit=yes |
| 1345 | break |
| 1346 | fi |
| 1347 | done |
| 1348 | if test -z "$haveit"; then |
| 1349 | rpathdirs="$rpathdirs $found_dir" |
| 1350 | fi |
| 1351 | else |
| 1352 | dnl Rely on "-L$found_dir". |
| 1353 | dnl But don't add it if it's already contained in the LDFLAGS |
| 1354 | dnl or the already constructed $LIBNAME |
| 1355 | haveit= |
| 1356 | for x in $LDFLAGS $LIB[]NAME; do |
| 1357 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1358 | if test "X$x" = "X-L$found_dir"; then |
| 1359 | haveit=yes |
| 1360 | break |
| 1361 | fi |
| 1362 | done |
| 1363 | if test -z "$haveit"; then |
| 1364 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" |
| 1365 | fi |
| 1366 | if test "$hardcode_minus_L" != no; then |
| 1367 | dnl FIXME: Not sure whether we should use |
| 1368 | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
| 1369 | dnl here. |
| 1370 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1371 | else |
| 1372 | dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH |
| 1373 | dnl here, because this doesn't fit in flags passed to the |
| 1374 | dnl compiler. So give up. No hardcoding. This affects only |
| 1375 | dnl very old systems. |
| 1376 | dnl FIXME: Not sure whether we should use |
| 1377 | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
| 1378 | dnl here. |
| 1379 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
| 1380 | fi |
| 1381 | fi |
| 1382 | fi |
| 1383 | fi |
| 1384 | else |
| 1385 | if test "X$found_a" != "X"; then |
| 1386 | dnl Linking with a static library. |
| 1387 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" |
| 1388 | else |
| 1389 | dnl We shouldn't come here, but anyway it's good to have a |
| 1390 | dnl fallback. |
| 1391 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" |
| 1392 | fi |
| 1393 | fi |
| 1394 | dnl Assume the include files are nearby. |
| 1395 | additional_includedir= |
| 1396 | case "$found_dir" in |
| 1397 | */lib | */lib/) |
| 1398 | basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` |
| 1399 | additional_includedir="$basedir/include" |
| 1400 | ;; |
| 1401 | esac |
| 1402 | if test "X$additional_includedir" != "X"; then |
| 1403 | dnl Potentially add $additional_includedir to $INCNAME. |
| 1404 | dnl But don't add it |
| 1405 | dnl 1. if it's the standard /usr/include, |
| 1406 | dnl 2. if it's /usr/local/include and we are using GCC on Linux, |
| 1407 | dnl 3. if it's already present in $CPPFLAGS or the already |
| 1408 | dnl constructed $INCNAME, |
| 1409 | dnl 4. if it doesn't exist as a directory. |
| 1410 | if test "X$additional_includedir" != "X/usr/include"; then |
| 1411 | haveit= |
| 1412 | if test "X$additional_includedir" = "X/usr/local/include"; then |
| 1413 | if test -n "$GCC"; then |
| 1414 | case $host_os in |
| 1415 | linux*) haveit=yes;; |
| 1416 | esac |
| 1417 | fi |
| 1418 | fi |
| 1419 | if test -z "$haveit"; then |
| 1420 | for x in $CPPFLAGS $INC[]NAME; do |
| 1421 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1422 | if test "X$x" = "X-I$additional_includedir"; then |
| 1423 | haveit=yes |
| 1424 | break |
| 1425 | fi |
| 1426 | done |
| 1427 | if test -z "$haveit"; then |
| 1428 | if test -d "$additional_includedir"; then |
| 1429 | dnl Really add $additional_includedir to $INCNAME. |
| 1430 | INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" |
| 1431 | fi |
| 1432 | fi |
| 1433 | fi |
| 1434 | fi |
| 1435 | fi |
| 1436 | dnl Look for dependencies. |
| 1437 | if test -n "$found_la"; then |
| 1438 | dnl Read the .la file. It defines the variables |
| 1439 | dnl dlname, library_names, old_library, dependency_libs, current, |
| 1440 | dnl age, revision, installed, dlopen, dlpreopen, libdir. |
| 1441 | save_libdir="$libdir" |
| 1442 | case "$found_la" in |
| 1443 | */* | *\\*) . "$found_la" ;; |
| 1444 | *) . "./$found_la" ;; |
| 1445 | esac |
| 1446 | libdir="$save_libdir" |
| 1447 | dnl We use only dependency_libs. |
| 1448 | for dep in $dependency_libs; do |
| 1449 | case "$dep" in |
| 1450 | -L*) |
| 1451 | additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` |
| 1452 | dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. |
| 1453 | dnl But don't add it |
| 1454 | dnl 1. if it's the standard /usr/lib, |
| 1455 | dnl 2. if it's /usr/local/lib and we are using GCC on Linux, |
| 1456 | dnl 3. if it's already present in $LDFLAGS or the already |
| 1457 | dnl constructed $LIBNAME, |
| 1458 | dnl 4. if it doesn't exist as a directory. |
| 1459 | if test "X$additional_libdir" != "X/usr/lib"; then |
| 1460 | haveit= |
| 1461 | if test "X$additional_libdir" = "X/usr/local/lib"; then |
| 1462 | if test -n "$GCC"; then |
| 1463 | case $host_os in |
| 1464 | linux*) haveit=yes;; |
| 1465 | esac |
| 1466 | fi |
| 1467 | fi |
| 1468 | if test -z "$haveit"; then |
| 1469 | haveit= |
| 1470 | for x in $LDFLAGS $LIB[]NAME; do |
| 1471 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1472 | if test "X$x" = "X-L$additional_libdir"; then |
| 1473 | haveit=yes |
| 1474 | break |
| 1475 | fi |
| 1476 | done |
| 1477 | if test -z "$haveit"; then |
| 1478 | if test -d "$additional_libdir"; then |
| 1479 | dnl Really add $additional_libdir to $LIBNAME. |
| 1480 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" |
| 1481 | fi |
| 1482 | fi |
| 1483 | haveit= |
| 1484 | for x in $LDFLAGS $LTLIB[]NAME; do |
| 1485 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1486 | if test "X$x" = "X-L$additional_libdir"; then |
| 1487 | haveit=yes |
| 1488 | break |
| 1489 | fi |
| 1490 | done |
| 1491 | if test -z "$haveit"; then |
| 1492 | if test -d "$additional_libdir"; then |
| 1493 | dnl Really add $additional_libdir to $LTLIBNAME. |
| 1494 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" |
| 1495 | fi |
| 1496 | fi |
| 1497 | fi |
| 1498 | fi |
| 1499 | ;; |
| 1500 | -R*) |
| 1501 | dir=`echo "X$dep" | sed -e 's/^X-R//'` |
| 1502 | if test "$enable_rpath" != no; then |
| 1503 | dnl Potentially add DIR to rpathdirs. |
| 1504 | dnl The rpathdirs will be appended to $LIBNAME at the end. |
| 1505 | haveit= |
| 1506 | for x in $rpathdirs; do |
| 1507 | if test "X$x" = "X$dir"; then |
| 1508 | haveit=yes |
| 1509 | break |
| 1510 | fi |
| 1511 | done |
| 1512 | if test -z "$haveit"; then |
| 1513 | rpathdirs="$rpathdirs $dir" |
| 1514 | fi |
| 1515 | dnl Potentially add DIR to ltrpathdirs. |
| 1516 | dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
| 1517 | haveit= |
| 1518 | for x in $ltrpathdirs; do |
| 1519 | if test "X$x" = "X$dir"; then |
| 1520 | haveit=yes |
| 1521 | break |
| 1522 | fi |
| 1523 | done |
| 1524 | if test -z "$haveit"; then |
| 1525 | ltrpathdirs="$ltrpathdirs $dir" |
| 1526 | fi |
| 1527 | fi |
| 1528 | ;; |
| 1529 | -l*) |
| 1530 | dnl Handle this in the next round. |
| 1531 | names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` |
| 1532 | ;; |
| 1533 | *.la) |
| 1534 | dnl Handle this in the next round. Throw away the .la's |
| 1535 | dnl directory; it is already contained in a preceding -L |
| 1536 | dnl option. |
| 1537 | names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` |
| 1538 | ;; |
| 1539 | *) |
| 1540 | dnl Most likely an immediate library name. |
| 1541 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" |
| 1542 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" |
| 1543 | ;; |
| 1544 | esac |
| 1545 | done |
| 1546 | fi |
| 1547 | else |
| 1548 | dnl Didn't find the library; assume it is in the system directories |
| 1549 | dnl known to the linker and runtime loader. (All the system |
| 1550 | dnl directories known to the linker should also be known to the |
| 1551 | dnl runtime loader, otherwise the system is severely misconfigured.) |
| 1552 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
| 1553 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" |
| 1554 | fi |
| 1555 | fi |
| 1556 | fi |
| 1557 | done |
| 1558 | done |
| 1559 | if test "X$rpathdirs" != "X"; then |
| 1560 | if test -n "$hardcode_libdir_separator"; then |
| 1561 | dnl Weird platform: only the last -rpath option counts, the user must |
| 1562 | dnl pass all path elements in one option. We can arrange that for a |
| 1563 | dnl single library, but not when more than one $LIBNAMEs are used. |
| 1564 | alldirs= |
| 1565 | for found_dir in $rpathdirs; do |
| 1566 | alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" |
| 1567 | done |
| 1568 | dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. |
| 1569 | acl_save_libdir="$libdir" |
| 1570 | libdir="$alldirs" |
| 1571 | eval flag=\"$hardcode_libdir_flag_spec\" |
| 1572 | libdir="$acl_save_libdir" |
| 1573 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
| 1574 | else |
| 1575 | dnl The -rpath options are cumulative. |
| 1576 | for found_dir in $rpathdirs; do |
| 1577 | acl_save_libdir="$libdir" |
| 1578 | libdir="$found_dir" |
| 1579 | eval flag=\"$hardcode_libdir_flag_spec\" |
| 1580 | libdir="$acl_save_libdir" |
| 1581 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
| 1582 | done |
| 1583 | fi |
| 1584 | fi |
| 1585 | if test "X$ltrpathdirs" != "X"; then |
| 1586 | dnl When using libtool, the option that works for both libraries and |
| 1587 | dnl executables is -R. The -R options are cumulative. |
| 1588 | for found_dir in $ltrpathdirs; do |
| 1589 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" |
| 1590 | done |
| 1591 | fi |
| 1592 | ]) |
| 1593 | |
| 1594 | dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, |
| 1595 | dnl unless already present in VAR. |
| 1596 | dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes |
| 1597 | dnl contains two or three consecutive elements that belong together. |
| 1598 | AC_DEFUN([AC_LIB_APPENDTOVAR], |
| 1599 | [ |
| 1600 | for element in [$2]; do |
| 1601 | haveit= |
| 1602 | for x in $[$1]; do |
| 1603 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1604 | if test "X$x" = "X$element"; then |
| 1605 | haveit=yes |
| 1606 | break |
| 1607 | fi |
| 1608 | done |
| 1609 | if test -z "$haveit"; then |
| 1610 | [$1]="${[$1]}${[$1]:+ }$element" |
| 1611 | fi |
| 1612 | done |
| 1613 | ]) |
| 1614 | # lib-prefix.m4 serial 1 (gettext-0.11) |
| 1615 | dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. |
| 1616 | dnl This file is free software, distributed under the terms of the GNU |
| 1617 | dnl General Public License. As a special exception to the GNU General |
| 1618 | dnl Public License, this file may be distributed as part of a program |
| 1619 | dnl that contains a configuration script generated by Autoconf, under |
| 1620 | dnl the same distribution terms as the rest of that program. |
| 1621 | |
| 1622 | dnl From Bruno Haible. |
| 1623 | |
| 1624 | dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed |
| 1625 | dnl to access previously installed libraries. The basic assumption is that |
| 1626 | dnl a user will want packages to use other packages he previously installed |
| 1627 | dnl with the same --prefix option. |
| 1628 | dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate |
| 1629 | dnl libraries, but is otherwise very convenient. |
| 1630 | AC_DEFUN([AC_LIB_PREFIX], |
| 1631 | [ |
| 1632 | AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) |
| 1633 | AC_REQUIRE([AC_PROG_CC]) |
| 1634 | AC_REQUIRE([AC_CANONICAL_HOST]) |
| 1635 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 1636 | dnl By default, look in $includedir and $libdir. |
| 1637 | use_additional=yes |
| 1638 | AC_LIB_WITH_FINAL_PREFIX([ |
| 1639 | eval additional_includedir=\"$includedir\" |
| 1640 | eval additional_libdir=\"$libdir\" |
| 1641 | ]) |
| 1642 | AC_ARG_WITH([lib-prefix], |
| 1643 | [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib |
| 1644 | --without-lib-prefix don't search for libraries in includedir and libdir], |
| 1645 | [ |
| 1646 | if test "X$withval" = "Xno"; then |
| 1647 | use_additional=no |
| 1648 | else |
| 1649 | if test "X$withval" = "X"; then |
| 1650 | AC_LIB_WITH_FINAL_PREFIX([ |
| 1651 | eval additional_includedir=\"$includedir\" |
| 1652 | eval additional_libdir=\"$libdir\" |
| 1653 | ]) |
| 1654 | else |
| 1655 | additional_includedir="$withval/include" |
| 1656 | additional_libdir="$withval/lib" |
| 1657 | fi |
| 1658 | fi |
| 1659 | ]) |
| 1660 | if test $use_additional = yes; then |
| 1661 | dnl Potentially add $additional_includedir to $CPPFLAGS. |
| 1662 | dnl But don't add it |
| 1663 | dnl 1. if it's the standard /usr/include, |
| 1664 | dnl 2. if it's already present in $CPPFLAGS, |
| 1665 | dnl 3. if it's /usr/local/include and we are using GCC on Linux, |
| 1666 | dnl 4. if it doesn't exist as a directory. |
| 1667 | if test "X$additional_includedir" != "X/usr/include"; then |
| 1668 | haveit= |
| 1669 | for x in $CPPFLAGS; do |
| 1670 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1671 | if test "X$x" = "X-I$additional_includedir"; then |
| 1672 | haveit=yes |
| 1673 | break |
| 1674 | fi |
| 1675 | done |
| 1676 | if test -z "$haveit"; then |
| 1677 | if test "X$additional_includedir" = "X/usr/local/include"; then |
| 1678 | if test -n "$GCC"; then |
| 1679 | case $host_os in |
| 1680 | linux*) haveit=yes;; |
| 1681 | esac |
| 1682 | fi |
| 1683 | fi |
| 1684 | if test -z "$haveit"; then |
| 1685 | if test -d "$additional_includedir"; then |
| 1686 | dnl Really add $additional_includedir to $CPPFLAGS. |
| 1687 | CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" |
| 1688 | fi |
| 1689 | fi |
| 1690 | fi |
| 1691 | fi |
| 1692 | dnl Potentially add $additional_libdir to $LDFLAGS. |
| 1693 | dnl But don't add it |
| 1694 | dnl 1. if it's the standard /usr/lib, |
| 1695 | dnl 2. if it's already present in $LDFLAGS, |
| 1696 | dnl 3. if it's /usr/local/lib and we are using GCC on Linux, |
| 1697 | dnl 4. if it doesn't exist as a directory. |
| 1698 | if test "X$additional_libdir" != "X/usr/lib"; then |
| 1699 | haveit= |
| 1700 | for x in $LDFLAGS; do |
| 1701 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1702 | if test "X$x" = "X-L$additional_libdir"; then |
| 1703 | haveit=yes |
| 1704 | break |
| 1705 | fi |
| 1706 | done |
| 1707 | if test -z "$haveit"; then |
| 1708 | if test "X$additional_libdir" = "X/usr/local/lib"; then |
| 1709 | if test -n "$GCC"; then |
| 1710 | case $host_os in |
| 1711 | linux*) haveit=yes;; |
| 1712 | esac |
| 1713 | fi |
| 1714 | fi |
| 1715 | if test -z "$haveit"; then |
| 1716 | if test -d "$additional_libdir"; then |
| 1717 | dnl Really add $additional_libdir to $LDFLAGS. |
| 1718 | LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" |
| 1719 | fi |
| 1720 | fi |
| 1721 | fi |
| 1722 | fi |
| 1723 | fi |
| 1724 | ]) |
| 1725 | |
| 1726 | dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, |
| 1727 | dnl acl_final_exec_prefix, containing the values to which $prefix and |
| 1728 | dnl $exec_prefix will expand at the end of the configure script. |
| 1729 | AC_DEFUN([AC_LIB_PREPARE_PREFIX], |
| 1730 | [ |
| 1731 | dnl Unfortunately, prefix and exec_prefix get only finally determined |
| 1732 | dnl at the end of configure. |
| 1733 | if test "X$prefix" = "XNONE"; then |
| 1734 | acl_final_prefix="$ac_default_prefix" |
| 1735 | else |
| 1736 | acl_final_prefix="$prefix" |
| 1737 | fi |
| 1738 | if test "X$exec_prefix" = "XNONE"; then |
| 1739 | acl_final_exec_prefix='${prefix}' |
| 1740 | else |
| 1741 | acl_final_exec_prefix="$exec_prefix" |
| 1742 | fi |
| 1743 | acl_save_prefix="$prefix" |
| 1744 | prefix="$acl_final_prefix" |
| 1745 | eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" |
| 1746 | prefix="$acl_save_prefix" |
| 1747 | ]) |
| 1748 | |
| 1749 | dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the |
| 1750 | dnl variables prefix and exec_prefix bound to the values they will have |
| 1751 | dnl at the end of the configure script. |
| 1752 | AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], |
| 1753 | [ |
| 1754 | acl_save_prefix="$prefix" |
| 1755 | prefix="$acl_final_prefix" |
| 1756 | acl_save_exec_prefix="$exec_prefix" |
| 1757 | exec_prefix="$acl_final_exec_prefix" |
| 1758 | $1 |
| 1759 | exec_prefix="$acl_save_exec_prefix" |
| 1760 | prefix="$acl_save_prefix" |
| 1761 | ]) |
| 1762 | # progtest.m4 serial 2 (gettext-0.10.40) |
| 1763 | dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. |
| 1764 | dnl This file is free software, distributed under the terms of the GNU |
| 1765 | dnl General Public License. As a special exception to the GNU General |
| 1766 | dnl Public License, this file may be distributed as part of a program |
| 1767 | dnl that contains a configuration script generated by Autoconf, under |
| 1768 | dnl the same distribution terms as the rest of that program. |
| 1769 | dnl |
| 1770 | dnl This file can can be used in projects which are not available under |
| 1771 | dnl the GNU General Public License or the GNU Library General Public |
| 1772 | dnl License but which still want to provide support for the GNU gettext |
| 1773 | dnl functionality. |
| 1774 | dnl Please note that the actual code of the GNU gettext library is covered |
| 1775 | dnl by the GNU Library General Public License, and the rest of the GNU |
| 1776 | dnl gettext package package is covered by the GNU General Public License. |
| 1777 | dnl They are *not* in the public domain. |
| 1778 | |
| 1779 | dnl Authors: |
| 1780 | dnl Ulrich Drepper <drepper@cygnus.com>, 1996. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 1781 | |
| 1782 | # Search path for a program which passes the given test. |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 1783 | |
| 1784 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, |
| 1785 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 1786 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 1787 | [# Extract the first word of "$2", so it can be a program name with args. |
| 1788 | set dummy $2; ac_word=[$]2 |
| 1789 | AC_MSG_CHECKING([for $ac_word]) |
| 1790 | AC_CACHE_VAL(ac_cv_path_$1, |
| 1791 | [case "[$]$1" in |
| 1792 | /*) |
| 1793 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. |
| 1794 | ;; |
| 1795 | *) |
| 1796 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
| 1797 | for ac_dir in ifelse([$5], , $PATH, [$5]); do |
| 1798 | test -z "$ac_dir" && ac_dir=. |
| 1799 | if test -f $ac_dir/$ac_word; then |
| 1800 | if [$3]; then |
| 1801 | ac_cv_path_$1="$ac_dir/$ac_word" |
| 1802 | break |
| 1803 | fi |
| 1804 | fi |
| 1805 | done |
| 1806 | IFS="$ac_save_ifs" |
| 1807 | dnl If no 4th arg is given, leave the cache variable unset, |
| 1808 | dnl so AC_PATH_PROGS will keep looking. |
| 1809 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" |
| 1810 | ])dnl |
| 1811 | ;; |
| 1812 | esac])dnl |
| 1813 | $1="$ac_cv_path_$1" |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 1814 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 1815 | AC_MSG_RESULT([$]$1) |
| 1816 | else |
| 1817 | AC_MSG_RESULT(no) |
| 1818 | fi |
| 1819 | AC_SUBST($1)dnl |
| 1820 | ]) |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 1821 | # stdint_h.m4 serial 2 (gettext-0.11.4) |
| 1822 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. |
| 1823 | dnl This file is free software, distributed under the terms of the GNU |
| 1824 | dnl General Public License. As a special exception to the GNU General |
| 1825 | dnl Public License, this file may be distributed as part of a program |
| 1826 | dnl that contains a configuration script generated by Autoconf, under |
| 1827 | dnl the same distribution terms as the rest of that program. |
| 1828 | |
| 1829 | dnl From Paul Eggert. |
| 1830 | |
| 1831 | # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists, |
| 1832 | # doesn't clash with <sys/types.h>, and declares uintmax_t. |
| 1833 | |
| 1834 | AC_DEFUN([jm_AC_HEADER_STDINT_H], |
| 1835 | [ |
| 1836 | AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, |
| 1837 | [AC_TRY_COMPILE( |
| 1838 | [#include <sys/types.h> |
| 1839 | #include <stdint.h>], |
| 1840 | [uintmax_t i = (uintmax_t) -1;], |
| 1841 | jm_ac_cv_header_stdint_h=yes, |
| 1842 | jm_ac_cv_header_stdint_h=no)]) |
| 1843 | if test $jm_ac_cv_header_stdint_h = yes; then |
| 1844 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, |
| 1845 | [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, |
| 1846 | and declares uintmax_t. ]) |
| 1847 | fi |
| 1848 | ]) |
| 1849 | # uintmax_t.m4 serial 6 (gettext-0.11) |
| 1850 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. |
| 1851 | dnl This file is free software, distributed under the terms of the GNU |
| 1852 | dnl General Public License. As a special exception to the GNU General |
| 1853 | dnl Public License, this file may be distributed as part of a program |
| 1854 | dnl that contains a configuration script generated by Autoconf, under |
| 1855 | dnl the same distribution terms as the rest of that program. |
| 1856 | |
| 1857 | dnl From Paul Eggert. |
| 1858 | |
| 1859 | AC_PREREQ(2.13) |
| 1860 | |
| 1861 | # Define uintmax_t to `unsigned long' or `unsigned long long' |
| 1862 | # if <inttypes.h> does not exist. |
| 1863 | |
| 1864 | AC_DEFUN([jm_AC_TYPE_UINTMAX_T], |
| 1865 | [ |
| 1866 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) |
| 1867 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) |
| 1868 | if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then |
| 1869 | AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) |
| 1870 | test $ac_cv_type_unsigned_long_long = yes \ |
| 1871 | && ac_type='unsigned long long' \ |
| 1872 | || ac_type='unsigned long' |
| 1873 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, |
| 1874 | [Define to unsigned long or unsigned long long |
| 1875 | if <inttypes.h> and <stdint.h> don't define.]) |
| 1876 | fi |
| 1877 | ]) |
| 1878 | # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) |
| 1879 | dnl Copyright (C) 1999-2002 Free Software Foundation, Inc. |
| 1880 | dnl This file is free software, distributed under the terms of the GNU |
| 1881 | dnl General Public License. As a special exception to the GNU General |
| 1882 | dnl Public License, this file may be distributed as part of a program |
| 1883 | dnl that contains a configuration script generated by Autoconf, under |
| 1884 | dnl the same distribution terms as the rest of that program. |
| 1885 | |
| 1886 | dnl From Paul Eggert. |
| 1887 | |
| 1888 | AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], |
| 1889 | [ |
| 1890 | AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, |
| 1891 | [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], |
| 1892 | [unsigned long long ullmax = (unsigned long long) -1; |
| 1893 | return ull << i | ull >> i | ullmax / ull | ullmax % ull;], |
| 1894 | ac_cv_type_unsigned_long_long=yes, |
| 1895 | ac_cv_type_unsigned_long_long=no)]) |
| 1896 | if test $ac_cv_type_unsigned_long_long = yes; then |
| 1897 | AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, |
| 1898 | [Define if you have the unsigned long long type.]) |
| 1899 | fi |
| 1900 | ]) |