# HG changeset patch # User jwe # Date 782152443 0 # Node ID 39073da2ec568326f636686522c6a2f500b845cb # Parent e14a213685ec6d2bd4a0c266d7dd2fadb427c079 [project @ 1994-10-14 16:34:03 by jwe] diff --git a/flibs.sh b/flibs.sh --- a/flibs.sh +++ b/flibs.sh @@ -15,21 +15,31 @@ echo " END" > conftest.f -# I don't think that stripping commas out of this will ever hurt, and -# we have to do it for the code that follows to understand the output -# from `xlf -v'. +# 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. foutput=`${F77-f77} -v -o conftest conftest.f 2>&1 | sed 's/,/ /g'` flibs= lflags= + +# If want arg is set, we know we want the arg to be added to the list, +# so we don't have to examine it. want_arg= for arg in $foutput do if test x$want_arg = x then - want_arg= case $arg in /*.a) exists=false @@ -66,15 +76,59 @@ -u) want_arg=$arg ;; + -Y) + want_arg=$arg + arg= + ;; *) arg= ;; esac else - want_arg= + 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= + fi fi - if test x$arg != x + + if test "x$arg" = x then + true + else flibs="$flibs $arg" fi done