common/autoconf/configure.ac

Thu, 31 Aug 2017 15:40:18 +0800

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

mercurial