#!/bin/sh

# Called to call a C compiler appropriately.  See comments for
# GCT_NEW_PASSTHROUGH spec (gcc.c) for why this file exists.
# It's a kludge.
#
# The first argument is -o.  Ignore it.
# The second argument is the output .o file.  Ignore it.
# The third argument is the C compiler to call.
# The remaining arguments are passed to the compiler.
# If -o is really needed, it is included here.

if [ "$1" != "-o" ]
then
  echo "GCT program error (passcc):  -o not passed."
  exit 1
fi
shift

# Unused second argument.
shift

COMPILER=$1
shift

if [ "$COMPILER" = "" ]
then
  echo "GCT program error:  passcc called with too few arguments."
  exit 1
fi


$COMPILER "$@"
exit
