[m-rev.] support `mmake install' in extras directory

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Mar 6 18:18:20 AEDT 2002


Add appropriate infrastructure to support doing `mmake depend && mmake
&& mmake install' in the `extras' directory, and having it automatically
install and build as much as possible.

extras/Mmakefile:
	New file.

extras/cgi/Mmakefile:
	Delete bogus reference to `ALL_LIBGRADES' and `mercury-config'.

extras/complex_numbers/Mmakefile:
extras/concurrency/Mmakefile:
extras/concurrency/concurrency.m:
extras/curses/Mmakefile:
extras/dynamic_linking/Mmakefile:
extras/lazy_evaluation/Mmakefile:
extras/lex/Mmakefile:
extras/moose/Mmakefile:
extras/xml/Mmakefile:
	Add rules for `mmake install'.

extras/references/scoped_update.m:
	Add macro guard around typedef in `c_header_code'.

extras/curs/Mmakefile:
extras/curses/Mmakefile:
	Define MERCURY_BOOTSTRAP_H, to avoid name clash on `bool'
	that is caused by our bootstrap code in runtime/Merucry.h.

extras/curs/curs.m:
	Add `promise_pure' declarations for all pure procedures.
	XXX Should this be needed?  These predicates all take
	io__state arguments.

Workspace: /home/ceres/fjh/mercury
Index: extras/Mmakefile
===================================================================
RCS file: extras/Mmakefile
diff -N extras/Mmakefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/Mmakefile	6 Mar 2002 06:57:40 -0000
@@ -0,0 +1,43 @@
+# This Mmakefile provides some targets for building and installing most
+# of the libraries in this `extras' distribution.
+#
+# Note that not all subdirectories of `extras' are set up for
+# automatic installation.  This Mmakefile will only build those which are.
+# In addition, libraries which are not reasonably portable won't get built.
+# The following subdirectories are not included in the list that gets
+# built by this Mmakefile, because they are often won't install
+# "out-of-the-box":
+#
+#	aditi 		you need to have Aditi installed
+#	graphics 	you need to have tcl/tk or OpenGL installed
+#	morphine 	see morphine/README for instructions on how to install
+#	concurrency 	doesn't work in all compilation grades
+#	trailed_update 	doesn't work in all compilation grades
+#	logged_output 	requires a specially-configured Mercury installation
+#	odbc 		requires an ODBC driver be installed
+#	quickcheck 	no `install' target
+#	stream 		no `install' target; also has some modules shared with
+#			the `concurrency' package.
+
+SUBDIRS = cgi complex_numbers curs curses dynamic_linking \
+	lazy_evaluation lex moose posix \
+	references xml
+
+MMAKEFLAGS =
+
+main_target: all
+
+depend: $(SUBDIRS:%=%_depend)
+all: $(SUBDIRS)
+install: all $(SUBDIRS:%=%_install)
+
+$(SUBDIRS:%=%_depend): %_depend:
+	cd $* && $(MMAKE) $(MMAKEFLAGS) depend
+
+$(SUBDIRS): %:
+	cd $* && $(MMAKE) $(MMAKEFLAGS) 
+
+$(SUBDIRS:%=%_install): %_install:
+	cd $* && $(MMAKE) $(MMAKEFLAGS) install
+
+.PHONY: $(SUBDIRS)
Index: extras/cgi/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/cgi/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- extras/cgi/Mmakefile	21 Nov 2000 23:52:26 -0000	1.2
+++ extras/cgi/Mmakefile	6 Mar 2002 05:10:50 -0000
@@ -14,7 +14,6 @@
 
 distclean: realclean
 
-ALL_LIBGRADES=`mercury-config --installed-grades`
 INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 
 install: libmercury_www.install
Index: extras/complex_numbers/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- extras/complex_numbers/Mmakefile	21 Nov 2000 23:52:27 -0000	1.3
+++ extras/complex_numbers/Mmakefile	6 Mar 2002 05:13:00 -0000
@@ -12,6 +12,9 @@
 
 depend:	complex_numbers.depend
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+install: libcomplex_numbers.install
+
 .PHONY: check
 check:
 	true
Index: extras/concurrency/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/concurrency/Mmakefile,v
retrieving revision 1.4
diff -u -d -r1.4 Mmakefile
--- extras/concurrency/Mmakefile	22 Nov 2001 10:52:21 -0000	1.4
+++ extras/concurrency/Mmakefile	6 Mar 2002 05:50:57 -0000
@@ -6,13 +6,17 @@
 
 -include ../Mmake.params
 
