--- Makefile.in.in.clean	Tue Apr 17 23:56:23 2001
+++ Makefile.in.in	Sat Apr 28 17:58:22 2001
@@ -34,7 +34,12 @@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
-MSGMERGE = msgmerge
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --dist
+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --pot
+

 DEFS = @DEFS@
 CFLAGS = @CFLAGS@
@@ -81,12 +86,7 @@
 # have been downloaded.

 $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
-	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
-	  --add-comments --keyword=_ --keyword=N_ \
-	  --files-from=$(srcdir)/POTFILES.in \
-	&& test ! -f $(PACKAGE).po \
-	   || ( rm -f $(srcdir)/$(PACKAGE).pot \
-		&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
+	$(GENPOT)


 install: install-exec install-data
@@ -171,16 +171,30 @@
 	for cat in $$catalogs; do \
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed 's/\.gmo$$//'`; \
+	  cp $$lang.po $$lang.old.po; \
 	  echo "$$lang:"; \
-	  if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
-	    mv -f $$lang.new.po $$lang.po; \
+	  if $(MSGMERGE) $$lang ; then \
+ 	    rm -f $$lang.old.po; \
 	  else \
 	    echo "msgmerge for $$cat failed!"; \
-	    rm -f $$lang.new.po; \
+ 	    mv $$lang.old.po $$lang.po; \
 	  fi; \
 	done
 	$(MAKE) update-gmo

+.po: Makefile
+	$(MAKE)  $(PACKAGE).pot;
+	PATH=`pwd`/../src:$$PATH; \
+	echo; printf "$*: "; \
+	if $(MSGMERGE) $*; then \
+	  rm -f $*.old.po; \
+	  else \
+	    echo "msgmerge for * failed!"; \
+	    mv $*.old.po $*.po; \
+	fi; \
+	msgfmt --statistics $*.po; echo;
+
+
 update-gmo: Makefile $(GMOFILES)
 	@:


