configure.ac revision 1817:a151b3ec17a1
1169689Skan#
2169689Skan# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3169689Skan# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4169689Skan#
5169689Skan# This code is free software; you can redistribute it and/or modify it
6169689Skan# under the terms of the GNU General Public License version 2 only, as
7169689Skan# published by the Free Software Foundation.  Oracle designates this
8169689Skan# particular file as subject to the "Classpath" exception as provided
9169689Skan# by Oracle in the LICENSE file that accompanied this code.
10169689Skan#
11169689Skan# This code is distributed in the hope that it will be useful, but WITHOUT
12169689Skan# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13169689Skan# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14169689Skan# version 2 for more details (a copy is included in the LICENSE file that
15169689Skan# accompanied this code).
16169689Skan#
17169689Skan# You should have received a copy of the GNU General Public License version
18169689Skan# 2 along with this work; if not, write to the Free Software Foundation,
19169689Skan# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20169689Skan#
21169689Skan# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22169689Skan# or visit www.oracle.com if you need additional information or have any
23169689Skan# questions.
24169689Skan#
25169689Skan
26169689Skan###############################################################################
27169689Skan#
28169689Skan# Includes and boilerplate
29169689Skan#
30169689Skan###############################################################################
31169689Skan
32169689Skan
33169689SkanAC_PREREQ([2.69])
34169689SkanAC_INIT(OpenJDK, jdk9, build-dev@openjdk.java.net,,http://openjdk.java.net)
35169689Skan
36169689SkanAC_CONFIG_AUX_DIR([$TOPDIR/common/autoconf/build-aux])
37169689Skanm4_include([build-aux/pkg.m4])
38169689Skan
39169689Skan# Include these first...
40169689Skanm4_include([basics.m4])
41169689Skanm4_include([basics_windows.m4])
42169689Skan# ... then the rest
43169689Skanm4_include([boot-jdk.m4])
44169689Skanm4_include([build-performance.m4])
45169689Skanm4_include([flags.m4])
46169689Skanm4_include([help.m4])
47169689Skanm4_include([jdk-options.m4])
48169689Skanm4_include([jdk-version.m4])
49169689Skanm4_include([libraries.m4])
50169689Skanm4_include([platform.m4])
51169689Skanm4_include([source-dirs.m4])
52169689Skanm4_include([toolchain.m4])
53169689Skanm4_include([toolchain_windows.m4])
54169689Skan
55169689SkanAC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
56169689SkanAC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
57169689SkanAC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
58169689SkanAC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
59169689Skan
60169689Skan# This line needs to be here, verbatim, after all includes and the dummy hook
61169689Skan# definitions. It is replaced with custom functionality when building
62169689Skan# custom sources.
63169689Skan#CUSTOM_AUTOCONF_INCLUDE
64169689Skan
65169689Skan# Do not change or remove the following line, it is needed for consistency checks:
66169689SkanDATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@
67169689Skan
68169689Skan###############################################################################
69169689Skan#
70169689Skan# Initialization / Boot-strapping
71169689Skan#
72169689Skan# The bootstrapping process needs to solve the "chicken or the egg" problem,
73169689Skan# thus it jumps back and forth, each time gaining something needed later on.
74169689Skan#
75169689Skan###############################################################################
76169689Skan
77169689Skan# If we are requested to print additional help, do that and then exit.
78169689Skan# This must be the very first call.
79169689SkanHELP_PRINT_ADDITIONAL_HELP_AND_EXIT
80169689Skan
81169689Skan# Basic initialization that must happen first of all in the normal process.
82169689SkanBASIC_INIT
83169689SkanBASIC_SETUP_FUNDAMENTAL_TOOLS
84169689Skan
85169689Skan# Now we can determine OpenJDK build and target platforms. This is required to
86169689Skan# have early on.
87169689SkanPLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
88169689Skan
89169689Skan# Continue setting up basic stuff. Most remaining code require fundamental tools.
90169689SkanBASIC_SETUP_PATHS
91169689Skan
92169689Skan# Check if it's a pure open build or if custom sources are to be used.
93169689SkanJDKOPT_SETUP_OPEN_OR_CUSTOM
94169689Skan
95169689Skan# These are needed to be able to create a configuration name (and thus the output directory)
96169689SkanJDKOPT_SETUP_JDK_VARIANT
97169689SkanJDKOPT_SETUP_JVM_INTERPRETER
98169689SkanJDKOPT_SETUP_JVM_VARIANTS
99169689SkanJDKOPT_SETUP_DEBUG_LEVEL
100169689Skan
101169689Skan# With basic setup done, call the custom early hook.
102169689SkanCUSTOM_EARLY_HOOK
103169689Skan
104169689Skan# Check if we have devkits, extra paths or sysroot set.
105169689SkanBASIC_SETUP_DEVKIT
106169689Skan
107169689Skan# To properly create a configuration name, we need to have the OpenJDK target
108169689Skan# and options (variants and debug level) parsed.
109169689SkanBASIC_SETUP_OUTPUT_DIR
110169689Skan
111169689Skan# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
112169689SkanHELP_SETUP_DEPENDENCY_HELP
113169689Skan
114169689Skan# Setup tools that requires more complex handling, or that is not needed by the configure script.
115169689SkanBASIC_SETUP_COMPLEX_TOOLS
116169689SkanBASIC_CHECK_BASH_OPTIONS
117169689Skan
118169689Skan# Check if pkg-config is available.
119169689SkanPKG_PROG_PKG_CONFIG
120169689Skan
121169689Skan# After basic tools have been setup, we can check build os specific details.
122169689SkanPLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
123169689Skan
124169689Skan# Misc basic settings
125169689SkanBASIC_SETUP_DEFAULT_MAKE_TARGET
126169689Skan
127169689Skan###############################################################################
128169689Skan#
129169689Skan# Determine OpenJDK variants, options and version numbers.
130169689Skan#
131169689Skan###############################################################################
132169689Skan
133169689Skan# We need build & target for this.
134169689SkanJDKOPT_SETUP_JDK_OPTIONS
135169689SkanJDKVER_SETUP_JDK_VERSION_NUMBERS
136169689Skan
137169689Skan###############################################################################
138169689Skan#
139169689Skan# Setup BootJDK, used to bootstrap the build.
140169689Skan#
141169689Skan###############################################################################
142169689Skan
143169689SkanBOOTJDK_SETUP_BOOT_JDK
144169689Skan
145169689Skan###############################################################################
146169689Skan#
147169689Skan# Configure the sources to use. We can add or override individual directories.
148169689Skan#
149169689Skan###############################################################################
150169689Skan
151169689SkanSRCDIRS_SETUP_TOPDIRS
152169689SkanSRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
153169689SkanSRCDIRS_SETUP_OUTPUT_DIRS
154169689Skan
155169689Skan###############################################################################
156169689Skan#
157169689Skan# Setup the toolchain (compilers etc), i.e. tools used to compile and process
158169689Skan# native code.
159169689Skan#
160169689Skan###############################################################################
161169689Skan
162169689Skan# See if we are doing a complete static build or not
163169689SkanJDKOPT_SETUP_STATIC_BUILD
164169689Skan
165169689Skan# First determine the toolchain type (compiler family)
166169689SkanTOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
167169689Skan
168169689Skan# User supplied flags should be used when configure detects compilers
169169689SkanFLAGS_SETUP_USER_SUPPLIED_FLAGS
170169689Skan# The sysroot cflags are needed for configure to be able to run the compilers
171169689SkanFLAGS_SETUP_SYSROOT_FLAGS
172169689Skan
173169689Skan# Then detect the actual binaries needed
174169689SkanTOOLCHAIN_PRE_DETECTION
175169689SkanTOOLCHAIN_DETECT_TOOLCHAIN_CORE
176169689SkanTOOLCHAIN_DETECT_TOOLCHAIN_EXTRA
177169689SkanTOOLCHAIN_POST_DETECTION
178169689Skan
179169689Skan# Finally do some processing after the detection phase
180169689SkanTOOLCHAIN_SETUP_BUILD_COMPILERS
181169689SkanTOOLCHAIN_SETUP_LEGACY
182169689SkanTOOLCHAIN_MISC_CHECKS
183169689Skan
184169689Skan# Setup the JTReg Regression Test Harness.
185169689SkanTOOLCHAIN_SETUP_JTREG
186169689Skan
187169689SkanFLAGS_SETUP_INIT_FLAGS
188169689Skan
189169689Skan# FIXME: Currently we must test this after toolchain but before flags. Fix!
190169689Skan
191260919Spfg# Now we can test some aspects on the target using configure macros.
192260919SpfgPLATFORM_SETUP_OPENJDK_TARGET_BITS
193260919SpfgPLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
194260919Spfg
195169689Skan# Configure flags for the tools
196169689SkanFLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS
197169689SkanFLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
198169689SkanFLAGS_SETUP_COMPILER_FLAGS_FOR_JDK
199169689SkanFLAGS_SETUP_COMPILER_FLAGS_MISC
200169689Skan
201169689Skan# Setup debug symbols (need objcopy from the toolchain for that)
202169689SkanJDKOPT_SETUP_DEBUG_SYMBOLS
203169689SkanJDKOPT_SETUP_CODE_COVERAGE
204169689Skan
205169689Skan###############################################################################
206169689Skan#
207169689Skan# Check dependencies for external and internal libraries.
208169689Skan#
209169689Skan###############################################################################
210169689Skan
211169689Skan# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
212169689SkanBASIC_COMPILE_FIXPATH
213169689Skan
214169689SkanLIB_DETERMINE_DEPENDENCIES
215169689SkanLIB_SETUP_LIBRARIES
216169689Skan
217169689Skan###############################################################################
218169689Skan#
219169689Skan# We need to do some final tweaking, when everything else is done.
220169689Skan#
221169689Skan###############################################################################
222169689Skan
223169689SkanJDKOPT_SETUP_BUILD_TWEAKS
224169689SkanJDKOPT_DETECT_INTREE_EC
225169689Skan
226169689Skan###############################################################################
227169689Skan#
228169689Skan# Configure parts of the build that only affect the build performance,
229260919Spfg# not the result.
230260919Spfg#
231260919Spfg###############################################################################
232260919Spfg
233260919SpfgBPERF_SETUP_BUILD_CORES
234260919SpfgBPERF_SETUP_BUILD_MEMORY
235169689SkanBPERF_SETUP_BUILD_JOBS
236169689Skan
237169689Skan# Setup arguments for the boot jdk (after cores and memory have been setup)
238169689SkanBOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
239169689Skan
240169689Skan# Setup smart javac (after cores and memory have been setup)
241169689SkanBPERF_SETUP_SMART_JAVAC
242169689Skan
243169689Skan# Setup use of icecc if requested
244169689SkanBPERF_SETUP_ICECC
245169689Skan
246169689Skan# Can the C/C++ compiler use precompiled headers?
247169689SkanBPERF_SETUP_PRECOMPILED_HEADERS
248169689Skan
249169689Skan# Setup use of ccache, if available
250169689SkanBPERF_SETUP_CCACHE
251169689Skan
252169689Skan###############################################################################
253169689Skan#
254169689Skan# And now the finish...
255169689Skan#
256169689Skan###############################################################################
257169689Skan
258169689Skan# Check for some common pitfalls
259169689SkanBASIC_TEST_USABILITY_ISSUES
260169689Skan
261169689Skan# At the end, call the custom hook. (Dummy macro if no custom sources available)
262169689SkanCUSTOM_LATE_HOOK
263169689Skan
264169689Skan# We're messing a bit with internal autoconf variables to put the config.status
265169689Skan# in the output directory instead of the current directory.
266169689SkanCONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
267169689Skan
268169689Skan# Create the actual output files. Now the main work of configure is done.
269169689SkanAC_OUTPUT
270169689Skan
271169689Skan# After AC_OUTPUT, we need to do final work
272169689SkanCUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
273169689SkanBASIC_POST_CONFIG_OUTPUT
274169689Skan
275169689Skan# Finally output some useful information to the user
276169689SkanHELP_PRINT_SUMMARY_AND_WARNINGS
277169689SkanCUSTOM_SUMMARY_AND_WARNINGS_HOOK
278169689SkanHELP_REPEAT_WARNINGS
279169689Skan