ohair@425: # ohair@425: # Copyright (c) 2011, 2012, 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: ohair@425: AC_PREREQ([2.61]) ohair@425: AC_INIT(openjdk, version-0.1, build-infra-dev@openjdk.java.net) ohair@425: ohair@425: AC_CONFIG_AUX_DIR([build-aux]) ohair@425: ohair@425: m4_include([build-aux/pkg.m4]) ohair@425: m4_include([builddeps.m4]) ohair@425: m4_include([platform.m4]) ohair@425: m4_include([cores.m4]) ohair@425: m4_include([help.m4]) ohair@425: ohair@425: # Save the command line. Do this very early, before it is lost by calling autoconf macros. ohair@425: CONFIGURE_COMMAND_LINE="$@" ohair@425: AC_SUBST(CONFIGURE_COMMAND_LINE) ohair@425: ohair@425: # Locate the directory of this script. ohair@425: SCRIPT="[$]0" ohair@425: REMOVE_SYMBOLIC_LINKS(SCRIPT) ohair@425: AUTOCONF_DIR=`dirname [$]0` ohair@425: ohair@425: # Start with tools that do not need have cross compilation support ohair@425: # and can be expected to be found in the default PATH. These tools are ohair@425: # used by configure. Nor are these tools expected to be found in the ohair@425: # devkit from the builddeps server either, since they are ohair@425: # needed to download the devkit. ohair@425: AC_PROG_AWK ohair@425: CHECK_NONEMPTY(AWK) ohair@425: AC_PATH_PROG(CAT, cat) ohair@425: CHECK_NONEMPTY(CAT) ohair@425: AC_PATH_PROG(CHMOD, chmod) ohair@425: CHECK_NONEMPTY(CHMOD) ohair@425: AC_PATH_PROG(CP, cp) ohair@425: CHECK_NONEMPTY(CP) ohair@425: AC_PATH_PROG(CPIO, cpio) ohair@425: CHECK_NONEMPTY(CPIO) ohair@425: AC_PATH_PROG(CUT, cut) ohair@425: CHECK_NONEMPTY(CUT) ohair@425: AC_PATH_PROG(DATE, date) ohair@425: CHECK_NONEMPTY(DATE) ohair@425: AC_PATH_PROG(DF, df) ohair@425: CHECK_NONEMPTY(DF) ohair@425: AC_PATH_PROG(DIFF, diff) ohair@425: CHECK_NONEMPTY(DIFF) ohair@425: # Warning echo is really, really unportable!!!!! Different ohair@425: # behaviour in bash and dash and in a lot of other shells! ohair@425: # Use printf for serious work! ohair@425: AC_PATH_PROG(ECHO, echo) ohair@425: CHECK_NONEMPTY(ECHO) ohair@425: AC_PROG_EGREP ohair@425: CHECK_NONEMPTY(EGREP) ohair@425: AC_PROG_FGREP ohair@425: CHECK_NONEMPTY(FGREP) ohair@425: ohair@425: AC_PATH_PROG(FIND, find) ohair@425: CHECK_NONEMPTY(FIND) ohair@425: CHECK_FIND_DELETE ohair@425: AC_SUBST(FIND_DELETE) ohair@425: ohair@425: AC_PROG_GREP ohair@425: CHECK_NONEMPTY(GREP) ohair@425: AC_PATH_PROG(HEAD, head) ohair@425: CHECK_NONEMPTY(HEAD) ohair@425: AC_PATH_PROG(LN, ln) ohair@425: CHECK_NONEMPTY(LN) ohair@425: AC_PATH_PROG(LS, ls) ohair@425: CHECK_NONEMPTY(LS) ohair@425: AC_PATH_PROGS(MAKE, [gmake make]) ohair@425: CHECK_NONEMPTY(MAKE) ohair@425: MAKE_VERSION=`$MAKE --version | head -n 1 | grep '3.8[[12346789]]'` ohair@425: if test "x$MAKE_VERSION" = x; then ohair@425: AC_ERROR([You must use GNU make 3.81 or newer! Please put it in the path.]) ohair@425: fi ohair@425: AC_PATH_PROG(MKDIR, mkdir) ohair@425: CHECK_NONEMPTY(MKDIR) ohair@425: AC_PATH_PROG(MV, mv) ohair@425: CHECK_NONEMPTY(MV) ohair@425: AC_PATH_PROGS(NAWK, [nawk gawk awk]) ohair@425: CHECK_NONEMPTY(NAWK) ohair@425: AC_PATH_PROG(PRINTF, printf) ohair@425: CHECK_NONEMPTY(PRINTF) ohair@425: AC_PATH_PROG(THEPWDCMD, pwd) ohair@425: AC_PATH_PROG(RM, rm) ohair@425: CHECK_NONEMPTY(RM) ohair@425: RM="$RM -f" ohair@425: AC_PROG_SED ohair@425: CHECK_NONEMPTY(SED) ohair@425: AC_PATH_PROG(SH, sh) ohair@425: CHECK_NONEMPTY(SH) ohair@425: AC_PATH_PROG(SORT, sort) ohair@425: CHECK_NONEMPTY(SORT) ohair@425: AC_PATH_PROG(TAR, tar) ohair@425: CHECK_NONEMPTY(TAR) ohair@425: AC_PATH_PROG(TAIL, tail) ohair@425: CHECK_NONEMPTY(TAIL) ohair@425: AC_PATH_PROG(TEE, tee) ohair@425: CHECK_NONEMPTY(TEE) ohair@425: AC_PATH_PROG(TR, tr) ohair@425: CHECK_NONEMPTY(TR) ohair@425: AC_PATH_PROG(TOUCH, touch) ohair@425: CHECK_NONEMPTY(TOUCH) ohair@425: AC_PATH_PROG(WC, wc) ohair@425: CHECK_NONEMPTY(WC) ohair@425: AC_PATH_PROG(XARGS, xargs) ohair@425: CHECK_NONEMPTY(XARGS) ohair@425: AC_PATH_PROG(ZIP, zip) ohair@425: CHECK_NONEMPTY(ZIP) ohair@425: AC_PATH_PROG(UNZIP, unzip) ohair@425: CHECK_NONEMPTY(UNZIP) ohair@425: AC_PATH_PROG(LDD, ldd) ohair@425: if test "x$LDD" = "x"; then ohair@425: # List shared lib dependencies is used for ohair@425: # debug output and checking for forbidden dependencies. ohair@425: # We can build without it. ohair@425: LDD="true" ohair@425: fi ohair@425: AC_PATH_PROG(OTOOL, otool) ohair@425: if test "x$OTOOL" = "x"; then ohair@425: OTOOL="true" ohair@425: fi ohair@425: AC_PATH_PROG(READELF, readelf) ohair@425: AC_PATH_PROG(EXPR, expr) ohair@425: CHECK_NONEMPTY(EXPR) ohair@425: AC_PATH_PROG(FILE, file) ohair@425: CHECK_NONEMPTY(FILE) ohair@425: # Figure out the build and host system. ohair@425: AC_CANONICAL_BUILD ohair@425: AC_CANONICAL_HOST ohair@425: ohair@425: AC_ARG_WITH(data-model, [AS_HELP_STRING([--with-data-model], ohair@425: [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-data-model=32 @<:@guessed@:>@])]) ohair@425: ohair@425: if test "x$with_data_model" != x && \ ohair@425: test "x$with_data_model" != x32 && \ ohair@425: test "x$with_data_model" != x64 ; then ohair@425: AC_ERROR([The data model can only be 32 or 64!]) ohair@425: fi ohair@425: # Translate the standard cpu-vendor-kernel-os quadruplets into ohair@425: # the new HOST_.... and BUILD_... and the legacy names used by ohair@425: # the openjdk build. ohair@425: # It uses $host_os $host_cpu $build_os $build_cpu and $with_data_model ohair@425: EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS ohair@425: # Now the following vars are defined. ohair@425: # HOST_OS=aix,bsd,hpux,linux,macosx,solaris,windows ohair@425: # HOST_OS_FAMILY=bsd,gnu,sysv,win32,wince ohair@425: # HOST_OS_API=posix,winapi ohair@425: # ohair@425: # HOST_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64 ohair@425: # HOST_CPU_ARCH=x86,sparc,pcc,arm ohair@425: # HOST_CPU_BITS=32,64 ohair@425: # HOST_CPU_ENDIAN=big,little ohair@425: # ohair@425: # There is also a: ohair@425: # LEGACY_HOST_CPU1=i586,amd64,.... # used to set the old var ARCH ohair@425: # LEGACY_HOST_CPU2=i386,amd64,.... # used to set the old var LIBARCH ohair@425: # LEGACY_HOST_CPU3=only sparcv9,amd64 # used to set the ISA_DIR on Solaris ohair@425: # There was also a BUILDARCH that had i486,amd64,... but we do not use that ohair@425: # in the new build. ohair@425: # LEGACY_HOST_OS_API=solaris,windows # used to select source roots ohair@425: ohair@425: DATE_WHEN_CONFIGURED=`LANG=C date` ohair@425: AC_SUBST(DATE_WHEN_CONFIGURED) ohair@425: ohair@425: # How many cores do we have on this build system? ohair@425: AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores], ohair@425: [number of cores in the build system, e.g. --with-num-cores=8 @<:@probed@:>@])]) ohair@425: if test "x$with_num_cores" = x; then ohair@425: # The number of cores were not specified, try to probe them. ohair@425: CHECK_CORES ohair@425: else ohair@425: NUM_CORES=$with_num_cores ohair@425: CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2` ohair@425: fi ohair@425: AC_SUBST(NUM_CORES) ohair@425: AC_SUBST(CONCURRENT_BUILD_JOBS) ohair@425: ohair@425: # How many cores do we have on this build system? ohair@425: AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size], ohair@425: [memory (in MB) available in the build system, e.g. --with-memory-size=1024 @<:@probed@:>@])]) ohair@425: if test "x$with_memory_size" = x; then ohair@425: # The memory size was not specified, try to probe it. ohair@425: CHECK_MEMORY_SIZE ohair@425: else ohair@425: MEMORY_SIZE=$with_memory_size ohair@425: fi ohair@425: AC_SUBST(MEMORY_SIZE) ohair@425: ohair@425: # Where is the source? It is located two levels above the configure script. ohair@425: CURDIR="$PWD" ohair@425: cd "$AUTOCONF_DIR/../.." ohair@425: SRC_ROOT="`pwd`" ohair@425: AC_SUBST(SRC_ROOT) ohair@425: cd "$CURDIR" ohair@425: ohair@425: # For cygwin we need cygpath first, since it is used everywhere. ohair@425: AC_PATH_PROG(CYGPATH, cygpath) ohair@425: PATH_SEP=":" ohair@425: if test "x$BUILD_OS" = "xwindows"; then ohair@425: if test "x$CYGPATH" = x; then ohair@425: AC_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) ohair@425: fi ohair@425: PATH_SEP=";" ohair@425: fi ohair@425: AC_SUBST(PATH_SEP) ohair@425: ohair@425: SPACESAFE(SRC_ROOT,[the path to the source root]) ohair@425: SPACESAFE(CURDIR,[the path to the current directory]) ohair@425: ohair@425: if test "x$BUILD_OS" = "xsolaris"; then ohair@425: # Also search in /usr/ccs/bin for utilities like ar and as. ohair@425: PATH="/usr/ccs/bin:$PATH" ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # OpenJDK or closed ohair@425: # ohair@425: AC_ARG_ENABLE([openjdk], [AS_HELP_STRING([--enable-openjdk], ohair@425: [build OpenJDK regardless of the presence of closed repositories @<:@disabled@:>@])],,) ohair@425: ohair@425: if test "x$enable_openjdk" = "xyes"; then ohair@425: OPENJDK=true ohair@425: elif test "x$enable_openjdk" = "xno"; then ohair@425: OPENJDK=false ohair@425: elif test -d "$SRC_ROOT/jdk/src/closed"; then ohair@425: OPENJDK=false ohair@425: else ohair@425: OPENJDK=true ohair@425: fi ohair@425: ohair@425: if test "x$OPENJDK" = "xtrue"; then ohair@425: SET_OPENJDK=OPENJDK=true ohair@425: fi ohair@425: ohair@425: AC_SUBST(SET_OPENJDK) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # JIGSAW or not. The JIGSAW variable is used during the intermediate ohair@425: # stage when we are building both the old style JDK and the new style modularized JDK. ohair@425: # When the modularized JDK is finalized, this option will go away. ohair@425: # ohair@425: AC_ARG_ENABLE([jigsaw], [AS_HELP_STRING([--enable-jigsaw], ohair@425: [build Jigsaw images (not yet available) @<:@disabled@:>@])],,) ohair@425: ohair@425: if test "x$enable_jigsaw" = "xyes"; then ohair@425: JIGSAW=true ohair@425: else ohair@425: JIGSAW=false ohair@425: fi ohair@425: AC_SUBST(JIGSAW) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check which variant of the JDK that we want to build. ohair@425: # Currently we have: ohair@425: # normal: standard edition ohair@425: # embedded: cut down to a smaller footprint ohair@425: # ohair@425: # Effectively the JDK variant gives a name to a specific set of ohair@425: # modules to compile into the JDK. In the future, these modules ohair@425: # might even be Jigsaw modules. ohair@425: # ohair@425: AC_MSG_CHECKING([which variant of the JDK to build]) ohair@425: AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant], ohair@425: [JDK variant to build (normal, embedded) @<:@normal@:>@])]) ohair@425: ohair@425: if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then ohair@425: JAVASE_EMBEDDED="" ohair@425: MINIMIZE_RAM_USAGE="" ohair@425: JDK_VARIANT="normal" ohair@425: elif test "x$with_jdk_variant" = xembedded; then ohair@425: JAVASE_EMBEDDED="JAVASE_EMBEDDED:=true" ohair@425: MINIMIZE_RAM_USAGE="MINIMIZE_RAM_USAGE:=true" ohair@425: JDK_VARIANT="embedded" ohair@425: else ohair@425: AC_ERROR([The available JDK variants are: normal, embedded]) ohair@425: fi ohair@425: ohair@425: AC_SUBST(JAVASE_EMBEDDED) ohair@425: AC_SUBST(MINIMIZE_RAM_USAGE) ohair@425: AC_SUBST(JDK_VARIANT) ohair@425: ohair@425: AC_MSG_RESULT([$JDK_VARIANT]) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Should we build a JDK/JVM with head support (ie a graphical ui)? ohair@425: # We always build headless support. ohair@425: # ohair@425: AC_MSG_CHECKING([headful support]) ohair@425: AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful], ohair@425: [build headful support (graphical UI support) @<:@enabled@:>@])], ohair@425: [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes]) ohair@425: ohair@425: SUPPORT_HEADLESS=yes ohair@425: BUILD_HEADLESS="BUILD_HEADLESS:=true" ohair@425: ohair@425: if test "x$SUPPORT_HEADFUL" = xyes; then ohair@425: # We are building both headful and headless. ohair@425: BUILD_HEADLESS_ONLY="" ohair@425: headful_msg="inlude support for both headful and headless" ohair@425: fi ohair@425: ohair@425: if test "x$SUPPORT_HEADFUL" = xno; then ohair@425: # Thus we are building headless only. ohair@425: BUILD_HEADLESS="BUILD_HEADLESS:=true" ohair@425: BUILD_HEADLESS_ONLY="BUILD_HEADLESS_ONLY:=true" ohair@425: headful_msg="headless only" ohair@425: fi ohair@425: ohair@425: AC_MSG_RESULT([$headful_msg]) ohair@425: ohair@425: AC_SUBST(SUPPORT_HEADLESS) ohair@425: AC_SUBST(SUPPORT_HEADFUL) ohair@425: AC_SUBST(BUILD_HEADLESS) ohair@425: AC_SUBST(BUILD_HEADLESS_ONLY) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check which variants of the JVM that we want to build. ohair@425: # Currently we have: ohair@425: # server: normal interpreter and a tiered C1/C2 compiler ohair@425: # client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms) ohair@425: # kernel: kernel footprint JVM that passes the TCK without major performance problems, ohair@425: # ie normal interpreter and C1, only the serial GC, kernel jvmti etc ohair@425: # zero: no machine code interpreter, no compiler ohair@425: # zeroshark: zero interpreter and shark/llvm compiler backend ohair@425: AC_MSG_CHECKING([which variants of the JVM that should be built]) ohair@425: AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants], ohair@425: [JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])]) ohair@425: ohair@425: if test "x$with_jvm_variants" = x; then ohair@425: if test "x$JDK_VARIANT" = xembedded; then ohair@425: with_jvm_variants="kernel" ohair@425: elif test "x$HOST_CPU_BITS" = x64; then ohair@425: with_jvm_variants="server" ohair@425: else ohair@425: # Yes, on 32-bit machines, the same source (almost) is compiled twice ohair@425: # to generate two libjvm.so files. Fun, fun. ohair@425: with_jvm_variants="client,server" ohair@425: fi ohair@425: fi ohair@425: ohair@425: JVM_VARIANTS=",$with_jvm_variants," ohair@425: TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'` ohair@425: ohair@425: if test "x$TEST_VARIANTS" != "x,"; then ohair@425: AC_ERROR([The available JVM variants are: server, client, kernel, zero, zeroshark]) ohair@425: fi ohair@425: AC_MSG_RESULT([$with_jvm_variants]) ohair@425: ohair@425: JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'` ohair@425: JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'` ohair@425: JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'` ohair@425: JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'` ohair@425: JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'` ohair@425: ohair@425: if test "x$JVM_VARIANT_CLIENT" = xtrue; then ohair@425: if test "x$HOST_CPU_BITS" = x64; then ohair@425: AC_ERROR([You cannot build a client JVM for a 64-bit machine.]) ohair@425: fi ohair@425: fi ohair@425: if test "x$JVM_VARIANT_KERNEL" = xtrue; then ohair@425: if test "x$HOST_CPU_BITS" = x64; then ohair@425: AC_ERROR([You cannot build a kernel JVM for a 64-bit machine.]) ohair@425: fi ohair@425: fi ohair@425: ohair@425: COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'` ohair@425: # Replace the commas with AND for use in the build directory name. ohair@425: ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'` ohair@425: if test "x$COUNT_VARIANTS" != "x,1"; then ohair@425: AC_MSG_NOTICE([NOTE! Longer build time since we are building more than one version of the libjvm! $with_jvm_variants]) ohair@425: fi ohair@425: ohair@425: AC_SUBST(JVM_VARIANTS) ohair@425: AC_SUBST(JVM_VARIANT_SERVER) ohair@425: AC_SUBST(JVM_VARIANT_CLIENT) ohair@425: AC_SUBST(JVM_VARIANT_KERNEL) ohair@425: AC_SUBST(JVM_VARIANT_ZERO) ohair@425: AC_SUBST(JVM_VARIANT_ZEROSHARK) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Set the debug level ohair@425: # release: no debug information, all optimizations, no asserts. ohair@425: # fastdebug: debug information (-g), all optimizations, all asserts ohair@425: # slowdebug: debug information (-g), no optimizations, all asserts ohair@425: # ohair@425: DEBUG_LEVEL="release" ohair@425: AC_MSG_CHECKING([which debug level to use]) ohair@425: AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], ohair@425: [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])], ohair@425: [ ohair@425: ENABLE_DEBUG="${enableval}" ohair@425: DEBUG_LEVEL="fastdebug" ohair@425: ], [ENABLE_DEBUG="no"]) ohair@425: ohair@425: AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level], ohair@425: [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])], ohair@425: [ ohair@425: DEBUG_LEVEL="${withval}" ohair@425: if test "x$ENABLE_DEBUG" = xyes; then ohair@425: AC_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.]) ohair@425: fi ohair@425: ]) ohair@425: AC_MSG_RESULT([$DEBUG_LEVEL]) ohair@425: ohair@425: if test "x$DEBUG_LEVEL" != xrelease && \ ohair@425: test "x$DEBUG_LEVEL" != xfastdebug && \ ohair@425: test "x$DEBUG_LEVEL" != xslowdebug; then ohair@425: AC_ERROR([Allowed debug levels are: release, fastdebug and slowdebug]) ohair@425: fi ohair@425: ohair@425: case $DEBUG_LEVEL in ohair@425: release ) ohair@425: VARIANT="OPT" ohair@425: FASTDEBUG="false" ohair@425: DEBUG_CLASSFILES="false" ohair@425: BUILD_VARIANT_RELEASE="" ohair@425: ;; ohair@425: fastdebug ) ohair@425: VARIANT="DBG" ohair@425: FASTDEBUG="true" ohair@425: DEBUG_CLASSFILES="true" ohair@425: BUILD_VARIANT_RELEASE="-fastdebug" ohair@425: ;; ohair@425: slowdebug ) ohair@425: VARIANT="DBG" ohair@425: FASTDEBUG="false" ohair@425: DEBUG_CLASSFILES="true" ohair@425: BUILD_VARIANT_RELEASE="-debug" ohair@425: ;; ohair@425: esac ohair@425: ohair@425: AC_SUBST(DEBUG_LEVEL) ohair@425: AC_SUBST(VARIANT) ohair@425: AC_SUBST(FASTDEBUG) ohair@425: AC_SUBST(DEBUG_CLASSFILES) ohair@425: AC_SUBST(BUILD_VARIANT_RELEASE) ohair@425: ohair@425: # Source the version numbers ohair@425: . $AUTOCONF_DIR/version.numbers ohair@425: if test "x$OPENJDK" = "xfalse"; then ohair@425: . $AUTOCONF_DIR/closed.version.numbers ohair@425: fi ohair@425: # Now set the JDK version, milestone, build number etc. ohair@425: AC_SUBST(JDK_MAJOR_VERSION) ohair@425: AC_SUBST(JDK_MINOR_VERSION) ohair@425: AC_SUBST(JDK_MICRO_VERSION) ohair@425: AC_SUBST(JDK_UPDATE_VERSION) ohair@425: AC_SUBST(JDK_BUILD_NUMBER) ohair@425: AC_SUBST(MILESTONE) ohair@425: AC_SUBST(LAUNCHER_NAME) ohair@425: AC_SUBST(PRODUCT_NAME) ohair@425: AC_SUBST(PRODUCT_SUFFIX) ohair@425: AC_SUBST(JDK_RC_PLATFORM_NAME) ohair@425: AC_SUBST(COMPANY_NAME) ohair@425: ohair@425: COPYRIGHT_YEAR=`date +'%Y'` ohair@425: AC_SUBST(COPYRIGHT_YEAR) ohair@425: ohair@425: RUNTIME_NAME="$PRODUCT_NAME $PRODUCT_SUFFIX" ohair@425: AC_SUBST(RUNTIME_NAME) ohair@425: ohair@425: if test "x$JDK_UPDATE_VERSION" != x; then ohair@425: JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}" ohair@425: else ohair@425: JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}" ohair@425: fi ohair@425: AC_SUBST(JDK_VERSION) ohair@425: ohair@425: if test "x$MILESTONE" != x; then ohair@425: RELEASE="${JDK_VERSION}-${MILESTONE}${BUILD_VARIANT_RELEASE}" ohair@425: else ohair@425: RELEASE="${JDK_VERSION}${BUILD_VARIANT_RELEASE}" ohair@425: fi ohair@425: AC_SUBST(RELEASE) ohair@425: ohair@425: if test "x$JDK_BUILD_NUMBER" != x; then ohair@425: FULL_VERSION="${RELEASE}-${JDK_BUILD_NUMBER}" ohair@425: else ohair@425: JDK_BUILD_NUMBER=b00 ohair@425: BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` ohair@425: # Avoid [:alnum:] since it depends on the locale. ohair@425: CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'` ohair@425: USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` ohair@425: FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}" ohair@425: fi ohair@425: AC_SUBST(FULL_VERSION) ohair@425: COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'` ohair@425: AC_SUBST(COOKED_BUILD_NUMBER) ohair@425: ohair@425: # Test from where we are running configure, in or outside of src root. ohair@425: if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then ohair@425: # We are running configure from the src root. ohair@425: # Create a default ./build/host-variant-debuglevel output root. ohair@425: OUTPUT_ROOT="$SRC_ROOT/build/${HOST_OS}-${HOST_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" ohair@425: mkdir -p "$OUTPUT_ROOT" ohair@425: if test ! -d "$OUTPUT_ROOT"; then ohair@425: AC_ERROR([Could not create build directory $OUTPUT_ROOT]) ohair@425: fi ohair@425: else ohair@425: # We are running configure from outside of the src dir. ohair@425: # Then use the current directory as output dir! ohair@425: OUTPUT_ROOT="$CURDIR" ohair@425: fi ohair@425: ohair@425: SPACESAFE(OUTPUT_ROOT,[the path to the output root]) ohair@425: ohair@425: # Save the arguments given to us ohair@425: echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments ohair@425: ohair@425: # Check if the VS env variables were setup prior to running configure. ohair@425: # If not, then find vcvarsall.bat and run it automatically, and integrate ohair@425: # the set env variables into the spec file. ohair@425: SETUPDEVENV="# No special vars" ohair@425: if test "x$BUILD_OS" = "xwindows"; then ohair@425: # If vcvarsall.bat has been run, then VCINSTALLDIR is set. ohair@425: if test "x$VCINSTALLDIR" != x; then ohair@425: # No further setup is needed. The build will happen from this kind ohair@425: # of shell. ohair@425: SETUPDEVENV="# This spec file expects that you are running bash from within a VS command prompt." ohair@425: # Make sure to remind you, if you forget to run make from a cygwin bash shell ohair@425: # that is spawned "bash -l" from a VS command prompt. ohair@425: CHECK_FOR_VCINSTALLDIR=yes ohair@425: AC_MSG_CHECKING([if you are running from within a VS command prompt]) ohair@425: AC_MSG_RESULT([yes]) ohair@425: else ohair@425: # Ah, we have not yet run vcvarsall.bat/vsvars32.bat/vsvars64.bat. Lets do that. First find it. ohair@425: if test "x$VS100COMNTOOLS" != x; then ohair@425: VARSBAT=`find "$VS100COMNTOOLS/../.." -name vcvarsall.bat` ohair@425: SEARCH_ROOT="$VS100COMNTOOLS" ohair@425: else ohair@425: VARSBAT=`find "$PROGRAMFILES" -name vcvarsall.bat` ohair@425: SEARCH_ROOT="$PROGRAMFILES" ohair@425: fi ohair@425: VCPATH=`dirname "$VARSBAT"` ohair@425: VCPATH=`cygpath -w "$VCPATH"` ohair@425: if test "x$VARSBAT" = x || test ! -d "$VCPATH"; then ohair@425: AC_MSG_CHECKING([if we can find the VS installation]) ohair@425: AC_MSG_RESULT([no]) ohair@425: AC_ERROR([Tried to find a VS installation using both $SEARCH_ROOT but failed. Please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.]) ohair@425: fi ohair@425: case "$LEGACY_HOST_CPU1" in ohair@425: i?86) ohair@425: VARSBAT_ARCH=x86 ohair@425: ;; ohair@425: *) ohair@425: VARSBAT_ARCH=$LEGACY_HOST_CPU1 ohair@425: ;; ohair@425: esac ohair@425: # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat ohair@425: cd $OUTPUT_ROOT ohair@425: $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH" ohair@425: cd $CURDIR ohair@425: if test ! -s $OUTPUT_ROOT/localdevenv.sh || test ! -s $OUTPUT_ROOT/localdevenv.gmk; then ohair@425: AC_MSG_CHECKING([if we can extract the needed env variables]) ohair@425: AC_MSG_RESULT([no]) ohair@425: AC_ERROR([Could not succesfully extract the env variables needed for the VS setup. Please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.]) ohair@425: fi ohair@425: # Now set all paths and other env variables. This will allow the rest of ohair@425: # the configure script to find and run the compiler in the proper way. ohair@425: . $OUTPUT_ROOT/localdevenv.sh ohair@425: AC_MSG_CHECKING([if we can find the VS installation]) ohair@425: if test "x$VCINSTALLDIR" != x; then ohair@425: AC_MSG_RESULT([$VCINSTALLDIR]) ohair@425: else ohair@425: AC_MSG_RESULT([no]) ohair@425: AC_ERROR([Could not find VS installation. Please install. If you are sure you have installed VS, then please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.]) ohair@425: fi ohair@425: CHECK_FOR_VCINSTALLDIR=no ohair@425: SETUPDEVENV="include $OUTPUT_ROOT/localdevenv.gmk" ohair@425: ohair@425: AC_MSG_CHECKING([for msvcr100.dll]) ohair@425: AC_ARG_WITH(msvcr100dll, [AS_HELP_STRING([--with-msvcr100dll], ohair@425: [copy this msvcr100.dll into the built JDK])]) ohair@425: if test "x$with_msvcr100dll" != x; then ohair@425: MSVCR100DLL="$with_msvcr100dll" ohair@425: else ohair@425: if test "x$HOST_CPU_BITS" = x64; then ohair@425: MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x64 | head --lines 1` ohair@425: else ohair@425: MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` ohair@425: if test "x$MSVCR100DLL" = x; then ohair@425: MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | head --lines 1` ohair@425: fi ohair@425: fi ohair@425: fi ohair@425: if test "x$MSVCR100DLL" = x; then ohair@425: AC_MSG_RESULT([no]) ohair@425: AC_ERROR([Could not find msvcr100.dll !]) ohair@425: fi ohair@425: AC_MSG_RESULT([$MSVCR100DLL]) ohair@425: SPACESAFE(MSVCR100DLL,[the path to msvcr100.dll]) ohair@425: fi ohair@425: fi ohair@425: AC_SUBST(SETUPDEVENV) ohair@425: AC_SUBST(CHECK_FOR_VCINSTALLDIR) ohair@425: AC_SUBST(MSVCR100DLL) ohair@425: ohair@425: # Most of the probed defines are put into config.h ohair@425: AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in]) ohair@425: # The spec.gmk file contains all variables for the make system. ohair@425: AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in]) ohair@425: # The generated Makefile knows where the spec.gmk is and where the source is. ohair@425: # You can run make from the OUTPUT_ROOT. If you have only ohair@425: # one configured host, then you can also run make from the SRC_ROOT, ohair@425: # since it will go look for a single spec.gmk file. Or perhaps it ohair@425: # should instead make all configured hosts it can find? ohair@425: AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in]) ohair@425: ohair@425: AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk) ohair@425: AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT) ohair@425: ohair@425: # Where are the sources. Any of these can be overridden ohair@425: # using --with-override-corba and the likes. ohair@425: LANGTOOLS_TOPDIR="$SRC_ROOT/langtools" ohair@425: CORBA_TOPDIR="$SRC_ROOT/corba" ohair@425: JAXP_TOPDIR="$SRC_ROOT/jaxp" ohair@425: JAXWS_TOPDIR="$SRC_ROOT/jaxws" ohair@425: HOTSPOT_TOPDIR="$SRC_ROOT/hotspot" ohair@425: JDK_TOPDIR="$SRC_ROOT/jdk" ohair@425: AC_SUBST(LANGTOOLS_TOPDIR) ohair@425: AC_SUBST(CORBA_TOPDIR) ohair@425: AC_SUBST(JAXP_TOPDIR) ohair@425: AC_SUBST(JAXWS_TOPDIR) ohair@425: AC_SUBST(HOTSPOT_TOPDIR) ohair@425: AC_SUBST(JDK_TOPDIR) ohair@425: ohair@425: # Check if pkg-config is available. ohair@425: PKG_PROG_PKG_CONFIG ohair@425: ohair@425: AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf], ohair@425: [use this configuration file for the builddeps])]) ohair@425: ohair@425: AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server], ohair@425: [download and use build dependencies from this server url, e.g. --with-builddeps-server=ftp://example.com/dir])]) ohair@425: ohair@425: AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir], ohair@425: [store downloaded build dependencies here @<:@d/localhome/builddeps@:>@])], ohair@425: [], ohair@425: [with_builddeps_dir=/localhome/builddeps]) ohair@425: ohair@425: AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group], ohair@425: [chgrp the downloaded build dependencies to this group])]) ohair@425: ohair@425: AC_ARG_ENABLE([list-builddeps], [AS_HELP_STRING([--enable-list-builddeps], ohair@425: [list all build dependencies known to the configure script])], ohair@425: [LIST_BUILDDEPS="${enableval}"], [LIST_BUILDDEPS='no']) ohair@425: ohair@425: if test "x$LIST_BUILDDEPS" = xyes; then ohair@425: echo ohair@425: echo List of build dependencies known to the configure script, ohair@425: echo that can be used in builddeps.conf files: ohair@425: cat $SRC_ROOT/configure.ac | grep BDEPS_CHECK_MODUL | grep -v configure.ac | cut -f 2 -d ',' | tr -d ' ' | sort ohair@425: echo ohair@425: exit 1 ohair@425: fi ohair@425: ohair@425: # If builddeps server or conf file is given. Setup buildeps usage. ohair@425: BDEPS_SCAN_FOR_BUILDDEPS ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Configure the development tool paths and potential sysroot. ohair@425: # ohair@425: AC_LANG(C++) ohair@425: DEVKIT= ohair@425: SYS_ROOT=/ ohair@425: AC_SUBST(SYS_ROOT) ohair@425: ohair@425: # The option used to specify the target .o,.a or .so file. ohair@425: # When compiling, how to specify the to be created object file. ohair@425: CC_OUT_OPTION='-o$(SPACE)' ohair@425: # When linking, how to specify the to be created executable. ohair@425: EXE_OUT_OPTION='-o$(SPACE)' ohair@425: # When linking, how to specify the to be created dynamically linkable library. ohair@425: LD_OUT_OPTION='-o$(SPACE)' ohair@425: # When archiving, how to specify the to be create static archive for object files. ohair@425: AR_OUT_OPTION='rcs$(SPACE)' ohair@425: AC_SUBST(CC_OUT_OPTION) ohair@425: AC_SUBST(EXE_OUT_OPTION) ohair@425: AC_SUBST(LD_OUT_OPTION) ohair@425: AC_SUBST(AR_OUT_OPTION) ohair@425: ohair@425: # If --build AND --host is set, then the configure script will find any ohair@425: # cross compilation tools in the PATH. Cross compilation tools ohair@425: # follows the cross compilation standard where they are prefixed with ${host}. ohair@425: # For example the binary i686-sun-solaris2.10-gcc ohair@425: # will cross compile for i686-sun-solaris2.10 ohair@425: # If neither of build and host is not set, then build=host and the ohair@425: # default compiler found in the path will be used. ohair@425: # Setting only --host, does not seem to be really supported. ohair@425: # Please set both --build and --host if you want to cross compile. ohair@425: ohair@425: DEFINE_CROSS_COMPILE_ARCH="" ohair@425: HOSTCC="" ohair@425: HOSTCXX="" ohair@425: AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) ohair@425: AC_SUBST(HOST_CC) ohair@425: AC_SUBST(HOST_CXX) ohair@425: AC_MSG_CHECKING([if this is a cross compile]) ohair@425: if test "x$build_var" != "x$host_var"; then ohair@425: AC_MSG_RESULT([yes, from $build_var to $host_var]) ohair@425: # We have detected a cross compile! ohair@425: DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$LEGACY_HOST_CPU1" ohair@425: # Now we to find a C/C++ compiler that can build executables for the build ohair@425: # platform. We can't use the AC_PROG_CC macro, since it can only be used ohair@425: # once. ohair@425: AC_PATH_PROGS(HOSTCC, [cl cc gcc]) ohair@425: WHICHCMD(HOSTCC) ohair@425: AC_PATH_PROGS(HOSTCXX, [cl CC g++]) ohair@425: WHICHCMD(HOSTCXX) ohair@425: # Building for the build platform should be easy. Therefore ohair@425: # we do not need any linkers or assemblers etc. ohair@425: else ohair@425: AC_MSG_RESULT([no]) ohair@425: fi ohair@425: ohair@425: # You can force the sys-root if the sys-root encoded into the cross compiler tools ohair@425: # is not correct. ohair@425: AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root], ohair@425: [pass this sys-root to the compilers and linker (useful if the sys-root encoded in ohair@425: the cross compiler tools is incorrect)])]) ohair@425: ohair@425: if test "x$with_sys_root" != x; then ohair@425: SYS_ROOT=$with_sys_root ohair@425: fi ohair@425: ohair@425: # If a devkit is found on the builddeps server, then prepend its path to the ohair@425: # PATH variable. If there are cross compilers available in the devkit, these ohair@425: # will be found by AC_PROG_CC et al. ohair@425: BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, ohair@425: [# Found devkit ohair@425: PATH="$DEVKIT/bin:$PATH" ohair@425: SYS_ROOT="$DEVKIT/${rewritten_host}/sys-root" ohair@425: if test "x$x_includes" = "xNONE"; then ohair@425: x_includes="$SYS_ROOT/usr/include/X11" ohair@425: fi ohair@425: if test "x$x_libraries" = "xNONE"; then ohair@425: x_libraries="$SYS_ROOT/usr/lib" ohair@425: fi ohair@425: ], ohair@425: []) ohair@425: ohair@425: if test "x$SYS_ROOT" != "x/" ; then ohair@425: CFLAGS="--sysroot=$SYS_ROOT $CFLAGS" ohair@425: CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS" ohair@425: OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" ohair@425: OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" ohair@425: CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS" ohair@425: LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS" ohair@425: fi ohair@425: ohair@425: # Store the CFLAGS etal passed to the configure script. ohair@425: ORG_CFLAGS="$CFLAGS" ohair@425: ORG_CXXFLAGS="$CXXFLAGS" ohair@425: ORG_OBJCFLAGS="$OBJCFLAGS" ohair@425: ohair@425: # gcc is almost always present, but on Windows we ohair@425: # prefer cl.exe and on Solaris we prefer CC. ohair@425: # Thus test for them in this order. ohair@425: AC_PROG_CC([cl cc gcc]) ohair@425: if test "x$CC" = x; then ohair@425: help_on_build_dependency devkit ohair@425: AC_ERROR([Could not find a compiler. $HELP_MSG]) ohair@425: fi ohair@425: if test "x$CC" = xcc && test "x$BUILD_OS" = xmacosx; then ohair@425: # Do not use cc on MacOSX use gcc instead. ohair@425: CC="gcc" ohair@425: fi ohair@425: WHICHCMD(CC) ohair@425: ohair@425: AC_PROG_CXX([cl CC g++]) ohair@425: if test "x$CXX" = xCC && test "x$BUILD_OS" = xmacosx; then ohair@425: # The found CC, even though it seems to be a g++ derivate, cannot compile ohair@425: # c++ code. Override. ohair@425: CXX="g++" ohair@425: fi ohair@425: WHICHCMD(CXX) ohair@425: ohair@425: if test "x$CXX" = x || test "x$CC" = x; then ohair@425: help_on_build_dependency devkit ohair@425: AC_ERROR([Could not find the needed compilers! $HELP_MSG ]) ohair@425: fi ohair@425: ohair@425: if test "x$BUILD_OS" != xwindows; then ohair@425: AC_PROG_OBJC ohair@425: WHICHCMD(OBJC) ohair@425: else ohair@425: OBJC= ohair@425: fi ohair@425: ohair@425: # Restore the flags to the user specified values. ohair@425: # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" ohair@425: CFLAGS="$ORG_CFLAGS" ohair@425: CXXFLAGS="$ORG_CXXFLAGS" ohair@425: OBJCFLAGS="$ORG_OBJCFLAGS" ohair@425: ohair@425: # If we are not cross compiling, use the same compilers for ohair@425: # building the build platform executables. ohair@425: if test "x$DEFINE_CROSS_COMPILE_ARCH" = x; then ohair@425: HOSTCC="$CC" ohair@425: HOSTCXX="$CXX" ohair@425: fi ohair@425: ohair@425: AC_CHECK_TOOL(LD, ld) ohair@425: WHICHCMD(LD) ohair@425: LDEXE="$LD" ohair@425: LDCXX="$LD" ohair@425: LDEXECXX="$LD" ohair@425: # LDEXE is the linker to use, when creating executables. ohair@425: AC_SUBST(LDEXE) ohair@425: # Linking C++ libraries. ohair@425: AC_SUBST(LDCXX) ohair@425: # Linking C++ executables. ohair@425: AC_SUBST(LDEXECXX) ohair@425: ohair@425: AC_CHECK_TOOL(AR, ar) ohair@425: WHICHCMD(AR) ohair@425: if test "x$BUILD_OS" = xmacosx; then ohair@425: ARFLAGS="-r" ohair@425: else ohair@425: ARFLAGS="" ohair@425: fi ohair@425: AC_SUBST(ARFLAGS) ohair@425: ohair@425: COMPILER_NAME=gcc ohair@425: COMPILER_TYPE=CC ohair@425: AS_IF([test "x$BUILD_OS" = xwindows], [ ohair@425: # For now, assume that we are always compiling using cl.exe. ohair@425: CC_OUT_OPTION=-Fo ohair@425: EXE_OUT_OPTION=-Fe ohair@425: LD_OUT_OPTION=-out: ohair@425: AR_OUT_OPTION=-out: ohair@425: # On Windows, reject /usr/bin/link, which is a cygwin ohair@425: # program for something completely different. ohair@425: AC_CHECK_PROG([WINLD], [link],[link],,, [/usr/bin/link]) ohair@425: # Since we must ignore the first found link, WINLD will contain ohair@425: # the full path to the link.exe program. ohair@425: WHICHCMD_SPACESAFE([WINLD]) ohair@425: LD="$WINLD" ohair@425: # However creating executables can only be done with cl.exe. ohair@425: LDEXE="$CC" ohair@425: LDCXX="$WINLD" ohair@425: LDEXECXX="$CC" ohair@425: ohair@425: AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) ohair@425: WHICHCMD_SPACESAFE([MT]) ohair@425: # The resource compiler ohair@425: AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) ohair@425: WHICHCMD_SPACESAFE([RC]) ohair@425: ohair@425: RC_FLAGS="/l 0x409 /r" ohair@425: AS_IF([test "x$VARIANT" = xOPT], [ ohair@425: RC_FLAGS="$RC_FLAGS -d NDEBUG" ohair@425: ]) ohair@425: JDK_UPDATE_VERSION_NOTNULL=$JDK_UPDATE_VERSION ohair@425: AS_IF([test "x$JDK_UPDATE_VERSION" = x], [ ohair@425: JDK_UPDATE_VERSION_NOTNULL=0 ohair@425: ]) ohair@425: RC_FLAGS="$RC_FLAGS -d \"JDK_BUILD_ID=$FULL_VERSION\"" ohair@425: RC_FLAGS="$RC_FLAGS -d \"JDK_COMPANY=$COMPANY_NAME\"" ohair@425: RC_FLAGS="$RC_FLAGS -d \"JDK_COMPONENT=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME binary\"" ohair@425: RC_FLAGS="$RC_FLAGS -d \"JDK_VER=$JDK_MINOR_VERSION.$JDK_MICRO_VERSION.$JDK_UPDATE_VERSION_NOTNULL.$COOKED_BUILD_NUMBER\"" ohair@425: RC_FLAGS="$RC_FLAGS -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\"" ohair@425: RC_FLAGS="$RC_FLAGS -d \"JDK_NAME=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME $JDK_MINOR_VERSION $JDK_UPDATE_META_TAG\"" ohair@425: RC_FLAGS="$RC_FLAGS -d \"JDK_FVER=$JDK_MINOR_VERSION,$JDK_MICRO_VERSION,$JDK_UPDATE_VERSION_NOTNULL,$COOKED_BUILD_NUMBER\"" ohair@425: ohair@425: # lib.exe is used to create static libraries. ohair@425: AC_CHECK_PROG([WINAR], [lib],[lib],,,) ohair@425: WHICHCMD_SPACESAFE([WINAR]) ohair@425: AR="$WINAR" ohair@425: ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" ohair@425: ohair@425: AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) ohair@425: WHICHCMD_SPACESAFE([DUMPBIN]) ohair@425: ohair@425: COMPILER_TYPE=CL ohair@425: CFLAGS="$CFLAGS -nologo" ohair@425: LDFLAGS="$LDFLAGS -nologo -dll -opt:ref -incremental:no " ohair@425: if test "x$LEGACY_HOST_CPU1" = xi586; then ohair@425: LDFLAGS="$LDFLAGS -safeseh" ohair@425: fi ohair@425: if test "x$DEBUG_LEVEL" != xrelease; then ohair@425: LDFLAGS="$LDFLAGS -debug" ohair@425: fi ohair@425: ]) ohair@425: AC_SUBST(RC_FLAGS) ohair@425: AC_SUBST(COMPILER_TYPE) ohair@425: ohair@425: AC_PROG_CPP ohair@425: WHICHCMD(CPP) ohair@425: ohair@425: AC_PROG_CXXCPP ohair@425: WHICHCMD(CXXCPP) ohair@425: ohair@425: # Find the right assembler. ohair@425: if test "x$BUILD_OS" = xsolaris; then ohair@425: AC_PATH_PROG(AS, as) ohair@425: WHICHCMD(AS) ohair@425: ASFLAGS=" " ohair@425: else ohair@425: AS="$CC -c" ohair@425: ASFLAGS=" " ohair@425: fi ohair@425: AC_SUBST(AS) ohair@425: AC_SUBST(ASFLAGS) ohair@425: ohair@425: if test "x$HOST_CPU_BITS" = x32 && test "x$HOST_OS" = macosx; then ohair@425: # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. ohair@425: # While waiting for a better solution, the current workaround is to use -mstackrealign. ohair@425: CFLAGS="$CFLAGS -mstackrealign" ohair@425: AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign]) ohair@425: AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], ohair@425: [ ohair@425: AC_MSG_RESULT([yes]) ohair@425: ], ohair@425: [ ohair@425: AC_MSG_RESULT([no]) ohair@425: AC_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) ohair@425: ]) ohair@425: fi ohair@425: ohair@425: if test "x$BUILD_OS" = xsolaris; then ohair@425: AC_PATH_PROG(NM, nm) ohair@425: WHICHCMD(NM) ohair@425: AC_PATH_PROG(STRIP, strip) ohair@425: WHICHCMD(STRIP) ohair@425: AC_PATH_PROG(MCS, mcs) ohair@425: WHICHCMD(MCS) ohair@425: else ohair@425: AC_CHECK_TOOL(NM, nm) ohair@425: WHICHCMD(NM) ohair@425: AC_CHECK_TOOL(STRIP, strip) ohair@425: WHICHCMD(STRIP) ohair@425: fi ohair@425: ohair@425: # When using cygwin, we need a wrapper binary that renames ohair@425: # /cygdrive/c/ arguments into c:/ arguments and peeks into ohair@425: # @files and rewrites these too! This wrapper binary is ohair@425: # called uncygdrive.exe. ohair@425: UNCYGDRIVE= ohair@425: if test "x$BUILD_OS" = xwindows; then ohair@425: AC_MSG_CHECKING([if uncygdrive can be created]) ohair@425: UNCYGDRIVE_SRC=`$CYGPATH -m $SRC_ROOT/common/src/uncygdrive.c` ohair@425: rm -f $OUTPUT_ROOT/uncygdrive* ohair@425: UNCYGDRIVE=`$CYGPATH -m $OUTPUT_ROOT/uncygdrive.exe` ohair@425: cd $OUTPUT_ROOT ohair@425: $CC $UNCYGDRIVE_SRC /Fe$UNCYGDRIVE > $OUTPUT_ROOT/uncygdrive1.log 2>&1 ohair@425: cd $CURDIR ohair@425: ohair@425: if test ! -x $OUTPUT_ROOT/uncygdrive.exe; then ohair@425: AC_MSG_RESULT([no]) ohair@425: cat $OUTPUT_ROOT/uncygdrive1.log ohair@425: AC_ERROR([Could not create $OUTPUT_ROOT/uncygdrive.exe]) ohair@425: fi ohair@425: AC_MSG_RESULT([$UNCYGDRIVE]) ohair@425: AC_MSG_CHECKING([if uncygdrive.exe works]) ohair@425: cd $OUTPUT_ROOT ohair@425: $UNCYGDRIVE $CC $SRC_ROOT/common/src/uncygdrive.c /Fe$OUTPUT_ROOT/uncygdrive2.exe > $OUTPUT_ROOT/uncygdrive2.log 2>&1 ohair@425: cd $CURDIR ohair@425: if test ! -x $OUTPUT_ROOT/uncygdrive2.exe; then ohair@425: AC_MSG_RESULT([no]) ohair@425: cat $OUTPUT_ROOT/uncygdrive2.log ohair@425: AC_ERROR([Uncygdrive did not work!]) ohair@425: fi ohair@425: AC_MSG_RESULT([yes]) ohair@425: rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj ohair@425: fi ohair@425: ohair@425: AC_SUBST(UNCYGDRIVE) ohair@425: ohair@425: TESTFOR_PROG_CCACHE ohair@425: ohair@425: # Used on GNU/Linux systems, can be empty... ohair@425: #AC_PATH_PROG(ELFDUMP, elfdump) ohair@425: ohair@425: # Setup default logging of stdout and stderr to build.log in the output root. ohair@425: BUILD_LOG='$(OUTPUT_ROOT)/build.log' ihse@430: BUILD_LOG_WRAPPER='$(SH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' ohair@425: AC_SUBST(BUILD_LOG) ohair@425: AC_SUBST(BUILD_LOG_WRAPPER) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. ohair@425: # (The JVM can use 32 or 64 bit Java pointers but that decision ohair@425: # is made at runtime.) ohair@425: # ohair@425: AC_CHECK_SIZEOF([int *], [1111]) ohair@425: if test "x$ac_cv_sizeof_int_p" = x0; then ohair@425: # The test failed, lets pick the assumed value. ohair@425: ARCH_DATA_MODEL=$HOST_CPU_BITS ohair@425: else ohair@425: ARCH_DATA_MODEL=`expr 8 \* $ac_cv_sizeof_int_p` ohair@425: fi ohair@425: ohair@425: if test "x$ARCH_DATA_MODEL" = x64; then ohair@425: A_LP64="LP64:=" ohair@425: ADD_LP64="-D_LP64=1" ohair@425: fi ohair@425: AC_MSG_CHECKING([for host address size]) ohair@425: AC_MSG_RESULT([$ARCH_DATA_MODEL bits]) ohair@425: AC_SUBST(LP64,$A_LP64) ohair@425: AC_SUBST(ARCH_DATA_MODEL) ohair@425: ohair@425: if test "x$ARCH_DATA_MODEL" != "x$HOST_CPU_BITS"; then ohair@425: AC_ERROR([The tested number of bits in the host ($ARCH_DATA_MODEL) differs from the number of bits expected to be found in the host ($HOST_CPU_BITS)]) ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Can the C/C++ compiler use precompiled headers? ohair@425: # ohair@425: AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], ohair@425: [use precompiled headers when compiling C++ @<:@enabled@:>@])], ohair@425: [ENABLE_PRECOMPH=${enable_precompiled-headers}], [ENABLE_PRECOMPH=yes]) ohair@425: ohair@425: USE_PRECOMPILED_HEADER=1 ohair@425: if test "x$ENABLE_PRECOMPH" = xno; then ohair@425: USE_PRECOMPILED_HEADER=0 ohair@425: fi ohair@425: ohair@425: if test "x$ENABLE_PRECOMPH" = xyes; then ohair@425: # Check that the compiler actually supports precomp headers. ohair@425: if test "x$GCC" = xyes; then ohair@425: AC_MSG_CHECKING([that precompiled headers work]) ohair@425: echo "int alfa();" > conftest.h ohair@425: $CXX -x c++-header conftest.h -o conftest.hpp.gch ohair@425: if test ! -f conftest.hpp.gch; then ohair@425: echo Precompiled header is not working! ohair@425: USE_PRECOMPILED_HEADER=0 ohair@425: AC_MSG_RESULT([no]) ohair@425: else ohair@425: AC_MSG_RESULT([yes]) ohair@425: fi ohair@425: rm -f conftest.h ohair@425: fi ohair@425: fi ohair@425: ohair@425: AC_SUBST(USE_PRECOMPILED_HEADER) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # How to compile shared libraries. ohair@425: # ohair@425: ohair@425: if test "x$GCC" = xyes; then ohair@425: COMPILER_NAME=gcc ohair@425: PICFLAG="-fPIC" ohair@425: LIBRARY_PREFIX=lib ohair@425: SHARED_LIBRARY='lib$1.so' ohair@425: STATIC_LIBRARY='lib$1.a' ohair@425: SHARED_LIBRARY_FLAGS="-shared" ohair@425: SHARED_LIBRARY_SUFFIX='.so' ohair@425: STATIC_LIBRARY_SUFFIX='.a' ohair@425: OBJ_SUFFIX='.o' ohair@425: EXE_SUFFIX='' ohair@425: SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1' ohair@425: SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$(JDK_TOPDIR)/$1' ohair@425: SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN/$1' ohair@425: LD="$CC" ohair@425: LDEXE="$CC" ohair@425: LDCXX="$CXX" ohair@425: LDEXECXX="$CXX" ohair@425: ohair@425: # Linking is different on MacOSX ohair@425: if test "x$BUILD_OS" = xmacosx; then ohair@425: # Might change in the future to clang. ohair@425: COMPILER_NAME=gcc ohair@425: SHARED_LIBRARY='lib$1.dylib' ohair@425: SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" ohair@425: SHARED_LIBRARY_SUFFIX='.dylib' ohair@425: EXE_SUFFIX='' ohair@425: SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1' ohair@425: SET_SHARED_LIBRARY_MAPFILE='' ohair@425: SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' ohair@425: fi ohair@425: else ohair@425: if test "x$BUILD_OS" = xsolaris; then ohair@425: # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler ohair@425: COMPILER_NAME=ossc ohair@425: PICFLAG="-KPIC" ohair@425: LIBRARY_PREFIX=lib ohair@425: SHARED_LIBRARY='lib$1.so' ohair@425: STATIC_LIBRARY='lib$1.a' ohair@425: SHARED_LIBRARY_FLAGS="-G" ohair@425: SHARED_LIBRARY_SUFFIX='.so' ohair@425: STATIC_LIBRARY_SUFFIX='.a' ohair@425: OBJ_SUFFIX='.o' ohair@425: EXE_SUFFIX='' ohair@425: SET_SHARED_LIBRARY_NAME='' ohair@425: SET_SHARED_LIBRARY_MAPFILE='-M $(JDK_TOPDIR)/$1' ohair@425: SET_SHARED_LIBRARY_ORIGIN='-R \$$$$ORIGIN/$1' ohair@425: CFLAGS_JDKLIB_EXTRA='-xstrconst -D__solaris__' ohair@425: fi ohair@425: if test "x$BUILD_OS" = xwindows; then ohair@425: # If it is not gcc, then assume it is the MS Visual Studio compiler ohair@425: COMPILER_NAME=cl ohair@425: PICFLAG="" ohair@425: LIBRARY_PREFIX= ohair@425: SHARED_LIBRARY='$1.dll' ohair@425: STATIC_LIBRARY='$1.lib' ohair@425: SHARED_LIBRARY_FLAGS="-LD" ohair@425: SHARED_LIBRARY_SUFFIX='.dll' ohair@425: STATIC_LIBRARY_SUFFIX='.lib' ohair@425: OBJ_SUFFIX='.obj' ohair@425: EXE_SUFFIX='.exe' ohair@425: SET_SHARED_LIBRARY_NAME='' ohair@425: SET_SHARED_LIBRARY_MAPFILE='' ohair@425: SET_SHARED_LIBRARY_ORIGIN='' ohair@425: fi ohair@425: fi ohair@425: ohair@425: AC_SUBST(OBJ_SUFFIX) ohair@425: AC_SUBST(SHARED_LIBRARY) ohair@425: AC_SUBST(STATIC_LIBRARY) ohair@425: AC_SUBST(LIBRARY_PREFIX) ohair@425: AC_SUBST(SHARED_LIBRARY_SUFFIX) ohair@425: AC_SUBST(STATIC_LIBRARY_SUFFIX) ohair@425: AC_SUBST(EXE_SUFFIX) ohair@425: AC_SUBST(SHARED_LIBRARY_FLAGS) ohair@425: AC_SUBST(SET_SHARED_LIBRARY_NAME) ohair@425: AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) ohair@425: AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) ohair@425: ohair@425: # The (cross) compiler is now configured, we can now test capabilities ohair@425: # of the host platform. ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Is the host little of big endian? ohair@425: # ohair@425: AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal"]) ohair@425: ohair@425: if test "x$ENDIAN" = xuniversal; then ohair@425: AC_ERROR([It seems like someone needs to decide how we are to deal with universal binaries on the MacOSX?]) ohair@425: fi ohair@425: if test "x$ENDIAN" = xunknown; then ohair@425: ENDIAN="$HOST_CPU_ENDIAN" ohair@425: fi ohair@425: if test "x$ENDIAN" != "x$HOST_CPU_ENDIAN"; then ohair@425: AC_WARN([The tested endian in the host ($ENDIAN) differs from the endian expected to be found in the host ($HOST_CPU_ENDIAN)]) ohair@425: ENDIAN="$HOST_CPU_ENDIAN" ohair@425: fi ohair@425: AC_SUBST(ENDIAN) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # We need a Boot JDK to bootstrap the build. ohair@425: # ohair@425: BOOT_JDK_FOUND=no ohair@425: AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk], ohair@425: [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])]) ohair@425: ohair@425: if test "x$with_boot_jdk" != x; then ohair@425: BOOT_JDK=$with_boot_jdk ohair@425: BOOT_JDK_FOUND=yes ohair@425: fi ohair@425: if test "x$BOOT_JDK_FOUND" = xno; then ohair@425: BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=yes], [BOOT_JDK_FOUND=no]) ohair@425: fi ohair@425: ohair@425: if test "x$BOOT_JDK_FOUND" = xno; then ohair@425: if test "x$JAVA_HOME" != x; then ohair@425: if test ! -d "$JAVA_HOME"; then ohair@425: AC_ERROR([Your JAVA_HOME points to a non-existing directory!]) ohair@425: fi ohair@425: # Aha, the user has set a JAVA_HOME ohair@425: # let us use that as the Boot JDK. ohair@425: BOOT_JDK=$JAVA_HOME ohair@425: BOOT_JDK_FOUND=yes ohair@425: # To be on the safe side, lets check that it is a JDK. ohair@425: if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then ohair@425: JAVAC=$BOOT_JDK/bin/javac ohair@425: JAVA=$BOOT_JDK/bin/java ohair@425: BOOT_JDK_FOUND=yes ohair@425: else ohair@425: AC_ERROR([Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK.]) ohair@425: fi ohair@425: fi ohair@425: fi ohair@425: ohair@425: if test "x$BOOT_JDK_FOUND" = xno; then ohair@425: AC_PATH_PROG(JAVAC_CHECK, javac) ohair@425: AC_PATH_PROG(JAVA_CHECK, java) ohair@425: BINARY="$JAVAC_CHECK" ohair@425: if test "x$JAVAC_CHECK" = x; then ohair@425: BINARY="$JAVA_CHECK" ohair@425: fi ohair@425: if test "x$BINARY" != x; then ohair@425: # So there is a java(c) binary, it might be part of a JDK. ohair@425: # Lets find the JDK/JRE directory by following symbolic links. ohair@425: # Linux/GNU systems often have links from /usr/bin/java to ohair@425: # /etc/alternatives/java to the real JDK binary. ohair@425: WHICHCMD_SPACESAFE(BINARY,[path to javac]) ohair@425: REMOVE_SYMBOLIC_LINKS(BINARY) ohair@425: BOOT_JDK=`dirname $BINARY` ohair@425: BOOT_JDK=`cd $BOOT_JDK/..; pwd` ohair@425: if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then ohair@425: JAVAC=$BOOT_JDK/bin/javac ohair@425: JAVA=$BOOT_JDK/bin/java ohair@425: BOOT_JDK_FOUND=yes ohair@425: fi ohair@425: fi ohair@425: fi ohair@425: ohair@425: if test "x$BOOT_JDK_FOUND" = xno; then ohair@425: # Try the MacOSX way. ohair@425: if test -x /usr/libexec/java_home; then ohair@425: BOOT_JDK=`/usr/libexec/java_home` ohair@425: if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then ohair@425: JAVAC=$BOOT_JDK/bin/javac ohair@425: JAVA=$BOOT_JDK/bin/java ohair@425: BOOT_JDK_FOUND=yes ohair@425: fi ohair@425: fi ohair@425: fi ohair@425: ohair@425: if test "x$BOOT_JDK_FOUND" = xno; then ohair@425: AC_PATH_PROG(JAVA_CHECK, java) ohair@425: if test "x$JAVA_CHECK" != x; then ohair@425: # There is a java in the path. But apparently we have not found a javac ohair@425: # in the path, since that would have been tested earlier. ohair@425: if test "x$HOST_OS" = xwindows; then ohair@425: # Now if this is a windows platform. The default installation of a JDK ohair@425: # actually puts the JRE in the path and keeps the JDK out of the path! ohair@425: # Go look in the default installation location. ohair@425: BOOT_JDK=/cygdrive/c/Program\ Files/Java/`ls /cygdrive/c/Program\ Files/Java | grep jdk | sort -r | head --lines 1` ohair@425: if test -d "$BOOT_JDK"; then ohair@425: BOOT_JDK_FOUND=yes ohair@425: fi ohair@425: fi ohair@425: if test "x$BOOT_JDK_FOUND" = xno; then ohair@425: help_on_build_dependency openjdk ohair@425: AC_ERROR([Found a JRE, not not a JDK! Please remove the JRE from your path and put a JDK there instead. $HELP_MSG]) ohair@425: fi ohair@425: else ohair@425: help_on_build_dependency openjdk ohair@425: AC_ERROR([Could not find a JDK. $HELP_MSG]) ohair@425: fi ohair@425: fi ohair@425: ohair@425: WIN_FIX_PATH(BOOT_JDK) ohair@425: ohair@425: # Now see if we can find the rt.jar, or its nearest equivalent. ohair@425: BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar" ohair@425: SPACESAFE(BOOT_RTJAR,[the path to the Boot JDK rt.jar (or nearest equivalent)]) ohair@425: ohair@425: BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar" ohair@425: SPACESAFE(BOOT_TOOLSJAR,[the path to the Boot JDK tools.jar (or nearest equivalent)]) ohair@425: ohair@425: if test ! -f $BOOT_RTJAR; then ohair@425: # On MacOSX it is called classes.jar ohair@425: BOOT_RTJAR=$BOOT_JDK/../Classes/classes.jar ohair@425: if test ! -f $BOOT_RTJAR; then ohair@425: AC_ERROR([Cannot find the rt.jar or its equivalent!]) ohair@425: fi ohair@425: # Remove the .. ohair@425: BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}" ohair@425: # The tools.jar is part of classes.jar ohair@425: BOOT_TOOLSJAR="$BOOT_RTJAR" ohair@425: fi ohair@425: ohair@425: AC_SUBST(BOOT_JDK) ohair@425: AC_SUBST(BOOT_RTJAR) ohair@425: AC_SUBST(BOOT_TOOLSJAR) ohair@425: AC_MSG_CHECKING([for Boot JDK]) ohair@425: AC_MSG_RESULT([$BOOT_JDK]) ohair@425: AC_MSG_CHECKING([for Boot rt.jar]) ohair@425: AC_MSG_RESULT([$BOOT_RTJAR]) ohair@425: AC_MSG_CHECKING([for Boot tools.jar]) ohair@425: AC_MSG_RESULT([$BOOT_TOOLSJAR]) ohair@425: ohair@425: # Use the java tool from the Boot JDK. ohair@425: AC_MSG_CHECKING([for java in Boot JDK]) ohair@425: JAVA=$BOOT_JDK/bin/java ohair@425: if test ! -x $JAVA; then ohair@425: AC_ERROR([Could not find a working java]) ohair@425: fi ohair@425: BOOT_JDK_VERSION=`$JAVA -version 2>&1 | head -n 1` ohair@425: AC_MSG_RESULT([yes $BOOT_JDK_VERSION]) ohair@425: AC_SUBST(JAVA) ohair@425: ohair@425: # Extra M4 quote needed to protect [] in grep expression. ohair@425: [FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'`] ohair@425: if test "x$FOUND_VERSION_78" = x; then ohair@425: help_on_build_dependency openjdk ohair@425: AC_ERROR([Your bootjdk must be version 7 or 8. $HELP_MSG]) ohair@425: fi ohair@425: ohair@425: # When compiling code to be executed by the Boot JDK, force jdk7 compatibility. ohair@425: BOOT_JDK_SOURCETARGET="-source 7 -target 7" ohair@425: AC_SUBST(BOOT_JDK_SOURCETARGET) ohair@425: ohair@425: # Use the javac tool from the Boot JDK. ohair@425: AC_MSG_CHECKING([for javac in Boot JDK]) ohair@425: JAVAC=$BOOT_JDK/bin/javac ohair@425: if test ! -x $JAVAC; then ohair@425: AC_ERROR([Could not find a working javac]) ohair@425: fi ohair@425: AC_MSG_RESULT(yes) ohair@425: AC_SUBST(JAVAC) ohair@425: AC_SUBST(JAVAC_FLAGS) ohair@425: ohair@425: # Use the javac tool from the Boot JDK. ohair@425: AC_MSG_CHECKING([for javah in Boot JDK]) ohair@425: JAVAH=$BOOT_JDK/bin/javah ohair@425: if test ! -x $JAVAH; then ohair@425: AC_ERROR([Could not find a working javah]) ohair@425: fi ohair@425: AC_MSG_RESULT(yes) ohair@425: AC_SUBST(JAVAH) ohair@425: ohair@425: # Use the jar tool from the Boot JDK. ohair@425: AC_MSG_CHECKING([for jar in Boot JDK]) ohair@425: JAR=$BOOT_JDK/bin/jar ohair@425: if test ! -x $JAR; then ohair@425: AC_ERROR([Could not find a working jar]) ohair@425: fi ohair@425: AC_SUBST(JAR) ohair@425: AC_MSG_RESULT(yes) ohair@425: ohair@425: # Use the rmic tool from the Boot JDK. ohair@425: AC_MSG_CHECKING([for rmic in Boot JDK]) ohair@425: RMIC=$BOOT_JDK/bin/rmic ohair@425: if test ! -x $RMIC; then ohair@425: AC_ERROR([Could not find a working rmic]) ohair@425: fi ohair@425: AC_SUBST(RMIC) ohair@425: AC_MSG_RESULT(yes) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Pickup additional source for a component from outside of the source root ohair@425: # or override source for a component. ohair@425: # ohair@425: AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root], ohair@425: [for each and every source directory, look in this additional source root for ohair@425: the same directory; if it exists and have files in it, include it in the build])]) ohair@425: ohair@425: AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root], ohair@425: [for each and every source directory, look in this override source root for ohair@425: the same directory; if it exists, use that directory instead and ohair@425: ignore the directory in the original source root])]) ohair@425: ohair@425: AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides], ohair@425: [use the subdirs 'adds' and 'overrides' in the specified directory as ohair@425: add-source-root and override-source-root])]) ohair@425: ohair@425: if test "x$with_adds_and_overrides" != x; then ohair@425: with_add_source_root="$with_adds_and_overrides/adds" ohair@425: with_override_source_root="$with_adds_and_overrides/overrides" ohair@425: fi ohair@425: ohair@425: if test "x$with_add_source_root" != x; then ohair@425: if ! test -d $with_add_source_root; then ohair@425: AC_ERROR([Trying to use a non-existant add-source-root $with_add_source_root]) ohair@425: fi ohair@425: CURDIR="$PWD" ohair@425: cd "$with_add_source_root" ohair@425: ADD_SRC_ROOT="`pwd`" ohair@425: cd "$CURDIR" ohair@425: # Verify that the addon source root does not have any root makefiles. ohair@425: # If it does, then it is usually an error, prevent this. ohair@425: if test -f $with_add_source_root/langtools/makefiles/Makefile || \ ohair@425: test -f $with_add_source_root/langtools/make/Makefile; then ohair@425: AC_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.]) ohair@425: fi ohair@425: if test -f $with_add_source_root/corba/makefiles/Makefile || \ ohair@425: test -f $with_add_source_root/corba/make/Makefile; then ohair@425: AC_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.]) ohair@425: fi ohair@425: if test -f $with_add_source_root/jaxp/makefiles/Makefile || \ ohair@425: test -f $with_add_source_root/jaxp/make/Makefile; then ohair@425: AC_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.]) ohair@425: fi ohair@425: if test -f $with_add_source_root/jaxws/makefiles/Makefile || \ ohair@425: test -f $with_add_source_root/jaxws/make/Makefile; then ohair@425: AC_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.]) ohair@425: fi ohair@425: if test -f $with_add_source_root/hotspot/makefiles/Makefile || \ ohair@425: test -f $with_add_source_root/hotspot/make/Makefile; then ohair@425: AC_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.]) ohair@425: fi ohair@425: if test -f $with_add_source_root/jdk/makefiles/Makefile || \ ohair@425: test -f $with_add_source_root/jdk/make/Makefile; then ohair@425: AC_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.]) ohair@425: fi ohair@425: fi ohair@425: AC_SUBST(ADD_SRC_ROOT) ohair@425: ohair@425: if test "x$with_override_source_root" != x; then ohair@425: if ! test -d $with_override_source_root; then ohair@425: AC_ERROR([Trying to use a non-existant override-source-root $with_override_source_root]) ohair@425: fi ohair@425: CURDIR="$PWD" ohair@425: cd "$with_override_source_root" ohair@425: OVERRIDE_SRC_ROOT="`pwd`" ohair@425: cd "$CURDIR" ohair@425: if test -f $with_override_source_root/langtools/makefiles/Makefile || \ ohair@425: test -f $with_override_source_root/langtools/make/Makefile; then ohair@425: AC_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.]) ohair@425: fi ohair@425: if test -f $with_override_source_root/corba/makefiles/Makefile || \ ohair@425: test -f $with_override_source_root/corba/make/Makefile; then ohair@425: AC_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.]) ohair@425: fi ohair@425: if test -f $with_override_source_root/jaxp/makefiles/Makefile || \ ohair@425: test -f $with_override_source_root/jaxp/make/Makefile; then ohair@425: AC_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.]) ohair@425: fi ohair@425: if test -f $with_override_source_root/jaxws/makefiles/Makefile || \ ohair@425: test -f $with_override_source_root/jaxws/make/Makefile; then ohair@425: AC_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.]) ohair@425: fi ohair@425: if test -f $with_override_source_root/hotspot/makefiles/Makefile || \ ohair@425: test -f $with_override_source_root/hotspot/make/Makefile; then ohair@425: AC_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.]) ohair@425: fi ohair@425: if test -f $with_override_source_root/jdk/makefiles/Makefile || \ ohair@425: test -f $with_override_source_root/jdk/make/Makefile; then ohair@425: AC_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.]) ohair@425: fi ohair@425: fi ohair@425: AC_SUBST(OVERRIDE_SRC_ROOT) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Override a repo completely, this is used for example when you have 3 small ohair@425: # development sandboxes of the langtools sources and want to avoid having 3 full ohair@425: # OpenJDK sources checked out on disk. ohair@425: # ohair@425: # Assuming that the 3 langtools sandboxes are located here: ohair@425: # /home/fredrik/sandbox1/langtools ohair@425: # /home/fredrik/sandbox2/langtools ohair@425: # /home/fredrik/sandbox3/langtools ohair@425: # ohair@425: # From the source root you create build subdirs manually: ohair@425: # mkdir -p build1 build2 build3 ohair@425: # in each build directory run: ohair@425: # (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) ohair@425: # (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) ohair@425: # (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) ohair@425: # ohair@425: ohair@425: AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools], ohair@425: [use this langtools dir for the build])]) ohair@425: ohair@425: AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba], ohair@425: [use this corba dir for the build])]) ohair@425: ohair@425: AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp], ohair@425: [use this jaxp dir for the build])]) ohair@425: ohair@425: AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws], ohair@425: [use this jaxws dir for the build])]) ohair@425: ohair@425: AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot], ohair@425: [use this hotspot dir for the build])]) ohair@425: ohair@425: AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk], ohair@425: [use this jdk dir for the build])]) ohair@425: ohair@425: if test "x$with_override_langtools" != x; then ohair@425: CURDIR="$PWD" ohair@425: cd "$with_override_langtools" ohair@425: LANGTOOLS_TOPDIR="`pwd`" ohair@425: cd "$CURDIR" ohair@425: if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then ohair@425: AC_ERROR([You have to override langtools with a full langtools repo!]) ohair@425: fi ohair@425: AC_MSG_CHECKING([if langtools should be overridden]) ohair@425: AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR]) ohair@425: fi ohair@425: if test "x$with_override_corba" != x; then ohair@425: CURDIR="$PWD" ohair@425: cd "$with_override_corba" ohair@425: CORBA_TOPDIR="`pwd`" ohair@425: cd "$CURDIR" ohair@425: if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then ohair@425: AC_ERROR([You have to override corba with a full corba repo!]) ohair@425: fi ohair@425: AC_MSG_CHECKING([if corba should be overridden]) ohair@425: AC_MSG_RESULT([yes with $CORBA_TOPDIR]) ohair@425: fi ohair@425: if test "x$with_override_jaxp" != x; then ohair@425: CURDIR="$PWD" ohair@425: cd "$with_override_jaxp" ohair@425: JAXP_TOPDIR="`pwd`" ohair@425: cd "$CURDIR" ohair@425: if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then ohair@425: AC_ERROR([You have to override jaxp with a full jaxp repo!]) ohair@425: fi ohair@425: AC_MSG_CHECKING([if jaxp should be overridden]) ohair@425: AC_MSG_RESULT([yes with $JAXP_TOPDIR]) ohair@425: fi ohair@425: if test "x$with_override_jaxws" != x; then ohair@425: CURDIR="$PWD" ohair@425: cd "$with_override_jaxws" ohair@425: JAXWS_TOPDIR="`pwd`" ohair@425: cd "$CURDIR" ohair@425: if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then ohair@425: AC_ERROR([You have to override jaxws with a full jaxws repo!]) ohair@425: fi ohair@425: AC_MSG_CHECKING([if jaxws should be overridden]) ohair@425: AC_MSG_RESULT([yes with $JAXWS_TOPDIR]) ohair@425: fi ohair@425: if test "x$with_override_hotspot" != x; then ohair@425: CURDIR="$PWD" ohair@425: cd "$with_override_hotspot" ohair@425: HOTSPOT_TOPDIR="`pwd`" ohair@425: cd "$CURDIR" ohair@425: if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \ ohair@425: ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then ohair@425: AC_ERROR([You have to override hotspot with a full hotspot repo!]) ohair@425: fi ohair@425: AC_MSG_CHECKING([if hotspot should be overridden]) ohair@425: AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR]) ohair@425: fi ohair@425: if test "x$with_override_jdk" != x; then ohair@425: CURDIR="$PWD" ohair@425: cd "$with_override_jdk" ohair@425: JDK_TOPDIR="`pwd`" ohair@425: cd "$CURDIR" ohair@425: if ! test -f $JDK_TOPDIR/makefiles/Makefile; then ohair@425: AC_ERROR([You have to override JDK with a full JDK repo!]) ohair@425: fi ohair@425: AC_MSG_CHECKING([if JDK should be overridden]) ohair@425: AC_MSG_RESULT([yes with $JDK_TOPDIR]) ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Specify options for anything that is run with the Boot JDK. ohair@425: # ohair@425: AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], ohair@425: [specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values, ohair@425: e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])]) ohair@425: ohair@425: if test "x$with_boot_jdk_jvmargs" = x; then ohair@425: # Not all JVM:s accept the same arguments on the command line. ohair@425: # OpenJDK specific increase in thread stack for JDK build, ohair@425: # well more specifically, when running javac. ohair@425: if test "x$BUILD_NUM_BITS" = x32; then ohair@425: STACK_SIZE=768 ohair@425: else ohair@425: # Running Javac on a JVM on a 64-bit machine, the stack takes more space ohair@425: # since 64-bit pointers are pushed on the stach. Apparently, we need ohair@425: # to increase the stack space when javacing the JDK.... ohair@425: STACK_SIZE=1536 ohair@425: fi ohair@425: ohair@425: # Minimum amount of heap memory. ohair@425: ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA]) ohair@425: if test "x$HOST_OS" = "xmacosx"; then ohair@425: # Why does macosx need more heap? Its the huge JDK batch. ohair@425: ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA]) ohair@425: else ohair@425: ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA]) ohair@425: fi ohair@425: # When is adding -client something that speeds up the JVM? ohair@425: # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],boot_jdk_jvmargs,[$JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],boot_jdk_jvmargs,[$JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA]) ohair@425: # Disable special log output when a debug build is used as Boot JDK... ohair@425: ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) ohair@425: fi ohair@425: ohair@425: AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs) ohair@425: ohair@425: AC_ARG_WITH(server-java, [AS_HELP_STRING([--with-server-java], ohair@425: [use this java binary for running the javac background server and other long running java tasks in the build process, ohair@425: e.g. ---with-server-java="/opt/jrockit/bin/java -server"])]) ohair@425: ohair@425: if test "x$with_server_java" != x; then ohair@425: SERVER_JAVA="$with_server_java" ohair@425: FOUND_VERSION=`$SERVER_JAVA -version 2>&1 | grep " version \""` ohair@425: if test "x$FOUND_VERSION" = x; then ohair@425: AC_ERROR([Could not execute server java: $SERVER_JAVA]) ohair@425: fi ohair@425: else ohair@425: SERVER_JAVA="" ohair@425: # Hotspot specific options. ohair@425: ADD_JVM_ARG_IF_OK([-XX:+UseParallelOldGC],SERVER_JAVA,[$JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-verbosegc],SERVER_JAVA,[$JAVA]) ohair@425: # JRockit specific options. ohair@425: ADD_JVM_ARG_IF_OK([-Xverbose:gc],SERVER_JAVA,[$JAVA]) ohair@425: SERVER_JAVA="$JAVA $SERVER_JAVA" ohair@425: fi ohair@425: AC_SUBST(SERVER_JAVA) ohair@425: ohair@425: AC_MSG_CHECKING([whether to use shared server for javac]) ohair@425: AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server], ohair@425: [enable the shared javac server during the build process @<:@disabled@:>@])], ohair@425: [ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER='no']) ohair@425: AC_MSG_RESULT([$ENABLE_JAVAC_SERVER]) ohair@425: if test "x$ENABLE_JAVAC_SERVER" = xyes; then ohair@425: JAVAC_USE_REMOTE=true ohair@425: JAVAC_SERVERS="$OUTPUT_ROOT/javacservers" ohair@425: else ohair@425: JAVAC_USE_REMOTE=false ohair@425: JAVAC_SERVERS= ohair@425: fi ohair@425: AC_SUBST(JAVAC_USE_REMOTE) ohair@425: AC_SUBST(JAVAC_SERVERS) ohair@425: ohair@425: AC_ARG_WITH(javac-server-cores, [AS_HELP_STRING([--with-javac-server-cores], ohair@425: [use at most this number of concurrent threads on the javac server @<:@probed@:>@])]) ohair@425: if test "x$with_javac_server_cores" != x; then ohair@425: JAVAC_SERVER_CORES="$with_javac_server_cores" ohair@425: else ohair@425: if test "$NUM_CORES" -gt 16; then ohair@425: # We set this arbitrary limit because we want to limit the heap ohair@425: # size of the javac server. ohair@425: # In the future we will make the javac compilers in the server ohair@425: # share more and more state, thus enabling us to use more and ohair@425: # more concurrent threads in the server. ohair@425: JAVAC_SERVER_CORES="16" ohair@425: else ohair@425: JAVAC_SERVER_CORES="$NUM_CORES" ohair@425: fi ohair@425: ohair@425: if test "$MEMORY_SIZE" -gt "17000"; then ohair@425: MAX_HEAP_MEM=10000 ohair@425: ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xmn2G],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: elif test "$MEMORY_SIZE" -gt "10000"; then ohair@425: MAX_HEAP_MEM=6000 ohair@425: ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xmn1G],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: elif test "$MEMORY_SIZE" -gt "5000"; then ohair@425: MAX_HEAP_MEM=3000 ohair@425: ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: elif test "$MEMORY_SIZE" -gt "3800"; then ohair@425: MAX_HEAP_MEM=2500 ohair@425: ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: elif test "$MEMORY_SIZE" -gt "1900"; then ohair@425: MAX_HEAP_MEM=1200 ohair@425: ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1200M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: elif test "$MEMORY_SIZE" -gt "1000"; then ohair@425: MAX_HEAP_MEM=900 ohair@425: ADD_JVM_ARG_IF_OK([-Xms400M -Xmx900M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: else ohair@425: MAX_HEAP_MEM=512 ohair@425: ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA]) ohair@425: fi ohair@425: ohair@425: MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501` ohair@425: if test "$JAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then ohair@425: AC_MSG_CHECKING([if number of server cores must be reduced]) ohair@425: JAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP" ohair@425: AC_MSG_RESULT([yes, to $JAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB]) ohair@425: fi ohair@425: fi ohair@425: AC_SUBST(JAVAC_SERVER_CORES) ohair@425: ohair@425: AC_MSG_CHECKING([whether to track dependencies between Java packages]) ohair@425: AC_ARG_ENABLE([javac-deps], [AS_HELP_STRING([--enable-javac-deps], ohair@425: [enable the dependency tracking between Java packages @<:@disabled@:>@])], ohair@425: [ENABLE_JAVAC_DEPS="${enableval}"], [ENABLE_JAVAC_DEPS='no']) ohair@425: AC_MSG_RESULT([$ENABLE_JAVAC_DEPS]) ohair@425: if test "x$ENABLE_JAVAC_DEPS" = xyes; then ohair@425: JAVAC_USE_DEPS=true ohair@425: else ohair@425: JAVAC_USE_DEPS=false ohair@425: fi ohair@425: AC_SUBST(JAVAC_USE_DEPS) ohair@425: ohair@425: AC_MSG_CHECKING([whether to use multiple cores for javac compilation]) ohair@425: AC_ARG_ENABLE([javac-multi-core], [AS_HELP_STRING([--enable-javac-multi-core], ohair@425: [compile Java packages concurrently @<:@disabled@:>@])], ohair@425: [ENABLE_JAVAC_MULTICORE="${enableval}"], [ENABLE_JAVAC_MULTICORE='no']) ohair@425: AC_MSG_RESULT([$ENABLE_JAVAC_MULTICORE]) ohair@425: if test "x$ENABLE_JAVAC_MULTICORE" = xyes; then ohair@425: JAVAC_USE_MODE=MULTI_CORE_CONCURRENT ohair@425: else ohair@425: JAVAC_USE_MODE=SINGLE_THREADED_BATCH ohair@425: if test "x$ENABLE_JAVAC_DEPS" = xyes; then ohair@425: AC_MSG_WARN([Dependency tracking is not supported with single threaded batch compiles of Java source roots. Please add --disable-javac-deps to your configure options.]) ohair@425: AC_MSG_WARN([Disabling dependency tracking for you now.]) ohair@425: JAVAC_USE_DEPS=false ohair@425: fi ohair@425: if test "x$ENABLE_JAVAC_SERVER" = xyes; then ohair@425: AC_MSG_WARN([The javac server will not be used since single threaded batch compiles are run within their own JVM. Please add --disable-javac-server to your configure options.]) ohair@425: AC_MSG_WARN([Disabling javac server for you now.]) ohair@425: JAVAC_USE_REMOTE=false ohair@425: fi ohair@425: fi ohair@425: AC_SUBST(JAVAC_USE_MODE) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # OS specific settings that we never will need to probe. ohair@425: # ohair@425: if test "x$HOST_OS" = xlinux; then ohair@425: AC_MSG_CHECKING([what is not needed on Linux?]) ohair@425: PULSE_NOT_NEEDED=yes ohair@425: AC_MSG_RESULT([pulse]) ohair@425: fi ohair@425: ohair@425: if test "x$HOST_OS" = xsolaris; then ohair@425: AC_MSG_CHECKING([what is not needed on Solaris?]) ohair@425: ALSA_NOT_NEEDED=yes ohair@425: PULSE_NOT_NEEDED=yes ohair@425: AC_MSG_RESULT([alsa pulse]) ohair@425: fi ohair@425: ohair@425: if test "x$HOST_OS" = xwindows; then ohair@425: AC_MSG_CHECKING([what is not needed on Windows?]) ohair@425: CUPS_NOT_NEEDED=yes ohair@425: ALSA_NOT_NEEDED=yes ohair@425: PULSE_NOT_NEEDED=yes ohair@425: X11_NOT_NEEDED=yes ohair@425: AC_MSG_RESULT([alsa cups pulse x11]) ohair@425: fi ohair@425: ohair@425: if test "x$HOST_OS" = xmacosx; then ohair@425: AC_MSG_CHECKING([what is not needed on MacOSX?]) ohair@425: ALSA_NOT_NEEDED=yes ohair@425: PULSE_NOT_NEEDED=yes ohair@425: X11_NOT_NEEDED=yes ohair@425: FREETYPE2_NOT_NEEDED=yes ohair@425: # If the java runtime framework is disabled, then we need X11. ohair@425: # This will be adjusted below. ohair@425: AC_MSG_RESULT([alsa pulse x11]) ohair@425: fi ohair@425: ohair@425: if test "x$HOST_OS" = xbsd; then ohair@425: AC_MSG_CHECKING([what is not needed on bsd?]) ohair@425: ALSA_NOT_NEEDED=yes ohair@425: AC_MSG_RESULT([alsa]) ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check for MacOSX support for OpenJDK. If this exists, try to build a JVM ohair@425: # that uses this API. ohair@425: # ohair@425: AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support], ohair@425: [disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])], ohair@425: [MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"]) ohair@425: ohair@425: USE_MACOSX_RUNTIME_SUPPORT=no ohair@425: AC_MSG_CHECKING([for explicit Java runtime support in the OS]) ohair@425: if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then ohair@425: if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then ohair@425: MACOSX_RUNTIME_SUPPORT=yes ohair@425: USE_MACOSX_RUNTIME_SUPPORT=yes ohair@425: AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11]) ohair@425: else ohair@425: AC_MSG_RESULT([yes, but explicitly disabled.]) ohair@425: fi ohair@425: else ohair@425: AC_MSG_RESULT([no]) ohair@425: fi ohair@425: ohair@425: if test "x$HOST_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then ohair@425: AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?]) ohair@425: X11_NOT_NEEDED= ohair@425: FREETYPE2_NOT_NEEDED= ohair@425: AC_MSG_RESULT([alsa pulse]) ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check for X Windows ohair@425: # ohair@425: AC_PATH_XTRA ohair@425: ohair@425: if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then ohair@425: help_on_build_dependency x11 ohair@425: AC_ERROR([Could not find X11 libraries. $HELP_MSG]) ohair@425: fi ohair@425: ohair@425: AC_SUBST(X_CFLAGS) ohair@425: AC_SUBST(X_LIBS) ohair@425: ohair@425: # Some of the old makefiles require a setting of OPENWIN_HOME ohair@425: # Since the X11R6 directory has disappeared on later Linuxes, ohair@425: # we need to probe for it. ohair@425: if test "x$HOST_OS" = xlinux; then ohair@425: if test -d "$SYS_ROOT/usr/X11R6"; then ohair@425: OPENWIN_HOME="$SYS_ROOT/usr/X11R6" ohair@425: fi ohair@425: if test -d "$SYS_ROOT/usr/include/X11"; then ohair@425: OPENWIN_HOME="$SYS_ROOT/usr" ohair@425: fi ohair@425: fi ohair@425: if test "x$HOST_OS" = xsolaris; then ohair@425: OPENWIN_HOME="/usr/openwin" ohair@425: fi ohair@425: AC_SUBST(OPENWIN_HOME) ohair@425: ohair@425: AC_LANG_PUSH(C) ohair@425: OLD_CFLAGS="$CFLAGS" ohair@425: CFLAGS="$CFLAGS $X_CFLAGS" ohair@425: AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h], ohair@425: [X11_A_OK=yes], ohair@425: [X11_A_OK=no]) ohair@425: CFLAGS="$OLD_CFLAGS" ohair@425: AC_LANG_POP(C) ohair@425: ohair@425: if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then ohair@425: help_on_build_dependency x11 ohair@425: AC_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG]) ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # The common unix printing system cups is used to print from java. ohair@425: # ohair@425: AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], ohair@425: [specify prefix directory for the cups package ohair@425: (expecting the libraries under PATH/lib and the headers under PATH/include)])]) ohair@425: AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], ohair@425: [specify directory for the cups include files])]) ohair@425: AC_ARG_WITH(cups-lib, [AS_HELP_STRING([--with-cups-lib], ohair@425: [specify directory for the cups library])]) ohair@425: ohair@425: if test "x$CUPS_NOT_NEEDED" = xyes; then ohair@425: if test "x$with_cups" != x || test "x$with_cups-include" != x || test "x$with_cups-lib" != x; then ohair@425: AC_MSG_WARN([cups not used, so --with-cups is ignored]) ohair@425: fi ohair@425: CUPS_CFLAGS= ohair@425: CUPS_LIBS= ohair@425: else ohair@425: CUPS_FOUND=no ohair@425: ohair@425: if test "x$with_cups" = xno || test "x$with_cups-include" = xno || test "x$with_cups-lib" = xno; then ohair@425: AC_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) ohair@425: fi ohair@425: ohair@425: if test "x$with_cups" != x; then ohair@425: CUPS_LIBS="-L$with_cups/lib -lcups" ohair@425: CUPS_CFLAGS="-I$with_cups/include" ohair@425: CUPS_FOUND=yes ohair@425: fi ohair@425: if test "x$with_cups-include" != x; then ohair@425: CUPS_CFLAGS="-I$with_cups-include" ohair@425: CUPS_FOUND=yes ohair@425: fi ohair@425: if test "x$with_cups-lib" != x; then ohair@425: CUPS_LIBS="-L$with_cups-lib -lcups" ohair@425: CUPS_FOUND=yes ohair@425: fi ohair@425: if test "x$CUPS_FOUND" = xno; then ohair@425: BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) ohair@425: fi ohair@425: if test "x$CUPS_FOUND" = xno; then ohair@425: # Are the cups headers installed in the default /usr/include location? ohair@425: AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], ohair@425: [CUPS_FOUND=yes ohair@425: CUPS_CFLAGS= ohair@425: CUPS_LIBS="-lcups" ohair@425: DEFAULT_CUPS=yes]) ohair@425: fi ohair@425: if test "x$CUPS_FOUND" = xno; then ohair@425: # Getting nervous now? Lets poke around for standard Solaris third-party ohair@425: # package installation locations. ohair@425: AC_MSG_CHECKING([for cups headers and libs]) ohair@425: if test -s /opt/sfw/cups/include/cups/cups.h; then ohair@425: # An SFW package seems to be installed! ohair@425: CUPS_FOUND=yes ohair@425: CUPS_CFLAGS="-I/opt/sfw/cups/include" ohair@425: CUPS_LIBS="-L/opt/sfw/cups/lib -lcups" ohair@425: elif test -s /opt/csw/include/cups/cups.h; then ohair@425: # A CSW package seems to be installed! ohair@425: CUPS_FOUND=yes ohair@425: CUPS_CFLAGS="-I/opt/csw/include" ohair@425: CUPS_LIBS="-L/opt/csw/lib -lcups" ohair@425: fi ohair@425: AC_MSG_RESULT([$CUPS_FOUND]) ohair@425: fi ohair@425: if test "x$CUPS_FOUND" = xno; then ohair@425: help_on_build_dependency cups ohair@425: AC_ERROR([Could not find cups! $HELP_MSG ]) ohair@425: fi ohair@425: fi ohair@425: ohair@425: AC_SUBST(CUPS_CFLAGS) ohair@425: AC_SUBST(CUPS_LIBS) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # The ubiquitous freetype2 library is used to render fonts. ohair@425: # ohair@425: AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], ohair@425: [specify prefix directory for the freetype2 package ohair@425: (expecting the libraries under PATH/lib and the headers under PATH/include)])]) ohair@425: ohair@425: # If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree ohair@425: USING_SYSTEM_FT_LIB=false ohair@425: ohair@425: if test "x$FREETYPE2_NOT_NEEDED" = xyes; then ohair@425: if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then ohair@425: AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) ohair@425: fi ohair@425: FREETYPE2_CFLAGS= ohair@425: FREETYPE2_LIBS= ohair@425: FREETYPE2_LIB_PATH= ohair@425: else ohair@425: FREETYPE2_FOUND=no ohair@425: ohair@425: if test "x$with_freetype" != x; then ohair@425: SPACESAFE(with_freetype,[the path to freetype]) ohair@425: FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" ohair@425: if test "x$HOST_OS" = xwindows; then ohair@425: FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" ohair@425: fi ohair@425: FREETYPE2_LIB_PATH="$with_freetype/lib" ohair@425: FREETYPE2_CFLAGS="-I$with_freetype/include" ohair@425: if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then ohair@425: FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" ohair@425: fi ohair@425: FREETYPE2_FOUND=yes ohair@425: if test "x$FREETYPE2_FOUND" = xyes; then ohair@425: # Verify that the directories exist ohair@425: if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then ohair@425: AC_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include]) ohair@425: fi ohair@425: # List the contents of the lib. ohair@425: FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` ohair@425: if test "x$FREETYPELIB" = x; then ohair@425: AC_ERROR([Could not find libfreetype.se nor freetype.dll in $with_freetype/lib]) ohair@425: fi ohair@425: # Check one h-file ohair@425: if ! test -s "$with_freetype/include/ft2build.h"; then ohair@425: AC_ERROR([Could not find $with_freetype/include/ft2build.h]) ohair@425: fi ohair@425: fi ohair@425: fi ohair@425: if test "x$FREETYPE2_FOUND" = xno; then ohair@425: BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) ohair@425: USING_SYSTEM_FT_LIB=true ohair@425: fi ohair@425: if test "x$FREETYPE2_FOUND" = xno; then ohair@425: PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) ohair@425: USING_SYSTEM_FT_LIB=true ohair@425: fi ohair@425: if test "x$FREETYPE2_FOUND" = xno; then ohair@425: AC_MSG_CHECKING([for freetype in some standard locations]) ohair@425: ohair@425: if test -s /usr/X11/include/ft2build.h && test -d /usr/X11/include/freetype2/freetype; then ohair@425: DEFAULT_FREETYPE_CFLAGS="-I/usr/X11/include/freetype2 -I/usr/X11/include" ohair@425: DEFAULT_FREETYPE_LIBS="-L/usr/X11/lib -lfreetype" ohair@425: fi ohair@425: if test -s /usr/include/ft2build.h && test -d /usr/include/freetype2/freetype; then ohair@425: DEFAULT_FREETYPE_CFLAGS="-I/usr/include/freetype2" ohair@425: DEFAULT_FREETYPE_LIBS="-lfreetype" ohair@425: fi ohair@425: ohair@425: PREV_CXXCFLAGS="$CXXFLAGS" ohair@425: PREV_LDFLAGS="$LDFLAGS" ohair@425: CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" ohair@425: LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" ohair@425: AC_LINK_IFELSE([AC_LANG_SOURCE([[#include ohair@425: #include FT_FREETYPE_H ohair@425: int main() { return 0; } ohair@425: ]])], ohair@425: [ ohair@425: # Yes, the default cflags and libs did the trick. ohair@425: FREETYPE2_FOUND=yes ohair@425: FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" ohair@425: FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" ohair@425: ], ohair@425: [ ohair@425: FREETYPE2_FOUND=no ohair@425: ]) ohair@425: CXXCFLAGS="$PREV_CXXFLAGS" ohair@425: LDFLAGS="$PREV_LDFLAGS" ohair@425: AC_MSG_RESULT([$FREETYPE2_FOUND]) ohair@425: USING_SYSTEM_FT_LIB=true ohair@425: fi ohair@425: if test "x$FREETYPE2_FOUND" = xno; then ohair@425: help_on_build_dependency freetype2 ohair@425: AC_ERROR([Could not find freetype2! $HELP_MSG ]) ohair@425: fi ohair@425: fi ohair@425: ohair@425: AC_SUBST(USING_SYSTEM_FT_LIB) ohair@425: AC_SUBST(FREETYPE2_LIB_PATH) ohair@425: AC_SUBST(FREETYPE2_CFLAGS) ohair@425: AC_SUBST(FREETYPE2_LIBS) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check for alsa headers and libraries. Used on Linux/GNU systems. ohair@425: # ohair@425: AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], ohair@425: [specify prefix directory for the alsa package ohair@425: (expecting the libraries under PATH/lib and the headers under PATH/include)])]) ohair@425: AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], ohair@425: [specify directory for the alsa include files])]) ohair@425: AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], ohair@425: [specify directory for the alsa library])]) ohair@425: ohair@425: if test "x$ALSA_NOT_NEEDED" = xyes; then ohair@425: if test "x$with_alsa" != x || test "x$with_alsa-include" != x || test "x$with_alsa-lib" != x; then ohair@425: AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) ohair@425: fi ohair@425: ALSA_CFLAGS= ohair@425: ALSA_LIBS= ohair@425: else ohair@425: ALSA_FOUND=no ohair@425: ohair@425: if test "x$with_alsa" = xno || test "x$with_alsa-include" = xno || test "x$with_alsa-lib" = xno; then ohair@425: AC_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) ohair@425: fi ohair@425: ohair@425: if test "x$with_alsa" != x; then ohair@425: ALSA_LIBS="-L$with_alsa/lib -lalsa" ohair@425: ALSA_CFLAGS="-I$with_alsa/include" ohair@425: ALSA_FOUND=yes ohair@425: fi ohair@425: if test "x$with_alsa-include" != x; then ohair@425: ALSA_CFLAGS="-I$with_alsa/include" ohair@425: ALSA_FOUND=yes ohair@425: fi ohair@425: if test "x$with_alsa-lib" != x; then ohair@425: ALSA_LIBS="-L$with_alsa/lib -lalsa" ohair@425: ALSA_FOUND=yes ohair@425: fi ohair@425: if test "x$ALSA_FOUND" = xno; then ohair@425: BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) ohair@425: fi ohair@425: if test "x$ALSA_FOUND" = xno; then ohair@425: PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no]) ohair@425: fi ohair@425: if test "x$ALSA_FOUND" = xno; then ohair@425: AC_CHECK_HEADERS([alsa/asoundlib.h], ohair@425: [ALSA_FOUND=yes ohair@425: ALSA_CFLAGS=-Iignoreme ohair@425: ALSA_LIBS=-lasound ohair@425: DEFAULT_ALSA=yes], ohair@425: [ALSA_FOUND=no]) ohair@425: fi ohair@425: if test "x$ALSA_FOUND" = xno; then ohair@425: help_on_build_dependency alsa ohair@425: AC_ERROR([Could not find alsa! $HELP_MSG ]) ohair@425: fi ohair@425: fi ohair@425: ohair@425: AC_SUBST(ALSA_CFLAGS) ohair@425: AC_SUBST(ALSA_LIBS) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check for pulse audio headers and libraries. ohair@425: # ohair@425: PULSE_FOUND=no ohair@425: AC_ARG_WITH(pulse, [AS_HELP_STRING([--with-pulse], ohair@425: [specify prefix directory for the pulseaudio package ohair@425: (expecting the libraries under PATH/lib and the headers under PATH/include)])]) ohair@425: AC_ARG_WITH(pulse-include, [AS_HELP_STRING([--with-pulse-include], ohair@425: [specify directory for the pulseaudio include files])]) ohair@425: AC_ARG_WITH(pulse-lib, [AS_HELP_STRING([--with-pulse-lib], ohair@425: [specify directory for the pulseaudio library])]) ohair@425: ohair@425: if test "x$with_pulse" != x; then ohair@425: PULSE_LIBS="-L$with_pulse/lib -lfreetype" ohair@425: PULSE_CFLAGS="-I$with_pulse/include" ohair@425: PULSE_FOUND=yes ohair@425: fi ohair@425: if test "x$with_pulse-include" != x; then ohair@425: PULSE_CFLAGS="-I$with_pulse/include" ohair@425: PULSE_FOUND=yes ohair@425: fi ohair@425: if test "x$with_pulse-lib" != x; then ohair@425: PULSE_LIBS="-L$with_pulse/lib -lfreetype" ohair@425: PULSE_FOUND=yes ohair@425: fi ohair@425: if test "x$PULSE_FOUND" = xno; then ohair@425: BDEPS_CHECK_MODULE(PULSE, pulse, xxx, [PULSE_FOUND=yes], [PULSE_FOUND=no]) ohair@425: fi ohair@425: if test "x$PULSE_FOUND" = xno; then ohair@425: PKG_CHECK_MODULES(LIBPULSE,[libpulse >= 0.9.11],[PULSE_FOUND=yes],[PULSE_FOUND=no]) ohair@425: fi ohair@425: if test "x$PULSE_FOUND" = xno; then ohair@425: AC_CHECK_HEADERS([pulse/pulseaudio.h], ohair@425: [PULSE_FOUND=yes ohair@425: PULSE_CFLAGS=-Iignoreme ohair@425: PULSE_LIBS= ohair@425: DEFAULT_PULSE=yes], ohair@425: [PULSE_FOUND=no]) ohair@425: fi ohair@425: ohair@425: if test "x$PULSE_FOUND" = xno && test "x$PULSE_NOT_NEEDED" != xyes; then ohair@425: help_on_build_dependency pulse ohair@425: AC_ERROR([Could not find pulse audio libraries. $HELP_MSG ]) ohair@425: fi ohair@425: ohair@425: AC_SUBST(PULSE_CFLAGS) ohair@425: AC_SUBST(PULSE_LIBS) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check for the jpeg library ohair@425: # ohair@425: ohair@425: USE_EXTERNAL_LIBJPEG=true ohair@425: AC_CHECK_LIB(jpeg, main, [], ohair@425: [ USE_EXTERNAL_LIBJPEG=false ohair@425: AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) ohair@425: ]) ohair@425: AC_SUBST(USE_EXTERNAL_LIBJPEG) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check for the gif library ohair@425: # ohair@425: ohair@425: USE_EXTERNAL_LIBJPEG=true ohair@425: AC_CHECK_LIB(gif, main, [], ohair@425: [ USE_EXTERNAL_LIBGIF=false ohair@425: AC_MSG_NOTICE([Will use gif decoder bundled with the OpenJDK source]) ohair@425: ]) ohair@425: AC_SUBST(USE_EXTERNAL_LIBGIF) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check for the zlib library ohair@425: # ohair@425: ohair@425: USE_EXTERNAL_LIBZ=true ohair@425: AC_CHECK_LIB(z, main, [], ohair@425: [ USE_EXTERNAL_LIBZ=false ohair@425: AC_MSG_NOTICE([Will use zlib bundled with the OpenJDK source]) ohair@425: ]) ohair@425: AC_SUBST(USE_EXTERNAL_LIBZ) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check if altzone exists in time.h ohair@425: # ohair@425: ohair@425: AC_TRY_LINK([#include ], [return (int)altzone;], ohair@425: has_altzone=yes, ohair@425: has_altzone=no) ohair@425: if test "x$has_altzone" = xyes; then ohair@425: AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h]) ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Check the maths library ohair@425: # ohair@425: ohair@425: AC_CHECK_LIB(m, main, [], ohair@425: [ ohair@425: AC_MSG_NOTICE([Maths library was not found]) ohair@425: ]) ohair@425: AC_SUBST(LIBM) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Should we run the painfully slow javadoc tool? ohair@425: # ohair@425: AC_MSG_CHECKING([whether to build documentation]) ohair@425: AC_ARG_ENABLE([docs], [AS_HELP_STRING([--enable-docs], ohair@425: [enable generation of Javadoc documentation @<:@disabled@:>@])], ohair@425: [ENABLE_DOCS="${enableval}"], [ENABLE_DOCS='no']) ohair@425: AC_MSG_RESULT([$ENABLE_DOCS]) ohair@425: AC_SUBST(ENABLE_DOCS) ohair@425: GENERATE_DOCS=false ohair@425: if test "x$ENABLE_DOCS" = xyes; then ohair@425: GENERATE_DOCS=true ohair@425: fi ohair@425: AC_SUBST(GENERATE_DOCS) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Should we compile nimbus swing L&F? We can probably remove this option ohair@425: # since nimbus is officially part of javax now. ohair@425: # ohair@425: AC_MSG_CHECKING([whether to build nimbus L&F]) ohair@425: AC_ARG_ENABLE([nimbus], [AS_HELP_STRING([--disable-nimbus], ohair@425: [disable Nimbus L&F @<:@enabled@:>@])], ohair@425: [ENABLE_NIMBUS="${enableval}"], [ENABLE_NIMBUS='yes']) ohair@425: AC_MSG_RESULT([$ENABLE_NIMBUS]) ohair@425: DISABLE_NIMBUS= ohair@425: if test "x$ENABLE_NIMBUS" = xno; then ohair@425: DISABLE_NIMBUS=true ohair@425: fi ohair@425: AC_SUBST(DISABLE_NIMBUS) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Setup the opt flags for different compilers ohair@425: # and different operating systems. ohair@425: # ohair@425: case $COMPILER_TYPE in ohair@425: CC ) ohair@425: D_FLAG="-g" ohair@425: case $COMPILER_NAME in ohair@425: gcc ) ohair@425: case $PLATFORM in ohair@425: macosx ) ohair@425: # On MacOSX we optimize for size, something ohair@425: # we should do for all platforms? ohair@425: C_O_FLAG_HI="-O3" ohair@425: C_O_FLAG_NORM="-Os" ohair@425: C_O_FLAG_NONE="-O0" ohair@425: ;; ohair@425: *) ohair@425: C_O_FLAG_HI="-O3" ohair@425: C_O_FLAG_NORM="-O2" ohair@425: C_O_FLAG_NONE="-O0" ohair@425: ;; ohair@425: esac ohair@425: CXX_O_FLAG_HI="$C_O_FLAG_HI" ohair@425: CXX_O_FLAG_NORM="$C_O_FLAG_NORM" ohair@425: CXX_O_FLAG_NONE="$C_O_FLAG_NONE" ohair@425: ;; ohair@425: ossc ) ohair@425: case $LEGACY_HOST_CPU1 in ohair@425: i586) ohair@425: C_O_FLAG_HI="-xO4 -Wu,-O4~yz" ohair@425: C_O_FLAG_NORM="-xO2 -Wu,-O2~yz" ohair@425: C_O_FLAG_NONE="" ohair@425: CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz" ohair@425: CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz" ohair@425: CXX_O_FLAG_NONE="" ohair@425: ;; ohair@425: sparc) ohair@425: C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" ohair@425: C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" ohair@425: C_O_FLAG_NONE="" ohair@425: CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" ohair@425: CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" ohair@425: CXX_O_FLAG_NONE="" ohair@425: ;; ohair@425: esac ohair@425: esac ohair@425: ;; ohair@425: CL ) ohair@425: D_FLAG= ohair@425: C_O_FLAG_HI="-O2" ohair@425: C_O_FLAG_NORM="-O1" ohair@425: C_O_FLAG_NONE="-Od" ohair@425: CXX_O_FLAG_HI="$C_O_FLAG_HI" ohair@425: CXX_O_FLAG_NORM="$C_O_FLAG_NORM" ohair@425: CXX_O_FLAG_NONE="$C_O_FLAG_NONE" ohair@425: ;; ohair@425: esac ohair@425: ohair@425: AC_SUBST(C_O_FLAG_HI) ohair@425: AC_SUBST(C_O_FLAG_NORM) ohair@425: AC_SUBST(C_O_FLAG_NONE) ohair@425: AC_SUBST(CXX_O_FLAG_HI) ohair@425: AC_SUBST(CXX_O_FLAG_NORM) ohair@425: AC_SUBST(CXX_O_FLAG_NONE) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Setup legacy vars/targets and new vars to deal with different debug levels. ohair@425: # ohair@425: case $DEBUG_LEVEL in ohair@425: release ) ohair@425: HOTSPOT_DEBUG_LEVEL="product" ohair@425: HOTSPOT_EXPORT="product" ohair@425: ;; ohair@425: fastdebug ) ohair@425: HOTSPOT_DEBUG_LEVEL="fastdebug" ohair@425: HOTSPOT_EXPORT="fastdebug" ohair@425: CFLAGS="$CFLAGS $D_FLAG" ohair@425: JAVAC_FLAGS="$JAVAC_FLAGS -g" ohair@425: ;; ohair@425: slowdebug ) ohair@425: HOTSPOT_DEBUG_LEVEL="jvmg" ohair@425: HOTSPOT_EXPORT="debug" ohair@425: CFLAGS="$CFLAGS $D_FLAG" ohair@425: C_O_FLAG_HI="$C_O_FLAG_NONE" ohair@425: C_O_FLAG_NORM="$C_O_FLAG_NONE" ohair@425: CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" ohair@425: CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" ohair@425: JAVAC_FLAGS="$JAVAC_FLAGS -g" ohair@425: ;; ohair@425: esac ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Generate the legacy makefile targets for hotspot. ohair@425: # The hotspot api for selecting the build artifacts, really, needs to be improved. ohair@425: # ohair@425: HOTSPOT_TARGET="" ohair@425: ohair@425: if test "x$JVM_VARIANT_SERVER" = xtrue; then ohair@425: HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} " ohair@425: fi ohair@425: ohair@425: if test "x$JVM_VARIANT_CLIENT" = xtrue; then ohair@425: HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 " ohair@425: fi ohair@425: ohair@425: if test "x$JVM_VARIANT_KERNEL" = xtrue; then ohair@425: HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel " ohair@425: fi ohair@425: ohair@425: if test "x$JVM_VARIANT_ZERO" = xtrue; then ohair@425: HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero " ohair@425: fi ohair@425: ohair@425: if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then ohair@425: HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark " ohair@425: fi ohair@425: ohair@425: HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Setup all directories for the subrepoes and the arguments to the sub makes. ohair@425: # ohair@425: LANGTOOLS_OUTPUTDIR="$OUTPUT_ROOT/langtools" ohair@425: LANGTOOLS_DIST="$OUTPUT_ROOT/langtools/dist" ohair@425: LANGTOOLS_MAKE_ARGS="" ohair@425: AC_SUBST(LANGTOOLS_OUTPUTDIR) ohair@425: AC_SUBST(LANGTOOLS_DIST) ohair@425: AC_SUBST(LANGTOOLS_MAKE_ARGS) ohair@425: ohair@425: CORBA_OUTPUTDIR="$OUTPUT_ROOT/corba" ohair@425: CORBA_DIST="$OUTPUT_ROOT/corba/dist" ohair@425: CORBA_MAKE_ARGS="" ohair@425: AC_SUBST(CORBA_OUTPUTDIR) ohair@425: AC_SUBST(CORBA_DIST) ohair@425: AC_SUBST(CORBA_MAKE_ARGS) ohair@425: ohair@425: JAXP_OUTPUTDIR="$OUTPUT_ROOT/jaxp" ohair@425: JAXP_DIST="$OUTPUT_ROOT/jaxp/dist" ohair@425: JAXP_MAKE_ARGS="" ohair@425: AC_SUBST(JAXP_OUTPUTDIR) ohair@425: AC_SUBST(JAXP_DIST) ohair@425: AC_SUBST(JAXP_MAKE_ARGS) ohair@425: ohair@425: JAXWS_OUTPUTDIR="$OUTPUT_ROOT/jaxws" ohair@425: JAXWS_DIST="$OUTPUT_ROOT/jaxws/dist" ohair@425: JAXWS_MAKE_ARGS="" ohair@425: AC_SUBST(JAXWS_OUTPUTDIR) ohair@425: AC_SUBST(JAXWS_DIST) ohair@425: AC_SUBST(JAXWS_MAKE_ARGS) ohair@425: ohair@425: HOTSPOT_OUTPUTDIR="$OUTPUT_ROOT/hotspot" ohair@425: HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" ohair@425: HOTSPOT_MAKE_ARGS="ALT_OUTPUTDIR=$HOTSPOT_OUTPUTDIR ALT_EXPORT_PATH=$HOTSPOT_DIST $HOTSPOT_TARGET" ohair@425: AC_SUBST(HOTSPOT_OUTPUTDIR) ohair@425: AC_SUBST(HOTSPOT_DIST) ohair@425: AC_SUBST(HOTSPOT_MAKE_ARGS) ohair@425: ohair@425: JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" ohair@425: JDK_MAKE_ARGS="ALT_OUTPUTDIR=\"$OUTPUT_ROOT/jdk\"" ohair@425: AC_SUBST(JDK_OUTPUTDIR) ohair@425: AC_SUBST(JDK_MAKE_ARGS) ohair@425: ohair@425: IMAGES_OUTPUTDIR=$OUTPUT_ROOT/images ohair@425: IMAGES_MAKE_ARGS="ALT_OUTPUTDIR=$OUTPUT_ROOT/jdk \ ohair@425: SHARE_SRC=$JDK_TOPDIR/src/share \ ohair@425: PLATFORM_SRC=$JDK_TOPDIR/src/$LEGACY_HOST_OS_API \ ohair@425: TEMPDIR=$IMAGES_OUTPUTDIR/tmp \ ohair@425: ABS_TEMPDIR=$IMAGES_OUTPUTDIR/tmp " ohair@425: AC_SUBST(IMAGES_OUTPUTDIR) ohair@425: AC_SUBST(IMAGES_MAKE_ARGS) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Now setup the CFLAGS and LDFLAGS for the JDK build. ohair@425: # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. ohair@425: # ohair@425: case $COMPILER_NAME in ohair@425: gcc ) ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ ohair@425: -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" ohair@425: CFLAGS_JDK="$CFLAGS_JDK -fno-strict-aliasing" ohair@425: ;; ohair@425: ossc ) ohair@425: CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa REQUIRED -v -mt -norunpath -xnolib" ohair@425: CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt REQUIRED -features=no%except -DCC_NOEX" ohair@425: ;; ohair@425: cl ) ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ ohair@425: -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ ohair@425: -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ ohair@425: -DWIN32 -DIAL" ohair@425: case $LEGACY_HOST_CPU1 in ohair@425: i?86 ) ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" ohair@425: ;; ohair@425: amd64 ) ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" ohair@425: ;; ohair@425: esac ohair@425: ;; ohair@425: esac ohair@425: ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" ohair@425: ohair@425: # The package path is used only on macosx? ohair@425: PACKAGE_PATH=/opt/local ohair@425: AC_SUBST(PACKAGE_PATH) ohair@425: ohair@425: # Sometimes we use a cpu dir (.../lib/amd64/server) ohair@425: # Sometimes not (.../lib/server) ohair@425: LIBARCHDIR="$LEGACY_HOST_CPU2/" ohair@425: if test "x$ENDIAN" = xlittle; then ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" ohair@425: else ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" ohair@425: fi ohair@425: if test "x$HOST_OS" = xlinux; then ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX" ohair@425: fi ohair@425: if test "x$HOST_OS" = xwindows; then ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS" ohair@425: fi ohair@425: if test "x$HOST_OS" = xsolaris; then ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS" ohair@425: fi ohair@425: if test "x$HOST_OS" = xmacosx; then ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE" ohair@425: LIBARCHDIR="" ohair@425: fi ohair@425: if test "x$HOST_OS" = xbsd; then ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" ohair@425: fi ohair@425: if test "x$DEBUG_LEVEL" = xrelease; then ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG" ohair@425: else ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG" ohair@425: fi ohair@425: ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$LEGACY_HOST_CPU1\"' -D$LEGACY_HOST_CPU1" ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" ohair@425: ohair@425: CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ ohair@425: -I${JDK_OUTPUTDIR}/include \ ohair@425: -I${JDK_OUTPUTDIR}/include/$PLATFORM \ ohair@425: -I${JDK_TOPDIR}/src/share/javavm/export \ ohair@425: -I${JDK_TOPDIR}/src/$LEGACY_HOST_OS_API/javavm/export \ ohair@425: -I${JDK_TOPDIR}/src/share/native/common \ ohair@425: -I${JDK_TOPDIR}/src/$LEGACY_HOST_OS_API/native/common" ohair@425: ohair@425: # The shared libraries are compiled using the picflag. ohair@425: CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" ohair@425: CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG" ohair@425: ohair@425: # Executable flags ohair@425: CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" ohair@425: CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" ohair@425: ohair@425: # Now this is odd. The JDK native libraries have to link against libjvm.so ohair@425: # On 32-bit machines there is normally two distinct libjvm.so:s, client and server. ohair@425: # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library ohair@425: # is identical for client and server? Yes. Which is picked at runtime (client or server)? ohair@425: # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following ohair@425: # libraries will link to whatever is in memory. Yuck. ohair@425: # ohair@425: # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. ohair@425: if test "x$COMPILER_TYPE" = xCL; then ohair@425: LDFLAGS_JDKLIB="$LDFLAGS -libpath:${JDK_OUTPUTDIR}/lib jvm.lib java.lib" ohair@425: LDFLAGS_JDKLIB_SUFFIX="" ohair@425: if test "x$HOST_CPU_BITS" = "x64"; then ohair@425: LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj64/jli.lib" ohair@425: else ohair@425: LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj/jli.lib" ohair@425: fi ohair@425: LDFLAGS_JDKEXE_SUFFIX="" ohair@425: else ohair@425: # If this is a --hash-style=gnu system, use --hash-style=both, why? ohair@425: HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` ohair@425: if test -n "$HAS_GNU_HASH"; then ohair@425: # And since we now know that the linker is gnu, then add -z defs, to forbid ohair@425: # undefined symbols in object files. ohair@425: LDFLAGS="$LDFLAGS -Xlinker --hash-style=both -Xlinker -z -Xlinker defs" ohair@425: if test "x$DEBUG_LEVEL" == "xrelease"; then ohair@425: # When building release libraries, tell the linker optimize them. ohair@425: # Should this be supplied to the OSS linker as well? ohair@425: LDFLAGS="$LDFLAGS -Xlinker -O1" ohair@425: fi ohair@425: fi ohair@425: ohair@425: LDFLAGS_JDKLIB="$LDFLAGS $SHARED_LIBRARY_FLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \ ohair@425: -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}client \ ohair@425: -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}" ohair@425: LDFLAGS_JDKLIB_SUFFIX="-ljvm -ljava" ohair@425: if test "x$COMPILER_NAME" = xossc; then ohair@425: LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" ohair@425: fi ohair@425: ohair@425: # Only the jli library is explicitly linked when the launchers are built. ohair@425: # The libjvm is then dynamically loaded/linked by the launcher. ohair@425: LDFLAGS_JDKEXE="$LDFLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli" ohair@425: LDFLAGS_JDKEXE_SUFFIX="-ljli" ohair@425: fi ohair@425: ohair@425: ohair@425: AC_SUBST(CFLAGS_JDKLIB) ohair@425: AC_SUBST(CFLAGS_JDKEXE) ohair@425: ohair@425: AC_SUBST(CXXFLAGS_JDKLIB) ohair@425: AC_SUBST(CXXFLAGS_JDKEXE) ohair@425: ohair@425: AC_SUBST(LDFLAGS_JDKLIB) ohair@425: AC_SUBST(LDFLAGS_JDKEXE) ohair@425: AC_SUBST(LDFLAGS_JDKLIB_SUFFIX) ohair@425: AC_SUBST(LDFLAGS_JDKEXE_SUFFIX) ohair@425: ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # statically link libstdc++ before C++ ABI is stablized on Linux unless ohair@425: # dynamic build is configured on command line. ohair@425: # ohair@425: AC_ARG_ENABLE([static-link-stdc++], [AS_HELP_STRING([--disable-static-link-stdc++], ohair@425: [disable static linking of the C++ runtime on Linux @<:@enabled@:>@])],, ohair@425: [ ohair@425: enable_static_link_stdc__=yes ohair@425: ]) ohair@425: ohair@425: if test "x$HOST_OS" = xlinux; then ohair@425: # Test if -lstdc++ works. ohair@425: AC_MSG_CHECKING([if dynamic link of stdc++ is possible]) ohair@425: AC_LANG_PUSH(C++) ohair@425: OLD_CXXFLAGS="$CXXFLAGS" ohair@425: CXXFLAGS="$CXXFLAGS -lstdc++" ohair@425: AC_TRY_LINK([], [return 0;], ohair@425: has_dynamic_libstdcxx=yes, ohair@425: has_dynamic_libstdcxx=no) ohair@425: CXXFLAGS="$OLD_CXXFLAGS" ohair@425: AC_LANG_POP(C++) ohair@425: AC_MSG_RESULT([$has_dynamic_libstdcxx]) ohair@425: ohair@425: # Test if stdc++ can be linked statically. ohair@425: AC_MSG_CHECKING([if static link of stdc++ is possible]) ohair@425: STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic" ohair@425: AC_LANG_PUSH(C++) ohair@425: OLD_LIBS="$LIBS" ohair@425: OLD_CXX="$CXX" ohair@425: LIBS="$STATIC_STDCXX_FLAGS" ohair@425: CXX="$CC" ohair@425: AC_TRY_LINK([], [return 0;], ohair@425: has_static_libstdcxx=yes, ohair@425: has_static_libstdcxx=no) ohair@425: LIBS="$OLD_LIBS" ohair@425: CXX="$OLD_CXX" ohair@425: AC_LANG_POP(C++) ohair@425: AC_MSG_RESULT([$has_static_libstdcxx]) ohair@425: ohair@425: if test "x$has_static_libcxx" = xno && test "x$has_dynamic_libcxx" = xno; then ohair@425: AC_ERROR([I cannot link to stdc++! Neither dynamically nor statically.]) ohair@425: fi ohair@425: ohair@425: if test "x$enable_static_link_stdc__" = xyes && test "x$has_static_libstdcxx" = xno; then ohair@425: AC_MSG_NOTICE([Static linking of libstdc++ was not possible reverting to dynamic linking.]) ohair@425: enable_static_link_stdc__=no ohair@425: fi ohair@425: ohair@425: if test "x$enable_static_link_stdc__" = xno && test "x$has_dynamic_libstdcxx" = xno; then ohair@425: AC_MSG_NOTICE([Dynamic linking of libstdc++ was not possible reverting to static linking.]) ohair@425: enable_static_link_stdc__=yes ohair@425: fi ohair@425: ohair@425: AC_MSG_CHECKING([how to link with libstdc++]) ohair@425: if test "x$enable_static_link_stdc__" = xyes; then ohair@425: LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" ohair@425: LDCXX="$CC" ohair@425: AC_MSG_RESULT([static]) ohair@425: else ohair@425: LIBCXX="$LIBCXX -lstdc++" ohair@425: LDCXX="$CXX" ohair@425: AC_MSG_RESULT([dynamic]) ohair@425: fi ohair@425: fi ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Could someone enlighten this configure script with a comment about libCrun? ohair@425: # The LEGACY_HOST_CPU3 is the setting for ISA_DIR. ohair@425: # ohair@425: if test "x$HOST_OS" = xsolaris; then ohair@425: LIBCXX="$LIBCXX /usr/lib${LEGACY_HOST_CPU3}/libCrun.so.1" ohair@425: fi ohair@425: ohair@425: AC_SUBST(LIBCXX) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # Misc ohair@425: # ohair@425: ohair@425: # Control wether Hotspot runs Queens test after build. ohair@425: AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build], ohair@425: [enable running of Queens test after Hotspot build (not yet available) @<:@disabled@:>@])],, ohair@425: [enable_hotspot_test_in_build=no]) ohair@425: if test "x$enable_hotspot_test_in_build" = "xyes"; then ohair@425: TEST_IN_BUILD=true ohair@425: else ohair@425: TEST_IN_BUILD=false ohair@425: fi ohair@425: AC_SUBST(TEST_IN_BUILD) ohair@425: ohair@425: ############################################################################### ohair@425: # ohair@425: # A helpful message at the end of the configure run. ohair@425: # ohair@425: if test "x$CCACHE_FOUND" = x && test "x$GCC" = xyes; then ohair@425: help_on_build_dependency ccache ohair@425: ohair@425: printf "\nTip of the day:\nYou should really install ccache version 3.1.4 or newer.\n" ohair@425: printf "It gives a tremendous speedup for C++ recompilations with precompiled headers!\n" ohair@425: fi ohair@425: ohair@425: if test "x$CCACHE_FOUND" != x && test "x$HAS_GOOD_CCACHE" = x; then ohair@425: printf "You have a ccache installed, but it is a version prior to 3.1.4. Try upgrading.\n" ohair@425: fi ohair@425: ohair@425: AC_OUTPUT