view flibs.sh @ 100:197bd6c63baa

[project @ 1993-09-13 03:06:15 by jwe] (syl): Use complex_matrix_value(), not ComplexMatrixLoad().
author jwe
date Mon, 13 Sep 1993 03:06:15 +0000
parents 9c27e323492f
children 9465b39f764a
line wrap: on
line source

#!/bin/sh
#
# flibs -- try to get the Fortran compiler to tell us what libraries
# it expects to link to, and echo the result to the standard output.
#
# John W. Eaton
# jwe@che.utexas.edu
# Department of Chemical Engineering
# The University of Texas at Austin

trap 'rm -f conftest* core; exit 1' 1 3 15

# Write a minimal program and compile it with -v.  I don't know what
# to do if your compiler doesn't have -v...

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

foutput=`${F77-f77} -v -o conftest conftest.f 2>&1 | sed 's/,/ /g'`

flibs=
lflags=
want_arg=

for arg in $foutput
do
  if test x$want_arg = x
  then
    want_arg=
    case $arg in
      -[lL]*)
        exists=false
        for f in $lflags
        do
          if test x$arg = x$f
          then
            exists=true
          fi
        done
	if $exists || test x$arg = x-lm -o x$arg = x-lc
	then
	  arg=
        else
          lflags="$lflags $arg"
	fi
      ;;
      -u)
        want_arg=$arg
      ;;
      *)
        arg=
      ;;
    esac
  else
    want_arg=
  fi
  if test x$arg != x
  then
    flibs="$flibs $arg"
  fi
done

echo "$flibs"

rm -f conftest* core

# Bye-bye.

exit 0