From c0eac0c3606d9852de1fba7c0f380352a71c0a59 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Thu, 1 Oct 1998 07:35:22 +0000 Subject: [PATCH] 1998-10-02 Ben Elliston * 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 . --- ChangeLog | 7 +++++++ acgeneral.m4 | 25 +++++++++++++++++++++++++ lib/autoconf/general.m4 | 25 +++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/ChangeLog b/ChangeLog index 78e6837d..c411ff0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1998-10-02 Ben Elliston + + * 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 . + 1998-09-29 Ben Elliston * acgeneral.m4 (AC_SEARCH_LIBS): New macro. Searches a series of diff --git a/acgeneral.m4 b/acgeneral.m4 index 53938811..608b5882 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -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 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 53938811..608b5882 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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 -- 2.47.2