configure.ac revision 1808:90f455b5ff5e
150477Speter#
235388Smjacob# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
335388Smjacob# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
435388Smjacob#
548484Smjacob# This code is free software; you can redistribute it and/or modify it
635388Smjacob# under the terms of the GNU General Public License version 2 only, as
735388Smjacob# published by the Free Software Foundation.  Oracle designates this
852347Smjacob# particular file as subject to the "Classpath" exception as provided
935388Smjacob# by Oracle in the LICENSE file that accompanied this code.
1035388Smjacob#
1135388Smjacob# This code is distributed in the hope that it will be useful, but WITHOUT
1235388Smjacob# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1335388Smjacob# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1435388Smjacob# version 2 for more details (a copy is included in the LICENSE file that
1535388Smjacob# accompanied this code).
1635388Smjacob#
1735388Smjacob# You should have received a copy of the GNU General Public License version
1835388Smjacob# 2 along with this work; if not, write to the Free Software Foundation,
1935388Smjacob# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2035388Smjacob#
2135388Smjacob# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2235388Smjacob# or visit www.oracle.com if you need additional information or have any
2335388Smjacob# questions.
2435388Smjacob#
2535388Smjacob
2635388Smjacob###############################################################################
2735388Smjacob#
2835388Smjacob# Includes and boilerplate
2935388Smjacob#
3035388Smjacob###############################################################################
3135388Smjacob
3235388Smjacob
3335388SmjacobAC_PREREQ([2.69])
3435388SmjacobAC_INIT(OpenJDK, jdk9, build-dev@openjdk.java.net,,http://openjdk.java.net)
3535388Smjacob
3635388SmjacobAC_CONFIG_AUX_DIR([$TOPDIR/common/autoconf/build-aux])
3735388Smjacobm4_include([build-aux/pkg.m4])
3844819Smjacob
3935388Smjacob# Include these first...
4053487Smjacobm4_include([basics.m4])
4153487Smjacobm4_include([basics_windows.m4])
4256004Smjacob# ... then the rest
4335388Smjacobm4_include([boot-jdk.m4])
4453487Smjacobm4_include([build-performance.m4])
4535388Smjacobm4_include([flags.m4])
4635388Smjacobm4_include([help.m4])
4753487Smjacobm4_include([jdk-options.m4])
4853487Smjacobm4_include([jdk-version.m4])
4956004Smjacobm4_include([libraries.m4])
5035388Smjacobm4_include([platform.m4])
5153487Smjacobm4_include([source-dirs.m4])
5235388Smjacobm4_include([toolchain.m4])
5342131Smjacobm4_include([toolchain_windows.m4])
5453487Smjacob
5553487SmjacobAC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
5656004SmjacobAC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
5735388SmjacobAC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
5853487SmjacobAC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
5935388Smjacob
6064087Smjacob# This line needs to be here, verbatim, after all includes and the dummy hook
6164087Smjacob# definitions. It is replaced with custom functionality when building
6239235Sgibbs# custom sources.
6335388Smjacob#CUSTOM_AUTOCONF_INCLUDE
6443420Smjacob
6535388Smjacob# Do not change or remove the following line, it is needed for consistency checks:
6635388SmjacobDATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@
6735388Smjacob
6835388Smjacob###############################################################################
6935388Smjacob#
7035388Smjacob# Initialization / Boot-strapping
7135388Smjacob#
7264087Smjacob# The bootstrapping process needs to solve the "chicken or the egg" problem,
7335388Smjacob# thus it jumps back and forth, each time gaining something needed later on.
7464087Smjacob#
7535388Smjacob###############################################################################
7635388Smjacob
7764087Smjacob# If we are requested to print additional help, do that and then exit.
7861772Smjacob# This must be the very first call.
7935388SmjacobHELP_PRINT_ADDITIONAL_HELP_AND_EXIT
8035388Smjacob
8135388Smjacob# Basic initialization that must happen first of all in the normal process.
8235388SmjacobBASIC_INIT
8364087SmjacobBASIC_SETUP_FUNDAMENTAL_TOOLS
8464087Smjacob
8564087Smjacob# Now we can determine OpenJDK build and target platforms. This is required to
8635388Smjacob# have early on.
8744819SmjacobPLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
8844819Smjacob
8944819Smjacob# Continue setting up basic stuff. Most remaining code require fundamental tools.
9035388SmjacobBASIC_SETUP_PATHS
9144819Smjacob
9235388Smjacob# Check if it's a pure open build or if custom sources are to be used.
9349909SmjacobJDKOPT_SETUP_OPEN_OR_CUSTOM
9461772Smjacob
9549909Smjacob# These are needed to be able to create a configuration name (and thus the output directory)
9653487SmjacobJDKOPT_SETUP_JDK_VARIANT
9753487SmjacobJDKOPT_SETUP_JVM_INTERPRETER
9864087SmjacobJDKOPT_SETUP_JVM_VARIANTS
9964087SmjacobJDKOPT_SETUP_DEBUG_LEVEL
10053487Smjacob
10153487Smjacob# With basic setup done, call the custom early hook.
10253487SmjacobCUSTOM_EARLY_HOOK
10353487Smjacob
10453487Smjacob# Check if we have devkits, extra paths or sysroot set.
10553487SmjacobBASIC_SETUP_DEVKIT
10653487Smjacob
10753487Smjacob# To properly create a configuration name, we need to have the OpenJDK target
10853487Smjacob# and options (variants and debug level) parsed.
10953487SmjacobBASIC_SETUP_OUTPUT_DIR
11053487Smjacob
11153487Smjacob# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
11253487SmjacobHELP_SETUP_DEPENDENCY_HELP
11353487Smjacob
11453487Smjacob# Setup tools that requires more complex handling, or that is not needed by the configure script.
11553487SmjacobBASIC_SETUP_COMPLEX_TOOLS
11653487SmjacobBASIC_CHECK_BASH_OPTIONS
11753487Smjacob
11853487Smjacob# Check if pkg-config is available.
11953487SmjacobPKG_PROG_PKG_CONFIG
12053487Smjacob
12153487Smjacob# After basic tools have been setup, we can check build os specific details.
12264087SmjacobPLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
12364087Smjacob
12453487Smjacob###############################################################################
12553487Smjacob#
12653487Smjacob# Determine OpenJDK variants, options and version numbers.
12753487Smjacob#
12853487Smjacob###############################################################################
12953487Smjacob
13053487Smjacob# We need build & target for this.
13164087SmjacobJDKOPT_SETUP_JDK_OPTIONS
13264087SmjacobJDKVER_SETUP_JDK_VERSION_NUMBERS
13364087Smjacob
13464087Smjacob###############################################################################
13564087Smjacob#
13664087Smjacob# Setup BootJDK, used to bootstrap the build.
13764087Smjacob#
13864087Smjacob###############################################################################
13964087Smjacob
14064087SmjacobBOOTJDK_SETUP_BOOT_JDK
14164087Smjacob
14264087Smjacob###############################################################################
14364087Smjacob#
14464087Smjacob# Configure the sources to use. We can add or override individual directories.
14564087Smjacob#
14664087Smjacob###############################################################################
14764087Smjacob
14839235SgibbsSRCDIRS_SETUP_TOPDIRS
14964087SmjacobSRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
15064087SmjacobSRCDIRS_SETUP_OUTPUT_DIRS
15164087Smjacob
15264087Smjacob###############################################################################
15339235Sgibbs#
15439235Sgibbs# Setup the toolchain (compilers etc), i.e. tools used to compile and process
15539235Sgibbs# native code.
15665140Smjacob#
15739235Sgibbs###############################################################################
15852347Smjacob
15965140Smjacob# See if we are doing a complete static build or not
16065140SmjacobJDKOPT_SETUP_STATIC_BUILD
16153487Smjacob
16253487Smjacob# First determine the toolchain type (compiler family)
16364087SmjacobTOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
16464087Smjacob
16564087Smjacob# User supplied flags should be used when configure detects compilers
16653487SmjacobFLAGS_SETUP_USER_SUPPLIED_FLAGS
16735388Smjacob# The sysroot cflags are needed for configure to be able to run the compilers
16846968SmjacobFLAGS_SETUP_SYSROOT_FLAGS
16935388Smjacob
17035388Smjacob# Then detect the actual binaries needed
17135388SmjacobTOOLCHAIN_PRE_DETECTION
17246968SmjacobTOOLCHAIN_DETECT_TOOLCHAIN_CORE
17352347SmjacobTOOLCHAIN_DETECT_TOOLCHAIN_EXTRA
17452347SmjacobTOOLCHAIN_POST_DETECTION
17535388Smjacob
17635388Smjacob# Finally do some processing after the detection phase
17742461SmjacobTOOLCHAIN_SETUP_BUILD_COMPILERS
17843420SmjacobTOOLCHAIN_SETUP_LEGACY
17935388SmjacobTOOLCHAIN_MISC_CHECKS
18045040Smjacob
18165140Smjacob# Setup the JTReg Regression Test Harness.
18235388SmjacobTOOLCHAIN_SETUP_JTREG
18352347Smjacob
18452347SmjacobFLAGS_SETUP_INIT_FLAGS
18552347Smjacob
18635388Smjacob# FIXME: Currently we must test this after toolchain but before flags. Fix!
18752347Smjacob
18852347Smjacob# Now we can test some aspects on the target using configure macros.
18952347SmjacobPLATFORM_SETUP_OPENJDK_TARGET_BITS
19035388SmjacobPLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
19146968Smjacob
19246968Smjacob# Configure flags for the tools
19343420SmjacobFLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS
19443420SmjacobFLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
19545040SmjacobFLAGS_SETUP_COMPILER_FLAGS_FOR_JDK
19645040SmjacobFLAGS_SETUP_COMPILER_FLAGS_MISC
19745040Smjacob
19845040Smjacob# Setup debug symbols (need objcopy from the toolchain for that)
19945040SmjacobJDKOPT_SETUP_DEBUG_SYMBOLS
20045040SmjacobJDKOPT_SETUP_CODE_COVERAGE
20145040Smjacob
20235388Smjacob###############################################################################
20346968Smjacob#
20435388Smjacob# Check dependencies for external and internal libraries.
20535388Smjacob#
20635388Smjacob###############################################################################
20735388Smjacob
20839235Sgibbs# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
20939235SgibbsBASIC_COMPILE_FIXPATH
21039235Sgibbs
21139235SgibbsLIB_DETERMINE_DEPENDENCIES
21239235SgibbsLIB_SETUP_LIBRARIES
21339235Sgibbs
21439235Sgibbs###############################################################################
21539235Sgibbs#
21665140Smjacob# We need to do some final tweaking, when everything else is done.
21765140Smjacob#
21865140Smjacob###############################################################################
21943793Smjacob
22039235SgibbsJDKOPT_SETUP_BUILD_TWEAKS
22135388SmjacobJDKOPT_DETECT_INTREE_EC
22239235Sgibbs
22345040Smjacob###############################################################################
22465140Smjacob#
22565140Smjacob# Configure parts of the build that only affect the build performance,
22665140Smjacob# not the result.
22765140Smjacob#
22852347Smjacob###############################################################################
22952347Smjacob
23052347SmjacobBPERF_SETUP_BUILD_CORES
23152347SmjacobBPERF_SETUP_BUILD_MEMORY
23235388SmjacobBPERF_SETUP_BUILD_JOBS
23335388Smjacob
23435388Smjacob# Setup arguments for the boot jdk (after cores and memory have been setup)
23535388SmjacobBOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
23652347Smjacob
23752347Smjacob# Setup smart javac (after cores and memory have been setup)
23852347SmjacobBPERF_SETUP_SMART_JAVAC
23952347Smjacob
24035388Smjacob# Setup use of icecc if requested
24152347SmjacobBPERF_SETUP_ICECC
24259454Smjacob
24348484Smjacob# Can the C/C++ compiler use precompiled headers?
24448484SmjacobBPERF_SETUP_PRECOMPILED_HEADERS
24548484Smjacob
24648484Smjacob# Setup use of ccache, if available
24759454SmjacobBPERF_SETUP_CCACHE
24848484Smjacob
24939235Sgibbs###############################################################################
25039235Sgibbs#
25152347Smjacob# And now the finish...
25248484Smjacob#
25339235Sgibbs###############################################################################
25452347Smjacob
25552347Smjacob# Check for some common pitfalls
25652347SmjacobBASIC_TEST_USABILITY_ISSUES
25739235Sgibbs
25839235Sgibbs# At the end, call the custom hook. (Dummy macro if no custom sources available)
25948484SmjacobCUSTOM_LATE_HOOK
26048484Smjacob
26135388Smjacob# We're messing a bit with internal autoconf variables to put the config.status
26248484Smjacob# in the output directory instead of the current directory.
26348484SmjacobCONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
26448484Smjacob
26548484Smjacob# Create the actual output files. Now the main work of configure is done.
26648484SmjacobAC_OUTPUT
26748484Smjacob
26848484Smjacob# After AC_OUTPUT, we need to do final work
26944819SmjacobCUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
27048484SmjacobBASIC_POST_CONFIG_OUTPUT
27152347Smjacob
27260221Smjacob# Finally output some useful information to the user
27360221SmjacobHELP_PRINT_SUMMARY_AND_WARNINGS
27460221SmjacobCUSTOM_SUMMARY_AND_WARNINGS_HOOK
27560221SmjacobHELP_REPEAT_WARNINGS
27660221Smjacob