xref: /original-bsd/usr.bin/cpp/cpp.sh (revision 4cda19ca)
1#!/bin/sh
2#
3# Copyright (c) 1990 The Regents of the University of California.
4# All rights reserved.
5#
6# This code is derived from software contributed to Berkeley by
7# the Systems Programming Group of the University of Utah Computer
8# Science Department.
9#
10# %sccs.include.redist.sh%
11#
12#	@(#)cpp.sh	6.1 (Berkeley) 02/01/91
13#
14# Transitional front end to CCCP to make it behave like (Reiser) CCP:
15#	specifies -traditional
16#	doesn't search gcc-include
17#
18cpp="eval exec /usr/libexec/cpp"
19ALST="-traditional -D__GNUC__"
20NSI=no
21ARGS=""
22INCS=""
23
24for A do
25	case $A in
26	-nostdinc)
27		NSI=yes
28		;;
29	-traditional)
30		;;
31	-I*)
32		INCS="$INCS $A"
33		;;
34	-U__GNUC__)
35		ALST=`echo $ALST | sed -e 's/-D__GNUC__//'`
36		;;
37	*)
38		ARGS="$ARGS '$A'"
39		;;
40	esac
41done
42
43INCS="-nostdinc $INCS"
44if [ $NSI = "no" ]
45then
46	INCS="$INCS -I/usr/include"
47fi
48$cpp $ALST $INCS $LIBS $CSU $ARGS $GLIB $CLIB
49exit $?
50