[m-rev.] for review: add MR_ prefixes to configuration macros

Simon Taylor stayl at cs.mu.OZ.AU
Sat Feb 9 18:54:05 AEDT 2002


Estimated hours taken: 5

Add MR_ prefixes to the configuration macros. This change only
adds prefixes to the definitions of the macros, not the uses.

configure.in:
aclocal.m4:
runtime/mercury_conf.h.in:
runtime/RESERVED_MACRO_NAMES:
	Add MR_ prefixes to all configuration macros. 

	Consistently use a `_H' suffix for macros which indicate
	whether a header file exists.

	Remove unused macros RETSIGTYPE and USE_TYPE_LAYOUT.
	
runtime/Mmakefile:
runtime/mercury_conf_bootstrap.h:
	Define the non-prefixed macros for backwards compatibility.

Index: aclocal.m4
===================================================================
RCS file: /home/mercury1/repository/mercury/aclocal.m4,v
retrieving revision 1.6
diff -u -u -r1.6 aclocal.m4
--- aclocal.m4	8 Aug 2001 13:55:51 -0000	1.6
+++ aclocal.m4	8 Feb 2002 02:36:27 -0000
@@ -24,14 +24,7 @@
 if test "$mercury_cv_with_readline" = yes; then
 
 	# check for the readline header files
-	AC_CHECK_HEADER(readline/readline.h, HAVE_READLINE_READLINE_H=1)
-	if test "$HAVE_READLINE_READLINE_H" = 1; then
-		AC_DEFINE(HAVE_READLINE_READLINE)
-	fi
-	AC_CHECK_HEADER(readline/history.h, HAVE_READLINE_HISTORY_H=1)
-	if test "$HAVE_READLINE_HISTORY_H" = 1; then
-		AC_DEFINE(HAVE_READLINE_HISTORY)
-	fi
+	mercury_check_for_headers readline/readline.h readline/history.h
 
 	# check for the libraries that readline depends on
 	MERCURY_MSG('looking for termcap or curses (needed by readline)...')
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.295
diff -u -u -r1.295 configure.in
--- configure.in	3 Feb 2002 09:01:25 -0000	1.295
+++ configure.in	8 Feb 2002 15:07:35 -0000
@@ -363,7 +363,6 @@
 LIBS="-L/usr/local/lib $LIBS"
 
 AC_PROG_CPP
-AC_RETSIGTYPE
 #-----------------------------------------------------------------------------#
 # Check for `-lm': some systems, e.g. MacOS X (Darwin), don't have it.
 AC_CHECK_LIB(m, sin, [MATH_LIB=-lm], [MATH_LIB=])
@@ -437,104 +436,58 @@
 MERCURY_CHECK_DOTNET
 
 #-----------------------------------------------------------------------------#
+mercury_check_for_functions () {
+
+    for mercury_cv_func in "$@"
+    do
+	mercury_cv_func_define=MR_HAVE_`echo $mercury_cv_func | tr a-z A-Z`
+	AC_CHECK_FUNC($mercury_cv_func, [
+		AC_DEFINE_UNQUOTED($mercury_cv_func_define)
+	])
+    done
+}
+
 # Don't try to use mprotect() on gnu-win32, since it is broken
 # (at least for version b18, anyway) and trying it can crash Win95.
 case "$host" in
 	*-cygwin*)
 		ac_cv_func_mprotect=no ;;
 esac
-AC_HAVE_FUNCS(sysconf getpagesize gethostname)
-AC_HAVE_FUNCS(mprotect memalign memmove)
-AC_HAVE_FUNCS(sigaction setitimer)
-AC_HAVE_FUNCS(snprintf vsnprintf _vsnprintf strerror)
-AC_HAVE_FUNCS(open close dup dup2 fdopen fileno fstat stat isatty)
-AC_HAVE_FUNCS(getpid setpgid fork execlp wait kill)
-AC_HAVE_FUNCS(grantpt unlockpt ptsname tcgetattr tcsetattr ioctl)
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(unistd.h, HAVE_UNISTD_H=1)
-if test "$HAVE_UNISTD_H" = 1; then
-	AC_DEFINE(HAVE_UNISTD_H)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/wait.h, HAVE_SYS_WAIT_H=1)
-if test "$HAVE_SYS_WAIT_H" = 1; then
-	AC_DEFINE(HAVE_SYS_WAIT)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/siginfo.h, HAVE_SYS_SIGINFO_H=1)
-if test "$HAVE_SYS_SIGINFO_H" = 1; then
-	AC_DEFINE(HAVE_SYS_SIGINFO)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/signal.h, HAVE_SYS_SIGNAL_H=1)
-if test "$HAVE_SYS_SIGNAL_H" = 1; then
-	AC_DEFINE(HAVE_SYS_SIGNAL)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(ucontext.h, HAVE_UCONTEXT_H=1)
-if test "$HAVE_UCONTEXT_H" = 1; then
-	AC_DEFINE(HAVE_UCONTEXT)
-else
-	AC_CHECK_HEADER(sys/ucontext.h, HAVE_SYS_UCONTEXT_H=1)
-	if test "$HAVE_SYS_UCONTEXT_H" = 1; then
-		AC_DEFINE(HAVE_SYS_UCONTEXT)
-	fi
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(asm/sigcontext.h, HAVE_ASM_SIGCONTEXT_H=1)
-if test "$HAVE_ASM_SIGCONTEXT_H" = 1; then
-	AC_DEFINE(HAVE_ASM_SIGCONTEXT)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/param.h, HAVE_SYS_PARAM_H=1)
-if test "$HAVE_SYS_PARAM_H" = 1; then
-	AC_DEFINE(HAVE_SYS_PARAM)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/time.h, HAVE_SYS_TIME_H=1)
-if test "$HAVE_SYS_TIME_H" = 1; then
-	AC_DEFINE(HAVE_SYS_TIME)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/times.h, HAVE_SYS_TIMES_H=1)
-if test "$HAVE_SYS_TIMES_H" = 1; then
-	AC_DEFINE(HAVE_SYS_TIMES_H)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/types.h, HAVE_SYS_TYPES_H=1)
-if test "$HAVE_SYS_TYPES_H" = 1; then
-	AC_DEFINE(HAVE_SYS_TYPES_H)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/stat.h, HAVE_SYS_STAT_H=1)
-if test "$HAVE_SYS_STAT_H" = 1; then
-	AC_DEFINE(HAVE_SYS_STAT_H)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(fcntl.h, HAVE_FCNTL_H=1)
-if test "$HAVE_FCNTL_H" = 1; then
-	AC_DEFINE(HAVE_FCNTL_H)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(termios.h, HAVE_TERMIOS_H=1)
-if test "$HAVE_TERMIOS_H" = 1; then
-	AC_DEFINE(HAVE_TERMIOS_H)
-fi
-#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/ioctl.h, HAVE_SYS_IOCTL_H=1)
-if test "$HAVE_SYS_IOCTL_H" = 1; then
-	AC_DEFINE(HAVE_SYS_IOCTL_H)
-fi
+
+mercury_check_for_functions \
+		sysconf getpagesize gethostname \
+		mprotect memalign memmove \
+		sigaction setitimer \
+		snprintf vsnprintf _vsnprintf strerror \
+		open close dup dup2 fdopen fileno fstat stat isatty \
+		getpid setpgid fork execlp wait kill \
+		grantpt unlockpt ptsname tcgetattr tcsetattr ioctl
+
 #-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/stropts.h, HAVE_SYS_STROPTS_H=1)
-if test "$HAVE_SYS_STROPTS_H" = 1; then
-	AC_DEFINE(HAVE_SYS_STROPTS_H)
+# This is also used by MERCURY_CHECK_READLINE in aclocal.m4.
+mercury_check_for_headers () {
+    for mercury_cv_header in "$@"
+    do
+	mercury_cv_header_define="MR_HAVE_`echo $mercury_cv_header | \
+						tr 'a-z./' 'A-Z__'`"
+	AC_CHECK_HEADER($mercury_cv_header, [
+		AC_DEFINE_UNQUOTED($mercury_cv_header_define)
+		eval "$mercury_cv_header_define=1"
+	])
+    done
+}
+
+mercury_check_for_headers \
+		unistd.h sys/wait.h sys/siginfo.h sys/signal.h ucontext.h \
+		asm/sigcontext.h sys/param.h sys/time.h sys/times.h \
+		sys/types.h sys/stat.h fcntl.h termios.h sys/ioctl.h \
+		sys/stropts.h
+
+if test "$MR_HAVE_UCONTEXT_H" != 1; then
+	mercury_check_for_headers sys/ucontext.h
 fi
 #-----------------------------------------------------------------------------#
