common/autoconf/configure.ac

Tue, 03 Jul 2012 16:11:12 -0700

author
erikj
date
Tue, 03 Jul 2012 16:11:12 -0700
changeset 458
c8d320b48626
parent 445
efd26e051e50
child 478
2ba6f4da4bf3
permissions
-rw-r--r--

7181504: Update of latest build-infra Makefiles
Reviewed-by: ohair

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])
erikj@458 34 AC_INIT(openjdk, jdk8, build-dev@openjdk.java.net)
erikj@458 35
erikj@458 36 # Do not change or remove the following line, it is needed for consistency checks:
erikj@458 37 # DATE_WHEN_GENERATED: @DATE_WHEN_GENERATED@
ohair@425 38
ohair@425 39 AC_CONFIG_AUX_DIR([build-aux])
erikj@458 40 m4_include([build-aux/pkg.m4])
ohair@425 41
erikj@458 42 # Include these first...
erikj@458 43 m4_include([basics.m4])
ohair@425 44 m4_include([builddeps.m4])
erikj@458 45 # ... then the rest
erikj@458 46 m4_include([boot-jdk.m4])
erikj@458 47 m4_include([build-performance.m4])
erikj@458 48 m4_include([help.m4])
erikj@458 49 m4_include([jdk-options.m4])
erikj@458 50 m4_include([libraries.m4])
ohair@425 51 m4_include([platform.m4])
erikj@458 52 m4_include([source-dirs.m4])
erikj@458 53 m4_include([toolchain.m4])
ohair@425 54
erikj@458 55 # This line needs to be here, verbatim, after all includes.
erikj@458 56 # It is replaced with closed functionality when building
erikj@458 57 # closed sources.
erikj@458 58 AC_DEFUN_ONCE([CLOSED_HOOK])
ohair@425 59
ohair@425 60 ###############################################################################
ohair@425 61 #
erikj@458 62 # Initialization
ohair@425 63 #
erikj@458 64 ###############################################################################
ohair@425 65
erikj@458 66 # Basic initialization that must happen first of all
erikj@458 67 BASIC_INIT
erikj@458 68 BASIC_SETUP_PATHS
erikj@458 69 BASIC_SETUP_LOGGING
ohair@425 70
erikj@458 71 # Must be done before we can call HELP_MSG_MISSING_DEPENDENCY.
erikj@458 72 HELP_SETUP_DEPENDENCY_HELP
ohair@425 73
erikj@458 74 # Setup simple tools, that do not need have cross compilation support.
erikj@458 75 # Without these, we can't properly run the rest of the configure script.
erikj@458 76 BASIC_SETUP_TOOLS
ohair@425 77
erikj@458 78 # Setup builddeps, for automatic downloading of tools we need.
erikj@458 79 # This is needed before we can call BDEPS_CHECK_MODULE, which is done in
erikj@458 80 # boot-jdk setup, but we need to have basic tools setup first.
erikj@458 81 BDEPS_CONFIGURE_BUILDDEPS
erikj@458 82 BDEPS_SCAN_FOR_BUILDDEPS
ohair@425 83
ohair@425 84 # Check if pkg-config is available.
ohair@425 85 PKG_PROG_PKG_CONFIG
ohair@425 86
erikj@458 87 ###############################################################################
erikj@458 88 #
erikj@458 89 # Determine OpenJDK build and target platforms.
erikj@458 90 #
erikj@458 91 ###############################################################################
ohair@425 92
erikj@458 93 PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
erikj@458 94 PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
ohair@425 95
erikj@458 96 # With knowledge of the build platform, setup more basic things.
erikj@458 97 BASIC_SETUP_PATH_SEP
erikj@458 98 BASIC_SETUP_SEARCHPATH
ohair@425 99
ohair@425 100 ###############################################################################
ohair@425 101 #
erikj@458 102 # Determine OpenJDK variants, options and version numbers.
ohair@425 103 #
erikj@458 104 ###############################################################################
ohair@425 105
erikj@458 106 # We need build & target for this.
erikj@458 107 JDKOPT_SETUP_JDK_VARIANT
erikj@458 108 JDKOPT_SETUP_JVM_VARIANTS
erikj@458 109 JDKOPT_SETUP_DEBUG_LEVEL
erikj@458 110 JDKOPT_SETUP_JDK_OPTIONS
erikj@458 111 JDKOPT_SETUP_JDK_VERSION_NUMBERS
ohair@425 112
erikj@458 113 # To properly create a configuration name, we need to have the OpenJDK target
erikj@458 114 # and options (variants and debug level) parsed.
erikj@458 115 BASIC_SETUP_OUTPUT_DIR
ohair@425 116
ohair@425 117 ###############################################################################
ohair@425 118 #
erikj@458 119 # Setup BootJDK, used to bootstrap the build.
ohair@425 120 #
erikj@458 121 ###############################################################################
erikj@445 122
erikj@458 123 BOOTJDK_SETUP_BOOT_JDK
erikj@458 124 BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
ohair@425 125
ohair@425 126 ###############################################################################
ohair@425 127 #
erikj@458 128 # Configure the sources to use. We can add or override individual directories.
ohair@425 129 #
erikj@458 130 ###############################################################################
ohair@425 131
erikj@458 132 SRCDIRS_SETUP_TOPDIRS
erikj@458 133 SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
erikj@458 134 SRCDIRS_SETUP_OUTPUT_DIRS
ohair@425 135
ohair@425 136 ###############################################################################
ohair@425 137 #
erikj@458 138 # Setup the toolchain (compilers etc), i.e. the tools that need to be
erikj@458 139 # cross-compilation aware.
ohair@425 140 #
erikj@458 141 ###############################################################################
ohair@425 142
erikj@458 143 TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS
erikj@458 144 TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
erikj@458 145 # Locate the actual tools
erikj@458 146 TOOLCHAIN_SETUP_PATHS
ohair@425 147
erikj@458 148 # FIXME: Currently we must test this after paths but before flags. Fix!
ohair@425 149
erikj@458 150 # And we can test some aspects on the target using configure macros.
erikj@458 151 PLATFORM_TEST_OPENJDK_TARGET_BITS
erikj@458 152 PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
ohair@425 153
erikj@458 154 # Configure flags for the tools
erikj@458 155 TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS
erikj@458 156 TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION
erikj@458 157 TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK
erikj@458 158
erikj@458 159 # After we have toolchain, we can compile the uncygdrive helper
erikj@458 160 BASIC_COMPILE_UNCYGDRIVE
erikj@458 161
erikj@458 162
erikj@458 163 # Setup debug symbols (need objcopy from the toolchain for that)
erikj@458 164 JDKOPT_SETUP_DEBUG_SYMBOLS
ohair@425 165
ohair@425 166 ###############################################################################
ohair@425 167 #
erikj@458 168 # Check dependencies for external and internal libraries.
ohair@425 169 #
erikj@458 170 ###############################################################################
ohair@425 171
erikj@458 172 LIB_SETUP_INIT
erikj@458 173 LIB_SETUP_X11
erikj@458 174 LIB_SETUP_CUPS
erikj@458 175 LIB_SETUP_FREETYPE
erikj@458 176 LIB_SETUP_ALSA
erikj@458 177 LIB_SETUP_MISC_LIBS
erikj@458 178 LIB_SETUP_STATIC_LINK_LIBSTDCPP
ohair@425 179
ohair@425 180 ###############################################################################
ohair@425 181 #
erikj@458 182 # We need to do some final tweaking, when everything else is done.
ohair@425 183 #
erikj@458 184 ###############################################################################
ohair@425 185
erikj@458 186 JDKOPT_SETUP_BUILD_TWEAKS
erikj@445 187
ohair@425 188 ###############################################################################
ohair@425 189 #
erikj@458 190 # Configure parts of the build that only affect the build performance,
erikj@458 191 # not the result.
ohair@425 192 #
erikj@458 193 ###############################################################################
ohair@425 194
erikj@458 195 BPERF_SETUP_BUILD_CORES
erikj@458 196 BPERF_SETUP_BUILD_MEMORY
ohair@425 197
erikj@458 198 # Setup smart javac (after cores and memory have been setup)
erikj@458 199 BPERF_SETUP_SMART_JAVAC
ohair@425 200
erikj@458 201 # Can the C/C++ compiler use precompiled headers?
erikj@458 202 BPERF_SETUP_PRECOMPILED_HEADERS
ohair@425 203
erikj@458 204 # Setup use of ccache, if available
erikj@458 205 BPERF_SETUP_CCACHE
ohair@425 206
ohair@425 207 ###############################################################################
ohair@425 208 #
erikj@458 209 # And now the finish...
ohair@425 210 #
ohair@425 211 ###############################################################################
erikj@445 212
erikj@458 213 # Check for some common pitfalls
erikj@458 214 BASIC_TEST_USABILITY_ISSUES
erikj@445 215
erikj@458 216 # At the end, call the closed hook. (Dummy macro if no closed sources available)
erikj@458 217 CLOSED_HOOK
ohair@425 218
erikj@458 219 # We're messing a bit with internal autoconf variables to put the config.status
erikj@458 220 # in the output directory instead of the current directory.
erikj@458 221 CONFIG_STATUS="$OUTPUT_ROOT/config.status"
erikj@458 222 # Create the actual output files. Now the main work of configure is done.
erikj@445 223 AC_OUTPUT
erikj@445 224
erikj@445 225 # Finally output some useful information to the user
erikj@458 226 HELP_PRINT_SUMMARY_AND_WARNINGS

mercurial