OSDN Git Service

2011-08-20 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / config / gettext-sister.m4
index d10aae8..e8e6b66 100644 (file)
@@ -19,8 +19,9 @@ INCINTL=      AC_SUBST(INCINTL)
 XGETTEXT=      AC_SUBST(XGETTEXT)
 GMSGFMT=       AC_SUBST(GMSGFMT)
 POSUB=         AC_SUBST(POSUB)
-if test -f ../intl/config.intl; then
-  . ../intl/config.intl
+
+if test -f  ifelse([$1],,[../intl],[$1])/config.intl; then
+  .  ifelse([$1],,[../intl],[$1])/config.intl
 fi
 AC_MSG_CHECKING([whether NLS is requested])
 if test x"$USE_NLS" != xyes; then
@@ -46,8 +47,8 @@ else
     # by the backticks, then collapsed again by the double quotes,
     # leaving us with one backslash in the sed expression (right
     # before the dot that mustn't act as a wildcard).
-    cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"`
-    lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"`
+    cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"`
+    lang=`echo $cat | sed -e "s!\\\\.gmo!!"`
     # The user is allowed to set LINGUAS to a list of languages to
     # install catalogs for.  If it's empty that means "all of them."
     if test "x$LINGUAS" = x; then
@@ -63,4 +64,17 @@ else
   done
   LINGUAS="$XLINGUAS"
   AC_MSG_RESULT($LINGUAS)
+
+  dnl Set up some additional variables which our po/Make-in files
+  dnl may need.
+
+  dnl For backward compatibility. Some Makefiles may be using these.
+  DATADIRNAME=share
+  AC_SUBST(DATADIRNAME)
+  INSTOBJEXT=.mo
+  AC_SUBST(INSTOBJEXT)
+  GENCAT=gencat
+  AC_SUBST(GENCAT)
+  CATOBJEXT=.gmo
+  AC_SUBST(CATOBJEXT)
 fi])