aoqi@0: # aoqi@0: # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: # aoqi@0: # This code is free software; you can redistribute it and/or modify it aoqi@0: # under the terms of the GNU General Public License version 2 only, as aoqi@0: # published by the Free Software Foundation. Oracle designates this aoqi@0: # particular file as subject to the "Classpath" exception as provided aoqi@0: # by Oracle in the LICENSE file that accompanied this code. aoqi@0: # aoqi@0: # This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: # version 2 for more details (a copy is included in the LICENSE file that aoqi@0: # accompanied this code). aoqi@0: # aoqi@0: # You should have received a copy of the GNU General Public License version aoqi@0: # 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: # aoqi@0: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: # or visit www.oracle.com if you need additional information or have any aoqi@0: # questions. aoqi@0: # aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Includes and boilerplate aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: aoqi@0: AC_PREREQ([2.69]) aoqi@0: AC_INIT(OpenJDK, jdk8, build-dev@openjdk.java.net,,http://openjdk.java.net) aoqi@0: aoqi@0: AC_CONFIG_AUX_DIR([build-aux]) aoqi@0: m4_include([build-aux/pkg.m4]) aoqi@0: aoqi@0: # Include these first... aoqi@0: m4_include([basics.m4]) aoqi@0: m4_include([basics_windows.m4]) aoqi@0: m4_include([builddeps.m4]) aoqi@0: # ... then the rest aoqi@0: m4_include([boot-jdk.m4]) aoqi@0: m4_include([build-performance.m4]) aoqi@0: m4_include([help.m4]) aoqi@0: m4_include([jdk-options.m4]) aoqi@0: m4_include([libraries.m4]) aoqi@0: m4_include([platform.m4]) aoqi@0: m4_include([source-dirs.m4]) aoqi@0: m4_include([toolchain.m4]) aoqi@0: m4_include([toolchain_windows.m4]) aoqi@0: aoqi@0: AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK]) aoqi@0: AC_DEFUN_ONCE([CUSTOM_LATE_HOOK]) aoqi@0: aoqi@0: # This line needs to be here, verbatim, after all includes and the dummy hook aoqi@0: # definitions. It is replaced with custom functionality when building aoqi@0: # custom sources. aoqi@0: #CUSTOM_AUTOCONF_INCLUDE aoqi@0: aoqi@0: # Do not change or remove the following line, it is needed for consistency checks: aoqi@0: DATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@ aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Initialization / Boot-strapping aoqi@0: # aoqi@0: # The bootstrapping process needs to solve the "chicken or the egg" problem, aoqi@0: # thus it jumps back and forth, each time gaining something needed later on. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: # Basic initialization that must happen first of all aoqi@0: BASIC_INIT aoqi@0: BASIC_SETUP_FUNDAMENTAL_TOOLS aoqi@0: aoqi@0: # Now we can determine OpenJDK build and target platforms. This is required to aoqi@0: # have early on. aoqi@0: PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET aoqi@0: aoqi@0: # Continue setting up basic stuff. Most remaining code require fundamental tools. aoqi@0: BASIC_SETUP_PATHS aoqi@0: BASIC_SETUP_LOGGING aoqi@0: aoqi@0: # Check if it's a pure open build or if custom sources are to be used. aoqi@0: JDKOPT_SETUP_OPEN_OR_CUSTOM aoqi@0: aoqi@0: # These are needed to be able to create a configuration name (and thus the output directory) aoqi@0: JDKOPT_SETUP_JDK_VARIANT aoqi@0: JDKOPT_SETUP_JVM_INTERPRETER aoqi@0: JDKOPT_SETUP_JVM_VARIANTS aoqi@0: JDKOPT_SETUP_DEBUG_LEVEL aoqi@0: aoqi@0: # With basic setup done, call the custom early hook. aoqi@0: CUSTOM_EARLY_HOOK aoqi@0: aoqi@0: # To properly create a configuration name, we need to have the OpenJDK target aoqi@0: # and options (variants and debug level) parsed. aoqi@0: BASIC_SETUP_OUTPUT_DIR aoqi@0: aoqi@0: # Must be done before we can call HELP_MSG_MISSING_DEPENDENCY. aoqi@0: HELP_SETUP_DEPENDENCY_HELP aoqi@0: aoqi@0: # Setup tools that requires more complex handling, or that is not needed by the configure script. aoqi@0: BASIC_SETUP_COMPLEX_TOOLS aoqi@0: aoqi@0: # Check if pkg-config is available. aoqi@0: PKG_PROG_PKG_CONFIG aoqi@0: aoqi@0: # After basic tools have been setup, we can check build os specific details. aoqi@0: PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION aoqi@0: aoqi@0: # Setup builddeps, for automatic downloading of tools we need. aoqi@0: # This is needed before we can call BDEPS_CHECK_MODULE, which is done in aoqi@0: # boot-jdk setup, but we need to have basic tools setup first. aoqi@0: BDEPS_CONFIGURE_BUILDDEPS aoqi@0: BDEPS_SCAN_FOR_BUILDDEPS aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Determine OpenJDK variants, options and version numbers. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: # We need build & target for this. aoqi@0: JDKOPT_SETUP_JDK_OPTIONS aoqi@0: JDKOPT_SETUP_JDK_VERSION_NUMBERS aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Setup BootJDK, used to bootstrap the build. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: BOOTJDK_SETUP_BOOT_JDK aoqi@0: BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Configure the sources to use. We can add or override individual directories. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: SRCDIRS_SETUP_TOPDIRS aoqi@0: SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS aoqi@0: SRCDIRS_SETUP_OUTPUT_DIRS aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Setup the toolchain (compilers etc), i.e. the tools that need to be aoqi@0: # cross-compilation aware. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS aoqi@0: # Locate the actual tools aoqi@0: TOOLCHAIN_SETUP_PATHS aoqi@0: aoqi@0: # FIXME: Currently we must test this after paths but before flags. Fix! aoqi@0: aoqi@0: # And we can test some aspects on the target using configure macros. aoqi@0: PLATFORM_SETUP_OPENJDK_TARGET_BITS aoqi@0: PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS aoqi@0: aoqi@0: # Configure flags for the tools aoqi@0: TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS aoqi@0: TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION aoqi@0: TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK aoqi@0: TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC aoqi@0: aoqi@0: # Setup debug symbols (need objcopy from the toolchain for that) aoqi@0: JDKOPT_SETUP_DEBUG_SYMBOLS aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Check dependencies for external and internal libraries. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: # After we have toolchain, we can compile fixpath. It's needed by the lib checks. aoqi@0: BASIC_COMPILE_FIXPATH aoqi@0: aoqi@0: LIB_SETUP_INIT aoqi@0: LIB_SETUP_X11 aoqi@0: LIB_SETUP_CUPS aoqi@0: LIB_SETUP_FREETYPE aoqi@0: LIB_SETUP_ALSA aoqi@0: LIB_SETUP_MISC_LIBS aoqi@0: LIB_SETUP_STATIC_LINK_LIBSTDCPP aoqi@0: aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # We need to do some final tweaking, when everything else is done. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: JDKOPT_SETUP_BUILD_TWEAKS aoqi@0: JDKOPT_DETECT_INTREE_EC aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # Configure parts of the build that only affect the build performance, aoqi@0: # not the result. aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: BPERF_SETUP_BUILD_CORES aoqi@0: BPERF_SETUP_BUILD_MEMORY aoqi@0: BPERF_SETUP_BUILD_JOBS aoqi@0: aoqi@0: # Setup smart javac (after cores and memory have been setup) aoqi@0: BPERF_SETUP_SMART_JAVAC aoqi@0: aoqi@0: # Can the C/C++ compiler use precompiled headers? aoqi@0: BPERF_SETUP_PRECOMPILED_HEADERS aoqi@0: aoqi@0: # Setup use of ccache, if available aoqi@0: BPERF_SETUP_CCACHE aoqi@0: aoqi@0: ############################################################################### aoqi@0: # aoqi@0: # And now the finish... aoqi@0: # aoqi@0: ############################################################################### aoqi@0: aoqi@0: # Check for some common pitfalls aoqi@0: BASIC_TEST_USABILITY_ISSUES aoqi@0: aoqi@0: # At the end, call the custom hook. (Dummy macro if no custom sources available) aoqi@0: CUSTOM_LATE_HOOK aoqi@0: aoqi@0: # We're messing a bit with internal autoconf variables to put the config.status aoqi@0: # in the output directory instead of the current directory. aoqi@0: CONFIG_STATUS="$OUTPUT_ROOT/config.status" aoqi@0: aoqi@0: # Create the actual output files. Now the main work of configure is done. aoqi@0: AC_OUTPUT aoqi@0: aoqi@0: # Try to move the config.log file to the output directory. aoqi@0: if test -e ./config.log; then aoqi@0: $MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null aoqi@0: fi aoqi@0: aoqi@0: # Make the compare script executable aoqi@0: $CHMOD +x $OUTPUT_ROOT/compare.sh aoqi@0: aoqi@0: # Finally output some useful information to the user aoqi@0: HELP_PRINT_SUMMARY_AND_WARNINGS