Questions on using configure

David Holmes david.holmes at oracle.com
Thu Oct 20 04:03:06 PDT 2011


Hi Magnus,

On 20/10/2011 7:30 PM, Magnus Ihse Bursie wrote:
> I'll try to answer from the best of my knowledge.

Thanks :)

> On 2011-10-18 08:38, David Holmes wrote:
>> 1. ./configure created a build/linux-i586-clientANDserver-release
>> directory for its output. How do I manually define the two components
>> in that path? (I couldn't see any configure args that appeared to
>> control it)
>
> Do you mean ...
> Or do you mean like "build" and "linux-i586-clientANDserver-release"?
> "build" is the default output directory, and the default configuration
> is named "<host*>-<jvm-variant>-<debug-level>" where host is the
> traditional "os-cpu" for currently supported platforms.

Yes this is what I meant.

> This is just the default. You can do something like:
> build-infra$ mkdir -p my-output/my-build
> build-infra$ cd my-output/my-build/
> build-infra/my-output/my-build$ ../../configure
> build-infra/my-output/my-build$ make
>
> and it will work fine.

So you are saying that if configure doesn't find itself in the current 
directory then it will assume that the current directory is the 
directory to be used for the end build?

>> 2. configure uses that build/linux...-release path as the value to
>> which ALT_OUTPUTDIR is set. Can I control the value of ALT_OUTPUTDIR
>> any other way?
>
> What is it that you want to achieve?
>
> ALT_OUTPUTDIR is used to communicate to the "old" makefiles where the
> output should end up. The idea with configure is that the way this is
> communicated should be hidden from the user. So, basically, no you can't
> change ALT_OUTPUTDIR. But I'm certain there's a good way of achieving
> what you want to achieve anyway. :)

So here is the scenario based on the way I work today. I use a script to 
set various build variables including ALT_OUTPUTDIR. If I'm working on a 
fix I do a build and maybe I'll call it v1 and that will be part of the 
ALT_OUTPUTDIR setting. I then change the fix to v2 and update the script 
so that ALT_OUTPUTDIR points to a v2 directory.

It sounds like with configure my script will have re-run configure in 
the target v1 or v2 directories - is that right?

>> 3. The spec.gmk states that "make install" will create the images and
>> then copy to the installation directory. I would want to create images
>> but I would not want to install them anywhere. How do I do this?
> "make images"

Thanks.

> "make install" is basically "make images" followed by a copying stage. I
> imagine that "make images" is what most JDK developers will use. "make
> install" is more targeted at end users who want to build and install the
> JDK locally on their machine.

Ok. As Andrew Hughes stated it is more normal for install to just do the 
copying part.

>> 4. Cross-compilation seems to be controlled only via the HOST setting
>> but I don't see any details on the format of that setting and how it
>> impacts what configure will do. At present to cross-compile I need to
>> set environment variables that:
>> - set the target arch as CROSS_COMPILE_ARCH
>> - set the path to the cross-compiler as ALT_COMPILER_PATH
>> - set EXTRA_CFLAGS to define the arch specific arguments to the
>> compiler (eg to request soft-float vs hard-float, different
>> instruction set levels etc)
>> How do I do all that with HOST and/or other configure variables?
>
> Unfortunately we have not been able to spend much time on
> cross-compilation yet. :( Would you be interested in helping us getting
> it to work?

Sure. But we might have different expectations of how we think it should 
work. ;-)

>> 5. What env/make variables can still be defined at the actual build
>> time (ie when make is invoked) - for example can I set
>> BUILD_HOTSPOT=false to skip the hotspot build? Put another way, what
>> variables are set at configure time and which can be overridden at
>> build time?
>
> The basic idea is that variables that affect the build are set at
> configure time, and not at make time. It might not have been fully
> implemented yet. I'm not sure about specific variables.

This concerns me. There are literally dozens of variables that affect 
the build that I might want to tweak between builds (ie invocations of 
make, probably with some source code modifications in between). Having 
to re-run configure to do this seems excessive. Further I haven't seen 
how I would tell configure about these variables. My past experience 
with configure based builds is that configure will determine a set of 
values for specific build variables, based on the current system and the 
requested configuration (eg cross-compile or not) and then hardwire them 
in to generated Makefiles. But I would not expect all build variables to 
be handled via configure - for example I might want to adjust the 
optimization level of a compilation of a particular file and so set 
CFLAGS to indicate that.

So I would expect that configure controls one set of well defined 
properties/variables: basic things like arch, debug-level, vm variant, 
compiler path, boot jdk. But that when invoking make you can control the 
other build variables.

Cheers,
David

> /Magnus



More information about the build-infra-dev mailing list