File: checkf77.sh

package info (click to toggle)
coda 2.21.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,320 kB
  • sloc: ansic: 125,785; javascript: 6,732; java: 2,391; yacc: 1,007; python: 872; makefile: 615; lex: 204; sh: 99; fortran: 60; xml: 5
file content (40 lines) | stat: -rwxr-xr-x 1,042 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

if test -z "$1" ; then
  echo "Usage: checkf77.sh <fortrancompiler>"
  exit
fi
F77=$1

echo "Using compiler :" $F77
echo "Checking which precompiler settings should be provided:"

echo "      SUBROUTINE FOO_1" > foo.f
echo "      END" >> foo.f
$F77 -c foo.f

# Test whether the fortran compiler generates capital are small-caps identifiers
echo -n "  WRAPFORTRAN_USE_UPPERCASE_IDENTIFIERS : "
use_uppercase_identifiers=no
capitalname=`nm foo.o | grep FOO`
if test ! -z "$capitalname" ; then
  echo "yes" 
  use_uppercase_identifiers=yes
fi
echo $use_uppercase_identifiers

# Test whether the fortran compiler adds an additional '_' for identifiers
# that already contain a '_'.
echo -n "  WRAPFORTRAN_USE_ADDITIONAL_UNDERSCORE : "
use_additional_underscore=no
if test $use_uppercase_identifiers = yes ; then
  extraunderscore=`nm foo.o | grep FOO_1__`;
else
  extraunderscore=`nm foo.o | grep foo_1__`;
fi
if test ! -z "$extraunderscore" ; then
  use_additional_underscore=yes
fi
echo $use_additional_underscore

rm -f foo.o foo.f