File: fortc

package info (click to toggle)
libhdf4 4.1r4-18.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 24,348 kB
  • ctags: 26,692
  • sloc: ansic: 207,307; fortran: 30,195; sh: 7,789; makefile: 7,470; cpp: 2,186; pascal: 1,407; asm: 1,027; yacc: 680; lex: 202; sed: 153
file content (52 lines) | stat: -rw-r--r-- 967 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
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# fortc - make Fortran-callable C source
# usage: fortc [-L LibDir] [-O OperSys] [file ...]

#set -x

InFiles=
LibDir=/usr/local/ldm/lib

while [ $# -gt 0 ]; do
    case $1 in
    -L)	shift; LibDir=$1; shift;;
    -L*)
	LibDir=`echo $1 | sed 's/-.//'`; shift;;
    -O)	shift; OS=$1; shift;;
    -O*)
	OS=`echo $1 | sed 's/-.//'`; shift;;
    -*)	echo 1>&2 "Option '$1' is unknown"; exit 1;;
    *)	InFiles="$InFiles $1"; shift;;
    esac
done

case "$OS" in
    aix*)
	OS=aix;;
    hpux*)
	OS=hpux;;
    irix*)
	OS=irix;;
    msoft*)
	OS=msoft;;
    next*)
	OS=next;;
    sun*)
	OS=sunos;;
    ultrix*)
	OS=ultrix;;
    unicos*)
	OS=unicos;;
    vms*)
	OS=vms;;
    S370*)
	OS=fujivp;;
    "")	echo 1>&2 \
	    "$0: Operating-system not defined: environmental-variable OS not" \
	    "set or option \"-O<system>\" not specified."
	exit 2;;
esac

sed -f $LibDir/fortc1.sed $InFiles |
    m4 $LibDir/common.m4 $LibDir/$OS.m4 - |
    sed -f $LibDir/fortc2.sed