[m-dev.] For review: Simplified installation of user libraries

Warwick Harvey wharvey at cs.monash.edu.au
Sun Oct 3 23:00:55 AEST 1999


Fergus wrote:
> So I think it would be best if the `.opt' files were not built and installed
> unless the library was compiled with intermodule optimization enabled.
> However the Mercury User's Guide should advise library developers to compile
> their libraries with intermodule optimization enabled.

OK, I've updated the User Guide.

> Hmm, it's a bit hard to read and maintain such a long section of code
> in that form.  I think it would be clearer to write most of that as a
> single string literal:

Done.

> I think that documentation is misleading, because it suggests that it only
> installs the libraries for one grade, but (if I understand things correctly)
> actually it will installed them for multiple grades by default.
> Therefore I suggest replacing that with the following

Done.

> > +Note that at this stage is not possible to set the installation prefix
> > +on a library-by-library basis.
> 
> I suggest s/at this stage/currently/

Done.

> > +lib%.install_grades:
> > +	rm -rf tmp_dir && \
> > +	mkdir tmp_dir && \
> > +	{ mv -f *.c *.o *.pic_o *.a *.so tmp_dir || true; } && \
> > +	for grade in x $(ALL_LIBGRADES); do \
> > +		if [ "$$grade" != "x" ]; then \
> > +			$(MMAKE) GRADE=$$grade lib$*.install_library || \
> > +				exit 1; \
> > +			rm -rf *.c *.o *.pic_o *.a *.so; \
> > +		fi; \
> > +	done && \
> > +	{ mv tmp_dir/* . ; rmdir tmp_dir ; true }
> > +
> > +lib%.install_split_grades:
> > +	rm -rf tmp_dir && \
> > +	mkdir tmp_dir && \
> > +	{ mv -f *.dir *.c *.o *.pic_o *.a *.so tmp_dir || true; } && \
> > +	for grade in x $(ALL_LIBGRADES); do \
> > +		if [ "$$grade" != "x" ]; then \
> > +			$(MMAKE) GRADE=$$grade lib$*.install_split_library || \
> > +				exit 1; \
> > +			rm -rf *.dir *.c *.o *.pic_o *.a *.so; \
> > +		fi; \
> > +	done && \
> > +	{ mv tmp_dir/* . ; rmdir tmp_dir ; true }
> 
> Those rules won't work correctly if `--use-subdirs' is enabled.

Same goes for a bunch of other things.  :-)

I've tested the revised version both with and without the use of subdirs,
and it seems to work OK now.

> There are a also other flaws with those rules, in particular
> the danger of moving or removing *.c, problems if run concurrently,
> and leaving the directory in a nasty state if the install fails.
> Fixes for those are not as easy.  But I suppose those problems
> are tolerable for now.

I have changed things so that:

1)  Only those `.c', `.o' etc. files used by the library being built are
moved and deleted.

2)  `mmake libfoo.install -j2' doesn't crash and burn (it now makes sure
everything else is installed before building the grades).  (Doesn't stop the
user invoking multiple simultaneous `mmake's in the same directory though.)
(I also moved a few targets back into `Mmake.rules' since the reason for
them being in the `.dep' files disappeared with this change.)

3)  If an install encounters an error while building a different grade, a
script is called to clean up the mess.  This ensures that any files left in
the directory are compatible with the default grade.  This of course has the
disadvantage that any files related to the error are likely to be missing.
Perhaps the user should just be told to run the script, rather than it being
run automatically?  Also, can anyone think of a convenient way for the
script to know what the subdirectory names are (rather than hard-coding
them)?  Or should it be an mmake target rather than a separate script?

I've also added a `lib%.install_split' target, which does the same thing
for split versions of the library as `lib%.install' did for the "normal"
versions.

I include below a relative diff, plus a full diff.

Estimated hours taken: 20

Added built-in mmake support for installing user libraries.

Mmake.common.in:
        Moved the definitions of many of the generic install directories
        (plus FULLARCH and LIBGRADES) to scripts/Mmake.vars.in, so they
        can be used for things other than just the Mercury compiler.

compiler/modules.m:
        Added code to generate appropriate lib<module>.install* targets.
        Improved the dependency list generated for the lib<module> target to
        include intermodule optimisation files if and only if the
        appropriate flags have been set (previously it always depended on
        the `.opt' files, but never on the `.trans_opt' files).

scripts/Mmake.rules:
        Added some rules for use when installing libraries.

scripts/Mmake.vars.in:
        Added the definitions of many of the generic install directories
        (plus FULLARCH and LIBGRADES) from Mmake.common.in.
        Added support for overriding and/or adding to the definition of
        LIBGRADES on a per-library basis.

scripts/cleanup_install:
        New script, for cleaning up after failed installs.  

doc/user_guide.texi:
        Documented the new features.

extras/references/Mmakefile:
extras/references/samples/Mmakefile:
        Changed to exploit/test new features.

===================================================================
--- compiler/ver1/modules.m	Sun Oct  3 19:33:44 1999
+++ compiler/modules.m	Sun Oct  3 21:37:28 1999
@@ -563,6 +563,7 @@
 		; Ext = ".clean_sicstus"
 		; Ext = ".realclean"
 		; Ext = ".depend"
+		; Ext = ".install_ints"
 		; Ext = ".check"
 		; Ext = ".ints"
 		; Ext = ".int3s"
@@ -2660,57 +2661,39 @@
 			" $(", MakeVarName, ".qls)\n\n"
 	]),
 
-	module_name_to_lib_file_name("lib", ModuleName, ".install", no,
-				LibInstallTargetName),
-	module_name_to_lib_file_name("lib", ModuleName, ".install_main", no,
-				LibInstallMainTargetName),
-	module_name_to_lib_file_name("lib", ModuleName, ".install_grades", no,
-				LibInstallGradesTargetName),
 	module_name_to_lib_file_name("lib", ModuleName, ".install_ints", no,
 				LibInstallIntsTargetName),
