diff: clean up runtime.

Tyson Richard DOWD trd at cs.mu.oz.au
Mon Nov 17 19:11:09 AEDT 1997


Hi. 

Here's what I plan to commit soon. I haven't included the diffs
for most of the files, because they're pretty meaningless.

If you have any work in the runtime directory, you should probably make
a diff to make it easily to use patch to re-apply your changes.

===================================================================

Estimated hours taken: 1.5

Cleaned up runtime directory.

runtime/*.c:
	- Renamed all .c files as mercury_*.c
	  Some have been renamed to make their purpose clearer.
	  	call.mod -> mercury_ho_call.c

runtime/*.h:
	- Moved contents of .h files to mercury_*.h
	- *.h now contain #include "mercury_*.h". They be removed later.
	- Updated references to header files to include the correct
	  name.
	- Updated #ifdef FILENAME.H .... #endif /* FILENAME.H */
	  with new filename.

runtime/conf.h.in:
	- Renamed conf.h.in as mercury_conf.h.in.
	  Didn't leave a forwarding header for this one, as conf.h was
	  never part of the repository anyway.

runtime/Mmakefile:
	- Convert lists to one-per-line lists.
	- Add mercury_accurate_gc.h to HDRS.
	- Remove all .mod files
	- Make sure runtime.init uses the ORIG_CS not MOD_CS.
	- Fix the rules for "clean_o" and "clean_mod_c", which used
	  wildcards like "*.o" to remove files.  The one that removed
	  all .c files corresponding with *.mod, instead of using MOD_CS
	  was particularly vicious.
	- Cope with the file renamings.

Mmakefile:
Makefile:
configure.in:
	- Cope with the file renamings.

Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.117
diff -u -r1.117 configure.in
--- configure.in	1997/11/02 12:41:48	1.117
+++ configure.in	1997/11/17 08:03:08
@@ -20,7 +20,7 @@
 define(MERCURY_MSG,
 [echo $1 1>&AC_FD_MSG])
 #-----------------------------------------------------------------------------#
-AC_INIT(runtime/wrapper.mod)
+AC_INIT(runtime/mercury_wrapper.c)
 #-----------------------------------------------------------------------------#
 #
 # Ensure that all messages are saved to a file `configure.log' by
@@ -39,7 +39,7 @@
 	exit
 fi
 #-----------------------------------------------------------------------------#
-AC_CONFIG_HEADER(runtime/conf.h)
+AC_CONFIG_HEADER(runtime/mercury_conf.h)
 AC_PREFIX_DEFAULT(/usr/local/mercury-`. ./VERSION; echo $VERSION`)
 AC_CANONICAL_HOST
 FULLARCH="$host"
@@ -210,7 +210,7 @@
 CFLAGS="-O"
 
 # we also need to add the appropriate `-I' options so that the test programs
-# can do #include "memory.h"
+# can #include various Mercury runtime headers.
 CFLAGS="-I runtime -I runtime/machdeps $CFLAGS"
 AC_PROG_CPP
 AC_C_CROSS
@@ -1079,10 +1079,10 @@
 	AC_DEFINE(HAVE_ASM_LABELS)
 fi
 #-----------------------------------------------------------------------------#
-# We need to ensure that runtime/conf.h exists, since some of the
+# We need to ensure that runtime/mercury_conf.h exists, since some of the
 # programs we attempt to compile below indirectly include it.
