[m-dev.] For review: "Absolutify" relative paths for shared libraries

Warwick Harvey wharvey at cs.monash.edu.au
Wed Jun 30 12:00:37 AEST 1999


Estimated hours taken: 1

scripts/ml.in:
	If a shared library directory given to `ml' is relative, turn it
	into an absolute path by prepending the current directory.  Also
	add an option `--leave-shared-lib-dirs-relative' to `ml' which
	turns off this behaviour, in case the user does actually want a
	relative path.


Index: ml.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.63
diff -u -r1.63 ml.in
--- ml.in	1999/06/21 07:45:52	1.63
+++ ml.in	1999/06/30 01:54:05
@@ -63,6 +63,9 @@
 	-R <directory>, --shared-lib-dir <directory>
 		Include <directory> in the list of directories that the
 		dynamic linker will use to search for shared libraries.
+	--leave-shared-lib-dirs-relative
+		Don't convert relative shared library directory names
+		into absolute paths.
 
 Debugging options:
 	-t, --trace
@@ -151,6 +154,7 @@
 demangle=true
 MAYBE_STATIC_OPT=""
 make_shared_lib=false
+leave_shlib_dirs_relative=false
 user_shlib_dirs=""
 
 # include the file `init_grade_options.sh-subr'
@@ -246,13 +250,24 @@
 	-L*)
 		user_libdir_opts="$user_libdir_opts $1"
 		;;
+	--leave-shared-lib-dirs-relative)
+		leave_shlib_dirs_relative=true
+		;;
 	-R|--shared-lib-dir)
 		dir="$2"
+		case $leave_shlib_dirs_relative in false)
+			dir="`expr $dir : '\(/.*\)' '|' $PWD/$dir`"
+			;;
+		esac
 		user_shlib_dirs="$user_shlib_dirs $dir"
 		shift
 		;;
 	-R*)
 		dir="` expr $1 : '-R\(.*\)' `"
+		case $leave_shlib_dirs_relative in false)
+			dir="`expr $dir : '\(/.*\)' '|' $PWD/$dir`"
+			;;
+		esac
 		user_shlib_dirs="$user_shlib_dirs $dir"
 		;;
 


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