configure.ac revision 1482:98e85b507b09
1152570Sru#
2152324Sdavidxu# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3152297Sdavidxu# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4152297Sdavidxu#
5152297Sdavidxu# This code is free software; you can redistribute it and/or modify it
6152297Sdavidxu# under the terms of the GNU General Public License version 2 only, as
7152297Sdavidxu# published by the Free Software Foundation.  Oracle designates this
8152297Sdavidxu# particular file as subject to the "Classpath" exception as provided
9152297Sdavidxu# by Oracle in the LICENSE file that accompanied this code.
10152297Sdavidxu#
11152297Sdavidxu# This code is distributed in the hope that it will be useful, but WITHOUT
12152297Sdavidxu# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13152297Sdavidxu# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14152297Sdavidxu# version 2 for more details (a copy is included in the LICENSE file that
15152297Sdavidxu# accompanied this code).
16152297Sdavidxu#
17152297Sdavidxu# You should have received a copy of the GNU General Public License version
18152297Sdavidxu# 2 along with this work; if not, write to the Free Software Foundation,
19152297Sdavidxu# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20152297Sdavidxu#
21152297Sdavidxu# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22152297Sdavidxu# or visit www.oracle.com if you need additional information or have any
23152297Sdavidxu# questions.
24152297Sdavidxu#
25152297Sdavidxu
26152297Sdavidxu###############################################################################
27152297Sdavidxu#
28152297Sdavidxu# Includes and boilerplate
29152297Sdavidxu#
30152570Sru###############################################################################
31152297Sdavidxu
32152297Sdavidxu
33152297SdavidxuAC_PREREQ([2.69])
34152570SruAC_INIT(OpenJDK, jdk9, build-dev@openjdk.java.net,,http://openjdk.java.net)
35152570Sru
36152297SdavidxuAC_CONFIG_AUX_DIR([$TOPDIR/common/autoconf/build-aux])
37152570Srum4_include([build-aux/pkg.m4])
38152297Sdavidxu
39170904Sdavidxu# Include these first...
40152297Sdavidxum4_include([basics.m4])
41152297Sdavidxum4_include([basics_windows.m4])
42152297Sdavidxum4_include([builddeps.m4])
43152297Sdavidxu# ... then the rest
44152297Sdavidxum4_include([boot-jdk.m4])
45152297Sdavidxum4_include([build-performance.m4])
46152297Sdavidxum4_include([flags.m4])
47152570Srum4_include([help.m4])
48152570Srum4_include([jdk-options.m4])
49152570Srum4_include([libraries.m4])
50152570Srum4_include([platform.m4])
51152297Sdavidxum4_include([source-dirs.m4])
52152297Sdavidxum4_include([toolchain.m4])
53152297Sdavidxum4_include([toolchain_windows.m4])
54152570Sru
55152297SdavidxuAC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
56152297SdavidxuAC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
57152297SdavidxuAC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
58152570SruAC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
59152570Sru
60152570Sru# This line needs to be here, verbatim, after all includes and the dummy hook
61152570Sru# definitions. It is replaced with custom functionality when building
62152570Sru# custom sources.
63152570Sru#CUSTOM_AUTOCONF_INCLUDE
64152297Sdavidxu
65152570Sru# Do not change or remove the following line, it is needed for consistency checks:
66152570SruDATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@
67152570Sru
68152570Sru###############################################################################
69152570Sru#
70152570Sru# Initialization / Boot-strapping
71152297Sdavidxu#
72152297Sdavidxu# The bootstrapping process needs to solve the "chicken or the egg" problem,
73152297Sdavidxu# thus it jumps back and forth, each time gaining something needed later on.
74152297Sdavidxu#
75152297Sdavidxu###############################################################################
76152570Sru
77152297Sdavidxu# If we are requested to print additional help, do that and then exit.
78152297Sdavidxu# This must be the very first call.
79152570SruHELP_PRINT_ADDITIONAL_HELP_AND_EXIT
80152570Sru
81152570Sru# Basic initialization that must happen first of all in the normal process.
82152570SruBASIC_INIT
83152570SruBASIC_SETUP_FUNDAMENTAL_TOOLS
84152570Sru
85152570Sru# Now we can determine OpenJDK build and target platforms. This is required to
86152570Sru# have early on.
87152570SruPLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
88152570Sru
89152297Sdavidxu# Continue setting up basic stuff. Most remaining code require fundamental tools.
90152297SdavidxuBASIC_SETUP_PATHS
91152297Sdavidxu
92152570Sru# Check if it's a pure open build or if custom sources are to be used.
93152570SruJDKOPT_SETUP_OPEN_OR_CUSTOM
94152570Sru
95152570Sru# These are needed to be able to create a configuration name (and thus the output directory)
96152570SruJDKOPT_SETUP_JDK_VARIANT
97152570SruJDKOPT_SETUP_JVM_INTERPRETER
98152297SdavidxuJDKOPT_SETUP_JVM_VARIANTS
99152297SdavidxuJDKOPT_SETUP_DEBUG_LEVEL
100152570Sru
101152570Sru# With basic setup done, call the custom early hook.
102152570SruCUSTOM_EARLY_HOOK
103152297Sdavidxu
104152297Sdavidxu# Check if we have devkits, extra paths or sysroot set.
105152297SdavidxuBASIC_SETUP_DEVKIT
106152570Sru
107152570Sru# To properly create a configuration name, we need to have the OpenJDK target
108152570Sru# and options (variants and debug level) parsed.
109152570SruBASIC_SETUP_OUTPUT_DIR
110152570Sru
111152570Sru# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
112152570SruHELP_SETUP_DEPENDENCY_HELP
113152570Sru
114152570Sru# Setup tools that requires more complex handling, or that is not needed by the configure script.
115152570SruBASIC_SETUP_COMPLEX_TOOLS
116152570SruBASIC_CHECK_BASH_OPTIONS
117152570Sru
118152297Sdavidxu# Check if pkg-config is available.
119152297SdavidxuPKG_PROG_PKG_CONFIG
120152297Sdavidxu
121152297Sdavidxu# After basic tools have been setup, we can check build os specific details.
122152297SdavidxuPLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
123152297Sdavidxu
124152570Sru# Setup builddeps, for automatic downloading of tools we need.
125152570Sru# This is needed before we can call BDEPS_CHECK_MODULE, which is done in
126152570Sru# boot-jdk setup, but we need to have basic tools setup first.
127152570SruBDEPS_CONFIGURE_BUILDDEPS
128152570SruBDEPS_SCAN_FOR_BUILDDEPS
129152297Sdavidxu
130152570Sru###############################################################################
131152570Sru#
132152570Sru# Determine OpenJDK variants, options and version numbers.
133152570Sru#
134152570Sru###############################################################################
135152570Sru
136152570Sru# We need build & target for this.
137152297SdavidxuJDKOPT_SETUP_JDK_OPTIONS
138152297SdavidxuJDKOPT_SETUP_JDK_VERSION_NUMBERS
139152297Sdavidxu
140152570Sru###############################################################################
141152570Sru#
142152570Sru# Setup BootJDK, used to bootstrap the build.
143152297Sdavidxu#
144152297Sdavidxu###############################################################################
145152570Sru
146152570SruBOOTJDK_SETUP_BOOT_JDK
147152570Sru
148152570Sru###############################################################################
149152570Sru#
150152297Sdavidxu# Configure the sources to use. We can add or override individual directories.
151152570Sru#
152152570Sru###############################################################################
153152570Sru
154152297SdavidxuSRCDIRS_SETUP_TOPDIRS
155152570SruSRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
156152570SruSRCDIRS_SETUP_OUTPUT_DIRS
157152297Sdavidxu
158152297Sdavidxu###############################################################################
159152297Sdavidxu#
160152570Sru# Setup the toolchain (compilers etc), i.e. tools used to compile and process
161152570Sru# native code.
162152570Sru#
163152570Sru###############################################################################
164152297Sdavidxu
165152297Sdavidxu# First determine the toolchain type (compiler family)
166152570SruTOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
167152297Sdavidxu
168152297Sdavidxu# Then detect the actual binaries needed
169152570SruTOOLCHAIN_PRE_DETECTION
170152570SruTOOLCHAIN_DETECT_TOOLCHAIN_CORE
171152570SruTOOLCHAIN_DETECT_TOOLCHAIN_EXTRA
172152570SruTOOLCHAIN_POST_DETECTION
173152570Sru
174152570Sru# Finally do some processing after the detection phase
175152570SruTOOLCHAIN_SETUP_BUILD_COMPILERS
176152570SruTOOLCHAIN_SETUP_LEGACY
177152297SdavidxuTOOLCHAIN_MISC_CHECKS
178152570Sru
179152570Sru# Setup the JTReg Regression Test Harness.
180152297SdavidxuTOOLCHAIN_SETUP_JTREG
181152297Sdavidxu
182152297SdavidxuFLAGS_SETUP_INIT_FLAGS
183152297Sdavidxu
184152297Sdavidxu# FIXME: Currently we must test this after toolchain but before flags. Fix!
185152297Sdavidxu
186152570Sru# Now we can test some aspects on the target using configure macros.
187152297SdavidxuPLATFORM_SETUP_OPENJDK_TARGET_BITS
188152570SruPLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
189152570Sru
190152570Sru# Configure flags for the tools
191152297SdavidxuFLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS
192152570SruFLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
193152297SdavidxuFLAGS_SETUP_COMPILER_FLAGS_FOR_JDK
194152297SdavidxuFLAGS_SETUP_COMPILER_FLAGS_MISC
195152297Sdavidxu
196152570Sru# Setup debug symbols (need objcopy from the toolchain for that)
197152297SdavidxuJDKOPT_SETUP_DEBUG_SYMBOLS
198152297SdavidxuJDKOPT_SETUP_CODE_COVERAGE
199152297Sdavidxu
200152570Sru###############################################################################
201152570Sru#
202152570Sru# Check dependencies for external and internal libraries.
203152570Sru#
204152570Sru###############################################################################
205152570Sru
206152297Sdavidxu# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
207152297SdavidxuBASIC_COMPILE_FIXPATH
208152297Sdavidxu
209152570SruLIB_SETUP_INIT
210152297SdavidxuLIB_SETUP_X11
211152297SdavidxuLIB_SETUP_CUPS
212152297SdavidxuLIB_SETUP_FREETYPE
213152297SdavidxuLIB_SETUP_ALSA
214152297SdavidxuLIB_SETUP_MISC_LIBS
215152297SdavidxuLIB_SETUP_STATIC_LINK_LIBSTDCPP
216152297SdavidxuLIB_SETUP_ON_WINDOWS
217152297Sdavidxu
218152297Sdavidxu###############################################################################
219152297Sdavidxu#
220152570Sru# We need to do some final tweaking, when everything else is done.
221152570Sru#
222152570Sru###############################################################################
223152297Sdavidxu
224152297SdavidxuJDKOPT_SETUP_BUILD_TWEAKS
225152570SruJDKOPT_DETECT_INTREE_EC
226152570Sru
227152570Sru###############################################################################
228152570Sru#
229152570Sru# Configure parts of the build that only affect the build performance,
230152570Sru# not the result.
231152570Sru#
232152570Sru###############################################################################
233152570Sru
234152297SdavidxuBPERF_SETUP_BUILD_CORES
235152570SruBPERF_SETUP_BUILD_MEMORY
236152297SdavidxuBPERF_SETUP_BUILD_JOBS
237152297Sdavidxu
238152297Sdavidxu# Setup arguments for the boot jdk (after cores and memory have been setup)
239152297SdavidxuBOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
240152297Sdavidxu
241152297Sdavidxu# Setup smart javac (after cores and memory have been setup)
242152570SruBPERF_SETUP_SMART_JAVAC
243152297Sdavidxu
244152297Sdavidxu# Can the C/C++ compiler use precompiled headers?
245152297SdavidxuBPERF_SETUP_PRECOMPILED_HEADERS
246152297Sdavidxu
247152297Sdavidxu# Setup use of ccache, if available
248152297SdavidxuBPERF_SETUP_CCACHE
249152297Sdavidxu
250152570Sru###############################################################################
251153376Sdavidxu#
252153376Sdavidxu# And now the finish...
253152297Sdavidxu#
254152297Sdavidxu###############################################################################
255152297Sdavidxu
256152297Sdavidxu# Check for some common pitfalls
257152297SdavidxuBASIC_TEST_USABILITY_ISSUES
258152297Sdavidxu
259152570Sru# At the end, call the custom hook. (Dummy macro if no custom sources available)
260235140SgjbCUSTOM_LATE_HOOK
261152944Sdavidxu
262162385Sru# We're messing a bit with internal autoconf variables to put the config.status
263162385Sru# in the output directory instead of the current directory.
264162385SruCONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
265152944Sdavidxu
266# Create the actual output files. Now the main work of configure is done.
267AC_OUTPUT
268
269# After AC_OUTPUT, we need to do final work
270CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
271BASIC_POST_CONFIG_OUTPUT
272
273# Finally output some useful information to the user
274HELP_PRINT_SUMMARY_AND_WARNINGS
275CUSTOM_SUMMARY_AND_WARNINGS_HOOK
276HELP_REPEAT_WARNINGS
277