-test -f runtime/conf.h || {
-	cat > runtime/conf.h <<EOF
+test -f runtime/mercury_conf.h || {
+	cat > runtime/mercury_conf.h <<EOF
 #define WORD_TYPE $WORD_TYPE
 EOF
 }
@@ -1093,8 +1093,8 @@
 	AC_TRY_RUN([
 	#define USE_GCC_NONLOCAL_GOTOS
 	#define USE_GCC_GLOBAL_REGISTERS
-	#include "regs.h"
-	#include "memory.h"
+	#include "mercury_regs.h"
+	#include "mercury_memory.h"
 	changequote(<<,>>) 
 	Word fake_reg[MAX_FAKE_REG];
 	changequote([,]) 
@@ -1154,8 +1154,8 @@
 AC_CACHE_VAL(mercury_cv_gcc_model_reg,
 AC_TRY_RUN([
 #define USE_GCC_GLOBAL_REGISTERS
-#include "regs.h"
-#include "memory.h"
+#include "mercury_regs.h"
+#include "mercury_memory.h"
 changequote(<<,>>) 
 Word fake_reg[MAX_FAKE_REG];
 changequote([,]) 
@@ -1443,7 +1443,8 @@
 		#
 		# If you *do* use `-fpic', you must also use `-DPIC'.
 		#
-		# See runtime/goto.h for the code that handles PIC on SPARCs.
+		# See runtime/mercury_goto.h for the code that handles PIC
+		# on SPARCs.
 		# Note that mixing PIC and non-PIC code is fine on SPARCs
 		# (though it doesn't work on x86s, due to the use of `ebx'
 		# in runtime/machdeps/i386_regs.h).
@@ -1551,8 +1552,8 @@
 scripts/msc scripts/msl scripts/msp scripts/sicstus_conv
 scripts/mkfifo_using_mknod bindist/bindist.build_vars
 ,
-if test "$CONFIG_HEADERS" = "runtime/conf.h"; then
-	touch runtime/conf.h.date
+if test "$CONFIG_HEADERS" = "runtime/mercury_conf.h"; then
+	touch runtime/mercury_conf.h.date
 fi
 # conftest.junk is used to avoid a warning if there
 # are no files in the list passed to chmod
Index: runtime/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/Mmakefile,v
retrieving revision 1.16
diff -u -r1.16 Mmakefile
--- Mmakefile	1997/11/06 06:19:38	1.16
+++ Mmakefile	1997/11/17 07:49:16
@@ -22,32 +22,87 @@
 #-----------------------------------------------------------------------------#
 
 #		  keep this list in alphabetical order, please
-HDRS		= calls.h conf.h context.h \
-		  deep_copy.h dlist.h debug.h dummy.h \
-		  engine.h getopt.h goto.h heap.h imp.h init.h label.h \
-		  memory.h mercury_float.h mercury_grade.h \
-		  mercury_string.h mercury_trace.h mercury_trail.h \
-		  mercury_types.h misc.h \
-		  overflow.h prof.h prof_mem.h regorder.h regs.h \
-		  spinlock.h std.h stacks.h \
-		  table.h tags.h timing.h type_info.h wrapper.h \
-		  $(LIBMER_DLL_H)
+HDRS		=	\
+		  	mercury_engine.h	\
+			mercury_getopt.h	\
+			mercury_goto.h		\
+			mercury_heap.h		\
+			mercury_imp.h		\
+			mercury_init.h		\
+			mercury_label.h		\
+			mercury_memory.h	\
+			mercury_accurate_gc.h	\
+			mercury_calls.h		\
+			mercury_conf.h		\
+			mercury_context.h	\
+			mercury_debug.h		\
+			mercury_deep_copy.h	\
+			mercury_dummy.h		\
+			mercury_dlist.h		\
+			mercury_float.h		\
+			mercury_string.h	\
+			mercury_trace.h		\
+			mercury_trail.h		\
+			mercury_types.h		\
+			mercury_misc.h		\
+			mercury_overflow.h	\
+			mercury_prof.h		\
+			mercury_prof_mem.h	\
+			mercury_regorder.h	\
+			mercury_regs.h		\
+			mercury_spinlock.h	\
+			mercury_std.h		\
+			mercury_stacks.h	\
+			mercury_table.h		\
+			mercury_tags.h		\
+			mercury_timing.h	\
+			mercury_type_info.h	\
+			mercury_wrapper.h	\
+			$(LIBMER_DLL_H)
+
 # Note that `libmer_globals.h' cannot be part of $(HDR),
 # since it depends on libmer_def.a, and $(OBJ) : $(HDR) would create a
 # circular dependency.
 
 
-MACHHDRS	= machdeps/no_regs.h machdeps/i386_regs.h \
-		  machdeps/mips_regs.h machdeps/sparc_regs.h \
-		  machdeps/alpha_regs.h machdeps/pa_regs.h \
-		  machdeps/rs6000_regs.h
-MODS		= engine.mod wrapper.mod call.mod context.mod type_info.mod
-MOD_CS		= engine.c wrapper.c call.c context.c type_info.c
+MACHHDRS	= 	machdeps/no_regs.h	\
+			machdeps/i386_regs.h	\
+			machdeps/mips_regs.h	\
+			machdeps/sparc_regs.h	\
+			machdeps/alpha_regs.h	\
+			machdeps/pa_regs.h	\
+			machdeps/rs6000_regs.h
+
+
+# XXX .mod support is being removed. This will soon disappear.
+MODS		= 
+MOD_CS		= 
 MOD_OS		= $(MOD_CS:.c=.o)
-ORIG_CS		= deep_copy.c dlist.c dummy.c label.c \
-		  memory.c misc.c regs.c table.c timing.c prof.c prof_mem.c \
-		  spinlock.c mercury_float.c mercury_grade.c mercury_trace.c \
-		  mercury_trail.c
+
+#		  keep this list in alphabetical order, please
+ORIG_CS		= 	mercury_context.c	\
+			mercury_deep_copy.c	\
+			mercury_dlist.c		\
+			mercury_dummy.c		\
+			mercury_engine.c	\
+			mercury_float.c		\
+			mercury_grade.c		\
+			mercury_ho_call.c	\
+			mercury_label.c		\
+			mercury_memory.c	\
+			mercury_misc.c		\
+			mercury_prof.c		\
+			mercury_prof_mem.c	\
+			mercury_regs.c		\
+			mercury_spinlock.c	\
+			mercury_table.c		\
+			mercury_timing.c	\
+			mercury_trace.c		\
+			mercury_trail.c 	\
+			mercury_type_info.c	\
+			mercury_wrapper.c
+
+ORIG_OS		= $(ORIG_CS:.c=.o)
 ORIG_OS		= $(ORIG_CS:.c=.o)
 OBJS		= $(MOD_OS) $(ORIG_OS)
 PIC_OBJS	= $(OBJS:.o=.$(EXT_FOR_PIC_OBJECTS))
@@ -96,8 +151,8 @@
 		$(LDFLAGS) $(LDLIBS)					\
 		$(SHARED_LIBS)
 
-runtime.init: $(MOD_CS)
-	cat `vpath_find $(MOD_CS)` | grep '^INIT ' > runtime.init
+runtime.init: $(ORIG_CS)
+	cat `vpath_find $(ORIG_CS)` | grep '^INIT ' > runtime.init
 
 conf.h.date: $(MERCURY_DIR)/config.status conf.h.in
 	CONFIG_FILES= CONFIG_HEADERS=conf.h $(MERCURY_DIR)/config.status
@@ -161,13 +216,11 @@
 
 .PHONY: clean_o
 clean_o:
-	rm -f *.o *.pic_o
+	rm -f $(MOD_OS) $(OBJS) $(PIC_OBJS) 
 
 .PHONY: clean_mod_c
 clean_mod_c:
-	for file in *.mod; do \
-		rm -f `basename $$file .mod`.c; \
-	done
+	rm -f $(MOD_OS)
 
 realclean:
 	rm -f libmer.a libmer.so runtime.init
Index: Makefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	1996/12/05 20:30:53	1.7
+++ Makefile	1997/11/17 07:12:31
@@ -44,7 +44,7 @@
 .PHONY: distclean
 distclean: clean
 	cd scripts; for file in *.in; do rm -f `basename $file .in`; done
-	-rm -f Mmake.common runtime/conf.h bindist/bindist.build_vars
+	-rm -f Mmake.common runtime/mercury_conf.h bindist/bindist.build_vars
 	-rm -f config.cache config.status config.log
 
 .PHONY: maintainer-clean
Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/Mmakefile,v
retrieving revision 1.13
diff -u -r1.13 Mmakefile
--- Mmakefile	1997/10/21 14:56:44	1.13
+++ Mmakefile	1997/11/17 07:13:32
@@ -173,7 +173,7 @@
 	cd doc && mmake distclean
 	-rm -f errs errs2 update.log
 	-rm -f config.status config.cache config.log configure.log
-	-rm -f runtime/conf.h
+	-rm -f runtime/mercury_conf.h
 	-rm -f Mmake.common
 	# Package up the mercury directory and the tests directory, 
 	# but with some subdirectories excluded, into a gzipped tar

-- 
       Tyson Dowd           # 
                            #         Linux versus Windows is a 
     trd at cs.mu.oz.au        #            Win lose situation.
http://www.cs.mu.oz.au/~trd #



More information about the developers mailing list