common/autoconf/configure.ac

Mon, 14 Sep 2020 16:42:03 +0100

author
andrew
date
Mon, 14 Sep 2020 16:42:03 +0100
changeset 2554
7f60c2d9823e
parent 2400
9da665f87c4b
child 2408
2e38e8d106de
permissions
-rw-r--r--

Added tag jdk8u272-b08 for changeset 34c6baf21464

ohair@425 1 #
kevinw@2206 2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
ohair@425 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@425 4 #
ohair@425 5 # This code is free software; you can redistribute it and/or modify it
ohair@425 6 # under the terms of the GNU General Public License version 2 only, as
ohair@425 7 # published by the Free Software Foundation. Oracle designates this
ohair@425 8 # particular file as subject to the "Classpath" exception as provided
ohair@425 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@425 10 #
ohair@425 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@425 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@425 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@425 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@425 15 # accompanied this code).
ohair@425 16 #
ohair@425 17 # You should have received a copy of the GNU General Public License version
ohair@425 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@425 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@425 20 #
ohair@425 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@425 22 # or visit www.oracle.com if you need additional information or have any
ohair@425 23 # questions.
ohair@425 24 #
ohair@425 25
erikj@458 26 ###############################################################################
erikj@458 27 #
erikj@458 28 # Includes and boilerplate
erikj@458 29 #
erikj@458 30 ###############################################################################
erikj@458 31
erikj@458 32
erikj@783 33 AC_PREREQ([2.69])
ohair@494 34 AC_INIT(OpenJDK, jdk8, build-dev@openjdk.java.net,,http://openjdk.java.net)
ohair@425 35
kevinw@2213 36 AC_CONFIG_AUX_DIR([$TOPDIR/common/autoconf/build-aux])
erikj@458 37 m4_include([build-aux/pkg.m4])
ohair@425 38
erikj@458 39 # Include these first...
erikj@458 40 m4_include([basics.m4])
ohair@494 41 m4_include([basics_windows.m4])
ohair@425 42 m4_include([builddeps.m4])
erikj@458 43 # ... then the rest
erikj@458 44 m4_include([boot-jdk.m4])
erikj@458 45 m4_include([build-performance.m4])
kevinw@2206 46 m4_include([flags.m4])
erikj@458 47 m4_include([help.m4])
erikj@458 48 m4_include([jdk-options.m4])
erikj@458 49 m4_include([libraries.m4])
ohair@425 50 m4_include([platform.m4])
erikj@458 51 m4_include([source-dirs.m4])
erikj@458 52 m4_include([toolchain.m4])
ohair@494 53 m4_include([toolchain_windows.m4])
ohair@425 54
ohair@494 55 AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
ohair@494 56 AC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
ihse@1320 57 AC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
ohair@494 58
ohair@494 59 # This line needs to be here, verbatim, after all includes and the dummy hook
ohair@494 60 # definitions. It is replaced with custom functionality when building
ohair@478 61 # custom sources.
ohair@494 62 #CUSTOM_AUTOCONF_INCLUDE
ohair@494 63
ohair@494 64 # Do not change or remove the following line, it is needed for consistency checks:
ohair@494 65 DATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@
ohair@425 66
ohair@425 67 ###############################################################################
ohair@425 68 #
ohair@494 69 # Initialization / Boot-strapping
ohair@494 70 #
ohair@494 71 # The bootstrapping process needs to solve the "chicken or the egg" problem,
ohair@494 72 # thus it jumps back and forth, each time gaining something needed later on.
ohair@425 73 #
erikj@458 74 ###############################################################################
ohair@425 75
kevinw@2206 76 # If we are requested to print additional help, do that and then exit.
kevinw@2206 77 # This must be the very first call.
kevinw@2206 78 HELP_PRINT_ADDITIONAL_HELP_AND_EXIT
kevinw@2206 79
kevinw@2206 80 # Basic initialization that must happen first of all in the normal process.
erikj@458 81 BASIC_INIT
ohair@494 82 BASIC_SETUP_FUNDAMENTAL_TOOLS
ohair@478 83
ohair@478 84 # Now we can determine OpenJDK build and target platforms. This is required to
ohair@478 85 # have early on.
ohair@478 86 PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
ohair@478 87
ohair@494 88 # Continue setting up basic stuff. Most remaining code require fundamental tools.
erikj@458 89 BASIC_SETUP_PATHS
erikj@458 90 BASIC_SETUP_LOGGING
ohair@425 91
erikj@575 92 # Check if it's a pure open build or if custom sources are to be used.
erikj@575 93 JDKOPT_SETUP_OPEN_OR_CUSTOM
erikj@575 94
ohair@494 95 # These are needed to be able to create a configuration name (and thus the output directory)
ohair@494 96 JDKOPT_SETUP_JDK_VARIANT
simonis@965 97 JDKOPT_SETUP_JVM_INTERPRETER
ohair@494 98 JDKOPT_SETUP_JVM_VARIANTS
ohair@494 99 JDKOPT_SETUP_DEBUG_LEVEL
ohair@494 100
ohair@494 101 # With basic setup done, call the custom early hook.
ohair@494 102 CUSTOM_EARLY_HOOK
ohair@494 103
kevinw@2215 104 # Check if we have devkits, extra paths or sysroot set.
kevinw@2215 105 BASIC_SETUP_DEVKIT
kevinw@2215 106
ohair@494 107 # To properly create a configuration name, we need to have the OpenJDK target
ohair@494 108 # and options (variants and debug level) parsed.
ohair@494 109 BASIC_SETUP_OUTPUT_DIR
ohair@494 110
erikj@458 111 # Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
erikj@458 112 HELP_SETUP_DEPENDENCY_HELP
ohair@425 113
ohair@494 114 # Setup tools that requires more complex handling, or that is not needed by the configure script.
ohair@494 115 BASIC_SETUP_COMPLEX_TOOLS
ohair@425 116
ohair@478 117 # Check if pkg-config is available.
ohair@478 118 PKG_PROG_PKG_CONFIG
ohair@478 119
ohair@478 120 # After basic tools have been setup, we can check build os specific details.
ohair@478 121 PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
ohair@478 122
erikj@458 123 # Setup builddeps, for automatic downloading of tools we need.
erikj@458 124 # This is needed before we can call BDEPS_CHECK_MODULE, which is done in
erikj@458 125 # boot-jdk setup, but we need to have basic tools setup first.
erikj@458 126 BDEPS_CONFIGURE_BUILDDEPS
erikj@458 127 BDEPS_SCAN_FOR_BUILDDEPS
ohair@425 128
ohair@425 129 ###############################################################################
ohair@425 130 #
erikj@458 131 # Determine OpenJDK variants, options and version numbers.
ohair@425 132 #
erikj@458 133 ###############################################################################
ohair@425 134
erikj@458 135 # We need build & target for this.
erikj@458 136 JDKOPT_SETUP_JDK_OPTIONS
erikj@458 137 JDKOPT_SETUP_JDK_VERSION_NUMBERS
ohair@425 138
ohair@425 139 ###############################################################################
ohair@425 140 #
erikj@458 141 # Setup BootJDK, used to bootstrap the build.
ohair@425 142 #
erikj@458 143 ###############################################################################
erikj@445 144
erikj@458 145 BOOTJDK_SETUP_BOOT_JDK
erikj@458 146 BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
ohair@425 147
ohair@425 148 ###############################################################################
ohair@425 149 #
erikj@458 150 # Configure the sources to use. We can add or override individual directories.
ohair@425 151 #
erikj@458 152 ###############################################################################
ohair@425 153
erikj@458 154 SRCDIRS_SETUP_TOPDIRS
erikj@458 155 SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
erikj@458 156 SRCDIRS_SETUP_OUTPUT_DIRS
ohair@425 157
ohair@425 158 ###############################################################################
ohair@425 159 #
kevinw@2206 160 # Setup the toolchain (compilers etc), i.e. tools used to compile and process
kevinw@2206 161 # native code.
ohair@425 162 #
erikj@458 163 ###############################################################################
ohair@425 164
kevinw@2206 165 # First determine the toolchain type (compiler family)
kevinw@2206 166 TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
ohair@425 167
kevinw@2206 168 # Then detect the actual binaries needed
kevinw@2206 169 TOOLCHAIN_PRE_DETECTION
kevinw@2206 170 TOOLCHAIN_DETECT_TOOLCHAIN_CORE
kevinw@2206 171 TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA
kevinw@2206 172 TOOLCHAIN_POST_DETECTION
ohair@425 173
kevinw@2206 174 # Finally do some processing after the detection phase
kevinw@2206 175 TOOLCHAIN_SETUP_BUILD_COMPILERS
kevinw@2206 176 TOOLCHAIN_SETUP_LEGACY
kevinw@2206 177 TOOLCHAIN_MISC_CHECKS
kevinw@2206 178
kevinw@2206 179 # Setup the JTReg Regression Test Harness.
kevinw@2206 180 TOOLCHAIN_SETUP_JTREG
kevinw@2206 181
kevinw@2206 182 FLAGS_SETUP_INIT_FLAGS
kevinw@2206 183
kevinw@2206 184 # FIXME: Currently we must test this after toolchain but before flags. Fix!
kevinw@2206 185
kevinw@2206 186 # Now we can test some aspects on the target using configure macros.
ohair@478 187 PLATFORM_SETUP_OPENJDK_TARGET_BITS
erikj@458 188 PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
ohair@425 189
erikj@458 190 # Configure flags for the tools
kevinw@2206 191 FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS
kevinw@2206 192 FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
kevinw@2206 193 FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK
kevinw@2206 194 FLAGS_SETUP_COMPILER_FLAGS_MISC
erikj@458 195
erikj@458 196 # Setup debug symbols (need objcopy from the toolchain for that)
erikj@458 197 JDKOPT_SETUP_DEBUG_SYMBOLS
ohair@425 198
ohair@425 199 ###############################################################################
ohair@425 200 #
erikj@458 201 # Check dependencies for external and internal libraries.
ohair@425 202 #
erikj@458 203 ###############################################################################
ohair@425 204
ihse@868 205 # After we have toolchain, we can compile fixpath. It's needed by the lib checks.
ihse@868 206 BASIC_COMPILE_FIXPATH
ihse@868 207
erikj@458 208 LIB_SETUP_INIT
erikj@458 209 LIB_SETUP_X11
erikj@458 210 LIB_SETUP_CUPS
erikj@458 211 LIB_SETUP_FREETYPE
erikj@458 212 LIB_SETUP_ALSA
prr@2400 213 LIB_SETUP_FONTCONFIG
erikj@458 214 LIB_SETUP_MISC_LIBS
erikj@458 215 LIB_SETUP_STATIC_LINK_LIBSTDCPP
kevinw@2206 216 LIB_SETUP_ON_WINDOWS
ohair@494 217
ohair@425 218 ###############################################################################
ohair@425 219 #
erikj@458 220 # We need to do some final tweaking, when everything else is done.
ohair@425 221 #
erikj@458 222 ###############################################################################
ohair@425 223
erikj@458 224 JDKOPT_SETUP_BUILD_TWEAKS
omajid@656 225 JDKOPT_DETECT_INTREE_EC
erikj@445 226
ohair@425 227 ###############################################################################
ohair@425 228 #
erikj@458 229 # Configure parts of the build that only affect the build performance,
erikj@458 230 # not the result.
ohair@425 231 #
erikj@458 232 ###############################################################################
ohair@425 233
erikj@458 234 BPERF_SETUP_BUILD_CORES
erikj@458 235 BPERF_SETUP_BUILD_MEMORY
erikj@635 236 BPERF_SETUP_BUILD_JOBS
ohair@425 237
erikj@458 238 # Setup smart javac (after cores and memory have been setup)
erikj@458 239 BPERF_SETUP_SMART_JAVAC
ohair@425 240
erikj@458 241 # Can the C/C++ compiler use precompiled headers?
erikj@458 242 BPERF_SETUP_PRECOMPILED_HEADERS
ohair@425 243
erikj@458 244 # Setup use of ccache, if available
erikj@458 245 BPERF_SETUP_CCACHE
ohair@425 246
ohair@425 247 ###############################################################################
ohair@425 248 #
erikj@458 249 # And now the finish...
ohair@425 250 #
ohair@425 251 ###############################################################################
erikj@445 252
erikj@458 253 # Check for some common pitfalls
erikj@458 254 BASIC_TEST_USABILITY_ISSUES
erikj@445 255
ohair@478 256 # At the end, call the custom hook. (Dummy macro if no custom sources available)
ohair@494 257 CUSTOM_LATE_HOOK
ohair@425 258
erikj@458 259 # We're messing a bit with internal autoconf variables to put the config.status
erikj@458 260 # in the output directory instead of the current directory.
erikj@458 261 CONFIG_STATUS="$OUTPUT_ROOT/config.status"
ihse@797 262
erikj@458 263 # Create the actual output files. Now the main work of configure is done.
erikj@445 264 AC_OUTPUT
ihse@1320 265 CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
erikj@445 266
ihse@839 267 # Try to move the config.log file to the output directory.
ihse@797 268 if test -e ./config.log; then
ihse@797 269 $MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null
ihse@797 270 fi
ihse@797 271
ohair@478 272 # Make the compare script executable
ohair@478 273 $CHMOD +x $OUTPUT_ROOT/compare.sh
ohair@478 274
erikj@445 275 # Finally output some useful information to the user
erikj@458 276 HELP_PRINT_SUMMARY_AND_WARNINGS

mercurial