xref: /original-bsd/usr.bin/cpp/cpp.sh (revision 6da71724)
18b4d2f25Sdonn#!/bin/sh
28b4d2f25Sdonn#
38b4d2f25Sdonn# Copyright (c) 1990 The Regents of the University of California.
48b4d2f25Sdonn# All rights reserved.
58b4d2f25Sdonn#
68b4d2f25Sdonn# This code is derived from software contributed to Berkeley by
78b4d2f25Sdonn# the Systems Programming Group of the University of Utah Computer
88b4d2f25Sdonn# Science Department.
98b4d2f25Sdonn#
108b4d2f25Sdonn# %sccs.include.redist.sh%
118b4d2f25Sdonn#
12*6da71724Sdonn#	@(#)cpp.sh	6.4 (Berkeley) 03/19/91
138b4d2f25Sdonn#
148b4d2f25Sdonn# Transitional front end to CCCP to make it behave like (Reiser) CCP:
158b4d2f25Sdonn#	specifies -traditional
168b4d2f25Sdonn#	doesn't search gcc-include
178b4d2f25Sdonn#
18*6da71724Sdonncpp="eval /usr/libexec/cpp"
194a367439SdonnALST="-traditional -D__GNUC__ -$ "
208b4d2f25SdonnNSI=no
21*6da71724SdonnOPTS=""
22*6da71724SdonnINCS="-nostdinc"
238b4d2f25Sdonn
24d64b0929Sdonnfor A
25d64b0929Sdonndo
268b4d2f25Sdonn	case $A in
278b4d2f25Sdonn	-nostdinc)
288b4d2f25Sdonn		NSI=yes
298b4d2f25Sdonn		;;
308b4d2f25Sdonn	-traditional)
318b4d2f25Sdonn		;;
328b4d2f25Sdonn	-I*)
338b4d2f25Sdonn		INCS="$INCS $A"
348b4d2f25Sdonn		;;
358b4d2f25Sdonn	-U__GNUC__)
368b4d2f25Sdonn		ALST=`echo $ALST | sed -e 's/-D__GNUC__//'`
378b4d2f25Sdonn		;;
38*6da71724Sdonn	-*)
39*6da71724Sdonn		OPTS="$OPTS '$A'"
40*6da71724Sdonn		;;
418b4d2f25Sdonn	*)
42*6da71724Sdonn		if [ $NSI = "no" ]
43*6da71724Sdonn		then
44*6da71724Sdonn			INCS="$INCS -I/usr/include"
45*6da71724Sdonn			NSI=skip
46*6da71724Sdonn		fi
47*6da71724Sdonn		$cpp $ALST $INCS $LIBS $CSU $OPTS $A || exit $?
488b4d2f25Sdonn		;;
498b4d2f25Sdonn	esac
508b4d2f25Sdonndone
518b4d2f25Sdonn
52*6da71724Sdonnexit 0
53