]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
1998-10-02 Ben Elliston <bje@cygnus.com>
authorBen Elliston <bje+keyword+gnu.7caf74@air.net.au>
Thu, 1 Oct 1998 07:35:22 +0000 (07:35 +0000)
committerBen Elliston <bje+keyword+gnu.7caf74@air.net.au>
Thu, 1 Oct 1998 07:35:22 +0000 (07:35 +0000)
* acgeneral.m4 (AC_VALIDATE_CACHED_SYSTEM_TUPLE): New macro. This
macro can be used to ensure that a configure script will not run
on a second system without removing the cache and re-running
configure. Contributed by Alexandre Oliva <oliva@dcc.unicamp.br>.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4

index 78e6837ddc58d3c236cf5b14eaca813680ddb800..c411ff0dd214a710bc1dc32077bc135627e5ed0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1998-10-02  Ben Elliston  <bje@cygnus.com>
+
+       * acgeneral.m4 (AC_VALIDATE_CACHED_SYSTEM_TUPLE): New macro. This
+       macro can be used to ensure that a configure script will not run
+       on a second system without removing the cache and re-running
+       configure. Contributed by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
 1998-09-29  Ben Elliston  <bje@cygnus.com>
 
        * acgeneral.m4 (AC_SEARCH_LIBS): New macro. Searches a series of
index 539388115126203b2c669ece7fcbb974c18aa5b4..608b58820869cecfebbe23dca55c15c0d7ea390f 100644 (file)
@@ -1012,6 +1012,31 @@ AC_SUBST(build_os)dnl
 ])
 
 
+dnl AC_VALIDATE_CACHED_SYSTEM_TUPLE[(cmd)]
+dnl if the cache file is inconsistent with the current host,
+dnl target and build system types, execute CMD or print a default
+dnl error message.
+AC_DEFUN(AC_VALIDATE_CACHED_SYSTEM_TUPLE, [
+  AC_REQUIRE([AC_CANONICAL_SYSTEM])
+  AC_MSG_CHECKING([cached system tuple])
+  if { test x"${ac_cv_host_system_type+set}" = x"set" &&
+       test x"$ac_cv_host_system_type" != x"$host"; } ||
+     { test x"${ac_cv_build_system_type+set}" = x"set" &&
+       test x"$ac_cv_build_system_type" != x"$build"; } ||
+     { test x"${ac_cv_target_system_type+set}" = x"set" &&
+       test x"$ac_cv_target_system_type" != x"$target"; }; then
+      AC_MSG_RESULT([different])
+      ifelse($#, 1, [$1],
+        [AC_MSG_ERROR([remove config.cache and re-run configure])])
+  else
+    AC_MSG_RESULT(ok)
+  fi
+  ac_cv_host_system_type="$host"
+  ac_cv_build_system_type="$build"
+  ac_cv_target_system_type="$target"
+])
+
+
 dnl ### Caching test results
 
 
index 539388115126203b2c669ece7fcbb974c18aa5b4..608b58820869cecfebbe23dca55c15c0d7ea390f 100644 (file)
@@ -1012,6 +1012,31 @@ AC_SUBST(build_os)dnl
 ])
 
 
+dnl AC_VALIDATE_CACHED_SYSTEM_TUPLE[(cmd)]
+dnl if the cache file is inconsistent with the current host,
+dnl target and build system types, execute CMD or print a default
+dnl error message.
+AC_DEFUN(AC_VALIDATE_CACHED_SYSTEM_TUPLE, [
+  AC_REQUIRE([AC_CANONICAL_SYSTEM])
+  AC_MSG_CHECKING([cached system tuple])
+  if { test x"${ac_cv_host_system_type+set}" = x"set" &&
+       test x"$ac_cv_host_system_type" != x"$host"; } ||
+     { test x"${ac_cv_build_system_type+set}" = x"set" &&
+       test x"$ac_cv_build_system_type" != x"$build"; } ||
+     { test x"${ac_cv_target_system_type+set}" = x"set" &&
+       test x"$ac_cv_target_system_type" != x"$target"; }; then
+      AC_MSG_RESULT([different])
+      ifelse($#, 1, [$1],
+        [AC_MSG_ERROR([remove config.cache and re-run configure])])
+  else
+    AC_MSG_RESULT(ok)
+  fi
+  ac_cv_host_system_type="$host"
+  ac_cv_build_system_type="$build"
+  ac_cv_target_system_type="$target"
+])
+
+
 dnl ### Caching test results