~ubuntu-branches/ubuntu/intrepid/gnome-system-tools/intrepid-updates

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2008-09-23 18:51:35 UTC
  • mfrom: (1.1.32 upstream)
  • Revision ID: james.westby@ubuntu.com-20080923185135-du03j0nnk1xmhfjk
Tags: 2.22.1-0ubuntu1
* New upstream release (LP: #273579)
  - Mark interface as active if it wasn't previously configured, and as
    auto if it's been (or already was) activated
  - Translation update
* 90_from_svn_correctly_configure_interface.patch: removed as applied
  upstream
* 98_automake.patch: some changes to comply with new source file

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
 
m4_if(AC_AUTOCONF_VERSION, [2.61],,
17
 
[m4_warning([this file was generated for autoconf 2.61.
 
16
m4_if(AC_AUTOCONF_VERSION, [2.62],,
 
17
[m4_warning([this file was generated for autoconf 2.62.
18
18
You have another version of autoconf.  It may work, but is not guaranteed to.
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
945
945
    GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
946
946
  fi
947
947
 
948
 
  AC_ARG_WITH(gconf-source, 
949
 
  [  --with-gconf-source=sourceaddress      Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
 
948
  AC_ARG_WITH([gconf-source],
 
949
              AC_HELP_STRING([--with-gconf-source=sourceaddress],
 
950
                             [Config database for installing schema files.]),
 
951
              [GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
950
952
 
951
953
  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
952
954
  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
955
957
    GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
956
958
  fi
957
959
 
958
 
  AC_ARG_WITH(gconf-schema-file-dir, 
959
 
  [  --with-gconf-schema-file-dir=dir        Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
 
960
  AC_ARG_WITH([gconf-schema-file-dir],
 
961
              AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
 
962
                             [Directory for installing schema files.]),
 
963
              [GCONF_SCHEMA_FILE_DIR="$withval"],)
960
964
 
961
965
  AC_SUBST(GCONF_SCHEMA_FILE_DIR)
962
966
  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
970
974
  AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
971
975
])
972
976
 
 
977
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
978
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
 
979
#
 
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.
 
985
#
 
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.
 
989
#
 
990
# Macro to add for using GNU gettext.
 
991
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
 
992
#
 
993
# Modified to never use included libintl. 
 
994
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
 
995
#
 
996
# Major rework to remove unused code
 
997
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
 
998
#
 
999
# Added better handling of ALL_LINGUAS from GNU gettext version 
 
1000
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
 
1001
#
 
1002
# Modified to require ngettext
 
1003
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
 
1004
#
 
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
 
1008
AC_PREREQ(2.53)
 
1009
 
 
1010
dnl
 
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.
 
1014
dnl
 
1015
m4_copy([AC_DEFUN],[glib_DEFUN])
 
1016
m4_copy([AC_REQUIRE],[glib_REQUIRE])
 
1017
dnl
 
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.
 
1020
dnl
 
1021
 
 
1022
# GLIB_LC_MESSAGES
 
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.])
 
1033
    fi
 
1034
  fi])
 
1035
 
 
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,
 
1045
[case "[$]$1" in
 
1046
  /*)
 
1047
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
1048
  ;;
 
1049
  *)
 
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
 
1054
      if [$3]; then
 
1055
        ac_cv_path_$1="$ac_dir/$ac_word"
 
1056
        break
 
1057
      fi
 
1058
    fi
 
1059
  done
 
1060
  IFS="$ac_save_ifs"
 
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"
 
1064
])dnl
 
1065
  ;;
 
1066
esac])dnl
 
1067
$1="$ac_cv_path_$1"
 
1068
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
1069
  AC_MSG_RESULT([$]$1)
 
1070
else
 
1071
  AC_MSG_RESULT(no)
 
1072
fi
 
1073
AC_SUBST($1)dnl
 
1074
])
 
1075
 
 
1076
# GLIB_WITH_NLS
 
1077
#-----------------
 
1078
glib_DEFUN([GLIB_WITH_NLS],
 
1079
  dnl NLS is obligatory
 
1080
  [USE_NLS=yes
 
1081
    AC_SUBST(USE_NLS)
 
1082
 
 
1083
    gt_cv_have_gettext=no
 
1084
 
 
1085
    CATOBJEXT=NONE
 
1086
    XGETTEXT=:
 
1087
    INTLLIBS=
 
1088
 
 
1089
    AC_CHECK_HEADER(libintl.h,
 
1090
     [gt_cv_func_dgettext_libintl="no"
 
1091
      libintl_extra_libs=""
 
1092
 
 
1093
      #
 
1094
      # First check in libc
 
1095
      #
 
1096
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
 
1097
        [AC_TRY_LINK([
 
1098
#include <libintl.h>
 
1099
],
 
1100
         [return !ngettext ("","", 1)],
 
1101
          gt_cv_func_ngettext_libc=yes,
 
1102
          gt_cv_func_ngettext_libc=no)
 
1103
        ])
 
1104
  
 
1105
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1106
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
 
1107
                [AC_TRY_LINK([
 
1108
#include <libintl.h>
 
1109
],
 
1110
                  [return !dgettext ("","")],
 
1111
                  gt_cv_func_dgettext_libc=yes,
 
1112
                  gt_cv_func_dgettext_libc=no)
 
1113
                ])
 
1114
      fi
 
1115
  
 
1116
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1117
        AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1118
      fi
 
1119
 
 
1120
      #
 
1121
      # If we don't have everything we want, check in libintl
 
1122
      #
 
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
 
1126
        
 
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)])])
 
1131
 
 
1132
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 
1133
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
 
1134
          AC_MSG_RESULT([])
 
1135
          AC_CHECK_LIB(intl, ngettext,
 
1136
                [AC_CHECK_LIB(intl, dcgettext,
 
1137
                       [gt_cv_func_dgettext_libintl=yes
 
1138
                        libintl_extra_libs=-liconv],
 
1139
                        :,-liconv)],
 
1140
                :,-liconv)
 
1141
        fi
 
1142
 
 
1143
        #
 
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
 
1147
        #
 
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"
 
1154
 
 
1155
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
 
1156
            gt_cv_func_dgettext_libc=no
 
1157
          else
 
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
 
1161
            fi
 
1162
          fi
 
1163
        fi
 
1164
      fi
 
1165
 
 
1166
      if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1167
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1168
        gt_cv_have_gettext=yes
 
1169
      fi
 
1170
  
 
1171
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1172
        INTLLIBS="-lintl $libintl_extra_libs"
 
1173
      fi
 
1174
  
 
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)
 
1184
          MSGFMT_OPTS=
 
1185
          AC_MSG_CHECKING([if msgfmt accepts -c])
 
1186
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
 
1187
msgid ""
 
1188
msgstr ""
 
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],
 
1203
            [CATOBJEXT=.gmo 
 
1204
             DATADIRNAME=share],
 
1205
            [case $host in
 
1206
            *-*-solaris*)
 
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,
 
1213
              [CATOBJEXT=.gmo 
 
1214
               DATADIRNAME=share],
 
1215
              [CATOBJEXT=.mo
 
1216
               DATADIRNAME=lib])
 
1217
            ;;
 
1218
            *)
 
1219
            CATOBJEXT=.mo
 
1220
            DATADIRNAME=lib
 
1221
            ;;
 
1222
            esac])
 
1223
          LIBS="$glib_save_LIBS"
 
1224
          INSTOBJEXT=.mo
 
1225
        else
 
1226
          gt_cv_have_gettext=no
 
1227
        fi
 
1228
      fi
 
1229
    ])
 
1230
 
 
1231
    if test "$gt_cv_have_gettext" = "yes" ; then
 
1232
      AC_DEFINE(ENABLE_NLS, 1,
 
1233
        [always defined to indicate that i18n is enabled])
 
1234
    fi
 
1235
 
 
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
 
1241
        : ;
 
1242
      else
 
1243
        AC_MSG_RESULT(
 
1244
          [found xgettext program is not GNU xgettext; ignore it])
 
1245
        XGETTEXT=":"
 
1246
      fi
 
1247
    fi
 
1248
 
 
1249
    # We need to process the po/ directory.
 
1250
    POSUB=po
 
1251
 
 
1252
    AC_OUTPUT_COMMANDS(
 
1253
      [case "$CONFIG_FILES" in *po/Makefile.in*)
 
1254
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
1255
      esac])
 
1256
 
 
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"
 
1263
    done
 
1264
 
 
1265
    dnl Make all variables we use known to autoconf.
 
1266
    AC_SUBST(CATALOGS)
 
1267
    AC_SUBST(CATOBJEXT)
 
1268
    AC_SUBST(DATADIRNAME)
 
1269
    AC_SUBST(GMOFILES)
 
1270
    AC_SUBST(INSTOBJEXT)
 
1271
    AC_SUBST(INTLLIBS)
 
1272
    AC_SUBST(PO_IN_DATADIR_TRUE)
 
1273
    AC_SUBST(PO_IN_DATADIR_FALSE)
 
1274
    AC_SUBST(POFILES)
 
1275
    AC_SUBST(POSUB)
 
1276
  ])
 
1277
 
 
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 
 
1286
# glib-gettextize.
 
1287
dnl
 
1288
glib_DEFUN([GLIB_GNU_GETTEXT],
 
1289
  [AC_REQUIRE([AC_PROG_CC])dnl
 
1290
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
1291
   
 
1292
   GLIB_LC_MESSAGES
 
1293
   GLIB_WITH_NLS
 
1294
 
 
1295
   if test "$gt_cv_have_gettext" = "yes"; then
 
1296
     if test "x$ALL_LINGUAS" = "x"; then
 
1297
       LINGUAS=
 
1298
     else
 
1299
       AC_MSG_CHECKING(for catalogs to be installed)
 
1300
       NEW_LINGUAS=
 
1301
       for presentlang in $ALL_LINGUAS; do
 
1302
         useit=no
 
1303
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
 
1304
           desiredlanguages="$LINGUAS"
 
1305
         else
 
1306
           desiredlanguages="$ALL_LINGUAS"
 
1307
         fi
 
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;;
 
1316
           esac
 
1317
         done
 
1318
         if test $useit = yes; then
 
1319
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
 
1320
         fi
 
1321
       done
 
1322
       LINGUAS=$NEW_LINGUAS
 
1323
       AC_MSG_RESULT($LINGUAS)
 
1324
     fi
 
1325
 
 
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
 
1329
     fi
 
1330
   fi
 
1331
 
 
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.
 
1335
   MKINSTALLDIRS=
 
1336
   if test -n "$ac_aux_dir"; then
 
1337
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
1338
   fi
 
1339
   if test -z "$MKINSTALLDIRS"; then
 
1340
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
1341
   fi
 
1342
   AC_SUBST(MKINSTALLDIRS)
 
1343
 
 
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/"
 
1350
     else
 
1351
       posrcprefix="../$srcdir/"
 
1352
     fi
 
1353
   else
 
1354
     posrcprefix="../"
 
1355
   fi
 
1356
   rm -f po/POTFILES
 
1357
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 
1358
        < $srcdir/po/POTFILES.in > po/POTFILES
 
1359
  ])
 
1360
 
 
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"`
 
1375
else
 
1376
  localedir=`eval echo "${datadir}/locale"`
 
1377
fi
 
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])
 
1383
])
 
1384
 
 
1385
dnl
 
1386
dnl Now the definitions that aclocal will find
 
1387
dnl
 
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($@)])
 
1391
])dnl
 
1392
 
 
1393
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
 
1394
 
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
 
1400
$2
 
1401
_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
 
1407
fi])
 
1408
 
 
1409
 
973
1410
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
974
1411
 
975
 
# serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL
 
1412
# serial 52 AC_PROG_LIBTOOL
976
1413
 
977
1414
 
978
1415
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
1596
2033
      esac
1597
2034
      ;;
1598
2035
    *64-bit*)
 
2036
      libsuff=64
1599
2037
      case $host in
1600
2038
        x86_64-*kfreebsd*-gnu)
1601
2039
          LD="${LD-ld} -m elf_x86_64_fbsd"
2658
3096
  # Some rework will be needed to allow for fast_install
2659
3097
  # before this can be enabled.
2660
3098
  hardcode_into_libs=yes
 
3099
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
 
3100
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2661
3101
 
2662
3102
  # Append ld.so.conf contents to the search path
2663
3103
  if test -f /etc/ld.so.conf; then
2664
3104
    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2665
 
    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
 
3105
    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2666
3106
  fi
2667
3107
 
2668
3108
  # We used to test for /lib/ld.so.1 and disable shared libraries on
2674
3114
  dynamic_linker='GNU/Linux ld.so'
2675
3115
  ;;
2676
3116
 
2677
 
netbsdelf*-gnu)
2678
 
  version_type=linux
2679
 
  need_lib_prefix=no
2680
 
  need_version=no
2681
 
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2682
 
  soname_spec='${libname}${release}${shared_ext}$major'
2683
 
  shlibpath_var=LD_LIBRARY_PATH
2684
 
  shlibpath_overrides_runpath=no
2685
 
  hardcode_into_libs=yes
2686
 
  dynamic_linker='NetBSD ld.elf_so'
2687
 
  ;;
2688
 
 
2689
3117
netbsd*)
2690
3118
  version_type=sunos
2691
3119
  need_lib_prefix=no
3467
3895
  lt_cv_deplibs_check_method=pass_all
3468
3896
  ;;
3469
3897
 
3470
 
netbsd* | netbsdelf*-gnu)
 
3898
netbsd*)
3471
3899
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3472
3900
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3473
3901
  else
4474
4902
        ;;
4475
4903
    esac
4476
4904
    ;;
4477
 
  netbsd* | netbsdelf*-gnu)
 
4905
  netbsd*)
4478
4906
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
4479
4907
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
4480
4908
      wlarc=
6166
6594
            ;;
6167
6595
        esac
6168
6596
        ;;
6169
 
      netbsd* | netbsdelf*-gnu)
 
6597
      netbsd*)
6170
6598
        ;;
6171
6599
      osf3* | osf4* | osf5*)
6172
6600
        case $cc_basename in
6543
6971
  cygwin* | mingw*)
6544
6972
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
6545
6973
  ;;
6546
 
  linux* | k*bsd*-gnu)
6547
 
    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
6548
 
  ;;
6549
6974
  *)
6550
6975
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6551
6976
  ;;
6754
7179
  $echo "local: *; };" >> $output_objdir/$libname.ver~
6755
7180
          $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6756
7181
        fi
6757
 
        _LT_AC_TAGVAR(link_all_deplibs, $1)=no
6758
7182
      else
6759
7183
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
6760
7184
      fi
6761
7185
      ;;
6762
7186
 
6763
 
    netbsd* | netbsdelf*-gnu)
 
7187
    netbsd*)
6764
7188
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6765
7189
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6766
7190
        wlarc=
7191
7615
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7192
7616
      ;;
7193
7617
 
7194
 
    netbsd* | netbsdelf*-gnu)
 
7618
    netbsd*)
7195
7619
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
7196
7620
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
7197
7621
      else
7690
8114
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
7691
8115
# ---------------------------------------------
7692
8116
m4_define([_PKG_CONFIG],
7693
 
[if test -n "$PKG_CONFIG"; then
7694
 
    if test -n "$$1"; then
7695
 
        pkg_cv_[]$1="$$1"
7696
 
    else
7697
 
        PKG_CHECK_EXISTS([$3],
7698
 
                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
7699
 
                         [pkg_failed=yes])
7700
 
    fi
7701
 
else
7702
 
        pkg_failed=untried
 
8117
[if test -n "$$1"; then
 
8118
    pkg_cv_[]$1="$$1"
 
8119
 elif test -n "$PKG_CONFIG"; then
 
8120
    PKG_CHECK_EXISTS([$3],
 
8121
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
8122
                     [pkg_failed=yes])
 
8123
 else
 
8124
    pkg_failed=untried
7703
8125
fi[]dnl
7704
8126
])# _PKG_CONFIG
7705
8127
 
7743
8165
if test $pkg_failed = yes; then
7744
8166
        _PKG_SHORT_ERRORS_SUPPORTED
7745
8167
        if test $_pkg_short_errors_supported = yes; then
7746
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
 
8168
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
7747
8169
        else 
7748
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
8170
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
7749
8171
        fi
7750
8172
        # Put the nasty error message in config.log where it belongs
7751
8173
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
7780
8202
fi[]dnl
7781
8203
])# PKG_CHECK_MODULES
7782
8204
 
7783
 
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
7784
 
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
7785
 
#
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.
7791
 
#
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.
7795
 
#
7796
 
# Macro to add for using GNU gettext.
7797
 
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
7798
 
#
7799
 
# Modified to never use included libintl. 
7800
 
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
7801
 
#
7802
 
# Major rework to remove unused code
7803
 
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
7804
 
#
7805
 
# Added better handling of ALL_LINGUAS from GNU gettext version 
7806
 
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
7807
 
#
7808
 
# Modified to require ngettext
7809
 
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
7810
 
#
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
7814
 
AC_PREREQ(2.53)
7815
 
 
7816
 
dnl
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.
7820
 
dnl
7821
 
m4_copy([AC_DEFUN],[glib_DEFUN])
7822
 
m4_copy([AC_REQUIRE],[glib_REQUIRE])
7823
 
dnl
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.
7826
 
dnl
7827
 
 
7828
 
# GLIB_LC_MESSAGES
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.])
7839
 
    fi
7840
 
  fi])
7841
 
 
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,
7851
 
[case "[$]$1" in
7852
 
  /*)
7853
 
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
7854
 
  ;;
7855
 
  *)
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
7860
 
      if [$3]; then
7861
 
        ac_cv_path_$1="$ac_dir/$ac_word"
7862
 
        break
7863
 
      fi
7864
 
    fi
7865
 
  done
7866
 
  IFS="$ac_save_ifs"
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"
7870
 
])dnl
7871
 
  ;;
7872
 
esac])dnl
7873
 
$1="$ac_cv_path_$1"
7874
 
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
7875
 
  AC_MSG_RESULT([$]$1)
7876
 
else
7877
 
  AC_MSG_RESULT(no)
7878
 
fi
7879
 
AC_SUBST($1)dnl
7880
 
])
7881
 
 
7882
 
# GLIB_WITH_NLS
7883
 
#-----------------
7884
 
glib_DEFUN([GLIB_WITH_NLS],
7885
 
  dnl NLS is obligatory
7886
 
  [USE_NLS=yes
7887
 
    AC_SUBST(USE_NLS)
7888
 
 
7889
 
    gt_cv_have_gettext=no
7890
 
 
7891
 
    CATOBJEXT=NONE
7892
 
    XGETTEXT=:
7893
 
    INTLLIBS=
7894
 
 
7895
 
    AC_CHECK_HEADER(libintl.h,
7896
 
     [gt_cv_func_dgettext_libintl="no"
7897
 
      libintl_extra_libs=""
7898
 
 
7899
 
      #
7900
 
      # First check in libc
7901
 
      #
7902
 
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
7903
 
        [AC_TRY_LINK([
7904
 
#include <libintl.h>
7905
 
],
7906
 
         [return !ngettext ("","", 1)],
7907
 
          gt_cv_func_ngettext_libc=yes,
7908
 
          gt_cv_func_ngettext_libc=no)
7909
 
        ])
7910
 
  
7911
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7912
 
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
7913
 
                [AC_TRY_LINK([
7914
 
#include <libintl.h>
7915
 
],
7916
 
                  [return !dgettext ("","")],
7917
 
                  gt_cv_func_dgettext_libc=yes,
7918
 
                  gt_cv_func_dgettext_libc=no)
7919
 
                ])
7920
 
      fi
7921
 
  
7922
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7923
 
        AC_CHECK_FUNCS(bind_textdomain_codeset)
7924
 
      fi
7925
 
 
7926
 
      #
7927
 
      # If we don't have everything we want, check in libintl
7928
 
      #
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
7932
 
        
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)])])
7937
 
 
7938
 
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
7939
 
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
7940
 
          AC_MSG_RESULT([])
7941
 
          AC_CHECK_LIB(intl, ngettext,
7942
 
                [AC_CHECK_LIB(intl, dcgettext,
7943
 
                       [gt_cv_func_dgettext_libintl=yes
7944
 
                        libintl_extra_libs=-liconv],
7945
 
                        :,-liconv)],
7946
 
                :,-liconv)
7947
 
        fi
7948
 
 
7949
 
        #
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
7953
 
        #
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"
7960
 
 
7961
 
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
7962
 
            gt_cv_func_dgettext_libc=no
7963
 
          else
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
7967
 
            fi
7968
 
          fi
7969
 
        fi
7970
 
      fi
7971
 
 
7972
 
      if test "$gt_cv_func_dgettext_libc" = "yes" \
7973
 
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
7974
 
        gt_cv_have_gettext=yes
7975
 
      fi
7976
 
  
7977
 
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
7978
 
        INTLLIBS="-lintl $libintl_extra_libs"
7979
 
      fi
7980
 
  
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)
7990
 
          MSGFMT_OPTS=
7991
 
          AC_MSG_CHECKING([if msgfmt accepts -c])
7992
 
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
7993
 
msgid ""
7994
 
msgstr ""
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],
8009
 
            [CATOBJEXT=.gmo 
8010
 
             DATADIRNAME=share],
8011
 
            [case $host in
8012
 
            *-*-solaris*)
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,
8019
 
              [CATOBJEXT=.gmo 
8020
 
               DATADIRNAME=share],
8021
 
              [CATOBJEXT=.mo
8022
 
               DATADIRNAME=lib])
8023
 
            ;;
8024
 
            *)
8025
 
            CATOBJEXT=.mo
8026
 
            DATADIRNAME=lib
8027
 
            ;;
8028
 
            esac])
8029
 
          LIBS="$glib_save_LIBS"
8030
 
          INSTOBJEXT=.mo
8031
 
        else
8032
 
          gt_cv_have_gettext=no
8033
 
        fi
8034
 
      fi
8035
 
    ])
8036
 
 
8037
 
    if test "$gt_cv_have_gettext" = "yes" ; then
8038
 
      AC_DEFINE(ENABLE_NLS, 1,
8039
 
        [always defined to indicate that i18n is enabled])
8040
 
    fi
8041
 
 
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
8047
 
        : ;
8048
 
      else
8049
 
        AC_MSG_RESULT(
8050
 
          [found xgettext program is not GNU xgettext; ignore it])
8051
 
        XGETTEXT=":"
8052
 
      fi
8053
 
    fi
8054
 
 
8055
 
    # We need to process the po/ directory.
8056
 
    POSUB=po
8057
 
 
8058
 
    AC_OUTPUT_COMMANDS(
8059
 
      [case "$CONFIG_FILES" in *po/Makefile.in*)
8060
 
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
8061
 
      esac])
8062
 
 
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"
8069
 
    done
8070
 
 
8071
 
    dnl Make all variables we use known to autoconf.
8072
 
    AC_SUBST(CATALOGS)
8073
 
    AC_SUBST(CATOBJEXT)
8074
 
    AC_SUBST(DATADIRNAME)
8075
 
    AC_SUBST(GMOFILES)
8076
 
    AC_SUBST(INSTOBJEXT)
8077
 
    AC_SUBST(INTLLIBS)
8078
 
    AC_SUBST(PO_IN_DATADIR_TRUE)
8079
 
    AC_SUBST(PO_IN_DATADIR_FALSE)
8080
 
    AC_SUBST(POFILES)
8081
 
    AC_SUBST(POSUB)
8082
 
  ])
8083
 
 
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 
8092
 
# glib-gettextize.
8093
 
dnl
8094
 
glib_DEFUN([GLIB_GNU_GETTEXT],
8095
 
  [AC_REQUIRE([AC_PROG_CC])dnl
8096
 
   AC_REQUIRE([AC_HEADER_STDC])dnl
8097
 
   
8098
 
   GLIB_LC_MESSAGES
8099
 
   GLIB_WITH_NLS
8100
 
 
8101
 
   if test "$gt_cv_have_gettext" = "yes"; then
8102
 
     if test "x$ALL_LINGUAS" = "x"; then
8103
 
       LINGUAS=
8104
 
     else
8105
 
       AC_MSG_CHECKING(for catalogs to be installed)
8106
 
       NEW_LINGUAS=
8107
 
       for presentlang in $ALL_LINGUAS; do
8108
 
         useit=no
8109
 
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
8110
 
           desiredlanguages="$LINGUAS"
8111
 
         else
8112
 
           desiredlanguages="$ALL_LINGUAS"
8113
 
         fi
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;;
8122
 
           esac
8123
 
         done
8124
 
         if test $useit = yes; then
8125
 
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
8126
 
         fi
8127
 
       done
8128
 
       LINGUAS=$NEW_LINGUAS
8129
 
       AC_MSG_RESULT($LINGUAS)
8130
 
     fi
8131
 
 
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
8135
 
     fi
8136
 
   fi
8137
 
 
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.
8141
 
   MKINSTALLDIRS=
8142
 
   if test -n "$ac_aux_dir"; then
8143
 
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
8144
 
   fi
8145
 
   if test -z "$MKINSTALLDIRS"; then
8146
 
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
8147
 
   fi
8148
 
   AC_SUBST(MKINSTALLDIRS)
8149
 
 
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/"
8156
 
     else
8157
 
       posrcprefix="../$srcdir/"
8158
 
     fi
8159
 
   else
8160
 
     posrcprefix="../"
8161
 
   fi
8162
 
   rm -f po/POTFILES
8163
 
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
8164
 
        < $srcdir/po/POTFILES.in > po/POTFILES
8165
 
  ])
8166
 
 
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"`
8181
 
else
8182
 
  localedir=`eval echo "${datadir}/locale"`
8183
 
fi
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])
8189
 
])
8190
 
 
8191
 
dnl
8192
 
dnl Now the definitions that aclocal will find
8193
 
dnl
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($@)])
8197
 
])dnl
8198
 
 
8199
 
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
8200
 
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
8206
 
$2
8207
 
_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
8213
 
fi])
8214
 
 
8215
 
 
8216
8205
m4_include([m4/gnome-doc-utils.m4])
8217
8206
m4_include([m4/intltool.m4])