-AC_CHECK_FILE(/dev/ptmx, HAVE_DEV_PTMX=1)
-if test "$HAVE_DEV_PTMX" = 1; then
-	AC_DEFINE(HAVE_DEV_PTMX)
-fi
+AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(MR_HAVE_DEV_PTMX))
 #-----------------------------------------------------------------------------#
 #
 # check the basics of sigaction
@@ -579,9 +532,9 @@
 	[mercury_cv_sigaction_field=sa_handler],
 	[mercury_cv_sigaction_field=sa_handler]))
 	AC_MSG_RESULT($mercury_cv_sigaction_field)
-	AC_DEFINE_UNQUOTED(SIGACTION_FIELD,$mercury_cv_sigaction_field)
+	AC_DEFINE_UNQUOTED(MR_SIGACTION_FIELD,$mercury_cv_sigaction_field)
 	if test $mercury_cv_sigaction_field = sa_sigaction; then
-		AC_DEFINE(HAVE_SIGINFO)
+		AC_DEFINE(MR_HAVE_SIGINFO)
 	fi
 fi
 #
@@ -591,7 +544,7 @@
 AC_CACHE_VAL(mercury_cv_sigcontext_struct_2arg,
 mercury_cv_sigcontext_struct_2arg=no
 AC_TRY_RUN([
-/* see runtime/memory.c for documentation of this code */
+/* see runtime/mercury_signal.h for documentation of this code */
 
 #define sigcontext_struct sigcontext
 
@@ -599,7 +552,7 @@
 #include <signal.h>
 #undef __KERNEL__
 
-#ifdef HAVE_ASM_SIGCONTEXT
+#ifdef MR_HAVE_ASM_SIGCONTEXT_H
 #include <asm/sigcontext.h>
 #endif
 
@@ -641,7 +594,7 @@
 	mercury_cv_sigcontext_struct_3arg=no
 
 	AC_TRY_RUN([
-	/* see runtime/mercury_memory.c for documentation of this code */
+	/* see runtime/mercury_signal.h for documentation of this code */
 
 	#define sigcontext_struct sigcontext
 
@@ -649,7 +602,7 @@
 	#include <signal.h>
 	#undef __KERNEL__
 
-	#ifdef HAVE_ASM_SIGCONTEXT
+	#ifdef MR_HAVE_ASM_SIGCONTEXT_H
 	#include <asm/sigcontext.h>
 	#endif
 
@@ -689,17 +642,17 @@
 
 if test $mercury_cv_sigcontext_struct_2arg = yes; then
 	mercury_cv_sigcontext_struct=yes
-	AC_DEFINE(HAVE_SIGCONTEXT_STRUCT_2ARG)
+	AC_DEFINE(MR_HAVE_SIGCONTEXT_STRUCT_2ARG)
 fi
 
 if test $mercury_cv_sigcontext_struct_3arg = yes; then
 	mercury_cv_sigcontext_struct=yes
-	AC_DEFINE(HAVE_SIGCONTEXT_STRUCT_3ARG)
+	AC_DEFINE(MR_HAVE_SIGCONTEXT_STRUCT_3ARG)
 fi
 
 if test $mercury_cv_sigcontext_struct = yes; then
-	AC_DEFINE(HAVE_SIGCONTEXT_STRUCT)
-	AC_DEFINE(HAVE_SIGINFO)
+	AC_DEFINE(MR_HAVE_SIGCONTEXT_STRUCT)
+	AC_DEFINE(MR_HAVE_SIGINFO)
 
 	#
 	# check for sigcontext_struct.eip
@@ -708,7 +661,7 @@
 	AC_CACHE_VAL(mercury_cv_pc_access,
 	mercury_cv_pc_access=no
 	AC_TRY_RUN([
-	/* see runtime/memory.c for documentation of this code */
+	/* see runtime/mercury_signal.h for documentation of this code */
 
 	#define sigcontext_struct sigcontext
 
@@ -716,7 +669,7 @@
 	#include <signal.h>
 	#undef __KERNEL__
 
-	#ifdef HAVE_ASM_SIGCONTEXT
+	#ifdef MR_HAVE_ASM_SIGCONTEXT_H
 	#include <asm/sigcontext.h>
 	#endif
 
@@ -724,7 +677,7 @@
 
 	#include <stdio.h>
 
-	#if HAVE_SIGCONTEXT_STRUCT_3ARG
+	#if MR_HAVE_SIGCONTEXT_STRUCT_3ARG
 	extern void handler(int signum, int code, 
 			struct sigcontext_struct context);
 	#else
@@ -742,7 +695,7 @@
 		exit(1);
 	}
 
-	#if HAVE_SIGCONTEXT_STRUCT_3ARG
+	#if MR_HAVE_SIGCONTEXT_STRUCT_3ARG
 	void handler(int signum, int code, struct sigcontext_struct context) {
 	#else
 	void handler(int signum, struct sigcontext_struct context) {
@@ -759,7 +712,7 @@
 	}], [mercury_cv_pc_access=eip], [true], [true]))
 	AC_MSG_RESULT($mercury_cv_pc_access)
 	if test $mercury_cv_pc_access != no; then
-		AC_DEFINE_UNQUOTED(PC_ACCESS,$mercury_cv_pc_access)
+		AC_DEFINE_UNQUOTED(MR_PC_ACCESS,$mercury_cv_pc_access)
 	fi
 else
 	AC_MSG_CHECKING(for \`siginfo_t')
@@ -768,16 +721,16 @@
 	AC_TRY_RUN([
 	#include <stdio.h>
 	#include <signal.h>
-	#ifdef HAVE_SYS_SIGINFO
+	#ifdef MR_HAVE_SYS_SIGINFO_H
 	#include <sys/siginfo.h>
 	#endif
-	#ifdef HAVE_SYS_SIGNAL
+	#ifdef MR_HAVE_SYS_SIGNAL_H
 	#include <sys/signal.h>
 	#endif
-	#ifdef HAVE_UCONTEXT
+	#ifdef MR_HAVE_UCONTEXT_H
 	#include <ucontext.h>
 	#endif
-	#ifdef HAVE_SYS_UCONTEXT
+	#ifdef MR_HAVE_SYS_UCONTEXT_H
 	#include <sys/ucontext.h>
 	#endif
 	int save_signum = 0;
@@ -804,8 +757,8 @@
 	}], [mercury_cv_siginfo_t=yes], [true], [true]))
 	AC_MSG_RESULT($mercury_cv_siginfo_t)
 	if test $mercury_cv_siginfo_t = yes; then
-		AC_DEFINE(HAVE_SIGINFO_T)
-		AC_DEFINE(HAVE_SIGINFO)
+		AC_DEFINE(MR_HAVE_SIGINFO_T)
+		AC_DEFINE(MR_HAVE_SIGINFO)
 
 		AC_MSG_CHECKING(for \`siginfo' pc access at signals)
 		AC_CACHE_VAL(mercury_cv_pc_access,
@@ -814,7 +767,7 @@
 		#include <stdio.h>
 		#include <signal.h>
 		#include <sys/siginfo.h>
-		#ifdef HAVE_UCONTEXT
+		#ifdef MR_HAVE_UCONTEXT_H
 		#include <ucontext.h>
 		#else
 		#include <sys/ucontext.h>
@@ -850,7 +803,7 @@
 		#include <stdio.h>
 		#include <signal.h>
 		#include <sys/siginfo.h>
-		#ifdef HAVE_UCONTEXT
+		#ifdef MR_HAVE_UCONTEXT_H
 		#include <ucontext.h>
 		#else
 		#include <sys/ucontext.h>
@@ -884,7 +837,7 @@
 		#include <stdio.h>
 		#include <signal.h>
 		#include <sys/siginfo.h>
-		#ifdef HAVE_UCONTEXT
+		#ifdef MR_HAVE_UCONTEXT_H
 		#include <ucontext.h>
 		#else
 		#include <sys/ucontext.h>
@@ -916,9 +869,9 @@
 		)
 		AC_MSG_RESULT($mercury_cv_pc_access)
 		if test $mercury_cv_pc_access != no; then
-			AC_DEFINE_UNQUOTED(PC_ACCESS,$mercury_cv_pc_access)
+			AC_DEFINE_UNQUOTED(MR_PC_ACCESS,$mercury_cv_pc_access)
 			if test $mercury_cv_pc_access_greg != no; then
-				AC_DEFINE(PC_ACCESS_GREG)
+				AC_DEFINE(MR_PC_ACCESS_GREG)
 			fi
 		fi
 	fi
@@ -1205,7 +1158,7 @@
 		mercury_cv_low_tag_bits=2
 	fi
 fi
-AC_DEFINE_UNQUOTED(LOW_TAG_BITS, $mercury_cv_low_tag_bits)
+AC_DEFINE_UNQUOTED(MR_LOW_TAG_BITS, $mercury_cv_low_tag_bits)
 LOW_TAG_BITS=$mercury_cv_low_tag_bits
 AC_SUBST(LOW_TAG_BITS)
 #-----------------------------------------------------------------------------#
@@ -1229,7 +1182,7 @@
 	[mercury_cv_bytes_per_word=0])
 )
 AC_MSG_RESULT($mercury_cv_bytes_per_word)
-AC_DEFINE_UNQUOTED(BYTES_PER_WORD, $mercury_cv_bytes_per_word)
+AC_DEFINE_UNQUOTED(MR_BYTES_PER_WORD, $mercury_cv_bytes_per_word)
 BYTES_PER_WORD=$mercury_cv_bytes_per_word
 AC_SUBST(BYTES_PER_WORD)
 #-----------------------------------------------------------------------------#
@@ -1260,7 +1213,7 @@
 	[mercury_cv_sync_term_size=0])
 )
 AC_MSG_RESULT($mercury_cv_sync_term_size)
-AC_DEFINE_UNQUOTED(SYNC_TERM_SIZE, $mercury_cv_sync_term_size)
+AC_DEFINE_UNQUOTED(MR_SYNC_TERM_SIZE, $mercury_cv_sync_term_size)
 SYNC_TERM_SIZE=$mercury_cv_sync_term_size
 AC_SUBST(SYNC_TERM_SIZE)
 #-----------------------------------------------------------------------------#
@@ -1285,7 +1238,7 @@
 	[mercury_cv_bits_per_word=0])
 )
 AC_MSG_RESULT($mercury_cv_bits_per_word)
-AC_DEFINE_UNQUOTED(BITS_PER_WORD, $mercury_cv_bits_per_word)
+AC_DEFINE_UNQUOTED(MR_BITS_PER_WORD, $mercury_cv_bits_per_word)
 BITS_PER_WORD=$mercury_cv_bits_per_word
 AC_SUBST(BITS_PER_WORD)
 #-----------------------------------------------------------------------------#
@@ -1318,7 +1271,7 @@
 if test "$mercury_cv_unboxed_floats" = yes; then
 	HAVE_BOXED_FLOATS="--unboxed-float"
 else
-	AC_DEFINE(BOXED_FLOAT)
+	AC_DEFINE(MR_BOXED_FLOAT)
 	HAVE_BOXED_FLOATS="--no-unboxed-float"
 fi
 AC_SUBST(HAVE_BOXED_FLOATS)
@@ -1435,7 +1388,7 @@
 AC_CACHE_VAL(mercury_cv_normal_system_retval,
 	AC_TRY_RUN([
 	#include <stdlib.h>
-	#ifdef HAVE_SYS_WAIT
+	#ifdef MR_HAVE_SYS_WAIT_H
 	#include <sys/wait.h>
 	#endif
 	int main() {
@@ -1652,7 +1605,7 @@
 )
 AC_MSG_RESULT($mercury_cv_gcc_labels)
 if test "$mercury_cv_gcc_labels" = yes; then
-	AC_DEFINE(HAVE_GCC_LABELS)
+	AC_DEFINE(MR_HAVE_GCC_LABELS)
 fi
 
 if test $mercury_cv_gcc_labels = yes; then
@@ -1684,7 +1637,7 @@
 HAVE_ASM_LABELS=$mercury_cv_asm_labels
 AC_SUBST(HAVE_ASM_LABELS)
 if test $HAVE_ASM_LABELS = 1; then
-	AC_DEFINE(HAVE_ASM_LABELS)
+	AC_DEFINE(MR_HAVE_ASM_LABELS)
 fi
 
 # Restore env vars modified above
@@ -1777,22 +1730,22 @@
 #include	<string.h>
 #include	<signal.h>
 
-#ifdef HAVE_SYS_PARAM
+#ifdef MR_HAVE_SYS_PARAM_H
 #include	<sys/param.h>
 #endif
 
-#ifdef HAVE_SYS_TIME
+#ifdef MR_HAVE_SYS_TIME_H
 #include	<sys/time.h>
 #endif
 
 /* 
 ** if HZ is not defined, we may be able to use sysconf(_SC_CLK_TCK) instead
 */
-#if !defined(HZ) && defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK)
+#if !defined(HZ) && defined(MR_HAVE_SYSCONF) && defined(_SC_CLK_TCK)
 #define HZ ((int)sysconf(_SC_CLK_TCK))
 #endif
 
-#if !defined(HZ) || !defined(SIGPROF) || !defined(HAVE_SETITIMER)
+#if !defined(HZ) || !defined(SIGPROF) || !defined(MR_HAVE_SETITIMER)
 #error "Time profiling not supported on this system"
 #endif
 ], [mercury_cv_profiling=yes], [mercury_cv_profiling=no]))
@@ -1823,7 +1776,7 @@
     # Currently it only distinguishes between systems which have
     # unistd.h or not, but at a later date we may also need to test for
     # other posix features.
-if test "$HAVE_UNISTD_H" = 1; then
+if test "$MR_HAVE_UNISTD_H" = 1; then
     mercury_cv_can_enable_deep_profiler=yes
 else
     mercury_cv_can_enable_deep_profiler=no
@@ -2628,7 +2581,7 @@
 AC_SUBST(SHARED_LIBS)
 AC_SUBST(SHARED_LIBS_SH)
 if test $USE_DLLS = "yes"; then
-	AC_DEFINE(USE_DLLS)
+	AC_DEFINE(MR_USE_DLLS)
 fi
 #-----------------------------------------------------------------------------#
 if test "$BOOTSTRAP_MC" = ""; then
@@ -2922,10 +2875,7 @@
 [  --disable-dynamic-link  disable the use of dynamic linking],
 mercury_cv_enable_dynamic_link="$enableval",mercury_cv_enable_dynamic_link=yes)
 if test "$mercury_cv_enable_dynamic_link" = "yes"; then
-	AC_CHECK_HEADER(dlfcn.h, HAVE_DLFCN_H=1)
-	if test "$HAVE_DLFCN_H" = 1; then
-		AC_DEFINE(HAVE_DLFCN_H)
-	fi
+	mercury_check_for_headers dlfcn.h
 	AC_CHECK_LIB(dl, dlopen, DL_LIBRARY="-ldl", DL_LIBRARY="")
 	AC_SUBST(DL_LIBRARY)
 
@@ -2933,7 +2883,7 @@
 	save_LIBS="$LIBS"
 	LIBS="$LIBS $DL_LIBRARY"
 
-	AC_HAVE_FUNCS(dlopen dlclose dlsym dlerror)
+	mercury_check_for_functions dlopen dlclose dlsym dlerror
 
 	# restore old value of LIBS
 	LIBS="$save_LIBS"
@@ -2957,7 +2907,7 @@
 MERCURY_CHECK_READLINE
 #-----------------------------------------------------------------------------#
 
-check_c_files () {
+mercury_check_c_files () {
     c_dir=$1
     c_date_dir=$2
 
@@ -2992,8 +2942,8 @@
     MERCURY_MSG("checking whether any C files need to be rebuilt...")
     for directory in library compiler profiler deep_profiler browser
     do
-        check_c_files $directory $directory
-        check_c_files $directory/Mercury/cs $directory/Mercury/c_dates
+        mercury_check_c_files $directory $directory
+        mercury_check_c_files $directory/Mercury/cs $directory/Mercury/c_dates
     done
     if test "$to_delete" = "" ; then
         case $some_kept in
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.82
diff -u -u -r1.82 Mmakefile
--- runtime/Mmakefile	30 Jan 2002 05:08:57 -0000	1.82
+++ runtime/Mmakefile	9 Feb 2002 05:09:27 -0000
@@ -39,6 +39,7 @@
 			mercury_bootstrap.h	\
 			mercury_calls.h		\
 			mercury_conf.h		\
+			mercury_conf_bootstrap.h \
 			mercury_conf_param.h	\
 			mercury_construct.h	\
 			mercury_context.h	\
Index: runtime/RESERVED_MACRO_NAMES
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/RESERVED_MACRO_NAMES,v
retrieving revision 1.8
diff -u -u -r1.8 RESERVED_MACRO_NAMES
--- runtime/RESERVED_MACRO_NAMES	2 Feb 2002 16:52:30 -0000	1.8
+++ runtime/RESERVED_MACRO_NAMES	8 Feb 2002 11:35:22 -0000
@@ -46,9 +46,6 @@
 # by mercury_conf.h and/or mercury_conf_param.h and/or
 # on the command-line or by scripts/mgnuc.
 # XXX we ought to add MR_ prefixes to all of these.
-# XXX USE_TYPE_LAYOUT is defined in mercury_type_info.h
-# but it ought to be defined in mercury_conf_param.h,
-# or just deleted, since it is not used at all
 # XXX TAG_BITS is defined in mercury_tags.h
 pid_t
 BOXED_FLOAT
@@ -63,7 +60,6 @@
 PROFILE_CALLS
 PROFILE_MEMORY
 PROFILE_TIME
-RETSIGTYPE
 SIGACTION_FIELD
 TAG_BITS
 USE_ASM_LABELS
@@ -71,7 +67,6 @@
 USE_GCC_GLOBAL_REGISTERS
 USE_GCC_NONLOCAL_GOTOS
 USE_SINGLE_PREC_FLOAT
-USE_TYPE_LAYOUT
 HAVE_ASM_SIGCONTEXT
 HAVE_CLOSE
 HAVE_DEV_PTMX
Index: runtime/mercury_conf.h.in
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf.h.in,v
retrieving revision 1.41
diff -u -u -r1.41 mercury_conf.h.in
--- runtime/mercury_conf.h.in	30 Jan 2002 14:51:07 -0000	1.41
+++ runtime/mercury_conf.h.in	9 Feb 2002 06:34:23 -0000
@@ -88,67 +88,67 @@
 #undef	MR_UINT_LEAST32_MAX
 
 /*
-** LOW_TAG_BITS: an integer, specifying the number of low-order tag bits
+** MR_LOW_TAG_BITS: an integer, specifying the number of low-order tag bits
 ** we can use.  Normally this is the base-2 log of the word size in bytes.
 */
-#undef	LOW_TAG_BITS
+#undef	MR_LOW_TAG_BITS
 
 /*
-** BOXED_FLOAT: defined if double precision floats might not fit
+** MR_BOXED_FLOAT: defined if double precision floats might not fit
 ** in a Word, and hence must be boxed.
 ** Note that when bootstrapping from the source distribution,
-** we initially build things without BOXED_FLOAT even on machines
+** we initially build things without MR_BOXED_FLOAT even on machines
 ** for which sizeof(MR_Float) <= sizeof(MR_Word).
-** Conversely if BOXED_FLOAT is undefined, it implies that
+** Conversely if MR_BOXED_FLOAT is undefined, it implies that
 ** sizeof(MR_Float) <= sizeof(MR_Word).
 */
-#undef	BOXED_FLOAT
+#undef	MR_BOXED_FLOAT
 
 /*
 ** The following macros are defined iff the corresponding header file
 ** is available:
 **
-**	HAVE_SYS_SIGINFO	we have <sys/siginfo.h>
-**	HAVE_SYS_SIGNAL		we have <sys/signal.h>
-**	HAVE_UCONTEXT		we have <ucontext.h>
-**	HAVE_SYS_UCONTEXT	we have <sys/ucontext.h>
-**	HAVE_ASM_SIGCONTEXT	we have <asm/sigcontext.h> (e.g. i386 Linux)
-**	HAVE_SYS_TIME		we have <sys/time.h>
-**	HAVE_UNISTD_H		we have <unistd.h>
-**	HAVE_SYS_PARAM		we have <sys/param.h>
-**	HAVE_SYS_WAIT		we have <sys/wait.h>
-**	HAVE_SYS_STAT_H		we have <sys/stat.h>
-**	HAVE_SYS_TYPES_H	we have <sys/types.h>
-**	HAVE_SYS_TIMES_H	we have <sys/times.h>
-**	HAVE_DLFCN_H		we have <dlfcn.h>
-**	HAVE_FCNTL_H		we have <fcnt.h>
-**	HAVE_TERMIOS_H		we have <termios.h>
-**	HAVE_SYS_IOCTL_H	we have <sys/ioctl.h>
-**	HAVE_SYS_STROPTS_H	we have <sys/stropts.h>
-*/
-#undef	HAVE_SYS_SIGINFO
-#undef	HAVE_SYS_SIGNAL
-#undef	HAVE_UCONTEXT
-#undef	HAVE_SYS_UCONTEXT
-#undef	HAVE_ASM_SIGCONTEXT
-#undef	HAVE_SYS_TIME
-#undef	HAVE_UNISTD_H
-#undef	HAVE_SYS_PARAM
-#undef	HAVE_SYS_WAIT
-#undef	HAVE_SYS_STAT_H
-#undef	HAVE_SYS_TIMES_H
-#undef	HAVE_SYS_TYPES_H
-#undef	HAVE_DLFCN_H
-#undef	HAVE_FCNTL_H
-#undef	HAVE_TERMIOS_H
-#undef	HAVE_SYS_IOCTL_H
-#undef	HAVE_SYS_STROPTS_H
+**	MR_HAVE_SYS_SIGINFO_H	we have <sys/siginfo.h>
+**	MR_HAVE_SYS_SIGNAL_H	we have <sys/signal.h>
+**	MR_HAVE_UCONTEXT_H	we have <ucontext.h>
+**	MR_HAVE_SYS_UCONTEXT_H	we have <sys/ucontext.h>
+**	MR_HAVE_ASM_SIGCONTEXT_H we have <asm/sigcontext.h> (e.g. i386 Linux)
+**	MR_HAVE_SYS_TIME_H	we have <sys/time.h>
+**	MR_HAVE_UNISTD_H	we have <unistd.h>
+**	MR_HAVE_SYS_PARAM_H	we have <sys/param.h>
+**	MR_HAVE_SYS_WAIT_H	we have <sys/wait.h>
+**	MR_HAVE_SYS_STAT_H	we have <sys/stat.h>
+**	MR_HAVE_SYS_TYPES_H	we have <sys/types.h>
+**	MR_HAVE_SYS_TIMES_H	we have <sys/times.h>
+**	MR_HAVE_DLFCN_H		we have <dlfcn.h>
+**	MR_HAVE_FCNTL_H		we have <fcnt.h>
+**	MR_HAVE_TERMIOS_H	we have <termios.h>
+**	MR_HAVE_SYS_IOCTL_H	we have <sys/ioctl.h>
+**	MR_HAVE_SYS_STROPTS_H	we have <sys/stropts.h>
+*/
+#undef	MR_HAVE_SYS_SIGINFO_H
+#undef	MR_HAVE_SYS_SIGNAL_H
+#undef	MR_HAVE_UCONTEXT_H
+#undef	MR_HAVE_SYS_UCONTEXT_H
+#undef	MR_HAVE_ASM_SIGCONTEXT_H
+#undef	MR_HAVE_SYS_TIME_H
+#undef	MR_HAVE_UNISTD_H
+#undef	MR_HAVE_SYS_PARAM_H
+#undef	MR_HAVE_SYS_WAIT_H
+#undef	MR_HAVE_SYS_STAT_H
+#undef	MR_HAVE_SYS_TIMES_H
+#undef	MR_HAVE_SYS_TYPES_H
+#undef	MR_HAVE_DLFCN_H
+#undef	MR_HAVE_FCNTL_H
+#undef	MR_HAVE_TERMIOS_H
+#undef	MR_HAVE_SYS_IOCTL_H
+#undef	MR_HAVE_SYS_STROPTS_H
 
 /*
-** HAVE_DEV_PTMX is defined if /dev/ptmx (used to allocate
+** MR_HAVE_DEV_PTMX is defined if /dev/ptmx (used to allocate
 ** pseudo-terminals) exists.
 */
-#undef HAVE_DEV_PTMX
+#undef MR_HAVE_DEV_PTMX
 
 /*
 ** MR_HAVE_POSIX_TIMES is defined if we have the POSIX
@@ -175,90 +175,84 @@
 ** The following macros are defined iff the corresponding function or
 ** system call is available:
 **
-** 	HAVE_GETPID		we have the getpid() function.
-** 	HAVE_SETPGID		we have the setpgid() function.
-**	HAVE_FORK		we have the fork() function.
-**	HAVE_EXECLP		we have the execlp() function.
-**	HAVE_WAIT		we have the wait() function.
-**	HAVE_KILL		we have the kill() function.
-** 	HAVE_GETHOSTNAME	we have the gethostname() function.
-**	HAVE_SNPRINTF 		we have the snprintf() function.
-**	HAVE_VSNPRINTF 		we have the vsnprintf() function.
-**	HAVE__VSNPRINTF 	we have the _vsnprintf() function.
-**	HAVE_SYSCONF     	we have the sysconf() system call.
-**	HAVE_SIGACTION		we have the sigaction() system call.
-**	HAVE_GETPAGESIZE 	we have the getpagesize() system call.
-**	HAVE_MPROTECT    	we have the mprotect() system call.
-**	HAVE_MEMALIGN    	we have the memalign() function.
-**	HAVE_STRERROR    	we have the strerror() function.
-**	HAVE_SETITIMER   	we have the setitimer() function.
-**	HAVE_MEMMOVE   		we have the memmove() function.
-**	HAVE_DLOPEN   		we have the dlopen() function.
-**	HAVE_DLCLOSE   		we have the dlclose() function.
-**	HAVE_DLSYM   		we have the dlsym() function.
-**	HAVE_DLERROR   		we have the dlerror() function.
-**	HAVE_STAT 		we have the stat() function.
-**	HAVE_FSTAT 		we have the fstat() function.
-**	HAVE_FDOPEN 		we have the fdopen() function.
-**	HAVE_OPEN		we have the open() function.
-**	HAVE_CLOSE		we have the close() function.
-**	HAVE_DUP		we have the dup() function.
-**	HAVE_DUP2		we have the dup2() function.
-**	HAVE_FILENO 		we have the fileno() function.
+** 	MR_HAVE_GETPID		we have the getpid() function.
+** 	MR_HAVE_SETPGID		we have the setpgid() function.
+**	MR_HAVE_FORK		we have the fork() function.
+**	MR_HAVE_EXECLP		we have the execlp() function.
+**	MR_HAVE_WAIT		we have the wait() function.
+**	MR_HAVE_KILL		we have the kill() function.
+** 	MR_HAVE_GETHOSTNAME	we have the gethostname() function.
+**	MR_HAVE_SNPRINTF 		we have the snprintf() function.
+**	MR_HAVE_VSNPRINTF 		we have the vsnprintf() function.
+**	MR_HAVE__VSNPRINTF 	we have the _vsnprintf() function.
+**	MR_HAVE_SYSCONF     	we have the sysconf() system call.
+**	MR_HAVE_SIGACTION		we have the sigaction() system call.
+**	MR_HAVE_GETPAGESIZE 	we have the getpagesize() system call.
+**	MR_HAVE_MPROTECT    	we have the mprotect() system call.
+**	MR_HAVE_MEMALIGN    	we have the memalign() function.
+**	MR_HAVE_STRERROR    	we have the strerror() function.
+**	MR_HAVE_SETITIMER   	we have the setitimer() function.
+**	MR_HAVE_MEMMOVE   		we have the memmove() function.
+**	MR_HAVE_DLOPEN   		we have the dlopen() function.
+**	MR_HAVE_DLCLOSE   		we have the dlclose() function.
+**	MR_HAVE_DLSYM   		we have the dlsym() function.
+**	MR_HAVE_DLERROR   		we have the dlerror() function.
+**	MR_HAVE_STAT 		we have the stat() function.
+**	MR_HAVE_FSTAT 		we have the fstat() function.
+**	MR_HAVE_FDOPEN 		we have the fdopen() function.
+**	MR_HAVE_OPEN		we have the open() function.
+**	MR_HAVE_CLOSE		we have the close() function.
+**	MR_HAVE_DUP		we have the dup() function.
+**	MR_HAVE_DUP2		we have the dup2() function.
+**	MR_HAVE_FILENO 		we have the fileno() function.
 **				Note that fileno() may be a macro
 **				rather than a function, so you should use
-**				#if defined(fileno) || defined(HAVE_FILENO)
-**	HAVE_ISATTY 		we have the isatty() function.
-**	HAVE_GRANTPT		we have the grantpt() function.
-**	HAVE_UNLOCKPT		we have the unlockpt() function.
-**	HAVE_PTSNAME		we have the ptsname() function.
-**	HAVE_TCGETATTR		we have the tcgetattr() function.
-**	HAVE_TCSETATTR		we have the tcsetattr() function.
-**	HAVE_IOCTL		we have the ioctl() function.
-*/
-#undef	HAVE_GETPID
-#undef	HAVE_SETPGID
-#undef	HAVE_FORK
-#undef	HAVE_EXECLP
-#undef	HAVE_WAIT
-#undef	HAVE_KILL
-#undef	HAVE_GETHOSTNAME
-#undef	HAVE_SNPRINTF
-#undef	HAVE_VSNPRINTF
-#undef	HAVE__VSNPRINTF
-#undef	HAVE_SYSCONF
-#undef	HAVE_SIGACTION
-#undef	HAVE_GETPAGESIZE
-#undef	HAVE_MEMALIGN
-#undef	HAVE_MPROTECT
-#undef	HAVE_STRERROR
-#undef	HAVE_SETITIMER
-#undef	HAVE_MEMMOVE
-#undef	HAVE_DLOPEN
-#undef	HAVE_DLCLOSE
-#undef	HAVE_DLSYM
-#undef	HAVE_DLERROR
-#undef	HAVE_STAT
-#undef	HAVE_FSTAT
-#undef	HAVE_FDOPEN
-#undef	HAVE_OPEN
-#undef	HAVE_CLOSE
-#undef	HAVE_DUP
-#undef	HAVE_DUP2
-#undef	HAVE_FILENO
-#undef	HAVE_ISATTY
-#undef	HAVE_GRANTPT
-#undef	HAVE_UNLOCKPT
-#undef	HAVE_PTSNAME
-#undef	HAVE_TCGETATTR
-#undef	HAVE_TCSETATTR
-#undef	HAVE_IOCTL
-
-/*
-** RETSIGTYPE: the return type of signal handlers.
-** Either `int' or `void'.
-*/
-#undef	RETSIGTYPE
+**				#if defined(fileno) || defined(MR_HAVE_FILENO)
+**	MR_HAVE_ISATTY 		we have the isatty() function.
+**	MR_HAVE_GRANTPT		we have the grantpt() function.
+**	MR_HAVE_UNLOCKPT		we have the unlockpt() function.
+**	MR_HAVE_PTSNAME		we have the ptsname() function.
+**	MR_HAVE_TCGETATTR		we have the tcgetattr() function.
+**	MR_HAVE_TCSETATTR		we have the tcsetattr() function.
+**	MR_HAVE_IOCTL		we have the ioctl() function.
+*/
+#undef	MR_HAVE_GETPID
+#undef	MR_HAVE_SETPGID
+#undef	MR_HAVE_FORK
+#undef	MR_HAVE_EXECLP
+#undef	MR_HAVE_WAIT
+#undef	MR_HAVE_KILL
+#undef	MR_HAVE_GETHOSTNAME
+#undef	MR_HAVE_SNPRINTF
+#undef	MR_HAVE_VSNPRINTF
+#undef	MR_HAVE__VSNPRINTF
+#undef	MR_HAVE_SYSCONF
+#undef	MR_HAVE_SIGACTION
+#undef	MR_HAVE_GETPAGESIZE
+#undef	MR_HAVE_MEMALIGN
+#undef	MR_HAVE_MPROTECT
+#undef	MR_HAVE_STRERROR
+#undef	MR_HAVE_SETITIMER
+#undef	MR_HAVE_MEMMOVE
+#undef	MR_HAVE_DLOPEN
+#undef	MR_HAVE_DLCLOSE
+#undef	MR_HAVE_DLSYM
+#undef	MR_HAVE_DLERROR
+#undef	MR_HAVE_STAT
+#undef	MR_HAVE_FSTAT
+#undef	MR_HAVE_FDOPEN
+#undef	MR_HAVE_OPEN
+#undef	MR_HAVE_CLOSE
+#undef	MR_HAVE_DUP
+#undef	MR_HAVE_DUP2
+#undef	MR_HAVE_FILENO
+#undef	MR_HAVE_ISATTY
+#undef	MR_HAVE_GRANTPT
+#undef	MR_HAVE_UNLOCKPT
+#undef	MR_HAVE_PTSNAME
+#undef	MR_HAVE_TCGETATTR
+#undef	MR_HAVE_TCSETATTR
+#undef	MR_HAVE_IOCTL
 
 /*
 ** We use mprotect() and signals to catch stack and heap overflows.
@@ -268,50 +262,52 @@
 ** it has to be done differently on different systems.
 ** The following macros specify whether we can do it and if so, how.
 **
-**	HAVE_SIGINFO		defined iff we can _somehow_ figure out the
+**	MR_HAVE_SIGINFO		defined iff we can _somehow_ figure out the
 **				fault address for SIGSEGVs.
-**	HAVE_SIGINFO_T		defined iff we can figure out the
+**	MR_HAVE_SIGINFO_T	defined iff we can figure out the
 **				fault address for SIGSEGVs using sigaction
 **				and siginfo_t.
-**	HAVE_SIGCONTEXT_STRUCT	defined iff normal signal handlers are given
+**	MR_HAVE_SIGCONTEXT_STRUCT
+**				defined iff normal signal handlers are given
 **				sigcontext_struct arguments that we can use to
 **				figure out the fault address for SIGSEGVs.
-**	HAVE_SIGCONTEXT_STRUCT_3ARG
+**	MR_HAVE_SIGCONTEXT_STRUCT_3ARG
 **				defined iff signal handlers have three
 **				parameters, the third being the
 **				sigcontext struct.
-**	HAVE_SIGCONTEXT_STRUCT_2ARG
+**	MR_HAVE_SIGCONTEXT_STRUCT_2ARG
 **				defined iff signal handlers have two
 **				parameters, the second being the
 **				sigcontext struct. 
 */
-#undef	HAVE_SIGINFO
-#undef	HAVE_SIGINFO_T
-#undef	HAVE_SIGCONTEXT_STRUCT
-#undef	HAVE_SIGCONTEXT_STRUCT_3ARG
-#undef	HAVE_SIGCONTEXT_STRUCT_2ARG
+#undef	MR_HAVE_SIGINFO
+#undef	MR_HAVE_SIGINFO_T
+#undef	MR_HAVE_SIGCONTEXT_STRUCT
+#undef	MR_HAVE_SIGCONTEXT_STRUCT_3ARG
+#undef	MR_HAVE_SIGCONTEXT_STRUCT_2ARG
 
 /*
 ** For debugging purposes, if we get a fatal signal, we print out the
 ** program counter (PC) at which the signal occurred.
 **
-** PC_ACCESS, PC_ACCESS_GREG: the way to access the saved PC in ucontexts.
+** MR_PC_ACCESS, MR_PC_ACCESS_GREG: the way to access the saved
+** PC in ucontexts.
 **
-** If PC_ACCESS_GREG is defined, then PC_ACCESS specifies an index into
+** If MR_PC_ACCESS_GREG is defined, then MR_PC_ACCESS specifies an index into
 ** the `gregs' (general registers) array, which is a field of the `ucontext'
-** struct.  Otherwise, if PC_ACCESS is defined then it is a field name
-** in the `ucontext' struct.  If PC_ACCESS is not defined, then we don't
+** struct.  Otherwise, if MR_PC_ACCESS is defined then it is a field name
+** in the `ucontext' struct.  If MR_PC_ACCESS is not defined, then we don't
 ** have any way of getting the saved PC.
 */
-#undef	PC_ACCESS
-#undef	PC_ACCESS_GREG
+#undef	MR_PC_ACCESS
+#undef	MR_PC_ACCESS_GREG
 
 /*
-** SIGACTION_FIELD: the name of the field in the sigaction struct
-** (either sa_handler or sa_sigaction).  Defined only if HAVE_SIGACTION
+** MR_SIGACTION_FIELD: the name of the field in the sigaction struct
+** (either sa_handler or sa_sigaction).  Defined only if MR_HAVE_SIGACTION
 ** is defined.
 */
-#undef	SIGACTION_FIELD
+#undef	MR_SIGACTION_FIELD
 
 /*
 ** Configuration parameters for multithreaded execution support.
@@ -363,7 +359,7 @@
 /*
 ** Should we build the Mercury libraries as Windows DLLs?
 */
-#undef USE_DLLS
+#undef MR_USE_DLLS
 
 /*
 ** For SPARC systems, does `as' not allow `.type' in inline asm?
@@ -410,14 +406,14 @@
 **	The autoconfiguration script sets this if it can't find a termcap
 **	library.
 **
-** HAVE_READLINE_READLINE
-** HAVE_READLINE_HISTORY
+** MR_HAVE_READLINE_READLINE_H
+** MR_HAVE_READLINE_HISTORY_H
 **	Defined if the header files readline/readline.h and
 **	readline/history.h are available.
 */
 #undef  MR_NO_USE_READLINE
-#undef  HAVE_READLINE_READLINE
-#undef  HAVE_READLINE_HISTORY
+#undef  MR_HAVE_READLINE_READLINE_H
+#undef  MR_HAVE_READLINE_HISTORY_H
 
 /*
 ** MR_MKFIFO
@@ -446,5 +442,6 @@
 /*---------------------------------------------------------------------------*/
 
 #include "mercury_conf_param.h"
+#include "mercury_conf_bootstrap.h"
 
 #endif /* MERCURY_CONF_H */
Index: runtime/mercury_conf_bootstrap.h
===================================================================
RCS file: runtime/mercury_conf_bootstrap.h
diff -N runtime/mercury_conf_bootstrap.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ runtime/mercury_conf_bootstrap.h	9 Feb 2002 06:26:26 -0000
@@ -0,0 +1,289 @@
+/*
+ * ** Copyright (C) 2002 The University of Melbourne.
+ * ** This file may only be copied under the terms of the GNU Library General
+ * ** Public License - see the file COPYING.LIB in the Mercury distribution.
+ * */
+
+/*
+ * ** mercury_conf_bootstrap.h
+ * **
+ * ** Backwards compatability definitions for auto-configured macros.
+ * ** All of the definitions here will go away eventually, so don't use them!
+ * */
+
+#ifndef MERCURY_CONF_BOOTSTRAP_H
+#define MERCURY_CONF_BOOTSTRAP_H
+
+#ifndef MR_NO_CONF_BACKWARDS_COMPAT
+
+/*
+** Header files.
+*/
+#ifdef MR_HAVE_SYS_SIGINFO_H
+  #define HAVE_SYS_SIGINFO 1
+#endif
+#ifdef MR_HAVE_SYS_SIGNAL_H
+  #define HAVE_SYS_SIGNAL 1
+#endif
+#ifdef MR_HAVE_UCONTEXT_H
+  #define HAVE_UCONTEXT 1
+#endif
+#ifdef MR_HAVE_SYS_UCONTEXT_H
+  #define HAVE_SYS_UCONTEXT 1
+#endif
+#ifdef MR_HAVE_ASM_SIGCONTEXT_H
+  #define HAVE_ASM_SIGCONTEXT 1
+#endif
+#ifdef MR_HAVE_SYS_TIME_H
+  #define HAVE_SYS_TIME 1
+#endif
+#ifdef MR_HAVE_UNISTD_H
+  #define HAVE_UNISTD_H 1
+#endif
+#ifdef MR_HAVE_SYS_PARAM_H
+  #define HAVE_SYS_PARAM 1
+#endif
+#ifdef MR_HAVE_SYS_WAIT_H
+  #define HAVE_SYS_WAIT 1
+#endif
+#ifdef MR_HAVE_SYS_STAT_H
+  #define HAVE_SYS_STAT_H 1
+#endif
+#ifdef MR_HAVE_SYS_TIMES_H
+  #define HAVE_SYS_TIMES_H 1
+#endif
+#ifdef MR_HAVE_SYS_TYPES_H
+  #define HAVE_SYS_TYPES_H 1
+#endif
+#ifdef MR_HAVE_DLFCN_H
+  #define HAVE_DLFCN_H 1
+#endif
+#ifdef MR_HAVE_FCNTL_H
+  #define HAVE_FCNTL_H 1
+#endif
+#ifdef MR_HAVE_TERMIOS_H
+  #define HAVE_TERMIOS_H 1
+#endif
+#ifdef MR_HAVE_SYS_IOCTL_H
+  #define HAVE_SYS_IOCTL_H 1
+#endif
+#ifdef MR_HAVE_SYS_STROPTS_H
+  #define HAVE_SYS_STROPTS_H 1
+#endif
+#ifdef MR_HAVE_READLINE_READLINE_H
+  #define HAVE_READLINE_READLINE 1
+#endif
+#ifdef MR_HAVE_READLINE_HISTORY_H
+  #define HAVE_READLINE_HISTORY 1
+#endif
+
+/*
+** Library functions.
+*/
+#ifdef MR_HAVE_GETPID
+  #define HAVE_GETPID 1
+#endif
+#ifdef MR_HAVE_SETPGID
+  #define HAVE_SETPGID 1
+#endif
+#ifdef MR_HAVE_FORK
+  #define HAVE_FORK 1
+#endif
+#ifdef MR_HAVE_EXECLP
+  #define HAVE_EXECLP 1
+#endif
+#ifdef MR_HAVE_WAIT
+  #define HAVE_WAIT 1
+#endif
+#ifdef MR_HAVE_KILL
+  #define HAVE_KILL 1
+#endif
+#ifdef MR_HAVE_GETHOSTNAME
+  #define HAVE_GETHOSTNAME 1
+#endif
+#ifdef MR_HAVE_SNPRINTF
+  #define HAVE_SNPRINTF 1
+#endif
+#ifdef MR_HAVE_VSNPRINTF
+  #define HAVE_VSNPRINTF 1
+#endif
+#ifdef MR_HAVE__VSNPRINTF
+  #define HAVE__VSNPRINTF 1
+#endif
+#ifdef MR_HAVE_SYSCONF
+  #define HAVE_SYSCONF 1
+#endif
+#ifdef MR_HAVE_SIGACTION
+  #define HAVE_SIGACTION 1
+#endif
+#ifdef MR_HAVE_GETPAGESIZE
+  #define HAVE_GETPAGESIZE 1
+#endif
+#ifdef MR_HAVE_MEMALIGN
+  #define HAVE_MEMALIGN 1
+#endif
+#ifdef MR_HAVE_MPROTECT
+  #define HAVE_MPROTECT 1
+#endif
+#ifdef MR_HAVE_STRERROR
+  #define HAVE_STRERROR 1
+#endif
+#ifdef MR_HAVE_SETITIMER
+  #define HAVE_SETITIMER 1
+#endif
+#ifdef MR_HAVE_MEMMOVE
+  #define HAVE_MEMMOVE 1
+#endif
+#ifdef MR_HAVE_DLOPEN
+  #define HAVE_DLOPEN 1
+#endif
+#ifdef MR_HAVE_DLCLOSE
+  #define HAVE_DLCLOSE 1
+#endif
+#ifdef MR_HAVE_DLSYM
+  #define HAVE_DLSYM 1
+#endif
+#ifdef MR_HAVE_DLERROR
+  #define HAVE_DLERROR 1
+#endif
+#ifdef MR_HAVE_STAT
+  #define HAVE_STAT 1
+#endif
+#ifdef MR_HAVE_FSTAT
+  #define HAVE_FSTAT 1
+#endif
+#ifdef MR_HAVE_FDOPEN
+  #define HAVE_FDOPEN 1
+#endif
+#ifdef MR_HAVE_OPEN
+  #define HAVE_OPEN 1
+#endif
+#ifdef MR_HAVE_CLOSE
+  #define HAVE_CLOSE 1
+#endif
+#ifdef MR_HAVE_DUP
+  #define HAVE_DUP 1
+#endif
+#ifdef MR_HAVE_DUP2
+  #define HAVE_DUP2 1
+#endif
+#ifdef MR_HAVE_FILENO
+  #define HAVE_FILENO 1
+#endif
+#ifdef MR_HAVE_ISATTY
+  #define HAVE_ISATTY 1
+#endif
+#ifdef MR_HAVE_GRANTPT
+  #define HAVE_GRANTPT 1
+#endif
+#ifdef MR_HAVE_UNLOCKPT
+  #define HAVE_UNLOCKPT 1
+#endif
+#ifdef MR_HAVE_PTSNAME
+  #define HAVE_PTSNAME 1
+#endif
+#ifdef MR_HAVE_TCGETATTR
+  #define HAVE_TCGETATTR 1
+#endif
+#ifdef MR_HAVE_TCSETATTR
+  #define HAVE_TCSETATTR 1
+#endif
+#ifdef MR_HAVE_IOCTL
+  #define HAVE_IOCTL 1
+#endif
+
+/*
+** Command-line parameters
+*/
+#ifdef MR_USE_GCC_GLOBAL_REGISTERS
+  #define USE_GCC_GLOBAL_REGISTERS 1
+#endif
+#ifdef MR_USE_GCC_NONLOCAL_GOTOS
+  #define USE_GCC_NONLOCAL_GOTOS 1
+#endif
+#ifdef MR_USE_ASM_LABELS
+  #define USE_ASM_LABELS 1
+#endif
+#ifdef MR_CONSERVATIVE_GC
+  #define CONSERVATIVE_GC 1
+#endif
+#ifdef MR_NATIVE_GC
+  #define NATIVE_GC 1
+#endif
+#ifdef MR_NO_TYPE_LAYOUT
+  #define NO_TYPE_LAYOUT 1
+#endif
+#ifdef MR_BOXED_FLOAT
+  #define BOXED_FLOAT 1
+#endif
+#ifdef MR_USE_SINGLE_PREC_FLOAT
+  #define USE_SINGLE_PREC_FLOAT 1
+#endif
+#ifdef MR_SPLIT_C_FILES
+  #define SPLIT_C_FILES 1
+#endif
+#ifdef MR_INLINE_ALLOC
+  #define INLINE_ALLOC 1
+#endif
+#ifdef MR_PIC_REG
+  #define PIC_REG 1
+#endif
+
+/*
+** Other stuff.
+*/
+#ifdef MR_HAVE_SIGINFO
+  #define HAVE_SIGINFO 1
+#endif
+#ifdef MR_HAVE_SIGINFO_T
+  #define HAVE_SIGINFO_T 1
+#endif
+#ifdef MR_HAVE_SIGCONTEXT_STRUCT
+  #define HAVE_SIGCONTEXT_STRUCT 1
+#endif
+#ifdef MR_HAVE_SIGCONTEXT_STRUCT_3ARG
+  #define HAVE_SIGCONTEXT_STRUCT_3ARG 1
+#endif
+#ifdef MR_HAVE_SIGCONTEXT_STRUCT_2ARG
+  #define HAVE_SIGCONTEXT_STRUCT_2ARG 1
+#endif
+#ifdef MR_SIGACTION_FIELD
+  #define SIGACTION_FIELD MR_SIGACTION_FIELD
+#endif
+#ifdef MR_LOW_TAG_BITS
+  #define LOW_TAG_BITS MR_LOW_TAG_BITS
+#endif
+#ifdef MR_BYTES_PER_WORD
+  #define BYTES_PER_WORD MR_BYTES_PER_WORD
+#endif
+#ifdef MR_BITS_PER_WORD
+  #define BITS_PER_WORD MR_BITS_PER_WORD
+#endif
+#ifdef MR_SYNC_TERM_SIZE
+  #define SYNC_TERM_SIZE MR_SYNC_TERM_SIZE
+#endif
+#ifdef MR_BOXED_FLOAT
+  #define BOXED_FLOAT 1
+#endif
+#ifdef MR_HAVE_GCC_LABELS
+  #define HAVE_GCC_LABELS 1
+#endif
+#ifdef MR_HAVE_ASM_LABELS
+  #define HAVE_ASM_LABELS 1
+#endif
+#ifdef MR_USE_DLLS
+  #define USE_DLLS 1
+#endif
+#ifdef MR_PC_ACCESS_GREG
+  #define PC_ACCESS_GREG 1
+#endif
+#ifdef MR_PC_ACCESS
+  #define PC_ACCESS MR_PC_ACCESS
+#endif
+#ifdef MR_HAVE_DEV_PTMX
+  #define HAVE_DEV_PTMX 1
+#endif
+
+#endif /* !MR_NO_CONF_BACKWARDS_COMPAT */
+
+#endif /* MERCURY_CONF_BOOTSTRAP_H */
Index: runtime/mercury_conf_param.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf_param.h,v
retrieving revision 1.51
diff -u -u -r1.51 mercury_conf_param.h
--- runtime/mercury_conf_param.h	27 Dec 2001 07:25:22 -0000	1.51
+++ runtime/mercury_conf_param.h	9 Feb 2002 05:11:18 -0000
@@ -42,16 +42,19 @@
 ** MR_HIGHLEVEL_CODE
 ** MR_HIGHLEVEL_DATA
 ** MR_USE_GCC_NESTED_FUNCTIONS
-** USE_GCC_GLOBAL_REGISTERS
-** USE_GCC_NONLOCAL_GOTOS
-** USE_ASM_LABELS
-** CONSERVATIVE_GC
-** NATIVE_GC		[not yet working]
-** NO_TYPE_LAYOUT
-** BOXED_FLOAT
+** MR_USE_GCC_GLOBAL_REGISTERS
+** MR_USE_GCC_NONLOCAL_GOTOS
+** MR_USE_ASM_LABELS
+** MR_CONSERVATIVE_GC
+** MR_NATIVE_GC		[not yet working]
+** MR_NO_TYPE_LAYOUT
+** MR_BOXED_FLOAT
 ** MR_USE_TRAIL
 ** MR_RESERVE_TAG
 ** MR_USE_MINIMAL_MODEL
+** MR_SPLIT_C_FILES
+** MR_INLINE_ALLOC
+** MR_PIC_REG
 **	See the documentation for
 **		--high-level-code
 **		--high-level-data
@@ -66,9 +69,11 @@
 **		--use-trail
 **		--reserve-tag
 **		--use-minimal-model
+**		--split-c-files
+**		--pic-reg
 **	(respectively) in the mmc help message or the Mercury User's Guide.
 **
-** USE_SINGLE_PREC_FLOAT:
+** MR_USE_SINGLE_PREC_FLOAT:
 **	Use C's `float' rather than C's `double' for the
 **	Mercury floating point type (`MR_Float').
 **
@@ -92,6 +97,10 @@
 **	constructs, e.g. referring to variables and macros without their MR_
 **	prefixes.
 **
+** MR_NO_CONF_BACKWARDS_COMPAT
+**	Disable backwards compatibility with C code using obsolete
+**	configuration macros without MR_ prefixes.
+**
 ** MR_EXTRA_BACKWARDS_COMPAT
 **	Add extra backwards compatibility with C code using obsolete low-level
 **	constructs, e.g. referring to variables and macros without their MR_
@@ -99,6 +108,56 @@
 */
 
 /*
+** XXX Allow the non-prefixed versions of these macros to be used on
+** the command line until mgnuc and mercury_compile are fixed to
+** use the prefixed versions.
+*/
+#ifdef USE_GCC_GLOBAL_REGISTERS
+  #define MR_USE_GCC_GLOBAL_REGISTERS 1
+  #undef USE_GCC_GLOBAL_REGISTERS
+#endif
+#ifdef USE_GCC_NONLOCAL_GOTOS
+  #define MR_USE_GCC_NONLOCAL_GOTOS 1
+  #undef USE_GCC_NONLOCAL_GOTOS
+#endif
+#ifdef USE_ASM_LABELS
+  #define MR_USE_ASM_LABELS 1
+  #undef USE_ASM_LABELS
+#endif
+#ifdef CONSERVATIVE_GC
+  #define MR_CONSERVATIVE_GC 1
+  #undef CONSERVATIVE_GC
+#endif
+#ifdef NATIVE_GC
+  #define MR_NATIVE_GC 1
+  #undef NATIVE_GC
+#endif
+#ifdef NO_TYPE_LAYOUT
+  #define MR_NO_TYPE_LAYOUT 1
+  #undef NO_TYPE_LAYOUT
+#endif
+#ifdef BOXED_FLOAT
+  #define MR_BOXED_FLOAT 1
+  #undef BOXED_FLOAT
+#endif
+#ifdef USE_SINGLE_PREC_FLOAT
+  #define MR_USE_SINGLE_PREC_FLOAT 1
+  #undef USE_SINGLE_PREC_FLOAT
+#endif
+#ifdef SPLIT_C_FILES
+  #define MR_SPLIT_C_FILES 1
+  #undef SPLIT_C_FILES
+#endif
+#ifdef INLINE_ALLOC
+  #define MR_INLINE_ALLOC 1
+  #undef INLINE_ALLOC
+#endif
+#ifdef PIC_REG
+  #define MR_PIC_REG 1
+  #undef PIC_REG
+#endif
+
+/*
 ** Runtime checking options:
 **
 ** MR_CHECK_FOR_OVERFLOW
@@ -285,12 +344,12 @@
 */
 
 /*
-** MR_HIGHLEVEL_CODE implies BOXED_FLOAT,
+** MR_HIGHLEVEL_CODE implies MR_BOXED_FLOAT,
 ** since unboxed float is currently not yet implemented for the MLDS back-end.
 ** XXX we really ought to fix that...
 */
 #ifdef MR_HIGHLEVEL_CODE
-  #define BOXED_FLOAT 1
+  #define MR_BOXED_FLOAT 1
 #endif
 
 /* MR_LOWLEVEL_DEBUG implies MR_DEBUG_GOTOS and MR_CHECK_FOR_OVERFLOW */
@@ -341,7 +400,7 @@
 #ifdef MR_STATIC_CODE_ADDRESSES
   #error "MR_STATIC_CODE_ADDRESSES should not be defined on the command line"
 #endif
-#if !defined(USE_GCC_NONLOCAL_GOTOS) || defined(USE_ASM_LABELS)
+#if !defined(MR_USE_GCC_NONLOCAL_GOTOS) || defined(MR_USE_ASM_LABELS)
   #define MR_STATIC_CODE_ADDRESSES
 #endif
 
@@ -374,8 +433,9 @@
 #ifdef MR_INSERT_LABELS
   #error "MR_INSERT_LABELS should not be defined on the command line"
 #endif
-#if defined(MR_STACK_TRACE) || defined(NATIVE_GC) || defined(MR_DEBUG_GOTOS) \
-	|| defined(MR_BYTECODE_CALLABLE) || defined(MR_DEBUG_LABEL_NAMES)
+#if defined(MR_STACK_TRACE) || defined(MR_NATIVE_GC) \
+	|| defined(MR_DEBUG_GOTOS) || defined(MR_BYTECODE_CALLABLE) \
+	|| defined(MR_DEBUG_LABEL_NAMES)
   #define MR_INSERT_LABELS
 #endif
 
@@ -429,7 +489,7 @@
 ** layout of stack frames.
 */
 
-#if defined(NATIVE_GC) || defined(MR_DEBUG_GOTOS) \
+#if defined(MR_NATIVE_GC) || defined(MR_DEBUG_GOTOS) \
 	|| defined(MR_INSERT_ENTRY_LABEL_NAMES)
   #define MR_NEED_ENTRY_LABEL_ARRAY
 #endif
@@ -481,7 +541,7 @@
 **				  to be compiled with the flag `--trace-decl'.
 */
 
-#if defined(CONSERVATIVE_GC) && !defined(MR_DISABLE_DECLARATIVE_DEBUGGER)
+#if defined(MR_CONSERVATIVE_GC) && !defined(MR_DISABLE_DECLARATIVE_DEBUGGER)
   #define MR_USE_DECLARATIVE_DEBUGGER
 #endif
 
@@ -491,7 +551,7 @@
 ** Memory protection and signal handling.
 */
 
-#if defined(HAVE_SIGINFO) && defined(PC_ACCESS)
+#if defined(MR_HAVE_SIGINFO) && defined(MR_PC_ACCESS)
   #define MR_CAN_GET_PC_AT_SIGNAL
 #endif
 
@@ -500,7 +560,7 @@
 **					memory zones using mprotect() like
 **					functionality.
 */
-#if (defined(HAVE_MPROTECT) && defined(HAVE_SIGINFO)) || defined(_WIN32)
+#if (defined(MR_HAVE_MPROTECT) && defined(MR_HAVE_SIGINFO)) || defined(_WIN32)
   #define MR_CHECK_OVERFLOW_VIA_MPROTECT
 #endif
 
@@ -508,7 +568,7 @@
 ** MR_PROTECTPAGE   -- 	MR_protect_pages() can be defined to provide the same
 **			functionality as the system call mprotect().
 */
-#if defined(HAVE_MPROTECT) || defined(_WIN32)
+#if defined(MR_HAVE_MPROTECT) || defined(_WIN32)
   #define MR_PROTECTPAGE
 #endif
 
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list