diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-17 07:40:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-17 07:40:35 +0000 |
commit | 59b43b4b7398858b220c55b1b38101428f8a2c0b (patch) | |
tree | b823a3c787c452ba70124cfb219e9c1bf759c171 /m4 | |
parent | a0677cf8ba5ccf83f2a01fa831415717b6b4c244 (diff) | |
download | gnunet-gtk-59b43b4b7398858b220c55b1b38101428f8a2c0b.tar.gz gnunet-gtk-59b43b4b7398858b220c55b1b38101428f8a2c0b.zip |
importing 0.9.x gnunet-gtk branch
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gettext.m4 | 276 | ||||
-rw-r--r-- | m4/iconv.m4 | 95 | ||||
-rw-r--r-- | m4/lib-ld.m4 | 8 | ||||
-rw-r--r-- | m4/lib-link.m4 | 274 | ||||
-rw-r--r-- | m4/lib-prefix.m4 | 52 | ||||
-rw-r--r-- | m4/nls.m4 | 32 | ||||
-rw-r--r-- | m4/po.m4 | 146 | ||||
-rw-r--r-- | m4/progtest.m4 | 15 |
8 files changed, 540 insertions, 358 deletions
diff --git a/m4/gettext.m4 b/m4/gettext.m4 index a374f03f..c9ae1f7d 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # gettext.m4 serial 28 (gettext-0.13) | 1 | # gettext.m4 serial 60 (gettext-0.17) |
2 | dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | dnl | 6 | dnl |
9 | dnl This file can can be used in projects which are not available under | 7 | dnl This file can can be used in projects which are not available under |
10 | dnl the GNU General Public License or the GNU Library General Public | 8 | dnl the GNU General Public License or the GNU Library General Public |
@@ -17,7 +15,7 @@ dnl They are *not* in the public domain. | |||
17 | 15 | ||
18 | dnl Authors: | 16 | dnl Authors: |
19 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. | 17 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. |
20 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. | 18 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006. |
21 | 19 | ||
22 | dnl Macro to add for using GNU gettext. | 20 | dnl Macro to add for using GNU gettext. |
23 | 21 | ||
@@ -65,8 +63,13 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
65 | ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , | 63 | ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
66 | [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT | 64 | [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
67 | ])])])]) | 65 | ])])])]) |
68 | define(gt_included_intl, ifelse([$1], [external], [no], [yes])) | 66 | define([gt_included_intl], |
69 | define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) | 67 | ifelse([$1], [external], |
68 | ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), | ||
69 | [yes])) | ||
70 | define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) | ||
71 | gt_NEEDS_INIT | ||
72 | AM_GNU_GETTEXT_NEED([$2]) | ||
70 | 73 | ||
71 | AC_REQUIRE([AM_PO_SUBDIRS])dnl | 74 | AC_REQUIRE([AM_PO_SUBDIRS])dnl |
72 | ifelse(gt_included_intl, yes, [ | 75 | ifelse(gt_included_intl, yes, [ |
@@ -80,7 +83,7 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
80 | dnl Sometimes libintl requires libiconv, so first search for libiconv. | 83 | dnl Sometimes libintl requires libiconv, so first search for libiconv. |
81 | dnl Ideally we would do this search only after the | 84 | dnl Ideally we would do this search only after the |
82 | dnl if test "$USE_NLS" = "yes"; then | 85 | dnl if test "$USE_NLS" = "yes"; then |
83 | dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then | 86 | dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then |
84 | dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT | 87 | dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT |
85 | dnl the configure script would need to contain the same shell code | 88 | dnl the configure script would need to contain the same shell code |
86 | dnl again, outside any 'if'. There are two solutions: | 89 | dnl again, outside any 'if'. There are two solutions: |
@@ -92,8 +95,11 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
92 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) | 95 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
93 | ]) | 96 | ]) |
94 | 97 | ||
98 | dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. | ||
99 | gt_INTL_MACOSX | ||
100 | |||
95 | dnl Set USE_NLS. | 101 | dnl Set USE_NLS. |
96 | AM_NLS | 102 | AC_REQUIRE([AM_NLS]) |
97 | 103 | ||
98 | ifelse(gt_included_intl, yes, [ | 104 | ifelse(gt_included_intl, yes, [ |
99 | BUILD_INCLUDED_LIBINTL=no | 105 | BUILD_INCLUDED_LIBINTL=no |
@@ -103,6 +109,15 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
103 | LTLIBINTL= | 109 | LTLIBINTL= |
104 | POSUB= | 110 | POSUB= |
105 | 111 | ||
112 | dnl Add a version number to the cache macros. | ||
113 | case " $gt_needs " in | ||
114 | *" need-formatstring-macros "*) gt_api_version=3 ;; | ||
115 | *" need-ngettext "*) gt_api_version=2 ;; | ||
116 | *) gt_api_version=1 ;; | ||
117 | esac | ||
118 | gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" | ||
119 | gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" | ||
120 | |||
106 | dnl If we use NLS figure out what method | 121 | dnl If we use NLS figure out what method |
107 | if test "$USE_NLS" = "yes"; then | 122 | if test "$USE_NLS" = "yes"; then |
108 | gt_use_preinstalled_gnugettext=no | 123 | gt_use_preinstalled_gnugettext=no |
@@ -121,28 +136,35 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
121 | dnl to use. If GNU gettext is available we use this. Else we have | 136 | dnl to use. If GNU gettext is available we use this. Else we have |
122 | dnl to fall back to GNU NLS library. | 137 | dnl to fall back to GNU NLS library. |
123 | 138 | ||
124 | dnl Add a version number to the cache macros. | 139 | if test $gt_api_version -ge 3; then |
125 | define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) | 140 | gt_revision_test_code=' |
126 | define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) | 141 | #ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
127 | define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) | ||
128 | |||
129 | AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, | ||
130 | [AC_TRY_LINK([#include <libintl.h> | ||
131 | ]ifelse([$2], [need-formatstring-macros], | ||
132 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION | ||
133 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) | 142 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
134 | #endif | 143 | #endif |
135 | changequote(,)dnl | 144 | changequote(,)dnl |
136 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; | 145 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
137 | changequote([,])dnl | 146 | changequote([,])dnl |
138 | ], [])[extern int _nl_msg_cat_cntr; | 147 | ' |
148 | else | ||
149 | gt_revision_test_code= | ||
150 | fi | ||
151 | if test $gt_api_version -ge 2; then | ||
152 | gt_expression_test_code=' + * ngettext ("", "", 0)' | ||
153 | else | ||
154 | gt_expression_test_code= | ||
155 | fi | ||
156 | |||
157 | AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], | ||
158 | [AC_TRY_LINK([#include <libintl.h> | ||
159 | $gt_revision_test_code | ||
160 | extern int _nl_msg_cat_cntr; | ||
139 | extern int *_nl_domain_bindings;], | 161 | extern int *_nl_domain_bindings;], |
140 | [bindtextdomain ("", ""); | 162 | [bindtextdomain ("", ""); |
141 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], | 163 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], |
142 | gt_cv_func_gnugettext_libc=yes, | 164 | [eval "$gt_func_gnugettext_libc=yes"], |
143 | gt_cv_func_gnugettext_libc=no)]) | 165 | [eval "$gt_func_gnugettext_libc=no"])]) |
144 | 166 | ||
145 | if test "$gt_cv_func_gnugettext_libc" != "yes"; then | 167 | if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then |
146 | dnl Sometimes libintl requires libiconv, so first search for libiconv. | 168 | dnl Sometimes libintl requires libiconv, so first search for libiconv. |
147 | ifelse(gt_included_intl, yes, , [ | 169 | ifelse(gt_included_intl, yes, , [ |
148 | AM_ICONV_LINK | 170 | AM_ICONV_LINK |
@@ -153,52 +175,40 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
153 | dnl even if libiconv doesn't exist. | 175 | dnl even if libiconv doesn't exist. |
154 | AC_LIB_LINKFLAGS_BODY([intl]) | 176 | AC_LIB_LINKFLAGS_BODY([intl]) |
155 | AC_CACHE_CHECK([for GNU gettext in libintl], | 177 | AC_CACHE_CHECK([for GNU gettext in libintl], |
156 | gt_cv_func_gnugettext_libintl, | 178 | [$gt_func_gnugettext_libintl], |
157 | [gt_save_CPPFLAGS="$CPPFLAGS" | 179 | [gt_save_CPPFLAGS="$CPPFLAGS" |
158 | CPPFLAGS="$CPPFLAGS $INCINTL" | 180 | CPPFLAGS="$CPPFLAGS $INCINTL" |
159 | gt_save_LIBS="$LIBS" | 181 | gt_save_LIBS="$LIBS" |
160 | LIBS="$LIBS $LIBINTL" | 182 | LIBS="$LIBS $LIBINTL" |
161 | dnl Now see whether libintl exists and does not depend on libiconv. | 183 | dnl Now see whether libintl exists and does not depend on libiconv. |
162 | AC_TRY_LINK([#include <libintl.h> | 184 | AC_TRY_LINK([#include <libintl.h> |
163 | ]ifelse([$2], [need-formatstring-macros], | 185 | $gt_revision_test_code |
164 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION | 186 | extern int _nl_msg_cat_cntr; |
165 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) | ||
166 | #endif | ||
167 | changequote(,)dnl | ||
168 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; | ||
169 | changequote([,])dnl | ||
170 | ], [])[extern int _nl_msg_cat_cntr; | ||
171 | extern | 187 | extern |
172 | #ifdef __cplusplus | 188 | #ifdef __cplusplus |
173 | "C" | 189 | "C" |
174 | #endif | 190 | #endif |
175 | const char *_nl_expand_alias ();], | 191 | const char *_nl_expand_alias (const char *);], |
176 | [bindtextdomain ("", ""); | 192 | [bindtextdomain ("", ""); |
177 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], | 193 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
178 | gt_cv_func_gnugettext_libintl=yes, | 194 | [eval "$gt_func_gnugettext_libintl=yes"], |
179 | gt_cv_func_gnugettext_libintl=no) | 195 | [eval "$gt_func_gnugettext_libintl=no"]) |
180 | dnl Now see whether libintl exists and depends on libiconv. | 196 | dnl Now see whether libintl exists and depends on libiconv. |
181 | if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then | 197 | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then |
182 | LIBS="$LIBS $LIBICONV" | 198 | LIBS="$LIBS $LIBICONV" |
183 | AC_TRY_LINK([#include <libintl.h> | 199 | AC_TRY_LINK([#include <libintl.h> |
184 | ]ifelse([$2], [need-formatstring-macros], | 200 | $gt_revision_test_code |
185 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION | 201 | extern int _nl_msg_cat_cntr; |
186 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) | ||
187 | #endif | ||
188 | changequote(,)dnl | ||
189 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; | ||
190 | changequote([,])dnl | ||
191 | ], [])[extern int _nl_msg_cat_cntr; | ||
192 | extern | 202 | extern |
193 | #ifdef __cplusplus | 203 | #ifdef __cplusplus |
194 | "C" | 204 | "C" |
195 | #endif | 205 | #endif |
196 | const char *_nl_expand_alias ();], | 206 | const char *_nl_expand_alias (const char *);], |
197 | [bindtextdomain ("", ""); | 207 | [bindtextdomain ("", ""); |
198 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], | 208 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
199 | [LIBINTL="$LIBINTL $LIBICONV" | 209 | [LIBINTL="$LIBINTL $LIBICONV" |
200 | LTLIBINTL="$LTLIBINTL $LTLIBICONV" | 210 | LTLIBINTL="$LTLIBINTL $LTLIBICONV" |
201 | gt_cv_func_gnugettext_libintl=yes | 211 | eval "$gt_func_gnugettext_libintl=yes" |
202 | ]) | 212 | ]) |
203 | fi | 213 | fi |
204 | CPPFLAGS="$gt_save_CPPFLAGS" | 214 | CPPFLAGS="$gt_save_CPPFLAGS" |
@@ -209,8 +219,8 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
209 | dnl use it. But if this macro is used in GNU gettext, and GNU | 219 | dnl use it. But if this macro is used in GNU gettext, and GNU |
210 | dnl gettext is already preinstalled in libintl, we update this | 220 | dnl gettext is already preinstalled in libintl, we update this |
211 | dnl libintl. (Cf. the install rule in intl/Makefile.in.) | 221 | dnl libintl. (Cf. the install rule in intl/Makefile.in.) |
212 | if test "$gt_cv_func_gnugettext_libc" = "yes" \ | 222 | if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ |
213 | || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ | 223 | || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ |
214 | && test "$PACKAGE" != gettext-runtime \ | 224 | && test "$PACKAGE" != gettext-runtime \ |
215 | && test "$PACKAGE" != gettext-tools; }; then | 225 | && test "$PACKAGE" != gettext-tools; }; then |
216 | gt_use_preinstalled_gnugettext=yes | 226 | gt_use_preinstalled_gnugettext=yes |
@@ -233,11 +243,12 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
233 | dnl Mark actions used to generate GNU NLS library. | 243 | dnl Mark actions used to generate GNU NLS library. |
234 | BUILD_INCLUDED_LIBINTL=yes | 244 | BUILD_INCLUDED_LIBINTL=yes |
235 | USE_INCLUDED_LIBINTL=yes | 245 | USE_INCLUDED_LIBINTL=yes |
236 | LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" | 246 | LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" |
237 | LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" | 247 | LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" |
238 | LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` | 248 | LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` |
239 | fi | 249 | fi |
240 | 250 | ||
251 | CATOBJEXT= | ||
241 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ | 252 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
242 | || test "$nls_cv_use_gnu_gettext" = "yes"; then | 253 | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
243 | dnl Mark actions to use GNU gettext tools. | 254 | dnl Mark actions to use GNU gettext tools. |
@@ -245,6 +256,15 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
245 | fi | 256 | fi |
246 | ]) | 257 | ]) |
247 | 258 | ||
259 | if test -n "$INTL_MACOSX_LIBS"; then | ||
260 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ | ||
261 | || test "$nls_cv_use_gnu_gettext" = "yes"; then | ||
262 | dnl Some extra flags are needed during linking. | ||
263 | LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" | ||
264 | LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" | ||
265 | fi | ||
266 | fi | ||
267 | |||
248 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ | 268 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
249 | || test "$nls_cv_use_gnu_gettext" = "yes"; then | 269 | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
250 | AC_DEFINE(ENABLE_NLS, 1, | 270 | AC_DEFINE(ENABLE_NLS, 1, |
@@ -260,7 +280,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
260 | if test "$USE_NLS" = "yes"; then | 280 | if test "$USE_NLS" = "yes"; then |
261 | AC_MSG_CHECKING([where the gettext function comes from]) | 281 | AC_MSG_CHECKING([where the gettext function comes from]) |
262 | if test "$gt_use_preinstalled_gnugettext" = "yes"; then | 282 | if test "$gt_use_preinstalled_gnugettext" = "yes"; then |
263 | if test "$gt_cv_func_gnugettext_libintl" = "yes"; then | 283 | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then |
264 | gt_source="external libintl" | 284 | gt_source="external libintl" |
265 | else | 285 | else |
266 | gt_source="libc" | 286 | gt_source="libc" |
@@ -274,7 +294,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
274 | if test "$USE_NLS" = "yes"; then | 294 | if test "$USE_NLS" = "yes"; then |
275 | 295 | ||
276 | if test "$gt_use_preinstalled_gnugettext" = "yes"; then | 296 | if test "$gt_use_preinstalled_gnugettext" = "yes"; then |
277 | if test "$gt_cv_func_gnugettext_libintl" = "yes"; then | 297 | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then |
278 | AC_MSG_CHECKING([how to link with libintl]) | 298 | AC_MSG_CHECKING([how to link with libintl]) |
279 | AC_MSG_RESULT([$LIBINTL]) | 299 | AC_MSG_RESULT([$LIBINTL]) |
280 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) | 300 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) |
@@ -320,6 +340,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
320 | AC_SUBST(GENCAT) | 340 | AC_SUBST(GENCAT) |
321 | 341 | ||
322 | dnl For backward compatibility. Some Makefiles may be using this. | 342 | dnl For backward compatibility. Some Makefiles may be using this. |
343 | INTLOBJS= | ||
323 | if test "$USE_INCLUDED_LIBINTL" = yes; then | 344 | if test "$USE_INCLUDED_LIBINTL" = yes; then |
324 | INTLOBJS="\$(GETTOBJS)" | 345 | INTLOBJS="\$(GETTOBJS)" |
325 | fi | 346 | fi |
@@ -341,145 +362,18 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", | |||
341 | ]) | 362 | ]) |
342 | 363 | ||
343 | 364 | ||
344 | dnl Checks for all prerequisites of the intl subdirectory, | 365 | dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. |
345 | dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, | 366 | m4_define([gt_NEEDS_INIT], |
346 | dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. | ||
347 | AC_DEFUN([AM_INTL_SUBDIR], | ||
348 | [ | 367 | [ |
349 | AC_REQUIRE([AC_PROG_INSTALL])dnl | 368 | m4_divert_text([DEFAULTS], [gt_needs=]) |
350 | AC_REQUIRE([AM_MKINSTALLDIRS])dnl | 369 | m4_define([gt_NEEDS_INIT], []) |
351 | AC_REQUIRE([AC_PROG_CC])dnl | ||
352 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | ||
353 | AC_REQUIRE([AC_PROG_RANLIB])dnl | ||
354 | AC_REQUIRE([AC_ISC_POSIX])dnl | ||
355 | AC_REQUIRE([AC_HEADER_STDC])dnl | ||
356 | AC_REQUIRE([AC_C_CONST])dnl | ||
357 | AC_REQUIRE([bh_C_SIGNED])dnl | ||
358 | AC_REQUIRE([AC_C_INLINE])dnl | ||
359 | AC_REQUIRE([AC_TYPE_OFF_T])dnl | ||
360 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl | ||
361 | AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl | ||
362 | AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl | ||
363 | AC_REQUIRE([gt_TYPE_WCHAR_T])dnl | ||
364 | AC_REQUIRE([gt_TYPE_WINT_T])dnl | ||
365 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) | ||
366 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) | ||
367 | AC_REQUIRE([gt_TYPE_INTMAX_T]) | ||
368 | AC_REQUIRE([gt_PRINTF_POSIX]) | ||
369 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl | ||
370 | AC_REQUIRE([AC_FUNC_MMAP])dnl | ||
371 | AC_REQUIRE([jm_GLIBC21])dnl | ||
372 | AC_REQUIRE([gt_INTDIV0])dnl | ||
373 | AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl | ||
374 | AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl | ||
375 | AC_REQUIRE([gt_INTTYPES_PRI])dnl | ||
376 | AC_REQUIRE([gl_XSIZE])dnl | ||
377 | |||
378 | AC_CHECK_TYPE([ptrdiff_t], , | ||
379 | [AC_DEFINE([ptrdiff_t], [long], | ||
380 | [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) | ||
381 | ]) | ||
382 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ | ||
383 | stdlib.h string.h unistd.h sys/param.h]) | ||
384 | AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ | ||
385 | mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ | ||
386 | strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ | ||
387 | __fsetlocking]) | ||
388 | |||
389 | dnl Use the _snprintf function only if it is declared (because on NetBSD it | ||
390 | dnl is defined as a weak alias of snprintf; we prefer to use the latter). | ||
391 | gt_CHECK_DECL(_snprintf, [#include <stdio.h>]) | ||
392 | gt_CHECK_DECL(_snwprintf, [#include <stdio.h>]) | ||
393 | |||
394 | dnl Use the *_unlocked functions only if they are declared. | ||
395 | dnl (because some of them were defined without being declared in Solaris | ||
396 | dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built | ||
397 | dnl on Solaris 2.5.1 to run on Solaris 2.6). | ||
398 | dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. | ||
399 | gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>]) | ||
400 | gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>]) | ||
401 | gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>]) | ||
402 | |||
403 | case $gt_cv_func_printf_posix in | ||
404 | *yes) HAVE_POSIX_PRINTF=1 ;; | ||
405 | *) HAVE_POSIX_PRINTF=0 ;; | ||
406 | esac | ||
407 | AC_SUBST([HAVE_POSIX_PRINTF]) | ||
408 | if test "$ac_cv_func_asprintf" = yes; then | ||
409 | HAVE_ASPRINTF=1 | ||
410 | else | ||
411 | HAVE_ASPRINTF=0 | ||
412 | fi | ||
413 | AC_SUBST([HAVE_ASPRINTF]) | ||
414 | if test "$ac_cv_func_snprintf" = yes; then | ||
415 | HAVE_SNPRINTF=1 | ||
416 | else | ||
417 | HAVE_SNPRINTF=0 | ||
418 | fi | ||
419 | AC_SUBST([HAVE_SNPRINTF]) | ||
420 | if test "$ac_cv_func_wprintf" = yes; then | ||
421 | HAVE_WPRINTF=1 | ||
422 | else | ||
423 | HAVE_WPRINTF=0 | ||
424 | fi | ||
425 | AC_SUBST([HAVE_WPRINTF]) | ||
426 | |||
427 | AM_ICONV | ||
428 | AM_LANGINFO_CODESET | ||
429 | if test $ac_cv_header_locale_h = yes; then | ||
430 | AM_LC_MESSAGES | ||
431 | fi | ||
432 | |||
433 | dnl intl/plural.c is generated from intl/plural.y. It requires bison, | ||
434 | dnl because plural.y uses bison specific features. It requires at least | ||
435 | dnl bison-1.26 because earlier versions generate a plural.c that doesn't | ||
436 | dnl compile. | ||
437 | dnl bison is only needed for the maintainer (who touches plural.y). But in | ||
438 | dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put | ||
439 | dnl the rule in general Makefile. Now, some people carelessly touch the | ||
440 | dnl files or have a broken "make" program, hence the plural.c rule will | ||
441 | dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not | ||
442 | dnl present or too old. | ||
443 | AC_CHECK_PROGS([INTLBISON], [bison]) | ||
444 | if test -z "$INTLBISON"; then | ||
445 | ac_verc_fail=yes | ||
446 | else | ||
447 | dnl Found it, now check the version. | ||
448 | AC_MSG_CHECKING([version of bison]) | ||
449 | changequote(<<,>>)dnl | ||
450 | ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` | ||
451 | case $ac_prog_version in | ||
452 | '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; | ||
453 | 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) | ||
454 | changequote([,])dnl | ||
455 | ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; | ||
456 | *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; | ||
457 | esac | ||
458 | AC_MSG_RESULT([$ac_prog_version]) | ||
459 | fi | ||
460 | if test $ac_verc_fail = yes; then | ||
461 | INTLBISON=: | ||
462 | fi | ||
463 | ]) | 370 | ]) |
464 | 371 | ||
465 | 372 | ||
466 | dnl gt_CHECK_DECL(FUNC, INCLUDES) | 373 | dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) |
467 | dnl Check whether a function is declared. | 374 | AC_DEFUN([AM_GNU_GETTEXT_NEED], |
468 | AC_DEFUN([gt_CHECK_DECL], | ||
469 | [ | 375 | [ |
470 | AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, | 376 | m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) |
471 | [AC_TRY_COMPILE([$2], [ | ||
472 | #ifndef $1 | ||
473 | char *p = (char *) $1; | ||
474 | #endif | ||
475 | ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) | ||
476 | if test $ac_cv_have_decl_$1 = yes; then | ||
477 | gt_value=1 | ||
478 | else | ||
479 | gt_value=0 | ||
480 | fi | ||
481 | AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], | ||
482 | [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) | ||
483 | ]) | 377 | ]) |
484 | 378 | ||
485 | 379 | ||
diff --git a/m4/iconv.m4 b/m4/iconv.m4 index c5f35798..66bc76f4 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # iconv.m4 serial AM4 (gettext-0.11.3) | 1 | # iconv.m4 serial AM6 (gettext-0.17) |
2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | 8 | ||
@@ -23,6 +21,7 @@ AC_DEFUN([AM_ICONV_LINK], | |||
23 | [ | 21 | [ |
24 | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and | 22 | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and |
25 | dnl those with the standalone portable GNU libiconv installed). | 23 | dnl those with the standalone portable GNU libiconv installed). |
24 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles | ||
26 | 25 | ||
27 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV | 26 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV |
28 | dnl accordingly. | 27 | dnl accordingly. |
@@ -35,7 +34,7 @@ AC_DEFUN([AM_ICONV_LINK], | |||
35 | am_save_CPPFLAGS="$CPPFLAGS" | 34 | am_save_CPPFLAGS="$CPPFLAGS" |
36 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) | 35 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) |
37 | 36 | ||
38 | AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ | 37 | AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ |
39 | am_cv_func_iconv="no, consider installing GNU libiconv" | 38 | am_cv_func_iconv="no, consider installing GNU libiconv" |
40 | am_cv_lib_iconv=no | 39 | am_cv_lib_iconv=no |
41 | AC_TRY_LINK([#include <stdlib.h> | 40 | AC_TRY_LINK([#include <stdlib.h> |
@@ -58,7 +57,85 @@ AC_DEFUN([AM_ICONV_LINK], | |||
58 | fi | 57 | fi |
59 | ]) | 58 | ]) |
60 | if test "$am_cv_func_iconv" = yes; then | 59 | if test "$am_cv_func_iconv" = yes; then |
61 | AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) | 60 | AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ |
61 | dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. | ||
62 | am_save_LIBS="$LIBS" | ||
63 | if test $am_cv_lib_iconv = yes; then | ||
64 | LIBS="$LIBS $LIBICONV" | ||
65 | fi | ||
66 | AC_TRY_RUN([ | ||
67 | #include <iconv.h> | ||
68 | #include <string.h> | ||
69 | int main () | ||
70 | { | ||
71 | /* Test against AIX 5.1 bug: Failures are not distinguishable from successful | ||
72 | returns. */ | ||
73 | { | ||
74 | iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); | ||
75 | if (cd_utf8_to_88591 != (iconv_t)(-1)) | ||
76 | { | ||
77 | static const char input[] = "\342\202\254"; /* EURO SIGN */ | ||
78 | char buf[10]; | ||
79 | const char *inptr = input; | ||
80 | size_t inbytesleft = strlen (input); | ||
81 | char *outptr = buf; | ||
82 | size_t outbytesleft = sizeof (buf); | ||
83 | size_t res = iconv (cd_utf8_to_88591, | ||
84 | (char **) &inptr, &inbytesleft, | ||
85 | &outptr, &outbytesleft); | ||
86 | if (res == 0) | ||
87 | return 1; | ||
88 | } | ||
89 | } | ||
90 | #if 0 /* This bug could be worked around by the caller. */ | ||
91 | /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ | ||
92 | { | ||
93 | iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); | ||
94 | if (cd_88591_to_utf8 != (iconv_t)(-1)) | ||
95 | { | ||
96 | static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; | ||
97 | char buf[50]; | ||
98 | const char *inptr = input; | ||
99 | size_t inbytesleft = strlen (input); | ||
100 | char *outptr = buf; | ||
101 | size_t outbytesleft = sizeof (buf); | ||
102 | size_t res = iconv (cd_88591_to_utf8, | ||
103 | (char **) &inptr, &inbytesleft, | ||
104 | &outptr, &outbytesleft); | ||
105 | if ((int)res > 0) | ||
106 | return 1; | ||
107 | } | ||
108 | } | ||
109 | #endif | ||
110 | /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is | ||
111 | provided. */ | ||
112 | if (/* Try standardized names. */ | ||
113 | iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) | ||
114 | /* Try IRIX, OSF/1 names. */ | ||
115 | && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) | ||
116 | /* Try AIX names. */ | ||
117 | && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) | ||
118 | /* Try HP-UX names. */ | ||
119 | && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) | ||
120 | return 1; | ||
121 | return 0; | ||
122 | }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], | ||
123 | [case "$host_os" in | ||
124 | aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; | ||
125 | *) am_cv_func_iconv_works="guessing yes" ;; | ||
126 | esac]) | ||
127 | LIBS="$am_save_LIBS" | ||
128 | ]) | ||
129 | case "$am_cv_func_iconv_works" in | ||
130 | *no) am_func_iconv=no am_cv_lib_iconv=no ;; | ||
131 | *) am_func_iconv=yes ;; | ||
132 | esac | ||
133 | else | ||
134 | am_func_iconv=no am_cv_lib_iconv=no | ||
135 | fi | ||
136 | if test "$am_func_iconv" = yes; then | ||
137 | AC_DEFINE(HAVE_ICONV, 1, | ||
138 | [Define if you have the iconv() function and it works.]) | ||
62 | fi | 139 | fi |
63 | if test "$am_cv_lib_iconv" = yes; then | 140 | if test "$am_cv_lib_iconv" = yes; then |
64 | AC_MSG_CHECKING([how to link with libiconv]) | 141 | AC_MSG_CHECKING([how to link with libiconv]) |
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 index 38aeaec1..96c4e2c3 100644 --- a/m4/lib-ld.m4 +++ b/m4/lib-ld.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # lib-ld.m4 serial 3 (gettext-0.13) | 1 | # lib-ld.m4 serial 3 (gettext-0.13) |
2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl Subroutines of libtool.m4, | 7 | dnl Subroutines of libtool.m4, |
10 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision | 8 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision |
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 index eeb200d2..e3d26fc4 100644 --- a/m4/lib-link.m4 +++ b/m4/lib-link.m4 | |||
@@ -1,17 +1,19 @@ | |||
1 | # lib-link.m4 serial 4 (gettext-0.12) | 1 | # lib-link.m4 serial 13 (gettext-0.17) |
2 | dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | 8 | ||
9 | AC_PREREQ(2.54) | ||
10 | |||
11 | dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and | 11 | dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and |
12 | dnl the libraries corresponding to explicit and implicit dependencies. | 12 | dnl the libraries corresponding to explicit and implicit dependencies. |
13 | dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and | 13 | dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and |
14 | dnl augments the CPPFLAGS variable. | 14 | dnl augments the CPPFLAGS variable. |
15 | dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname | ||
16 | dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. | ||
15 | AC_DEFUN([AC_LIB_LINKFLAGS], | 17 | AC_DEFUN([AC_LIB_LINKFLAGS], |
16 | [ | 18 | [ |
17 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | 19 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
@@ -24,13 +26,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS], | |||
24 | ac_cv_lib[]Name[]_libs="$LIB[]NAME" | 26 | ac_cv_lib[]Name[]_libs="$LIB[]NAME" |
25 | ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" | 27 | ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" |
26 | ac_cv_lib[]Name[]_cppflags="$INC[]NAME" | 28 | ac_cv_lib[]Name[]_cppflags="$INC[]NAME" |
29 | ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" | ||
27 | ]) | 30 | ]) |
28 | LIB[]NAME="$ac_cv_lib[]Name[]_libs" | 31 | LIB[]NAME="$ac_cv_lib[]Name[]_libs" |
29 | LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" | 32 | LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" |
30 | INC[]NAME="$ac_cv_lib[]Name[]_cppflags" | 33 | INC[]NAME="$ac_cv_lib[]Name[]_cppflags" |
34 | LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" | ||
31 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) | 35 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
32 | AC_SUBST([LIB]NAME) | 36 | AC_SUBST([LIB]NAME) |
33 | AC_SUBST([LTLIB]NAME) | 37 | AC_SUBST([LTLIB]NAME) |
38 | AC_SUBST([LIB]NAME[_PREFIX]) | ||
34 | dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the | 39 | dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the |
35 | dnl results of this search when this library appears as a dependency. | 40 | dnl results of this search when this library appears as a dependency. |
36 | HAVE_LIB[]NAME=yes | 41 | HAVE_LIB[]NAME=yes |
@@ -46,6 +51,8 @@ dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and | |||
46 | dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and | 51 | dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and |
47 | dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs | 52 | dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs |
48 | dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. | 53 | dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. |
54 | dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname | ||
55 | dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. | ||
49 | AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], | 56 | AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], |
50 | [ | 57 | [ |
51 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | 58 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
@@ -82,19 +89,27 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], | |||
82 | CPPFLAGS="$ac_save_CPPFLAGS" | 89 | CPPFLAGS="$ac_save_CPPFLAGS" |
83 | LIB[]NAME= | 90 | LIB[]NAME= |
84 | LTLIB[]NAME= | 91 | LTLIB[]NAME= |
92 | LIB[]NAME[]_PREFIX= | ||
85 | fi | 93 | fi |
86 | AC_SUBST([HAVE_LIB]NAME) | 94 | AC_SUBST([HAVE_LIB]NAME) |
87 | AC_SUBST([LIB]NAME) | 95 | AC_SUBST([LIB]NAME) |
88 | AC_SUBST([LTLIB]NAME) | 96 | AC_SUBST([LTLIB]NAME) |
97 | AC_SUBST([LIB]NAME[_PREFIX]) | ||
89 | undefine([Name]) | 98 | undefine([Name]) |
90 | undefine([NAME]) | 99 | undefine([NAME]) |
91 | ]) | 100 | ]) |
92 | 101 | ||
93 | dnl Determine the platform dependent parameters needed to use rpath: | 102 | dnl Determine the platform dependent parameters needed to use rpath: |
94 | dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, | 103 | dnl acl_libext, |
95 | dnl hardcode_direct, hardcode_minus_L. | 104 | dnl acl_shlibext, |
105 | dnl acl_hardcode_libdir_flag_spec, | ||
106 | dnl acl_hardcode_libdir_separator, | ||
107 | dnl acl_hardcode_direct, | ||
108 | dnl acl_hardcode_minus_L. | ||
96 | AC_DEFUN([AC_LIB_RPATH], | 109 | AC_DEFUN([AC_LIB_RPATH], |
97 | [ | 110 | [ |
111 | dnl Tell automake >= 1.10 to complain if config.rpath is missing. | ||
112 | m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) | ||
98 | AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS | 113 | AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS |
99 | AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld | 114 | AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld |
100 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host | 115 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host |
@@ -107,12 +122,14 @@ AC_DEFUN([AC_LIB_RPATH], | |||
107 | acl_cv_rpath=done | 122 | acl_cv_rpath=done |
108 | ]) | 123 | ]) |
109 | wl="$acl_cv_wl" | 124 | wl="$acl_cv_wl" |
110 | libext="$acl_cv_libext" | 125 | acl_libext="$acl_cv_libext" |
111 | shlibext="$acl_cv_shlibext" | 126 | acl_shlibext="$acl_cv_shlibext" |
112 | hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" | 127 | acl_libname_spec="$acl_cv_libname_spec" |
113 | hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" | 128 | acl_library_names_spec="$acl_cv_library_names_spec" |
114 | hardcode_direct="$acl_cv_hardcode_direct" | 129 | acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" |
115 | hardcode_minus_L="$acl_cv_hardcode_minus_L" | 130 | acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" |
131 | acl_hardcode_direct="$acl_cv_hardcode_direct" | ||
132 | acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" | ||
116 | dnl Determine whether the user wants rpath handling at all. | 133 | dnl Determine whether the user wants rpath handling at all. |
117 | AC_ARG_ENABLE(rpath, | 134 | AC_ARG_ENABLE(rpath, |
118 | [ --disable-rpath do not hardcode runtime library paths], | 135 | [ --disable-rpath do not hardcode runtime library paths], |
@@ -122,19 +139,24 @@ AC_DEFUN([AC_LIB_RPATH], | |||
122 | dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and | 139 | dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and |
123 | dnl the libraries corresponding to explicit and implicit dependencies. | 140 | dnl the libraries corresponding to explicit and implicit dependencies. |
124 | dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. | 141 | dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. |
142 | dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found | ||
143 | dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. | ||
125 | AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | 144 | AC_DEFUN([AC_LIB_LINKFLAGS_BODY], |
126 | [ | 145 | [ |
146 | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) | ||
127 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | 147 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
128 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | 148 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
149 | dnl Autoconf >= 2.61 supports dots in --with options. | ||
150 | define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) | ||
129 | dnl By default, look in $includedir and $libdir. | 151 | dnl By default, look in $includedir and $libdir. |
130 | use_additional=yes | 152 | use_additional=yes |
131 | AC_LIB_WITH_FINAL_PREFIX([ | 153 | AC_LIB_WITH_FINAL_PREFIX([ |
132 | eval additional_includedir=\"$includedir\" | 154 | eval additional_includedir=\"$includedir\" |
133 | eval additional_libdir=\"$libdir\" | 155 | eval additional_libdir=\"$libdir\" |
134 | ]) | 156 | ]) |
135 | AC_LIB_ARG_WITH([lib$1-prefix], | 157 | AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], |
136 | [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib | 158 | [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib |
137 | --without-lib$1-prefix don't search for lib$1 in includedir and libdir], | 159 | --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], |
138 | [ | 160 | [ |
139 | if test "X$withval" = "Xno"; then | 161 | if test "X$withval" = "Xno"; then |
140 | use_additional=no | 162 | use_additional=no |
@@ -146,7 +168,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
146 | ]) | 168 | ]) |
147 | else | 169 | else |
148 | additional_includedir="$withval/include" | 170 | additional_includedir="$withval/include" |
149 | additional_libdir="$withval/lib" | 171 | additional_libdir="$withval/$acl_libdirstem" |
150 | fi | 172 | fi |
151 | fi | 173 | fi |
152 | ]) | 174 | ]) |
@@ -155,6 +177,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
155 | LIB[]NAME= | 177 | LIB[]NAME= |
156 | LTLIB[]NAME= | 178 | LTLIB[]NAME= |
157 | INC[]NAME= | 179 | INC[]NAME= |
180 | LIB[]NAME[]_PREFIX= | ||
158 | rpathdirs= | 181 | rpathdirs= |
159 | ltrpathdirs= | 182 | ltrpathdirs= |
160 | names_already_handled= | 183 | names_already_handled= |
@@ -194,22 +217,55 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
194 | found_la= | 217 | found_la= |
195 | found_so= | 218 | found_so= |
196 | found_a= | 219 | found_a= |
220 | eval libname=\"$acl_libname_spec\" # typically: libname=lib$name | ||
221 | if test -n "$acl_shlibext"; then | ||
222 | shrext=".$acl_shlibext" # typically: shrext=.so | ||
223 | else | ||
224 | shrext= | ||
225 | fi | ||
197 | if test $use_additional = yes; then | 226 | if test $use_additional = yes; then |
198 | if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then | 227 | dir="$additional_libdir" |
199 | found_dir="$additional_libdir" | 228 | dnl The same code as in the loop below: |
200 | found_so="$additional_libdir/lib$name.$shlibext" | 229 | dnl First look for a shared library. |
201 | if test -f "$additional_libdir/lib$name.la"; then | 230 | if test -n "$acl_shlibext"; then |
202 | found_la="$additional_libdir/lib$name.la" | 231 | if test -f "$dir/$libname$shrext"; then |
203 | fi | 232 | found_dir="$dir" |
204 | else | 233 | found_so="$dir/$libname$shrext" |
205 | if test -f "$additional_libdir/lib$name.$libext"; then | 234 | else |
206 | found_dir="$additional_libdir" | 235 | if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then |
207 | found_a="$additional_libdir/lib$name.$libext" | 236 | ver=`(cd "$dir" && \ |
208 | if test -f "$additional_libdir/lib$name.la"; then | 237 | for f in "$libname$shrext".*; do echo "$f"; done \ |
209 | found_la="$additional_libdir/lib$name.la" | 238 | | sed -e "s,^$libname$shrext\\\\.,," \ |
239 | | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | ||
240 | | sed 1q ) 2>/dev/null` | ||
241 | if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then | ||
242 | found_dir="$dir" | ||
243 | found_so="$dir/$libname$shrext.$ver" | ||
244 | fi | ||
245 | else | ||
246 | eval library_names=\"$acl_library_names_spec\" | ||
247 | for f in $library_names; do | ||
248 | if test -f "$dir/$f"; then | ||
249 | found_dir="$dir" | ||
250 | found_so="$dir/$f" | ||
251 | break | ||
252 | fi | ||
253 | done | ||
210 | fi | 254 | fi |
211 | fi | 255 | fi |
212 | fi | 256 | fi |
257 | dnl Then look for a static library. | ||
258 | if test "X$found_dir" = "X"; then | ||
259 | if test -f "$dir/$libname.$acl_libext"; then | ||
260 | found_dir="$dir" | ||
261 | found_a="$dir/$libname.$acl_libext" | ||
262 | fi | ||
263 | fi | ||
264 | if test "X$found_dir" != "X"; then | ||
265 | if test -f "$dir/$libname.la"; then | ||
266 | found_la="$dir/$libname.la" | ||
267 | fi | ||
268 | fi | ||
213 | fi | 269 | fi |
214 | if test "X$found_dir" = "X"; then | 270 | if test "X$found_dir" = "X"; then |
215 | for x in $LDFLAGS $LTLIB[]NAME; do | 271 | for x in $LDFLAGS $LTLIB[]NAME; do |
@@ -217,21 +273,46 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
217 | case "$x" in | 273 | case "$x" in |
218 | -L*) | 274 | -L*) |
219 | dir=`echo "X$x" | sed -e 's/^X-L//'` | 275 | dir=`echo "X$x" | sed -e 's/^X-L//'` |
220 | if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then | 276 | dnl First look for a shared library. |
221 | found_dir="$dir" | 277 | if test -n "$acl_shlibext"; then |
222 | found_so="$dir/lib$name.$shlibext" | 278 | if test -f "$dir/$libname$shrext"; then |
223 | if test -f "$dir/lib$name.la"; then | ||
224 | found_la="$dir/lib$name.la" | ||
225 | fi | ||
226 | else | ||
227 | if test -f "$dir/lib$name.$libext"; then | ||
228 | found_dir="$dir" | 279 | found_dir="$dir" |
229 | found_a="$dir/lib$name.$libext" | 280 | found_so="$dir/$libname$shrext" |
230 | if test -f "$dir/lib$name.la"; then | 281 | else |
231 | found_la="$dir/lib$name.la" | 282 | if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then |
283 | ver=`(cd "$dir" && \ | ||
284 | for f in "$libname$shrext".*; do echo "$f"; done \ | ||
285 | | sed -e "s,^$libname$shrext\\\\.,," \ | ||
286 | | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | ||
287 | | sed 1q ) 2>/dev/null` | ||
288 | if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then | ||
289 | found_dir="$dir" | ||
290 | found_so="$dir/$libname$shrext.$ver" | ||
291 | fi | ||
292 | else | ||
293 | eval library_names=\"$acl_library_names_spec\" | ||
294 | for f in $library_names; do | ||
295 | if test -f "$dir/$f"; then | ||
296 | found_dir="$dir" | ||
297 | found_so="$dir/$f" | ||
298 | break | ||
299 | fi | ||
300 | done | ||
232 | fi | 301 | fi |
233 | fi | 302 | fi |
234 | fi | 303 | fi |
304 | dnl Then look for a static library. | ||
305 | if test "X$found_dir" = "X"; then | ||
306 | if test -f "$dir/$libname.$acl_libext"; then | ||
307 | found_dir="$dir" | ||
308 | found_a="$dir/$libname.$acl_libext" | ||
309 | fi | ||
310 | fi | ||
311 | if test "X$found_dir" != "X"; then | ||
312 | if test -f "$dir/$libname.la"; then | ||
313 | found_la="$dir/$libname.la" | ||
314 | fi | ||
315 | fi | ||
235 | ;; | 316 | ;; |
236 | esac | 317 | esac |
237 | if test "X$found_dir" != "X"; then | 318 | if test "X$found_dir" != "X"; then |
@@ -246,7 +327,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
246 | dnl Linking with a shared library. We attempt to hardcode its | 327 | dnl Linking with a shared library. We attempt to hardcode its |
247 | dnl directory into the executable's runpath, unless it's the | 328 | dnl directory into the executable's runpath, unless it's the |
248 | dnl standard /usr/lib. | 329 | dnl standard /usr/lib. |
249 | if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then | 330 | if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then |
250 | dnl No hardcoding is needed. | 331 | dnl No hardcoding is needed. |
251 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | 332 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
252 | else | 333 | else |
@@ -265,12 +346,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
265 | ltrpathdirs="$ltrpathdirs $found_dir" | 346 | ltrpathdirs="$ltrpathdirs $found_dir" |
266 | fi | 347 | fi |
267 | dnl The hardcoding into $LIBNAME is system dependent. | 348 | dnl The hardcoding into $LIBNAME is system dependent. |
268 | if test "$hardcode_direct" = yes; then | 349 | if test "$acl_hardcode_direct" = yes; then |
269 | dnl Using DIR/libNAME.so during linking hardcodes DIR into the | 350 | dnl Using DIR/libNAME.so during linking hardcodes DIR into the |
270 | dnl resulting binary. | 351 | dnl resulting binary. |
271 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | 352 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
272 | else | 353 | else |
273 | if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then | 354 | if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then |
274 | dnl Use an explicit option to hardcode DIR into the resulting | 355 | dnl Use an explicit option to hardcode DIR into the resulting |
275 | dnl binary. | 356 | dnl binary. |
276 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | 357 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
@@ -301,13 +382,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
301 | if test -z "$haveit"; then | 382 | if test -z "$haveit"; then |
302 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" | 383 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" |
303 | fi | 384 | fi |
304 | if test "$hardcode_minus_L" != no; then | 385 | if test "$acl_hardcode_minus_L" != no; then |
305 | dnl FIXME: Not sure whether we should use | 386 | dnl FIXME: Not sure whether we should use |
306 | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" | 387 | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
307 | dnl here. | 388 | dnl here. |
308 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | 389 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
309 | else | 390 | else |
310 | dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH | 391 | dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH |
311 | dnl here, because this doesn't fit in flags passed to the | 392 | dnl here, because this doesn't fit in flags passed to the |
312 | dnl compiler. So give up. No hardcoding. This affects only | 393 | dnl compiler. So give up. No hardcoding. This affects only |
313 | dnl very old systems. | 394 | dnl very old systems. |
@@ -332,8 +413,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
332 | dnl Assume the include files are nearby. | 413 | dnl Assume the include files are nearby. |
333 | additional_includedir= | 414 | additional_includedir= |
334 | case "$found_dir" in | 415 | case "$found_dir" in |
335 | */lib | */lib/) | 416 | */$acl_libdirstem | */$acl_libdirstem/) |
336 | basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` | 417 | basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` |
418 | LIB[]NAME[]_PREFIX="$basedir" | ||
337 | additional_includedir="$basedir/include" | 419 | additional_includedir="$basedir/include" |
338 | ;; | 420 | ;; |
339 | esac | 421 | esac |
@@ -350,7 +432,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
350 | if test "X$additional_includedir" = "X/usr/local/include"; then | 432 | if test "X$additional_includedir" = "X/usr/local/include"; then |
351 | if test -n "$GCC"; then | 433 | if test -n "$GCC"; then |
352 | case $host_os in | 434 | case $host_os in |
353 | linux*) haveit=yes;; | 435 | linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
354 | esac | 436 | esac |
355 | fi | 437 | fi |
356 | fi | 438 | fi |
@@ -394,12 +476,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
394 | dnl 3. if it's already present in $LDFLAGS or the already | 476 | dnl 3. if it's already present in $LDFLAGS or the already |
395 | dnl constructed $LIBNAME, | 477 | dnl constructed $LIBNAME, |
396 | dnl 4. if it doesn't exist as a directory. | 478 | dnl 4. if it doesn't exist as a directory. |
397 | if test "X$additional_libdir" != "X/usr/lib"; then | 479 | if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then |
398 | haveit= | 480 | haveit= |
399 | if test "X$additional_libdir" = "X/usr/local/lib"; then | 481 | if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then |
400 | if test -n "$GCC"; then | 482 | if test -n "$GCC"; then |
401 | case $host_os in | 483 | case $host_os in |
402 | linux*) haveit=yes;; | 484 | linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
403 | esac | 485 | esac |
404 | fi | 486 | fi |
405 | fi | 487 | fi |
@@ -495,18 +577,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
495 | done | 577 | done |
496 | done | 578 | done |
497 | if test "X$rpathdirs" != "X"; then | 579 | if test "X$rpathdirs" != "X"; then |
498 | if test -n "$hardcode_libdir_separator"; then | 580 | if test -n "$acl_hardcode_libdir_separator"; then |
499 | dnl Weird platform: only the last -rpath option counts, the user must | 581 | dnl Weird platform: only the last -rpath option counts, the user must |
500 | dnl pass all path elements in one option. We can arrange that for a | 582 | dnl pass all path elements in one option. We can arrange that for a |
501 | dnl single library, but not when more than one $LIBNAMEs are used. | 583 | dnl single library, but not when more than one $LIBNAMEs are used. |
502 | alldirs= | 584 | alldirs= |
503 | for found_dir in $rpathdirs; do | 585 | for found_dir in $rpathdirs; do |
504 | alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" | 586 | alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" |
505 | done | 587 | done |
506 | dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. | 588 | dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. |
507 | acl_save_libdir="$libdir" | 589 | acl_save_libdir="$libdir" |
508 | libdir="$alldirs" | 590 | libdir="$alldirs" |
509 | eval flag=\"$hardcode_libdir_flag_spec\" | 591 | eval flag=\"$acl_hardcode_libdir_flag_spec\" |
510 | libdir="$acl_save_libdir" | 592 | libdir="$acl_save_libdir" |
511 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | 593 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
512 | else | 594 | else |
@@ -514,7 +596,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | |||
514 | for found_dir in $rpathdirs; do | 596 | for found_dir in $rpathdirs; do |
515 | acl_save_libdir="$libdir" | 597 | acl_save_libdir="$libdir" |
516 | libdir="$found_dir" | 598 | libdir="$found_dir" |
517 | eval flag=\"$hardcode_libdir_flag_spec\" | 599 | eval flag=\"$acl_hardcode_libdir_flag_spec\" |
518 | libdir="$acl_save_libdir" | 600 | libdir="$acl_save_libdir" |
519 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | 601 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
520 | done | 602 | done |
@@ -549,3 +631,79 @@ AC_DEFUN([AC_LIB_APPENDTOVAR], | |||
549 | fi | 631 | fi |
550 | done | 632 | done |
551 | ]) | 633 | ]) |
634 | |||
635 | dnl For those cases where a variable contains several -L and -l options | ||
636 | dnl referring to unknown libraries and directories, this macro determines the | ||
637 | dnl necessary additional linker options for the runtime path. | ||
638 | dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) | ||
639 | dnl sets LDADDVAR to linker options needed together with LIBSVALUE. | ||
640 | dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, | ||
641 | dnl otherwise linking without libtool is assumed. | ||
642 | AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], | ||
643 | [ | ||
644 | AC_REQUIRE([AC_LIB_RPATH]) | ||
645 | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) | ||
646 | $1= | ||
647 | if test "$enable_rpath" != no; then | ||
648 | if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then | ||
649 | dnl Use an explicit option to hardcode directories into the resulting | ||
650 | dnl binary. | ||
651 | rpathdirs= | ||
652 | next= | ||
653 | for opt in $2; do | ||
654 | if test -n "$next"; then | ||
655 | dir="$next" | ||
656 | dnl No need to hardcode the standard /usr/lib. | ||
657 | if test "X$dir" != "X/usr/$acl_libdirstem"; then | ||
658 | rpathdirs="$rpathdirs $dir" | ||
659 | fi | ||
660 | next= | ||
661 | else | ||
662 | case $opt in | ||
663 | -L) next=yes ;; | ||
664 | -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` | ||
665 | dnl No need to hardcode the standard /usr/lib. | ||
666 | if test "X$dir" != "X/usr/$acl_libdirstem"; then | ||
667 | rpathdirs="$rpathdirs $dir" | ||
668 | fi | ||
669 | next= ;; | ||
670 | *) next= ;; | ||
671 | esac | ||
672 | fi | ||
673 | done | ||
674 | if test "X$rpathdirs" != "X"; then | ||
675 | if test -n ""$3""; then | ||
676 | dnl libtool is used for linking. Use -R options. | ||
677 | for dir in $rpathdirs; do | ||
678 | $1="${$1}${$1:+ }-R$dir" | ||
679 | done | ||
680 | else | ||
681 | dnl The linker is used for linking directly. | ||
682 | if test -n "$acl_hardcode_libdir_separator"; then | ||
683 | dnl Weird platform: only the last -rpath option counts, the user | ||
684 | dnl must pass all path elements in one option. | ||
685 | alldirs= | ||
686 | for dir in $rpathdirs; do | ||
687 | alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" | ||
688 | done | ||
689 | acl_save_libdir="$libdir" | ||
690 | libdir="$alldirs" | ||
691 | eval flag=\"$acl_hardcode_libdir_flag_spec\" | ||
692 | libdir="$acl_save_libdir" | ||
693 | $1="$flag" | ||
694 | else | ||
695 | dnl The -rpath options are cumulative. | ||
696 | for dir in $rpathdirs; do | ||
697 | acl_save_libdir="$libdir" | ||
698 | libdir="$dir" | ||
699 | eval flag=\"$acl_hardcode_libdir_flag_spec\" | ||
700 | libdir="$acl_save_libdir" | ||
701 | $1="${$1}${$1:+ }$flag" | ||
702 | done | ||
703 | fi | ||
704 | fi | ||
705 | fi | ||
706 | fi | ||
707 | fi | ||
708 | AC_SUBST([$1]) | ||
709 | ]) | ||
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 index 8aff5a9d..a8684e17 100644 --- a/m4/lib-prefix.m4 +++ b/m4/lib-prefix.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # lib-prefix.m4 serial 3 (gettext-0.13) | 1 | # lib-prefix.m4 serial 5 (gettext-0.15) |
2 | dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | 8 | ||
@@ -26,6 +24,7 @@ AC_DEFUN([AC_LIB_PREFIX], | |||
26 | AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) | 24 | AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) |
27 | AC_REQUIRE([AC_PROG_CC]) | 25 | AC_REQUIRE([AC_PROG_CC]) |
28 | AC_REQUIRE([AC_CANONICAL_HOST]) | 26 | AC_REQUIRE([AC_CANONICAL_HOST]) |
27 | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) | ||
29 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | 28 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
30 | dnl By default, look in $includedir and $libdir. | 29 | dnl By default, look in $includedir and $libdir. |
31 | use_additional=yes | 30 | use_additional=yes |
@@ -47,7 +46,7 @@ AC_DEFUN([AC_LIB_PREFIX], | |||
47 | ]) | 46 | ]) |
48 | else | 47 | else |
49 | additional_includedir="$withval/include" | 48 | additional_includedir="$withval/include" |
50 | additional_libdir="$withval/lib" | 49 | additional_libdir="$withval/$acl_libdirstem" |
51 | fi | 50 | fi |
52 | fi | 51 | fi |
53 | ]) | 52 | ]) |
@@ -71,7 +70,7 @@ AC_DEFUN([AC_LIB_PREFIX], | |||
71 | if test "X$additional_includedir" = "X/usr/local/include"; then | 70 | if test "X$additional_includedir" = "X/usr/local/include"; then |
72 | if test -n "$GCC"; then | 71 | if test -n "$GCC"; then |
73 | case $host_os in | 72 | case $host_os in |
74 | linux*) haveit=yes;; | 73 | linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
75 | esac | 74 | esac |
76 | fi | 75 | fi |
77 | fi | 76 | fi |
@@ -89,7 +88,7 @@ AC_DEFUN([AC_LIB_PREFIX], | |||
89 | dnl 2. if it's already present in $LDFLAGS, | 88 | dnl 2. if it's already present in $LDFLAGS, |
90 | dnl 3. if it's /usr/local/lib and we are using GCC on Linux, | 89 | dnl 3. if it's /usr/local/lib and we are using GCC on Linux, |
91 | dnl 4. if it doesn't exist as a directory. | 90 | dnl 4. if it doesn't exist as a directory. |
92 | if test "X$additional_libdir" != "X/usr/lib"; then | 91 | if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then |
93 | haveit= | 92 | haveit= |
94 | for x in $LDFLAGS; do | 93 | for x in $LDFLAGS; do |
95 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | 94 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
@@ -99,7 +98,7 @@ AC_DEFUN([AC_LIB_PREFIX], | |||
99 | fi | 98 | fi |
100 | done | 99 | done |
101 | if test -z "$haveit"; then | 100 | if test -z "$haveit"; then |
102 | if test "X$additional_libdir" = "X/usr/local/lib"; then | 101 | if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then |
103 | if test -n "$GCC"; then | 102 | if test -n "$GCC"; then |
104 | case $host_os in | 103 | case $host_os in |
105 | linux*) haveit=yes;; | 104 | linux*) haveit=yes;; |
@@ -153,3 +152,34 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], | |||
153 | exec_prefix="$acl_save_exec_prefix" | 152 | exec_prefix="$acl_save_exec_prefix" |
154 | prefix="$acl_save_prefix" | 153 | prefix="$acl_save_prefix" |
155 | ]) | 154 | ]) |
155 | |||
156 | dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing | ||
157 | dnl the basename of the libdir, either "lib" or "lib64". | ||
158 | AC_DEFUN([AC_LIB_PREPARE_MULTILIB], | ||
159 | [ | ||
160 | dnl There is no formal standard regarding lib and lib64. The current | ||
161 | dnl practice is that on a system supporting 32-bit and 64-bit instruction | ||
162 | dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit | ||
163 | dnl libraries go under $prefix/lib. We determine the compiler's default | ||
164 | dnl mode by looking at the compiler's library search path. If at least | ||
165 | dnl of its elements ends in /lib64 or points to a directory whose absolute | ||
166 | dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the | ||
167 | dnl default, namely "lib". | ||
168 | acl_libdirstem=lib | ||
169 | searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` | ||
170 | if test -n "$searchpath"; then | ||
171 | acl_save_IFS="${IFS= }"; IFS=":" | ||
172 | for searchdir in $searchpath; do | ||
173 | if test -d "$searchdir"; then | ||
174 | case "$searchdir" in | ||
175 | */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; | ||
176 | *) searchdir=`cd "$searchdir" && pwd` | ||
177 | case "$searchdir" in | ||
178 | */lib64 ) acl_libdirstem=lib64 ;; | ||
179 | esac ;; | ||
180 | esac | ||
181 | fi | ||
182 | done | ||
183 | IFS="$acl_save_IFS" | ||
184 | fi | ||
185 | ]) | ||
@@ -1,10 +1,8 @@ | |||
1 | # nls.m4 serial 1 (gettext-0.12) | 1 | # nls.m4 serial 3 (gettext-0.15) |
2 | dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | dnl | 6 | dnl |
9 | dnl This file can can be used in projects which are not available under | 7 | dnl This file can can be used in projects which are not available under |
10 | dnl the GNU General Public License or the GNU Library General Public | 8 | dnl the GNU General Public License or the GNU Library General Public |
@@ -19,6 +17,8 @@ dnl Authors: | |||
19 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. | 17 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. |
20 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. | 18 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. |
21 | 19 | ||
20 | AC_PREREQ(2.50) | ||
21 | |||
22 | AC_DEFUN([AM_NLS], | 22 | AC_DEFUN([AM_NLS], |
23 | [ | 23 | [ |
24 | AC_MSG_CHECKING([whether NLS is requested]) | 24 | AC_MSG_CHECKING([whether NLS is requested]) |
@@ -29,21 +29,3 @@ AC_DEFUN([AM_NLS], | |||
29 | AC_MSG_RESULT($USE_NLS) | 29 | AC_MSG_RESULT($USE_NLS) |
30 | AC_SUBST(USE_NLS) | 30 | AC_SUBST(USE_NLS) |
31 | ]) | 31 | ]) |
32 | |||
33 | AC_DEFUN([AM_MKINSTALLDIRS], | ||
34 | [ | ||
35 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly | ||
36 | dnl find the mkinstalldirs script in another subdir but $(top_srcdir). | ||
37 | dnl Try to locate it. | ||
38 | MKINSTALLDIRS= | ||
39 | if test -n "$ac_aux_dir"; then | ||
40 | case "$ac_aux_dir" in | ||
41 | /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; | ||
42 | *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; | ||
43 | esac | ||
44 | fi | ||
45 | if test -z "$MKINSTALLDIRS"; then | ||
46 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" | ||
47 | fi | ||
48 | AC_SUBST(MKINSTALLDIRS) | ||
49 | ]) | ||
@@ -1,10 +1,8 @@ | |||
1 | # po.m4 serial 2 (gettext-0.13) | 1 | # po.m4 serial 15 (gettext-0.17) |
2 | dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | dnl | 6 | dnl |
9 | dnl This file can can be used in projects which are not available under | 7 | dnl This file can can be used in projects which are not available under |
10 | dnl the GNU General Public License or the GNU Library General Public | 8 | dnl the GNU General Public License or the GNU Library General Public |
@@ -19,14 +17,20 @@ dnl Authors: | |||
19 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. | 17 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. |
20 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. | 18 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. |
21 | 19 | ||
20 | AC_PREREQ(2.50) | ||
21 | |||
22 | dnl Checks for all prerequisites of the po subdirectory. | 22 | dnl Checks for all prerequisites of the po subdirectory. |
23 | AC_DEFUN([AM_PO_SUBDIRS], | 23 | AC_DEFUN([AM_PO_SUBDIRS], |
24 | [ | 24 | [ |
25 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl | 25 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
26 | AC_REQUIRE([AC_PROG_INSTALL])dnl | 26 | AC_REQUIRE([AC_PROG_INSTALL])dnl |
27 | AC_REQUIRE([AM_MKINSTALLDIRS])dnl | 27 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake |
28 | AC_REQUIRE([AM_NLS])dnl | 28 | AC_REQUIRE([AM_NLS])dnl |
29 | 29 | ||
30 | dnl Release version of the gettext macros. This is used to ensure that | ||
31 | dnl the gettext macros and po/Makefile.in.in are in sync. | ||
32 | AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) | ||
33 | |||
30 | dnl Perform the following tests also if --disable-nls has been given, | 34 | dnl Perform the following tests also if --disable-nls has been given, |
31 | dnl because they are needed for "make dist" to work. | 35 | dnl because they are needed for "make dist" to work. |
32 | 36 | ||
@@ -34,59 +38,61 @@ AC_DEFUN([AM_PO_SUBDIRS], | |||
34 | dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. | 38 | dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. |
35 | dnl The second test excludes FreeBSD msgfmt. | 39 | dnl The second test excludes FreeBSD msgfmt. |
36 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | 40 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, |
37 | [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && | 41 | [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && |
38 | (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], | 42 | (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], |
39 | :) | 43 | :) |
40 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | 44 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) |
41 | 45 | ||
46 | dnl Test whether it is GNU msgfmt >= 0.15. | ||
47 | changequote(,)dnl | ||
48 | case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in | ||
49 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; | ||
50 | *) MSGFMT_015=$MSGFMT ;; | ||
51 | esac | ||
52 | changequote([,])dnl | ||
53 | AC_SUBST([MSGFMT_015]) | ||
54 | changequote(,)dnl | ||
55 | case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in | ||
56 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; | ||
57 | *) GMSGFMT_015=$GMSGFMT ;; | ||
58 | esac | ||
59 | changequote([,])dnl | ||
60 | AC_SUBST([GMSGFMT_015]) | ||
61 | |||
42 | dnl Search for GNU xgettext 0.12 or newer in the PATH. | 62 | dnl Search for GNU xgettext 0.12 or newer in the PATH. |
43 | dnl The first test excludes Solaris xgettext and early GNU xgettext versions. | 63 | dnl The first test excludes Solaris xgettext and early GNU xgettext versions. |
44 | dnl The second test excludes FreeBSD xgettext. | 64 | dnl The second test excludes FreeBSD xgettext. |
45 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | 65 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
46 | [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && | 66 | [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && |
47 | (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], | 67 | (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], |
48 | :) | 68 | :) |
49 | dnl Remove leftover from FreeBSD xgettext call. | 69 | dnl Remove leftover from FreeBSD xgettext call. |
50 | rm -f messages.po | 70 | rm -f messages.po |
51 | 71 | ||
72 | dnl Test whether it is GNU xgettext >= 0.15. | ||
73 | changequote(,)dnl | ||
74 | case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in | ||
75 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; | ||
76 | *) XGETTEXT_015=$XGETTEXT ;; | ||
77 | esac | ||
78 | changequote([,])dnl | ||
79 | AC_SUBST([XGETTEXT_015]) | ||
80 | |||
52 | dnl Search for GNU msgmerge 0.11 or newer in the PATH. | 81 | dnl Search for GNU msgmerge 0.11 or newer in the PATH. |
53 | AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, | 82 | AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, |
54 | [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) | 83 | [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) |
55 | 84 | ||
56 | dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. | 85 | dnl Installation directories. |
57 | dnl Test whether we really found GNU msgfmt. | 86 | dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we |
58 | if test "$GMSGFMT" != ":"; then | 87 | dnl have to define it here, so that it can be used in po/Makefile. |
59 | dnl If it is no GNU msgfmt we define it as : so that the | 88 | test -n "$localedir" || localedir='${datadir}/locale' |
60 | dnl Makefiles still can work. | 89 | AC_SUBST([localedir]) |
61 | if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && | ||
62 | (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then | ||
63 | : ; | ||
64 | else | ||
65 | GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` | ||
66 | AC_MSG_RESULT( | ||
67 | [found $GMSGFMT program is not GNU msgfmt; ignore it]) | ||
68 | GMSGFMT=":" | ||
69 | fi | ||
70 | fi | ||
71 | 90 | ||
72 | dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. | 91 | dnl Support for AM_XGETTEXT_OPTION. |
73 | dnl Test whether we really found GNU xgettext. | 92 | test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= |
74 | if test "$XGETTEXT" != ":"; then | 93 | AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) |
75 | dnl If it is no GNU xgettext we define it as : so that the | ||
76 | dnl Makefiles still can work. | ||
77 | if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && | ||
78 | (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then | ||
79 | : ; | ||
80 | else | ||
81 | AC_MSG_RESULT( | ||
82 | [found xgettext program is not GNU xgettext; ignore it]) | ||
83 | XGETTEXT=":" | ||
84 | fi | ||
85 | dnl Remove leftover from FreeBSD xgettext call. | ||
86 | rm -f messages.po | ||
87 | fi | ||
88 | 94 | ||
89 | AC_OUTPUT_COMMANDS([ | 95 | AC_CONFIG_COMMANDS([po-directories], [[ |
90 | for ac_file in $CONFIG_FILES; do | 96 | for ac_file in $CONFIG_FILES; do |
91 | # Support "outfile[:infile[:infile...]]" | 97 | # Support "outfile[:infile[:infile...]]" |
92 | case "$ac_file" in | 98 | case "$ac_file" in |
@@ -106,6 +112,9 @@ AC_DEFUN([AM_PO_SUBDIRS], | |||
106 | /*) top_srcdir="$ac_given_srcdir" ;; | 112 | /*) top_srcdir="$ac_given_srcdir" ;; |
107 | *) top_srcdir="$ac_dots$ac_given_srcdir" ;; | 113 | *) top_srcdir="$ac_dots$ac_given_srcdir" ;; |
108 | esac | 114 | esac |
115 | # Treat a directory as a PO directory if and only if it has a | ||
116 | # POTFILES.in file. This allows packages to have multiple PO | ||
117 | # directories under different names or in different locations. | ||
109 | if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then | 118 | if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then |
110 | rm -f "$ac_dir/POTFILES" | 119 | rm -f "$ac_dir/POTFILES" |
111 | test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" | 120 | test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" |
@@ -119,12 +128,13 @@ AC_DEFUN([AM_PO_SUBDIRS], | |||
119 | if test -n "$OBSOLETE_ALL_LINGUAS"; then | 128 | if test -n "$OBSOLETE_ALL_LINGUAS"; then |
120 | test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" | 129 | test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" |
121 | fi | 130 | fi |
122 | ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` | 131 | ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` |
123 | # Hide the ALL_LINGUAS assigment from automake. | 132 | # Hide the ALL_LINGUAS assigment from automake < 1.5. |
124 | eval 'ALL_LINGUAS''=$ALL_LINGUAS_' | 133 | eval 'ALL_LINGUAS''=$ALL_LINGUAS_' |
125 | POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" | 134 | POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" |
126 | else | 135 | else |
127 | # The set of available languages was given in configure.in. | 136 | # The set of available languages was given in configure.in. |
137 | # Hide the ALL_LINGUAS assigment from automake < 1.5. | ||
128 | eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' | 138 | eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' |
129 | fi | 139 | fi |
130 | # Compute POFILES | 140 | # Compute POFILES |
@@ -194,10 +204,10 @@ AC_DEFUN([AM_PO_SUBDIRS], | |||
194 | fi | 204 | fi |
195 | ;; | 205 | ;; |
196 | esac | 206 | esac |
197 | done], | 207 | done]], |
198 | [# Capture the value of obsolete ALL_LINGUAS because we need it to compute | 208 | [# Capture the value of obsolete ALL_LINGUAS because we need it to compute |
199 | # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it | 209 | # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it |
200 | # from automake. | 210 | # from automake < 1.5. |
201 | eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' | 211 | eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' |
202 | # Capture the value of LINGUAS because we need it to compute CATALOGS. | 212 | # Capture the value of LINGUAS because we need it to compute CATALOGS. |
203 | LINGUAS="${LINGUAS-%UNSET%}" | 213 | LINGUAS="${LINGUAS-%UNSET%}" |
@@ -283,7 +293,7 @@ x | |||
283 | changequote([,])dnl | 293 | changequote([,])dnl |
284 | 294 | ||
285 | # Set POTFILES to the value of the Makefile variable POTFILES. | 295 | # Set POTFILES to the value of the Makefile variable POTFILES. |
286 | sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`" | 296 | sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'` |
287 | POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` | 297 | POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` |
288 | # Compute POTFILES_DEPS as | 298 | # Compute POTFILES_DEPS as |
289 | # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) | 299 | # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) |
@@ -298,14 +308,14 @@ changequote([,])dnl | |||
298 | fi | 308 | fi |
299 | if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then | 309 | if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then |
300 | # The LINGUAS file contains the set of available languages. | 310 | # The LINGUAS file contains the set of available languages. |
301 | ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` | 311 | ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` |
302 | POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" | 312 | POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" |
303 | else | 313 | else |
304 | # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. | 314 | # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. |
305 | sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`" | 315 | sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` |
306 | ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` | 316 | ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` |
307 | fi | 317 | fi |
308 | # Hide the ALL_LINGUAS assigment from automake. | 318 | # Hide the ALL_LINGUAS assigment from automake < 1.5. |
309 | eval 'ALL_LINGUAS''=$ALL_LINGUAS_' | 319 | eval 'ALL_LINGUAS''=$ALL_LINGUAS_' |
310 | # Compute POFILES | 320 | # Compute POFILES |
311 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) | 321 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) |
@@ -323,6 +333,8 @@ changequote([,])dnl | |||
323 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) | 333 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) |
324 | # Compute MSGFILES | 334 | # Compute MSGFILES |
325 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) | 335 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) |
336 | # Compute RESOURCESDLLFILES | ||
337 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) | ||
326 | case "$ac_given_srcdir" in | 338 | case "$ac_given_srcdir" in |
327 | .) srcdirpre= ;; | 339 | .) srcdirpre= ;; |
328 | *) srcdirpre='$(srcdir)/' ;; | 340 | *) srcdirpre='$(srcdir)/' ;; |
@@ -335,6 +347,7 @@ changequote([,])dnl | |||
335 | CLASSFILES= | 347 | CLASSFILES= |
336 | QMFILES= | 348 | QMFILES= |
337 | MSGFILES= | 349 | MSGFILES= |
350 | RESOURCESDLLFILES= | ||
338 | for lang in $ALL_LINGUAS; do | 351 | for lang in $ALL_LINGUAS; do |
339 | POFILES="$POFILES $srcdirpre$lang.po" | 352 | POFILES="$POFILES $srcdirpre$lang.po" |
340 | UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" | 353 | UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" |
@@ -345,6 +358,8 @@ changequote([,])dnl | |||
345 | QMFILES="$QMFILES $srcdirpre$lang.qm" | 358 | QMFILES="$QMFILES $srcdirpre$lang.qm" |
346 | frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | 359 | frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
347 | MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" | 360 | MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" |
361 | frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` | ||
362 | RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll" | ||
348 | done | 363 | done |
349 | # CATALOGS depends on both $ac_dir and the user's LINGUAS | 364 | # CATALOGS depends on both $ac_dir and the user's LINGUAS |
350 | # environment variable. | 365 | # environment variable. |
@@ -376,6 +391,7 @@ changequote([,])dnl | |||
376 | JAVACATALOGS= | 391 | JAVACATALOGS= |
377 | QTCATALOGS= | 392 | QTCATALOGS= |
378 | TCLCATALOGS= | 393 | TCLCATALOGS= |
394 | CSHARPCATALOGS= | ||
379 | if test -n "$INST_LINGUAS"; then | 395 | if test -n "$INST_LINGUAS"; then |
380 | for lang in $INST_LINGUAS; do | 396 | for lang in $INST_LINGUAS; do |
381 | CATALOGS="$CATALOGS $lang.gmo" | 397 | CATALOGS="$CATALOGS $lang.gmo" |
@@ -383,10 +399,12 @@ changequote([,])dnl | |||
383 | QTCATALOGS="$QTCATALOGS $lang.qm" | 399 | QTCATALOGS="$QTCATALOGS $lang.qm" |
384 | frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | 400 | frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
385 | TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg" | 401 | TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg" |
402 | frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` | ||
403 | CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll" | ||
386 | done | 404 | done |
387 | fi | 405 | fi |
388 | 406 | ||
389 | sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" | 407 | sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" |
390 | if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then | 408 | if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then |
391 | # Add dependencies that cannot be formulated as a simple suffix rule. | 409 | # Add dependencies that cannot be formulated as a simple suffix rule. |
392 | for lang in $ALL_LINGUAS; do | 410 | for lang in $ALL_LINGUAS; do |
@@ -398,6 +416,17 @@ $frobbedlang.msg: $lang.po | |||
398 | EOF | 416 | EOF |
399 | done | 417 | done |
400 | fi | 418 | fi |
419 | if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then | ||
420 | # Add dependencies that cannot be formulated as a simple suffix rule. | ||
421 | for lang in $ALL_LINGUAS; do | ||
422 | frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` | ||
423 | cat >> "$ac_file.tmp" <<EOF | ||
424 | $frobbedlang/\$(DOMAIN).resources.dll: $lang.po | ||
425 | @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ | ||
426 | \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } | ||
427 | EOF | ||
428 | done | ||
429 | fi | ||
401 | if test -n "$POMAKEFILEDEPS"; then | 430 | if test -n "$POMAKEFILEDEPS"; then |
402 | cat >> "$ac_file.tmp" <<EOF | 431 | cat >> "$ac_file.tmp" <<EOF |
403 | Makefile: $POMAKEFILEDEPS | 432 | Makefile: $POMAKEFILEDEPS |
@@ -405,3 +434,16 @@ EOF | |||
405 | fi | 434 | fi |
406 | mv "$ac_file.tmp" "$ac_file" | 435 | mv "$ac_file.tmp" "$ac_file" |
407 | ]) | 436 | ]) |
437 | |||
438 | dnl Initializes the accumulator used by AM_XGETTEXT_OPTION. | ||
439 | AC_DEFUN([AM_XGETTEXT_OPTION_INIT], | ||
440 | [ | ||
441 | XGETTEXT_EXTRA_OPTIONS= | ||
442 | ]) | ||
443 | |||
444 | dnl Registers an option to be passed to xgettext in the po subdirectory. | ||
445 | AC_DEFUN([AM_XGETTEXT_OPTION], | ||
446 | [ | ||
447 | AC_REQUIRE([AM_XGETTEXT_OPTION_INIT]) | ||
448 | XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1" | ||
449 | ]) | ||
diff --git a/m4/progtest.m4 b/m4/progtest.m4 index 8fe527ce..a56365cd 100644 --- a/m4/progtest.m4 +++ b/m4/progtest.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # progtest.m4 serial 3 (gettext-0.12) | 1 | # progtest.m4 serial 4 (gettext-0.14.2) |
2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | dnl | 6 | dnl |
9 | dnl This file can can be used in projects which are not available under | 7 | dnl This file can can be used in projects which are not available under |
10 | dnl the GNU General Public License or the GNU Library General Public | 8 | dnl the GNU General Public License or the GNU Library General Public |
@@ -18,6 +16,8 @@ dnl They are *not* in the public domain. | |||
18 | dnl Authors: | 16 | dnl Authors: |
19 | dnl Ulrich Drepper <drepper@cygnus.com>, 1996. | 17 | dnl Ulrich Drepper <drepper@cygnus.com>, 1996. |
20 | 18 | ||
19 | AC_PREREQ(2.50) | ||
20 | |||
21 | # Search path for a program which passes the given test. | 21 | # Search path for a program which passes the given test. |
22 | 22 | ||
23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | 23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, |
@@ -67,6 +67,7 @@ AC_CACHE_VAL(ac_cv_path_$1, | |||
67 | test -z "$ac_dir" && ac_dir=. | 67 | test -z "$ac_dir" && ac_dir=. |
68 | for ac_exec_ext in '' $ac_executable_extensions; do | 68 | for ac_exec_ext in '' $ac_executable_extensions; do |
69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then | 69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then |
70 | echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD | ||
70 | if [$3]; then | 71 | if [$3]; then |
71 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" | 72 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" |
72 | break 2 | 73 | break 2 |