summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cc
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2017-07-24 19:22:50 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2017-07-24 19:22:50 +0000
commit84c01f44b24529a797ad127c622911ebbf70c735 (patch)
treee8bdd638efee8599a4d4ca530e90f72f70b48be2 /gnu/usr.bin/cc
parent7c2f6343cedc0aa760d7b15a59a45f26bf5228ce (diff)
install gcc, g++ as gcc and g++ instead of cc, c++ and create links
to the latter on non-clang architectures and make sure we build gcc with itself because clang won't be able to build it ok naddy@
Diffstat (limited to 'gnu/usr.bin/cc')
-rw-r--r--gnu/usr.bin/cc/Makefile.inc7
-rw-r--r--gnu/usr.bin/cc/c++/Makefile13
-rw-r--r--gnu/usr.bin/cc/cc/Makefile11
-rw-r--r--gnu/usr.bin/cc/libobjc/Makefile4
4 files changed, 28 insertions, 7 deletions
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index ba18fb63649..2175463185b 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -1,8 +1,13 @@
# $FreeBSD: src/gnu/usr.bin/cc/Makefile.inc,v 1.66.8.1 2009/04/15 03:14:26 kensmith Exp $
-# $OpenBSD: Makefile.inc,v 1.6 2012/09/16 20:46:35 kettenis Exp $
+# $OpenBSD: Makefile.inc,v 1.7 2017/07/24 19:22:49 robert Exp $
.include "../Makefile.inc"
+.if ${COMPILER_VERSION:L} == "clang"
+CC= gcc
+CXX= g++
+.endif
+
# Sometimes this is .include'd several times...
.if !defined(__CC_MAKEFILE_INC__)
__CC_MAKEFILE_INC__= ${MFILE}
diff --git a/gnu/usr.bin/cc/c++/Makefile b/gnu/usr.bin/cc/c++/Makefile
index 9cc438eefd4..b5a33bafa58 100644
--- a/gnu/usr.bin/cc/c++/Makefile
+++ b/gnu/usr.bin/cc/c++/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD: src/gnu/usr.bin/cc/c++/Makefile,v 1.24.8.1 2009/04/15 03:14:26 kensmith Exp $
-# $OpenBSD: Makefile,v 1.1 2009/10/15 20:50:20 robert Exp $
+# $OpenBSD: Makefile,v 1.2 2017/07/24 19:22:49 robert Exp $
.include <bsd.own.mk>
@@ -10,10 +10,19 @@
PROG= c++
SRCS+= g++spec.c
-LINKS= ${BINDIR}/c++ ${BINDIR}/g++
+
+.if ${COMPILER_VERSION:L} == "gcc4"
+LINKS= ${BINDIR}/g++ ${BINDIR}/c++
+.endif
+
NOMAN= Yes
DPADD= ${LIBCPP} ${LIBIBERTY}
LDADD= ${LIBCPP} ${LIBIBERTY}
+realinstall:
+ ${INSTALL} ${INSTALL_COPY} -S ${INSTALL_STRIP} \
+ -o ${BINOWN} -g ${BINGRP} \
+ -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/${PROG:S/c/g/g}
+
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/cc/cc/Makefile b/gnu/usr.bin/cc/cc/Makefile
index d017212cff7..a4f8590c347 100644
--- a/gnu/usr.bin/cc/cc/Makefile
+++ b/gnu/usr.bin/cc/cc/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD: src/gnu/usr.bin/cc/cc/Makefile,v 1.33.8.1 2009/04/15 03:14:26 kensmith Exp $
-# $OpenBSD: Makefile,v 1.7 2016/11/08 17:39:12 tb Exp $
+# $OpenBSD: Makefile,v 1.8 2017/07/24 19:22:49 robert Exp $
.include <bsd.own.mk>
@@ -12,13 +12,20 @@ SRCS+= gccspec.c
SPECDIR= /usr/lib/gcc-lib/${GCC_TARGET}/${BASEVER}
-LINKS= ${BINDIR}/cc ${BINDIR}/gcc
+.if ${COMPILER_VERSION:L} == "gcc4"
+LINKS= ${BINDIR}/gcc ${BINDIR}/cc
+.endif
beforeinstall:
.for dir in /usr/lib/gcc-lib /usr/lib/gcc-lib/${GCC_TARGET} ${SPECDIR}
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${DIRMODE} ${DESTDIR}${dir}
.endfor
+realinstall:
+ ${INSTALL} ${INSTALL_COPY} -S ${INSTALL_STRIP} \
+ -o ${BINOWN} -g ${BINGRP} \
+ -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/g${PROG}
+
afterinstall:
${.OBJDIR}/cc -dumpspecs > ${DESTDIR}${SPECDIR}/specs
chown ${BINOWN}:${BINGRP} ${DESTDIR}${SPECDIR}/specs
diff --git a/gnu/usr.bin/cc/libobjc/Makefile b/gnu/usr.bin/cc/libobjc/Makefile
index a371648942f..df06dcdecc3 100644
--- a/gnu/usr.bin/cc/libobjc/Makefile
+++ b/gnu/usr.bin/cc/libobjc/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD: src/gnu/lib/libobjc/Makefile,v 1.34.2.1 2009/08/03 08:13:06 kensmith Exp $
-# $OpenBSD: Makefile,v 1.7 2017/07/10 21:30:37 espie Exp $
+# $OpenBSD: Makefile,v 1.8 2017/07/24 19:22:49 robert Exp $
OBJCDIR=${.CURDIR}/../../../gcc/libobjc
GCCDIR= ${.CURDIR}/../../../gcc/gcc
@@ -57,7 +57,7 @@ BUILDFIRST = ${GENHDRS}
.SUFFIXES: .m
# ObjC
-OBJC?= cc
+OBJC?= ${CC}
OBJCFLAGS?= ${CFLAGS} ${CPPFLAGS} -Wno-import
COMPILE.m?= ${OBJC} ${OBJCFLAGS} -c
LINK.m?= ${OBJC} ${OBJCFLAGS} ${LDFLAGS}