Blame m4macros/glib-gettext.m4

Packit ae235b
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
Packit ae235b
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
Packit ae235b
#
Packit ae235b
# This file is free software, distributed under the terms of the GNU
Packit ae235b
# General Public License.  As a special exception to the GNU General
Packit ae235b
# Public License, this file may be distributed as part of a program
Packit ae235b
# that contains a configuration script generated by Autoconf, under
Packit ae235b
# the same distribution terms as the rest of that program.
Packit ae235b
#
Packit ae235b
# This file can be copied and used freely without restrictions.  It can
Packit ae235b
# be used in projects which are not available under the GNU Public License
Packit ae235b
# but which still want to provide support for the GNU gettext functionality.
Packit ae235b
#
Packit ae235b
# Macro to add for using GNU gettext.
Packit ae235b
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
Packit ae235b
#
Packit ae235b
# Modified to never use included libintl. 
Packit ae235b
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
Packit ae235b
#
Packit ae235b
# Major rework to remove unused code
Packit ae235b
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
Packit ae235b
#
Packit ae235b
# Added better handling of ALL_LINGUAS from GNU gettext version 
Packit ae235b
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
Packit ae235b
#
Packit ae235b
# Modified to require ngettext
Packit ae235b
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
Packit ae235b
Packit ae235b
# Increment this whenever this file is changed.
Packit ae235b
#serial 1
Packit ae235b
Packit ae235b
# We need this here as well, since someone might use autoconf-2.5x
Packit ae235b
# to configure GLib then an older version to configure a package
Packit ae235b
# using AM_GLIB_GNU_GETTEXT
Packit ae235b
AC_PREREQ(2.53)
Packit ae235b
Packit ae235b
dnl
Packit ae235b
dnl We go to great lengths to make sure that aclocal won't 
Packit ae235b
dnl try to pull in the installed version of these macros
Packit ae235b
dnl when running aclocal in the glib directory.
Packit ae235b
dnl
Packit ae235b
m4_copy([AC_DEFUN],[glib_DEFUN])
Packit ae235b
m4_copy([AC_REQUIRE],[glib_REQUIRE])
Packit ae235b
dnl
Packit ae235b
dnl At the end, if we're not within glib, we'll define the public
Packit ae235b
dnl definitions in terms of our private definitions.
Packit ae235b
dnl
Packit ae235b
Packit ae235b
# GLIB_LC_MESSAGES
Packit ae235b
#--------------------
Packit ae235b
glib_DEFUN([GLIB_LC_MESSAGES],
Packit ae235b
  [AC_CHECK_HEADERS([locale.h])
Packit ae235b
    if test $ac_cv_header_locale_h = yes; then
Packit ae235b
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
Packit ae235b
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
Packit ae235b
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
Packit ae235b
    if test $am_cv_val_LC_MESSAGES = yes; then
Packit ae235b
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
Packit ae235b
        [Define if your <locale.h> file defines LC_MESSAGES.])
Packit ae235b
    fi
Packit ae235b
  fi])
