Replace cc, c++ & cpp with symlinks

In case of installation of both clang and GCC, we want to be able to
switch which one is the default by adapting the cc, c++ & cpp symlinks.

The default behaviour implemented here is to prefer clang over gcc if
they are both installed.

Change-Id: Ic14720cd876d2bf934d345a955cb5789378209e6
This commit is contained in:
Lionel Sambuc 2014-01-28 10:48:19 +01:00
parent b811a43401
commit 4359ff87e0
5 changed files with 33 additions and 0 deletions

View file

@ -234,10 +234,12 @@
./usr/bin/bzip2 minix-sys ./usr/bin/bzip2 minix-sys
./usr/bin/bzip2recover minix-sys ./usr/bin/bzip2recover minix-sys
./usr/bin/c++ minix-sys gcccmds ./usr/bin/c++ minix-sys gcccmds
./usr/bin/c++ minix-sys llvm
./usr/bin/cal minix-sys ./usr/bin/cal minix-sys
./usr/bin/calendar minix-sys ./usr/bin/calendar minix-sys
./usr/bin/cawf minix-sys ./usr/bin/cawf minix-sys
./usr/bin/cc minix-sys gcccmds ./usr/bin/cc minix-sys gcccmds
./usr/bin/cc minix-sys llvm
./usr/bin/cc1 minix-sys gcccmds ./usr/bin/cc1 minix-sys gcccmds
./usr/bin/cc1obj minix-sys gcccmds ./usr/bin/cc1obj minix-sys gcccmds
./usr/bin/cc1plus minix-sys gcccmds ./usr/bin/cc1plus minix-sys gcccmds
@ -266,6 +268,7 @@
./usr/bin/compress minix-sys ./usr/bin/compress minix-sys
./usr/bin/cpio minix-sys ./usr/bin/cpio minix-sys
./usr/bin/cpp minix-sys gcccmds ./usr/bin/cpp minix-sys gcccmds
./usr/bin/cpp minix-sys llvm
./usr/bin/cprofalyze minix-sys ./usr/bin/cprofalyze minix-sys
./usr/bin/crc minix-sys ./usr/bin/crc minix-sys
./usr/bin/cron minix-sys ./usr/bin/cron minix-sys

View file

@ -6,6 +6,12 @@ NOMAN= yes
.if !defined(HOSTPROG) .if !defined(HOSTPROG)
SYMLINKS+= clang ${BINDIR}/clang++ SYMLINKS+= clang ${BINDIR}/clang++
SYMLINKS+= clang ${BINDIR}/clang-cpp SYMLINKS+= clang ${BINDIR}/clang-cpp
# if defined(__MINIX)
SYMLINKS+= clang ${BINDIR}/cc
SYMLINKS+= clang ${BINDIR}/c++
SYMLINKS+= clang ${BINDIR}/cpp
# endif # defined(__MINIX)
.endif .endif
.include <bsd.init.mk> .include <bsd.init.mk>

View file

@ -3,7 +3,13 @@
# For ../Makefile.inc and bsd.own.mk # For ../Makefile.inc and bsd.own.mk
.include <bsd.init.mk> .include <bsd.init.mk>
.if defined(__MINIX)
# In case of installation of both clang and GCC, we want to be able to
# switch which one is the default by adapting the cc, c++ & cpp symlinks
PROG= gcpp
.else
PROG= cpp PROG= cpp
.endif # defined(__MINIX)
SRCS= gcc.c cppspec.c prefix.c version.c SRCS= gcc.c cppspec.c prefix.c version.c
# XXX # XXX
@ -26,7 +32,13 @@ CPPFLAGS.gcc.c+= -I${GCCARCH} -I${BACKENDOBJ} -I. \
-DDEFAULT_TARGET_MACHINE=\"${MACHINE_GNU_PLATFORM}\" \ -DDEFAULT_TARGET_MACHINE=\"${MACHINE_GNU_PLATFORM}\" \
-DCONFIGURE_SPECS="\"\"" -DCONFIGURE_SPECS="\"\""
.if defined(__MINIX)
.if ${HAVE_LLVM:Uno} == "no"
SYMLINKS= gcpp ${BINDIR}/cpp
.endif # ${HAVE_LLVM:Uno} == "no"
.else
LINKS= ${BINDIR}/cpp ${BINDIR}/gcpp LINKS= ${BINDIR}/cpp ${BINDIR}/gcpp
.endif # defined(__MINIX)
TEXINFO= cpp.texi TEXINFO= cpp.texi
INFOFLAGS= -I${DIST}/gcc/doc -I${DIST}/gcc/doc/include -I. INFOFLAGS= -I${DIST}/gcc/doc -I${DIST}/gcc/doc/include -I.

View file

@ -10,7 +10,13 @@ NOMAN= # defined
CPPFLAGS+= -I${BACKENDOBJ} CPPFLAGS+= -I${BACKENDOBJ}
.if defined(__MINIX)
.if ${HAVE_LLVM:Uno} == "no"
SYMLINKS+= g++ ${BINDIR}/c++
.endif # ${HAVE_LLVM:Uno} == "no"
.else
LINKS+= ${BINDIR}/g++ ${BINDIR}/c++ LINKS+= ${BINDIR}/g++ ${BINDIR}/c++
.endif # defined(__MINIX)
.include "../Makefile.frontend" .include "../Makefile.frontend"

View file

@ -7,7 +7,13 @@ SRCS= gccspec.c
CPPFLAGS+= -I${BACKENDOBJ} CPPFLAGS+= -I${BACKENDOBJ}
.if defined(__MINIX)
.if ${HAVE_LLVM:Uno} == "no"
SYMLINKS+= gcc ${BINDIR}/cc
.endif # ${HAVE_LLVM:Uno} == "no"
.else
LINKS+= ${BINDIR}/gcc ${BINDIR}/cc LINKS+= ${BINDIR}/gcc ${BINDIR}/cc
.endif # defined(__MINIX)
MAN= gcc.1 MAN= gcc.1
MLINKS= gcc.1 cc.1 gcc.1 g++.1 gcc.1 c++.1 MLINKS= gcc.1 cc.1 gcc.1 g++.1 gcc.1 c++.1