customcc/compilers.conf: Some adjustments and simplifications.
authorSascha Wildner <saw@online.de>
Fri, 12 Oct 2012 08:57:12 +0000 (10:57 +0200)
committerSascha Wildner <saw@online.de>
Fri, 12 Oct 2012 20:01:44 +0000 (22:01 +0200)
* pkgsrc's clang no longer needs special handling for C++ compilation.

* Use gcc44's cpp, gcc41 is gone.

* -dumpversion is now understool by both pkgsrc's and SVN trunk's
  clang, so no special handling needed for that either.

Based on an older patch I did with Juan Francisco a year ago.

Reported-by: Juan Francisco Cantero Hurtado <iam@juanfra.info>
               Joris Giovannangeli <joris@giovannangeli.fr>
Tested-by: Joris Giovannangeli <joris@giovannangeli.fr>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2205>

etc/defaults/compilers.conf
libexec/customcc/cc.sh

index 3630d04..6cf1711 100644 (file)
@@ -4,13 +4,13 @@ clangsvn_CC=/usr/local/bin/clang
 clangsvn_CXX=/usr/local/bin/clang++
 clangsvn_CFLAGS="-fno-color-diagnostics -Qunused-arguments -std=gnu89"
 clangsvn_CXXFLAGS="-fno-color-diagnostics -Qunused-arguments -std=gnu++98"
-clangsvn_VERSION=4.1.2
 
 # clang from pkgsrc
 #
 clang_CC=/usr/pkg/bin/clang
+clang_CXX=/usr/pkg/bin/clang++
 clang_CFLAGS="-fno-color-diagnostics -Qunused-arguments -std=gnu89"
-clang_VERSION=4.1.2
+clang_CXXFLAGS="-fno-color-diagnostics -Qunused-arguments -std=gnu++98"
 
 # gnat-aux (i.e. gcc 4.6) from pkgsrc
 #
index b3a2024..428a042 100644 (file)
 CDIR=$(dirname $0)
 CNAME=$(basename $0)
 
-# XXX clang needs some special handling
-#
-# it is called only for "cc" and "gcc" and even then it could have been
-# run on c++ files
-#
-if [ "${CCVER}" = "clang" ]; then
-       if [ "${CNAME}" = "cpp" ]; then
-               exec ${CDIR}/../gcc41/cpp "$@"
-       elif [ "${CNAME}" = "c++" -o "${CNAME}" = "g++" ]; then
-               exec ${CDIR}/../gcc41/c++ "$@"
-       elif [ -z $beenhere ]; then
-               export beenhere=1
-               oldargs="$@"
-               export oldargs
-               INCOPT="-nobuiltininc -nostdinc \
-                   -isysroot @@INCPREFIX@@ \
-                   -isystem /usr/include \
-                   -isystem /usr/libdata/gcc41 \
-                   -isystem /usr/include/c++/4.1"
-       elif [ "${CNAME}" = "cc" -o "${CNAME}" = "gcc" ]; then
-               exec ${CDIR}/../gcc41/cc $oldargs
-       fi
-elif [ "${CCVER}" = "clangsvn" ]; then
+if [ "${CCVER}" = "clang" -o "${CCVER}" = "clangsvn" ]; then
        if [ "${CNAME}" = "cpp" ]; then
-               exec ${CDIR}/../gcc41/cpp "$@"
+               exec ${CDIR}/../gcc44/cpp "$@"
        else
                INCOPT="-nobuiltininc -nostdinc \
                    -isysroot @@INCPREFIX@@ \
@@ -84,11 +62,8 @@ CUSTOM_CXX=`eval echo \$\{${CCVER}_CXX\}`
 CUSTOM_CXXFLAGS=`eval echo \$\{${CCVER}_CXXFLAGS\}`
 CUSTOM_CPP=`eval echo \$\{${CCVER}_CPP\}`
 CUSTOM_CPPFLAGS=`eval echo \$\{${CCVER}_CPPFLAGS\}`
-CUSTOM_VERSION=`eval echo \$\{${CCVER}_VERSION\}`
 
-if [ "${CUSTOM_VERSION}" != "" -a "$1" = "-dumpversion" ]; then
-       echo ${CUSTOM_VERSION}
-elif [ "${CNAME}" = "cc" -o "${CNAME}" = "gcc" ]; then
+if [ "${CNAME}" = "cc" -o "${CNAME}" = "gcc" ]; then
        exec ${CUSTOM_CC} ${INCOPT} ${CUSTOM_CFLAGS} "$@"
 elif [ "${CNAME}" = "c++" -o "${CNAME}" = "g++" ]; then
        exec ${CUSTOM_CXX} ${INCOPT} ${CUSTOM_CXXFLAGS} "$@"