20
20
If you have problems, you may need to regenerate the build system entirely.
21
21
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
23
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
24
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
26
# This file is free software, distributed under the terms of the GNU
27
# General Public License. As a special exception to the GNU General
28
# Public License, this file may be distributed as part of a program
29
# that contains a configuration script generated by Autoconf, under
30
# the same distribution terms as the rest of that program.
32
# This file can be copied and used freely without restrictions. It can
33
# be used in projects which are not available under the GNU Public License
34
# but which still want to provide support for the GNU gettext functionality.
36
# Macro to add for using GNU gettext.
37
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
39
# Modified to never use included libintl.
40
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
42
# Major rework to remove unused code
43
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
45
# Added better handling of ALL_LINGUAS from GNU gettext version
46
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
48
# Modified to require ngettext
49
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
51
# We need this here as well, since someone might use autoconf-2.5x
52
# to configure GLib then an older version to configure a package
53
# using AM_GLIB_GNU_GETTEXT
57
dnl We go to great lengths to make sure that aclocal won't
58
dnl try to pull in the installed version of these macros
59
dnl when running aclocal in the glib directory.
61
m4_copy([AC_DEFUN],[glib_DEFUN])
62
m4_copy([AC_REQUIRE],[glib_REQUIRE])
64
dnl At the end, if we're not within glib, we'll define the public
65
dnl definitions in terms of our private definitions.
70
glib_DEFUN([GLIB_LC_MESSAGES],
71
[AC_CHECK_HEADERS([locale.h])
72
if test $ac_cv_header_locale_h = yes; then
73
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
74
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
75
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
76
if test $am_cv_val_LC_MESSAGES = yes; then
77
AC_DEFINE(HAVE_LC_MESSAGES, 1,
78
[Define if your <locale.h> file defines LC_MESSAGES.])
82
# GLIB_PATH_PROG_WITH_TEST
83
#----------------------------
84
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
85
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
86
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
87
[# Extract the first word of "$2", so it can be a program name with args.
88
set dummy $2; ac_word=[$]2
89
AC_MSG_CHECKING([for $ac_word])
90
AC_CACHE_VAL(ac_cv_path_$1,
93
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
96
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
97
for ac_dir in ifelse([$5], , $PATH, [$5]); do
98
test -z "$ac_dir" && ac_dir=.
99
if test -f $ac_dir/$ac_word; then
101
ac_cv_path_$1="$ac_dir/$ac_word"
107
dnl If no 4th arg is given, leave the cache variable unset,
108
dnl so AC_PATH_PROGS will keep looking.
109
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
114
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
124
glib_DEFUN([GLIB_WITH_NLS],
125
dnl NLS is obligatory
129
gt_cv_have_gettext=no
135
AC_CHECK_HEADER(libintl.h,
136
[gt_cv_func_dgettext_libintl="no"
137
libintl_extra_libs=""
140
# First check in libc
142
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
146
[return !ngettext ("","", 1)],
147
gt_cv_func_ngettext_libc=yes,
148
gt_cv_func_ngettext_libc=no)
151
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
152
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
156
[return !dgettext ("","")],
157
gt_cv_func_dgettext_libc=yes,
158
gt_cv_func_dgettext_libc=no)
162
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
163
AC_CHECK_FUNCS(bind_textdomain_codeset)
167
# If we don't have everything we want, check in libintl
169
if test "$gt_cv_func_dgettext_libc" != "yes" \
170
|| test "$gt_cv_func_ngettext_libc" != "yes" \
171
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
173
AC_CHECK_LIB(intl, bindtextdomain,
174
[AC_CHECK_LIB(intl, ngettext,
175
[AC_CHECK_LIB(intl, dgettext,
176
gt_cv_func_dgettext_libintl=yes)])])
178
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
179
AC_MSG_CHECKING([if -liconv is needed to use gettext])
181
AC_CHECK_LIB(intl, ngettext,
182
[AC_CHECK_LIB(intl, dcgettext,
183
[gt_cv_func_dgettext_libintl=yes
184
libintl_extra_libs=-liconv],
190
# If we found libintl, then check in it for bind_textdomain_codeset();
191
# we'll prefer libc if neither have bind_textdomain_codeset(),
192
# and both have dgettext and ngettext
194
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
195
glib_save_LIBS="$LIBS"
196
LIBS="$LIBS -lintl $libintl_extra_libs"
197
unset ac_cv_func_bind_textdomain_codeset
198
AC_CHECK_FUNCS(bind_textdomain_codeset)
199
LIBS="$glib_save_LIBS"
201
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
202
gt_cv_func_dgettext_libc=no
204
if test "$gt_cv_func_dgettext_libc" = "yes" \
205
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
206
gt_cv_func_dgettext_libintl=no
212
if test "$gt_cv_func_dgettext_libc" = "yes" \
213
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
214
gt_cv_have_gettext=yes
217
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
218
INTLLIBS="-lintl $libintl_extra_libs"
221
if test "$gt_cv_have_gettext" = "yes"; then
222
AC_DEFINE(HAVE_GETTEXT,1,
223
[Define if the GNU gettext() function is already present or preinstalled.])
224
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
225
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
226
if test "$MSGFMT" != "no"; then
227
glib_save_LIBS="$LIBS"
228
LIBS="$LIBS $INTLLIBS"
229
AC_CHECK_FUNCS(dcgettext)
231
AC_MSG_CHECKING([if msgfmt accepts -c])
232
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
235
"Content-Type: text/plain; charset=UTF-8\n"
236
"Project-Id-Version: test 1.0\n"
237
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
238
"Last-Translator: test <foo@bar.xx>\n"
239
"Language-Team: C <LL@li.org>\n"
240
"MIME-Version: 1.0\n"
241
"Content-Transfer-Encoding: 8bit\n"
242
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
243
AC_SUBST(MSGFMT_OPTS)
244
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
245
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
246
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
247
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
248
return _nl_msg_cat_cntr],
253
dnl On Solaris, if bind_textdomain_codeset is in libc,
254
dnl GNU format message catalog is always supported,
255
dnl since both are added to the libc all together.
256
dnl Hence, we'd like to go with DATADIRNAME=share and
257
dnl and CATOBJEXT=.gmo in this case.
258
AC_CHECK_FUNC(bind_textdomain_codeset,
273
LIBS="$glib_save_LIBS"
276
gt_cv_have_gettext=no
281
if test "$gt_cv_have_gettext" = "yes" ; then
282
AC_DEFINE(ENABLE_NLS, 1,
283
[always defined to indicate that i18n is enabled])
286
dnl Test whether we really found GNU xgettext.
287
if test "$XGETTEXT" != ":"; then
288
dnl If it is not GNU xgettext we define it as : so that the
289
dnl Makefiles still can work.
290
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
294
[found xgettext program is not GNU xgettext; ignore it])
299
# We need to process the po/ directory.
303
[case "$CONFIG_FILES" in *po/Makefile.in*)
304
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
307
dnl These rules are solely for the distribution goal. While doing this
308
dnl we only have to keep exactly one list of the available catalogs
310
for lang in $ALL_LINGUAS; do
311
GMOFILES="$GMOFILES $lang.gmo"
312
POFILES="$POFILES $lang.po"
315
dnl Make all variables we use known to autoconf.
318
AC_SUBST(DATADIRNAME)
322
AC_SUBST(PO_IN_DATADIR_TRUE)
323
AC_SUBST(PO_IN_DATADIR_FALSE)
328
# AM_GLIB_GNU_GETTEXT
329
# -------------------
330
# Do checks necessary for use of gettext. If a suitable implementation
331
# of gettext is found in either in libintl or in the C library,
332
# it will set INTLLIBS to the libraries needed for use of gettext
333
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
334
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
335
# on various variables needed by the Makefile.in.in installed by
338
glib_DEFUN([GLIB_GNU_GETTEXT],
339
[AC_REQUIRE([AC_PROG_CC])dnl
344
if test "$gt_cv_have_gettext" = "yes"; then
345
if test "x$ALL_LINGUAS" = "x"; then
348
AC_MSG_CHECKING(for catalogs to be installed)
350
for presentlang in $ALL_LINGUAS; do
352
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
353
desiredlanguages="$LINGUAS"
355
desiredlanguages="$ALL_LINGUAS"
357
for desiredlang in $desiredlanguages; do
358
# Use the presentlang catalog if desiredlang is
359
# a. equal to presentlang, or
360
# b. a variant of presentlang (because in this case,
361
# presentlang can be used as a fallback for messages
362
# which are not translated in the desiredlang catalog).
363
case "$desiredlang" in
364
"$presentlang"*) useit=yes;;
367
if test $useit = yes; then
368
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
372
AC_MSG_RESULT($LINGUAS)
375
dnl Construct list of names of catalog files to be constructed.
376
if test -n "$LINGUAS"; then
377
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
381
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
382
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
383
dnl Try to locate is.
385
if test -n "$ac_aux_dir"; then
386
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
388
if test -z "$MKINSTALLDIRS"; then
389
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
391
AC_SUBST(MKINSTALLDIRS)
393
dnl Generate list of files to be processed by xgettext which will
394
dnl be included in po/Makefile.
395
test -d po || mkdir po
396
if test "x$srcdir" != "x."; then
397
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
398
posrcprefix="$srcdir/"
400
posrcprefix="../$srcdir/"
406
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
407
< $srcdir/po/POTFILES.in > po/POTFILES
410
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
411
# -------------------------------
412
# Define VARIABLE to the location where catalog files will
413
# be installed by po/Makefile.
414
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
415
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
416
glib_save_prefix="$prefix"
417
glib_save_exec_prefix="$exec_prefix"
418
glib_save_datarootdir="$datarootdir"
419
test "x$prefix" = xNONE && prefix=$ac_default_prefix
420
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
421
datarootdir=`eval echo "${datarootdir}"`
422
if test "x$CATOBJEXT" = "x.mo" ; then
423
localedir=`eval echo "${libdir}/locale"`
425
localedir=`eval echo "${datadir}/locale"`
427
prefix="$glib_save_prefix"
428
exec_prefix="$glib_save_exec_prefix"
429
datarootdir="$glib_save_datarootdir"
430
AC_DEFINE_UNQUOTED($1, "$localedir",
431
[Define the location where the catalogs will be installed])
435
dnl Now the definitions that aclocal will find
437
ifdef(glib_configure_ac,[],[
438
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
439
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
442
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
444
# Create a temporary file with TEST-FILE as its contents and pass the
445
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
446
# 0 and perform ACTION-IF-FAIL for any other exit status.
447
AC_DEFUN([GLIB_RUN_PROG],
448
[cat >conftest.foo <<_ACEOF
451
if AC_RUN_LOG([$1 conftest.foo]); then
452
m4_ifval([$3], [$3], [:])
453
m4_ifvaln([$4], [else $4])dnl
454
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
455
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
460
24
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
461
25
# serial 42 IT_PROG_INTLTOOL
9521
9080
AS_VAR_IF([$1], [""], [$5], [$4])dnl
9522
9081
])# PKG_CHECK_VAR
9083
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
9084
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
9086
# This file is free software, distributed under the terms of the GNU
9087
# General Public License. As a special exception to the GNU General
9088
# Public License, this file may be distributed as part of a program
9089
# that contains a configuration script generated by Autoconf, under
9090
# the same distribution terms as the rest of that program.
9092
# This file can be copied and used freely without restrictions. It can
9093
# be used in projects which are not available under the GNU Public License
9094
# but which still want to provide support for the GNU gettext functionality.
9096
# Macro to add for using GNU gettext.
9097
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
9099
# Modified to never use included libintl.
9100
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
9102
# Major rework to remove unused code
9103
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
9105
# Added better handling of ALL_LINGUAS from GNU gettext version
9106
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
9108
# Modified to require ngettext
9109
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
9111
# We need this here as well, since someone might use autoconf-2.5x
9112
# to configure GLib then an older version to configure a package
9113
# using AM_GLIB_GNU_GETTEXT
9117
dnl We go to great lengths to make sure that aclocal won't
9118
dnl try to pull in the installed version of these macros
9119
dnl when running aclocal in the glib directory.
9121
m4_copy([AC_DEFUN],[glib_DEFUN])
9122
m4_copy([AC_REQUIRE],[glib_REQUIRE])
9124
dnl At the end, if we're not within glib, we'll define the public
9125
dnl definitions in terms of our private definitions.
9129
#--------------------
9130
glib_DEFUN([GLIB_LC_MESSAGES],
9131
[AC_CHECK_HEADERS([locale.h])
9132
if test $ac_cv_header_locale_h = yes; then
9133
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
9134
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
9135
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
9136
if test $am_cv_val_LC_MESSAGES = yes; then
9137
AC_DEFINE(HAVE_LC_MESSAGES, 1,
9138
[Define if your <locale.h> file defines LC_MESSAGES.])
9142
# GLIB_PATH_PROG_WITH_TEST
9143
#----------------------------
9144
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
9145
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
9146
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
9147
[# Extract the first word of "$2", so it can be a program name with args.
9148
set dummy $2; ac_word=[$]2
9149
AC_MSG_CHECKING([for $ac_word])
9150
AC_CACHE_VAL(ac_cv_path_$1,
9153
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
9156
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
9157
for ac_dir in ifelse([$5], , $PATH, [$5]); do
9158
test -z "$ac_dir" && ac_dir=.
9159
if test -f $ac_dir/$ac_word; then
9161
ac_cv_path_$1="$ac_dir/$ac_word"
9167
dnl If no 4th arg is given, leave the cache variable unset,
9168
dnl so AC_PATH_PROGS will keep looking.
9169
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
9174
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
9175
AC_MSG_RESULT([$]$1)
9184
glib_DEFUN([GLIB_WITH_NLS],
9185
dnl NLS is obligatory
9189
gt_cv_have_gettext=no
9195
AC_CHECK_HEADER(libintl.h,
9196
[gt_cv_func_dgettext_libintl="no"
9197
libintl_extra_libs=""
9200
# First check in libc
9202
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
9204
#include <libintl.h>
9206
[return !ngettext ("","", 1)],
9207
gt_cv_func_ngettext_libc=yes,
9208
gt_cv_func_ngettext_libc=no)
9211
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
9212
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
9214
#include <libintl.h>
9216
[return !dgettext ("","")],
9217
gt_cv_func_dgettext_libc=yes,
9218
gt_cv_func_dgettext_libc=no)
9222
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
9223
AC_CHECK_FUNCS(bind_textdomain_codeset)
9227
# If we don't have everything we want, check in libintl
9229
if test "$gt_cv_func_dgettext_libc" != "yes" \
9230
|| test "$gt_cv_func_ngettext_libc" != "yes" \
9231
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
9233
AC_CHECK_LIB(intl, bindtextdomain,
9234
[AC_CHECK_LIB(intl, ngettext,
9235
[AC_CHECK_LIB(intl, dgettext,
9236
gt_cv_func_dgettext_libintl=yes)])])
9238
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
9239
AC_MSG_CHECKING([if -liconv is needed to use gettext])
9241
AC_CHECK_LIB(intl, ngettext,
9242
[AC_CHECK_LIB(intl, dcgettext,
9243
[gt_cv_func_dgettext_libintl=yes
9244
libintl_extra_libs=-liconv],
9250
# If we found libintl, then check in it for bind_textdomain_codeset();
9251
# we'll prefer libc if neither have bind_textdomain_codeset(),
9252
# and both have dgettext and ngettext
9254
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
9255
glib_save_LIBS="$LIBS"
9256
LIBS="$LIBS -lintl $libintl_extra_libs"
9257
unset ac_cv_func_bind_textdomain_codeset
9258
AC_CHECK_FUNCS(bind_textdomain_codeset)
9259
LIBS="$glib_save_LIBS"
9261
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
9262
gt_cv_func_dgettext_libc=no
9264
if test "$gt_cv_func_dgettext_libc" = "yes" \
9265
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
9266
gt_cv_func_dgettext_libintl=no
9272
if test "$gt_cv_func_dgettext_libc" = "yes" \
9273
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
9274
gt_cv_have_gettext=yes
9277
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
9278
INTLLIBS="-lintl $libintl_extra_libs"
9281
if test "$gt_cv_have_gettext" = "yes"; then
9282
AC_DEFINE(HAVE_GETTEXT,1,
9283
[Define if the GNU gettext() function is already present or preinstalled.])
9284
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
9285
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
9286
if test "$MSGFMT" != "no"; then
9287
glib_save_LIBS="$LIBS"
9288
LIBS="$LIBS $INTLLIBS"
9289
AC_CHECK_FUNCS(dcgettext)
9291
AC_MSG_CHECKING([if msgfmt accepts -c])
9292
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
9295
"Content-Type: text/plain; charset=UTF-8\n"
9296
"Project-Id-Version: test 1.0\n"
9297
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
9298
"Last-Translator: test <foo@bar.xx>\n"
9299
"Language-Team: C <LL@li.org>\n"
9300
"MIME-Version: 1.0\n"
9301
"Content-Transfer-Encoding: 8bit\n"
9302
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
9303
AC_SUBST(MSGFMT_OPTS)
9304
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
9305
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
9306
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
9307
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
9308
return _nl_msg_cat_cntr],
9313
dnl On Solaris, if bind_textdomain_codeset is in libc,
9314
dnl GNU format message catalog is always supported,
9315
dnl since both are added to the libc all together.
9316
dnl Hence, we'd like to go with DATADIRNAME=share and
9317
dnl and CATOBJEXT=.gmo in this case.
9318
AC_CHECK_FUNC(bind_textdomain_codeset,
9333
LIBS="$glib_save_LIBS"
9336
gt_cv_have_gettext=no
9341
if test "$gt_cv_have_gettext" = "yes" ; then
9342
AC_DEFINE(ENABLE_NLS, 1,
9343
[always defined to indicate that i18n is enabled])
9346
dnl Test whether we really found GNU xgettext.
9347
if test "$XGETTEXT" != ":"; then
9348
dnl If it is not GNU xgettext we define it as : so that the
9349
dnl Makefiles still can work.
9350
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
9354
[found xgettext program is not GNU xgettext; ignore it])
9359
# We need to process the po/ directory.
9363
[case "$CONFIG_FILES" in *po/Makefile.in*)
9364
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
9367
dnl These rules are solely for the distribution goal. While doing this
9368
dnl we only have to keep exactly one list of the available catalogs
9369
dnl in configure.ac.
9370
for lang in $ALL_LINGUAS; do
9371
GMOFILES="$GMOFILES $lang.gmo"
9372
POFILES="$POFILES $lang.po"
9375
dnl Make all variables we use known to autoconf.
9378
AC_SUBST(DATADIRNAME)
9380
AC_SUBST(INSTOBJEXT)
9382
AC_SUBST(PO_IN_DATADIR_TRUE)
9383
AC_SUBST(PO_IN_DATADIR_FALSE)
9388
# AM_GLIB_GNU_GETTEXT
9389
# -------------------
9390
# Do checks necessary for use of gettext. If a suitable implementation
9391
# of gettext is found in either in libintl or in the C library,
9392
# it will set INTLLIBS to the libraries needed for use of gettext
9393
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
9394
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
9395
# on various variables needed by the Makefile.in.in installed by
9398
glib_DEFUN([GLIB_GNU_GETTEXT],
9399
[AC_REQUIRE([AC_PROG_CC])dnl
9404
if test "$gt_cv_have_gettext" = "yes"; then
9405
if test "x$ALL_LINGUAS" = "x"; then
9408
AC_MSG_CHECKING(for catalogs to be installed)
9410
for presentlang in $ALL_LINGUAS; do
9412
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
9413
desiredlanguages="$LINGUAS"
9415
desiredlanguages="$ALL_LINGUAS"
9417
for desiredlang in $desiredlanguages; do
9418
# Use the presentlang catalog if desiredlang is
9419
# a. equal to presentlang, or
9420
# b. a variant of presentlang (because in this case,
9421
# presentlang can be used as a fallback for messages
9422
# which are not translated in the desiredlang catalog).
9423
case "$desiredlang" in
9424
"$presentlang"*) useit=yes;;
9427
if test $useit = yes; then
9428
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
9431
LINGUAS=$NEW_LINGUAS
9432
AC_MSG_RESULT($LINGUAS)
9435
dnl Construct list of names of catalog files to be constructed.
9436
if test -n "$LINGUAS"; then
9437
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
9441
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
9442
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
9443
dnl Try to locate is.
9445
if test -n "$ac_aux_dir"; then
9446
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
9448
if test -z "$MKINSTALLDIRS"; then
9449
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
9451
AC_SUBST(MKINSTALLDIRS)
9453
dnl Generate list of files to be processed by xgettext which will
9454
dnl be included in po/Makefile.
9455
test -d po || mkdir po
9456
if test "x$srcdir" != "x."; then
9457
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
9458
posrcprefix="$srcdir/"
9460
posrcprefix="../$srcdir/"
9466
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
9467
< $srcdir/po/POTFILES.in > po/POTFILES
9470
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
9471
# -------------------------------
9472
# Define VARIABLE to the location where catalog files will
9473
# be installed by po/Makefile.
9474
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
9475
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
9476
glib_save_prefix="$prefix"
9477
glib_save_exec_prefix="$exec_prefix"
9478
glib_save_datarootdir="$datarootdir"
9479
test "x$prefix" = xNONE && prefix=$ac_default_prefix
9480
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
9481
datarootdir=`eval echo "${datarootdir}"`
9482
if test "x$CATOBJEXT" = "x.mo" ; then
9483
localedir=`eval echo "${libdir}/locale"`
9485
localedir=`eval echo "${datadir}/locale"`
9487
prefix="$glib_save_prefix"
9488
exec_prefix="$glib_save_exec_prefix"
9489
datarootdir="$glib_save_datarootdir"
9490
AC_DEFINE_UNQUOTED($1, "$localedir",
9491
[Define the location where the catalogs will be installed])
9495
dnl Now the definitions that aclocal will find
9497
ifdef(glib_configure_ac,[],[
9498
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
9499
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
9502
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
9504
# Create a temporary file with TEST-FILE as its contents and pass the
9505
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
9506
# 0 and perform ACTION-IF-FAIL for any other exit status.
9507
AC_DEFUN([GLIB_RUN_PROG],
9508
[cat >conftest.foo <<_ACEOF
9511
if AC_RUN_LOG([$1 conftest.foo]); then
9512
m4_ifval([$3], [$3], [:])
9513
m4_ifvaln([$4], [else $4])dnl
9514
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
9515
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
9524
9519
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
9526
9521
# This file is free software; the Free Software Foundation