-	module_name_to_lib_file_name("lib", ModuleName, ".install_init", no,
-				LibInstallInitTargetName),
-	module_name_to_lib_file_name("lib", ModuleName, ".install_library", no,
-				LibInstallLibraryTargetName),
-	io__write_strings(DepStream, [
-		".PHONY : ", LibInstallTargetName, "\n",
-		LibInstallTargetName, " : ", LibInstallMainTargetName, " ",
-			LibInstallGradesTargetName, "\n\n",
-		".PHONY : ", LibInstallMainTargetName, "\n",
-		LibInstallMainTargetName, " : ", LibInstallIntsTargetName, " ",
-			LibInstallInitTargetName, " ",
-			LibInstallLibraryTargetName, "\n\n"
-	]),
+	{ InstallIntsRuleBody =
+"		for file in $$files; do \\
+			target=$(INSTALL_INT_DIR)/`basename $$file`; \\
+			if cmp -s $$file $$target; then \\
+				echo \"$$target unchanged\"; \\
+			else \\
+				echo \"installing $$target\"; \\
+				cp $$file $$target; \\
+			fi; \\
+		done
+		# The following is needed to support the `--use-subdirs' option
+		# We try using `ln -s', but if that fails, then we just use `cp'.
+		for ext in int int2 int3 opt trans_opt; do \\
+			dir=$${ext}s; \\
+			rm -f $(INSTALL_INT_DIR)/Mercury/$$dir; \\
+			ln -s .. $(INSTALL_INT_DIR)/Mercury/$$dir || { \\
+				mkdir $(INSTALL_INT_DIR)/Mercury/$$dir && \\
+				cp $(INSTALL_INT_DIR)/*.$$ext \\
+					$(INSTALL_INT_DIR)/Mercury/$$dir; \\
+			} || exit 1; \\
+		done\n\n" },
 
 	io__write_strings(DepStream, [
 		".PHONY : ", LibInstallIntsTargetName, "\n",
 		LibInstallIntsTargetName, " : $(", MakeVarName, ".ints) $(",
 			MakeVarName, ".int3s) ", MaybeOptsVar,
 			MaybeTransOptsVar, "install_lib_dirs\n",
-		"\tfor file in $(", MakeVarName, ".ints) $(", MakeVarName,
+		"\tfiles=""$(", MakeVarName, ".ints) $(", MakeVarName,
 			".int3s) ", MaybeOptsVar, MaybeTransOptsVar,
-			"; do \\\n",
-		"\t\ttarget=$(INSTALL_INT_DIR)/`basename $$file`; \\\n",
-		"\t\tif cmp -s $$file $$target; then \\\n",
-		"\t\t\techo \"$$target unchanged\"; \\\n",
-		"\t\telse \\\n",
-		"\t\t\techo \"installing $$target\"; \\\n",
-		"\t\t\tcp $$file $$target; \\\n",
-		"\t\tfi; \\\n",
-		"\tdone\n",
-		"\t# The following is needed to support the `--use-subdirs'",
-			" option\n",
-		"\t# We try using `ln -s', but if that fails, then we just",
-			" use `cp'.\n",
-		"\tfor ext in int int2 int3 opt trans_opt; do \\\n",
-		"\t\tdir=$${ext}s; \\\n",
-		"\t\trm -f $(INSTALL_INT_DIR)/Mercury/$$dir; \\\n",
-		"\t\tln -s .. $(INSTALL_INT_DIR)/Mercury/$$dir || { \\\n",
-		"\t\t\tmkdir $(INSTALL_INT_DIR)/Mercury/$$dir && \\\n",
-		"\t\t\tcp $(INSTALL_INT_DIR)/*.$$ext \\\n",
-		"\t\t\t\t$(INSTALL_INT_DIR)/Mercury/$$dir; \\\n",
-		"\t\t} || exit 1; \\\n",
-		"\tdone\n\n"
+			"""; \\\n",
+		InstallIntsRuleBody
 	]),
 
 	module_name_to_file_name(SourceModuleName, ".check", no,
===================================================================
--- doc/ver1/user_guide.texi	Fri Oct  1 18:56:57 1999
+++ doc/user_guide.texi	Sun Oct  3 18:50:46 1999
@@ -429,8 +429,11 @@
 
 @item lib at var{main-module}.install
 Builds and installs a library whose top-level module is @var{main-module}.
-This will build and install a static object library, a shared object library
-(for platforms that support it), and the necessary interface files.
+This target will build and install a static object library and
+(for platforms that support it) a shared object library,
+for the default grade and also for the additional grades specified
+in the LIBGRADES variable.  It will also build and install the
+necessary interface files.
 For more information, see @ref{Supporting multiple grades and architectures}.
 
 @item @var{main-module}.clean
@@ -704,7 +707,8 @@
 
 @example
 libmypackage: libmypackage.a libmypackage.so \
-		$(mypackage.ints) $(mypackage.opts) mypackage.init
+		$(mypackage.ints) $(mypackage.int3s) \
+		$(mypackage.opts) $(mypackage.trans_opts) mypackage.init
 
 libmypackage.a: $(mypackage.os)
 	rm -f libmypackage.a
@@ -734,15 +738,18 @@
 
 Note that to use a library, as well as the shared or static object library,
 you also need the interface files.  That's why the
- at samp{libmypackage} target builds @samp{$(mypackage.ints)}.
+ at samp{libmypackage} target builds @samp{$(mypackage.ints)} and
+ at samp{$(mypackage.int3s)}.
 If the people using the library are going to use intermodule
 optimization, you will also need the intermodule optimization interfaces.
-That's why the @samp{libmypackage} target builds @samp{$(mypackage.opts)}.
-If the people using the library are going to use transitive intermodule
-optimization, you will also need the transitive intermodule optimization
-interfaces.  Currently these are @emph{not} built by default; if
-you want to build them, you will need to include @samp{--trans-intermod-opt}
-in your @samp{MCFLAGS} variable.
+The @samp{libmypackage} target will build @samp{$(mypackage.opts)} if
+ at samp{--intermodule-optimization} is specified in your @samp{MCFLAGS}
+variable (this is recommended).
+Similarly, if the people using the library are going to use transitive
+intermodule optimization, you will also need the transitive intermodule
+optimization interfaces (@samp{$(mypackage.trans_opt)}).
+These will be built if @samp{--trans-intermod-opt} is specified in your
+ at samp{MCFLAGS} variable.
 
 In addition, with certain compilation grades, programs will need to
 execute some startup code to initialize the library; the
@@ -868,7 +875,7 @@
 @samp{lib at var{foo}} by setting the @samp{LIBGRADES- at var{foo}} variable,
 or add to it by setting @samp{EXTRA_LIBGRADES- at var{foo}}.
 
-Note that at this stage is not possible to set the installation prefix
+Note that currently it is not possible to set the installation prefix
 on a library-by-library basis.
 
 Once a library is installed in such a hierarchy, using it is easy.
===================================================================
--- scripts/ver1/Mmake.rules	Sun Oct  3 18:52:24 1999
+++ scripts/Mmake.rules	Sun Oct  3 22:13:33 1999
@@ -325,13 +325,18 @@
 # Targets for building and installing libraries.
 #
 
-# It would nice to also have rules for `lib%.install' and `lib%.install_main'
-# here, but pattern rules are ignored if they have no body, so they must go
-# in each module's `.dep' file instead.
-
-# We also put the `lib%.install_ints' rule in each module's `.dep' file so
-# it can be more easily customised based on the desired level of intermodule
-# optimisation.
+# Note: the `lib%.install_ints' rule is generated in each module's `.dep'
+# file so it can be more easily customised based on the desired level of
+# intermodule optimisation.
+
+.PHONY: lib%.install
+lib%.install: lib%.install_ints lib%.install_init lib%.install_library
+	$(MMAKE) lib$*.install_grades || ( cleanup_install && exit 1 )
+
+.PHONY: lib%.install_split
+lib%.install_split: lib%.install_ints lib%.install_init \
+		lib%.install_split_library
+	$(MMAKE) lib$*.install_split_grades || ( cleanup_install && exit 1 )
 
 .PHONY: lib%.install_init
 lib%.install_init: %.init install_lib_dirs
@@ -348,28 +353,33 @@
 lib%.install_grades:
 	rm -rf tmp_dir && \
 	mkdir tmp_dir && \
-	{ mv -f *.c *.o *.pic_o *.a *.so tmp_dir || true; } && \
+	{ mv -f $($*.cs) $($*.os) $($*.pic_os) *.a *.so tmp_dir || true; } && \
 	for grade in x $(ALL_LIBGRADES); do \
 		if [ "$$grade" != "x" ]; then \
 			$(MMAKE) GRADE=$$grade lib$*.install_library || \
 				exit 1; \
-			rm -rf *.c *.o *.pic_o *.a *.so; \
+			rm -f $($*.cs) $($*.os) $($*.pic_os) *.a *.so; \
 		fi; \
 	done && \
-	{ mv tmp_dir/* . ; rmdir tmp_dir ; true }
+	{ mv tmp_dir/*.c $(cs_subdir). ; \
+	  mv tmp_dir/*.o $(os_subdir). ; \
+	  mv tmp_dir/*.pic_o $(os_subdir). ; \
+	  mv tmp_dir/* . ; rmdir tmp_dir ; true }
 
 lib%.install_split_grades:
 	rm -rf tmp_dir && \
 	mkdir tmp_dir && \
-	{ mv -f *.dir *.c *.o *.pic_o *.a *.so tmp_dir || true; } && \
+	{ mv -f $($*.dirs) *.a *.so tmp_dir || true; } && \
 	for grade in x $(ALL_LIBGRADES); do \
 		if [ "$$grade" != "x" ]; then \
 			$(MMAKE) GRADE=$$grade lib$*.install_split_library || \
 				exit 1; \
-			rm -rf *.dir *.c *.o *.pic_o *.a *.so; \
+			rm -rf $($*.dirs) *.a *.so; \
 		fi; \
 	done && \
-	{ mv tmp_dir/* . ; rmdir tmp_dir ; true }
+	{ mv tmp_dir/*.dir $(dirs_subdir). ; \
+	  mv tmp_dir/* . ; rmdir tmp_dir ; true }
 
 
 .PHONY: install_lib_dirs
===================================================================
--- scripts/ver1/Mmake.vars.in	Sun Oct  3 22:39:32 1999
+++ scripts/Mmake.vars.in	Sun Oct  3 20:44:23 1999
@@ -339,6 +339,8 @@
 
 ifeq ($(MMAKE_USE_SUBDIRS),yes)
 
+# If you change any of these, you may need to update `cleanup_install'.
+
 SUBDIR=Mercury/
 
 nos_subdir=$(SUBDIR)nos/
@@ -453,8 +455,9 @@
 INSTALL_MERC_BIN_DIR	= $(INSTALL_LIBDIR)/bin/$(FULLARCH)
 INSTALL_MERC_GRADELESS_LIB_DIR = $(INSTALL_LIBDIR)/lib/$(FULLARCH)
 FINAL_INSTALL_MERC_GRADELESS_LIB_DIR = $(FINAL_INSTALL_LIBDIR)/lib/$(FULLARCH)
-INSTALL_MERC_LIB_DIR	= $(INSTALL_LIBDIR)/lib/$(GRADE)/$(FULLARCH)
-FINAL_INSTALL_MERC_LIB_DIR = $(FINAL_INSTALL_LIBDIR)/lib/$(GRADE)/$(FULLARCH)
+INSTALL_MERC_LIB_DIR	= $(INSTALL_LIBDIR)/lib/$(GRADESTRING)/$(FULLARCH)
+FINAL_INSTALL_MERC_LIB_DIR = \
+		$(FINAL_INSTALL_LIBDIR)/lib/$(GRADESTRING)/$(FULLARCH)
 
 #-----------------------------------------------------------------------------#
 
Index: scripts/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmakefile,v
retrieving revision 1.17
diff -u -r1.17 Mmakefile
--- Mmakefile   1999/09/16 04:46:29     1.17
+++ Mmakefile   1999/10/03 12:50:09
@@ -16,7 +16,7 @@
 
 SCRIPTS = mmake mmc mdb c2init mgnuc ml mprof mprof_merge_runs \
          sicstus_conv mtags vpath_find mercury_update_interface \
-         mkfifo_using_mknod
+         mkfifo_using_mknod cleanup_install
 DEBUGGER_SCRIPTS = mdbrc
 EMACS_SCRIPTS = gud.el
 



New file: scripts/cleanup_install:
===================================================================
#! /bin/sh
#---------------------------------------------------------------------------#
# Copyright (C) 1999 Monash University.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#---------------------------------------------------------------------------#
#
# cleanup_install
#
# Author: Warwick Harvey <wharvey at cs.monash.edu.au>
#
# Checks for failed/aborted installation attempts, and tries to clean up
# after them, since simply re-starting the install may do the wrong thing.
#
# The main problem with restarting an install is when the install is
# interrupted during the building of alternative grades of the library,
# runtime, etc.  When the alternative grades are being built, the versions
# of the compiled files needed for the compiler itself (as opposed to
# installed libraries) are moved into a `tmp_dir' subdirectory, with the
# alternative versions being built in the old location.  This means that if
# the process is interrupted and then re-started, the build process will
# attempt to re-build the compiler using some files with the wrong grade.
#
# This script checks for the presence of subdirectories named `tmp_dir',
# and if it finds them, assumes that an install process has failed and
# needs to be cleaned up.  Cleaning up the failed install consists simply
# of moving all the files in each `tmp_dir' back to where they came
# from, overwriting any alternative grade versions that may be there,
# and deleting the temporary directories.
#
# If there is an error while doing the clean-up, a more aggressive approach
# is used.  An "mmake clean" is run on the directory in question, and then
# the `tmp_dir' is deleted completely.  Note that for some directories (e.g.
# `library' and `browser'), this deletes some C files, which require a
# working version of Mercury to rebuild.  However, if the installation got
# as far as building the different grades of the library, then the compiler
# (plus its default grade) has already been installed.  The build scripts
# are smart enough to find and use this installed version even if it's not
# in the user's path, so the "mmake clean" is safe even if there is no
# existing Mercury installation (e.g. if the user is building it from
# release sources).

cleanup_failed_dirs=

for tmp in `find . -name tmp_dir -print` ; do
    dir=`dirname $tmp`
    echo "Cleaning up from apparent failed install in \`$dir'..."
    if (
	cd $dir && (
	    if [ -d Mercury/dirs ] ; then
	    	dirs_subdir=Mercury/dirs/
	    else
	    	dirs_subdir=
	    fi
	    # For every saved `.dir' directory, delete any existing one so
	    # it can be moved back (one can't just clobber directories).
	    (
		cd tmp_dir &&
		for dir in *.dir ; do
		    if [ "$dir" != "*.dir" ] ; then
			rm -rf ../$dirs_subdir$dir
		    fi
		done
	    )
	    [ -d Mercury/dirs ] && mv tmp_dir/*.dir $dirs_subdir
	    [ -d Mercury/cs ] && mv -f tmp_dir/*.c Mercury/cs
	    [ -d Mercury/os ] && mv -f tmp_dir/*.o tmp_dir/*.pic_o Mercury/os
	    mv -f tmp_dir/* .
	    rmdir tmp_dir
	)
    ) ; then
	echo "Done."
    else
	echo "Failed.  Trying a more aggressive approach..."
	if ( cd $dir && mmake clean && rm -rf tmp_dir ) ; then
	    echo "Succeeded."
	else
	    echo "Failed again.  :-("
	    cleanup_failed_dirs="$cleanup_failed_dirs $dir"
	fi
    fi
done

if [ -n "$cleanup_failed_dirs" ] ; then
	cat <<END

Clean-up failed in the following directories:

$cleanup_failed_dirs

Either fix these directories by hand, or start over from scratch.

END
	exit 1
fi

exit 0




Full diff:
cvs server: Diffing .
Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.39
diff -u -r1.39 Mmake.common.in
--- Mmake.common.in	1999/07/20 21:29:35	1.39
+++ Mmake.common.in	1999/10/03 12:54:43
@@ -21,56 +21,12 @@
 
 #-----------------------------------------------------------------------------#
 
-# Specify the locations for installing things.
-# These directories can all be modified independantly.
-# In particular, you might want to find a better place for the DVI and
-# HTML files.
-
-# FINAL_INSTALL_PREFIX describes the directory that the installation
-# will finally end up in. It should only be set by the configure 
-# script.  Other FINAL_INSTALL_* variables have a similar meaning.
-#
-# If you want to install to a different directory temporarily (e.g.
-# to build a package, or if you don't have the permissions to install
-# to a final directory), override INSTALL_PREFIX on the command-line.
-# If you have previously configured to the directory you want to
-# finally install to, you will then be able to move the files safely,
-# since any hard-coded paths will be set to their final destination
-# already (note that the installation in the temporary directory may
-# not work until moved into its final destination).
-# e.g.
-#      configure --prefix /usr
-#      make INSTALL_PREFIX=/some/temporary/directory/usr
-
-# If you don't intend to install to a temporary directory, rather than
-# overriding INSTALL_PREFIX you should reconfigure using the configure
-# script, since there are some hardcoded paths created by the configure
-# script (e.g. in the shell scripts mmc, ml, mmake, etc) that will not
-# be updated simply by overriding INSTALL_PREFIX.
-
-INSTALL_PREFIX		= @prefix@
-FINAL_INSTALL_PREFIX	= @prefix@
-INSTALL_BINDIR 		= $(INSTALL_PREFIX)/bin
-INSTALL_LIBDIR 		= $(INSTALL_PREFIX)/lib/mercury
-FINAL_INSTALL_LIBDIR 	= $(FINAL_INSTALL_PREFIX)/lib/mercury
-INSTALL_INFO_DIR 	= $(INSTALL_PREFIX)/info
-INSTALL_DVI_DIR 	= $(INSTALL_PREFIX)/lib/mercury/doc
-INSTALL_TEXT_DIR 	= $(INSTALL_PREFIX)/lib/mercury/doc
-INSTALL_PS_DIR 		= $(INSTALL_PREFIX)/lib/mercury/doc
-INSTALL_MAN_DIR 	= $(INSTALL_PREFIX)/man
-INSTALL_HTML_DIR 	= $(INSTALL_PREFIX)/lib/mercury/html
-INSTALL_MDB_DOC_DIR 	= $(INSTALL_PREFIX)/lib/mercury/mdb
-INSTALL_ELISP_DIR 	= $(INSTALL_PREFIX)/lib/mercury/elisp
-
 # Specify the Mercury compiler to use for bootstrapping
 MC			= @BOOTSTRAP_MC@
 
 # Specify the compilation model to use for compiling the compiler
 GRADE			= @GRADE@
 
-# Specify the additional compilation models to install the library for
-LIBGRADES  		= @LIBGRADES@
-
 # Specify EXT_FOR_EXE is `.exe' on MS-Windows and empty elsewhere.
 EXT_FOR_EXE	= @EXT_FOR_EXE@
 
@@ -136,16 +92,8 @@
 
 #-----------------------------------------------------------------------------#
 
-INSTALL_MODULE_DIR	= $(INSTALL_LIBDIR)/modules
-INSTALL_INT_DIR		= $(INSTALL_LIBDIR)/ints
-INSTALL_INC_DIR		= $(INSTALL_LIBDIR)/inc
-INSTALL_MMAKE_DIR 	= $(INSTALL_LIBDIR)/mmake
-FULLARCH		= @FULLARCH@
-INSTALL_MERC_BIN_DIR	= $(INSTALL_LIBDIR)/bin/$(FULLARCH)
-INSTALL_MERC_GC_LIB_DIR	= $(INSTALL_LIBDIR)/lib/$(FULLARCH)
-FINAL_INSTALL_MERC_GC_LIB_DIR = $(FINAL_INSTALL_LIBDIR)/lib/$(FULLARCH)
-INSTALL_MERC_LIB_DIR	= $(INSTALL_LIBDIR)/lib/$(GRADE)/$(FULLARCH)
-FINAL_INSTALL_MERC_LIB_DIR = $(FINAL_INSTALL_LIBDIR)/lib/$(GRADE)/$(FULLARCH)
+INSTALL_MERC_GC_LIB_DIR	= $(INSTALL_MERC_GRADELESS_LIB_DIR)
+FINAL_INSTALL_MERC_GC_LIB_DIR = $(FINAL_INSTALL_MERC_GRADELESS_LIB_DIR)
 
 SCRIPTS_DIR = $(MERCURY_DIR)/scripts
 RUNTIME_DIR = $(MERCURY_DIR)/runtime
cvs server: Diffing bindist
cvs server: Diffing boehm_gc
cvs server: Diffing boehm_gc/Mac_files
cvs server: Diffing boehm_gc/cord
cvs server: Diffing boehm_gc/cord/private
cvs server: Diffing boehm_gc/include
cvs server: Diffing boehm_gc/include/private
cvs server: Diffing browser
cvs server: Diffing bytecode
cvs server: Diffing bytecode/test
cvs server: Diffing compiler
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.108
diff -u -r1.108 modules.m
--- modules.m	1999/09/12 04:26:46	1.108
+++ modules.m	1999/10/03 12:54:43
@@ -563,6 +563,7 @@
 		; Ext = ".clean_sicstus"
 		; Ext = ".realclean"
 		; Ext = ".depend"
+		; Ext = ".install_ints"
 		; Ext = ".check"
 		; Ext = ".ints"
 		; Ext = ".int3s"
@@ -2568,6 +2569,20 @@
 		"\t$(RANLIB) $(ALL_RANLIBFLAGS) ", SplitLibFileName, "\n\n"
 	]),
 
+	globals__io_lookup_bool_option(intermodule_optimization, Intermod),
+	{ Intermod = yes ->
+		string__append_list(["$(", MakeVarName, ".opts) "],
+				MaybeOptsVar)
+	;
+		MaybeOptsVar = ""
+	},
+	globals__io_lookup_bool_option(transitive_optimization, TransOpt),
+	{ TransOpt = yes ->
+		string__append_list(["$(", MakeVarName, ".trans_opts) "],
+				MaybeTransOptsVar)
+	;
+		MaybeTransOptsVar = ""
+	},
 	module_name_to_lib_file_name("lib", ModuleName, "", no, LibTargetName),
 	module_name_to_lib_file_name("lib", ModuleName, ".a", yes, LibFileName),
 	module_name_to_lib_file_name("lib", ModuleName, ".so", yes,
@@ -2581,7 +2596,7 @@
 		MaybeSharedLibFileName, " \\\n",
 		"\t\t$(", MakeVarName, ".ints) ",
 		"$(", MakeVarName, ".int3s) ",
-		"$(", MakeVarName, ".opts) ",
+		MaybeOptsVar, MaybeTransOptsVar,
 		InitFileName, "\n\n"
 	]),
 
@@ -2644,6 +2659,41 @@
 		SicstusDebugExeFileName, " : $(", MakeVarName, ".qls)\n",
 		"\t$(MSL) --debug $(ALL_MSLFLAGS) -o ", SicstusDebugExeFileName,
 			" $(", MakeVarName, ".qls)\n\n"
+	]),
+
+	module_name_to_lib_file_name("lib", ModuleName, ".install_ints", no,
+				LibInstallIntsTargetName),
+	{ InstallIntsRuleBody =
+"		for file in $$files; do \\
+			target=$(INSTALL_INT_DIR)/`basename $$file`; \\
+			if cmp -s $$file $$target; then \\
+				echo \"$$target unchanged\"; \\
+			else \\
+				echo \"installing $$target\"; \\
+				cp $$file $$target; \\
+			fi; \\
+		done
+		# The following is needed to support the `--use-subdirs' option
+		# We try using `ln -s', but if that fails, then we just use `cp'.
+		for ext in int int2 int3 opt trans_opt; do \\
+			dir=$${ext}s; \\
+			rm -f $(INSTALL_INT_DIR)/Mercury/$$dir; \\
+			ln -s .. $(INSTALL_INT_DIR)/Mercury/$$dir || { \\
+				mkdir $(INSTALL_INT_DIR)/Mercury/$$dir && \\
+				cp $(INSTALL_INT_DIR)/*.$$ext \\
+					$(INSTALL_INT_DIR)/Mercury/$$dir; \\
+			} || exit 1; \\
+		done\n\n" },
+
+	io__write_strings(DepStream, [
+		".PHONY : ", LibInstallIntsTargetName, "\n",
+		LibInstallIntsTargetName, " : $(", MakeVarName, ".ints) $(",
+			MakeVarName, ".int3s) ", MaybeOptsVar,
+			MaybeTransOptsVar, "install_lib_dirs\n",
+		"\tfiles=""$(", MakeVarName, ".ints) $(", MakeVarName,
+			".int3s) ", MaybeOptsVar, MaybeTransOptsVar,
+			"""; \\\n",
+		InstallIntsRuleBody
 	]),
 
 	module_name_to_file_name(SourceModuleName, ".check", no,
cvs server: Diffing compiler/notes
cvs server: Diffing debian
cvs server: Diffing detail
cvs server: Diffing doc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.184
diff -u -r1.184 user_guide.texi
--- user_guide.texi	1999/08/18 06:26:06	1.184
+++ user_guide.texi	1999/10/03 12:54:44
@@ -427,6 +427,15 @@
 (for platforms that support it), and the necessary interface files.
 For more information, see @ref{Libraries}.
 
+ at item lib at var{main-module}.install
+Builds and installs a library whose top-level module is @var{main-module}.
+This target will build and install a static object library and
+(for platforms that support it) a shared object library,
+for the default grade and also for the additional grades specified
+in the LIBGRADES variable.  It will also build and install the
+necessary interface files.
+For more information, see @ref{Supporting multiple grades and architectures}.
+
 @item @var{main-module}.clean
 Removes the automatically generated files
 that contain the compiled code of the program
@@ -561,6 +570,20 @@
 @item EXTRA_LIB_DIRS
 A list of extra Mercury library directory hierarchies to search when
 looking for extra libraries.
+
+ at item INSTALL_PREFIX
+The path to the root of the directory hierarchy where the libraries,
+etc. you are building should be installed.  The default is to install in
+the same location as the Mercury compiler being used to do the install.
+
+ at item LIBGRADES
+A list of additional grades which should be built when installing libraries.
+The default is to install the Mercury compiler's default set of grades.
+Note that this may not be the set of grades in which the standard libraries
+were actually installed.
+Note also that any @code{GRADEFLAGS} settings will also be applied when
+the library is built in each of the listed grades, so you may not get what
+you expect if those options are not subsumed by each of the grades listed.
 @end table
 
 Other variables also exist - see
@@ -684,7 +707,8 @@
 
 @example
 libmypackage: libmypackage.a libmypackage.so \
-		$(mypackage.ints) $(mypackage.opts) mypackage.init
+		$(mypackage.ints) $(mypackage.int3s) \
+		$(mypackage.opts) $(mypackage.trans_opts) mypackage.init
 
 libmypackage.a: $(mypackage.os)
 	rm -f libmypackage.a
@@ -714,15 +738,18 @@
 
 Note that to use a library, as well as the shared or static object library,
 you also need the interface files.  That's why the
- at samp{libmypackage} target builds @samp{$(mypackage.ints)}.
+ at samp{libmypackage} target builds @samp{$(mypackage.ints)} and
+ at samp{$(mypackage.int3s)}.
 If the people using the library are going to use intermodule
 optimization, you will also need the intermodule optimization interfaces.
-That's why the @samp{libmypackage} target builds @samp{$(mypackage.opts)}.
-If the people using the library are going to use transitive intermodule
-optimization, you will also need the transitive intermodule optimization
-interfaces.  Currently these are @emph{not} built by default; if
-you want to build them, you will need to include @samp{--trans-intermod-opt}
-in your @samp{MCFLAGS} variable.
+The @samp{libmypackage} target will build @samp{$(mypackage.opts)} if
+ at samp{--intermodule-optimization} is specified in your @samp{MCFLAGS}
+variable (this is recommended).
+Similarly, if the people using the library are going to use transitive
+intermodule optimization, you will also need the transitive intermodule
+optimization interfaces (@samp{$(mypackage.trans_opt)}).
+These will be built if @samp{--trans-intermod-opt} is specified in your
+ at samp{MCFLAGS} variable.
 
 In addition, with certain compilation grades, programs will need to
 execute some startup code to initialize the library; the
@@ -815,15 +842,41 @@
 @section Supporting multiple grades and architectures
 
 In order to better support using and installing libraries in multiple
-grades, @samp{mmake} now has some support for alternative library directory
+grades, @samp{mmake} now has support for alternative library directory
 hierarchies.
 These have the same structure as the @file{@var{prefix}/lib/mercury} tree,
 including the different subdirectories for different grades and different
 machine architectures.
+
+In order to support the installation of a library into such a tree, you
+simply need to specify (e.g. in your @file{Mmakefile}) the path prefix
+and the list of grades to install:
+
+ at example
+INSTALL_PREFIX = /my/install/dir
+LIBGRADES = asm_fast asm_fast.gc.tr.debug
+ at end example
+
+This specifies that libraries should be installed in
+ at file{/my/install/dir/lib/mercury}, in the default grade plus
+ at samp{asm_fast} and @samp{asm_fast.gc.tr.debug}.
+If @samp{INSTALL_PREFIX} is not specified, @samp{mmake} will attempt to
+install the library in the same place as the standard Mercury libraries.
+If @samp{LIBGRADES} is not specified, @samp{mmake} will use the Mercury
+compiler's default set of grades, which may or may not correspond to the
+actual set of grades in which the standard Mercury libraries were installed.
+
+To actually install a library @samp{lib at var{foo}}, use the @samp{mmake}
+target @samp{lib at var{foo}.install}.
+This also installs all the needed interface files, and (if intermodule
+optimisation is enabled) the relevant intermodule optimisation files.
+
+One can override the list of grades to install for a given library
+ at samp{lib at var{foo}} by setting the @samp{LIBGRADES- at var{foo}} variable,
+or add to it by setting @samp{EXTRA_LIBGRADES- at var{foo}}.
 
-Automatically installing a library and all its associated files to such a
-tree is not yet supported, but until it is the user can use the same
-techniques used for building and installing the core Mercury libraries.
+Note that currently it is not possible to set the installation prefix
+on a library-by-library basis.
 
 Once a library is installed in such a hierarchy, using it is easy.
 Suppose the user wishes to use the library @samp{mypackage} (installed
@@ -833,7 +886,8 @@
 The user need only set the following Mmake variables:
 
 @example
-EXTRA_LIB_DIRS = /some/directory/mypackage /some/directory/myotherlib
+EXTRA_LIB_DIRS = /some/directory/mypackage/lib/mercury \
+		/some/directory/myotherlib/lib/mercury
 EXTRA_LIBRARIES = mypackage myotherlib
 @end example
 
cvs server: Diffing extras
cvs server: Diffing extras/aditi
cvs server: Diffing extras/cgi
cvs server: Diffing extras/complex_numbers
cvs server: Diffing extras/complex_numbers/samples
cvs server: Diffing extras/complex_numbers/tests
cvs server: Diffing extras/dynamic_linking
cvs server: Diffing extras/exceptions
cvs server: Diffing extras/graphics
cvs server: Diffing extras/graphics/mercury_opengl
cvs server: Diffing extras/graphics/mercury_tcltk
cvs server: Diffing extras/graphics/samples
cvs server: Diffing extras/graphics/samples/calc
cvs server: Diffing extras/graphics/samples/maze
cvs server: Diffing extras/graphics/samples/pent
cvs server: Diffing extras/lazy_evaluation
cvs server: Diffing extras/lazy_evaluation/examples
cvs server: Diffing extras/odbc
cvs server: Diffing extras/references
Index: extras/references/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- Mmakefile	1998/06/18 04:30:20	1.1
+++ Mmakefile	1999/10/03 12:54:44
@@ -6,6 +6,16 @@
 
 GRADEFLAGS += --use-trail
 
+# Install in an "extras" subdirectory of the main installation tree
+INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
+LIBGRADES = asm_fast.tr asm_fast.gc.tr.debug
+
+MAIN_TARGET = libglobal
+
+# In case the user of the library wants to do intermodule optimisation
+MCFLAGS += --intermodule-optimisation
+MCFLAGS += --transitive-intermodule-optimisation
+
 depend: global.depend
 	cd samples && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" depend
 	cd tests && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" depend
@@ -13,6 +23,8 @@
 check: libglobal
 	cd samples && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" check
 	cd tests && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" check
+
+install: libglobal.install
 
 clean: clean_subdirs
 
cvs server: Diffing extras/references/samples
Index: extras/references/samples/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/samples/Mmakefile,v
retrieving revision 1.3
diff -u -r1.3 Mmakefile
--- Mmakefile	1999/09/16 04:45:49	1.3
+++ Mmakefile	1999/10/03 12:54:44
@@ -9,14 +9,9 @@
 # We need to use a grade with trailing
 GRADEFLAGS += --use-trail
 
-MGNUCFLAGS= -I..
+EXTRA_LIB_DIRS = $(INSTALL_PREFIX)/extras/lib/mercury
 
-# Link in the reference library from ..
-MCFLAGS += -I.. $(EXTRA_MCFLAGS)
-MLFLAGS += -R`pwd`/.. -L.. $(EXTRA_MLFLAGS)
-MLLIBS = -lglobal $(EXTRA_MLLIBS)
-VPATH = ..:$(MMAKE_VPATH)
-C2INITARGS = ../global.init
+EXTRA_LIBRARIES = global
 
 # We need the following to use shared libraries on Linux
 #MGNUCFLAGS += -DPIC_REG
cvs server: Diffing extras/references/tests
cvs server: Diffing extras/trailed_update
cvs server: Diffing extras/trailed_update/samples
cvs server: Diffing extras/trailed_update/tests
cvs server: Diffing library
cvs server: Diffing lp_solve
cvs server: Diffing lp_solve/lp_examples
cvs server: Diffing profiler
cvs server: Diffing readline
cvs server: Diffing readline/doc
cvs server: Diffing readline/examples
cvs server: Diffing readline/shlib
cvs server: Diffing readline/support
cvs server: Diffing runtime
cvs server: Diffing runtime/GETOPT
cvs server: Diffing runtime/machdeps
cvs server: Diffing samples
cvs server: Diffing samples/c_interface
cvs server: Diffing samples/c_interface/c_calls_mercury
cvs server: Diffing samples/c_interface/cplusplus_calls_mercury
cvs server: Diffing samples/c_interface/mercury_calls_c
cvs server: Diffing samples/c_interface/mercury_calls_cplusplus
cvs server: Diffing samples/c_interface/mercury_calls_fortran
cvs server: Diffing samples/c_interface/simpler_c_calls_mercury
cvs server: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs server: Diffing samples/diff
cvs server: Diffing samples/muz
cvs server: Diffing samples/rot13
cvs server: Diffing scripts
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.71
diff -u -r1.71 Mmake.rules
--- Mmake.rules	1999/08/18 06:26:09	1.71
+++ Mmake.rules	1999/10/03 12:54:44
@@ -321,3 +321,77 @@
 clean_local: clean_prof_files
 
 #-----------------------------------------------------------------------------#
+#
+# Targets for building and installing libraries.
+#
+
+# Note: the `lib%.install_ints' rule is generated in each module's `.dep'
+# file so it can be more easily customised based on the desired level of
+# intermodule optimisation.
+
+.PHONY: lib%.install
+lib%.install: lib%.install_ints lib%.install_init lib%.install_library
+	$(MMAKE) lib$*.install_grades || ( cleanup_install && exit 1 )
+
+.PHONY: lib%.install_split
+lib%.install_split: lib%.install_ints lib%.install_init \
+		lib%.install_split_library
+	$(MMAKE) lib$*.install_split_grades || ( cleanup_install && exit 1 )
+
+.PHONY: lib%.install_init
+lib%.install_init: %.init install_lib_dirs
+	cp `vpath_find $*.init` $(INSTALL_MODULE_DIR)
+
+.PHONY: lib%.install_library
+lib%.install_library: lib%.a lib%.$(EXT_FOR_SHARED_LIB) install_grade_dirs
+	cp `vpath_find lib$*.a lib$*.$(EXT_FOR_SHARED_LIB)` \
+			$(INSTALL_MERC_LIB_DIR)
+
+lib%.install_split_library: %.split.a install_grade_dirs
+	cp `vpath_find $*.split.a` $(INSTALL_MERC_LIB_DIR)/lib$*.a
+
+lib%.install_grades:
+	rm -rf tmp_dir && \
+	mkdir tmp_dir && \
+	{ mv -f $($*.cs) $($*.os) $($*.pic_os) *.a *.so tmp_dir || true; } && \
+	for grade in x $(ALL_LIBGRADES); do \
+		if [ "$$grade" != "x" ]; then \
+			$(MMAKE) GRADE=$$grade lib$*.install_library || \
+				exit 1; \
+			rm -f $($*.cs) $($*.os) $($*.pic_os) *.a *.so; \
+		fi; \
+	done && \
+	{ mv tmp_dir/*.c $(cs_subdir). ; \
+	  mv tmp_dir/*.o $(os_subdir). ; \
+	  mv tmp_dir/*.pic_o $(os_subdir). ; \
+	  mv tmp_dir/* . ; rmdir tmp_dir ; true }
+
+lib%.install_split_grades:
+	rm -rf tmp_dir && \
+	mkdir tmp_dir && \
+	{ mv -f $($*.dirs) *.a *.so tmp_dir || true; } && \
+	for grade in x $(ALL_LIBGRADES); do \
+		if [ "$$grade" != "x" ]; then \
+			$(MMAKE) GRADE=$$grade lib$*.install_split_library || \
+				exit 1; \
+			rm -rf $($*.dirs) *.a *.so; \
+		fi; \
+	done && \
+	{ mv tmp_dir/*.dir $(dirs_subdir). ; \
+	  mv tmp_dir/* . ; rmdir tmp_dir ; true }
+
+
+.PHONY: install_lib_dirs
+install_lib_dirs:
+	-[ -d $(INSTALL_INT_DIR) ] || mkdir -p $(INSTALL_INT_DIR)
+	-[ -d $(INSTALL_INC_DIR) ] || mkdir -p $(INSTALL_INC_DIR)
+	-[ -d $(INSTALL_MODULE_DIR) ] || mkdir -p $(INSTALL_MODULE_DIR)
+	# The following is needed to support the `--use-subdirs' option
+	-[ -d $(INSTALL_INT_DIR)/Mercury ] || \
+		mkdir -p $(INSTALL_INT_DIR)/Mercury
+
+.PHONY: install_grade_dirs
+install_grade_dirs: #install_lib_dirs
+	-[ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
+
+#-----------------------------------------------------------------------------#
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.28
diff -u -r1.28 Mmake.vars.in
--- Mmake.vars.in	1999/07/26 02:52:44	1.28
+++ Mmake.vars.in	1999/10/03 12:54:44
@@ -188,6 +188,11 @@
 RANLIBFLAGS	=
 EXTRA_RANLIBFLAGS =
 
+# List of grades to install for a library
+ALL_LIBGRADES	= $(TARGET_LIBGRADES) $(EXTRA_TARGET_LIBGRADES)
+LIBGRADES	=
+EXTRA_LIBGRADES	=
+
 # $(CFLAGS_FOR_PIC) is passed to the C compiler when creating `.pic_o' files
 # (We use `.pic_o' as the extension for `.o' files that must have
 # position-independent code.)
@@ -305,6 +310,17 @@
 maybe-target-EXTRA_LIBRARIES- = $(EXTRA_LIBRARIES-$(patsubst %_init.c,%,$@))
 maybe-target-EXTRA_LIBRARIES-undefined =
 
+TARGET_LIBGRADES = \
+  $(maybe-base-LIBGRADES-$(findstring undefined,$(origin LIBGRADES-$*)))
+maybe-base-LIBGRADES- = $(LIBGRADES-$*)
+maybe-base-LIBGRADES-undefined = $(LIBGRADES) $(EXTRA_LIBGRADES)
+
+EXTRA_TARGET_LIBGRADES = \
+  $(maybe-base-EXTRA_LIBGRADES-$(findstring undefined,\
+		$(origin EXTRA_LIBGRADES-$*)))
+maybe-base-EXTRA_LIBGRADES- = $(EXTRA_LIBGRADES-$*)
+maybe-base-EXTRA_LIBGRADES-undefined =
+
 # Support for compiling Mercury programs with Prolog will probably be
 # dropped one of these days, so it's probably not worth bothering with these.
 TARGET_MNCFLAGS	=
@@ -323,6 +339,8 @@
 
 ifeq ($(MMAKE_USE_SUBDIRS),yes)
 
+# If you change any of these, you may need to update `cleanup_install'.
+
 SUBDIR=Mercury/
 
 nos_subdir=$(SUBDIR)nos/
@@ -382,5 +400,68 @@
 MAIN_TARGET =
 
 default_target: main_target
+
+#-----------------------------------------------------------------------------#
+
+# Specify the locations for installing things.
+# These directories can all be modified independantly.
+# In particular, you might want to find a better place for the DVI and
+# HTML files.
+
+# FINAL_INSTALL_PREFIX describes the directory that the installation
+# will finally end up in.  When building the Mercury compiler, it
+# should only be set by the configure script.  Other
+# FINAL_INSTALL_* variables have a similar meaning.
+#
+# If you want to install to a different directory temporarily (e.g.
+# to build a package, or if you don't have the permissions to install
+# to a final directory), override INSTALL_PREFIX on the command-line.
+# If you have previously configured to the directory you want to
+# finally install to, you will then be able to move the files safely,
+# since any hard-coded paths will be set to their final destination
+# already (note that the installation in the temporary directory may
+# not work until moved into its final destination).
+# e.g.
+#      configure --prefix /usr
+#      make INSTALL_PREFIX=/some/temporary/directory/usr
+
+# If you don't intend to install to a temporary directory, rather than
+# overriding INSTALL_PREFIX you should reconfigure using the configure
+# script, since there are some hardcoded paths created by the configure
+# script (e.g. in the shell scripts mmc, ml, mmake, etc) that will not
+# be updated simply by overriding INSTALL_PREFIX.
+
+INSTALL_PREFIX		= @prefix@
+FINAL_INSTALL_PREFIX	= @prefix@
+INSTALL_BINDIR		= $(INSTALL_PREFIX)/bin
+INSTALL_LIBDIR		= $(INSTALL_PREFIX)/lib/mercury
+FINAL_INSTALL_LIBDIR	= $(FINAL_INSTALL_PREFIX)/lib/mercury
+INSTALL_INFO_DIR	= $(INSTALL_PREFIX)/info
+INSTALL_DVI_DIR		= $(INSTALL_PREFIX)/lib/mercury/doc
+INSTALL_TEXT_DIR	= $(INSTALL_PREFIX)/lib/mercury/doc
+INSTALL_PS_DIR		= $(INSTALL_PREFIX)/lib/mercury/doc
+INSTALL_MAN_DIR		= $(INSTALL_PREFIX)/man
+INSTALL_HTML_DIR	= $(INSTALL_PREFIX)/lib/mercury/html
+INSTALL_MDB_DOC_DIR	= $(INSTALL_PREFIX)/lib/mercury/mdb
+INSTALL_ELISP_DIR	= $(INSTALL_PREFIX)/lib/mercury/elisp
+
+# You should not need to override anything below here
+
+INSTALL_MODULE_DIR	= $(INSTALL_LIBDIR)/modules
+INSTALL_INT_DIR		= $(INSTALL_LIBDIR)/ints
+INSTALL_INC_DIR		= $(INSTALL_LIBDIR)/inc
+INSTALL_MMAKE_DIR	= $(INSTALL_LIBDIR)/mmake
+FULLARCH		= @FULLARCH@
+INSTALL_MERC_BIN_DIR	= $(INSTALL_LIBDIR)/bin/$(FULLARCH)
+INSTALL_MERC_GRADELESS_LIB_DIR = $(INSTALL_LIBDIR)/lib/$(FULLARCH)
+FINAL_INSTALL_MERC_GRADELESS_LIB_DIR = $(FINAL_INSTALL_LIBDIR)/lib/$(FULLARCH)
+INSTALL_MERC_LIB_DIR	= $(INSTALL_LIBDIR)/lib/$(GRADESTRING)/$(FULLARCH)
+FINAL_INSTALL_MERC_LIB_DIR = \
+		$(FINAL_INSTALL_LIBDIR)/lib/$(GRADESTRING)/$(FULLARCH)
+
+#-----------------------------------------------------------------------------#
+
+# Specify the additional compilation models to install by default
+LIBGRADES		= @LIBGRADES@
 
 #-----------------------------------------------------------------------------#
Index: scripts/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmakefile,v
retrieving revision 1.17
diff -u -r1.17 Mmakefile
--- Mmakefile	1999/09/16 04:46:29	1.17
+++ Mmakefile	1999/10/03 12:54:44
@@ -16,7 +16,7 @@
 
 SCRIPTS = mmake mmc mdb c2init mgnuc ml mprof mprof_merge_runs \
 	  sicstus_conv mtags vpath_find mercury_update_interface \
-	  mkfifo_using_mknod
+	  mkfifo_using_mknod cleanup_install
 DEBUGGER_SCRIPTS = mdbrc
 EMACS_SCRIPTS = gud.el
 
cvs server: scripts/cleanup_install is a new entry, no comparison available
cvs server: Diffing tools
cvs server: Diffing trace
cvs server: Diffing trial
cvs server: Diffing util

--------------------------------------------------------------------------
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