#!/bin/sh
# $Id: ccgs,v 1.1 2000/03/09 08:40:40 lpd Exp $
# Pre-process ANSI C files with ansi2knr before compiling.
# Usage: ccgs ansi2knr "cc switches..." ...switches... -c inputfile ... -o outputfile

CFILE=""
OFILE=""
CSWITCH=""
A2K=$1
shift
CMD=$1
while [ $# -gt 1 ]
do
	shift
	case "$1" in
	-c) CSWITCH=$1;;
	-o) OFILE=$2; shift;;
	-*) CMD="$CMD $1";;
	*) CFILE="$CFILE $1";;
	esac
done
$A2K $CFILE _temp_$$.c
$CMD $CSWITCH _temp_$$.c -o $OFILE
rm -f _temp_$$.c