Packit ae235b
Packit ae235b
# GLIB_PATH_PROG_WITH_TEST
Packit ae235b
#----------------------------
Packit ae235b
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
Packit ae235b
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
Packit ae235b
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
Packit ae235b
[# Extract the first word of "$2", so it can be a program name with args.
Packit ae235b
set dummy $2; ac_word=[$]2
Packit ae235b
AC_MSG_CHECKING([for $ac_word])
Packit ae235b
AC_CACHE_VAL(ac_cv_path_$1,
Packit ae235b
[case "[$]$1" in
Packit ae235b
  /*)
Packit ae235b
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
Packit ae235b
  ;;
Packit ae235b
  *)
Packit ae235b
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
Packit ae235b
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
Packit ae235b
    test -z "$ac_dir" && ac_dir=.
Packit ae235b
    if test -f $ac_dir/$ac_word; then
Packit ae235b
      if [$3]; then
Packit ae235b
	ac_cv_path_$1="$ac_dir/$ac_word"
Packit ae235b
	break
Packit ae235b
      fi
Packit ae235b
    fi
Packit ae235b
  done
Packit ae235b
  IFS="$ac_save_ifs"
Packit ae235b
dnl If no 4th arg is given, leave the cache variable unset,
Packit ae235b
dnl so AC_PATH_PROGS will keep looking.
Packit ae235b
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
Packit ae235b
])dnl
Packit ae235b
  ;;
Packit ae235b
esac])dnl
Packit ae235b
$1="$ac_cv_path_$1"
Packit ae235b
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
Packit ae235b
  AC_MSG_RESULT([$]$1)
Packit ae235b
else
Packit ae235b
  AC_MSG_RESULT(no)
Packit ae235b
fi
Packit ae235b
AC_SUBST($1)dnl
Packit ae235b
])
Packit ae235b
Packit ae235b
dnl Checks for special options needed on Mac OS X.
Packit ae235b
dnl Defines INTL_MACOSX_LIBS.
Packit ae235b
dnl
Packit ae235b
dnl Copied from intlmacosx.m4 in gettext, GPL.
Packit ae235b
dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
Packit ae235b
glib_DEFUN([glib_gt_INTL_MACOSX],
Packit ae235b
[
Packit ae235b
  dnl Check for API introduced in Mac OS X 10.2.
Packit ae235b
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
Packit ae235b
    [gt_cv_func_CFPreferencesCopyAppValue],
Packit ae235b
    [gt_save_LIBS="$LIBS"
Packit ae235b
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
Packit ae235b
     AC_LINK_IFELSE(
Packit ae235b
       [AC_LANG_PROGRAM(
Packit ae235b
          [[#include <CoreFoundation/CFPreferences.h>]],
Packit ae235b
          [[CFPreferencesCopyAppValue(NULL, NULL)]])],
Packit ae235b
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
Packit ae235b
       [gt_cv_func_CFPreferencesCopyAppValue=no])
Packit ae235b
     LIBS="$gt_save_LIBS"])
Packit ae235b
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
Packit ae235b
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
Packit ae235b
      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
Packit ae235b
  fi
Packit ae235b
  dnl Check for API introduced in Mac OS X 10.3.
Packit ae235b
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
Packit ae235b
    [gt_save_LIBS="$LIBS"
Packit ae235b
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
Packit ae235b
     AC_LINK_IFELSE(
Packit ae235b
       [AC_LANG_PROGRAM(
Packit ae235b
          [[#include <CoreFoundation/CFLocale.h>]],
Packit ae235b
          [[CFLocaleCopyCurrent();]])],
Packit ae235b
       [gt_cv_func_CFLocaleCopyCurrent=yes],
Packit ae235b
       [gt_cv_func_CFLocaleCopyCurrent=no])
Packit ae235b
     LIBS="$gt_save_LIBS"])
Packit ae235b
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
Packit ae235b
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
Packit ae235b
      [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
Packit ae235b
  fi
Packit ae235b
  INTL_MACOSX_LIBS=
Packit ae235b
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
Packit ae235b
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
Packit ae235b
  fi
Packit ae235b
  AC_SUBST([INTL_MACOSX_LIBS])
Packit ae235b
])
Packit ae235b
Packit ae235b
# GLIB_WITH_NLS
Packit ae235b
#-----------------
Packit ae235b
glib_DEFUN([GLIB_WITH_NLS],
Packit ae235b
  dnl NLS is obligatory
Packit ae235b
  [USE_NLS=yes
Packit ae235b
    AC_SUBST(USE_NLS)
Packit ae235b
Packit ae235b
    gt_cv_have_gettext=no
Packit ae235b
Packit ae235b
    CATOBJEXT=NONE
Packit ae235b
    XGETTEXT=:
Packit ae235b
    INTLLIBS=
Packit ae235b
Packit ae235b
    glib_gt_INTL_MACOSX
Packit ae235b
Packit ae235b
    AC_CHECK_HEADER(libintl.h,
Packit ae235b
     [gt_cv_func_dgettext_libintl="no"
Packit ae235b
      libintl_extra_libs=""
Packit ae235b
Packit ae235b
      #
Packit ae235b
      # First check in libc
Packit ae235b
      #
Packit ae235b
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
Packit ae235b
        [AC_TRY_LINK([
Packit ae235b
#include <libintl.h>
Packit ae235b
],
Packit ae235b
         [return !ngettext ("","", 1)],
Packit ae235b
	  gt_cv_func_ngettext_libc=yes,
Packit ae235b
          gt_cv_func_ngettext_libc=no)
Packit ae235b
        ])
Packit ae235b
  
Packit ae235b
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
Packit ae235b
	      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
Packit ae235b
        	[AC_TRY_LINK([
Packit ae235b
#include <libintl.h>
Packit ae235b
],
Packit ae235b
	          [return !dgettext ("","")],
Packit ae235b
		  gt_cv_func_dgettext_libc=yes,
Packit ae235b
	          gt_cv_func_dgettext_libc=no)
Packit ae235b
        	])
Packit ae235b
      fi
Packit ae235b
  
Packit ae235b
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
Packit ae235b
        AC_CHECK_FUNCS(bind_textdomain_codeset)
Packit ae235b
      fi
Packit ae235b
Packit ae235b
      #
Packit ae235b
      # If we don't have everything we want, check in libintl
Packit ae235b
      #
Packit ae235b
      if test "$gt_cv_func_dgettext_libc" != "yes" \
Packit ae235b
	 || test "$gt_cv_func_ngettext_libc" != "yes" \
Packit ae235b
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
Packit ae235b
        
Packit ae235b
        AC_CHECK_LIB(intl, bindtextdomain,
Packit ae235b
	    [AC_CHECK_LIB(intl, ngettext,
Packit ae235b
		    [AC_CHECK_LIB(intl, dgettext,
Packit ae235b
			          gt_cv_func_dgettext_libintl=yes)])])
Packit ae235b
Packit ae235b
	if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
Packit ae235b
	  AC_MSG_CHECKING([if -liconv is needed to use gettext])
Packit ae235b
	  AC_MSG_RESULT([])
Packit ae235b
  	  AC_CHECK_LIB(intl, ngettext,
Packit ae235b
          	[AC_CHECK_LIB(intl, dcgettext,
Packit ae235b
		       [gt_cv_func_dgettext_libintl=yes
Packit ae235b
			libintl_extra_libs=-liconv],
Packit ae235b
			:,-liconv)],
Packit ae235b
		:,-liconv)
Packit ae235b
        fi
Packit ae235b
Packit ae235b
        #
Packit ae235b
        # If we found libintl, then check in it for bind_textdomain_codeset();
Packit ae235b
        # we'll prefer libc if neither have bind_textdomain_codeset(),
Packit ae235b
        # and both have dgettext and ngettext
Packit ae235b
        #
Packit ae235b
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
Packit ae235b
          glib_save_LIBS="$LIBS"
Packit ae235b
          LIBS="$LIBS -lintl $libintl_extra_libs"
Packit ae235b
          unset ac_cv_func_bind_textdomain_codeset
Packit ae235b
          AC_CHECK_FUNCS(bind_textdomain_codeset)
Packit ae235b
          LIBS="$glib_save_LIBS"
Packit ae235b
Packit ae235b
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
Packit ae235b
            gt_cv_func_dgettext_libc=no
Packit ae235b
          else
Packit ae235b
            if test "$gt_cv_func_dgettext_libc" = "yes" \
Packit ae235b
		&& test "$gt_cv_func_ngettext_libc" = "yes"; then
Packit ae235b
              gt_cv_func_dgettext_libintl=no
Packit ae235b
            fi
Packit ae235b
          fi
Packit ae235b
        fi
Packit ae235b
      fi
Packit ae235b
Packit ae235b
      if test "$gt_cv_func_dgettext_libc" = "yes" \
Packit ae235b
	|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
Packit ae235b
        gt_cv_have_gettext=yes
Packit ae235b
      fi
Packit ae235b
  
Packit ae235b
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
Packit ae235b
        INTLLIBS="-lintl $libintl_extra_libs $INTL_MACOSX_LIBS"
Packit ae235b
      fi
Packit ae235b
  
Packit ae235b
      if test "$gt_cv_have_gettext" = "yes"; then
Packit ae235b
	AC_DEFINE(HAVE_GETTEXT,1,
Packit ae235b
	  [Define if the GNU gettext() function is already present or preinstalled.])
Packit ae235b
	GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
Packit ae235b
	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
Packit ae235b
	if test "$MSGFMT" != "no"; then
Packit ae235b
          glib_save_LIBS="$LIBS"
Packit ae235b
          LIBS="$LIBS $INTLLIBS"
Packit ae235b
	  AC_CHECK_FUNCS(dcgettext)
Packit ae235b
	  MSGFMT_OPTS=
Packit ae235b
	  AC_MSG_CHECKING([if msgfmt accepts -c])
Packit ae235b
	  GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
Packit ae235b
msgid ""
Packit ae235b
msgstr ""
Packit ae235b
"Content-Type: text/plain; charset=UTF-8\n"
Packit ae235b
"Project-Id-Version: test 1.0\n"
Packit ae235b
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
Packit ae235b
"Last-Translator: test <foo@bar.xx>\n"
Packit ae235b
"Language-Team: C <LL@li.org>\n"
Packit ae235b
"MIME-Version: 1.0\n"
Packit ae235b
"Content-Transfer-Encoding: 8bit\n"
Packit ae235b
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
Packit ae235b
	  AC_SUBST(MSGFMT_OPTS)
Packit ae235b
	  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
Packit ae235b
	  GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
Packit ae235b
	    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
Packit ae235b
	  AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
Packit ae235b
			 return _nl_msg_cat_cntr],
Packit ae235b
	    [CATOBJEXT=.gmo 
Packit ae235b
             DATADIRNAME=share],
Packit ae235b
	    [case $host in
Packit ae235b
	    *-*-solaris*)
Packit ae235b
	    dnl On Solaris, if bind_textdomain_codeset is in libc,
Packit ae235b
	    dnl GNU format message catalog is always supported,
Packit ae235b
            dnl since both are added to the libc all together.
Packit ae235b
	    dnl Hence, we'd like to go with DATADIRNAME=share and
Packit ae235b
	    dnl and CATOBJEXT=.gmo in this case.
Packit ae235b
            AC_CHECK_FUNC(bind_textdomain_codeset,
Packit ae235b
	      [CATOBJEXT=.gmo 
Packit ae235b
               DATADIRNAME=share],
Packit ae235b
	      [CATOBJEXT=.mo
Packit ae235b
               DATADIRNAME=lib])
Packit ae235b
	    ;;
Packit ae235b
	    *-*-openbsd*)
Packit ae235b
	    CATOBJEXT=.mo
Packit ae235b
            DATADIRNAME=share
Packit ae235b
	    ;;
Packit ae235b
	    *)
Packit ae235b
	    CATOBJEXT=.mo
Packit ae235b
            DATADIRNAME=lib
Packit ae235b
	    ;;
Packit ae235b
	    esac])
Packit ae235b
          LIBS="$glib_save_LIBS"
Packit ae235b
	  INSTOBJEXT=.mo
Packit ae235b
	else
Packit ae235b
	  gt_cv_have_gettext=no
Packit ae235b
	fi
Packit ae235b
      fi
Packit ae235b
    ])
Packit ae235b
Packit ae235b
    if test "$gt_cv_have_gettext" = "yes" ; then
Packit ae235b
      AC_DEFINE(ENABLE_NLS, 1,
Packit ae235b
        [always defined to indicate that i18n is enabled])
Packit ae235b
    fi
Packit ae235b
Packit ae235b
    dnl Test whether we really found GNU xgettext.
Packit ae235b
    if test "$XGETTEXT" != ":"; then
Packit ae235b
      dnl If it is not GNU xgettext we define it as : so that the
Packit ae235b
      dnl Makefiles still can work.
Packit ae235b
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
Packit ae235b
        : ;
Packit ae235b
      else
Packit ae235b
        AC_MSG_RESULT(
Packit ae235b
	  [found xgettext program is not GNU xgettext; ignore it])
Packit ae235b
        XGETTEXT=":"
Packit ae235b
      fi
Packit ae235b
    fi
Packit ae235b
Packit ae235b
    # We need to process the po/ directory.
Packit ae235b
    POSUB=po
Packit ae235b
Packit ae235b
    AC_OUTPUT_COMMANDS(
Packit ae235b
      [case "$CONFIG_FILES" in *po/Makefile.in*)
Packit ae235b
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
Packit ae235b
      esac])
Packit ae235b
Packit ae235b
    dnl These rules are solely for the distribution goal.  While doing this
Packit ae235b
    dnl we only have to keep exactly one list of the available catalogs
Packit ae235b
    dnl in configure.ac.
Packit ae235b
    for lang in $ALL_LINGUAS; do
Packit ae235b
      GMOFILES="$GMOFILES $lang.gmo"
Packit ae235b
      POFILES="$POFILES $lang.po"
Packit ae235b
    done
Packit ae235b
Packit ae235b
    dnl Make all variables we use known to autoconf.
Packit ae235b
    AC_SUBST(CATALOGS)
Packit ae235b
    AC_SUBST(CATOBJEXT)
Packit ae235b
    AC_SUBST(DATADIRNAME)
Packit ae235b
    AC_SUBST(GMOFILES)
Packit ae235b
    AC_SUBST(INSTOBJEXT)
Packit ae235b
    AC_SUBST(INTLLIBS)
Packit ae235b
    AC_SUBST(PO_IN_DATADIR_TRUE)
Packit ae235b
    AC_SUBST(PO_IN_DATADIR_FALSE)
Packit ae235b
    AC_SUBST(POFILES)
Packit ae235b
    AC_SUBST(POSUB)
Packit ae235b
  ])
Packit ae235b
Packit ae235b
# AM_GLIB_GNU_GETTEXT
Packit ae235b
# -------------------
Packit ae235b
# Do checks necessary for use of gettext. If a suitable implementation 
Packit ae235b
# of gettext is found in either in libintl or in the C library,
Packit ae235b
# it will set INTLLIBS to the libraries needed for use of gettext
Packit ae235b
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
Packit ae235b
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
Packit ae235b
# on various variables needed by the Makefile.in.in installed by 
Packit ae235b
# glib-gettextize.
Packit ae235b
dnl
Packit ae235b
AU_DEFUN([GLIB_GNU_GETTEXT],
Packit ae235b
  [AC_REQUIRE([AC_PROG_CC])dnl
Packit ae235b
   
Packit ae235b
   GLIB_LC_MESSAGES
Packit ae235b
   GLIB_WITH_NLS
Packit ae235b
Packit ae235b
   if test "$gt_cv_have_gettext" = "yes"; then
Packit ae235b
     if test "x$ALL_LINGUAS" = "x"; then
Packit ae235b
       LINGUAS=
Packit ae235b
     else
Packit ae235b
       AC_MSG_CHECKING(for catalogs to be installed)
Packit ae235b
       NEW_LINGUAS=
Packit ae235b
       for presentlang in $ALL_LINGUAS; do
Packit ae235b
         useit=no
Packit ae235b
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
Packit ae235b
           desiredlanguages="$LINGUAS"
Packit ae235b
         else
Packit ae235b
           desiredlanguages="$ALL_LINGUAS"
Packit ae235b
         fi
Packit ae235b
         for desiredlang in $desiredlanguages; do
Packit ae235b
 	   # Use the presentlang catalog if desiredlang is
Packit ae235b
           #   a. equal to presentlang, or
Packit ae235b
           #   b. a variant of presentlang (because in this case,
Packit ae235b
           #      presentlang can be used as a fallback for messages
Packit ae235b
           #      which are not translated in the desiredlang catalog).
Packit ae235b
           case "$desiredlang" in
Packit ae235b
             "$presentlang"*) useit=yes;;
Packit ae235b
           esac
Packit ae235b
         done
Packit ae235b
         if test $useit = yes; then
Packit ae235b
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
Packit ae235b
         fi
Packit ae235b
       done
Packit ae235b
       LINGUAS=$NEW_LINGUAS
Packit ae235b
       AC_MSG_RESULT($LINGUAS)
Packit ae235b
     fi
Packit ae235b
Packit ae235b
     dnl Construct list of names of catalog files to be constructed.
Packit ae235b
     if test -n "$LINGUAS"; then
Packit ae235b
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
Packit ae235b
     fi
Packit ae235b
   fi
Packit ae235b
Packit ae235b
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
Packit ae235b
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
Packit ae235b
   dnl Try to locate is.
Packit ae235b
   MKINSTALLDIRS=
Packit ae235b
   if test -n "$ac_aux_dir"; then
Packit ae235b
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
Packit ae235b
   fi
Packit ae235b
   if test -z "$MKINSTALLDIRS"; then
Packit ae235b
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
Packit ae235b
   fi
Packit ae235b
   AC_SUBST(MKINSTALLDIRS)
Packit ae235b
Packit ae235b
   dnl Generate list of files to be processed by xgettext which will
Packit ae235b
   dnl be included in po/Makefile.
Packit ae235b
   test -d po || mkdir po
Packit ae235b
   if test "x$srcdir" != "x."; then
Packit ae235b
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
Packit ae235b
       posrcprefix="$srcdir/"
Packit ae235b
     else
Packit ae235b
       posrcprefix="../$srcdir/"
Packit ae235b
     fi
Packit ae235b
   else
Packit ae235b
     posrcprefix="../"
Packit ae235b
   fi
Packit ae235b
   rm -f po/POTFILES
Packit ae235b
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
Packit ae235b
	< $srcdir/po/POTFILES.in > po/POTFILES
Packit ae235b
  ],
Packit ae235b
  [[$0: This macro is deprecated. You should use upstream gettext instead.]])
Packit ae235b
Packit ae235b
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
Packit ae235b
# -------------------------------
Packit ae235b
# Define VARIABLE to the location where catalog files will
Packit ae235b
# be installed by po/Makefile.
Packit ae235b
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
Packit ae235b
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
Packit ae235b
glib_save_prefix="$prefix"
Packit ae235b
glib_save_exec_prefix="$exec_prefix"
Packit ae235b
glib_save_datarootdir="$datarootdir"
Packit ae235b
test "x$prefix" = xNONE && prefix=$ac_default_prefix
Packit ae235b
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
Packit ae235b
datarootdir=`eval echo "${datarootdir}"`
Packit ae235b
if test "x$CATOBJEXT" = "x.mo" ; then
Packit ae235b
  localedir=`eval echo "${libdir}/locale"`
Packit ae235b
else
Packit ae235b
  localedir=`eval echo "${datadir}/locale"`
Packit ae235b
fi
Packit ae235b
prefix="$glib_save_prefix"
Packit ae235b
exec_prefix="$glib_save_exec_prefix"
Packit ae235b
datarootdir="$glib_save_datarootdir"
Packit ae235b
AC_DEFINE_UNQUOTED($1, "$localedir",
Packit ae235b
  [Define the location where the catalogs will be installed])
Packit ae235b
])
Packit ae235b
Packit ae235b
dnl
Packit ae235b
dnl Now the definitions that aclocal will find
Packit ae235b
dnl
Packit ae235b
ifdef(glib_configure_ac,[],[
Packit ae235b
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
Packit ae235b
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
Packit ae235b
])dnl
Packit ae235b
Packit ae235b
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
Packit ae235b
# 
Packit ae235b
# Create a temporary file with TEST-FILE as its contents and pass the
Packit ae235b
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
Packit ae235b
# 0 and perform ACTION-IF-FAIL for any other exit status.
Packit ae235b
AC_DEFUN([GLIB_RUN_PROG],
Packit ae235b
[cat >conftest.foo <<_ACEOF
Packit ae235b
$2
Packit ae235b
_ACEOF
Packit ae235b
if AC_RUN_LOG([$1 conftest.foo]); then
Packit ae235b
  m4_ifval([$3], [$3], [:])
Packit ae235b
m4_ifvaln([$4], [else $4])dnl
Packit ae235b
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
Packit ae235b
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
Packit ae235b
fi])
Packit ae235b