[m-dev.] diff: library/Mmakefile: work-around failure of `ln -s'

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Sep 16 18:09:31 AEST 1999


Estimated hours taken: 0.25

library/Mmakefile:
	Change the rule for `mmake install' so that it supports file systems
	or operating systems on which `ln -s' does not work.
	We now try using `ln -s', but if that fails, then we just use `cp'.

Workspace: /d-drive/home/hg/public/test_mercury/test_dirs/hg/mercury
Index: library/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/Mmakefile,v
retrieving revision 1.40
diff -u -r1.40 Mmakefile
--- library/Mmakefile	1999/06/20 09:33:28	1.40
+++ library/Mmakefile	1999/09/16 08:03:39
@@ -262,9 +262,15 @@
 		fi; \
 	done
 	# The following is needed to support the `--use-subdirs' option
-	for dir in ints int2s int3s opts trans_opts; do \
+	# 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; \
+		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
 
 .PHONY: install_init

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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