git: customcc: Improve wrapper script efficiency and capabilities
John Marino
marino at crater.dragonflybsd.org
Tue Oct 21 08:43:45 PDT 2014
commit 571f588a5c6622ead0ed757b2884a76bb45bdb56
Author: John Marino <draco at marino.st>
Date: Tue Oct 21 15:11:34 2014 +0200
customcc: Improve wrapper script efficiency and capabilities
The wrapper script had some deficies, such as:
* awk called every invocation
* cc and gcc treated the same
* c++ and g++ treated the same
* evals for variables not used
* every invocation of c++ or g++ called cc -dumpmachine
* g++ hardcoded to dports include scheme
* no support for "CC" or "gcov" (both defined by base compilers)
The update addresses these by:
* awk eliminated by pushing INCOPT definition to defaults/compilers.conf
* cc -dumpmachine eliminated during creation of defaults/compilers.conf
It was only used for dports gcc, so with the assumption that the dports
compiler matches the uname information (a decent assumption), this
was predefined, yet overridable by /etc/compilers.conf
* cc is treated separately from gcc
* CC and c++ are treated the same but separately from g++
* by wrapper default, gcc and g++ refer to base gcc4.7, but the default
compilers.conf sets them to the same as the specified dports gcc
* Support for clang, clang++, clang-cpp, CC, and gcov was added
* Support for base clang, clang++, and clang-cpp was added in
anticipation of bringing clang into base.
* variables are only evaluated if used.
* supports the ability to have gcc, g++, clang, clang++ point to base
compilers while cc, c++, CC point to custom compiler. However, the
custom compiler can also point to any combination of cc, gcc, c++, and
g++ and that's controllable by compilers.conf.
The /etc/defaults/compilers.conf file was augmented and support for
clang35 from dports added. man 5 compilers.conf was edited accordingly
with placeholders for <version>_CLANG, <version>_CLANGCXX and
<version>_CLANGCPP which aren't applicable until clang comes into base.
Summary of changes:
etc/defaults/compilers.conf | 73 +++++++++++++++++++
libexec/customcc/Makefile | 15 +++-
libexec/customcc/cc.sh | 152 +++++++++++++++++++++++++++++++---------
share/man/man5/compilers.conf.5 | 88 ++++++++++++++++-------
4 files changed, 265 insertions(+), 63 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/571f588a5c6622ead0ed757b2884a76bb45bdb56
--
DragonFly BSD source repository
More information about the Commits
mailing list