summaryrefslogtreecommitdiff
path: root/source3/aclocal.m4
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@samba.org>1998-09-24 08:34:21 +0000
committerAlexandre Oliva <oliva@samba.org>1998-09-24 08:34:21 +0000
commit6de1659640fa5d2a3b27bec69cd13d87b905d5c4 (patch)
treed8f5e7d6b3657f8904bfb4bd544e8ebc1e6f2d53 /source3/aclocal.m4
parente5948ffd7f276b4c3ee6916d1dc6c5d8b28ad557 (diff)
downloadsamba-6de1659640fa5d2a3b27bec69cd13d87b905d5c4.tar.gz
samba-6de1659640fa5d2a3b27bec69cd13d87b905d5c4.tar.bz2
samba-6de1659640fa5d2a3b27bec69cd13d87b905d5c4.zip
check whether system type is the same as stored in the cache (full
stand-alone macro, candidate for inclusion in the next release of autoconf) create configure flag --enable-maintainer-mode, that enables automatic rebuilding of configure from configure.in and aclocal.m4, and of config.h.in based on acconfig.h. This assumes autoconf and autoheader are available. Maintainer mode also introduces automatic dependency tracking of include files, but it depends on features provided by gcc and GNU make, so you must not enable maintainer mode if you are not using any of these (This used to be commit 64cba1cc8e689bcde2dc124c511da086c33fa4a8)
Diffstat (limited to 'source3/aclocal.m4')
-rw-r--r--source3/aclocal.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4
new file mode 100644
index 0000000000..9573795888
--- /dev/null
+++ b/source3/aclocal.m4
@@ -0,0 +1,36 @@
+dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(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_CACHE_SYSTEM_TYPE, [
+ AC_REQUIRE([AC_CANONICAL_SYSTEM])
+ AC_MSG_CHECKING([config.cache system type])
+ 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(["you must remove config.cache and restart configure"])])
+ else
+ AC_MSG_RESULT([same])
+ fi
+ ac_cv_host_system_type="$host"
+ ac_cv_build_system_type="$build"
+ ac_cv_target_system_type="$target"
+])
+
+dnl based on Automake's maintainer mode
+AC_DEFUN(SAMBA_MAINTAINER_MODE,[
+ AC_ARG_ENABLE(maintainer-mode,
+ [ --enable-maintainer-mode enable some make rules for maintainers],
+ maint_mode=$enableval, maint_mode=no)
+ if test x"$maint_mode" = x"yes"; then MAINT=; else MAINT='#'; fi
+ AC_SUBST(MAINT)
+ AC_PATH_PROG(AUTOCONF, autoconf, autoconf)
+ AC_SUBST(AUTOCONF)
+ AC_PATH_PROG(AUTOHEADER, autoheader, autoheader)
+ AC_SUBST(AUTOHEADER)
+])