common/autoconf/configure.ac

Mon, 16 Oct 2017 15:57:35 +0800

author
aoqi
date
Mon, 16 Oct 2017 15:57:35 +0800
changeset 1482
8fb429038513
parent 1320
045eace96e6d
parent 1133
50aaf272884f
child 2161
e50b76885c16
permissions
-rw-r--r--

merge

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

mercurial