common/autoconf/configure.ac

Wed, 03 Jul 2019 20:37:44 +0800

author
aoqi
date
Wed, 03 Jul 2019 20:37:44 +0800
changeset 2408
2e38e8d106de
parent 2316
64a3eeabf6e5
parent 2400
9da665f87c4b
permissions
-rw-r--r--

Merge

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

mercurial