apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: [PATCH] 'apr.h' was always touched by 'configure', causing re-build
Date Thu, 20 Jan 2005 17:16:51 GMT
On Tue, Jan 18, 2005 at 12:45:12AM +0000, Julian Foad wrote:
> May I request re-insertion of the duplicate "SAVE_FILES=..." line and
> an explanatory comment, as below?  I don't like duplication, so
> alternatives are welcome, but this is the best solution I can see at
> present.

With autoconf 2.5x it should be possible to fix this and actually make
it work properly in config.status too (!)... this is what I came up 
with, will commit after a bit more testing:

Index: configure.in
===================================================================
--- configure.in	(revision 125788)
+++ configure.in	(working copy)
@@ -2003,12 +2003,6 @@
 AC_SUBST(EXEEXT)
 AC_SUBST(LIBTOOL_LIBS)
 
-echo "${nl}Construct Makefiles and header files."
-MAKEFILES="Makefile"
-if test -d $srcdir/test; then
-    MAKEFILES="$MAKEFILES test/Makefile test/internal/Makefile"
-fi
-
 #
 # BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
 #
@@ -2032,31 +2026,36 @@
 AC_SUBST(INCLUDE_RULES)
 AC_SUBST(INCLUDE_OUTPUTS)
 
-SAVE_FILES="include/apr.h include/arch/unix/apr_private.h"
+AC_CONFIG_FILES([include/apr.h
+                 build/apr_rules.mk
+                 build/pkg/pkginfo
+                 apr-$APR_MAJOR_VERSION-config:apr-config.in
+                 apr.pc])
 
-for i in $SAVE_FILES; do
-  test -r $i && mv $i $i.save
-done
+if test -d $srcdir/test; then
+   AC_CONFIG_FILES([test/Makefile test/internal/Makefile])
+fi
 
 dir=include/arch/unix
 test -d $dir || $MKDIR $dir
 
-AC_OUTPUT([
-	$MAKEFILES
-	include/apr.h
-	build/apr_rules.mk
-	build/pkg/pkginfo
-	apr-$APR_MAJOR_VERSION-config:apr-config.in
-        apr.pc
-],[
-for i in $SAVE_FILES; do
+AC_CONFIG_COMMANDS([default], [
+for i in $APR_SAVE_HEADERS; do
   if cmp -s $i $i.save 2>/dev/null; then
     mv $i.save $i
-    echo "$i is unchanged"
+    AC_MSG_NOTICE([$i is unchanged])
   fi
   rm -f $i.save
 done
 chmod +x apr-$APR_MAJOR_VERSION-config
 ],[
+# Commands run at the beginning of config.status
+APR_SAVE_HEADERS="include/apr.h include/arch/unix/apr_private.h"
 APR_MAJOR_VERSION=$APR_MAJOR_VERSION
+
+for apri in \${APR_SAVE_HEADERS}; do
+  test -r \${apri} && mv \${apri} \${apri}.save
+done
 ])
+
+AC_OUTPUT


Mime
View raw message