libexec/customcc: Set up the include paths a bit better.
authorSascha Wildner <saw@online.de>
Tue, 6 Oct 2009 20:38:40 +0000 (22:38 +0200)
committerSascha Wildner <saw@online.de>
Tue, 6 Oct 2009 20:38:40 +0000 (22:38 +0200)
Only use /usr/include and /usr/libdata/gcc41 prefixed by
${USRDATA_PREFIX}. This requires r83302 of LLVM/clang or
higher for the -nostdclanginc option.

While here, remove an 'else' I put in for debugging purposes
which is now useless.

libexec/customcc/Makefile
libexec/customcc/cc.sh

index ff2094a..2c0720a 100644 (file)
@@ -8,6 +8,6 @@ CLEANFILES=     cc
 NOMAN=
 
 ${.OBJDIR}/cc: cc.sh
-       sed "s#@@PREFIX2@@#${USRDATA_PREFIX}/usr#g" $> > $@
+       sed "s#@@INCPREFIX@@#${USRDATA_PREFIX}#g" $> > $@
 
 .include <bsd.prog.mk>
index d0e4127..178dc75 100644 (file)
@@ -17,8 +17,7 @@ if [ "${CCVER}" = "clang" ]; then
                export beenhere=1
                oldargs="$@"
                export oldargs
-               INCOPT="-isystem @@PREFIX2@@/include \
-                       -isystem @@PREFIX2@@/libdata/gcc41"
+               INCOPT="-isysroot @@INCPREFIX@@ -nostdclanginc"
        elif [ "${CNAME}" = "cc" -o "${CNAME}" = "gcc" ]; then
                exec ${CDIR}/../gcc41/cc $oldargs
        fi
@@ -43,7 +42,4 @@ elif [ "${CNAME}" = "c++" -o "${CNAME}" = "g++" ]; then
        exec ${CUSTOM_CXX} ${INCOPT} ${CUSTOM_CXXFLAGS} "$@"
 elif [ "${CNAME}" = "cpp" ]; then
        exec ${CUSTOM_CPP} ${INCOPT} ${CUSTOM_CPPFLAGS} "$@"
-else
-       echo "unknown compiler ${CNAME}"
-       exit 1
 fi