configure.ac revision 1808:90f455b5ff5e
155714Skris#
255714Skris# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
355714Skris# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
455714Skris#
555714Skris# This code is free software; you can redistribute it and/or modify it
655714Skris# under the terms of the GNU General Public License version 2 only, as
755714Skris# published by the Free Software Foundation.  Oracle designates this
855714Skris# particular file as subject to the "Classpath" exception as provided
955714Skris# by Oracle in the LICENSE file that accompanied this code.
1055714Skris#
1155714Skris# This code is distributed in the hope that it will be useful, but WITHOUT
1255714Skris# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1355714Skris# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1455714Skris# version 2 for more details (a copy is included in the LICENSE file that
1555714Skris# accompanied this code).
1655714Skris#
1755714Skris# You should have received a copy of the GNU General Public License version
1855714Skris# 2 along with this work; if not, write to the Free Software Foundation,
1955714Skris# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2055714Skris#
2155714Skris# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2255714Skris# or visit www.oracle.com if you need additional information or have any
2355714Skris# questions.
2455714Skris#
2555714Skris
2655714Skris###############################################################################
2755714Skris#
2855714Skris# Includes and boilerplate
2955714Skris#
3055714Skris###############################################################################
3155714Skris
3255714Skris
3355714SkrisAC_PREREQ([2.69])
3455714SkrisAC_INIT(OpenJDK, jdk9, build-dev@openjdk.java.net,,http://openjdk.java.net)
3555714Skris
3655714SkrisAC_CONFIG_AUX_DIR([$TOPDIR/common/autoconf/build-aux])
3755714Skrism4_include([build-aux/pkg.m4])
3855714Skris
3955714Skris# Include these first...
4055714Skrism4_include([basics.m4])
4155714Skrism4_include([basics_windows.m4])
4255714Skris# ... then the rest
4355714Skrism4_include([boot-jdk.m4])
4455714Skrism4_include([build-performance.m4])
4555714Skrism4_include([flags.m4])
4655714Skrism4_include([help.m4])
4755714Skrism4_include([jdk-options.m4])
4855714Skrism4_include([jdk-version.m4])
4955714Skrism4_include([libraries.m4])
5055714Skrism4_include([platform.m4])
5155714Skrism4_include([source-dirs.m4])
5255714Skrism4_include([toolchain.m4])
5355714Skrism4_include([toolchain_windows.m4])
5455714Skris
5555714SkrisAC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
5655714SkrisAC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
5755714SkrisAC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
58100928SnectarAC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
59100928Snectar
60100928Snectar# This line needs to be here, verbatim, after all includes and the dummy hook
61100928Snectar# definitions. It is replaced with custom functionality when building
62100928Snectar# custom sources.
63100928Snectar#CUSTOM_AUTOCONF_INCLUDE
64100928Snectar
65100928Snectar# Do not change or remove the following line, it is needed for consistency checks:
66100928SnectarDATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@
67100928Snectar
68100928Snectar###############################################################################
69100928Snectar#
70100928Snectar# Initialization / Boot-strapping
71100928Snectar#
72100928Snectar# The bootstrapping process needs to solve the "chicken or the egg" problem,
73100928Snectar# thus it jumps back and forth, each time gaining something needed later on.
74100928Snectar#
75100928Snectar###############################################################################
76100928Snectar
77100928Snectar# If we are requested to print additional help, do that and then exit.
78100928Snectar# This must be the very first call.
79100928SnectarHELP_PRINT_ADDITIONAL_HELP_AND_EXIT
80100928Snectar
81100928Snectar# Basic initialization that must happen first of all in the normal process.
82100928SnectarBASIC_INIT
83100928SnectarBASIC_SETUP_FUNDAMENTAL_TOOLS
84100928Snectar
85100928Snectar# Now we can determine OpenJDK build and target platforms. This is required to
86100928Snectar# have early on.
87100928SnectarPLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
88100928Snectar
89100928Snectar# Continue setting up basic stuff. Most remaining code require fundamental tools.
90100928SnectarBASIC_SETUP_PATHS
91100928Snectar
92100928Snectar# Check if it's a pure open build or if custom sources are to be used.
93100928SnectarJDKOPT_SETUP_OPEN_OR_CUSTOM
94100928Snectar
95100928Snectar# These are needed to be able to create a configuration name (and thus the output directory)
96100928SnectarJDKOPT_SETUP_JDK_VARIANT
97100928SnectarJDKOPT_SETUP_JVM_INTERPRETER
98100928SnectarJDKOPT_SETUP_JVM_VARIANTS
99100928SnectarJDKOPT_SETUP_DEBUG_LEVEL
100100928Snectar
101100928Snectar# With basic setup done, call the custom early hook.
102100928SnectarCUSTOM_EARLY_HOOK
103100928Snectar
104100928Snectar# Check if we have devkits, extra paths or sysroot set.
105100928SnectarBASIC_SETUP_DEVKIT
106100928Snectar
107100928Snectar# To properly create a configuration name, we need to have the OpenJDK target
108100928Snectar# and options (variants and debug level) parsed.
109100928SnectarBASIC_SETUP_OUTPUT_DIR
110100928Snectar
11155714Skris# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
11255714SkrisHELP_SETUP_DEPENDENCY_HELP
113109998Smarkm
114194206Ssimon# Setup tools that requires more complex handling, or that is not needed by the configure script.
11555714SkrisBASIC_SETUP_COMPLEX_TOOLS
116194206SsimonBASIC_CHECK_BASH_OPTIONS
11755714Skris
11855714Skris# Check if pkg-config is available.
119109998SmarkmPKG_PROG_PKG_CONFIG
120194206Ssimon
121194206Ssimon# After basic tools have been setup, we can check build os specific details.
122194206SsimonPLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
12355714Skris
12455714Skris###############################################################################
12555714Skris#
12655714Skris# Determine OpenJDK variants, options and version numbers.
12755714Skris#
12855714Skris###############################################################################
12955714Skris
13055714Skris# We need build & target for this.
13155714SkrisJDKOPT_SETUP_JDK_OPTIONS
132109998SmarkmJDKVER_SETUP_JDK_VERSION_NUMBERS
13355714Skris
13455714Skris###############################################################################
13555714Skris#
13655714Skris# Setup BootJDK, used to bootstrap the build.
137109998Smarkm#
138109998Smarkm###############################################################################
139194206Ssimon
140194206SsimonBOOTJDK_SETUP_BOOT_JDK
141109998Smarkm
142109998Smarkm###############################################################################
14355714Skris#
14455714Skris# Configure the sources to use. We can add or override individual directories.
14555714Skris#
14655714Skris###############################################################################
14755714Skris
14855714SkrisSRCDIRS_SETUP_TOPDIRS
149109998SmarkmSRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
150109998SmarkmSRCDIRS_SETUP_OUTPUT_DIRS
15155714Skris
152109998Smarkm###############################################################################
15355714Skris#
15455714Skris# Setup the toolchain (compilers etc), i.e. tools used to compile and process
15555714Skris# native code.
15655714Skris#
15755714Skris###############################################################################
15855714Skris
15955714Skris# See if we are doing a complete static build or not
16055714SkrisJDKOPT_SETUP_STATIC_BUILD
16155714Skris
16255714Skris# First determine the toolchain type (compiler family)
16355714SkrisTOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
16455714Skris
16555714Skris# User supplied flags should be used when configure detects compilers
16655714SkrisFLAGS_SETUP_USER_SUPPLIED_FLAGS
16755714Skris# The sysroot cflags are needed for configure to be able to run the compilers
16855714SkrisFLAGS_SETUP_SYSROOT_FLAGS
169109998Smarkm
170109998Smarkm# Then detect the actual binaries needed
171109998SmarkmTOOLCHAIN_PRE_DETECTION
17255714SkrisTOOLCHAIN_DETECT_TOOLCHAIN_CORE
17355714SkrisTOOLCHAIN_DETECT_TOOLCHAIN_EXTRA
17455714SkrisTOOLCHAIN_POST_DETECTION
17555714Skris
17655714Skris# Finally do some processing after the detection phase
17755714SkrisTOOLCHAIN_SETUP_BUILD_COMPILERS
17855714SkrisTOOLCHAIN_SETUP_LEGACY
17955714SkrisTOOLCHAIN_MISC_CHECKS
18055714Skris
18155714Skris# Setup the JTReg Regression Test Harness.
18255714SkrisTOOLCHAIN_SETUP_JTREG
18355714Skris
18455714SkrisFLAGS_SETUP_INIT_FLAGS
18555714Skris
18655714Skris# FIXME: Currently we must test this after toolchain but before flags. Fix!
187160814Ssimon
18855714Skris# Now we can test some aspects on the target using configure macros.
18955714SkrisPLATFORM_SETUP_OPENJDK_TARGET_BITS
19055714SkrisPLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
19155714Skris
19255714Skris# Configure flags for the tools
19355714SkrisFLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS
19455714SkrisFLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
19555714SkrisFLAGS_SETUP_COMPILER_FLAGS_FOR_JDK
19655714SkrisFLAGS_SETUP_COMPILER_FLAGS_MISC
19755714Skris
19855714Skris# Setup debug symbols (need objcopy from the toolchain for that)
19955714SkrisJDKOPT_SETUP_DEBUG_SYMBOLS
20055714SkrisJDKOPT_SETUP_CODE_COVERAGE
20155714Skris
20255714Skris###############################################################################
20355714Skris#
20455714Skris# Check dependencies for external and internal libraries.
20555714Skris#
20655714Skris###############################################################################
20755714Skris
20855714Skris# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
20955714SkrisBASIC_COMPILE_FIXPATH
21055714Skris
21155714SkrisLIB_DETERMINE_DEPENDENCIES
21255714SkrisLIB_SETUP_LIBRARIES
21355714Skris
214109998Smarkm###############################################################################
215109998Smarkm#
216109998Smarkm# We need to do some final tweaking, when everything else is done.
217109998Smarkm#
218109998Smarkm###############################################################################
219109998Smarkm
220109998SmarkmJDKOPT_SETUP_BUILD_TWEAKS
221109998SmarkmJDKOPT_DETECT_INTREE_EC
222109998Smarkm
223109998Smarkm###############################################################################
224109998Smarkm#
22555714Skris# Configure parts of the build that only affect the build performance,
22655714Skris# not the result.
22755714Skris#
22855714Skris###############################################################################
22955714Skris
23055714SkrisBPERF_SETUP_BUILD_CORES
23155714SkrisBPERF_SETUP_BUILD_MEMORY
23255714SkrisBPERF_SETUP_BUILD_JOBS
23355714Skris
23455714Skris# Setup arguments for the boot jdk (after cores and memory have been setup)
23555714SkrisBOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
23655714Skris
23755714Skris# Setup smart javac (after cores and memory have been setup)
23855714SkrisBPERF_SETUP_SMART_JAVAC
23955714Skris
24055714Skris# Setup use of icecc if requested
241160814SsimonBPERF_SETUP_ICECC
24255714Skris
243160814Ssimon# Can the C/C++ compiler use precompiled headers?
24455714SkrisBPERF_SETUP_PRECOMPILED_HEADERS
245109998Smarkm
246109998Smarkm# Setup use of ccache, if available
24755714SkrisBPERF_SETUP_CCACHE
248109998Smarkm
24955714Skris###############################################################################
25055714Skris#
251160814Ssimon# And now the finish...
25255714Skris#
253160814Ssimon###############################################################################
25455714Skris
25555714Skris# Check for some common pitfalls
256109998SmarkmBASIC_TEST_USABILITY_ISSUES
257109998Smarkm
258109998Smarkm# At the end, call the custom hook. (Dummy macro if no custom sources available)
259194206SsimonCUSTOM_LATE_HOOK
260194206Ssimon
261109998Smarkm# We're messing a bit with internal autoconf variables to put the config.status
262109998Smarkm# in the output directory instead of the current directory.
263109998SmarkmCONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
264109998Smarkm
265194206Ssimon# Create the actual output files. Now the main work of configure is done.
266194206SsimonAC_OUTPUT
267194206Ssimon
268109998Smarkm# After AC_OUTPUT, we need to do final work
269109998SmarkmCUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
270109998SmarkmBASIC_POST_CONFIG_OUTPUT
27155714Skris
27255714Skris# Finally output some useful information to the user
273109998SmarkmHELP_PRINT_SUMMARY_AND_WARNINGS
274109998SmarkmCUSTOM_SUMMARY_AND_WARNINGS_HOOK
275109998SmarkmHELP_REPEAT_WARNINGS
27655714Skris