<<< Date Index >>>     <<< Thread Index >>>

[PATCH 2 of 2] Don't build keymap_alldefs.h in srcdir as it may be read-only



# HG changeset patch
# User Rocco Rutte <pdmef@xxxxxxx>
# Date 1194443688 -3600
# Branch HEAD
# Node ID 84284776659e83b3b115cb513da41d565de37b3a
# Parent  fed536a2ce2228a08cfae000066bf293be0ae808
Don't build keymap_alldefs.h in srcdir as it may be read-only

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -114,12 +114,11 @@ keymap_defs.h: $(OPS) $(srcdir)/gen_defs
 keymap_defs.h: $(OPS) $(srcdir)/gen_defs
        $(srcdir)/gen_defs $(OPS) > keymap_defs.h
 
-$(srcdir)/keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX 
$(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
-       chmod u+w $(srcdir)
+keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX 
$(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
        rm -f $@
        $(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \
                $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
-                       > $(srcdir)/keymap_alldefs.h
+                       > keymap_alldefs.h
 
 reldate.h: $(srcdir)/ChangeLog
        echo 'const char *ReleaseDate = "'`head -n 1 $(srcdir)/ChangeLog | 
LC_ALL=C cut -d ' ' -f 1`'";' > reldate.h.tmp; \
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -51,6 +51,10 @@ DISTFILES = Makefile.in.in POTFILES.in $
 DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \
 $(POFILES) $(GMOFILES)
 
+# need two spaces before = as m4/gettext.m4 matches against
+# 'POTFILES[space]=' to add files from POTFILES
+BUILT_POTFILES  = $(top_builddir)/keymap_alldefs.h
+
 POTFILES = \
 
 CATALOGS = @CATALOGS@
@@ -78,19 +82,22 @@ all-yes: $(CATALOGS)
 all-yes: $(CATALOGS)
 all-no:
 
-.PHONY: $(top_srcdir)/keymap_alldefs.h
-$(top_srcdir)/keymap_alldefs.h:
-       cd .. && $(MAKE) keymap_alldefs.h
+$(top_builddir)/keymap_alldefs.h:
+       ( cd $(top_builddir) && $(MAKE) keymap_alldefs.h )
 
 # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
 # otherwise packages like GCC can not be built if only parts of the source
 # have been downloaded.
 
-$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
-       rm -f $@
+$(PACKAGE).pot: $(POTFILES) $(BUILT_POTFILES) $(srcdir)/POTFILES.in
+       rm -f $(PACKAGE).pot $(PACKAGE).po
        $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
          --add-comments --keyword=_ --keyword=N_ \
          --files-from=$(srcdir)/POTFILES.in \
+       && \
+       $(XGETTEXT) --default-domain=$(PACKAGE) \
+         --add-comments --keyword=_ --keyword=N_ \
+         --join $(BUILT_POTFILES) \
        && test ! -f $(PACKAGE).po \
           || ( rm -f $(PACKAGE).pot \
                && mv $(PACKAGE).po $(PACKAGE).pot )
diff --git a/po/POTFILES.in b/po/POTFILES.in
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -34,7 +34,6 @@ imap/util.c
 imap/util.c
 init.c
 keymap.c
-keymap_alldefs.h
 lib.c
 main.c
 mbox.c