diff: ml.in bug fix for SunOS 4.x

Fergus Henderson fjh at cs.mu.oz.au
Fri Oct 3 02:22:34 AEST 1997


Fix a bug that broke things on SunOS 4.x.

scripts/ml.in:
	Don't pass -rpath options unless the system supports shared
	libraries.

Index: ml.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/ml.in,v
retrieving revision 1.31
diff -u -u -r1.31 ml.in
--- ml.in	1997/07/27 15:09:35	1.31
+++ ml.in	1997/10/02 16:18:37
@@ -63,6 +63,7 @@
 MKFIFO=${MERCURY_MKFIFO="@MKFIFO@"}
 EXE_RPATH_OPT=${MERCURY_EXE_RPATH_OPT="@EXE_RPATH_OPT@"}
 EXE_RPATH_SEP=${MERCURY_EXE_RPATH_SEP="@EXE_RPATH_SEP@"}
+EXT_FOR_SHARED_LIB=${MERCURY_EXT_FOR_SHARED_LIB="@EXT_FOR_SHARED_LIB@"}
 LINK_SHARED_OBJ=${MERCURY_LINK_SHARED_OBJ="@LINK_SHARED_OBJ@"}
 SHLIB_RPATH_OPT=${MERCURY_SHLIB_RPATH_OPT="@SHLIB_RPATH_OPT@"}
 SHLIB_RPATH_SEP=${MERCURY_SHLIB_RPATH_SEP="@SHLIB_RPATH_SEP@"}
@@ -257,20 +258,25 @@
 esac
 
 RPATH_OPT_LIST=
-prev=""
-for dir in $merc_shlib_dirs $user_shlib_dirs 'kludge for broken shells'; do
-    case "$dir" in
-	'kludge for broken shells')
-	    ;;
-	*)
-	    case "$prev" in
-		"") RPATH_OPT_LIST="$RPATH_OPT$dir" ;;
-		*)  RPATH_OPT_LIST="$RPATH_OPT_LIST$RPATH_SEP$dir" ;;
+# only set RPATH_OPT_LIST if the system supports shared libraries
+case $EXT_FOR_SHARED_LIB in so)
+	prev=""
+	for dir in $merc_shlib_dirs $user_shlib_dirs 'kludge for broken shells'
+	do
+	    case "$dir" in
+		'kludge for broken shells')
+		    ;;
+		*)
+		    case "$prev" in
+			"") RPATH_OPT_LIST="$RPATH_OPT$dir" ;;
+			*)  RPATH_OPT_LIST="$RPATH_OPT_LIST$RPATH_SEP$dir" ;;
+		    esac
+		    ;;
 	    esac
-	    ;;
-    esac
-    prev=$dir
-done
+	    prev=$dir
+	done
+	;;
+esac
 
 # On Irix 5, grades `fast' and `jump' only work in non_shared mode.
 case $FULLARCH in
-- 
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.



More information about the developers mailing list