comparison flibs.sh @ 5:9c27e323492f

[project @ 1993-08-08 01:29:13 by jwe] Initial revision
author jwe
date Sun, 08 Aug 1993 01:32:33 +0000
parents
children 9465b39f764a
comparison
equal deleted inserted replaced
4:b4df021f796c 5:9c27e323492f
1 #!/bin/sh
2 #
3 # flibs -- try to get the Fortran compiler to tell us what libraries
4 # it expects to link to, and echo the result to the standard output.
5 #
6 # John W. Eaton
7 # jwe@che.utexas.edu
8 # Department of Chemical Engineering
9 # The University of Texas at Austin
10
11 trap 'rm -f conftest* core; exit 1' 1 3 15
12
13 # Write a minimal program and compile it with -v. I don't know what
14 # to do if your compiler doesn't have -v...
15
16 echo " END" > conftest.f
17
18 # I don't think that stripping commas out of this will ever hurt, and
19 # we have to do it for the code that follows to understand the output
20 # from `xlf -v'.
21
22 foutput=`${F77-f77} -v -o conftest conftest.f 2>&1 | sed 's/,/ /g'`
23
24 flibs=
25 lflags=
26 want_arg=
27
28 for arg in $foutput
29 do
30 if test x$want_arg = x
31 then
32 want_arg=
33 case $arg in
34 -[lL]*)
35 exists=false
36 for f in $lflags
37 do
38 if test x$arg = x$f
39 then
40 exists=true
41 fi
42 done
43 if $exists || test x$arg = x-lm -o x$arg = x-lc
44 then
45 arg=
46 else
47 lflags="$lflags $arg"
48 fi
49 ;;
50 -u)
51 want_arg=$arg
52 ;;
53 *)
54 arg=
55 ;;
56 esac
57 else
58 want_arg=
59 fi
60 if test x$arg != x
61 then
62 flibs="$flibs $arg"
63 fi
64 done
65
66 echo "$flibs"
67
68 rm -f conftest* core
69
70 # Bye-bye.
71
72 exit 0