-default_target: tests
+default_target: all
+
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 
 TESTS = philo philo2 philo3 midimon
 
-depend:		$(TESTS:%=%.depend)
+depend:		concurrency.depend $(TESTS:%=%.depend)
+all:		libconcurrency tests
+install:	libconcurrency.install
 tests:		$(TESTS)
 
 .PHONY: check
-check: tests
+check: all
 		true
Index: extras/concurrency/concurrency.m
===================================================================
RCS file: extras/concurrency/concurrency.m
diff -N extras/concurrency/concurrency.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/concurrency/concurrency.m	6 Mar 2002 05:48:11 -0000
@@ -0,0 +1,3 @@
+% The "concurrency" library package consists of the following modules.
+:- module concurrency.
+:- import_module channel, global, mvar, semaphore, spawn, stream.
Index: extras/curs/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curs/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- extras/curs/Mmakefile	29 Dec 2001 06:45:24 -0000	1.2
+++ extras/curs/Mmakefile	6 Mar 2002 05:55:45 -0000
@@ -21,6 +21,7 @@
 # necessary, and everything put there.
 #
 #INSTALL_PREFIX = $(HOME)/mercury
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 
 # Omit this line if you want to install the default grades.
 # Edit this line if you want to install with different grades.
@@ -39,6 +40,9 @@
 #EXTRA_LIBRARIES = curs
 
 -include ../Mmake.params
+
+# Needed to avoid conflicts with `bool'
+CFLAGS = -DMERCURY_BOOTSTRAP_H
 
 MAIN_TARGET = libcurs
 depend: curs.depend
Index: extras/curs/curs.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curs/curs.m,v
retrieving revision 1.3
diff -u -d -r1.3 curs.m
--- extras/curs/curs.m	13 Feb 2002 09:56:27 -0000	1.3
+++ extras/curs/curs.m	6 Mar 2002 05:59:41 -0000
@@ -365,7 +365,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", start(IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     initscr();                          /* Start the show */
 
@@ -450,7 +450,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", stop(IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     endwin();
     IO = IO0;
@@ -467,7 +467,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", rows_cols(Rows::out, Cols::out, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     getmaxyx(stdscr, Rows, Cols);
     IO = IO0;
@@ -477,7 +477,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", move(Row::in, Col::in, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     move(Row, Col);
     IO = IO0;
@@ -487,7 +487,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", clear(IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     clear();
     IO = IO0;
@@ -497,7 +497,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", addch(Attr::in, CharCode::in, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     addch((chtype)Attr | (chtype)CharCode);
     IO = IO0;
