Don't touch configmake.h if it has not actually changed.
authorBruno Haible <bruno@clisp.org>
Sun, 19 Apr 2009 20:09:56 +0000 (22:09 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 19 Apr 2009 20:09:56 +0000 (22:09 +0200)
ChangeLog
modules/configmake

index a10e086b79b91155f491b24f2214e09fe0b5d5c5..6dded668e93875b045c77bbd3f13a805d33f95b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-19  Bruno Haible  <bruno@clisp.org>
+
+       * modules/configmake (Makefile.am): When the contents of configmake.h
+       does not change, arrange to preserve its modification time.
+
 2009-04-17  Simon Josefsson  <simon@josefsson.org>
 
        * top/maint.mk (PO_DOMAIN): New variable, allows overriding of
index 5160128e6ea105ebf0099afbb069052b49eb530e..2c5dfaab16d04069e79b0eafcec8bb6966e451f1 100644 (file)
@@ -26,7 +26,7 @@ Makefile.am:
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
-       rm -f $@-t $@
+       rm -f $@-t
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@@ -56,7 +56,12 @@ configmake.h: Makefile
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
        } | sed '/""/d' > $@-t
-       mv $@-t $@
+       if test -f $@ && cmp $@-t $@ > /dev/null; then \
+         rm -f $@-t; \
+       else \
+         rm -f $@; mv $@-t $@; \
+       fi
+
 BUILT_SOURCES += configmake.h
 CLEANFILES += configmake.h configmake.h-t