summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2010-05-03 18:34:02 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2010-05-03 18:34:02 +0000
commit36ee86173e1bd1cf3aa17f76b7401be27a5705ea (patch)
tree75fa9c4278c5bd71ce1b3dbc5cadd37e9302ec44
parent72a6f023642c24ed068b6564472df9d7ccec30cf (diff)
Support gcc4 with cpp (gcc4 binary to be installed in /usr/libexec/cpp).
ok kettenis@
-rw-r--r--usr.bin/cpp/Makefile12
-rw-r--r--usr.bin/cpp/cpp.sh4
2 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/cpp/Makefile b/usr.bin/cpp/Makefile
index b99cc0482c2..e81a0220fa9 100644
--- a/usr.bin/cpp/Makefile
+++ b/usr.bin/cpp/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.8 2004/02/10 02:02:22 espie Exp $
+# $OpenBSD: Makefile,v 1.9 2010/05/03 18:34:01 drahn Exp $
.include <bsd.own.mk>
@@ -7,12 +7,16 @@ NOMAN=
PROG=cpp
SRCS=
INSTALL_STRIP=
+USE_GCC3?="no"
+USE_GCC4?="no"
cpp: cpp.sh
-.if ${USE_GCC3:L} == "no"
- sed -e 's/@dollaropt@/-$$/' ${.CURDIR}/cpp.sh >$@
+.if ${USE_GCC3:L} == "yes"
+ sed -e 's/@GNUC@/-D__GNUC__/' -e 's/@dollaropt@//' ${.CURDIR}/cpp.sh >$@
+.elif ${USE_GCC4:L} == "yes"
+ sed -e 's/@GNUC@//' -e 's/@dollaropt@//' ${.CURDIR}/cpp.sh >$@
.else
- sed -e 's/@dollaropt@//' ${.CURDIR}/cpp.sh >$@
+ sed -e 's/@GNUC@/-D__GNUC__/' -e 's/@dollaropt@/-$$/' ${.CURDIR}/cpp.sh >$@
.endif
.include <bsd.prog.mk>
diff --git a/usr.bin/cpp/cpp.sh b/usr.bin/cpp/cpp.sh
index baf0989f021..ca5ffea78db 100644
--- a/usr.bin/cpp/cpp.sh
+++ b/usr.bin/cpp/cpp.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: cpp.sh,v 1.7 2004/02/10 02:02:22 espie Exp $
+# $OpenBSD: cpp.sh,v 1.8 2010/05/03 18:34:01 drahn Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
@@ -41,7 +41,7 @@
#
PATH=/usr/bin:/bin
TRAD=-traditional
-DGNUC="-D__GNUC__"
+DGNUC="@GNUC@"
STDINC="-I/usr/include"
DOLLAR="@dollaropt@"
OPTS=""