Ability to override compiler from environment

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Mon Jun 23 22:34:15 UTC 2008


David,

Some would say that it is a feature of the current build system that 
random environment variables don't get used :-)  It makes it that much 
harder to get a predictable build.

-- Jon


David Herron wrote:
> I was thinking about this issue of compiling with different gcc's and 
> it seems the normal way to install multiple gcc's is to use suffixes 
> for the version like so:-
>
> gcc-4.1 == gcc v4.1.x
> gcc-3.4 == gcc v3.4.x
> gcc       == gcc v4.2.x
>
> I groped around the OpenJDK makefiles and found
>
> jdk/make/common/shared/Compiler-gcc.gmk
> corba/make/common/shared/Compiler-gcc.gmk
> hotspot/build/linux/makefiles/gcc.make
>
> both contain lines which say
>
> CC=gcc
> CPP=g++
>
> According to the GNU make manual .. 
> http://www.gnu.org/software/make/manual/html_node/Setting.html#Setting 
> .. these values could be overridden with a small change in the makefile
>
> CC?=gcc
> CPP?=g++
>
> And then setting CC or CPP in the environment would make it so the 
> variable is already set and these lines in the makefile would have no 
> effect.
>
>
>
> - David Herron
>
>




More information about the build-dev mailing list