xref: /csrg-svn/usr.bin/cpp/cpp.sh (revision 47593)
146185Sdonn#!/bin/sh
246185Sdonn#
346185Sdonn# Copyright (c) 1990 The Regents of the University of California.
446185Sdonn# All rights reserved.
546185Sdonn#
646185Sdonn# This code is derived from software contributed to Berkeley by
746185Sdonn# the Systems Programming Group of the University of Utah Computer
846185Sdonn# Science Department.
946185Sdonn#
1046185Sdonn# %sccs.include.redist.sh%
1146185Sdonn#
12*47593Sdonn#	@(#)cpp.sh	6.4 (Berkeley) 03/19/91
1346185Sdonn#
1446185Sdonn# Transitional front end to CCCP to make it behave like (Reiser) CCP:
1546185Sdonn#	specifies -traditional
1646185Sdonn#	doesn't search gcc-include
1746185Sdonn#
18*47593Sdonncpp="eval /usr/libexec/cpp"
1947156SdonnALST="-traditional -D__GNUC__ -$ "
2046185SdonnNSI=no
21*47593SdonnOPTS=""
22*47593SdonnINCS="-nostdinc"
2346185Sdonn
2447575Sdonnfor A
2547575Sdonndo
2646185Sdonn	case $A in
2746185Sdonn	-nostdinc)
2846185Sdonn		NSI=yes
2946185Sdonn		;;
3046185Sdonn	-traditional)
3146185Sdonn		;;
3246185Sdonn	-I*)
3346185Sdonn		INCS="$INCS $A"
3446185Sdonn		;;
3546185Sdonn	-U__GNUC__)
3646185Sdonn		ALST=`echo $ALST | sed -e 's/-D__GNUC__//'`
3746185Sdonn		;;
38*47593Sdonn	-*)
39*47593Sdonn		OPTS="$OPTS '$A'"
40*47593Sdonn		;;
4146185Sdonn	*)
42*47593Sdonn		if [ $NSI = "no" ]
43*47593Sdonn		then
44*47593Sdonn			INCS="$INCS -I/usr/include"
45*47593Sdonn			NSI=skip
46*47593Sdonn		fi
47*47593Sdonn		$cpp $ALST $INCS $LIBS $CSU $OPTS $A || exit $?
4846185Sdonn		;;
4946185Sdonn	esac
5046185Sdonndone
5146185Sdonn
52*47593Sdonnexit 0
53