970
974
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
977
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
978
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
980
# This file is free software, distributed under the terms of the GNU
981
# General Public License. As a special exception to the GNU General
982
# Public License, this file may be distributed as part of a program
983
# that contains a configuration script generated by Autoconf, under
984
# the same distribution terms as the rest of that program.
986
# This file can be copied and used freely without restrictions. It can
987
# be used in projects which are not available under the GNU Public License
988
# but which still want to provide support for the GNU gettext functionality.
990
# Macro to add for using GNU gettext.
991
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
993
# Modified to never use included libintl.
994
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
996
# Major rework to remove unused code
997
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
999
# Added better handling of ALL_LINGUAS from GNU gettext version
1000
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1002
# Modified to require ngettext
1003
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1005
# We need this here as well, since someone might use autoconf-2.5x
1006
# to configure GLib then an older version to configure a package
1007
# using AM_GLIB_GNU_GETTEXT
1011
dnl We go to great lengths to make sure that aclocal won't
1012
dnl try to pull in the installed version of these macros
1013
dnl when running aclocal in the glib directory.
1015
m4_copy([AC_DEFUN],[glib_DEFUN])
1016
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1018
dnl At the end, if we're not within glib, we'll define the public
1019
dnl definitions in terms of our private definitions.
1023
#--------------------
1024
glib_DEFUN([GLIB_LC_MESSAGES],
1025
[AC_CHECK_HEADERS([locale.h])
1026
if test $ac_cv_header_locale_h = yes; then
1027
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1028
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1029
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1030
if test $am_cv_val_LC_MESSAGES = yes; then
1031
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1032
[Define if your <locale.h> file defines LC_MESSAGES.])
1036
# GLIB_PATH_PROG_WITH_TEST
1037
#----------------------------
1038
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1039
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1040
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1041
[# Extract the first word of "$2", so it can be a program name with args.
1042
set dummy $2; ac_word=[$]2
1043
AC_MSG_CHECKING([for $ac_word])
1044
AC_CACHE_VAL(ac_cv_path_$1,
1047
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1050
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1051
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1052
test -z "$ac_dir" && ac_dir=.
1053
if test -f $ac_dir/$ac_word; then
1055
ac_cv_path_$1="$ac_dir/$ac_word"
1061
dnl If no 4th arg is given, leave the cache variable unset,
1062
dnl so AC_PATH_PROGS will keep looking.
1063
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1068
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1069
AC_MSG_RESULT([$]$1)
1078
glib_DEFUN([GLIB_WITH_NLS],
1079
dnl NLS is obligatory
1083
gt_cv_have_gettext=no
1089
AC_CHECK_HEADER(libintl.h,
1090
[gt_cv_func_dgettext_libintl="no"
1091
libintl_extra_libs=""
1094
# First check in libc
1096
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1098
#include <libintl.h>
1100
[return !ngettext ("","", 1)],
1101
gt_cv_func_ngettext_libc=yes,
1102
gt_cv_func_ngettext_libc=no)
1105
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1106
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1108
#include <libintl.h>
1110
[return !dgettext ("","")],
1111
gt_cv_func_dgettext_libc=yes,
1112
gt_cv_func_dgettext_libc=no)
1116
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1117
AC_CHECK_FUNCS(bind_textdomain_codeset)
1121
# If we don't have everything we want, check in libintl
1123
if test "$gt_cv_func_dgettext_libc" != "yes" \
1124
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1125
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1127
AC_CHECK_LIB(intl, bindtextdomain,
1128
[AC_CHECK_LIB(intl, ngettext,
1129
[AC_CHECK_LIB(intl, dgettext,
1130
gt_cv_func_dgettext_libintl=yes)])])
1132
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1133
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1135
AC_CHECK_LIB(intl, ngettext,
1136
[AC_CHECK_LIB(intl, dcgettext,
1137
[gt_cv_func_dgettext_libintl=yes
1138
libintl_extra_libs=-liconv],
1144
# If we found libintl, then check in it for bind_textdomain_codeset();
1145
# we'll prefer libc if neither have bind_textdomain_codeset(),
1146
# and both have dgettext and ngettext
1148
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1149
glib_save_LIBS="$LIBS"
1150
LIBS="$LIBS -lintl $libintl_extra_libs"
1151
unset ac_cv_func_bind_textdomain_codeset
1152
AC_CHECK_FUNCS(bind_textdomain_codeset)
1153
LIBS="$glib_save_LIBS"
1155
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1156
gt_cv_func_dgettext_libc=no
1158
if test "$gt_cv_func_dgettext_libc" = "yes" \
1159
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1160
gt_cv_func_dgettext_libintl=no
1166
if test "$gt_cv_func_dgettext_libc" = "yes" \
1167
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1168
gt_cv_have_gettext=yes
1171
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1172
INTLLIBS="-lintl $libintl_extra_libs"
1175
if test "$gt_cv_have_gettext" = "yes"; then
1176
AC_DEFINE(HAVE_GETTEXT,1,
1177
[Define if the GNU gettext() function is already present or preinstalled.])
1178
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1179
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1180
if test "$MSGFMT" != "no"; then
1181
glib_save_LIBS="$LIBS"
1182
LIBS="$LIBS $INTLLIBS"
1183
AC_CHECK_FUNCS(dcgettext)
1185
AC_MSG_CHECKING([if msgfmt accepts -c])
1186
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1189
"Content-Type: text/plain; charset=UTF-8\n"
1190
"Project-Id-Version: test 1.0\n"
1191
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1192
"Last-Translator: test <foo@bar.xx>\n"
1193
"Language-Team: C <LL@li.org>\n"
1194
"MIME-Version: 1.0\n"
1195
"Content-Transfer-Encoding: 8bit\n"
1196
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1197
AC_SUBST(MSGFMT_OPTS)
1198
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1199
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1200
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1201
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1202
return _nl_msg_cat_cntr],
1207
dnl On Solaris, if bind_textdomain_codeset is in libc,
1208
dnl GNU format message catalog is always supported,
1209
dnl since both are added to the libc all together.
1210
dnl Hence, we'd like to go with DATADIRNAME=share and
1211
dnl and CATOBJEXT=.gmo in this case.
1212
AC_CHECK_FUNC(bind_textdomain_codeset,
1223
LIBS="$glib_save_LIBS"
1226
gt_cv_have_gettext=no
1231
if test "$gt_cv_have_gettext" = "yes" ; then
1232
AC_DEFINE(ENABLE_NLS, 1,
1233
[always defined to indicate that i18n is enabled])
1236
dnl Test whether we really found GNU xgettext.
1237
if test "$XGETTEXT" != ":"; then
1238
dnl If it is not GNU xgettext we define it as : so that the
1239
dnl Makefiles still can work.
1240
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1244
[found xgettext program is not GNU xgettext; ignore it])
1249
# We need to process the po/ directory.
1253
[case "$CONFIG_FILES" in *po/Makefile.in*)
1254
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1257
dnl These rules are solely for the distribution goal. While doing this
1258
dnl we only have to keep exactly one list of the available catalogs
1259
dnl in configure.in.
1260
for lang in $ALL_LINGUAS; do
1261
GMOFILES="$GMOFILES $lang.gmo"
1262
POFILES="$POFILES $lang.po"
1265
dnl Make all variables we use known to autoconf.
1268
AC_SUBST(DATADIRNAME)
1270
AC_SUBST(INSTOBJEXT)
1272
AC_SUBST(PO_IN_DATADIR_TRUE)
1273
AC_SUBST(PO_IN_DATADIR_FALSE)
1278
# AM_GLIB_GNU_GETTEXT
1279
# -------------------
1280
# Do checks necessary for use of gettext. If a suitable implementation
1281
# of gettext is found in either in libintl or in the C library,
1282
# it will set INTLLIBS to the libraries needed for use of gettext
1283
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1284
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1285
# on various variables needed by the Makefile.in.in installed by
1288
glib_DEFUN([GLIB_GNU_GETTEXT],
1289
[AC_REQUIRE([AC_PROG_CC])dnl
1290
AC_REQUIRE([AC_HEADER_STDC])dnl
1295
if test "$gt_cv_have_gettext" = "yes"; then
1296
if test "x$ALL_LINGUAS" = "x"; then
1299
AC_MSG_CHECKING(for catalogs to be installed)
1301
for presentlang in $ALL_LINGUAS; do
1303
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1304
desiredlanguages="$LINGUAS"
1306
desiredlanguages="$ALL_LINGUAS"
1308
for desiredlang in $desiredlanguages; do
1309
# Use the presentlang catalog if desiredlang is
1310
# a. equal to presentlang, or
1311
# b. a variant of presentlang (because in this case,
1312
# presentlang can be used as a fallback for messages
1313
# which are not translated in the desiredlang catalog).
1314
case "$desiredlang" in
1315
"$presentlang"*) useit=yes;;
1318
if test $useit = yes; then
1319
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1322
LINGUAS=$NEW_LINGUAS
1323
AC_MSG_RESULT($LINGUAS)
1326
dnl Construct list of names of catalog files to be constructed.
1327
if test -n "$LINGUAS"; then
1328
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1332
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1333
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1334
dnl Try to locate is.
1336
if test -n "$ac_aux_dir"; then
1337
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1339
if test -z "$MKINSTALLDIRS"; then
1340
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1342
AC_SUBST(MKINSTALLDIRS)
1344
dnl Generate list of files to be processed by xgettext which will
1345
dnl be included in po/Makefile.
1346
test -d po || mkdir po
1347
if test "x$srcdir" != "x."; then
1348
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1349
posrcprefix="$srcdir/"
1351
posrcprefix="../$srcdir/"
1357
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1358
< $srcdir/po/POTFILES.in > po/POTFILES
1361
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1362
# -------------------------------
1363
# Define VARIABLE to the location where catalog files will
1364
# be installed by po/Makefile.
1365
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1366
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1367
glib_save_prefix="$prefix"
1368
glib_save_exec_prefix="$exec_prefix"
1369
glib_save_datarootdir="$datarootdir"
1370
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1371
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1372
datarootdir=`eval echo "${datarootdir}"`
1373
if test "x$CATOBJEXT" = "x.mo" ; then
1374
localedir=`eval echo "${libdir}/locale"`
1376
localedir=`eval echo "${datadir}/locale"`
1378
prefix="$glib_save_prefix"
1379
exec_prefix="$glib_save_exec_prefix"
1380
datarootdir="$glib_save_datarootdir"
1381
AC_DEFINE_UNQUOTED($1, "$localedir",
1382
[Define the location where the catalogs will be installed])
1386
dnl Now the definitions that aclocal will find
1388
ifdef(glib_configure_in,[],[
1389
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1390
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1393
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1395
# Create a temporary file with TEST-FILE as its contents and pass the
1396
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1397
# 0 and perform ACTION-IF-FAIL for any other exit status.
1398
AC_DEFUN([GLIB_RUN_PROG],
1399
[cat >conftest.foo <<_ACEOF
1402
if AC_RUN_LOG([$1 conftest.foo]); then
1403
m4_ifval([$3], [$3], [:])
1404
m4_ifvaln([$4], [else $4])dnl
1405
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1406
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
973
1410
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
975
# serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL
1412
# serial 52 AC_PROG_LIBTOOL
978
1415
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
7781
8203
])# PKG_CHECK_MODULES
7783
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
7784
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
7786
# This file is free software, distributed under the terms of the GNU
7787
# General Public License. As a special exception to the GNU General
7788
# Public License, this file may be distributed as part of a program
7789
# that contains a configuration script generated by Autoconf, under
7790
# the same distribution terms as the rest of that program.
7792
# This file can be copied and used freely without restrictions. It can
7793
# be used in projects which are not available under the GNU Public License
7794
# but which still want to provide support for the GNU gettext functionality.
7796
# Macro to add for using GNU gettext.
7797
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
7799
# Modified to never use included libintl.
7800
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
7802
# Major rework to remove unused code
7803
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
7805
# Added better handling of ALL_LINGUAS from GNU gettext version
7806
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
7808
# Modified to require ngettext
7809
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
7811
# We need this here as well, since someone might use autoconf-2.5x
7812
# to configure GLib then an older version to configure a package
7813
# using AM_GLIB_GNU_GETTEXT
7817
dnl We go to great lengths to make sure that aclocal won't
7818
dnl try to pull in the installed version of these macros
7819
dnl when running aclocal in the glib directory.
7821
m4_copy([AC_DEFUN],[glib_DEFUN])
7822
m4_copy([AC_REQUIRE],[glib_REQUIRE])
7824
dnl At the end, if we're not within glib, we'll define the public
7825
dnl definitions in terms of our private definitions.
7829
#--------------------
7830
glib_DEFUN([GLIB_LC_MESSAGES],
7831
[AC_CHECK_HEADERS([locale.h])
7832
if test $ac_cv_header_locale_h = yes; then
7833
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
7834
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
7835
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
7836
if test $am_cv_val_LC_MESSAGES = yes; then
7837
AC_DEFINE(HAVE_LC_MESSAGES, 1,
7838
[Define if your <locale.h> file defines LC_MESSAGES.])
7842
# GLIB_PATH_PROG_WITH_TEST
7843
#----------------------------
7844
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
7845
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
7846
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
7847
[# Extract the first word of "$2", so it can be a program name with args.
7848
set dummy $2; ac_word=[$]2
7849
AC_MSG_CHECKING([for $ac_word])
7850
AC_CACHE_VAL(ac_cv_path_$1,
7853
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
7856
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7857
for ac_dir in ifelse([$5], , $PATH, [$5]); do
7858
test -z "$ac_dir" && ac_dir=.
7859
if test -f $ac_dir/$ac_word; then
7861
ac_cv_path_$1="$ac_dir/$ac_word"
7867
dnl If no 4th arg is given, leave the cache variable unset,
7868
dnl so AC_PATH_PROGS will keep looking.
7869
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
7874
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
7875
AC_MSG_RESULT([$]$1)
7884
glib_DEFUN([GLIB_WITH_NLS],
7885
dnl NLS is obligatory
7889
gt_cv_have_gettext=no
7895
AC_CHECK_HEADER(libintl.h,
7896
[gt_cv_func_dgettext_libintl="no"
7897
libintl_extra_libs=""
7900
# First check in libc
7902
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
7904
#include <libintl.h>
7906
[return !ngettext ("","", 1)],
7907
gt_cv_func_ngettext_libc=yes,
7908
gt_cv_func_ngettext_libc=no)
7911
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7912
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
7914
#include <libintl.h>
7916
[return !dgettext ("","")],
7917
gt_cv_func_dgettext_libc=yes,
7918
gt_cv_func_dgettext_libc=no)
7922
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7923
AC_CHECK_FUNCS(bind_textdomain_codeset)
7927
# If we don't have everything we want, check in libintl
7929
if test "$gt_cv_func_dgettext_libc" != "yes" \
7930
|| test "$gt_cv_func_ngettext_libc" != "yes" \
7931
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
7933
AC_CHECK_LIB(intl, bindtextdomain,
7934
[AC_CHECK_LIB(intl, ngettext,
7935
[AC_CHECK_LIB(intl, dgettext,
7936
gt_cv_func_dgettext_libintl=yes)])])
7938
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
7939
AC_MSG_CHECKING([if -liconv is needed to use gettext])
7941
AC_CHECK_LIB(intl, ngettext,
7942
[AC_CHECK_LIB(intl, dcgettext,
7943
[gt_cv_func_dgettext_libintl=yes
7944
libintl_extra_libs=-liconv],
7950
# If we found libintl, then check in it for bind_textdomain_codeset();
7951
# we'll prefer libc if neither have bind_textdomain_codeset(),
7952
# and both have dgettext and ngettext
7954
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
7955
glib_save_LIBS="$LIBS"
7956
LIBS="$LIBS -lintl $libintl_extra_libs"
7957
unset ac_cv_func_bind_textdomain_codeset
7958
AC_CHECK_FUNCS(bind_textdomain_codeset)
7959
LIBS="$glib_save_LIBS"
7961
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
7962
gt_cv_func_dgettext_libc=no
7964
if test "$gt_cv_func_dgettext_libc" = "yes" \
7965
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
7966
gt_cv_func_dgettext_libintl=no
7972
if test "$gt_cv_func_dgettext_libc" = "yes" \
7973
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
7974
gt_cv_have_gettext=yes
7977
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
7978
INTLLIBS="-lintl $libintl_extra_libs"
7981
if test "$gt_cv_have_gettext" = "yes"; then
7982
AC_DEFINE(HAVE_GETTEXT,1,
7983
[Define if the GNU gettext() function is already present or preinstalled.])
7984
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
7985
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
7986
if test "$MSGFMT" != "no"; then
7987
glib_save_LIBS="$LIBS"
7988
LIBS="$LIBS $INTLLIBS"
7989
AC_CHECK_FUNCS(dcgettext)
7991
AC_MSG_CHECKING([if msgfmt accepts -c])
7992
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
7995
"Content-Type: text/plain; charset=UTF-8\n"
7996
"Project-Id-Version: test 1.0\n"
7997
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
7998
"Last-Translator: test <foo@bar.xx>\n"
7999
"Language-Team: C <LL@li.org>\n"
8000
"MIME-Version: 1.0\n"
8001
"Content-Transfer-Encoding: 8bit\n"
8002
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
8003
AC_SUBST(MSGFMT_OPTS)
8004
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
8005
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
8006
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
8007
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
8008
return _nl_msg_cat_cntr],
8013
dnl On Solaris, if bind_textdomain_codeset is in libc,
8014
dnl GNU format message catalog is always supported,
8015
dnl since both are added to the libc all together.
8016
dnl Hence, we'd like to go with DATADIRNAME=share and
8017
dnl and CATOBJEXT=.gmo in this case.
8018
AC_CHECK_FUNC(bind_textdomain_codeset,
8029
LIBS="$glib_save_LIBS"
8032
gt_cv_have_gettext=no
8037
if test "$gt_cv_have_gettext" = "yes" ; then
8038
AC_DEFINE(ENABLE_NLS, 1,
8039
[always defined to indicate that i18n is enabled])
8042
dnl Test whether we really found GNU xgettext.
8043
if test "$XGETTEXT" != ":"; then
8044
dnl If it is not GNU xgettext we define it as : so that the
8045
dnl Makefiles still can work.
8046
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
8050
[found xgettext program is not GNU xgettext; ignore it])
8055
# We need to process the po/ directory.
8059
[case "$CONFIG_FILES" in *po/Makefile.in*)
8060
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
8063
dnl These rules are solely for the distribution goal. While doing this
8064
dnl we only have to keep exactly one list of the available catalogs
8065
dnl in configure.in.
8066
for lang in $ALL_LINGUAS; do
8067
GMOFILES="$GMOFILES $lang.gmo"
8068
POFILES="$POFILES $lang.po"
8071
dnl Make all variables we use known to autoconf.
8074
AC_SUBST(DATADIRNAME)
8076
AC_SUBST(INSTOBJEXT)
8078
AC_SUBST(PO_IN_DATADIR_TRUE)
8079
AC_SUBST(PO_IN_DATADIR_FALSE)
8084
# AM_GLIB_GNU_GETTEXT
8085
# -------------------
8086
# Do checks necessary for use of gettext. If a suitable implementation
8087
# of gettext is found in either in libintl or in the C library,
8088
# it will set INTLLIBS to the libraries needed for use of gettext
8089
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
8090
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
8091
# on various variables needed by the Makefile.in.in installed by
8094
glib_DEFUN([GLIB_GNU_GETTEXT],
8095
[AC_REQUIRE([AC_PROG_CC])dnl
8096
AC_REQUIRE([AC_HEADER_STDC])dnl
8101
if test "$gt_cv_have_gettext" = "yes"; then
8102
if test "x$ALL_LINGUAS" = "x"; then
8105
AC_MSG_CHECKING(for catalogs to be installed)
8107
for presentlang in $ALL_LINGUAS; do
8109
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
8110
desiredlanguages="$LINGUAS"
8112
desiredlanguages="$ALL_LINGUAS"
8114
for desiredlang in $desiredlanguages; do
8115
# Use the presentlang catalog if desiredlang is
8116
# a. equal to presentlang, or
8117
# b. a variant of presentlang (because in this case,
8118
# presentlang can be used as a fallback for messages
8119
# which are not translated in the desiredlang catalog).
8120
case "$desiredlang" in
8121
"$presentlang"*) useit=yes;;
8124
if test $useit = yes; then
8125
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
8128
LINGUAS=$NEW_LINGUAS
8129
AC_MSG_RESULT($LINGUAS)
8132
dnl Construct list of names of catalog files to be constructed.
8133
if test -n "$LINGUAS"; then
8134
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
8138
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
8139
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
8140
dnl Try to locate is.
8142
if test -n "$ac_aux_dir"; then
8143
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
8145
if test -z "$MKINSTALLDIRS"; then
8146
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
8148
AC_SUBST(MKINSTALLDIRS)
8150
dnl Generate list of files to be processed by xgettext which will
8151
dnl be included in po/Makefile.
8152
test -d po || mkdir po
8153
if test "x$srcdir" != "x."; then
8154
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
8155
posrcprefix="$srcdir/"
8157
posrcprefix="../$srcdir/"
8163
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
8164
< $srcdir/po/POTFILES.in > po/POTFILES
8167
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
8168
# -------------------------------
8169
# Define VARIABLE to the location where catalog files will
8170
# be installed by po/Makefile.
8171
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
8172
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
8173
glib_save_prefix="$prefix"
8174
glib_save_exec_prefix="$exec_prefix"
8175
glib_save_datarootdir="$datarootdir"
8176
test "x$prefix" = xNONE && prefix=$ac_default_prefix
8177
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
8178
datarootdir=`eval echo "${datarootdir}"`
8179
if test "x$CATOBJEXT" = "x.mo" ; then
8180
localedir=`eval echo "${libdir}/locale"`
8182
localedir=`eval echo "${datadir}/locale"`
8184
prefix="$glib_save_prefix"
8185
exec_prefix="$glib_save_exec_prefix"
8186
datarootdir="$glib_save_datarootdir"
8187
AC_DEFINE_UNQUOTED($1, "$localedir",
8188
[Define the location where the catalogs will be installed])
8192
dnl Now the definitions that aclocal will find
8194
ifdef(glib_configure_in,[],[
8195
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
8196
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
8199
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
8201
# Create a temporary file with TEST-FILE as its contents and pass the
8202
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
8203
# 0 and perform ACTION-IF-FAIL for any other exit status.
8204
AC_DEFUN([GLIB_RUN_PROG],
8205
[cat >conftest.foo <<_ACEOF
8208
if AC_RUN_LOG([$1 conftest.foo]); then
8209
m4_ifval([$3], [$3], [:])
8210
m4_ifvaln([$4], [else $4])dnl
8211
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
8212
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
8216
8205
m4_include([m4/gnome-doc-utils.m4])
8217
8206
m4_include([m4/intltool.m4])