changeset 823:46b2bf3b526c

[project @ 1994-10-15 15:37:04 by jwe]
author jwe
date Sat, 15 Oct 1994 15:37:04 +0000
parents fefddd86271e
children 45f674300747
files flibs.sh
diffstat 1 files changed, 28 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/flibs.sh	Sat Oct 15 14:45:12 1994 +0000
+++ b/flibs.sh	Sat Oct 15 15:37:04 1994 +0000
@@ -15,19 +15,31 @@
 
 echo "      END" > conftest.f
 
+if test $# -eq 1
+then
+  foutput=`cat $1`
+else
+  foutput=`${F77-f77} -v -o conftest conftest.f 2>&1`
+fi
+
 # The easiest thing to do for xlf output is to replace all the commas
-# with spaces.  That causes problems for the output from f77 on
-# Solaris systems that looks something like
-#
-#  -Y P,colon:separated:path:of:lib:directories
-#
-# and that this sed command transforms to
-#
-#  -Y P colon:separated:path:of:lib:directories
-#
-# This is handled as a somewhat special case below.
+# with spaces.  Try to only do that if the output is really from xlf,
+# since doing that causes problems on other systems.
+
+xlf_p=`echo $foutput | grep xlfentry`
+if test -n "$xlf_p"
+then
+  foutput=`echo $foutput | sed 's/,/ /g'`
+fi
 
-foutput=`${F77-f77} -v -o conftest conftest.f 2>&1 | sed 's/,/ /g'`
+ld_run_path=`echo $foutput | \
+  sed -n -e 's/.*\(LD_RUN_PATH *= *[^ ]*\).*/\1/p' | \
+  sed -e 's/LD_RUN_PATH *= *//'`
+
+if test -n "$ld_run_path"
+then
+  ld_run_path="-Xlinker -R -Xlinker $ld_run_path"
+fi
 
 flibs=
 lflags=
@@ -38,7 +50,7 @@
 
 for arg in $foutput
 do
-  if test x$want_arg = x
+  if test -z "$want_arg"
   then
     case $arg in
       /*.a)
@@ -87,53 +99,18 @@
   else
     if test x$want_arg = x-Y
     then
-      if test x$arg = xP
-      then
-        want_arg=$arg
-      else
-        want_arg=
-      fi
-      arg=
-    else
-      if test x$want_arg = xP
-      then
-	dir_list=`echo $arg | sed 's/^[ \t]*P,//'`
-	arg=
-	save_IFS=$IFS
-	IFS=":"
-	for dir in $dir_list
-	do
-	  exists=false
-	  for f in $lflags
-	  do
-	    if test x$dir = x$f
-	    then
-	      exists=true
-	    fi
-	  done
-	  if $exists || test x$dir = x-lm -o x$dir = x-lc
-	  then
-	    true
-	  else
-	    lflags="$lflags $dir"
-	    arg="$arg -L $dir"
-	  fi
-	done
-	IFS="$save_IFS"
-      fi
-      want_arg=
+      arg="-Xlinker -Y -Xlinker $arg"
     fi
+    want_arg=
   fi
 
-  if test "x$arg" = x
+  if test -n "$arg"
   then
-    true
-  else
     flibs="$flibs $arg"
   fi
 done
 
-echo "$flibs"
+echo "$ld_run_path $flibs"
 
 rm -f conftest* core