diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-08-27 20:51:39 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-08-27 20:51:39 +0000 |
commit | dd201ca1f8b531e5b83221b21b987dea2e71696b (patch) | |
tree | 3e221460a1bf1a44a2e3a008fead9cd61b440bc6 /gcc/ch/chill.in | |
parent | 43ccffb6fd159b6ec48fdaa7f280a84450c0f2b3 (diff) | |
download | gcc-dd201ca1f8b531e5b83221b21b987dea2e71696b.tar.gz |
�
Migrate from devo/gcc/ch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22038 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ch/chill.in')
-rw-r--r-- | gcc/ch/chill.in | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/gcc/ch/chill.in b/gcc/ch/chill.in new file mode 100644 index 00000000000..62b73d5f961 --- /dev/null +++ b/gcc/ch/chill.in @@ -0,0 +1,130 @@ +#!/bin/sh +# Compile GNU Chill programs. +: || exec /bin/sh -f $0 $argv:q + +# The compiler name might be different when doing cross-compilation +# (this should be configured) +gcc_name=gcc +whatgcc=gcc +speclang=-xnone +startfile=chillrt0 +gnuchill_script_flags= +gnuchill_version=unknown +extraflags= + +# replace the command name by the name of the new command +progname=`basename $0` +case "$0" in + */*) + gcc=`echo $0 | sed -e "s;/[^/]*$;;"`/$gcc_name + ;; + *) + gcc=$gcc_name + ;; +esac + +# $first is yes for first arg, no afterwards. +first=yes +# If next arg is the argument of an option, $quote is non-empty. +# More precisely, it is the option that wants an argument. +quote= +# $library is made empty to disable use of libchill. +library="-lchill" +libpath=chillrt +numargs=$# + +for arg +do + if [ $first = yes ] + then + # Need some 1st arg to `set' which does not begin with `-'. + # We get rid of it after the loop ends. + set gcc + first=no + fi + # If you have to ask what this does, you should not edit this file. :-) + # The ``S'' at the start is so that echo -nostdinc does not eat the + # -nostdinc. + arg=`echo "S$arg" | sed "s/^S//; s/'/'\\\\\\\\''/g"` + if [ x$quote != x ] + then + quote= + else + quote= + case $arg in + -nostdlib) + # Inhibit linking with -lchill. + library= + libpath= + startfile= + ;; + -B*) + gcc=`echo $arg | sed -e "s/^-B//"`$gcc_name + ;; + -[bBVDUoeTuIYmLiA] | -Tdata | -Xlinker) + # these switches take following word as argument, + # so don't treat it as a file name. + quote=$arg + ;; + -[cSEM] | -MM) + # Don't specify libraries if we won't link, + # since that would cause a warning. + library= + libpath= + startfile= + ;; + -x*) + speclang=$arg + ;; + -v) + # catch `chill -v' + if [ $numargs = 1 ] ; then + library= + libpath= + startfile= + fi + echo "GNUCHILL version $gnuchill_version" + ;; + -fgrant-only | -fchill-grant-only) + #inhibit production of an object file + extraflags="-S -o /dev/null" + library= + libpath= + startfile= + ;; + -*) + # Pass other options through; they don't need -x and aren't inputs. + ;; + *) + # If file ends in .i, put options around it. + # But not if a specified -x option is currently active. + case "$speclang $arg" in -xnone\ *.[i]) + set "$@" -xchill "'$arg'" -xnone + continue + esac + ;; + esac + fi + set "$@" "'$arg'" +done + +# Get rid of that initial 1st arg +if [ $first = no ]; then + shift +else + echo "$0: No input files specified." + exit 1 +fi + +if [ x$quote != x ] +then + echo "$0: argument to \`$quote' missing" + exit 1 +fi + +# The '-ansi' flag prevents cpp from changing this: +# NEWMODE x = SET (sun, mon, thu, wed, thu, fri, sat); +#to this: +# NEWMODE x = SET (1, mon, thu, wed, thu, fri, sat); +#which is a CHILL syntax error. +eval $whatgcc -ansi $gnuchill_script_flags $startfile "$@" $libpath $library $extraflags |