configure.ac revision 2017:9f1ecdfae7fb
1279264Sdelphij#
2238405Sjkim# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
3238405Sjkim# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4238405Sjkim#
5238405Sjkim# This code is free software; you can redistribute it and/or modify it
6238405Sjkim# under the terms of the GNU General Public License version 2 only, as
7238405Sjkim# published by the Free Software Foundation.  Oracle designates this
8238405Sjkim# particular file as subject to the "Classpath" exception as provided
9238405Sjkim# by Oracle in the LICENSE file that accompanied this code.
10238405Sjkim#
11238405Sjkim# This code is distributed in the hope that it will be useful, but WITHOUT
12238405Sjkim# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13238405Sjkim# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14238405Sjkim# version 2 for more details (a copy is included in the LICENSE file that
15238405Sjkim# accompanied this code).
16238405Sjkim#
17238405Sjkim# You should have received a copy of the GNU General Public License version
18238405Sjkim# 2 along with this work; if not, write to the Free Software Foundation,
19238405Sjkim# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20238405Sjkim#
21238405Sjkim# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22238405Sjkim# or visit www.oracle.com if you need additional information or have any
23238405Sjkim# questions.
24238405Sjkim#
25238405Sjkim
26238405Sjkim###############################################################################
27238405Sjkim#
28238405Sjkim# Includes and boilerplate
29238405Sjkim#
30238405Sjkim###############################################################################
31238405Sjkim
32238405Sjkim
33238405SjkimAC_PREREQ([2.69])
34238405SjkimAC_INIT(OpenJDK, jdk9, build-dev@openjdk.java.net,,http://openjdk.java.net)
35238405Sjkim
36238405SjkimAC_CONFIG_AUX_DIR([$TOPDIR/common/autoconf/build-aux])
37238405Sjkimm4_include([build-aux/pkg.m4])
38238405Sjkim
39238405Sjkim# Include these first...
40238405Sjkimm4_include([basics.m4])
41279264Sdelphijm4_include([basics_windows.m4])
42279264Sdelphij# ... then the rest
43238405Sjkimm4_include([boot-jdk.m4])
44238405Sjkimm4_include([build-performance.m4])
45238405Sjkimm4_include([flags.m4])
46238405Sjkimm4_include([help.m4])
47238405Sjkimm4_include([hotspot.m4])
48238405Sjkimm4_include([jdk-options.m4])
49238405Sjkimm4_include([jdk-version.m4])
50238405Sjkimm4_include([libraries.m4])
51238405Sjkimm4_include([platform.m4])
52238405Sjkimm4_include([source-dirs.m4])
53279264Sdelphijm4_include([toolchain.m4])
54279264Sdelphijm4_include([toolchain_windows.m4])
55279264Sdelphij
56238405SjkimAC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
57279264SdelphijAC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
58279264SdelphijAC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
59279264SdelphijAC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
60279264Sdelphij
61279264Sdelphij# This line needs to be here, verbatim, after all includes and the dummy hook
62279264Sdelphij# definitions. It is replaced with custom functionality when building
63238405Sjkim# custom sources.
64279264Sdelphij#CUSTOM_AUTOCONF_INCLUDE
65279264Sdelphij
66279264Sdelphij# Do not change or remove the following line, it is needed for consistency checks:
67279264SdelphijDATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@
68279264Sdelphij
69238405Sjkim###############################################################################
70279264Sdelphij#
71238405Sjkim# Initialization / Boot-strapping
72238405Sjkim#
73238405Sjkim# The bootstrapping process needs to solve the "chicken or the egg" problem,
74238405Sjkim# thus it jumps back and forth, each time gaining something needed later on.
75238405Sjkim#
76238405Sjkim###############################################################################
77238405Sjkim
78238405Sjkim# If we are requested to print additional help, do that and then exit.
79238405Sjkim# This must be the very first call.
80238405SjkimHELP_PRINT_ADDITIONAL_HELP_AND_EXIT
81238405Sjkim
82238405Sjkim# Basic initialization that must happen first of all in the normal process.
83238405SjkimBASIC_INIT
84238405SjkimBASIC_SETUP_FUNDAMENTAL_TOOLS
85238405Sjkim
86238405Sjkim# Now we can determine OpenJDK build and target platforms. This is required to
87238405Sjkim# have early on.
88238405SjkimPLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
89238405Sjkim
90238405Sjkim# Continue setting up basic stuff. Most remaining code require fundamental tools.
91238405SjkimBASIC_SETUP_PATHS
92238405Sjkim
93238405Sjkim# Check if it's a pure open build or if custom sources are to be used.
94238405SjkimJDKOPT_SETUP_OPEN_OR_CUSTOM
95238405Sjkim
96238405Sjkim# These are needed to be able to create a configuration name (and thus the output directory)
97238405SjkimJDKOPT_SETUP_JDK_VARIANT
98238405SjkimHOTSPOT_SETUP_JVM_INTERPRETER
99238405SjkimHOTSPOT_SETUP_JVM_VARIANTS
100238405SjkimJDKOPT_SETUP_DEBUG_LEVEL
101238405SjkimHOTSPOT_SETUP_DEBUG_LEVEL
102238405Sjkim
103238405Sjkim# With basic setup done, call the custom early hook.
104238405SjkimCUSTOM_EARLY_HOOK
105238405Sjkim
106238405Sjkim# Check if we have devkits, extra paths or sysroot set.
107238405SjkimBASIC_SETUP_DEVKIT
108238405Sjkim
109238405Sjkim# To properly create a configuration name, we need to have the OpenJDK target
110238405Sjkim# and options (variants and debug level) parsed.
111238405SjkimBASIC_SETUP_OUTPUT_DIR
112238405Sjkim
113238405Sjkim# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
114238405SjkimHELP_SETUP_DEPENDENCY_HELP
115238405Sjkim
116238405Sjkim# Setup tools that requires more complex handling, or that is not needed by the configure script.
117238405SjkimBASIC_SETUP_COMPLEX_TOOLS
118238405SjkimBASIC_CHECK_BASH_OPTIONS
119238405Sjkim
120238405Sjkim# Check if pkg-config is available.
121238405SjkimPKG_PROG_PKG_CONFIG
122238405Sjkim
123238405Sjkim# After basic tools have been setup, we can check build os specific details.
124238405SjkimPLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
125238405Sjkim
126238405Sjkim# Misc basic settings
127238405SjkimBASIC_SETUP_DEFAULT_MAKE_TARGET
128238405Sjkim
129238405Sjkim###############################################################################
130238405Sjkim#
131238405Sjkim# Determine OpenJDK variants, options and version numbers.
132238405Sjkim#
133238405Sjkim###############################################################################
134238405Sjkim
135238405Sjkim# We need build & target for this.
136279264SdelphijJDKOPT_SETUP_JDK_OPTIONS
137238405SjkimJDKOPT_SETUP_JLINK_OPTIONS
138238405SjkimHOTSPOT_SETUP_HOTSPOT_OPTIONS
139238405SjkimJDKVER_SETUP_JDK_VERSION_NUMBERS
140238405Sjkim
141238405Sjkim###############################################################################
142238405Sjkim#
143238405Sjkim# Setup BootJDK, used to bootstrap the build.
144238405Sjkim#
145238405Sjkim###############################################################################
146238405Sjkim
147238405SjkimBOOTJDK_SETUP_BOOT_JDK
148238405SjkimBOOTJDK_SETUP_BUILD_JDK
149238405Sjkim
150238405Sjkim###############################################################################
151238405Sjkim#
152238405Sjkim# Configure the sources to use. We can add or override individual directories.
153238405Sjkim#
154238405Sjkim###############################################################################
155238405Sjkim
156238405SjkimSRCDIRS_SETUP_TOPDIRS
157238405SjkimSRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
158238405SjkimSRCDIRS_SETUP_OUTPUT_DIRS
159238405Sjkim
160238405SjkimSRCDIRS_SETUP_IMPORT_MODULES
161238405Sjkim
162238405Sjkim###############################################################################
163238405Sjkim#
164238405Sjkim# Setup the toolchain (compilers etc), i.e. tools used to compile and process
165238405Sjkim# native code.
166238405Sjkim#
167238405Sjkim###############################################################################
168238405Sjkim
169238405Sjkim# See if we are doing a complete static build or not
170238405SjkimJDKOPT_SETUP_STATIC_BUILD
171238405Sjkim
172238405Sjkim# First determine the toolchain type (compiler family)
173238405SjkimTOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
174238405Sjkim
175238405Sjkim# User supplied flags should be used when configure detects compilers
176238405SjkimFLAGS_SETUP_USER_SUPPLIED_FLAGS
177238405Sjkim# The sysroot cflags are needed for configure to be able to run the compilers
178238405SjkimFLAGS_SETUP_SYSROOT_FLAGS
179238405Sjkim
180238405Sjkim# Then detect the actual binaries needed
181238405SjkimTOOLCHAIN_PRE_DETECTION
182238405SjkimTOOLCHAIN_DETECT_TOOLCHAIN_CORE
183238405SjkimTOOLCHAIN_DETECT_TOOLCHAIN_EXTRA
184238405SjkimTOOLCHAIN_POST_DETECTION
185238405Sjkim
186238405Sjkim# Finally do some processing after the detection phase
187238405SjkimTOOLCHAIN_SETUP_BUILD_COMPILERS
188238405SjkimTOOLCHAIN_SETUP_LEGACY
189238405SjkimTOOLCHAIN_MISC_CHECKS
190238405Sjkim
191238405Sjkim# Setup the JTReg Regression Test Harness.
192238405SjkimTOOLCHAIN_SETUP_JTREG
193238405Sjkim
194238405SjkimFLAGS_SETUP_INIT_FLAGS
195238405Sjkim
196238405Sjkim# Now we can test some aspects on the target using configure macros.
197238405SjkimPLATFORM_SETUP_OPENJDK_TARGET_BITS
198PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
199
200# Configure flags for the tools
201FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS
202FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
203FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK
204FLAGS_SETUP_COMPILER_FLAGS_MISC
205
206# Setup debug symbols (need objcopy from the toolchain for that)
207JDKOPT_SETUP_DEBUG_SYMBOLS
208JDKOPT_SETUP_CODE_COVERAGE
209
210###############################################################################
211#
212# Check dependencies for external and internal libraries.
213#
214###############################################################################
215
216# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
217BASIC_COMPILE_FIXPATH
218
219LIB_DETERMINE_DEPENDENCIES
220LIB_SETUP_LIBRARIES
221
222###############################################################################
223#
224# We need to do some final tweaking, when everything else is done.
225#
226###############################################################################
227
228HOTSPOT_SETUP_BUILD_TWEAKS
229JDKOPT_DETECT_INTREE_EC
230JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
231
232###############################################################################
233#
234# Configure parts of the build that only affect the build performance,
235# not the result.
236#
237###############################################################################
238
239BPERF_SETUP_BUILD_CORES
240BPERF_SETUP_BUILD_MEMORY
241BPERF_SETUP_BUILD_JOBS
242BPERF_SETUP_TEST_JOBS
243
244# Setup arguments for the boot jdk (after cores and memory have been setup)
245BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
246
247# Setup smart javac (after cores and memory have been setup)
248BPERF_SETUP_SMART_JAVAC
249
250# Setup use of icecc if requested
251BPERF_SETUP_ICECC
252
253# Can the C/C++ compiler use precompiled headers?
254BPERF_SETUP_PRECOMPILED_HEADERS
255
256# Setup use of ccache, if available
257BPERF_SETUP_CCACHE
258
259###############################################################################
260#
261# And now the finish...
262#
263###############################################################################
264
265# Check for some common pitfalls
266BASIC_TEST_USABILITY_ISSUES
267
268# At the end, call the custom hook. (Dummy macro if no custom sources available)
269CUSTOM_LATE_HOOK
270
271# We're messing a bit with internal autoconf variables to put the config.status
272# in the output directory instead of the current directory.
273CONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
274
275# Create the actual output files. Now the main work of configure is done.
276AC_OUTPUT
277
278# After AC_OUTPUT, we need to do final work
279CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
280BASIC_POST_CONFIG_OUTPUT
281
282# Finally output some useful information to the user
283HELP_PRINT_SUMMARY_AND_WARNINGS
284CUSTOM_SUMMARY_AND_WARNINGS_HOOK
285HELP_REPEAT_WARNINGS
286