summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-12-17 23:09:15 +0000
committerMorgan Deters <mdeters@gmail.com>2010-12-17 23:09:15 +0000
commiteecc1e4f301711dbb2bf1508ea0ba6cd20acd593 (patch)
tree72f28f268aa5a8978b87c9220811d6e8b675a27f
parent02c793249635ca25e1d611125074e6afdd91533f (diff)
tls.h, rational.h, and integer.h are only re-generated if changed. this obviates the need for a full rebuild just because you re-./configured.
-rw-r--r--config/cvc4.m425
-rw-r--r--configure.ac7
2 files changed, 29 insertions, 3 deletions
diff --git a/config/cvc4.m4 b/config/cvc4.m4
index 76ea2cc79..27efb8718 100644
--- a/config/cvc4.m4
+++ b/config/cvc4.m4
@@ -60,3 +60,28 @@ shift
dnl echo "args are now:" "${@}"
m4_divert_pop([PARSE_ARGS])dnl
])# CVC4_REWRITE_ARGS_FOR_BUILD_PROFILE
+
+
+# CVC4_COPY_IF_CHANGED(FROM, TO)
+# ------------------------------
+# Copy file FROM to TO, if they have textual differences.
+AC_DEFUN([CVC4_COPY_IF_CHANGED], [
+if diff -q "$1" "$2" >/dev/null 2>&1; then
+ dnl they are the same
+ :
+else
+ dnl they are different
+ cp "$1" "$2"
+fi
+])# CVC4_COPY_IF_CHANGED
+
+
+# CVC4_CONFIG_FILE_ONLY_IF_CHANGED(FILE)
+# --------------------------------------
+# Run AC_CONFIG_FILES to generate file named in the argument, but if it
+# exists already, only replace it if it would be changed (this preserves
+# the old timestamp if no textual changes are to be made to the file).
+AC_DEFUN([CVC4_CONFIG_FILE_ONLY_IF_CHANGED], [
+AC_CONFIG_FILES([$1.tmp:$1.in],
+ CVC4_COPY_IF_CHANGED([$1.tmp],[$1]))
+])# CVC4_CONFIG_FILE_ONLY_IF_CHANGED
diff --git a/configure.ac b/configure.ac
index 601258342..707cbea00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -749,11 +749,12 @@ AC_CONFIG_FILES([
Makefile.builds
Makefile]
m4_esyscmd([find contrib lib src test -name Makefile.am | sort | sed 's,\.am$,,'])
- src/util/rational.h
- src/util/integer.h
- src/util/tls.h
)
+CVC4_CONFIG_FILE_ONLY_IF_CHANGED([src/util/rational.h])
+CVC4_CONFIG_FILE_ONLY_IF_CHANGED([src/util/integer.h])
+CVC4_CONFIG_FILE_ONLY_IF_CHANGED([src/util/tls.h])
+
AC_OUTPUT
# Final information to the user
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback