]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Allow more than one po directory in the package.
authorBruno Haible <bruno@clisp.org>
Mon, 14 May 2001 21:37:42 +0000 (21:37 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 28 Jun 2009 14:35:48 +0000 (16:35 +0200)
m4/ChangeLog
m4/gettext.m4
po/ChangeLog
po/Makefile.in.in

index 2182dadb976e27dda99cf41586b6a3da85a701a6..10b586de5417841297d3d4bba1bb3d0792ba7786 100644 (file)
@@ -1,3 +1,10 @@
+2001-05-14  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.m4 (AM_WITH_NLS): Create po/POTFILES right before
+       po/Makefile, at config.status run time. Make it work independently of
+       the subdir name and of the subdir level.
+       (AM_GNU_GETTEXT): Don't create po/POTFILES at configure time.
+
 2001-05-11  Bruno Haible  <haible@clisp.cons.org>
 
        * glibc21.m4: New file, from fileutils-4.1.
index b744d7774e93dc9e18eada27240e123a7f97e4b9..7aea84f4c1ef34106f39e3946108b518fe56ef5d 100644 (file)
@@ -164,9 +164,29 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
       POSUB=po
     fi
     AC_OUTPUT_COMMANDS(
-     [for f in $CONFIG_FILES; do
-        case $f in po/Makefile.in | po/Makefile.in:*)
-          sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+     [for ac_file in $CONFIG_FILES; do
+        # Support "outfile[:infile[:infile...]]"
+        case "$ac_file" in
+          *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+        esac
+        # PO directories have a Makefile.in generated from Makefile.in.in.
+        case "$ac_file" in */Makefile.in)
+          # Adjust a relative srcdir.
+          ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+          ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+          ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+          case "$ac_given_srcdir" in
+            .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+            /*) top_srcdir="$ac_given_srcdir" ;;
+            *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+          esac
+          if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+            rm -f "$ac_dir/POTFILES"
+            echo creating "$ac_dir/POTFILES"
+            sed -e "/^#/d" -e "/^[     ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
+            echo creating "$ac_dir/Makefile"
+            sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+          fi
           ;;
         esac
       done])
@@ -319,23 +339,4 @@ strdup tsearch __argz_count __argz_stringify __argz_next])
    dnl Enable libtool support if the surrounding package wishes it.
    INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
-
-   dnl Generate list of files to be processed by xgettext which will
-   dnl be included in po/Makefile.  But only do this if the po directory
-   dnl exists in srcdir.
-   if test -d $srcdir/po; then
-      test -d po || mkdir po
-      if test "x$srcdir" != "x."; then
-       if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
-         posrcprefix="$srcdir/"
-       else
-         posrcprefix="../$srcdir/"
-       fi
-      else
-       posrcprefix="../"
-      fi
-      rm -f po/POTFILES
-      sed -e "/^#/d" -e "/^\$/d" -e "s,.*,     $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
-               < $srcdir/po/POTFILES.in > po/POTFILES
-   fi
   ])
index bafe6fae57ff07b61bc19911b016882b466f9862..2f196ed6633cdebed7e645c9c21032e134f2e49d 100644 (file)
@@ -1,3 +1,11 @@
+2001-05-14  Bruno Haible  <haible@clisp.cons.org>
+
+       * Makefile.in.in (dist): Make it work independently of the subdir
+       level.
+       (POTFILES): Remove rule.
+       (Makefile): Depend on POTFILES.in, not POTFILES. POTFILES is now
+       created by config.status as well.
+
 2001-05-06  Bruno Haible  <haible@clisp.cons.org>
 
        * sl.po: Update from
index 61e3f3ce44065f4733f9d4361dabf3b6e42a7c74..7eea75ca9020a158fb0db78d969cc9a1e7969573 100644 (file)
@@ -9,12 +9,15 @@
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
 SHELL = /bin/sh
 @SET_MAKE@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-top_builddir = ..
 VPATH = @srcdir@
 
 prefix = @prefix@
@@ -22,7 +25,6 @@ exec_prefix = @exec_prefix@
 datadir = @datadir@
 localedir = $(datadir)/locale
 gettextsrcdir = $(datadir)/gettext/po
-subdir = po
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -151,7 +153,7 @@ maintainer-clean: distclean
        @echo "it deletes files that may require special tools to rebuild."
        rm -f $(GMOFILES)
 
-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 dist distdir:
        $(MAKE) update-po
        @$(MAKE) dist2
@@ -183,21 +185,8 @@ update-po: Makefile
 update-gmo: Makefile $(GMOFILES)
        @:
 
-POTFILES: POTFILES.in
-       ( if test 'x$(srcdir)' != 'x.'; then \
-           posrcprefix='$(top_srcdir)/'; \
-         else \
-           posrcprefix="../"; \
-         fi; \
-         rm -f $@-t $@ \
-           && (sed -e '/^#/d' -e '/^[  ]*$$/d' \
-                   -e "s@.*@   $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
-               | sed -e '$$s/\\$$//') > $@-t \
-           && chmod a-w $@-t \
-           && mv $@-t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
-       cd .. \
+Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+       cd $(top_builddir) \
          && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
               $(SHELL) ./config.status