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