]> Zhao Yanbai Git Server - minix.git/commitdiff
Replace cc, c++ & cpp with symlinks
authorLionel Sambuc <lionel@minix3.org>
Tue, 28 Jan 2014 09:48:19 +0000 (10:48 +0100)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:06:02 +0000 (17:06 +0200)
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

distrib/sets/lists/minix/mi
external/bsd/llvm/bin/clang/Makefile
external/gpl3/gcc/usr.bin/cpp/Makefile
external/gpl3/gcc/usr.bin/g++/Makefile
external/gpl3/gcc/usr.bin/gcc/Makefile

index 470c2bee9cd8309b466bad4405b068ffb45f1570..cab97b8734326e7c34a6e9aaa2b1c3151a897a92 100644 (file)
 ./usr/bin/bzip2                                minix-sys
 ./usr/bin/bzip2recover                 minix-sys
 ./usr/bin/c++                          minix-sys       gcccmds
+./usr/bin/c++                          minix-sys       llvm
 ./usr/bin/cal                          minix-sys
 ./usr/bin/calendar                     minix-sys
 ./usr/bin/cawf                         minix-sys
 ./usr/bin/cc                           minix-sys       gcccmds
+./usr/bin/cc                           minix-sys       llvm
 ./usr/bin/cc1                          minix-sys       gcccmds
 ./usr/bin/cc1obj                       minix-sys       gcccmds
 ./usr/bin/cc1plus                      minix-sys       gcccmds
 ./usr/bin/compress                     minix-sys
 ./usr/bin/cpio                         minix-sys
 ./usr/bin/cpp                          minix-sys       gcccmds
+./usr/bin/cpp                          minix-sys       llvm
 ./usr/bin/cprofalyze                   minix-sys
 ./usr/bin/crc                          minix-sys
 ./usr/bin/cron                         minix-sys
index 7f9e276a730b30aa1d07e6ecbb7715fcd31048df..f39ad2bf75cd6c0dc17d3d7cdf643373903a952b 100644 (file)
@@ -6,6 +6,12 @@ NOMAN=         yes
 .if !defined(HOSTPROG)
 SYMLINKS+=     clang ${BINDIR}/clang++
 SYMLINKS+=     clang ${BINDIR}/clang-cpp
+
+# if defined(__MINIX)
+SYMLINKS+=     clang ${BINDIR}/cc
+SYMLINKS+=     clang ${BINDIR}/c++
+SYMLINKS+=     clang ${BINDIR}/cpp
+# endif # defined(__MINIX)
 .endif
 
 .include <bsd.init.mk>
index 6e3fd224a0ef2be956cee75c45b3dd7a4da24baa..62016304ecfff49a253c6d9abeb1fef13f66481d 100644 (file)
@@ -3,7 +3,13 @@
 # For ../Makefile.inc and bsd.own.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
+.endif # defined(__MINIX)
 SRCS=          gcc.c cppspec.c prefix.c version.c
 
 # XXX
@@ -26,7 +32,13 @@ CPPFLAGS.gcc.c+=     -I${GCCARCH} -I${BACKENDOBJ} -I. \
                -DDEFAULT_TARGET_MACHINE=\"${MACHINE_GNU_PLATFORM}\" \
                -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
+.endif # defined(__MINIX)
 
 TEXINFO=       cpp.texi
 INFOFLAGS=     -I${DIST}/gcc/doc -I${DIST}/gcc/doc/include -I.
index 8029c7145cc359bc6cc313ed0cb0a6c044441f85..e95ceeeae6ad7c5efa1ba43b6d4e427beeff4b9b 100644 (file)
@@ -10,7 +10,13 @@ NOMAN=               # defined
 
 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++
+.endif # defined(__MINIX)
 
 .include "../Makefile.frontend"
 
index 44bd2c2a51e5cc70aea83580e9635da22f1f0122..5ad4c7e7bd1881fb77444988f1b3abdd1dd42b58 100644 (file)
@@ -7,7 +7,13 @@ SRCS=          gccspec.c
 
 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 
+.endif # defined(__MINIX)
 
 MAN=           gcc.1
 MLINKS=                gcc.1 cc.1 gcc.1 g++.1 gcc.1 c++.1