xref: /csrg-svn/usr.bin/cpp/cpp.sh (revision 47575)
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.3 (Berkeley) 03/19/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
25do
26	case $A in
27	-nostdinc)
28		NSI=yes
29		;;
30	-traditional)
31		;;
32	-I*)
33		INCS="$INCS $A"
34		;;
35	-U__GNUC__)
36		ALST=`echo $ALST | sed -e 's/-D__GNUC__//'`
37		;;
38	*)
39		ARGS="$ARGS '$A'"
40		;;
41	esac
42done
43
44INCS="-nostdinc $INCS"
45if [ $NSI = "no" ]
46then
47	INCS="$INCS -I/usr/include"
48fi
49$cpp $ALST $INCS $LIBS $CSU $ARGS $GLIB $CLIB
50exit $?
51