[m-dev.] diff: fix failing tests in samples/c_interface

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 5 20:27:05 AEDT 2001


For both the main branch and the release branch.

Estimated hours taken: 2.5

Fix some failing test cases in samples/c_interface.
This fixes SourceForge bug report #131053.

samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
	Fix several bugs:
	- use $(MGNUC) rather than hard-coding mgnuc
	- pass $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) to mgnuc
	- pass $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) to ml
	- s/*_REGS_H/MR_MACHDEPS_*_REGS_H/, to match
	  the renaming that was done a fair while back
	  in the runtime/machdeps/*.h.

samples/tests/c_interface/c_calls_mercury/Mmakefile:
	Add an explicit dependency to ensure that runtests makes
	the dependencies for the extra Mercury library used in
	this test case.

Workspace: /home/hg/fjh/ws-hg3/mercury
Index: samples/c_interface/cplusplus_calls_mercury/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/c_interface/cplusplus_calls_mercury/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- samples/c_interface/cplusplus_calls_mercury/Mmakefile	1999/09/16 04:46:18	1.3
+++ samples/c_interface/cplusplus_calls_mercury/Mmakefile	2001/02/05 09:14:36
@@ -12,18 +12,18 @@
 .cc.o:
 	$(CXX) $(HACK) $(CXXFLAGS) -c $<
 
-CXX=mgnuc
+CXX=$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS)
 
 # Due to a bug in g++ 2.7, global register variables don't work in C++.
 # Hence we need to ensure that we don't include the global register
 # variable declarations.  The following hack seems to do the trick.
 
-HACK=		-DALPHA_REGS_H \
-		-DMIPS_REGS_H \
-		-DSPARC_REGS_H \
-		-DI386_REGS_H \
-		-DPA_REGS_H \
-		-DRS6000_REGS_H
+HACK=		-DMR_MACHDEPS_ALPHA_REGS_H \
+		-DMR_MACHDEPS_MIPS_REGS_H \
+		-DMR_MACHDEPS_SPARC_REGS_H \
+		-DMR_MACHDEPS_I386_REGS_H \
+		-DMR_MACHDEPS_PA_REGS_H \
+		-DMR_MACHDEPS_RS6000_REGS_H
 
 # pass `-g' to the C compiler and linker, so we can use a debugger (e.g. gdb)
 CXXFLAGS=-g
Index: samples/c_interface/mercury_calls_cplusplus/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/c_interface/mercury_calls_cplusplus/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- samples/c_interface/mercury_calls_cplusplus/Mmakefile	1999/09/16 04:46:19	1.3
+++ samples/c_interface/mercury_calls_cplusplus/Mmakefile	2001/02/05 09:07:24
@@ -13,18 +13,18 @@
 .cc.o:
 	$(CXX) $(HACK) $(CXXFLAGS) -c $<
 
-CXX=mgnuc
+CXX=$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS)
 
 # Due to a bug in g++ 2.7, global register variables don't work in C++.
 # Hence we need to ensure that we don't include the global register
 # variable declarations.  The following hack seems to do the trick.
 
-HACK=		-DALPHA_REGS_H \
-		-DMIPS_REGS_H \
-		-DSPARC_REGS_H \
-		-DI386_REGS_H \
-		-DPA_REGS_H \
-		-DRS6000_REGS_H
+HACK=		-DMR_MACHDEPS_ALPHA_REGS_H \
+		-DMR_MACHDEPS_MIPS_REGS_H \
+		-DMR_MACHDEPS_SPARC_REGS_H \
+		-DMR_MACHDEPS_I386_REGS_H \
+		-DMR_MACHDEPS_PA_REGS_H \
+		-DMR_MACHDEPS_RS6000_REGS_H
 
 #-----------------------------------------------------------------------------#
 
Index: samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile	1999/09/16 04:46:21	1.3
+++ samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile	2001/02/05 09:07:29
@@ -13,18 +13,18 @@
 .cc.o:
 	$(CXX) $(HACK) $(CXXFLAGS) -c $<
 
-CXX=mgnuc
+CXX=$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS)
 
 # Due to a bug in g++ 2.7, global register variables don't work in C++.
 # Hence we need to ensure that we don't include the global register
 # variable declarations.  The following hack seems to do the trick.
 
-HACK=		-DALPHA_REGS_H \
-		-DMIPS_REGS_H \
-		-DSPARC_REGS_H \
-		-DI386_REGS_H \
-		-DPA_REGS_H \
-		-DRS6000_REGS_H
+HACK=		-DMR_MACHDEPS_ALPHA_REGS_H \
+		-DMR_MACHDEPS_MIPS_REGS_H \
+		-DMR_MACHDEPS_SPARC_REGS_H \
+		-DMR_MACHDEPS_I386_REGS_H \
+		-DMR_MACHDEPS_PA_REGS_H \
+		-DMR_MACHDEPS_RS6000_REGS_H
 
 # pass `-g' to the C compiler and linker, so we can use a debugger (e.g. gdb)
 CXXFLAGS=-g
@@ -43,7 +43,8 @@
 #-----------------------------------------------------------------------------#
 
 cpp_main: $(OBJECTS)
-	$(ML) $(MLFLAGS) -o cpp_main $(OBJECTS) $(MLLIBS)
+	$(ML) $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) -o cpp_main $(OBJECTS) \
+		$(ALL_MLLIBS)
 
 cpp_main.o: mercury_lib.h
 
Index: samples/tests/c_interface/c_calls_mercury/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/tests/c_interface/c_calls_mercury/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- samples/tests/c_interface/c_calls_mercury/Mmakefile	2000/11/19 04:14:03	1.2
+++ samples/tests/c_interface/c_calls_mercury/Mmakefile	2001/02/05 09:04:00
@@ -21,6 +21,8 @@
 mercury_main.depend mercury_main.dep: c_main_int.m mercury_main.m
 c_main_int.o: c_main.h
 
+depend_local: mercury_lib.depend
+
 clean_local: clean_2
 
 clean_2:

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list