getlogin_r: Work around portability problem on OSF/1.
[gnulib.git] / modules / configmake
index c0354e4..c9af259 100644 (file)
@@ -2,10 +2,12 @@ Description:
 Variables set by "configure" or "make".
 
 Files:
+m4/configmake.m4
 
 Depends-on:
 
 configure.ac:
+gl_CONFIGMAKE_PREP
 
 Makefile.am:
 # Retrieve values of the variables through 'configure' followed by
@@ -22,12 +24,13 @@ Makefile.am:
 #
 # Another advantage is that 'make' output is shorter.
 #
-# Listed in the same order as the GNU makefile conventions.
+# Listed in the same order as the GNU makefile conventions, and
+# provided by autoconf 2.59c+.
 # The Automake-defined pkg* macros are appended, in the order
-# listed in the Automake documentation.
+# listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
-       rm -f $@-t $@
-       ( \
+       $(AM_V_GEN)rm -f $@-t && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
          echo '#define BINDIR "$(bindir)"'; \
@@ -51,19 +54,26 @@ configmake.h: Makefile
          echo '#define LOCALEDIR "$(localedir)"'; \
          echo '#define MANDIR "$(mandir)"'; \
          echo '#define MANEXT "$(manext)"'; \
-         echo '#define PKGLIBDIR "$(pkglibdir)"'; \
-         echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
          echo '#define PKGDATADIR "$(pkgdatadir)"'; \
-       :) | sed '/""/d' >$@-t
-       mv $@-t $@
+         echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
+         echo '#define PKGLIBDIR "$(pkglibdir)"'; \
+         echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
+       } | sed '/""/d' > $@-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:
+/* Include only after all system include files.  */
 "configmake.h"
 
 License:
-LGPL
+LGPLv2+
 
 Maintainer:
 all