@@ -515,21 +515,21 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", attr_on(Attr::in, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     attron(Attr);
     IO = IO0;
 
 ").
 :- pragma foreign_proc("C", attr_off(Attr::in, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     attroff(Attr);
     IO = IO0;
 
 ").
 :- pragma foreign_proc("C", attr_set(Attr::in, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     attrset(Attr);
     IO = IO0;
@@ -539,7 +539,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", doupdate(IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     doupdate();
     IO = IO0;
@@ -549,7 +549,7 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", getch(CharCode::out, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     CharCode = getch();
     IO = IO0;
@@ -559,217 +559,217 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", key_down = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_DOWN;
 ").
 :- pragma foreign_proc("C", key_up = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_UP;
 ").
 :- pragma foreign_proc("C", key_left = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_LEFT;
 ").
 :- pragma foreign_proc("C", key_right = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_RIGHT;
 ").
 :- pragma foreign_proc("C", key_home = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_HOME;
 ").
 :- pragma foreign_proc("C", key_backspace = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_BACKSPACE;
 ").
 :- pragma foreign_proc("C", key_f(N::in) = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_F( N);
 ").
 :- pragma foreign_proc("C", key_del = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_DC;
 ").
 :- pragma foreign_proc("C", key_ins = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_IC;
 ").
 :- pragma foreign_proc("C", key_pageup = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_NPAGE;
 ").
 :- pragma foreign_proc("C", key_pagedown = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_PPAGE;
 ").
 :- pragma foreign_proc("C", key_a1 = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_A1;
 ").
 :- pragma foreign_proc("C", key_a3 = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_A3;
 ").
 :- pragma foreign_proc("C", key_b2 = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_B2;
 ").
 :- pragma foreign_proc("C", key_c1 = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_C1;
 ").
 :- pragma foreign_proc("C", key_c3 = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_C3;
 ").
 :- pragma foreign_proc("C", key_enter = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_ENTER;
 ").
 :- pragma foreign_proc("C", key_end = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_END;
 ").
 :- pragma foreign_proc("C", key_resize = (K::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     K = KEY_RESIZE;
 ").
 
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", acs_block = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_BLOCK;
 ").
 :- pragma foreign_proc("C", acs_board = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_BOARD;
 ").
 :- pragma foreign_proc("C", acs_btee = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_BTEE;
 ").
 :- pragma foreign_proc("C", acs_bullet = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_BULLET;
 ").
 :- pragma foreign_proc("C", acs_ckboard = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_CKBOARD;
 ").
 :- pragma foreign_proc("C", acs_darrow = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_DARROW;
 ").
 :- pragma foreign_proc("C", acs_degree = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_DEGREE;
 ").
 :- pragma foreign_proc("C", acs_diamond = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_DIAMOND;
 ").
 :- pragma foreign_proc("C", acs_gequal = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_GEQUAL;
 ").
 :- pragma foreign_proc("C", acs_hline = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_HLINE;
 ").
 :- pragma foreign_proc("C", acs_lantern = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_LANTERN;
 ").
 :- pragma foreign_proc("C", acs_larrow = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_LARROW;
 ").
 :- pragma foreign_proc("C", acs_lequal = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_LEQUAL;
 ").
 :- pragma foreign_proc("C", acs_llcorner = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_LLCORNER;
 ").
 :- pragma foreign_proc("C", acs_lrcorner = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_LRCORNER;
 ").
 :- pragma foreign_proc("C", acs_ltee = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_LTEE;
 ").
 :- pragma foreign_proc("C", acs_nequal = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_NEQUAL;
 ").
 :- pragma foreign_proc("C", acs_pi = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_PI;
 ").
 :- pragma foreign_proc("C", acs_plminus = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_PLMINUS;
 ").
 :- pragma foreign_proc("C", acs_plus = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_PLUS;
 ").
 :- pragma foreign_proc("C", acs_rarrow = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_RARROW;
 ").
 :- pragma foreign_proc("C", acs_rtee = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_RTEE;
 ").
 :- pragma foreign_proc("C", acs_s1 = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_S1;
 ").
 :- pragma foreign_proc("C", acs_s3 = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_S3;
 ").
 :- pragma foreign_proc("C", acs_s7 = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_S7;
 ").
 :- pragma foreign_proc("C", acs_s9 = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_S9;
 ").
 :- pragma foreign_proc("C", acs_sterling = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_STERLING;
 ").
 :- pragma foreign_proc("C", acs_ttee = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_TTEE;
 ").
 :- pragma foreign_proc("C", acs_uarrow = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_UARROW;
 ").
 :- pragma foreign_proc("C", acs_ulcorner = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_ULCORNER;
 ").
 :- pragma foreign_proc("C", acs_urcorner = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_URCORNER;
 ").
 :- pragma foreign_proc("C", acs_vline = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = ACS_VLINE;
 ").
 
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", curs:((Attr1::in) + (Attr2::in)) = (Attr::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     Attr = (chtype)Attr1 | (chtype)Attr2;
 
@@ -778,81 +778,81 @@
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", normal = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_NORMAL;
 ").
 :- pragma foreign_proc("C", standout = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_STANDOUT;
 ").
 :- pragma foreign_proc("C", underline = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_UNDERLINE;
 ").
 :- pragma foreign_proc("C", reverse = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_REVERSE;
 ").
 :- pragma foreign_proc("C", blink = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_BLINK;
 ").
 :- pragma foreign_proc("C", dim = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_DIM;
 ").
 :- pragma foreign_proc("C", bold = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_BOLD;
 ").
 :- pragma foreign_proc("C", invis = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = A_INVIS;
 ").
 :- pragma foreign_proc("C", fg_bg(Fg::in, Bg::in) = (A::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     A = COLOR_PAIR(FG_BG(Fg, Bg));
 ").
 
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", black = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_BLACK;
 ").
 :- pragma foreign_proc("C", red = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_RED;
 ").
 :- pragma foreign_proc("C", green = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_GREEN;
 ").
 :- pragma foreign_proc("C", yellow = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_YELLOW;
 ").
 :- pragma foreign_proc("C", blue = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_BLUE;
 ").
 :- pragma foreign_proc("C", magenta = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_MAGENTA;
 ").
 :- pragma foreign_proc("C", cyan = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_CYAN;
 ").
 :- pragma foreign_proc("C", white = (C::out),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
     C = COLOR_WHITE;
 ").
 
 % ---------------------------------------------------------------------------- %
 
 :- pragma foreign_proc("C", border(IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     border(0, 0, 0, 0, 0, 0, 0, 0);
     IO = IO0;
@@ -860,7 +860,7 @@
 ").
 
 :- pragma foreign_proc("C", hline(C::in, N::in, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     hline(C, N);
     IO = IO0;
@@ -868,7 +868,7 @@
 ").
 
 :- pragma foreign_proc("C", vline(C::in, N::in, IO0::di, IO::uo),
-    [will_not_call_mercury], "
+    [will_not_call_mercury, promise_pure], "
 
     vline(C, N);
     IO = IO0;
@@ -897,7 +897,7 @@
 
     :- pragma foreign_proc("C", new(Rows::in, Cols::in, Row::in, Col::in, Attr::in,
                             Panel::out, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         WINDOW *w = newwin(Rows, Cols, Row, Col);
         scrollok(w, TRUE);
@@ -913,7 +913,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", delete(Panel::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         delwin(panel_window((PANEL *)Panel));
         del_panel((PANEL *)Panel);
@@ -925,7 +925,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", raise(Panel::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         top_panel((PANEL *)Panel);
 
@@ -936,7 +936,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", lower(Panel::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         bottom_panel((PANEL *)Panel);
 
@@ -947,7 +947,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", hide(Panel::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         hide_panel((PANEL *)Panel);
 
@@ -958,7 +958,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", reveal(Panel::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         show_panel((PANEL *)Panel);
 
@@ -969,7 +969,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", relocate(Panel::in, Row::in, Col::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         move_panel((PANEL *)Panel, Row, Col);
 
@@ -980,7 +980,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", clear(Panel::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         wclear(panel_window((PANEL *)Panel));
 
@@ -991,7 +991,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", move(Panel::in, Row::in, Col::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         wmove(panel_window((PANEL *)Panel), Row, Col);
 
@@ -1002,7 +1002,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", addch(Panel::in, Attr::in, CharCode::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         waddch(panel_window((PANEL *)Panel), (chtype)Attr | (chtype)CharCode);
 
@@ -1023,21 +1023,21 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", attr_on(Panel::in, Attr::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         wattron(panel_window((PANEL *)Panel), Attr);
         IO = IO0;
 
     ").
     :- pragma foreign_proc("C", attr_off(Panel::in, Attr::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         wattroff(panel_window((PANEL *)Panel), Attr);
         IO = IO0;
 
     ").
     :- pragma foreign_proc("C", attr_set(Panel::in, Attr::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         wattrset(panel_window((PANEL *)Panel), Attr);
         IO = IO0;
@@ -1047,7 +1047,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", update_panels(IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         update_panels();
         doupdate();
@@ -1059,7 +1059,7 @@
     % ------------------------------------------------------------------------ %
 
     :- pragma foreign_proc("C", border(Panel::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         wborder(panel_window((PANEL *)Panel), 0, 0, 0, 0, 0, 0, 0, 0);
         IO = IO0;
@@ -1067,7 +1067,7 @@
     ").
 
     :- pragma foreign_proc("C", hline(Panel::in, C::in, N::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         whline(panel_window((PANEL *)Panel), C, N);
         IO = IO0;
@@ -1075,7 +1075,7 @@
     ").
 
     :- pragma foreign_proc("C", vline(Panel::in, C::in, N::in, IO0::di, IO::uo),
-        [will_not_call_mercury], "
+        [will_not_call_mercury, promise_pure], "
 
         wvline(panel_window((PANEL *)Panel), C, N);
         IO = IO0;
Index: extras/curses/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curses/Mmakefile,v
retrieving revision 1.3
diff -u -d -r1.3 Mmakefile
--- extras/curses/Mmakefile	29 Dec 2001 06:45:26 -0000	1.3
+++ extras/curses/Mmakefile	6 Mar 2002 05:22:57 -0000
@@ -6,9 +6,16 @@
 
 -include ../Mmake.params
 
+# This is needed to avoid conflicts with `bool'
+CFLAGS = -DMERCURY_BOOTSTRAP_H	
+
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 default_target:	libmcurses
 
 depend:	mcurses.depend
+
+install: libmcurses.install
 
 # The following definition is correct for Linux.  You may need to change
 # this line to include the appropriate curses library for your OS. 
Index: extras/dynamic_linking/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/dynamic_linking/Mmakefile,v
retrieving revision 1.6
diff -u -d -r1.6 Mmakefile
--- extras/dynamic_linking/Mmakefile	11 Jan 2001 06:23:06 -0000	1.6
+++ extras/dynamic_linking/Mmakefile	6 Mar 2002 05:18:49 -0000
@@ -6,6 +6,8 @@
 
 -include ../Mmake.params
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 # Use shared libraries, since they're needed for dynamic linking
 MGNUCFLAGS = --pic-reg
 MLFLAGS = --shared
@@ -19,6 +21,8 @@
 
 main_target: libdl
 depend: dl.depend dl_test.depend dl_test2.depend hello.depend
+
+install: libdl.install
 
 #-----------------------------------------------------------------------------#
 #
Index: extras/lazy_evaluation/Mmakefile
===================================================================
RCS file: extras/lazy_evaluation/Mmakefile
diff -N extras/lazy_evaluation/Mmakefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/lazy_evaluation/Mmakefile	6 Mar 2002 05:31:57 -0000
@@ -0,0 +1,5 @@
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+default_target: all
+depend: lazy_list.depend lazy_list_test.depend
+all: liblazy_list lazy_list_test
+install: liblazy_list.install
Index: extras/lex/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/lex/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- extras/lex/Mmakefile	29 Dec 2001 06:47:53 -0000	1.2
+++ extras/lex/Mmakefile	6 Mar 2002 05:33:05 -0000
@@ -18,6 +18,7 @@
 # A directory $(INSTALL_PREFIX)/lib/mercury will be created, if
 # necessary, and everything put there.
 #
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
 #INSTALL_PREFIX = $(HOME)/mercury
 
 # Omit this line if you want to install the default grades.
Index: extras/moose/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/moose/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- extras/moose/Mmakefile	21 Nov 2000 23:52:30 -0000	1.2
+++ extras/moose/Mmakefile	6 Mar 2002 06:49:02 -0000
@@ -12,8 +12,15 @@
 # MCFLAGS = -O6
 # MCFLAGS = --intermodule-optimization -O6
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 .PHONY: default_target
 default_target:	moose
+
+.PHONY: install
+install:
+	[ -d $(INSTALL_BINDIR) ] || mkdir -p $(INSTALL_BINDIR)
+	cp moose $(INSTALL_BINDIR)
 
 .PHONY: depend
 depend:		moose.depend
Index: extras/references/scoped_update.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/scoped_update.m,v
retrieving revision 1.3
diff -u -d -r1.3 scoped_update.m
--- extras/references/scoped_update.m	21 Jan 2002 05:20:35 -0000	1.3
+++ extras/references/scoped_update.m	6 Mar 2002 06:01:46 -0000
@@ -75,11 +75,14 @@
 **  automatically called at the right time.
 */
 
+#ifndef ME_SCOPEHANDLE_DEFINED
+#define ME_SCOPEHANDLE_DEFINED
 typedef struct {
 	MR_Word *var;
 	MR_Word insideval;
 	MR_Word outsideval;
 } *ME_ScopeHandle;
+#endif
 
 void ME_enter_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason);
 void ME_exit_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason);
Index: extras/xml/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/xml/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- extras/xml/Mmakefile	21 Nov 2000 23:52:34 -0000	1.2
+++ extras/xml/Mmakefile	6 Mar 2002 07:02:31 -0000
@@ -6,11 +6,16 @@
 
 -include ../Mmake.params
 
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+
 .PHONY: default_target
-default_target: tryit
+default_target: tryit libxml
 
 .PHONY: depend
-depend: tryit.depend
+depend: tryit.depend xml.depend
+
+.PHONY: install
+install: libxml.install
 
 .PHONY: check
 check:

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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