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