2 # Compile GNU Chill programs.
3 : ||
exec /bin
/sh
-f $0 $argv:q
5 # The compiler name might be different when doing cross-compilation
6 # (this should be configured)
11 gnuchill_script_flags
=
12 gnuchill_version
=unknown
15 # replace the command name by the name of the new command
16 progname
=`basename $0`
19 gcc
=`echo $0 | sed -e "s;/[^/]*$;;"`/$gcc_name
26 # $first is yes for first arg, no afterwards.
28 # If next arg is the argument of an option, $quote is non-empty.
29 # More precisely, it is the option that wants an argument.
31 # $library is made empty to disable use of libchill.
40 # Need some 1st arg to `set' which does not begin with `-'.
41 # We get rid of it after the loop ends.
45 # If you have to ask what this does, you should not edit this file. :-)
46 # The ``S'' at the start is so that echo -nostdinc does not eat the
48 arg
=`echo "S$arg" | sed "s/^S//; s/'/'\\\\\\\\''/g"`
56 # Inhibit linking with -lchill.
62 gcc
=`echo $arg | sed -e "s/^-B//"`$gcc_name
64 -[bBVDUoeTuIYmLiA
] |
-Tdata |
-Xlinker)
65 # these switches take following word as argument,
66 # so don't treat it as a file name.
70 # Don't specify libraries if we won't link,
71 # since that would cause a warning.
81 if [ $numargs = 1 ] ; then
86 echo "GNUCHILL version $gnuchill_version"
88 -fgrant-only |
-fchill-grant-only)
89 #inhibit production of an object file
90 extraflags
="-S -o /dev/null"
96 # Pass other options through; they don't need -x and aren't inputs.
99 # If file ends in .i, put options around it.
100 # But not if a specified -x option is currently active.
101 case "$speclang $arg" in -xnone\
*.
[i
])
102 set "$@" -xchill "'$arg'" -xnone
111 # Get rid of that initial 1st arg
112 if [ $first = no
]; then
115 echo "$0: No input files specified."
121 echo "$0: argument to \`$quote' missing"
125 # The '-ansi' flag prevents cpp from changing this:
126 # NEWMODE x = SET (sun, mon, thu, wed, thu, fri, sat);
128 # NEWMODE x = SET (1, mon, thu, wed, thu, fri, sat);
129 #which is a CHILL syntax error.
130 eval $whatgcc -ansi $gnuchill_script_flags $startfile "$@" $libpath $library $extraflags