Don't touch configmake.h if it has not actually changed.
[pspp] / modules / configmake
index a1169a933bb872f8f5f765090825d2e355a95646..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,12 +56,18 @@ 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
 
 Include:
-"configmake.h"
+/* Include only after all system include files.  */
+#include "configmake.h"
 
 License:
 LGPLv2+