/usr/bin/fortc is in libxgks-dev 2.6.1+dfsg.2-4+b1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | #!/bin/sh
# fortc - make C source file FORTRAN compatible
# usage: fortc [-L LibDir] [-O OpSys] file
#
# $Id: fortc.src,v 1.1 2000/08/07 23:15:03 emmerson Exp $
#set -x
# Temporary files:
#
tmp1=/tmp/fortc$$_1
tmp2=/tmp/fortc$$_2
# Automatic cleanup on interruption:
#
trap "exit 1" 1 2 3 13 15
trap 'status=$?; rm -f $tmp1 $tmp2; exit $status' 1 2 3 13 15
# Find the default, fortc(1) runtime library directory.
#
libpath=${FORTC_LIBPATH-/build/xgks-Erq8LR/xgks-2.6.1+dfsg.2/src/port/fortc:/usr/lib/fortc}
saveifs="$IFS"; IFS="${IFS}:"
for dir in $libpath; do
test -z "$dir" && dir=.
if test -f $dir/pre1.sed; then
LibDir=$dir
break
fi
done
IFS="$saveifs"
OS=${OS-linux}
for arg 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;;
*) break;;
esac
done
case $# in
1) file=$1;;
*) echo 1>&2 "$0: Usage [-L LibDir] [-O OpSys] file"; exit 1;;
esac
if test ! -f $LibDir/pre1.sed; then
echo 1>&2 "$0: Can't find runtime support files:
use \`-L' option or FORTC_LIBPATH environment variable"
exit 1
fi
case "$OS" in
next-absoft*)
OS=next-absoft;;
next*)
OS=next-absoft;;
unicos*)
echo '#include "/usr//include/fortran.h"';
OS=unicos;;
vms*)
echo "#include descrip";
OS=vms;;
*) OS=`echo $OS | sed 's/_.*//'`;;
esac
case "$OS" in
domainos|ultrix) sedcmd=d;;
*) sedcmd='s//\1 "'$file'"/';;
esac
if [ ! -f $LibDir/$OS.m4 ]; then
os=`echo $OS | sed 's/[0-9]*$//'` # try removing version numbers
if [ -f $LibDir/$os.m4 ]; then
OS=$os
else
echo 1>&2 \
"$0: Couldn't find macro file for operating system: $LibDir/$OS.m4"
exit 1
fi
fi
if sed -f $LibDir/pre1.sed $file > $tmp1 &&
sed -f $LibDir/pre2.sed $tmp1 > $tmp2 &&
m4 $LibDir/$OS.m4 $LibDir/common.m4 $tmp2 > $tmp1 &&
sed -f $LibDir/post.sed $tmp1 > $tmp2 &&
sed '/.*\(#line.*\)M4_FORTC_FILE/'"$sedcmd" $tmp2; then
status=0
fi
# Cleanup:
#
rm -f $tmp1 $tmp2
exit ${status-1}
|