Ability to override compiler from environment

David Herron David.Herron at Sun.COM
Tue Jun 24 01:32:06 UTC 2008


???  The OpenJDK build process is configured by setting environment 
variables.  I suppose what you mean is build configuration is done by 
setting variables named ALT_XYZZY rather than XYZZY...???

Some would say the value of setting environment variables to configure 
the build is you can change build parameters without modifying any of 
the build files.

- David



Jonathan Gibbons wrote:
> 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