configure.ac revision 696:e404d321abc6
1296633Sdes#
260573Skris# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
392555Sdes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
460573Skris#
560573Skris# This code is free software; you can redistribute it and/or modify it
660573Skris# under the terms of the GNU General Public License version 2 only, as
760573Skris# published by the Free Software Foundation.  Oracle designates this
860573Skris# particular file as subject to the "Classpath" exception as provided
960573Skris# by Oracle in the LICENSE file that accompanied this code.
1060573Skris#
1160573Skris# This code is distributed in the hope that it will be useful, but WITHOUT
1260573Skris# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1360573Skris# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1460573Skris# version 2 for more details (a copy is included in the LICENSE file that
1560573Skris# accompanied this code).
1660573Skris#
1760573Skris# You should have received a copy of the GNU General Public License version
1860573Skris# 2 along with this work; if not, write to the Free Software Foundation,
1960573Skris# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2060573Skris#
2160573Skris# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2260573Skris# or visit www.oracle.com if you need additional information or have any
2360573Skris# questions.
2460573Skris#
2560573Skris
2660573Skris###############################################################################
2760573Skris#
28294332Sdes# Includes and boilerplate
29162852Sdes#
30162852Sdes###############################################################################
31162852Sdes
32162852Sdes
33162852SdesAC_PREREQ([2.61])
34162852SdesAC_INIT(OpenJDK, jdk8, build-dev@openjdk.java.net,,http://openjdk.java.net)
35162852Sdes
36294328SdesAC_CONFIG_AUX_DIR([build-aux])
3776259Sgreenm4_include([build-aux/pkg.m4])
38294328Sdes
3976259Sgreen# Include these first...
4060573Skrism4_include([basics.m4])
4161209Skrism4_include([basics_windows.m4])
4260573Skrism4_include([builddeps.m4])
4376259Sgreen# ... then the rest
44294332Sdesm4_include([boot-jdk.m4])
4560573Skrism4_include([build-performance.m4])
4676259Sgreenm4_include([help.m4])
4776259Sgreenm4_include([jdk-options.m4])
4876259Sgreenm4_include([libraries.m4])
49294332Sdesm4_include([platform.m4])
5076259Sgreenm4_include([source-dirs.m4])
5198675Sdesm4_include([toolchain.m4])
52294332Sdesm4_include([toolchain_windows.m4])
53294332Sdes
54294332SdesAC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
55261320SdesAC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
5660573Skris
57162852Sdes# This line needs to be here, verbatim, after all includes and the dummy hook
58162852Sdes# definitions. It is replaced with custom functionality when building
59162852Sdes# custom sources.
60162852Sdes#CUSTOM_AUTOCONF_INCLUDE
61162852Sdes
62162852Sdes# Do not change or remove the following line, it is needed for consistency checks:
63162852SdesDATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@
64162852Sdes
6592555Sdes###############################################################################
66294332Sdes#
67294332Sdes# Initialization / Boot-strapping
6876259Sgreen#
69296633Sdes# The bootstrapping process needs to solve the "chicken or the egg" problem,
70296633Sdes# thus it jumps back and forth, each time gaining something needed later on.
71296633Sdes#
72296633Sdes###############################################################################
73296633Sdes
74296633Sdes# Basic initialization that must happen first of all
75296633SdesBASIC_INIT
76296633SdesBASIC_SETUP_FUNDAMENTAL_TOOLS
77296633Sdes
78296633Sdes# Now we can determine OpenJDK build and target platforms. This is required to
79296633Sdes# have early on.
80296633SdesPLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
81296633Sdes
82255767Sdes# Continue setting up basic stuff. Most remaining code require fundamental tools.
83255767SdesBASIC_SETUP_PATHS
84294332SdesBASIC_SETUP_LOGGING
85255767Sdes
86261320Sdes# Check if it's a pure open build or if custom sources are to be used.
87255767SdesJDKOPT_SETUP_OPEN_OR_CUSTOM
88255767Sdes
89294328Sdes# These are needed to be able to create a configuration name (and thus the output directory)
90261320SdesJDKOPT_SETUP_JDK_VARIANT
91261320SdesJDKOPT_SETUP_JVM_VARIANTS
92261320SdesJDKOPT_SETUP_DEBUG_LEVEL
93255767Sdes
94261320Sdes# With basic setup done, call the custom early hook.
95294328SdesCUSTOM_EARLY_HOOK
96255767Sdes
97261320Sdes# To properly create a configuration name, we need to have the OpenJDK target
98261320Sdes# and options (variants and debug level) parsed.
99261320SdesBASIC_SETUP_OUTPUT_DIR
100261320Sdes
101261320Sdes# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
102261320SdesHELP_SETUP_DEPENDENCY_HELP
103261320Sdes
104294328Sdes# Setup tools that requires more complex handling, or that is not needed by the configure script.
105294328SdesBASIC_SETUP_COMPLEX_TOOLS
106294328Sdes
107294332Sdes# Check if pkg-config is available.
108261320SdesPKG_PROG_PKG_CONFIG
109294332Sdes
110261320Sdes# After basic tools have been setup, we can check build os specific details.
111255767SdesPLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
112255767Sdes
113255767Sdes# Setup builddeps, for automatic downloading of tools we need.
114261320Sdes# This is needed before we can call BDEPS_CHECK_MODULE, which is done in
115255767Sdes# boot-jdk setup, but we need to have basic tools setup first.
116294332SdesBDEPS_CONFIGURE_BUILDDEPS
117255767SdesBDEPS_SCAN_FOR_BUILDDEPS
118255767Sdes
119255767Sdes###############################################################################
120255767Sdes#
121255767Sdes# Determine OpenJDK variants, options and version numbers.
122261320Sdes#
123255767Sdes###############################################################################
124294332Sdes
125294332Sdes# We need build & target for this.
126294332SdesJDKOPT_SETUP_JDK_OPTIONS
127294332SdesJDKOPT_SETUP_JDK_VERSION_NUMBERS
128294332Sdes
129255767Sdes###############################################################################
130255767Sdes#
131255767Sdes# Setup BootJDK, used to bootstrap the build.
132255767Sdes#
133255767Sdes###############################################################################
134255767Sdes
135255767SdesBOOTJDK_SETUP_BOOT_JDK
136255767SdesBOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
137255767Sdes
138255767Sdes###############################################################################
139255767Sdes#
140255767Sdes# Configure the sources to use. We can add or override individual directories.
141255767Sdes#
142255767Sdes###############################################################################
143255767Sdes
144255767SdesSRCDIRS_SETUP_TOPDIRS
145255767SdesSRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
146255767SdesSRCDIRS_SETUP_OUTPUT_DIRS
147221420Sdes
148221420Sdes###############################################################################
149221420Sdes#
150221420Sdes# Setup the toolchain (compilers etc), i.e. the tools that need to be
151221420Sdes# cross-compilation aware.
152221420Sdes#
153221420Sdes###############################################################################
154221420Sdes
155294332SdesTOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS
156294332Sdes# Locate the actual tools
157221420SdesTOOLCHAIN_SETUP_PATHS
158221420Sdes
159255767Sdes# FIXME: Currently we must test this after paths but before flags. Fix!
160221420Sdes
161255767Sdes# And we can test some aspects on the target using configure macros.
162221420SdesPLATFORM_SETUP_OPENJDK_TARGET_BITS
163221420SdesPLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
164221420Sdes
165221420Sdes# Configure flags for the tools
166255767SdesTOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS
167221420SdesTOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
168221420SdesTOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK
169221420SdesTOOLCHAIN_SETUP_COMPILER_FLAGS_MISC
170294464Sdes
171294464Sdes# Setup debug symbols (need objcopy from the toolchain for that)
172294464SdesJDKOPT_SETUP_DEBUG_SYMBOLS
173294464Sdes
174294464Sdes###############################################################################
175294464Sdes#
176294464Sdes# Check dependencies for external and internal libraries.
177294464Sdes#
178294464Sdes###############################################################################
179294464Sdes
180294464SdesLIB_SETUP_INIT
181294464SdesLIB_SETUP_X11
182294464SdesLIB_SETUP_CUPS
183294464SdesLIB_SETUP_FREETYPE
184294464SdesLIB_SETUP_ALSA
185294464SdesLIB_SETUP_MISC_LIBS
186294464SdesLIB_SETUP_STATIC_LINK_LIBSTDCPP
187294464Sdes
188294464Sdes# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper
189294464SdesBASIC_COMPILE_FIXPATH
190294464Sdes
191294464Sdes###############################################################################
192294464Sdes#
193294464Sdes# We need to do some final tweaking, when everything else is done.
194294464Sdes#
195294464Sdes###############################################################################
196294464Sdes
197294464SdesJDKOPT_SETUP_BUILD_TWEAKS
198294464SdesJDKOPT_DETECT_INTREE_EC
199294464Sdes
200294464Sdes###############################################################################
201294464Sdes#
202294464Sdes# Configure parts of the build that only affect the build performance,
203294464Sdes# not the result.
204294464Sdes#
205294464Sdes###############################################################################
206294464Sdes
207294464SdesBPERF_SETUP_BUILD_CORES
208294464SdesBPERF_SETUP_BUILD_MEMORY
209294464SdesBPERF_SETUP_BUILD_JOBS
210294464Sdes
211294464Sdes# Setup smart javac (after cores and memory have been setup)
212294464SdesBPERF_SETUP_SMART_JAVAC
213294464Sdes
214294464Sdes# Can the C/C++ compiler use precompiled headers?
215294464SdesBPERF_SETUP_PRECOMPILED_HEADERS
216294464Sdes
217294464Sdes# Setup use of ccache, if available
218294464SdesBPERF_SETUP_CCACHE
219294464Sdes
220294464Sdes###############################################################################
221294464Sdes#
222294464Sdes# And now the finish...
223294464Sdes#
224294464Sdes###############################################################################
225294464Sdes
226294464Sdes# Check for some common pitfalls
227294464SdesBASIC_TEST_USABILITY_ISSUES
228294464Sdes
229294464Sdes# At the end, call the custom hook. (Dummy macro if no custom sources available)
230294464SdesCUSTOM_LATE_HOOK
231294464Sdes
232291198Sdes# We're messing a bit with internal autoconf variables to put the config.status
233294332Sdes# in the output directory instead of the current directory.
234294332SdesCONFIG_STATUS="$OUTPUT_ROOT/config.status"
23560573Skris# Create the actual output files. Now the main work of configure is done.
236149749SdesAC_OUTPUT
237294332Sdes
23876259Sgreen# Make the compare script executable
239294332Sdes$CHMOD +x $OUTPUT_ROOT/compare.sh
240294332Sdes
24198675Sdes# Finally output some useful information to the user
24298675SdesHELP_PRINT_SUMMARY_AND_WARNINGS
24398675Sdes