summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-05-14 21:36:18 +0000
committerBruno Haible <bruno@clisp.org>2001-05-14 21:36:18 +0000
commit6e43fcc5742360799dde6419c0db7bf45300d19e (patch)
treefc68e7f9271012ff64233aa1206e379e1cce1ecf
parent22b44d7f8fd0b63f239b5b55f47b9cccc8e62c4f (diff)
downloadexternal_gettext-6e43fcc5742360799dde6419c0db7bf45300d19e.zip
external_gettext-6e43fcc5742360799dde6419c0db7bf45300d19e.tar.gz
external_gettext-6e43fcc5742360799dde6419c0db7bf45300d19e.tar.bz2
Allow more than one po directory in the project.
-rw-r--r--m4/ChangeLog7
-rw-r--r--m4/gettext.m445
-rw-r--r--po/ChangeLog8
-rw-r--r--po/Makefile.in.in25
4 files changed, 45 insertions, 40 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 2182dad..10b586d 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -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.
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index b744d77..7aea84f 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -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
])
diff --git a/po/ChangeLog b/po/ChangeLog
index d5d1295..654820c 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -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
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 61e3f3c..7eea75c 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -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