common/autoconf/configure.ac

Tue, 24 Jul 2018 13:19:47 +0800

author
aoqi
date
Tue, 24 Jul 2018 13:19:47 +0800
changeset 2161
e50b76885c16
parent 1482
8fb429038513
child 2316
64a3eeabf6e5
permissions
-rw-r--r--

#6580 added Loongson release info to java -version output
Summary: info includes Loongson OpenJDK version, host name and build OS name
Reviewed-by: zhaixiang

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

mercurial