| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
AC_DEFUN([AM_GNU_GETTEXT], |
|---|
| 58 |
[ |
|---|
| 59 |
|
|---|
| 60 |
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , |
|---|
| 61 |
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT |
|---|
| 62 |
])])])])]) |
|---|
| 63 |
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
|---|
| 64 |
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
|---|
| 65 |
])])])]) |
|---|
| 66 |
define([gt_included_intl], |
|---|
| 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]) |
|---|
| 73 |
|
|---|
| 74 |
AC_REQUIRE([AM_PO_SUBDIRS]) |
|---|
| 75 |
ifelse(gt_included_intl, yes, [ |
|---|
| 76 |
AC_REQUIRE([AM_INTL_SUBDIR]) |
|---|
| 77 |
]) |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
|---|
| 81 |
AC_REQUIRE([AC_LIB_RPATH]) |
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
ifelse(gt_included_intl, yes, , [ |
|---|
| 95 |
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
|---|
| 96 |
]) |
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
gt_INTL_MACOSX |
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
AC_REQUIRE([AM_NLS]) |
|---|
| 103 |
|
|---|
| 104 |
ifelse(gt_included_intl, yes, [ |
|---|
| 105 |
BUILD_INCLUDED_LIBINTL=no |
|---|
| 106 |
USE_INCLUDED_LIBINTL=no |
|---|
| 107 |
]) |
|---|
| 108 |
LIBINTL= |
|---|
| 109 |
LTLIBINTL= |
|---|
| 110 |
POSUB= |
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 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 |
|
|---|
| 121 |
|
|---|
| 122 |
if test "$USE_NLS" = "yes"; then |
|---|
| 123 |
gt_use_preinstalled_gnugettext=no |
|---|
| 124 |
ifelse(gt_included_intl, yes, [ |
|---|
| 125 |
AC_MSG_CHECKING([whether included gettext is requested]) |
|---|
| 126 |
AC_ARG_WITH(included-gettext, |
|---|
| 127 |
[ --with-included-gettext use the GNU gettext library included here], |
|---|
| 128 |
nls_cv_force_use_gnu_gettext=$withval, |
|---|
| 129 |
nls_cv_force_use_gnu_gettext=no) |
|---|
| 130 |
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) |
|---|
| 131 |
|
|---|
| 132 |
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" |
|---|
| 133 |
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then |
|---|
| 134 |
]) |
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
if test $gt_api_version -ge 3; then |
|---|
| 140 |
gt_revision_test_code=' |
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
changequote(,) |
|---|
| 145 |
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
|---|
| 146 |
changequote([,]) |
|---|
| 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([ |
|---|
| 159 |
$gt_revision_test_code |
|---|
| 160 |
extern int _nl_msg_cat_cntr; |
|---|
| 161 |
extern int *_nl_domain_bindings;], |
|---|
| 162 |
[bindtextdomain ("", ""); |
|---|
| 163 |
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], |
|---|
| 164 |
[eval "$gt_func_gnugettext_libc=yes"], |
|---|
| 165 |
[eval "$gt_func_gnugettext_libc=no"])]) |
|---|
| 166 |
|
|---|
| 167 |
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then |
|---|
| 168 |
|
|---|
| 169 |
ifelse(gt_included_intl, yes, , [ |
|---|
| 170 |
AM_ICONV_LINK |
|---|
| 171 |
]) |
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
AC_LIB_LINKFLAGS_BODY([intl]) |
|---|
| 177 |
AC_CACHE_CHECK([for GNU gettext in libintl], |
|---|
| 178 |
[$gt_func_gnugettext_libintl], |
|---|
| 179 |
[gt_save_CPPFLAGS="$CPPFLAGS" |
|---|
| 180 |
CPPFLAGS="$CPPFLAGS $INCINTL" |
|---|
| 181 |
gt_save_LIBS="$LIBS" |
|---|
| 182 |
LIBS="$LIBS $LIBINTL" |
|---|
| 183 |
|
|---|
| 184 |
AC_TRY_LINK([ |
|---|
| 185 |
$gt_revision_test_code |
|---|
| 186 |
extern int _nl_msg_cat_cntr; |
|---|
| 187 |
extern |
|---|
| 188 |
|
|---|
| 189 |
"C" |
|---|
| 190 |
|
|---|
| 191 |
const char *_nl_expand_alias (const char *);], |
|---|
| 192 |
[bindtextdomain ("", ""); |
|---|
| 193 |
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
|---|
| 194 |
[eval "$gt_func_gnugettext_libintl=yes"], |
|---|
| 195 |
[eval "$gt_func_gnugettext_libintl=no"]) |
|---|
| 196 |
|
|---|
| 197 |
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then |
|---|
| 198 |
LIBS="$LIBS $LIBICONV" |
|---|
| 199 |
AC_TRY_LINK([ |
|---|
| 200 |
$gt_revision_test_code |
|---|
| 201 |
extern int _nl_msg_cat_cntr; |
|---|
| 202 |
extern |
|---|
| 203 |
|
|---|
| 204 |
"C" |
|---|
| 205 |
|
|---|
| 206 |
const char *_nl_expand_alias (const char *);], |
|---|
| 207 |
[bindtextdomain ("", ""); |
|---|
| 208 |
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
|---|
| 209 |
[LIBINTL="$LIBINTL $LIBICONV" |
|---|
| 210 |
LTLIBINTL="$LTLIBINTL $LTLIBICONV" |
|---|
| 211 |
eval "$gt_func_gnugettext_libintl=yes" |
|---|
| 212 |
]) |
|---|
| 213 |
fi |
|---|
| 214 |
CPPFLAGS="$gt_save_CPPFLAGS" |
|---|
| 215 |
LIBS="$gt_save_LIBS"]) |
|---|
| 216 |
fi |
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ |
|---|
| 223 |
|| { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ |
|---|
| 224 |
&& test "$PACKAGE" != gettext-runtime \ |
|---|
| 225 |
&& test "$PACKAGE" != gettext-tools; }; then |
|---|
| 226 |
gt_use_preinstalled_gnugettext=yes |
|---|
| 227 |
else |
|---|
| 228 |
|
|---|
| 229 |
LIBINTL= |
|---|
| 230 |
LTLIBINTL= |
|---|
| 231 |
INCINTL= |
|---|
| 232 |
fi |
|---|
| 233 |
|
|---|
| 234 |
ifelse(gt_included_intl, yes, [ |
|---|
| 235 |
if test "$gt_use_preinstalled_gnugettext" != "yes"; then |
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 |
nls_cv_use_gnu_gettext=yes |
|---|
| 239 |
fi |
|---|
| 240 |
fi |
|---|
| 241 |
|
|---|
| 242 |
if test "$nls_cv_use_gnu_gettext" = "yes"; then |
|---|
| 243 |
|
|---|
| 244 |
BUILD_INCLUDED_LIBINTL=yes |
|---|
| 245 |
USE_INCLUDED_LIBINTL=yes |
|---|
| 246 |
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" |
|---|
| 247 |
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" |
|---|
| 248 |
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` |
|---|
| 249 |
fi |
|---|
| 250 |
|
|---|
| 251 |
CATOBJEXT= |
|---|
| 252 |
if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
|---|
| 253 |
|| test "$nls_cv_use_gnu_gettext" = "yes"; then |
|---|
| 254 |
|
|---|
| 255 |
CATOBJEXT=.gmo |
|---|
| 256 |
fi |
|---|
| 257 |
]) |
|---|
| 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 |
|
|---|
| 263 |
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" |
|---|
| 264 |
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" |
|---|
| 265 |
fi |
|---|
| 266 |
fi |
|---|
| 267 |
|
|---|
| 268 |
if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
|---|
| 269 |
|| test "$nls_cv_use_gnu_gettext" = "yes"; then |
|---|
| 270 |
AC_DEFINE(ENABLE_NLS, 1, |
|---|
| 271 |
[Define to 1 if translation of program messages to the user's native language |
|---|
| 272 |
is requested.]) |
|---|
| 273 |
else |
|---|
| 274 |
USE_NLS=no |
|---|
| 275 |
fi |
|---|
| 276 |
fi |
|---|
| 277 |
|
|---|
| 278 |
AC_MSG_CHECKING([whether to use NLS]) |
|---|
| 279 |
AC_MSG_RESULT([$USE_NLS]) |
|---|
| 280 |
if test "$USE_NLS" = "yes"; then |
|---|
| 281 |
AC_MSG_CHECKING([where the gettext function comes from]) |
|---|
| 282 |
if test "$gt_use_preinstalled_gnugettext" = "yes"; then |
|---|
| 283 |
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then |
|---|
| 284 |
gt_source="external libintl" |
|---|
| 285 |
else |
|---|
| 286 |
gt_source="libc" |
|---|
| 287 |
fi |
|---|
| 288 |
else |
|---|
| 289 |
gt_source="included intl directory" |
|---|
| 290 |
fi |
|---|
| 291 |
AC_MSG_RESULT([$gt_source]) |
|---|
| 292 |
fi |
|---|
| 293 |
|
|---|
| 294 |
if test "$USE_NLS" = "yes"; then |
|---|
| 295 |
|
|---|
| 296 |
if test "$gt_use_preinstalled_gnugettext" = "yes"; then |
|---|
| 297 |
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then |
|---|
| 298 |
AC_MSG_CHECKING([how to link with libintl]) |
|---|
| 299 |
AC_MSG_RESULT([$LIBINTL]) |
|---|
| 300 |
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) |
|---|
| 301 |
fi |
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
AC_DEFINE(HAVE_GETTEXT, 1, |
|---|
| 305 |
[Define if the GNU gettext() function is already present or preinstalled.]) |
|---|
| 306 |
AC_DEFINE(HAVE_DCGETTEXT, 1, |
|---|
| 307 |
[Define if the GNU dcgettext() function is already present or preinstalled.]) |
|---|
| 308 |
fi |
|---|
| 309 |
|
|---|
| 310 |
|
|---|
| 311 |
POSUB=po |
|---|
| 312 |
fi |
|---|
| 313 |
|
|---|
| 314 |
ifelse(gt_included_intl, yes, [ |
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then |
|---|
| 318 |
BUILD_INCLUDED_LIBINTL=yes |
|---|
| 319 |
fi |
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
AC_SUBST(BUILD_INCLUDED_LIBINTL) |
|---|
| 323 |
AC_SUBST(USE_INCLUDED_LIBINTL) |
|---|
| 324 |
AC_SUBST(CATOBJEXT) |
|---|
| 325 |
|
|---|
| 326 |
|
|---|
| 327 |
nls_cv_header_intl= |
|---|
| 328 |
nls_cv_header_libgt= |
|---|
| 329 |
|
|---|
| 330 |
|
|---|
| 331 |
DATADIRNAME=share |
|---|
| 332 |
AC_SUBST(DATADIRNAME) |
|---|
| 333 |
|
|---|
| 334 |
|
|---|
| 335 |
INSTOBJEXT=.mo |
|---|
| 336 |
AC_SUBST(INSTOBJEXT) |
|---|
| 337 |
|
|---|
| 338 |
|
|---|
| 339 |
GENCAT=gencat |
|---|
| 340 |
AC_SUBST(GENCAT) |
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
INTLOBJS= |
|---|
| 344 |
if test "$USE_INCLUDED_LIBINTL" = yes; then |
|---|
| 345 |
INTLOBJS="\$(GETTOBJS)" |
|---|
| 346 |
fi |
|---|
| 347 |
AC_SUBST(INTLOBJS) |
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix |
|---|
| 351 |
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) |
|---|
| 352 |
]) |
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
INTLLIBS="$LIBINTL" |
|---|
| 356 |
AC_SUBST(INTLLIBS) |
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 |
AC_SUBST(LIBINTL) |
|---|
| 360 |
AC_SUBST(LTLIBINTL) |
|---|
| 361 |
AC_SUBST(POSUB) |
|---|
| 362 |
]) |
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
m4_define([gt_NEEDS_INIT], |
|---|
| 367 |
[ |
|---|
| 368 |
m4_divert_text([DEFAULTS], [gt_needs=]) |
|---|
| 369 |
m4_define([gt_NEEDS_INIT], []) |
|---|
| 370 |
]) |
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
|
|---|
| 374 |
AC_DEFUN([AM_GNU_GETTEXT_NEED], |
|---|
| 375 |
[ |
|---|
| 376 |
m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) |
|---|
| 377 |
]) |
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 |
AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |
|---|