3 # Copyright (c) 2009-2014
4 # The DragonFly Project. All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # 1. Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in
14 # the documentation and/or other materials provided with the
16 # 3. Neither the name of The DragonFly Project nor the names of its
17 # contributors may be used to endorse or promote products derived
18 # from this software without specific, prior written permission.
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 # COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 # INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 INCPREFIX
=@@INCPREFIX@@
40 .
/etc
/defaults
/compilers.conf
41 [ -f /etc
/compilers.conf
] && .
/etc
/compilers.conf
46 CUSTOM_GCC
=`eval echo \$\{${CCVER}_GCC\}`
47 if [ -n "${CUSTOM_GCC}" ]; then
48 COMPILER
=${CUSTOM_GCC}
49 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
51 COMPILER
=/usr
/libexec
/gcc50
/gcc
56 CUSTOM_GXX
=`eval echo \$\{${CCVER}_GXX\}`
57 if [ -n "${CUSTOM_GXX}" ]; then
58 COMPILER
=${CUSTOM_GXX}
59 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
60 INCOPTCXX
=`eval echo \$\{${CCVER}_INCOPTCXX\}`
62 COMPILER
=/usr
/libexec
/gcc50
/g
++
64 INCOPTCXX
="-isystem /usr/include/c++/4.7"
68 CUSTOM_CLANG
=`eval echo \$\{${CCVER}_CLANG\}`
69 if [ -n "${CUSTOM_CLANG}" ]; then
70 COMPILER
=${CUSTOM_CLANG}
71 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
73 COMPILER
=/usr
/libexec
/clangbase
/clang
78 CUSTOM_CLANGCXX
=`eval echo \$\{${CCVER}_CLANGCXX\}`
79 if [ -n "${CUSTOM_CLANGCXX}" ]; then
80 COMPILER
=${CUSTOM_CLANGCXX}
81 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
82 INCOPTCXX
=`eval echo \$\{${CCVER}_INCOPTCXX\}`
84 COMPILER
=/usr
/libexec
/clangbase
/clang
++
85 INCOPT
=${CLANG_INCOPT}
86 INCOPTCXX
="-isystem /usr/include/c++/4.7"
90 CUSTOM_CC
=`eval echo \$\{${CCVER}_CC\}`
91 if [ -n ${CUSTOM_CC} ]; then
93 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
95 echo "${CCVER}_CC undefined, see compilers.conf(5)"
100 CUSTOM_CXX
=`eval echo \$\{${CCVER}_CXX\}`
101 if [ -n ${CUSTOM_CXX} ]; then
102 COMPILER
=${CUSTOM_CXX}
103 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
104 INCOPTCXX
=`eval echo \$\{${CCVER}_INCOPTCXX\}`
106 echo "${CCVER}_CXX undefined, see compilers.conf(5)"
111 CUSTOM_CPP
=`eval echo \$\{${CCVER}_CPP\}`
112 if [ -n ${CUSTOM_CPP} ]; then
113 COMPILER
=${CUSTOM_CPP}
114 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
116 echo "${CCVER}_CPP undefined, see compilers.conf(5)"
121 CUSTOM_CLANGCPP
=`eval echo \$\{${CCVER}_CLANGCPP\}`
122 if [ -n "${CUSTOM_CLANGCPP}" ]; then
123 COMPILER
=${CUSTOM_CLANGCPP}
124 INCOPT
=`eval echo \$\{${CCVER}_INCOPT\}`
126 COMPILER
=/usr
/libexec
/clangbase
/clang-cpp
127 INCOPT
=${CLANG_INCOPT}
131 CUSTOM_GCOV
=`eval echo \$\{${CCVER}_GCOV\}`
132 if [ -n "${CUSTOM_GCOV}" ]; then
133 exec ${CUSTOM_GCOV} "$@"
135 exec /usr
/libexec
/gcc50
/gcov
"$@"
139 echo "customcc: unrecognized command '${CNAME}'"
146 CUSTOM_CFLAGS
=`eval echo \$\{${CCVER}_CFLAGS\}`
147 exec ${COMPILER} ${INCOPT} ${CUSTOM_CFLAGS} "$@"
150 CUSTOM_CXXFLAGS
=`eval echo \$\{${CCVER}_CXXFLAGS\}`
151 exec ${COMPILER} ${INCOPT} ${INCOPTCXX} ${CUSTOM_CFLAGS} "$@"
154 CUSTOM_CPPFLAGS
=`eval echo \$\{${CCVER}_CPPFLAGS\}`
155 exec ${COMPILER} ${INCOPT} ${CUSTOM_CPPFLAGS} "$@"