#!/bin/sh
# $Id: ccgs,v 1.3 2002/04/23 11:58:38 easysw 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
