common/autoconf/configure.ac

Mon, 30 Apr 2012 12:13:29 -0700

author
ihse
date
Mon, 30 Apr 2012 12:13:29 -0700
changeset 430
afeeed8e5f8c
parent 425
e1830598f0b7
child 445
efd26e051e50
permissions
-rw-r--r--

7165277: Fix missing execute permission issue running logger.sh
Reviewed-by: ohair

ohair@425 1 #
ohair@425 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@425 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@425 4 #
ohair@425 5 # This code is free software; you can redistribute it and/or modify it
ohair@425 6 # under the terms of the GNU General Public License version 2 only, as
ohair@425 7 # published by the Free Software Foundation. Oracle designates this
ohair@425 8 # particular file as subject to the "Classpath" exception as provided
ohair@425 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@425 10 #
ohair@425 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@425 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@425 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@425 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@425 15 # accompanied this code).
ohair@425 16 #
ohair@425 17 # You should have received a copy of the GNU General Public License version
ohair@425 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@425 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@425 20 #
ohair@425 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@425 22 # or visit www.oracle.com if you need additional information or have any
ohair@425 23 # questions.
ohair@425 24 #
ohair@425 25
ohair@425 26 AC_PREREQ([2.61])
ohair@425 27 AC_INIT(openjdk, version-0.1, build-infra-dev@openjdk.java.net)
ohair@425 28
ohair@425 29 AC_CONFIG_AUX_DIR([build-aux])
ohair@425 30
ohair@425 31 m4_include([build-aux/pkg.m4])
ohair@425 32 m4_include([builddeps.m4])
ohair@425 33 m4_include([platform.m4])
ohair@425 34 m4_include([cores.m4])
ohair@425 35 m4_include([help.m4])
ohair@425 36
ohair@425 37 # Save the command line. Do this very early, before it is lost by calling autoconf macros.
ohair@425 38 CONFIGURE_COMMAND_LINE="$@"
ohair@425 39 AC_SUBST(CONFIGURE_COMMAND_LINE)
ohair@425 40
ohair@425 41 # Locate the directory of this script.
ohair@425 42 SCRIPT="[$]0"
ohair@425 43 REMOVE_SYMBOLIC_LINKS(SCRIPT)
ohair@425 44 AUTOCONF_DIR=`dirname [$]0`
ohair@425 45
ohair@425 46 # Start with tools that do not need have cross compilation support
ohair@425 47 # and can be expected to be found in the default PATH. These tools are
ohair@425 48 # used by configure. Nor are these tools expected to be found in the
ohair@425 49 # devkit from the builddeps server either, since they are
ohair@425 50 # needed to download the devkit.
ohair@425 51 AC_PROG_AWK
ohair@425 52 CHECK_NONEMPTY(AWK)
ohair@425 53 AC_PATH_PROG(CAT, cat)
ohair@425 54 CHECK_NONEMPTY(CAT)
ohair@425 55 AC_PATH_PROG(CHMOD, chmod)
ohair@425 56 CHECK_NONEMPTY(CHMOD)
ohair@425 57 AC_PATH_PROG(CP, cp)
ohair@425 58 CHECK_NONEMPTY(CP)
ohair@425 59 AC_PATH_PROG(CPIO, cpio)
ohair@425 60 CHECK_NONEMPTY(CPIO)
ohair@425 61 AC_PATH_PROG(CUT, cut)
ohair@425 62 CHECK_NONEMPTY(CUT)
ohair@425 63 AC_PATH_PROG(DATE, date)
ohair@425 64 CHECK_NONEMPTY(DATE)
ohair@425 65 AC_PATH_PROG(DF, df)
ohair@425 66 CHECK_NONEMPTY(DF)
ohair@425 67 AC_PATH_PROG(DIFF, diff)
ohair@425 68 CHECK_NONEMPTY(DIFF)
ohair@425 69 # Warning echo is really, really unportable!!!!! Different
ohair@425 70 # behaviour in bash and dash and in a lot of other shells!
ohair@425 71 # Use printf for serious work!
ohair@425 72 AC_PATH_PROG(ECHO, echo)
ohair@425 73 CHECK_NONEMPTY(ECHO)
ohair@425 74 AC_PROG_EGREP
ohair@425 75 CHECK_NONEMPTY(EGREP)
ohair@425 76 AC_PROG_FGREP
ohair@425 77 CHECK_NONEMPTY(FGREP)
ohair@425 78
ohair@425 79 AC_PATH_PROG(FIND, find)
ohair@425 80 CHECK_NONEMPTY(FIND)
ohair@425 81 CHECK_FIND_DELETE
ohair@425 82 AC_SUBST(FIND_DELETE)
ohair@425 83
ohair@425 84 AC_PROG_GREP
ohair@425 85 CHECK_NONEMPTY(GREP)
ohair@425 86 AC_PATH_PROG(HEAD, head)
ohair@425 87 CHECK_NONEMPTY(HEAD)
ohair@425 88 AC_PATH_PROG(LN, ln)
ohair@425 89 CHECK_NONEMPTY(LN)
ohair@425 90 AC_PATH_PROG(LS, ls)
ohair@425 91 CHECK_NONEMPTY(LS)
ohair@425 92 AC_PATH_PROGS(MAKE, [gmake make])
ohair@425 93 CHECK_NONEMPTY(MAKE)
ohair@425 94 MAKE_VERSION=`$MAKE --version | head -n 1 | grep '3.8[[12346789]]'`
ohair@425 95 if test "x$MAKE_VERSION" = x; then
ohair@425 96 AC_ERROR([You must use GNU make 3.81 or newer! Please put it in the path.])
ohair@425 97 fi
ohair@425 98 AC_PATH_PROG(MKDIR, mkdir)
ohair@425 99 CHECK_NONEMPTY(MKDIR)
ohair@425 100 AC_PATH_PROG(MV, mv)
ohair@425 101 CHECK_NONEMPTY(MV)
ohair@425 102 AC_PATH_PROGS(NAWK, [nawk gawk awk])
ohair@425 103 CHECK_NONEMPTY(NAWK)
ohair@425 104 AC_PATH_PROG(PRINTF, printf)
ohair@425 105 CHECK_NONEMPTY(PRINTF)
ohair@425 106 AC_PATH_PROG(THEPWDCMD, pwd)
ohair@425 107 AC_PATH_PROG(RM, rm)
ohair@425 108 CHECK_NONEMPTY(RM)
ohair@425 109 RM="$RM -f"
ohair@425 110 AC_PROG_SED
ohair@425 111 CHECK_NONEMPTY(SED)
ohair@425 112 AC_PATH_PROG(SH, sh)
ohair@425 113 CHECK_NONEMPTY(SH)
ohair@425 114 AC_PATH_PROG(SORT, sort)
ohair@425 115 CHECK_NONEMPTY(SORT)
ohair@425 116 AC_PATH_PROG(TAR, tar)
ohair@425 117 CHECK_NONEMPTY(TAR)
ohair@425 118 AC_PATH_PROG(TAIL, tail)
ohair@425 119 CHECK_NONEMPTY(TAIL)
ohair@425 120 AC_PATH_PROG(TEE, tee)
ohair@425 121 CHECK_NONEMPTY(TEE)
ohair@425 122 AC_PATH_PROG(TR, tr)
ohair@425 123 CHECK_NONEMPTY(TR)
ohair@425 124 AC_PATH_PROG(TOUCH, touch)
ohair@425 125 CHECK_NONEMPTY(TOUCH)
ohair@425 126 AC_PATH_PROG(WC, wc)
ohair@425 127 CHECK_NONEMPTY(WC)
ohair@425 128 AC_PATH_PROG(XARGS, xargs)
ohair@425 129 CHECK_NONEMPTY(XARGS)
ohair@425 130 AC_PATH_PROG(ZIP, zip)
ohair@425 131 CHECK_NONEMPTY(ZIP)
ohair@425 132 AC_PATH_PROG(UNZIP, unzip)
ohair@425 133 CHECK_NONEMPTY(UNZIP)
ohair@425 134 AC_PATH_PROG(LDD, ldd)
ohair@425 135 if test "x$LDD" = "x"; then
ohair@425 136 # List shared lib dependencies is used for
ohair@425 137 # debug output and checking for forbidden dependencies.
ohair@425 138 # We can build without it.
ohair@425 139 LDD="true"
ohair@425 140 fi
ohair@425 141 AC_PATH_PROG(OTOOL, otool)
ohair@425 142 if test "x$OTOOL" = "x"; then
ohair@425 143 OTOOL="true"
ohair@425 144 fi
ohair@425 145 AC_PATH_PROG(READELF, readelf)
ohair@425 146 AC_PATH_PROG(EXPR, expr)
ohair@425 147 CHECK_NONEMPTY(EXPR)
ohair@425 148 AC_PATH_PROG(FILE, file)
ohair@425 149 CHECK_NONEMPTY(FILE)
ohair@425 150 # Figure out the build and host system.
ohair@425 151 AC_CANONICAL_BUILD
ohair@425 152 AC_CANONICAL_HOST
ohair@425 153
ohair@425 154 AC_ARG_WITH(data-model, [AS_HELP_STRING([--with-data-model],
ohair@425 155 [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-data-model=32 @<:@guessed@:>@])])
ohair@425 156
ohair@425 157 if test "x$with_data_model" != x && \
ohair@425 158 test "x$with_data_model" != x32 && \
ohair@425 159 test "x$with_data_model" != x64 ; then
ohair@425 160 AC_ERROR([The data model can only be 32 or 64!])
ohair@425 161 fi
ohair@425 162 # Translate the standard cpu-vendor-kernel-os quadruplets into
ohair@425 163 # the new HOST_.... and BUILD_... and the legacy names used by
ohair@425 164 # the openjdk build.
ohair@425 165 # It uses $host_os $host_cpu $build_os $build_cpu and $with_data_model
ohair@425 166 EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS
ohair@425 167 # Now the following vars are defined.
ohair@425 168 # HOST_OS=aix,bsd,hpux,linux,macosx,solaris,windows
ohair@425 169 # HOST_OS_FAMILY=bsd,gnu,sysv,win32,wince
ohair@425 170 # HOST_OS_API=posix,winapi
ohair@425 171 #
ohair@425 172 # HOST_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
ohair@425 173 # HOST_CPU_ARCH=x86,sparc,pcc,arm
ohair@425 174 # HOST_CPU_BITS=32,64
ohair@425 175 # HOST_CPU_ENDIAN=big,little
ohair@425 176 #
ohair@425 177 # There is also a:
ohair@425 178 # LEGACY_HOST_CPU1=i586,amd64,.... # used to set the old var ARCH
ohair@425 179 # LEGACY_HOST_CPU2=i386,amd64,.... # used to set the old var LIBARCH
ohair@425 180 # LEGACY_HOST_CPU3=only sparcv9,amd64 # used to set the ISA_DIR on Solaris
ohair@425 181 # There was also a BUILDARCH that had i486,amd64,... but we do not use that
ohair@425 182 # in the new build.
ohair@425 183 # LEGACY_HOST_OS_API=solaris,windows # used to select source roots
ohair@425 184
ohair@425 185 DATE_WHEN_CONFIGURED=`LANG=C date`
ohair@425 186 AC_SUBST(DATE_WHEN_CONFIGURED)
ohair@425 187
ohair@425 188 # How many cores do we have on this build system?
ohair@425 189 AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores],
ohair@425 190 [number of cores in the build system, e.g. --with-num-cores=8 @<:@probed@:>@])])
ohair@425 191 if test "x$with_num_cores" = x; then
ohair@425 192 # The number of cores were not specified, try to probe them.
ohair@425 193 CHECK_CORES
ohair@425 194 else
ohair@425 195 NUM_CORES=$with_num_cores
ohair@425 196 CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
ohair@425 197 fi
ohair@425 198 AC_SUBST(NUM_CORES)
ohair@425 199 AC_SUBST(CONCURRENT_BUILD_JOBS)
ohair@425 200
ohair@425 201 # How many cores do we have on this build system?
ohair@425 202 AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size],
ohair@425 203 [memory (in MB) available in the build system, e.g. --with-memory-size=1024 @<:@probed@:>@])])
ohair@425 204 if test "x$with_memory_size" = x; then
ohair@425 205 # The memory size was not specified, try to probe it.
ohair@425 206 CHECK_MEMORY_SIZE
ohair@425 207 else
ohair@425 208 MEMORY_SIZE=$with_memory_size
ohair@425 209 fi
ohair@425 210 AC_SUBST(MEMORY_SIZE)
ohair@425 211
ohair@425 212 # Where is the source? It is located two levels above the configure script.
ohair@425 213 CURDIR="$PWD"
ohair@425 214 cd "$AUTOCONF_DIR/../.."
ohair@425 215 SRC_ROOT="`pwd`"
ohair@425 216 AC_SUBST(SRC_ROOT)
ohair@425 217 cd "$CURDIR"
ohair@425 218
ohair@425 219 # For cygwin we need cygpath first, since it is used everywhere.
ohair@425 220 AC_PATH_PROG(CYGPATH, cygpath)
ohair@425 221 PATH_SEP=":"
ohair@425 222 if test "x$BUILD_OS" = "xwindows"; then
ohair@425 223 if test "x$CYGPATH" = x; then
ohair@425 224 AC_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
ohair@425 225 fi
ohair@425 226 PATH_SEP=";"
ohair@425 227 fi
ohair@425 228 AC_SUBST(PATH_SEP)
ohair@425 229
ohair@425 230 SPACESAFE(SRC_ROOT,[the path to the source root])
ohair@425 231 SPACESAFE(CURDIR,[the path to the current directory])
ohair@425 232
ohair@425 233 if test "x$BUILD_OS" = "xsolaris"; then
ohair@425 234 # Also search in /usr/ccs/bin for utilities like ar and as.
ohair@425 235 PATH="/usr/ccs/bin:$PATH"
ohair@425 236 fi
ohair@425 237
ohair@425 238 ###############################################################################
ohair@425 239 #
ohair@425 240 # OpenJDK or closed
ohair@425 241 #
ohair@425 242 AC_ARG_ENABLE([openjdk], [AS_HELP_STRING([--enable-openjdk],
ohair@425 243 [build OpenJDK regardless of the presence of closed repositories @<:@disabled@:>@])],,)
ohair@425 244
ohair@425 245 if test "x$enable_openjdk" = "xyes"; then
ohair@425 246 OPENJDK=true
ohair@425 247 elif test "x$enable_openjdk" = "xno"; then
ohair@425 248 OPENJDK=false
ohair@425 249 elif test -d "$SRC_ROOT/jdk/src/closed"; then
ohair@425 250 OPENJDK=false
ohair@425 251 else
ohair@425 252 OPENJDK=true
ohair@425 253 fi
ohair@425 254
ohair@425 255 if test "x$OPENJDK" = "xtrue"; then
ohair@425 256 SET_OPENJDK=OPENJDK=true
ohair@425 257 fi
ohair@425 258
ohair@425 259 AC_SUBST(SET_OPENJDK)
ohair@425 260
ohair@425 261 ###############################################################################
ohair@425 262 #
ohair@425 263 # JIGSAW or not. The JIGSAW variable is used during the intermediate
ohair@425 264 # stage when we are building both the old style JDK and the new style modularized JDK.
ohair@425 265 # When the modularized JDK is finalized, this option will go away.
ohair@425 266 #
ohair@425 267 AC_ARG_ENABLE([jigsaw], [AS_HELP_STRING([--enable-jigsaw],
ohair@425 268 [build Jigsaw images (not yet available) @<:@disabled@:>@])],,)
ohair@425 269
ohair@425 270 if test "x$enable_jigsaw" = "xyes"; then
ohair@425 271 JIGSAW=true
ohair@425 272 else
ohair@425 273 JIGSAW=false
ohair@425 274 fi
ohair@425 275 AC_SUBST(JIGSAW)
ohair@425 276
ohair@425 277 ###############################################################################
ohair@425 278 #
ohair@425 279 # Check which variant of the JDK that we want to build.
ohair@425 280 # Currently we have:
ohair@425 281 # normal: standard edition
ohair@425 282 # embedded: cut down to a smaller footprint
ohair@425 283 #
ohair@425 284 # Effectively the JDK variant gives a name to a specific set of
ohair@425 285 # modules to compile into the JDK. In the future, these modules
ohair@425 286 # might even be Jigsaw modules.
ohair@425 287 #
ohair@425 288 AC_MSG_CHECKING([which variant of the JDK to build])
ohair@425 289 AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
ohair@425 290 [JDK variant to build (normal, embedded) @<:@normal@:>@])])
ohair@425 291
ohair@425 292 if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
ohair@425 293 JAVASE_EMBEDDED=""
ohair@425 294 MINIMIZE_RAM_USAGE=""
ohair@425 295 JDK_VARIANT="normal"
ohair@425 296 elif test "x$with_jdk_variant" = xembedded; then
ohair@425 297 JAVASE_EMBEDDED="JAVASE_EMBEDDED:=true"
ohair@425 298 MINIMIZE_RAM_USAGE="MINIMIZE_RAM_USAGE:=true"
ohair@425 299 JDK_VARIANT="embedded"
ohair@425 300 else
ohair@425 301 AC_ERROR([The available JDK variants are: normal, embedded])
ohair@425 302 fi
ohair@425 303
ohair@425 304 AC_SUBST(JAVASE_EMBEDDED)
ohair@425 305 AC_SUBST(MINIMIZE_RAM_USAGE)
ohair@425 306 AC_SUBST(JDK_VARIANT)
ohair@425 307
ohair@425 308 AC_MSG_RESULT([$JDK_VARIANT])
ohair@425 309
ohair@425 310 ###############################################################################
ohair@425 311 #
ohair@425 312 # Should we build a JDK/JVM with head support (ie a graphical ui)?
ohair@425 313 # We always build headless support.
ohair@425 314 #
ohair@425 315 AC_MSG_CHECKING([headful support])
ohair@425 316 AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
ohair@425 317 [build headful support (graphical UI support) @<:@enabled@:>@])],
ohair@425 318 [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
ohair@425 319
ohair@425 320 SUPPORT_HEADLESS=yes
ohair@425 321 BUILD_HEADLESS="BUILD_HEADLESS:=true"
ohair@425 322
ohair@425 323 if test "x$SUPPORT_HEADFUL" = xyes; then
ohair@425 324 # We are building both headful and headless.
ohair@425 325 BUILD_HEADLESS_ONLY=""
ohair@425 326 headful_msg="inlude support for both headful and headless"
ohair@425 327 fi
ohair@425 328
ohair@425 329 if test "x$SUPPORT_HEADFUL" = xno; then
ohair@425 330 # Thus we are building headless only.
ohair@425 331 BUILD_HEADLESS="BUILD_HEADLESS:=true"
ohair@425 332 BUILD_HEADLESS_ONLY="BUILD_HEADLESS_ONLY:=true"
ohair@425 333 headful_msg="headless only"
ohair@425 334 fi
ohair@425 335
ohair@425 336 AC_MSG_RESULT([$headful_msg])
ohair@425 337
ohair@425 338 AC_SUBST(SUPPORT_HEADLESS)
ohair@425 339 AC_SUBST(SUPPORT_HEADFUL)
ohair@425 340 AC_SUBST(BUILD_HEADLESS)
ohair@425 341 AC_SUBST(BUILD_HEADLESS_ONLY)
ohair@425 342
ohair@425 343 ###############################################################################
ohair@425 344 #
ohair@425 345 # Check which variants of the JVM that we want to build.
ohair@425 346 # Currently we have:
ohair@425 347 # server: normal interpreter and a tiered C1/C2 compiler
ohair@425 348 # client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
ohair@425 349 # kernel: kernel footprint JVM that passes the TCK without major performance problems,
ohair@425 350 # ie normal interpreter and C1, only the serial GC, kernel jvmti etc
ohair@425 351 # zero: no machine code interpreter, no compiler
ohair@425 352 # zeroshark: zero interpreter and shark/llvm compiler backend
ohair@425 353 AC_MSG_CHECKING([which variants of the JVM that should be built])
ohair@425 354 AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
ohair@425 355 [JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
ohair@425 356
ohair@425 357 if test "x$with_jvm_variants" = x; then
ohair@425 358 if test "x$JDK_VARIANT" = xembedded; then
ohair@425 359 with_jvm_variants="kernel"
ohair@425 360 elif test "x$HOST_CPU_BITS" = x64; then
ohair@425 361 with_jvm_variants="server"
ohair@425 362 else
ohair@425 363 # Yes, on 32-bit machines, the same source (almost) is compiled twice
ohair@425 364 # to generate two libjvm.so files. Fun, fun.
ohair@425 365 with_jvm_variants="client,server"
ohair@425 366 fi
ohair@425 367 fi
ohair@425 368
ohair@425 369 JVM_VARIANTS=",$with_jvm_variants,"
ohair@425 370 TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
ohair@425 371
ohair@425 372 if test "x$TEST_VARIANTS" != "x,"; then
ohair@425 373 AC_ERROR([The available JVM variants are: server, client, kernel, zero, zeroshark])
ohair@425 374 fi
ohair@425 375 AC_MSG_RESULT([$with_jvm_variants])
ohair@425 376
ohair@425 377 JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
ohair@425 378 JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
ohair@425 379 JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
ohair@425 380 JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
ohair@425 381 JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
ohair@425 382
ohair@425 383 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
ohair@425 384 if test "x$HOST_CPU_BITS" = x64; then
ohair@425 385 AC_ERROR([You cannot build a client JVM for a 64-bit machine.])
ohair@425 386 fi
ohair@425 387 fi
ohair@425 388 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
ohair@425 389 if test "x$HOST_CPU_BITS" = x64; then
ohair@425 390 AC_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
ohair@425 391 fi
ohair@425 392 fi
ohair@425 393
ohair@425 394 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 395 # Replace the commas with AND for use in the build directory name.
ohair@425 396 ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
ohair@425 397 if test "x$COUNT_VARIANTS" != "x,1"; then
ohair@425 398 AC_MSG_NOTICE([NOTE! Longer build time since we are building more than one version of the libjvm! $with_jvm_variants])
ohair@425 399 fi
ohair@425 400
ohair@425 401 AC_SUBST(JVM_VARIANTS)
ohair@425 402 AC_SUBST(JVM_VARIANT_SERVER)
ohair@425 403 AC_SUBST(JVM_VARIANT_CLIENT)
ohair@425 404 AC_SUBST(JVM_VARIANT_KERNEL)
ohair@425 405 AC_SUBST(JVM_VARIANT_ZERO)
ohair@425 406 AC_SUBST(JVM_VARIANT_ZEROSHARK)
ohair@425 407
ohair@425 408 ###############################################################################
ohair@425 409 #
ohair@425 410 # Set the debug level
ohair@425 411 # release: no debug information, all optimizations, no asserts.
ohair@425 412 # fastdebug: debug information (-g), all optimizations, all asserts
ohair@425 413 # slowdebug: debug information (-g), no optimizations, all asserts
ohair@425 414 #
ohair@425 415 DEBUG_LEVEL="release"
ohair@425 416 AC_MSG_CHECKING([which debug level to use])
ohair@425 417 AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
ohair@425 418 [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
ohair@425 419 [
ohair@425 420 ENABLE_DEBUG="${enableval}"
ohair@425 421 DEBUG_LEVEL="fastdebug"
ohair@425 422 ], [ENABLE_DEBUG="no"])
ohair@425 423
ohair@425 424 AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
ohair@425 425 [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
ohair@425 426 [
ohair@425 427 DEBUG_LEVEL="${withval}"
ohair@425 428 if test "x$ENABLE_DEBUG" = xyes; then
ohair@425 429 AC_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
ohair@425 430 fi
ohair@425 431 ])
ohair@425 432 AC_MSG_RESULT([$DEBUG_LEVEL])
ohair@425 433
ohair@425 434 if test "x$DEBUG_LEVEL" != xrelease && \
ohair@425 435 test "x$DEBUG_LEVEL" != xfastdebug && \
ohair@425 436 test "x$DEBUG_LEVEL" != xslowdebug; then
ohair@425 437 AC_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
ohair@425 438 fi
ohair@425 439
ohair@425 440 case $DEBUG_LEVEL in
ohair@425 441 release )
ohair@425 442 VARIANT="OPT"
ohair@425 443 FASTDEBUG="false"
ohair@425 444 DEBUG_CLASSFILES="false"
ohair@425 445 BUILD_VARIANT_RELEASE=""
ohair@425 446 ;;
ohair@425 447 fastdebug )
ohair@425 448 VARIANT="DBG"
ohair@425 449 FASTDEBUG="true"
ohair@425 450 DEBUG_CLASSFILES="true"
ohair@425 451 BUILD_VARIANT_RELEASE="-fastdebug"
ohair@425 452 ;;
ohair@425 453 slowdebug )
ohair@425 454 VARIANT="DBG"
ohair@425 455 FASTDEBUG="false"
ohair@425 456 DEBUG_CLASSFILES="true"
ohair@425 457 BUILD_VARIANT_RELEASE="-debug"
ohair@425 458 ;;
ohair@425 459 esac
ohair@425 460
ohair@425 461 AC_SUBST(DEBUG_LEVEL)
ohair@425 462 AC_SUBST(VARIANT)
ohair@425 463 AC_SUBST(FASTDEBUG)
ohair@425 464 AC_SUBST(DEBUG_CLASSFILES)
ohair@425 465 AC_SUBST(BUILD_VARIANT_RELEASE)
ohair@425 466
ohair@425 467 # Source the version numbers
ohair@425 468 . $AUTOCONF_DIR/version.numbers
ohair@425 469 if test "x$OPENJDK" = "xfalse"; then
ohair@425 470 . $AUTOCONF_DIR/closed.version.numbers
ohair@425 471 fi
ohair@425 472 # Now set the JDK version, milestone, build number etc.
ohair@425 473 AC_SUBST(JDK_MAJOR_VERSION)
ohair@425 474 AC_SUBST(JDK_MINOR_VERSION)
ohair@425 475 AC_SUBST(JDK_MICRO_VERSION)
ohair@425 476 AC_SUBST(JDK_UPDATE_VERSION)
ohair@425 477 AC_SUBST(JDK_BUILD_NUMBER)
ohair@425 478 AC_SUBST(MILESTONE)
ohair@425 479 AC_SUBST(LAUNCHER_NAME)
ohair@425 480 AC_SUBST(PRODUCT_NAME)
ohair@425 481 AC_SUBST(PRODUCT_SUFFIX)
ohair@425 482 AC_SUBST(JDK_RC_PLATFORM_NAME)
ohair@425 483 AC_SUBST(COMPANY_NAME)
ohair@425 484
ohair@425 485 COPYRIGHT_YEAR=`date +'%Y'`
ohair@425 486 AC_SUBST(COPYRIGHT_YEAR)
ohair@425 487
ohair@425 488 RUNTIME_NAME="$PRODUCT_NAME $PRODUCT_SUFFIX"
ohair@425 489 AC_SUBST(RUNTIME_NAME)
ohair@425 490
ohair@425 491 if test "x$JDK_UPDATE_VERSION" != x; then
ohair@425 492 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
ohair@425 493 else
ohair@425 494 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}"
ohair@425 495 fi
ohair@425 496 AC_SUBST(JDK_VERSION)
ohair@425 497
ohair@425 498 if test "x$MILESTONE" != x; then
ohair@425 499 RELEASE="${JDK_VERSION}-${MILESTONE}${BUILD_VARIANT_RELEASE}"
ohair@425 500 else
ohair@425 501 RELEASE="${JDK_VERSION}${BUILD_VARIANT_RELEASE}"
ohair@425 502 fi
ohair@425 503 AC_SUBST(RELEASE)
ohair@425 504
ohair@425 505 if test "x$JDK_BUILD_NUMBER" != x; then
ohair@425 506 FULL_VERSION="${RELEASE}-${JDK_BUILD_NUMBER}"
ohair@425 507 else
ohair@425 508 JDK_BUILD_NUMBER=b00
ohair@425 509 BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
ohair@425 510 # Avoid [:alnum:] since it depends on the locale.
ohair@425 511 CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'`
ohair@425 512 USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'`
ohair@425 513 FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}"
ohair@425 514 fi
ohair@425 515 AC_SUBST(FULL_VERSION)
ohair@425 516 COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
ohair@425 517 AC_SUBST(COOKED_BUILD_NUMBER)
ohair@425 518
ohair@425 519 # Test from where we are running configure, in or outside of src root.
ohair@425 520 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 521 # We are running configure from the src root.
ohair@425 522 # Create a default ./build/host-variant-debuglevel output root.
ohair@425 523 OUTPUT_ROOT="$SRC_ROOT/build/${HOST_OS}-${HOST_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
ohair@425 524 mkdir -p "$OUTPUT_ROOT"
ohair@425 525 if test ! -d "$OUTPUT_ROOT"; then
ohair@425 526 AC_ERROR([Could not create build directory $OUTPUT_ROOT])
ohair@425 527 fi
ohair@425 528 else
ohair@425 529 # We are running configure from outside of the src dir.
ohair@425 530 # Then use the current directory as output dir!
ohair@425 531 OUTPUT_ROOT="$CURDIR"
ohair@425 532 fi
ohair@425 533
ohair@425 534 SPACESAFE(OUTPUT_ROOT,[the path to the output root])
ohair@425 535
ohair@425 536 # Save the arguments given to us
ohair@425 537 echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments
ohair@425 538
ohair@425 539 # Check if the VS env variables were setup prior to running configure.
ohair@425 540 # If not, then find vcvarsall.bat and run it automatically, and integrate
ohair@425 541 # the set env variables into the spec file.
ohair@425 542 SETUPDEVENV="# No special vars"
ohair@425 543 if test "x$BUILD_OS" = "xwindows"; then
ohair@425 544 # If vcvarsall.bat has been run, then VCINSTALLDIR is set.
ohair@425 545 if test "x$VCINSTALLDIR" != x; then
ohair@425 546 # No further setup is needed. The build will happen from this kind
ohair@425 547 # of shell.
ohair@425 548 SETUPDEVENV="# This spec file expects that you are running bash from within a VS command prompt."
ohair@425 549 # Make sure to remind you, if you forget to run make from a cygwin bash shell
ohair@425 550 # that is spawned "bash -l" from a VS command prompt.
ohair@425 551 CHECK_FOR_VCINSTALLDIR=yes
ohair@425 552 AC_MSG_CHECKING([if you are running from within a VS command prompt])
ohair@425 553 AC_MSG_RESULT([yes])
ohair@425 554 else
ohair@425 555 # Ah, we have not yet run vcvarsall.bat/vsvars32.bat/vsvars64.bat. Lets do that. First find it.
ohair@425 556 if test "x$VS100COMNTOOLS" != x; then
ohair@425 557 VARSBAT=`find "$VS100COMNTOOLS/../.." -name vcvarsall.bat`
ohair@425 558 SEARCH_ROOT="$VS100COMNTOOLS"
ohair@425 559 else
ohair@425 560 VARSBAT=`find "$PROGRAMFILES" -name vcvarsall.bat`
ohair@425 561 SEARCH_ROOT="$PROGRAMFILES"
ohair@425 562 fi
ohair@425 563 VCPATH=`dirname "$VARSBAT"`
ohair@425 564 VCPATH=`cygpath -w "$VCPATH"`
ohair@425 565 if test "x$VARSBAT" = x || test ! -d "$VCPATH"; then
ohair@425 566 AC_MSG_CHECKING([if we can find the VS installation])
ohair@425 567 AC_MSG_RESULT([no])
ohair@425 568 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 569 fi
ohair@425 570 case "$LEGACY_HOST_CPU1" in
ohair@425 571 i?86)
ohair@425 572 VARSBAT_ARCH=x86
ohair@425 573 ;;
ohair@425 574 *)
ohair@425 575 VARSBAT_ARCH=$LEGACY_HOST_CPU1
ohair@425 576 ;;
ohair@425 577 esac
ohair@425 578 # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
ohair@425 579 cd $OUTPUT_ROOT
ohair@425 580 $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH"
ohair@425 581 cd $CURDIR
ohair@425 582 if test ! -s $OUTPUT_ROOT/localdevenv.sh || test ! -s $OUTPUT_ROOT/localdevenv.gmk; then
ohair@425 583 AC_MSG_CHECKING([if we can extract the needed env variables])
ohair@425 584 AC_MSG_RESULT([no])
ohair@425 585 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 586 fi
ohair@425 587 # Now set all paths and other env variables. This will allow the rest of
ohair@425 588 # the configure script to find and run the compiler in the proper way.
ohair@425 589 . $OUTPUT_ROOT/localdevenv.sh
ohair@425 590 AC_MSG_CHECKING([if we can find the VS installation])
ohair@425 591 if test "x$VCINSTALLDIR" != x; then
ohair@425 592 AC_MSG_RESULT([$VCINSTALLDIR])
ohair@425 593 else
ohair@425 594 AC_MSG_RESULT([no])
ohair@425 595 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 596 fi
ohair@425 597 CHECK_FOR_VCINSTALLDIR=no
ohair@425 598 SETUPDEVENV="include $OUTPUT_ROOT/localdevenv.gmk"
ohair@425 599
ohair@425 600 AC_MSG_CHECKING([for msvcr100.dll])
ohair@425 601 AC_ARG_WITH(msvcr100dll, [AS_HELP_STRING([--with-msvcr100dll],
ohair@425 602 [copy this msvcr100.dll into the built JDK])])
ohair@425 603 if test "x$with_msvcr100dll" != x; then
ohair@425 604 MSVCR100DLL="$with_msvcr100dll"
ohair@425 605 else
ohair@425 606 if test "x$HOST_CPU_BITS" = x64; then
ohair@425 607 MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x64 | head --lines 1`
ohair@425 608 else
ohair@425 609 MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1`
ohair@425 610 if test "x$MSVCR100DLL" = x; then
ohair@425 611 MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | head --lines 1`
ohair@425 612 fi
ohair@425 613 fi
ohair@425 614 fi
ohair@425 615 if test "x$MSVCR100DLL" = x; then
ohair@425 616 AC_MSG_RESULT([no])
ohair@425 617 AC_ERROR([Could not find msvcr100.dll !])
ohair@425 618 fi
ohair@425 619 AC_MSG_RESULT([$MSVCR100DLL])
ohair@425 620 SPACESAFE(MSVCR100DLL,[the path to msvcr100.dll])
ohair@425 621 fi
ohair@425 622 fi
ohair@425 623 AC_SUBST(SETUPDEVENV)
ohair@425 624 AC_SUBST(CHECK_FOR_VCINSTALLDIR)
ohair@425 625 AC_SUBST(MSVCR100DLL)
ohair@425 626
ohair@425 627 # Most of the probed defines are put into config.h
ohair@425 628 AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
ohair@425 629 # The spec.gmk file contains all variables for the make system.
ohair@425 630 AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
ohair@425 631 # The generated Makefile knows where the spec.gmk is and where the source is.
ohair@425 632 # You can run make from the OUTPUT_ROOT. If you have only
ohair@425 633 # one configured host, then you can also run make from the SRC_ROOT,
ohair@425 634 # since it will go look for a single spec.gmk file. Or perhaps it
ohair@425 635 # should instead make all configured hosts it can find?
ohair@425 636 AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
ohair@425 637
ohair@425 638 AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk)
ohair@425 639 AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
ohair@425 640
ohair@425 641 # Where are the sources. Any of these can be overridden
ohair@425 642 # using --with-override-corba and the likes.
ohair@425 643 LANGTOOLS_TOPDIR="$SRC_ROOT/langtools"
ohair@425 644 CORBA_TOPDIR="$SRC_ROOT/corba"
ohair@425 645 JAXP_TOPDIR="$SRC_ROOT/jaxp"
ohair@425 646 JAXWS_TOPDIR="$SRC_ROOT/jaxws"
ohair@425 647 HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
ohair@425 648 JDK_TOPDIR="$SRC_ROOT/jdk"
ohair@425 649 AC_SUBST(LANGTOOLS_TOPDIR)
ohair@425 650 AC_SUBST(CORBA_TOPDIR)
ohair@425 651 AC_SUBST(JAXP_TOPDIR)
ohair@425 652 AC_SUBST(JAXWS_TOPDIR)
ohair@425 653 AC_SUBST(HOTSPOT_TOPDIR)
ohair@425 654 AC_SUBST(JDK_TOPDIR)
ohair@425 655
ohair@425 656 # Check if pkg-config is available.
ohair@425 657 PKG_PROG_PKG_CONFIG
ohair@425 658
ohair@425 659 AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf],
ohair@425 660 [use this configuration file for the builddeps])])
ohair@425 661
ohair@425 662 AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server],
ohair@425 663 [download and use build dependencies from this server url, e.g. --with-builddeps-server=ftp://example.com/dir])])
ohair@425 664
ohair@425 665 AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir],
ohair@425 666 [store downloaded build dependencies here @<:@d/localhome/builddeps@:>@])],
ohair@425 667 [],
ohair@425 668 [with_builddeps_dir=/localhome/builddeps])
ohair@425 669
ohair@425 670 AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group],
ohair@425 671 [chgrp the downloaded build dependencies to this group])])
ohair@425 672
ohair@425 673 AC_ARG_ENABLE([list-builddeps], [AS_HELP_STRING([--enable-list-builddeps],
ohair@425 674 [list all build dependencies known to the configure script])],
ohair@425 675 [LIST_BUILDDEPS="${enableval}"], [LIST_BUILDDEPS='no'])
ohair@425 676
ohair@425 677 if test "x$LIST_BUILDDEPS" = xyes; then
ohair@425 678 echo
ohair@425 679 echo List of build dependencies known to the configure script,
ohair@425 680 echo that can be used in builddeps.conf files:
ohair@425 681 cat $SRC_ROOT/configure.ac | grep BDEPS_CHECK_MODUL | grep -v configure.ac | cut -f 2 -d ',' | tr -d ' ' | sort
ohair@425 682 echo
ohair@425 683 exit 1
ohair@425 684 fi
ohair@425 685
ohair@425 686 # If builddeps server or conf file is given. Setup buildeps usage.
ohair@425 687 BDEPS_SCAN_FOR_BUILDDEPS
ohair@425 688
ohair@425 689 ###############################################################################
ohair@425 690 #
ohair@425 691 # Configure the development tool paths and potential sysroot.
ohair@425 692 #
ohair@425 693 AC_LANG(C++)
ohair@425 694 DEVKIT=
ohair@425 695 SYS_ROOT=/
ohair@425 696 AC_SUBST(SYS_ROOT)
ohair@425 697
ohair@425 698 # The option used to specify the target .o,.a or .so file.
ohair@425 699 # When compiling, how to specify the to be created object file.
ohair@425 700 CC_OUT_OPTION='-o$(SPACE)'
ohair@425 701 # When linking, how to specify the to be created executable.
ohair@425 702 EXE_OUT_OPTION='-o$(SPACE)'
ohair@425 703 # When linking, how to specify the to be created dynamically linkable library.
ohair@425 704 LD_OUT_OPTION='-o$(SPACE)'
ohair@425 705 # When archiving, how to specify the to be create static archive for object files.
ohair@425 706 AR_OUT_OPTION='rcs$(SPACE)'
ohair@425 707 AC_SUBST(CC_OUT_OPTION)
ohair@425 708 AC_SUBST(EXE_OUT_OPTION)
ohair@425 709 AC_SUBST(LD_OUT_OPTION)
ohair@425 710 AC_SUBST(AR_OUT_OPTION)
ohair@425 711
ohair@425 712 # If --build AND --host is set, then the configure script will find any
ohair@425 713 # cross compilation tools in the PATH. Cross compilation tools
ohair@425 714 # follows the cross compilation standard where they are prefixed with ${host}.
ohair@425 715 # For example the binary i686-sun-solaris2.10-gcc
ohair@425 716 # will cross compile for i686-sun-solaris2.10
ohair@425 717 # If neither of build and host is not set, then build=host and the
ohair@425 718 # default compiler found in the path will be used.
ohair@425 719 # Setting only --host, does not seem to be really supported.
ohair@425 720 # Please set both --build and --host if you want to cross compile.
ohair@425 721
ohair@425 722 DEFINE_CROSS_COMPILE_ARCH=""
ohair@425 723 HOSTCC=""
ohair@425 724 HOSTCXX=""
ohair@425 725 AC_SUBST(DEFINE_CROSS_COMPILE_ARCH)
ohair@425 726 AC_SUBST(HOST_CC)
ohair@425 727 AC_SUBST(HOST_CXX)
ohair@425 728 AC_MSG_CHECKING([if this is a cross compile])
ohair@425 729 if test "x$build_var" != "x$host_var"; then
ohair@425 730 AC_MSG_RESULT([yes, from $build_var to $host_var])
ohair@425 731 # We have detected a cross compile!
ohair@425 732 DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$LEGACY_HOST_CPU1"
ohair@425 733 # Now we to find a C/C++ compiler that can build executables for the build
ohair@425 734 # platform. We can't use the AC_PROG_CC macro, since it can only be used
ohair@425 735 # once.
ohair@425 736 AC_PATH_PROGS(HOSTCC, [cl cc gcc])
ohair@425 737 WHICHCMD(HOSTCC)
ohair@425 738 AC_PATH_PROGS(HOSTCXX, [cl CC g++])
ohair@425 739 WHICHCMD(HOSTCXX)
ohair@425 740 # Building for the build platform should be easy. Therefore
ohair@425 741 # we do not need any linkers or assemblers etc.
ohair@425 742 else
ohair@425 743 AC_MSG_RESULT([no])
ohair@425 744 fi
ohair@425 745
ohair@425 746 # You can force the sys-root if the sys-root encoded into the cross compiler tools
ohair@425 747 # is not correct.
ohair@425 748 AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root],
ohair@425 749 [pass this sys-root to the compilers and linker (useful if the sys-root encoded in
ohair@425 750 the cross compiler tools is incorrect)])])
ohair@425 751
ohair@425 752 if test "x$with_sys_root" != x; then
ohair@425 753 SYS_ROOT=$with_sys_root
ohair@425 754 fi
ohair@425 755
ohair@425 756 # If a devkit is found on the builddeps server, then prepend its path to the
ohair@425 757 # PATH variable. If there are cross compilers available in the devkit, these
ohair@425 758 # will be found by AC_PROG_CC et al.
ohair@425 759 BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
ohair@425 760 [# Found devkit
ohair@425 761 PATH="$DEVKIT/bin:$PATH"
ohair@425 762 SYS_ROOT="$DEVKIT/${rewritten_host}/sys-root"
ohair@425 763 if test "x$x_includes" = "xNONE"; then
ohair@425 764 x_includes="$SYS_ROOT/usr/include/X11"
ohair@425 765 fi
ohair@425 766 if test "x$x_libraries" = "xNONE"; then
ohair@425 767 x_libraries="$SYS_ROOT/usr/lib"
ohair@425 768 fi
ohair@425 769 ],
ohair@425 770 [])
ohair@425 771
ohair@425 772 if test "x$SYS_ROOT" != "x/" ; then
ohair@425 773 CFLAGS="--sysroot=$SYS_ROOT $CFLAGS"
ohair@425 774 CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS"
ohair@425 775 OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
ohair@425 776 OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
ohair@425 777 CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS"
ohair@425 778 LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS"
ohair@425 779 fi
ohair@425 780
ohair@425 781 # Store the CFLAGS etal passed to the configure script.
ohair@425 782 ORG_CFLAGS="$CFLAGS"
ohair@425 783 ORG_CXXFLAGS="$CXXFLAGS"
ohair@425 784 ORG_OBJCFLAGS="$OBJCFLAGS"
ohair@425 785
ohair@425 786 # gcc is almost always present, but on Windows we
ohair@425 787 # prefer cl.exe and on Solaris we prefer CC.
ohair@425 788 # Thus test for them in this order.
ohair@425 789 AC_PROG_CC([cl cc gcc])
ohair@425 790 if test "x$CC" = x; then
ohair@425 791 help_on_build_dependency devkit
ohair@425 792 AC_ERROR([Could not find a compiler. $HELP_MSG])
ohair@425 793 fi
ohair@425 794 if test "x$CC" = xcc && test "x$BUILD_OS" = xmacosx; then
ohair@425 795 # Do not use cc on MacOSX use gcc instead.
ohair@425 796 CC="gcc"
ohair@425 797 fi
ohair@425 798 WHICHCMD(CC)
ohair@425 799
ohair@425 800 AC_PROG_CXX([cl CC g++])
ohair@425 801 if test "x$CXX" = xCC && test "x$BUILD_OS" = xmacosx; then
ohair@425 802 # The found CC, even though it seems to be a g++ derivate, cannot compile
ohair@425 803 # c++ code. Override.
ohair@425 804 CXX="g++"
ohair@425 805 fi
ohair@425 806 WHICHCMD(CXX)
ohair@425 807
ohair@425 808 if test "x$CXX" = x || test "x$CC" = x; then
ohair@425 809 help_on_build_dependency devkit
ohair@425 810 AC_ERROR([Could not find the needed compilers! $HELP_MSG ])
ohair@425 811 fi
ohair@425 812
ohair@425 813 if test "x$BUILD_OS" != xwindows; then
ohair@425 814 AC_PROG_OBJC
ohair@425 815 WHICHCMD(OBJC)
ohair@425 816 else
ohair@425 817 OBJC=
ohair@425 818 fi
ohair@425 819
ohair@425 820 # Restore the flags to the user specified values.
ohair@425 821 # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
ohair@425 822 CFLAGS="$ORG_CFLAGS"
ohair@425 823 CXXFLAGS="$ORG_CXXFLAGS"
ohair@425 824 OBJCFLAGS="$ORG_OBJCFLAGS"
ohair@425 825
ohair@425 826 # If we are not cross compiling, use the same compilers for
ohair@425 827 # building the build platform executables.
ohair@425 828 if test "x$DEFINE_CROSS_COMPILE_ARCH" = x; then
ohair@425 829 HOSTCC="$CC"
ohair@425 830 HOSTCXX="$CXX"
ohair@425 831 fi
ohair@425 832
ohair@425 833 AC_CHECK_TOOL(LD, ld)
ohair@425 834 WHICHCMD(LD)
ohair@425 835 LDEXE="$LD"
ohair@425 836 LDCXX="$LD"
ohair@425 837 LDEXECXX="$LD"
ohair@425 838 # LDEXE is the linker to use, when creating executables.
ohair@425 839 AC_SUBST(LDEXE)
ohair@425 840 # Linking C++ libraries.
ohair@425 841 AC_SUBST(LDCXX)
ohair@425 842 # Linking C++ executables.
ohair@425 843 AC_SUBST(LDEXECXX)
ohair@425 844
ohair@425 845 AC_CHECK_TOOL(AR, ar)
ohair@425 846 WHICHCMD(AR)
ohair@425 847 if test "x$BUILD_OS" = xmacosx; then
ohair@425 848 ARFLAGS="-r"
ohair@425 849 else
ohair@425 850 ARFLAGS=""
ohair@425 851 fi
ohair@425 852 AC_SUBST(ARFLAGS)
ohair@425 853
ohair@425 854 COMPILER_NAME=gcc
ohair@425 855 COMPILER_TYPE=CC
ohair@425 856 AS_IF([test "x$BUILD_OS" = xwindows], [
ohair@425 857 # For now, assume that we are always compiling using cl.exe.
ohair@425 858 CC_OUT_OPTION=-Fo
ohair@425 859 EXE_OUT_OPTION=-Fe
ohair@425 860 LD_OUT_OPTION=-out:
ohair@425 861 AR_OUT_OPTION=-out:
ohair@425 862 # On Windows, reject /usr/bin/link, which is a cygwin
ohair@425 863 # program for something completely different.
ohair@425 864 AC_CHECK_PROG([WINLD], [link],[link],,, [/usr/bin/link])
ohair@425 865 # Since we must ignore the first found link, WINLD will contain
ohair@425 866 # the full path to the link.exe program.
ohair@425 867 WHICHCMD_SPACESAFE([WINLD])
ohair@425 868 LD="$WINLD"
ohair@425 869 # However creating executables can only be done with cl.exe.
ohair@425 870 LDEXE="$CC"
ohair@425 871 LDCXX="$WINLD"
ohair@425 872 LDEXECXX="$CC"
ohair@425 873
ohair@425 874 AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt])
ohair@425 875 WHICHCMD_SPACESAFE([MT])
ohair@425 876 # The resource compiler
ohair@425 877 AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc])
ohair@425 878 WHICHCMD_SPACESAFE([RC])
ohair@425 879
ohair@425 880 RC_FLAGS="/l 0x409 /r"
ohair@425 881 AS_IF([test "x$VARIANT" = xOPT], [
ohair@425 882 RC_FLAGS="$RC_FLAGS -d NDEBUG"
ohair@425 883 ])
ohair@425 884 JDK_UPDATE_VERSION_NOTNULL=$JDK_UPDATE_VERSION
ohair@425 885 AS_IF([test "x$JDK_UPDATE_VERSION" = x], [
ohair@425 886 JDK_UPDATE_VERSION_NOTNULL=0
ohair@425 887 ])
ohair@425 888 RC_FLAGS="$RC_FLAGS -d \"JDK_BUILD_ID=$FULL_VERSION\""
ohair@425 889 RC_FLAGS="$RC_FLAGS -d \"JDK_COMPANY=$COMPANY_NAME\""
ohair@425 890 RC_FLAGS="$RC_FLAGS -d \"JDK_COMPONENT=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME binary\""
ohair@425 891 RC_FLAGS="$RC_FLAGS -d \"JDK_VER=$JDK_MINOR_VERSION.$JDK_MICRO_VERSION.$JDK_UPDATE_VERSION_NOTNULL.$COOKED_BUILD_NUMBER\""
ohair@425 892 RC_FLAGS="$RC_FLAGS -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\""
ohair@425 893 RC_FLAGS="$RC_FLAGS -d \"JDK_NAME=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME $JDK_MINOR_VERSION $JDK_UPDATE_META_TAG\""
ohair@425 894 RC_FLAGS="$RC_FLAGS -d \"JDK_FVER=$JDK_MINOR_VERSION,$JDK_MICRO_VERSION,$JDK_UPDATE_VERSION_NOTNULL,$COOKED_BUILD_NUMBER\""
ohair@425 895
ohair@425 896 # lib.exe is used to create static libraries.
ohair@425 897 AC_CHECK_PROG([WINAR], [lib],[lib],,,)
ohair@425 898 WHICHCMD_SPACESAFE([WINAR])
ohair@425 899 AR="$WINAR"
ohair@425 900 ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
ohair@425 901
ohair@425 902 AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
ohair@425 903 WHICHCMD_SPACESAFE([DUMPBIN])
ohair@425 904
ohair@425 905 COMPILER_TYPE=CL
ohair@425 906 CFLAGS="$CFLAGS -nologo"
ohair@425 907 LDFLAGS="$LDFLAGS -nologo -dll -opt:ref -incremental:no "
ohair@425 908 if test "x$LEGACY_HOST_CPU1" = xi586; then
ohair@425 909 LDFLAGS="$LDFLAGS -safeseh"
ohair@425 910 fi
ohair@425 911 if test "x$DEBUG_LEVEL" != xrelease; then
ohair@425 912 LDFLAGS="$LDFLAGS -debug"
ohair@425 913 fi
ohair@425 914 ])
ohair@425 915 AC_SUBST(RC_FLAGS)
ohair@425 916 AC_SUBST(COMPILER_TYPE)
ohair@425 917
ohair@425 918 AC_PROG_CPP
ohair@425 919 WHICHCMD(CPP)
ohair@425 920
ohair@425 921 AC_PROG_CXXCPP
ohair@425 922 WHICHCMD(CXXCPP)
ohair@425 923
ohair@425 924 # Find the right assembler.
ohair@425 925 if test "x$BUILD_OS" = xsolaris; then
ohair@425 926 AC_PATH_PROG(AS, as)
ohair@425 927 WHICHCMD(AS)
ohair@425 928 ASFLAGS=" "
ohair@425 929 else
ohair@425 930 AS="$CC -c"
ohair@425 931 ASFLAGS=" "
ohair@425 932 fi
ohair@425 933 AC_SUBST(AS)
ohair@425 934 AC_SUBST(ASFLAGS)
ohair@425 935
ohair@425 936 if test "x$HOST_CPU_BITS" = x32 && test "x$HOST_OS" = macosx; then
ohair@425 937 # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
ohair@425 938 # While waiting for a better solution, the current workaround is to use -mstackrealign.
ohair@425 939 CFLAGS="$CFLAGS -mstackrealign"
ohair@425 940 AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign])
ohair@425 941 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
ohair@425 942 [
ohair@425 943 AC_MSG_RESULT([yes])
ohair@425 944 ],
ohair@425 945 [
ohair@425 946 AC_MSG_RESULT([no])
ohair@425 947 AC_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
ohair@425 948 ])
ohair@425 949 fi
ohair@425 950
ohair@425 951 if test "x$BUILD_OS" = xsolaris; then
ohair@425 952 AC_PATH_PROG(NM, nm)
ohair@425 953 WHICHCMD(NM)
ohair@425 954 AC_PATH_PROG(STRIP, strip)
ohair@425 955 WHICHCMD(STRIP)
ohair@425 956 AC_PATH_PROG(MCS, mcs)
ohair@425 957 WHICHCMD(MCS)
ohair@425 958 else
ohair@425 959 AC_CHECK_TOOL(NM, nm)
ohair@425 960 WHICHCMD(NM)
ohair@425 961 AC_CHECK_TOOL(STRIP, strip)
ohair@425 962 WHICHCMD(STRIP)
ohair@425 963 fi
ohair@425 964
ohair@425 965 # When using cygwin, we need a wrapper binary that renames
ohair@425 966 # /cygdrive/c/ arguments into c:/ arguments and peeks into
ohair@425 967 # @files and rewrites these too! This wrapper binary is
ohair@425 968 # called uncygdrive.exe.
ohair@425 969 UNCYGDRIVE=
ohair@425 970 if test "x$BUILD_OS" = xwindows; then
ohair@425 971 AC_MSG_CHECKING([if uncygdrive can be created])
ohair@425 972 UNCYGDRIVE_SRC=`$CYGPATH -m $SRC_ROOT/common/src/uncygdrive.c`
ohair@425 973 rm -f $OUTPUT_ROOT/uncygdrive*
ohair@425 974 UNCYGDRIVE=`$CYGPATH -m $OUTPUT_ROOT/uncygdrive.exe`
ohair@425 975 cd $OUTPUT_ROOT
ohair@425 976 $CC $UNCYGDRIVE_SRC /Fe$UNCYGDRIVE > $OUTPUT_ROOT/uncygdrive1.log 2>&1
ohair@425 977 cd $CURDIR
ohair@425 978
ohair@425 979 if test ! -x $OUTPUT_ROOT/uncygdrive.exe; then
ohair@425 980 AC_MSG_RESULT([no])
ohair@425 981 cat $OUTPUT_ROOT/uncygdrive1.log
ohair@425 982 AC_ERROR([Could not create $OUTPUT_ROOT/uncygdrive.exe])
ohair@425 983 fi
ohair@425 984 AC_MSG_RESULT([$UNCYGDRIVE])
ohair@425 985 AC_MSG_CHECKING([if uncygdrive.exe works])
ohair@425 986 cd $OUTPUT_ROOT
ohair@425 987 $UNCYGDRIVE $CC $SRC_ROOT/common/src/uncygdrive.c /Fe$OUTPUT_ROOT/uncygdrive2.exe > $OUTPUT_ROOT/uncygdrive2.log 2>&1
ohair@425 988 cd $CURDIR
ohair@425 989 if test ! -x $OUTPUT_ROOT/uncygdrive2.exe; then
ohair@425 990 AC_MSG_RESULT([no])
ohair@425 991 cat $OUTPUT_ROOT/uncygdrive2.log
ohair@425 992 AC_ERROR([Uncygdrive did not work!])
ohair@425 993 fi
ohair@425 994 AC_MSG_RESULT([yes])
ohair@425 995 rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj
ohair@425 996 fi
ohair@425 997
ohair@425 998 AC_SUBST(UNCYGDRIVE)
ohair@425 999
ohair@425 1000 TESTFOR_PROG_CCACHE
ohair@425 1001
ohair@425 1002 # Used on GNU/Linux systems, can be empty...
ohair@425 1003 #AC_PATH_PROG(ELFDUMP, elfdump)
ohair@425 1004
ohair@425 1005 # Setup default logging of stdout and stderr to build.log in the output root.
ohair@425 1006 BUILD_LOG='$(OUTPUT_ROOT)/build.log'
ihse@430 1007 BUILD_LOG_WRAPPER='$(SH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)'
ohair@425 1008 AC_SUBST(BUILD_LOG)
ohair@425 1009 AC_SUBST(BUILD_LOG_WRAPPER)
ohair@425 1010
ohair@425 1011 ###############################################################################
ohair@425 1012 #
ohair@425 1013 # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code.
ohair@425 1014 # (The JVM can use 32 or 64 bit Java pointers but that decision
ohair@425 1015 # is made at runtime.)
ohair@425 1016 #
ohair@425 1017 AC_CHECK_SIZEOF([int *], [1111])
ohair@425 1018 if test "x$ac_cv_sizeof_int_p" = x0; then
ohair@425 1019 # The test failed, lets pick the assumed value.
ohair@425 1020 ARCH_DATA_MODEL=$HOST_CPU_BITS
ohair@425 1021 else
ohair@425 1022 ARCH_DATA_MODEL=`expr 8 \* $ac_cv_sizeof_int_p`
ohair@425 1023 fi
ohair@425 1024
ohair@425 1025 if test "x$ARCH_DATA_MODEL" = x64; then
ohair@425 1026 A_LP64="LP64:="
ohair@425 1027 ADD_LP64="-D_LP64=1"
ohair@425 1028 fi
ohair@425 1029 AC_MSG_CHECKING([for host address size])
ohair@425 1030 AC_MSG_RESULT([$ARCH_DATA_MODEL bits])
ohair@425 1031 AC_SUBST(LP64,$A_LP64)
ohair@425 1032 AC_SUBST(ARCH_DATA_MODEL)
ohair@425 1033
ohair@425 1034 if test "x$ARCH_DATA_MODEL" != "x$HOST_CPU_BITS"; then
ohair@425 1035 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 1036 fi
ohair@425 1037
ohair@425 1038 ###############################################################################
ohair@425 1039 #
ohair@425 1040 # Can the C/C++ compiler use precompiled headers?
ohair@425 1041 #
ohair@425 1042 AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers],
ohair@425 1043 [use precompiled headers when compiling C++ @<:@enabled@:>@])],
ohair@425 1044 [ENABLE_PRECOMPH=${enable_precompiled-headers}], [ENABLE_PRECOMPH=yes])
ohair@425 1045
ohair@425 1046 USE_PRECOMPILED_HEADER=1
ohair@425 1047 if test "x$ENABLE_PRECOMPH" = xno; then
ohair@425 1048 USE_PRECOMPILED_HEADER=0
ohair@425 1049 fi
ohair@425 1050
ohair@425 1051 if test "x$ENABLE_PRECOMPH" = xyes; then
ohair@425 1052 # Check that the compiler actually supports precomp headers.
ohair@425 1053 if test "x$GCC" = xyes; then
ohair@425 1054 AC_MSG_CHECKING([that precompiled headers work])
ohair@425 1055 echo "int alfa();" > conftest.h
ohair@425 1056 $CXX -x c++-header conftest.h -o conftest.hpp.gch
ohair@425 1057 if test ! -f conftest.hpp.gch; then
ohair@425 1058 echo Precompiled header is not working!
ohair@425 1059 USE_PRECOMPILED_HEADER=0
ohair@425 1060 AC_MSG_RESULT([no])
ohair@425 1061 else
ohair@425 1062 AC_MSG_RESULT([yes])
ohair@425 1063 fi
ohair@425 1064 rm -f conftest.h
ohair@425 1065 fi
ohair@425 1066 fi
ohair@425 1067
ohair@425 1068 AC_SUBST(USE_PRECOMPILED_HEADER)
ohair@425 1069
ohair@425 1070 ###############################################################################
ohair@425 1071 #
ohair@425 1072 # How to compile shared libraries.
ohair@425 1073 #
ohair@425 1074
ohair@425 1075 if test "x$GCC" = xyes; then
ohair@425 1076 COMPILER_NAME=gcc
ohair@425 1077 PICFLAG="-fPIC"
ohair@425 1078 LIBRARY_PREFIX=lib
ohair@425 1079 SHARED_LIBRARY='lib$1.so'
ohair@425 1080 STATIC_LIBRARY='lib$1.a'
ohair@425 1081 SHARED_LIBRARY_FLAGS="-shared"
ohair@425 1082 SHARED_LIBRARY_SUFFIX='.so'
ohair@425 1083 STATIC_LIBRARY_SUFFIX='.a'
ohair@425 1084 OBJ_SUFFIX='.o'
ohair@425 1085 EXE_SUFFIX=''
ohair@425 1086 SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
ohair@425 1087 SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$(JDK_TOPDIR)/$1'
ohair@425 1088 SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN/$1'
ohair@425 1089 LD="$CC"
ohair@425 1090 LDEXE="$CC"
ohair@425 1091 LDCXX="$CXX"
ohair@425 1092 LDEXECXX="$CXX"
ohair@425 1093
ohair@425 1094 # Linking is different on MacOSX
ohair@425 1095 if test "x$BUILD_OS" = xmacosx; then
ohair@425 1096 # Might change in the future to clang.
ohair@425 1097 COMPILER_NAME=gcc
ohair@425 1098 SHARED_LIBRARY='lib$1.dylib'
ohair@425 1099 SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
ohair@425 1100 SHARED_LIBRARY_SUFFIX='.dylib'
ohair@425 1101 EXE_SUFFIX=''
ohair@425 1102 SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
ohair@425 1103 SET_SHARED_LIBRARY_MAPFILE=''
ohair@425 1104 SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
ohair@425 1105 fi
ohair@425 1106 else
ohair@425 1107 if test "x$BUILD_OS" = xsolaris; then
ohair@425 1108 # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler
ohair@425 1109 COMPILER_NAME=ossc
ohair@425 1110 PICFLAG="-KPIC"
ohair@425 1111 LIBRARY_PREFIX=lib
ohair@425 1112 SHARED_LIBRARY='lib$1.so'
ohair@425 1113 STATIC_LIBRARY='lib$1.a'
ohair@425 1114 SHARED_LIBRARY_FLAGS="-G"
ohair@425 1115 SHARED_LIBRARY_SUFFIX='.so'
ohair@425 1116 STATIC_LIBRARY_SUFFIX='.a'
ohair@425 1117 OBJ_SUFFIX='.o'
ohair@425 1118 EXE_SUFFIX=''
ohair@425 1119 SET_SHARED_LIBRARY_NAME=''
ohair@425 1120 SET_SHARED_LIBRARY_MAPFILE='-M $(JDK_TOPDIR)/$1'
ohair@425 1121 SET_SHARED_LIBRARY_ORIGIN='-R \$$$$ORIGIN/$1'
ohair@425 1122 CFLAGS_JDKLIB_EXTRA='-xstrconst -D__solaris__'
ohair@425 1123 fi
ohair@425 1124 if test "x$BUILD_OS" = xwindows; then
ohair@425 1125 # If it is not gcc, then assume it is the MS Visual Studio compiler
ohair@425 1126 COMPILER_NAME=cl
ohair@425 1127 PICFLAG=""
ohair@425 1128 LIBRARY_PREFIX=
ohair@425 1129 SHARED_LIBRARY='$1.dll'
ohair@425 1130 STATIC_LIBRARY='$1.lib'
ohair@425 1131 SHARED_LIBRARY_FLAGS="-LD"
ohair@425 1132 SHARED_LIBRARY_SUFFIX='.dll'
ohair@425 1133 STATIC_LIBRARY_SUFFIX='.lib'
ohair@425 1134 OBJ_SUFFIX='.obj'
ohair@425 1135 EXE_SUFFIX='.exe'
ohair@425 1136 SET_SHARED_LIBRARY_NAME=''
ohair@425 1137 SET_SHARED_LIBRARY_MAPFILE=''
ohair@425 1138 SET_SHARED_LIBRARY_ORIGIN=''
ohair@425 1139 fi
ohair@425 1140 fi
ohair@425 1141
ohair@425 1142 AC_SUBST(OBJ_SUFFIX)
ohair@425 1143 AC_SUBST(SHARED_LIBRARY)
ohair@425 1144 AC_SUBST(STATIC_LIBRARY)
ohair@425 1145 AC_SUBST(LIBRARY_PREFIX)
ohair@425 1146 AC_SUBST(SHARED_LIBRARY_SUFFIX)
ohair@425 1147 AC_SUBST(STATIC_LIBRARY_SUFFIX)
ohair@425 1148 AC_SUBST(EXE_SUFFIX)
ohair@425 1149 AC_SUBST(SHARED_LIBRARY_FLAGS)
ohair@425 1150 AC_SUBST(SET_SHARED_LIBRARY_NAME)
ohair@425 1151 AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
ohair@425 1152 AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
ohair@425 1153
ohair@425 1154 # The (cross) compiler is now configured, we can now test capabilities
ohair@425 1155 # of the host platform.
ohair@425 1156
ohair@425 1157 ###############################################################################
ohair@425 1158 #
ohair@425 1159 # Is the host little of big endian?
ohair@425 1160 #
ohair@425 1161 AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal"])
ohair@425 1162
ohair@425 1163 if test "x$ENDIAN" = xuniversal; then
ohair@425 1164 AC_ERROR([It seems like someone needs to decide how we are to deal with universal binaries on the MacOSX?])
ohair@425 1165 fi
ohair@425 1166 if test "x$ENDIAN" = xunknown; then
ohair@425 1167 ENDIAN="$HOST_CPU_ENDIAN"
ohair@425 1168 fi
ohair@425 1169 if test "x$ENDIAN" != "x$HOST_CPU_ENDIAN"; then
ohair@425 1170 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 1171 ENDIAN="$HOST_CPU_ENDIAN"
ohair@425 1172 fi
ohair@425 1173 AC_SUBST(ENDIAN)
ohair@425 1174
ohair@425 1175 ###############################################################################
ohair@425 1176 #
ohair@425 1177 # We need a Boot JDK to bootstrap the build.
ohair@425 1178 #
ohair@425 1179 BOOT_JDK_FOUND=no
ohair@425 1180 AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk],
ohair@425 1181 [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])])
ohair@425 1182
ohair@425 1183 if test "x$with_boot_jdk" != x; then
ohair@425 1184 BOOT_JDK=$with_boot_jdk
ohair@425 1185 BOOT_JDK_FOUND=yes
ohair@425 1186 fi
ohair@425 1187 if test "x$BOOT_JDK_FOUND" = xno; then
ohair@425 1188 BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=yes], [BOOT_JDK_FOUND=no])
ohair@425 1189 fi
ohair@425 1190
ohair@425 1191 if test "x$BOOT_JDK_FOUND" = xno; then
ohair@425 1192 if test "x$JAVA_HOME" != x; then
ohair@425 1193 if test ! -d "$JAVA_HOME"; then
ohair@425 1194 AC_ERROR([Your JAVA_HOME points to a non-existing directory!])
ohair@425 1195 fi
ohair@425 1196 # Aha, the user has set a JAVA_HOME
ohair@425 1197 # let us use that as the Boot JDK.
ohair@425 1198 BOOT_JDK=$JAVA_HOME
ohair@425 1199 BOOT_JDK_FOUND=yes
ohair@425 1200 # To be on the safe side, lets check that it is a JDK.
ohair@425 1201 if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
ohair@425 1202 JAVAC=$BOOT_JDK/bin/javac
ohair@425 1203 JAVA=$BOOT_JDK/bin/java
ohair@425 1204 BOOT_JDK_FOUND=yes
ohair@425 1205 else
ohair@425 1206 AC_ERROR([Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK.])
ohair@425 1207 fi
ohair@425 1208 fi
ohair@425 1209 fi
ohair@425 1210
ohair@425 1211 if test "x$BOOT_JDK_FOUND" = xno; then
ohair@425 1212 AC_PATH_PROG(JAVAC_CHECK, javac)
ohair@425 1213 AC_PATH_PROG(JAVA_CHECK, java)
ohair@425 1214 BINARY="$JAVAC_CHECK"
ohair@425 1215 if test "x$JAVAC_CHECK" = x; then
ohair@425 1216 BINARY="$JAVA_CHECK"
ohair@425 1217 fi
ohair@425 1218 if test "x$BINARY" != x; then
ohair@425 1219 # So there is a java(c) binary, it might be part of a JDK.
ohair@425 1220 # Lets find the JDK/JRE directory by following symbolic links.
ohair@425 1221 # Linux/GNU systems often have links from /usr/bin/java to
ohair@425 1222 # /etc/alternatives/java to the real JDK binary.
ohair@425 1223 WHICHCMD_SPACESAFE(BINARY,[path to javac])
ohair@425 1224 REMOVE_SYMBOLIC_LINKS(BINARY)
ohair@425 1225 BOOT_JDK=`dirname $BINARY`
ohair@425 1226 BOOT_JDK=`cd $BOOT_JDK/..; pwd`
ohair@425 1227 if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
ohair@425 1228 JAVAC=$BOOT_JDK/bin/javac
ohair@425 1229 JAVA=$BOOT_JDK/bin/java
ohair@425 1230 BOOT_JDK_FOUND=yes
ohair@425 1231 fi
ohair@425 1232 fi
ohair@425 1233 fi
ohair@425 1234
ohair@425 1235 if test "x$BOOT_JDK_FOUND" = xno; then
ohair@425 1236 # Try the MacOSX way.
ohair@425 1237 if test -x /usr/libexec/java_home; then
ohair@425 1238 BOOT_JDK=`/usr/libexec/java_home`
ohair@425 1239 if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
ohair@425 1240 JAVAC=$BOOT_JDK/bin/javac
ohair@425 1241 JAVA=$BOOT_JDK/bin/java
ohair@425 1242 BOOT_JDK_FOUND=yes
ohair@425 1243 fi
ohair@425 1244 fi
ohair@425 1245 fi
ohair@425 1246
ohair@425 1247 if test "x$BOOT_JDK_FOUND" = xno; then
ohair@425 1248 AC_PATH_PROG(JAVA_CHECK, java)
ohair@425 1249 if test "x$JAVA_CHECK" != x; then
ohair@425 1250 # There is a java in the path. But apparently we have not found a javac
ohair@425 1251 # in the path, since that would have been tested earlier.
ohair@425 1252 if test "x$HOST_OS" = xwindows; then
ohair@425 1253 # Now if this is a windows platform. The default installation of a JDK
ohair@425 1254 # actually puts the JRE in the path and keeps the JDK out of the path!
ohair@425 1255 # Go look in the default installation location.
ohair@425 1256 BOOT_JDK=/cygdrive/c/Program\ Files/Java/`ls /cygdrive/c/Program\ Files/Java | grep jdk | sort -r | head --lines 1`
ohair@425 1257 if test -d "$BOOT_JDK"; then
ohair@425 1258 BOOT_JDK_FOUND=yes
ohair@425 1259 fi
ohair@425 1260 fi
ohair@425 1261 if test "x$BOOT_JDK_FOUND" = xno; then
ohair@425 1262 help_on_build_dependency openjdk
ohair@425 1263 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 1264 fi
ohair@425 1265 else
ohair@425 1266 help_on_build_dependency openjdk
ohair@425 1267 AC_ERROR([Could not find a JDK. $HELP_MSG])
ohair@425 1268 fi
ohair@425 1269 fi
ohair@425 1270
ohair@425 1271 WIN_FIX_PATH(BOOT_JDK)
ohair@425 1272
ohair@425 1273 # Now see if we can find the rt.jar, or its nearest equivalent.
ohair@425 1274 BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
ohair@425 1275 SPACESAFE(BOOT_RTJAR,[the path to the Boot JDK rt.jar (or nearest equivalent)])
ohair@425 1276
ohair@425 1277 BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
ohair@425 1278 SPACESAFE(BOOT_TOOLSJAR,[the path to the Boot JDK tools.jar (or nearest equivalent)])
ohair@425 1279
ohair@425 1280 if test ! -f $BOOT_RTJAR; then
ohair@425 1281 # On MacOSX it is called classes.jar
ohair@425 1282 BOOT_RTJAR=$BOOT_JDK/../Classes/classes.jar
ohair@425 1283 if test ! -f $BOOT_RTJAR; then
ohair@425 1284 AC_ERROR([Cannot find the rt.jar or its equivalent!])
ohair@425 1285 fi
ohair@425 1286 # Remove the ..
ohair@425 1287 BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
ohair@425 1288 # The tools.jar is part of classes.jar
ohair@425 1289 BOOT_TOOLSJAR="$BOOT_RTJAR"
ohair@425 1290 fi
ohair@425 1291
ohair@425 1292 AC_SUBST(BOOT_JDK)
ohair@425 1293 AC_SUBST(BOOT_RTJAR)
ohair@425 1294 AC_SUBST(BOOT_TOOLSJAR)
ohair@425 1295 AC_MSG_CHECKING([for Boot JDK])
ohair@425 1296 AC_MSG_RESULT([$BOOT_JDK])
ohair@425 1297 AC_MSG_CHECKING([for Boot rt.jar])
ohair@425 1298 AC_MSG_RESULT([$BOOT_RTJAR])
ohair@425 1299 AC_MSG_CHECKING([for Boot tools.jar])
ohair@425 1300 AC_MSG_RESULT([$BOOT_TOOLSJAR])
ohair@425 1301
ohair@425 1302 # Use the java tool from the Boot JDK.
ohair@425 1303 AC_MSG_CHECKING([for java in Boot JDK])
ohair@425 1304 JAVA=$BOOT_JDK/bin/java
ohair@425 1305 if test ! -x $JAVA; then
ohair@425 1306 AC_ERROR([Could not find a working java])
ohair@425 1307 fi
ohair@425 1308 BOOT_JDK_VERSION=`$JAVA -version 2>&1 | head -n 1`
ohair@425 1309 AC_MSG_RESULT([yes $BOOT_JDK_VERSION])
ohair@425 1310 AC_SUBST(JAVA)
ohair@425 1311
ohair@425 1312 # Extra M4 quote needed to protect [] in grep expression.
ohair@425 1313 [FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'`]
ohair@425 1314 if test "x$FOUND_VERSION_78" = x; then
ohair@425 1315 help_on_build_dependency openjdk
ohair@425 1316 AC_ERROR([Your bootjdk must be version 7 or 8. $HELP_MSG])
ohair@425 1317 fi
ohair@425 1318
ohair@425 1319 # When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
ohair@425 1320 BOOT_JDK_SOURCETARGET="-source 7 -target 7"
ohair@425 1321 AC_SUBST(BOOT_JDK_SOURCETARGET)
ohair@425 1322
ohair@425 1323 # Use the javac tool from the Boot JDK.
ohair@425 1324 AC_MSG_CHECKING([for javac in Boot JDK])
ohair@425 1325 JAVAC=$BOOT_JDK/bin/javac
ohair@425 1326 if test ! -x $JAVAC; then
ohair@425 1327 AC_ERROR([Could not find a working javac])
ohair@425 1328 fi
ohair@425 1329 AC_MSG_RESULT(yes)
ohair@425 1330 AC_SUBST(JAVAC)
ohair@425 1331 AC_SUBST(JAVAC_FLAGS)
ohair@425 1332
ohair@425 1333 # Use the javac tool from the Boot JDK.
ohair@425 1334 AC_MSG_CHECKING([for javah in Boot JDK])
ohair@425 1335 JAVAH=$BOOT_JDK/bin/javah
ohair@425 1336 if test ! -x $JAVAH; then
ohair@425 1337 AC_ERROR([Could not find a working javah])
ohair@425 1338 fi
ohair@425 1339 AC_MSG_RESULT(yes)
ohair@425 1340 AC_SUBST(JAVAH)
ohair@425 1341
ohair@425 1342 # Use the jar tool from the Boot JDK.
ohair@425 1343 AC_MSG_CHECKING([for jar in Boot JDK])
ohair@425 1344 JAR=$BOOT_JDK/bin/jar
ohair@425 1345 if test ! -x $JAR; then
ohair@425 1346 AC_ERROR([Could not find a working jar])
ohair@425 1347 fi
ohair@425 1348 AC_SUBST(JAR)
ohair@425 1349 AC_MSG_RESULT(yes)
ohair@425 1350
ohair@425 1351 # Use the rmic tool from the Boot JDK.
ohair@425 1352 AC_MSG_CHECKING([for rmic in Boot JDK])
ohair@425 1353 RMIC=$BOOT_JDK/bin/rmic
ohair@425 1354 if test ! -x $RMIC; then
ohair@425 1355 AC_ERROR([Could not find a working rmic])
ohair@425 1356 fi
ohair@425 1357 AC_SUBST(RMIC)
ohair@425 1358 AC_MSG_RESULT(yes)
ohair@425 1359
ohair@425 1360 ###############################################################################
ohair@425 1361 #
ohair@425 1362 # Pickup additional source for a component from outside of the source root
ohair@425 1363 # or override source for a component.
ohair@425 1364 #
ohair@425 1365 AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root],
ohair@425 1366 [for each and every source directory, look in this additional source root for
ohair@425 1367 the same directory; if it exists and have files in it, include it in the build])])
ohair@425 1368
ohair@425 1369 AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root],
ohair@425 1370 [for each and every source directory, look in this override source root for
ohair@425 1371 the same directory; if it exists, use that directory instead and
ohair@425 1372 ignore the directory in the original source root])])
ohair@425 1373
ohair@425 1374 AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides],
ohair@425 1375 [use the subdirs 'adds' and 'overrides' in the specified directory as
ohair@425 1376 add-source-root and override-source-root])])
ohair@425 1377
ohair@425 1378 if test "x$with_adds_and_overrides" != x; then
ohair@425 1379 with_add_source_root="$with_adds_and_overrides/adds"
ohair@425 1380 with_override_source_root="$with_adds_and_overrides/overrides"
ohair@425 1381 fi
ohair@425 1382
ohair@425 1383 if test "x$with_add_source_root" != x; then
ohair@425 1384 if ! test -d $with_add_source_root; then
ohair@425 1385 AC_ERROR([Trying to use a non-existant add-source-root $with_add_source_root])
ohair@425 1386 fi
ohair@425 1387 CURDIR="$PWD"
ohair@425 1388 cd "$with_add_source_root"
ohair@425 1389 ADD_SRC_ROOT="`pwd`"
ohair@425 1390 cd "$CURDIR"
ohair@425 1391 # Verify that the addon source root does not have any root makefiles.
ohair@425 1392 # If it does, then it is usually an error, prevent this.
ohair@425 1393 if test -f $with_add_source_root/langtools/makefiles/Makefile || \
ohair@425 1394 test -f $with_add_source_root/langtools/make/Makefile; then
ohair@425 1395 AC_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.])
ohair@425 1396 fi
ohair@425 1397 if test -f $with_add_source_root/corba/makefiles/Makefile || \
ohair@425 1398 test -f $with_add_source_root/corba/make/Makefile; then
ohair@425 1399 AC_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.])
ohair@425 1400 fi
ohair@425 1401 if test -f $with_add_source_root/jaxp/makefiles/Makefile || \
ohair@425 1402 test -f $with_add_source_root/jaxp/make/Makefile; then
ohair@425 1403 AC_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.])
ohair@425 1404 fi
ohair@425 1405 if test -f $with_add_source_root/jaxws/makefiles/Makefile || \
ohair@425 1406 test -f $with_add_source_root/jaxws/make/Makefile; then
ohair@425 1407 AC_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.])
ohair@425 1408 fi
ohair@425 1409 if test -f $with_add_source_root/hotspot/makefiles/Makefile || \
ohair@425 1410 test -f $with_add_source_root/hotspot/make/Makefile; then
ohair@425 1411 AC_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.])
ohair@425 1412 fi
ohair@425 1413 if test -f $with_add_source_root/jdk/makefiles/Makefile || \
ohair@425 1414 test -f $with_add_source_root/jdk/make/Makefile; then
ohair@425 1415 AC_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.])
ohair@425 1416 fi
ohair@425 1417 fi
ohair@425 1418 AC_SUBST(ADD_SRC_ROOT)
ohair@425 1419
ohair@425 1420 if test "x$with_override_source_root" != x; then
ohair@425 1421 if ! test -d $with_override_source_root; then
ohair@425 1422 AC_ERROR([Trying to use a non-existant override-source-root $with_override_source_root])
ohair@425 1423 fi
ohair@425 1424 CURDIR="$PWD"
ohair@425 1425 cd "$with_override_source_root"
ohair@425 1426 OVERRIDE_SRC_ROOT="`pwd`"
ohair@425 1427 cd "$CURDIR"
ohair@425 1428 if test -f $with_override_source_root/langtools/makefiles/Makefile || \
ohair@425 1429 test -f $with_override_source_root/langtools/make/Makefile; then
ohair@425 1430 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 1431 fi
ohair@425 1432 if test -f $with_override_source_root/corba/makefiles/Makefile || \
ohair@425 1433 test -f $with_override_source_root/corba/make/Makefile; then
ohair@425 1434 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 1435 fi
ohair@425 1436 if test -f $with_override_source_root/jaxp/makefiles/Makefile || \
ohair@425 1437 test -f $with_override_source_root/jaxp/make/Makefile; then
ohair@425 1438 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 1439 fi
ohair@425 1440 if test -f $with_override_source_root/jaxws/makefiles/Makefile || \
ohair@425 1441 test -f $with_override_source_root/jaxws/make/Makefile; then
ohair@425 1442 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 1443 fi
ohair@425 1444 if test -f $with_override_source_root/hotspot/makefiles/Makefile || \
ohair@425 1445 test -f $with_override_source_root/hotspot/make/Makefile; then
ohair@425 1446 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 1447 fi
ohair@425 1448 if test -f $with_override_source_root/jdk/makefiles/Makefile || \
ohair@425 1449 test -f $with_override_source_root/jdk/make/Makefile; then
ohair@425 1450 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 1451 fi
ohair@425 1452 fi
ohair@425 1453 AC_SUBST(OVERRIDE_SRC_ROOT)
ohair@425 1454
ohair@425 1455 ###############################################################################
ohair@425 1456 #
ohair@425 1457 # Override a repo completely, this is used for example when you have 3 small
ohair@425 1458 # development sandboxes of the langtools sources and want to avoid having 3 full
ohair@425 1459 # OpenJDK sources checked out on disk.
ohair@425 1460 #
ohair@425 1461 # Assuming that the 3 langtools sandboxes are located here:
ohair@425 1462 # /home/fredrik/sandbox1/langtools
ohair@425 1463 # /home/fredrik/sandbox2/langtools
ohair@425 1464 # /home/fredrik/sandbox3/langtools
ohair@425 1465 #
ohair@425 1466 # From the source root you create build subdirs manually:
ohair@425 1467 # mkdir -p build1 build2 build3
ohair@425 1468 # in each build directory run:
ohair@425 1469 # (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make)
ohair@425 1470 # (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make)
ohair@425 1471 # (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make)
ohair@425 1472 #
ohair@425 1473
ohair@425 1474 AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools],
ohair@425 1475 [use this langtools dir for the build])])
ohair@425 1476
ohair@425 1477 AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba],
ohair@425 1478 [use this corba dir for the build])])
ohair@425 1479
ohair@425 1480 AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp],
ohair@425 1481 [use this jaxp dir for the build])])
ohair@425 1482
ohair@425 1483 AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws],
ohair@425 1484 [use this jaxws dir for the build])])
ohair@425 1485
ohair@425 1486 AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot],
ohair@425 1487 [use this hotspot dir for the build])])
ohair@425 1488
ohair@425 1489 AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk],
ohair@425 1490 [use this jdk dir for the build])])
ohair@425 1491
ohair@425 1492 if test "x$with_override_langtools" != x; then
ohair@425 1493 CURDIR="$PWD"
ohair@425 1494 cd "$with_override_langtools"
ohair@425 1495 LANGTOOLS_TOPDIR="`pwd`"
ohair@425 1496 cd "$CURDIR"
ohair@425 1497 if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then
ohair@425 1498 AC_ERROR([You have to override langtools with a full langtools repo!])
ohair@425 1499 fi
ohair@425 1500 AC_MSG_CHECKING([if langtools should be overridden])
ohair@425 1501 AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR])
ohair@425 1502 fi
ohair@425 1503 if test "x$with_override_corba" != x; then
ohair@425 1504 CURDIR="$PWD"
ohair@425 1505 cd "$with_override_corba"
ohair@425 1506 CORBA_TOPDIR="`pwd`"
ohair@425 1507 cd "$CURDIR"
ohair@425 1508 if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then
ohair@425 1509 AC_ERROR([You have to override corba with a full corba repo!])
ohair@425 1510 fi
ohair@425 1511 AC_MSG_CHECKING([if corba should be overridden])
ohair@425 1512 AC_MSG_RESULT([yes with $CORBA_TOPDIR])
ohair@425 1513 fi
ohair@425 1514 if test "x$with_override_jaxp" != x; then
ohair@425 1515 CURDIR="$PWD"
ohair@425 1516 cd "$with_override_jaxp"
ohair@425 1517 JAXP_TOPDIR="`pwd`"
ohair@425 1518 cd "$CURDIR"
ohair@425 1519 if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then
ohair@425 1520 AC_ERROR([You have to override jaxp with a full jaxp repo!])
ohair@425 1521 fi
ohair@425 1522 AC_MSG_CHECKING([if jaxp should be overridden])
ohair@425 1523 AC_MSG_RESULT([yes with $JAXP_TOPDIR])
ohair@425 1524 fi
ohair@425 1525 if test "x$with_override_jaxws" != x; then
ohair@425 1526 CURDIR="$PWD"
ohair@425 1527 cd "$with_override_jaxws"
ohair@425 1528 JAXWS_TOPDIR="`pwd`"
ohair@425 1529 cd "$CURDIR"
ohair@425 1530 if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then
ohair@425 1531 AC_ERROR([You have to override jaxws with a full jaxws repo!])
ohair@425 1532 fi
ohair@425 1533 AC_MSG_CHECKING([if jaxws should be overridden])
ohair@425 1534 AC_MSG_RESULT([yes with $JAXWS_TOPDIR])
ohair@425 1535 fi
ohair@425 1536 if test "x$with_override_hotspot" != x; then
ohair@425 1537 CURDIR="$PWD"
ohair@425 1538 cd "$with_override_hotspot"
ohair@425 1539 HOTSPOT_TOPDIR="`pwd`"
ohair@425 1540 cd "$CURDIR"
ohair@425 1541 if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \
ohair@425 1542 ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then
ohair@425 1543 AC_ERROR([You have to override hotspot with a full hotspot repo!])
ohair@425 1544 fi
ohair@425 1545 AC_MSG_CHECKING([if hotspot should be overridden])
ohair@425 1546 AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
ohair@425 1547 fi
ohair@425 1548 if test "x$with_override_jdk" != x; then
ohair@425 1549 CURDIR="$PWD"
ohair@425 1550 cd "$with_override_jdk"
ohair@425 1551 JDK_TOPDIR="`pwd`"
ohair@425 1552 cd "$CURDIR"
ohair@425 1553 if ! test -f $JDK_TOPDIR/makefiles/Makefile; then
ohair@425 1554 AC_ERROR([You have to override JDK with a full JDK repo!])
ohair@425 1555 fi
ohair@425 1556 AC_MSG_CHECKING([if JDK should be overridden])
ohair@425 1557 AC_MSG_RESULT([yes with $JDK_TOPDIR])
ohair@425 1558 fi
ohair@425 1559
ohair@425 1560 ###############################################################################
ohair@425 1561 #
ohair@425 1562 # Specify options for anything that is run with the Boot JDK.
ohair@425 1563 #
ohair@425 1564 AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs],
ohair@425 1565 [specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values,
ohair@425 1566 e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])])
ohair@425 1567
ohair@425 1568 if test "x$with_boot_jdk_jvmargs" = x; then
ohair@425 1569 # Not all JVM:s accept the same arguments on the command line.
ohair@425 1570 # OpenJDK specific increase in thread stack for JDK build,
ohair@425 1571 # well more specifically, when running javac.
ohair@425 1572 if test "x$BUILD_NUM_BITS" = x32; then
ohair@425 1573 STACK_SIZE=768
ohair@425 1574 else
ohair@425 1575 # Running Javac on a JVM on a 64-bit machine, the stack takes more space
ohair@425 1576 # since 64-bit pointers are pushed on the stach. Apparently, we need
ohair@425 1577 # to increase the stack space when javacing the JDK....
ohair@425 1578 STACK_SIZE=1536
ohair@425 1579 fi
ohair@425 1580
ohair@425 1581 # Minimum amount of heap memory.
ohair@425 1582 ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
ohair@425 1583 if test "x$HOST_OS" = "xmacosx"; then
ohair@425 1584 # Why does macosx need more heap? Its the huge JDK batch.
ohair@425 1585 ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
ohair@425 1586 else
ohair@425 1587 ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
ohair@425 1588 fi
ohair@425 1589 # When is adding -client something that speeds up the JVM?
ohair@425 1590 # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])
ohair@425 1591 ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],boot_jdk_jvmargs,[$JAVA])
ohair@425 1592 ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],boot_jdk_jvmargs,[$JAVA])
ohair@425 1593 ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA])
ohair@425 1594 # Disable special log output when a debug build is used as Boot JDK...
ohair@425 1595 ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA])
ohair@425 1596 fi
ohair@425 1597
ohair@425 1598 AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs)
ohair@425 1599
ohair@425 1600 AC_ARG_WITH(server-java, [AS_HELP_STRING([--with-server-java],
ohair@425 1601 [use this java binary for running the javac background server and other long running java tasks in the build process,
ohair@425 1602 e.g. ---with-server-java="/opt/jrockit/bin/java -server"])])
ohair@425 1603
ohair@425 1604 if test "x$with_server_java" != x; then
ohair@425 1605 SERVER_JAVA="$with_server_java"
ohair@425 1606 FOUND_VERSION=`$SERVER_JAVA -version 2>&1 | grep " version \""`
ohair@425 1607 if test "x$FOUND_VERSION" = x; then
ohair@425 1608 AC_ERROR([Could not execute server java: $SERVER_JAVA])
ohair@425 1609 fi
ohair@425 1610 else
ohair@425 1611 SERVER_JAVA=""
ohair@425 1612 # Hotspot specific options.
ohair@425 1613 ADD_JVM_ARG_IF_OK([-XX:+UseParallelOldGC],SERVER_JAVA,[$JAVA])
ohair@425 1614 ADD_JVM_ARG_IF_OK([-verbosegc],SERVER_JAVA,[$JAVA])
ohair@425 1615 # JRockit specific options.
ohair@425 1616 ADD_JVM_ARG_IF_OK([-Xverbose:gc],SERVER_JAVA,[$JAVA])
ohair@425 1617 SERVER_JAVA="$JAVA $SERVER_JAVA"
ohair@425 1618 fi
ohair@425 1619 AC_SUBST(SERVER_JAVA)
ohair@425 1620
ohair@425 1621 AC_MSG_CHECKING([whether to use shared server for javac])
ohair@425 1622 AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server],
ohair@425 1623 [enable the shared javac server during the build process @<:@disabled@:>@])],
ohair@425 1624 [ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER='no'])
ohair@425 1625 AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
ohair@425 1626 if test "x$ENABLE_JAVAC_SERVER" = xyes; then
ohair@425 1627 JAVAC_USE_REMOTE=true
ohair@425 1628 JAVAC_SERVERS="$OUTPUT_ROOT/javacservers"
ohair@425 1629 else
ohair@425 1630 JAVAC_USE_REMOTE=false
ohair@425 1631 JAVAC_SERVERS=
ohair@425 1632 fi
ohair@425 1633 AC_SUBST(JAVAC_USE_REMOTE)
ohair@425 1634 AC_SUBST(JAVAC_SERVERS)
ohair@425 1635
ohair@425 1636 AC_ARG_WITH(javac-server-cores, [AS_HELP_STRING([--with-javac-server-cores],
ohair@425 1637 [use at most this number of concurrent threads on the javac server @<:@probed@:>@])])
ohair@425 1638 if test "x$with_javac_server_cores" != x; then
ohair@425 1639 JAVAC_SERVER_CORES="$with_javac_server_cores"
ohair@425 1640 else
ohair@425 1641 if test "$NUM_CORES" -gt 16; then
ohair@425 1642 # We set this arbitrary limit because we want to limit the heap
ohair@425 1643 # size of the javac server.
ohair@425 1644 # In the future we will make the javac compilers in the server
ohair@425 1645 # share more and more state, thus enabling us to use more and
ohair@425 1646 # more concurrent threads in the server.
ohair@425 1647 JAVAC_SERVER_CORES="16"
ohair@425 1648 else
ohair@425 1649 JAVAC_SERVER_CORES="$NUM_CORES"
ohair@425 1650 fi
ohair@425 1651
ohair@425 1652 if test "$MEMORY_SIZE" -gt "17000"; then
ohair@425 1653 MAX_HEAP_MEM=10000
ohair@425 1654 ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1655 ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1656 ADD_JVM_ARG_IF_OK([-Xmn2G],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1657 elif test "$MEMORY_SIZE" -gt "10000"; then
ohair@425 1658 MAX_HEAP_MEM=6000
ohair@425 1659 ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1660 ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1661 ADD_JVM_ARG_IF_OK([-Xmn1G],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1662 elif test "$MEMORY_SIZE" -gt "5000"; then
ohair@425 1663 MAX_HEAP_MEM=3000
ohair@425 1664 ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1665 ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1666 ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1667 elif test "$MEMORY_SIZE" -gt "3800"; then
ohair@425 1668 MAX_HEAP_MEM=2500
ohair@425 1669 ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1670 ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1671 elif test "$MEMORY_SIZE" -gt "1900"; then
ohair@425 1672 MAX_HEAP_MEM=1200
ohair@425 1673 ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1200M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1674 ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1675 elif test "$MEMORY_SIZE" -gt "1000"; then
ohair@425 1676 MAX_HEAP_MEM=900
ohair@425 1677 ADD_JVM_ARG_IF_OK([-Xms400M -Xmx900M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1678 ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1679 else
ohair@425 1680 MAX_HEAP_MEM=512
ohair@425 1681 ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1682 ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
ohair@425 1683 fi
ohair@425 1684
ohair@425 1685 MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501`
ohair@425 1686 if test "$JAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then
ohair@425 1687 AC_MSG_CHECKING([if number of server cores must be reduced])
ohair@425 1688 JAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP"
ohair@425 1689 AC_MSG_RESULT([yes, to $JAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB])
ohair@425 1690 fi
ohair@425 1691 fi
ohair@425 1692 AC_SUBST(JAVAC_SERVER_CORES)
ohair@425 1693
ohair@425 1694 AC_MSG_CHECKING([whether to track dependencies between Java packages])
ohair@425 1695 AC_ARG_ENABLE([javac-deps], [AS_HELP_STRING([--enable-javac-deps],
ohair@425 1696 [enable the dependency tracking between Java packages @<:@disabled@:>@])],
ohair@425 1697 [ENABLE_JAVAC_DEPS="${enableval}"], [ENABLE_JAVAC_DEPS='no'])
ohair@425 1698 AC_MSG_RESULT([$ENABLE_JAVAC_DEPS])
ohair@425 1699 if test "x$ENABLE_JAVAC_DEPS" = xyes; then
ohair@425 1700 JAVAC_USE_DEPS=true
ohair@425 1701 else
ohair@425 1702 JAVAC_USE_DEPS=false
ohair@425 1703 fi
ohair@425 1704 AC_SUBST(JAVAC_USE_DEPS)
ohair@425 1705
ohair@425 1706 AC_MSG_CHECKING([whether to use multiple cores for javac compilation])
ohair@425 1707 AC_ARG_ENABLE([javac-multi-core], [AS_HELP_STRING([--enable-javac-multi-core],
ohair@425 1708 [compile Java packages concurrently @<:@disabled@:>@])],
ohair@425 1709 [ENABLE_JAVAC_MULTICORE="${enableval}"], [ENABLE_JAVAC_MULTICORE='no'])
ohair@425 1710 AC_MSG_RESULT([$ENABLE_JAVAC_MULTICORE])
ohair@425 1711 if test "x$ENABLE_JAVAC_MULTICORE" = xyes; then
ohair@425 1712 JAVAC_USE_MODE=MULTI_CORE_CONCURRENT
ohair@425 1713 else
ohair@425 1714 JAVAC_USE_MODE=SINGLE_THREADED_BATCH
ohair@425 1715 if test "x$ENABLE_JAVAC_DEPS" = xyes; then
ohair@425 1716 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 1717 AC_MSG_WARN([Disabling dependency tracking for you now.])
ohair@425 1718 JAVAC_USE_DEPS=false
ohair@425 1719 fi
ohair@425 1720 if test "x$ENABLE_JAVAC_SERVER" = xyes; then
ohair@425 1721 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 1722 AC_MSG_WARN([Disabling javac server for you now.])
ohair@425 1723 JAVAC_USE_REMOTE=false
ohair@425 1724 fi
ohair@425 1725 fi
ohair@425 1726 AC_SUBST(JAVAC_USE_MODE)
ohair@425 1727
ohair@425 1728 ###############################################################################
ohair@425 1729 #
ohair@425 1730 # OS specific settings that we never will need to probe.
ohair@425 1731 #
ohair@425 1732 if test "x$HOST_OS" = xlinux; then
ohair@425 1733 AC_MSG_CHECKING([what is not needed on Linux?])
ohair@425 1734 PULSE_NOT_NEEDED=yes
ohair@425 1735 AC_MSG_RESULT([pulse])
ohair@425 1736 fi
ohair@425 1737
ohair@425 1738 if test "x$HOST_OS" = xsolaris; then
ohair@425 1739 AC_MSG_CHECKING([what is not needed on Solaris?])
ohair@425 1740 ALSA_NOT_NEEDED=yes
ohair@425 1741 PULSE_NOT_NEEDED=yes
ohair@425 1742 AC_MSG_RESULT([alsa pulse])
ohair@425 1743 fi
ohair@425 1744
ohair@425 1745 if test "x$HOST_OS" = xwindows; then
ohair@425 1746 AC_MSG_CHECKING([what is not needed on Windows?])
ohair@425 1747 CUPS_NOT_NEEDED=yes
ohair@425 1748 ALSA_NOT_NEEDED=yes
ohair@425 1749 PULSE_NOT_NEEDED=yes
ohair@425 1750 X11_NOT_NEEDED=yes
ohair@425 1751 AC_MSG_RESULT([alsa cups pulse x11])
ohair@425 1752 fi
ohair@425 1753
ohair@425 1754 if test "x$HOST_OS" = xmacosx; then
ohair@425 1755 AC_MSG_CHECKING([what is not needed on MacOSX?])
ohair@425 1756 ALSA_NOT_NEEDED=yes
ohair@425 1757 PULSE_NOT_NEEDED=yes
ohair@425 1758 X11_NOT_NEEDED=yes
ohair@425 1759 FREETYPE2_NOT_NEEDED=yes
ohair@425 1760 # If the java runtime framework is disabled, then we need X11.
ohair@425 1761 # This will be adjusted below.
ohair@425 1762 AC_MSG_RESULT([alsa pulse x11])
ohair@425 1763 fi
ohair@425 1764
ohair@425 1765 if test "x$HOST_OS" = xbsd; then
ohair@425 1766 AC_MSG_CHECKING([what is not needed on bsd?])
ohair@425 1767 ALSA_NOT_NEEDED=yes
ohair@425 1768 AC_MSG_RESULT([alsa])
ohair@425 1769 fi
ohair@425 1770
ohair@425 1771 ###############################################################################
ohair@425 1772 #
ohair@425 1773 # Check for MacOSX support for OpenJDK. If this exists, try to build a JVM
ohair@425 1774 # that uses this API.
ohair@425 1775 #
ohair@425 1776 AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support],
ohair@425 1777 [disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])],
ohair@425 1778 [MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"])
ohair@425 1779
ohair@425 1780 USE_MACOSX_RUNTIME_SUPPORT=no
ohair@425 1781 AC_MSG_CHECKING([for explicit Java runtime support in the OS])
ohair@425 1782 if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
ohair@425 1783 if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then
ohair@425 1784 MACOSX_RUNTIME_SUPPORT=yes
ohair@425 1785 USE_MACOSX_RUNTIME_SUPPORT=yes
ohair@425 1786 AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11])
ohair@425 1787 else
ohair@425 1788 AC_MSG_RESULT([yes, but explicitly disabled.])
ohair@425 1789 fi
ohair@425 1790 else
ohair@425 1791 AC_MSG_RESULT([no])
ohair@425 1792 fi
ohair@425 1793
ohair@425 1794 if test "x$HOST_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then
ohair@425 1795 AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?])
ohair@425 1796 X11_NOT_NEEDED=
ohair@425 1797 FREETYPE2_NOT_NEEDED=
ohair@425 1798 AC_MSG_RESULT([alsa pulse])
ohair@425 1799 fi
ohair@425 1800
ohair@425 1801 ###############################################################################
ohair@425 1802 #
ohair@425 1803 # Check for X Windows
ohair@425 1804 #
ohair@425 1805 AC_PATH_XTRA
ohair@425 1806
ohair@425 1807 if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then
ohair@425 1808 help_on_build_dependency x11
ohair@425 1809 AC_ERROR([Could not find X11 libraries. $HELP_MSG])
ohair@425 1810 fi
ohair@425 1811
ohair@425 1812 AC_SUBST(X_CFLAGS)
ohair@425 1813 AC_SUBST(X_LIBS)
ohair@425 1814
ohair@425 1815 # Some of the old makefiles require a setting of OPENWIN_HOME
ohair@425 1816 # Since the X11R6 directory has disappeared on later Linuxes,
ohair@425 1817 # we need to probe for it.
ohair@425 1818 if test "x$HOST_OS" = xlinux; then
ohair@425 1819 if test -d "$SYS_ROOT/usr/X11R6"; then
ohair@425 1820 OPENWIN_HOME="$SYS_ROOT/usr/X11R6"
ohair@425 1821 fi
ohair@425 1822 if test -d "$SYS_ROOT/usr/include/X11"; then
ohair@425 1823 OPENWIN_HOME="$SYS_ROOT/usr"
ohair@425 1824 fi
ohair@425 1825 fi
ohair@425 1826 if test "x$HOST_OS" = xsolaris; then
ohair@425 1827 OPENWIN_HOME="/usr/openwin"
ohair@425 1828 fi
ohair@425 1829 AC_SUBST(OPENWIN_HOME)
ohair@425 1830
ohair@425 1831 AC_LANG_PUSH(C)
ohair@425 1832 OLD_CFLAGS="$CFLAGS"
ohair@425 1833 CFLAGS="$CFLAGS $X_CFLAGS"
ohair@425 1834 AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h],
ohair@425 1835 [X11_A_OK=yes],
ohair@425 1836 [X11_A_OK=no])
ohair@425 1837 CFLAGS="$OLD_CFLAGS"
ohair@425 1838 AC_LANG_POP(C)
ohair@425 1839
ohair@425 1840 if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then
ohair@425 1841 help_on_build_dependency x11
ohair@425 1842 AC_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG])
ohair@425 1843 fi
ohair@425 1844
ohair@425 1845 ###############################################################################
ohair@425 1846 #
ohair@425 1847 # The common unix printing system cups is used to print from java.
ohair@425 1848 #
ohair@425 1849 AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups],
ohair@425 1850 [specify prefix directory for the cups package
ohair@425 1851 (expecting the libraries under PATH/lib and the headers under PATH/include)])])
ohair@425 1852 AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
ohair@425 1853 [specify directory for the cups include files])])
ohair@425 1854 AC_ARG_WITH(cups-lib, [AS_HELP_STRING([--with-cups-lib],
ohair@425 1855 [specify directory for the cups library])])
ohair@425 1856
ohair@425 1857 if test "x$CUPS_NOT_NEEDED" = xyes; then
ohair@425 1858 if test "x$with_cups" != x || test "x$with_cups-include" != x || test "x$with_cups-lib" != x; then
ohair@425 1859 AC_MSG_WARN([cups not used, so --with-cups is ignored])
ohair@425 1860 fi
ohair@425 1861 CUPS_CFLAGS=
ohair@425 1862 CUPS_LIBS=
ohair@425 1863 else
ohair@425 1864 CUPS_FOUND=no
ohair@425 1865
ohair@425 1866 if test "x$with_cups" = xno || test "x$with_cups-include" = xno || test "x$with_cups-lib" = xno; then
ohair@425 1867 AC_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
ohair@425 1868 fi
ohair@425 1869
ohair@425 1870 if test "x$with_cups" != x; then
ohair@425 1871 CUPS_LIBS="-L$with_cups/lib -lcups"
ohair@425 1872 CUPS_CFLAGS="-I$with_cups/include"
ohair@425 1873 CUPS_FOUND=yes
ohair@425 1874 fi
ohair@425 1875 if test "x$with_cups-include" != x; then
ohair@425 1876 CUPS_CFLAGS="-I$with_cups-include"
ohair@425 1877 CUPS_FOUND=yes
ohair@425 1878 fi
ohair@425 1879 if test "x$with_cups-lib" != x; then
ohair@425 1880 CUPS_LIBS="-L$with_cups-lib -lcups"
ohair@425 1881 CUPS_FOUND=yes
ohair@425 1882 fi
ohair@425 1883 if test "x$CUPS_FOUND" = xno; then
ohair@425 1884 BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes])
ohair@425 1885 fi
ohair@425 1886 if test "x$CUPS_FOUND" = xno; then
ohair@425 1887 # Are the cups headers installed in the default /usr/include location?
ohair@425 1888 AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
ohair@425 1889 [CUPS_FOUND=yes
ohair@425 1890 CUPS_CFLAGS=
ohair@425 1891 CUPS_LIBS="-lcups"
ohair@425 1892 DEFAULT_CUPS=yes])
ohair@425 1893 fi
ohair@425 1894 if test "x$CUPS_FOUND" = xno; then
ohair@425 1895 # Getting nervous now? Lets poke around for standard Solaris third-party
ohair@425 1896 # package installation locations.
ohair@425 1897 AC_MSG_CHECKING([for cups headers and libs])
ohair@425 1898 if test -s /opt/sfw/cups/include/cups/cups.h; then
ohair@425 1899 # An SFW package seems to be installed!
ohair@425 1900 CUPS_FOUND=yes
ohair@425 1901 CUPS_CFLAGS="-I/opt/sfw/cups/include"
ohair@425 1902 CUPS_LIBS="-L/opt/sfw/cups/lib -lcups"
ohair@425 1903 elif test -s /opt/csw/include/cups/cups.h; then
ohair@425 1904 # A CSW package seems to be installed!
ohair@425 1905 CUPS_FOUND=yes
ohair@425 1906 CUPS_CFLAGS="-I/opt/csw/include"
ohair@425 1907 CUPS_LIBS="-L/opt/csw/lib -lcups"
ohair@425 1908 fi
ohair@425 1909 AC_MSG_RESULT([$CUPS_FOUND])
ohair@425 1910 fi
ohair@425 1911 if test "x$CUPS_FOUND" = xno; then
ohair@425 1912 help_on_build_dependency cups
ohair@425 1913 AC_ERROR([Could not find cups! $HELP_MSG ])
ohair@425 1914 fi
ohair@425 1915 fi
ohair@425 1916
ohair@425 1917 AC_SUBST(CUPS_CFLAGS)
ohair@425 1918 AC_SUBST(CUPS_LIBS)
ohair@425 1919
ohair@425 1920 ###############################################################################
ohair@425 1921 #
ohair@425 1922 # The ubiquitous freetype2 library is used to render fonts.
ohair@425 1923 #
ohair@425 1924 AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
ohair@425 1925 [specify prefix directory for the freetype2 package
ohair@425 1926 (expecting the libraries under PATH/lib and the headers under PATH/include)])])
ohair@425 1927
ohair@425 1928 # 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 1929 USING_SYSTEM_FT_LIB=false
ohair@425 1930
ohair@425 1931 if test "x$FREETYPE2_NOT_NEEDED" = xyes; then
ohair@425 1932 if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
ohair@425 1933 AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
ohair@425 1934 fi
ohair@425 1935 FREETYPE2_CFLAGS=
ohair@425 1936 FREETYPE2_LIBS=
ohair@425 1937 FREETYPE2_LIB_PATH=
ohair@425 1938 else
ohair@425 1939 FREETYPE2_FOUND=no
ohair@425 1940
ohair@425 1941 if test "x$with_freetype" != x; then
ohair@425 1942 SPACESAFE(with_freetype,[the path to freetype])
ohair@425 1943 FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype"
ohair@425 1944 if test "x$HOST_OS" = xwindows; then
ohair@425 1945 FREETYPE2_LIBS="$with_freetype/lib/freetype.lib"
ohair@425 1946 fi
ohair@425 1947 FREETYPE2_LIB_PATH="$with_freetype/lib"
ohair@425 1948 FREETYPE2_CFLAGS="-I$with_freetype/include"
ohair@425 1949 if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then
ohair@425 1950 FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include"
ohair@425 1951 fi
ohair@425 1952 FREETYPE2_FOUND=yes
ohair@425 1953 if test "x$FREETYPE2_FOUND" = xyes; then
ohair@425 1954 # Verify that the directories exist
ohair@425 1955 if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then
ohair@425 1956 AC_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include])
ohair@425 1957 fi
ohair@425 1958 # List the contents of the lib.
ohair@425 1959 FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null`
ohair@425 1960 if test "x$FREETYPELIB" = x; then
ohair@425 1961 AC_ERROR([Could not find libfreetype.se nor freetype.dll in $with_freetype/lib])
ohair@425 1962 fi
ohair@425 1963 # Check one h-file
ohair@425 1964 if ! test -s "$with_freetype/include/ft2build.h"; then
ohair@425 1965 AC_ERROR([Could not find $with_freetype/include/ft2build.h])
ohair@425 1966 fi
ohair@425 1967 fi
ohair@425 1968 fi
ohair@425 1969 if test "x$FREETYPE2_FOUND" = xno; then
ohair@425 1970 BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
ohair@425 1971 USING_SYSTEM_FT_LIB=true
ohair@425 1972 fi
ohair@425 1973 if test "x$FREETYPE2_FOUND" = xno; then
ohair@425 1974 PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
ohair@425 1975 USING_SYSTEM_FT_LIB=true
ohair@425 1976 fi
ohair@425 1977 if test "x$FREETYPE2_FOUND" = xno; then
ohair@425 1978 AC_MSG_CHECKING([for freetype in some standard locations])
ohair@425 1979
ohair@425 1980 if test -s /usr/X11/include/ft2build.h && test -d /usr/X11/include/freetype2/freetype; then
ohair@425 1981 DEFAULT_FREETYPE_CFLAGS="-I/usr/X11/include/freetype2 -I/usr/X11/include"
ohair@425 1982 DEFAULT_FREETYPE_LIBS="-L/usr/X11/lib -lfreetype"
ohair@425 1983 fi
ohair@425 1984 if test -s /usr/include/ft2build.h && test -d /usr/include/freetype2/freetype; then
ohair@425 1985 DEFAULT_FREETYPE_CFLAGS="-I/usr/include/freetype2"
ohair@425 1986 DEFAULT_FREETYPE_LIBS="-lfreetype"
ohair@425 1987 fi
ohair@425 1988
ohair@425 1989 PREV_CXXCFLAGS="$CXXFLAGS"
ohair@425 1990 PREV_LDFLAGS="$LDFLAGS"
ohair@425 1991 CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS"
ohair@425 1992 LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS"
ohair@425 1993 AC_LINK_IFELSE([AC_LANG_SOURCE([[#include<ft2build.h>
ohair@425 1994 #include FT_FREETYPE_H
ohair@425 1995 int main() { return 0; }
ohair@425 1996 ]])],
ohair@425 1997 [
ohair@425 1998 # Yes, the default cflags and libs did the trick.
ohair@425 1999 FREETYPE2_FOUND=yes
ohair@425 2000 FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS"
ohair@425 2001 FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS"
ohair@425 2002 ],
ohair@425 2003 [
ohair@425 2004 FREETYPE2_FOUND=no
ohair@425 2005 ])
ohair@425 2006 CXXCFLAGS="$PREV_CXXFLAGS"
ohair@425 2007 LDFLAGS="$PREV_LDFLAGS"
ohair@425 2008 AC_MSG_RESULT([$FREETYPE2_FOUND])
ohair@425 2009 USING_SYSTEM_FT_LIB=true
ohair@425 2010 fi
ohair@425 2011 if test "x$FREETYPE2_FOUND" = xno; then
ohair@425 2012 help_on_build_dependency freetype2
ohair@425 2013 AC_ERROR([Could not find freetype2! $HELP_MSG ])
ohair@425 2014 fi
ohair@425 2015 fi
ohair@425 2016
ohair@425 2017 AC_SUBST(USING_SYSTEM_FT_LIB)
ohair@425 2018 AC_SUBST(FREETYPE2_LIB_PATH)
ohair@425 2019 AC_SUBST(FREETYPE2_CFLAGS)
ohair@425 2020 AC_SUBST(FREETYPE2_LIBS)
ohair@425 2021
ohair@425 2022 ###############################################################################
ohair@425 2023 #
ohair@425 2024 # Check for alsa headers and libraries. Used on Linux/GNU systems.
ohair@425 2025 #
ohair@425 2026 AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],
ohair@425 2027 [specify prefix directory for the alsa package
ohair@425 2028 (expecting the libraries under PATH/lib and the headers under PATH/include)])])
ohair@425 2029 AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include],
ohair@425 2030 [specify directory for the alsa include files])])
ohair@425 2031 AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib],
ohair@425 2032 [specify directory for the alsa library])])
ohair@425 2033
ohair@425 2034 if test "x$ALSA_NOT_NEEDED" = xyes; then
ohair@425 2035 if test "x$with_alsa" != x || test "x$with_alsa-include" != x || test "x$with_alsa-lib" != x; then
ohair@425 2036 AC_MSG_WARN([alsa not used, so --with-alsa is ignored])
ohair@425 2037 fi
ohair@425 2038 ALSA_CFLAGS=
ohair@425 2039 ALSA_LIBS=
ohair@425 2040 else
ohair@425 2041 ALSA_FOUND=no
ohair@425 2042
ohair@425 2043 if test "x$with_alsa" = xno || test "x$with_alsa-include" = xno || test "x$with_alsa-lib" = xno; then
ohair@425 2044 AC_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
ohair@425 2045 fi
ohair@425 2046
ohair@425 2047 if test "x$with_alsa" != x; then
ohair@425 2048 ALSA_LIBS="-L$with_alsa/lib -lalsa"
ohair@425 2049 ALSA_CFLAGS="-I$with_alsa/include"
ohair@425 2050 ALSA_FOUND=yes
ohair@425 2051 fi
ohair@425 2052 if test "x$with_alsa-include" != x; then
ohair@425 2053 ALSA_CFLAGS="-I$with_alsa/include"
ohair@425 2054 ALSA_FOUND=yes
ohair@425 2055 fi
ohair@425 2056 if test "x$with_alsa-lib" != x; then
ohair@425 2057 ALSA_LIBS="-L$with_alsa/lib -lalsa"
ohair@425 2058 ALSA_FOUND=yes
ohair@425 2059 fi
ohair@425 2060 if test "x$ALSA_FOUND" = xno; then
ohair@425 2061 BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no])
ohair@425 2062 fi
ohair@425 2063 if test "x$ALSA_FOUND" = xno; then
ohair@425 2064 PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
ohair@425 2065 fi
ohair@425 2066 if test "x$ALSA_FOUND" = xno; then
ohair@425 2067 AC_CHECK_HEADERS([alsa/asoundlib.h],
ohair@425 2068 [ALSA_FOUND=yes
ohair@425 2069 ALSA_CFLAGS=-Iignoreme
ohair@425 2070 ALSA_LIBS=-lasound
ohair@425 2071 DEFAULT_ALSA=yes],
ohair@425 2072 [ALSA_FOUND=no])
ohair@425 2073 fi
ohair@425 2074 if test "x$ALSA_FOUND" = xno; then
ohair@425 2075 help_on_build_dependency alsa
ohair@425 2076 AC_ERROR([Could not find alsa! $HELP_MSG ])
ohair@425 2077 fi
ohair@425 2078 fi
ohair@425 2079
ohair@425 2080 AC_SUBST(ALSA_CFLAGS)
ohair@425 2081 AC_SUBST(ALSA_LIBS)
ohair@425 2082
ohair@425 2083 ###############################################################################
ohair@425 2084 #
ohair@425 2085 # Check for pulse audio headers and libraries.
ohair@425 2086 #
ohair@425 2087 PULSE_FOUND=no
ohair@425 2088 AC_ARG_WITH(pulse, [AS_HELP_STRING([--with-pulse],
ohair@425 2089 [specify prefix directory for the pulseaudio package
ohair@425 2090 (expecting the libraries under PATH/lib and the headers under PATH/include)])])
ohair@425 2091 AC_ARG_WITH(pulse-include, [AS_HELP_STRING([--with-pulse-include],
ohair@425 2092 [specify directory for the pulseaudio include files])])
ohair@425 2093 AC_ARG_WITH(pulse-lib, [AS_HELP_STRING([--with-pulse-lib],
ohair@425 2094 [specify directory for the pulseaudio library])])
ohair@425 2095
ohair@425 2096 if test "x$with_pulse" != x; then
ohair@425 2097 PULSE_LIBS="-L$with_pulse/lib -lfreetype"
ohair@425 2098 PULSE_CFLAGS="-I$with_pulse/include"
ohair@425 2099 PULSE_FOUND=yes
ohair@425 2100 fi
ohair@425 2101 if test "x$with_pulse-include" != x; then
ohair@425 2102 PULSE_CFLAGS="-I$with_pulse/include"
ohair@425 2103 PULSE_FOUND=yes
ohair@425 2104 fi
ohair@425 2105 if test "x$with_pulse-lib" != x; then
ohair@425 2106 PULSE_LIBS="-L$with_pulse/lib -lfreetype"
ohair@425 2107 PULSE_FOUND=yes
ohair@425 2108 fi
ohair@425 2109 if test "x$PULSE_FOUND" = xno; then
ohair@425 2110 BDEPS_CHECK_MODULE(PULSE, pulse, xxx, [PULSE_FOUND=yes], [PULSE_FOUND=no])
ohair@425 2111 fi
ohair@425 2112 if test "x$PULSE_FOUND" = xno; then
ohair@425 2113 PKG_CHECK_MODULES(LIBPULSE,[libpulse >= 0.9.11],[PULSE_FOUND=yes],[PULSE_FOUND=no])
ohair@425 2114 fi
ohair@425 2115 if test "x$PULSE_FOUND" = xno; then
ohair@425 2116 AC_CHECK_HEADERS([pulse/pulseaudio.h],
ohair@425 2117 [PULSE_FOUND=yes
ohair@425 2118 PULSE_CFLAGS=-Iignoreme
ohair@425 2119 PULSE_LIBS=
ohair@425 2120 DEFAULT_PULSE=yes],
ohair@425 2121 [PULSE_FOUND=no])
ohair@425 2122 fi
ohair@425 2123
ohair@425 2124 if test "x$PULSE_FOUND" = xno && test "x$PULSE_NOT_NEEDED" != xyes; then
ohair@425 2125 help_on_build_dependency pulse
ohair@425 2126 AC_ERROR([Could not find pulse audio libraries. $HELP_MSG ])
ohair@425 2127 fi
ohair@425 2128
ohair@425 2129 AC_SUBST(PULSE_CFLAGS)
ohair@425 2130 AC_SUBST(PULSE_LIBS)
ohair@425 2131
ohair@425 2132 ###############################################################################
ohair@425 2133 #
ohair@425 2134 # Check for the jpeg library
ohair@425 2135 #
ohair@425 2136
ohair@425 2137 USE_EXTERNAL_LIBJPEG=true
ohair@425 2138 AC_CHECK_LIB(jpeg, main, [],
ohair@425 2139 [ USE_EXTERNAL_LIBJPEG=false
ohair@425 2140 AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
ohair@425 2141 ])
ohair@425 2142 AC_SUBST(USE_EXTERNAL_LIBJPEG)
ohair@425 2143
ohair@425 2144 ###############################################################################
ohair@425 2145 #
ohair@425 2146 # Check for the gif library
ohair@425 2147 #
ohair@425 2148
ohair@425 2149 USE_EXTERNAL_LIBJPEG=true
ohair@425 2150 AC_CHECK_LIB(gif, main, [],
ohair@425 2151 [ USE_EXTERNAL_LIBGIF=false
ohair@425 2152 AC_MSG_NOTICE([Will use gif decoder bundled with the OpenJDK source])
ohair@425 2153 ])
ohair@425 2154 AC_SUBST(USE_EXTERNAL_LIBGIF)
ohair@425 2155
ohair@425 2156 ###############################################################################
ohair@425 2157 #
ohair@425 2158 # Check for the zlib library
ohair@425 2159 #
ohair@425 2160
ohair@425 2161 USE_EXTERNAL_LIBZ=true
ohair@425 2162 AC_CHECK_LIB(z, main, [],
ohair@425 2163 [ USE_EXTERNAL_LIBZ=false
ohair@425 2164 AC_MSG_NOTICE([Will use zlib bundled with the OpenJDK source])
ohair@425 2165 ])
ohair@425 2166 AC_SUBST(USE_EXTERNAL_LIBZ)
ohair@425 2167
ohair@425 2168 ###############################################################################
ohair@425 2169 #
ohair@425 2170 # Check if altzone exists in time.h
ohair@425 2171 #
ohair@425 2172
ohair@425 2173 AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
ohair@425 2174 has_altzone=yes,
ohair@425 2175 has_altzone=no)
ohair@425 2176 if test "x$has_altzone" = xyes; then
ohair@425 2177 AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h])
ohair@425 2178 fi
ohair@425 2179
ohair@425 2180 ###############################################################################
ohair@425 2181 #
ohair@425 2182 # Check the maths library
ohair@425 2183 #
ohair@425 2184
ohair@425 2185 AC_CHECK_LIB(m, main, [],
ohair@425 2186 [
ohair@425 2187 AC_MSG_NOTICE([Maths library was not found])
ohair@425 2188 ])
ohair@425 2189 AC_SUBST(LIBM)
ohair@425 2190
ohair@425 2191 ###############################################################################
ohair@425 2192 #
ohair@425 2193 # Should we run the painfully slow javadoc tool?
ohair@425 2194 #
ohair@425 2195 AC_MSG_CHECKING([whether to build documentation])
ohair@425 2196 AC_ARG_ENABLE([docs], [AS_HELP_STRING([--enable-docs],
ohair@425 2197 [enable generation of Javadoc documentation @<:@disabled@:>@])],
ohair@425 2198 [ENABLE_DOCS="${enableval}"], [ENABLE_DOCS='no'])
ohair@425 2199 AC_MSG_RESULT([$ENABLE_DOCS])
ohair@425 2200 AC_SUBST(ENABLE_DOCS)
ohair@425 2201 GENERATE_DOCS=false
ohair@425 2202 if test "x$ENABLE_DOCS" = xyes; then
ohair@425 2203 GENERATE_DOCS=true
ohair@425 2204 fi
ohair@425 2205 AC_SUBST(GENERATE_DOCS)
ohair@425 2206
ohair@425 2207 ###############################################################################
ohair@425 2208 #
ohair@425 2209 # Should we compile nimbus swing L&F? We can probably remove this option
ohair@425 2210 # since nimbus is officially part of javax now.
ohair@425 2211 #
ohair@425 2212 AC_MSG_CHECKING([whether to build nimbus L&F])
ohair@425 2213 AC_ARG_ENABLE([nimbus], [AS_HELP_STRING([--disable-nimbus],
ohair@425 2214 [disable Nimbus L&F @<:@enabled@:>@])],
ohair@425 2215 [ENABLE_NIMBUS="${enableval}"], [ENABLE_NIMBUS='yes'])
ohair@425 2216 AC_MSG_RESULT([$ENABLE_NIMBUS])
ohair@425 2217 DISABLE_NIMBUS=
ohair@425 2218 if test "x$ENABLE_NIMBUS" = xno; then
ohair@425 2219 DISABLE_NIMBUS=true
ohair@425 2220 fi
ohair@425 2221 AC_SUBST(DISABLE_NIMBUS)
ohair@425 2222
ohair@425 2223 ###############################################################################
ohair@425 2224 #
ohair@425 2225 # Setup the opt flags for different compilers
ohair@425 2226 # and different operating systems.
ohair@425 2227 #
ohair@425 2228 case $COMPILER_TYPE in
ohair@425 2229 CC )
ohair@425 2230 D_FLAG="-g"
ohair@425 2231 case $COMPILER_NAME in
ohair@425 2232 gcc )
ohair@425 2233 case $PLATFORM in
ohair@425 2234 macosx )
ohair@425 2235 # On MacOSX we optimize for size, something
ohair@425 2236 # we should do for all platforms?
ohair@425 2237 C_O_FLAG_HI="-O3"
ohair@425 2238 C_O_FLAG_NORM="-Os"
ohair@425 2239 C_O_FLAG_NONE="-O0"
ohair@425 2240 ;;
ohair@425 2241 *)
ohair@425 2242 C_O_FLAG_HI="-O3"
ohair@425 2243 C_O_FLAG_NORM="-O2"
ohair@425 2244 C_O_FLAG_NONE="-O0"
ohair@425 2245 ;;
ohair@425 2246 esac
ohair@425 2247 CXX_O_FLAG_HI="$C_O_FLAG_HI"
ohair@425 2248 CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
ohair@425 2249 CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
ohair@425 2250 ;;
ohair@425 2251 ossc )
ohair@425 2252 case $LEGACY_HOST_CPU1 in
ohair@425 2253 i586)
ohair@425 2254 C_O_FLAG_HI="-xO4 -Wu,-O4~yz"
ohair@425 2255 C_O_FLAG_NORM="-xO2 -Wu,-O2~yz"
ohair@425 2256 C_O_FLAG_NONE=""
ohair@425 2257 CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz"
ohair@425 2258 CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz"
ohair@425 2259 CXX_O_FLAG_NONE=""
ohair@425 2260 ;;
ohair@425 2261 sparc)
ohair@425 2262 C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
ohair@425 2263 C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
ohair@425 2264 C_O_FLAG_NONE=""
ohair@425 2265 CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
ohair@425 2266 CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
ohair@425 2267 CXX_O_FLAG_NONE=""
ohair@425 2268 ;;
ohair@425 2269 esac
ohair@425 2270 esac
ohair@425 2271 ;;
ohair@425 2272 CL )
ohair@425 2273 D_FLAG=
ohair@425 2274 C_O_FLAG_HI="-O2"
ohair@425 2275 C_O_FLAG_NORM="-O1"
ohair@425 2276 C_O_FLAG_NONE="-Od"
ohair@425 2277 CXX_O_FLAG_HI="$C_O_FLAG_HI"
ohair@425 2278 CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
ohair@425 2279 CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
ohair@425 2280 ;;
ohair@425 2281 esac
ohair@425 2282
ohair@425 2283 AC_SUBST(C_O_FLAG_HI)
ohair@425 2284 AC_SUBST(C_O_FLAG_NORM)
ohair@425 2285 AC_SUBST(C_O_FLAG_NONE)
ohair@425 2286 AC_SUBST(CXX_O_FLAG_HI)
ohair@425 2287 AC_SUBST(CXX_O_FLAG_NORM)
ohair@425 2288 AC_SUBST(CXX_O_FLAG_NONE)
ohair@425 2289
ohair@425 2290 ###############################################################################
ohair@425 2291 #
ohair@425 2292 # Setup legacy vars/targets and new vars to deal with different debug levels.
ohair@425 2293 #
ohair@425 2294 case $DEBUG_LEVEL in
ohair@425 2295 release )
ohair@425 2296 HOTSPOT_DEBUG_LEVEL="product"
ohair@425 2297 HOTSPOT_EXPORT="product"
ohair@425 2298 ;;
ohair@425 2299 fastdebug )
ohair@425 2300 HOTSPOT_DEBUG_LEVEL="fastdebug"
ohair@425 2301 HOTSPOT_EXPORT="fastdebug"
ohair@425 2302 CFLAGS="$CFLAGS $D_FLAG"
ohair@425 2303 JAVAC_FLAGS="$JAVAC_FLAGS -g"
ohair@425 2304 ;;
ohair@425 2305 slowdebug )
ohair@425 2306 HOTSPOT_DEBUG_LEVEL="jvmg"
ohair@425 2307 HOTSPOT_EXPORT="debug"
ohair@425 2308 CFLAGS="$CFLAGS $D_FLAG"
ohair@425 2309 C_O_FLAG_HI="$C_O_FLAG_NONE"
ohair@425 2310 C_O_FLAG_NORM="$C_O_FLAG_NONE"
ohair@425 2311 CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
ohair@425 2312 CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
ohair@425 2313 JAVAC_FLAGS="$JAVAC_FLAGS -g"
ohair@425 2314 ;;
ohair@425 2315 esac
ohair@425 2316
ohair@425 2317 ###############################################################################
ohair@425 2318 #
ohair@425 2319 # Generate the legacy makefile targets for hotspot.
ohair@425 2320 # The hotspot api for selecting the build artifacts, really, needs to be improved.
ohair@425 2321 #
ohair@425 2322 HOTSPOT_TARGET=""
ohair@425 2323
ohair@425 2324 if test "x$JVM_VARIANT_SERVER" = xtrue; then
ohair@425 2325 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
ohair@425 2326 fi
ohair@425 2327
ohair@425 2328 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
ohair@425 2329 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
ohair@425 2330 fi
ohair@425 2331
ohair@425 2332 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
ohair@425 2333 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
ohair@425 2334 fi
ohair@425 2335
ohair@425 2336 if test "x$JVM_VARIANT_ZERO" = xtrue; then
ohair@425 2337 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
ohair@425 2338 fi
ohair@425 2339
ohair@425 2340 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
ohair@425 2341 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
ohair@425 2342 fi
ohair@425 2343
ohair@425 2344 HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
ohair@425 2345
ohair@425 2346 ###############################################################################
ohair@425 2347 #
ohair@425 2348 # Setup all directories for the subrepoes and the arguments to the sub makes.
ohair@425 2349 #
ohair@425 2350 LANGTOOLS_OUTPUTDIR="$OUTPUT_ROOT/langtools"
ohair@425 2351 LANGTOOLS_DIST="$OUTPUT_ROOT/langtools/dist"
ohair@425 2352 LANGTOOLS_MAKE_ARGS=""
ohair@425 2353 AC_SUBST(LANGTOOLS_OUTPUTDIR)
ohair@425 2354 AC_SUBST(LANGTOOLS_DIST)
ohair@425 2355 AC_SUBST(LANGTOOLS_MAKE_ARGS)
ohair@425 2356
ohair@425 2357 CORBA_OUTPUTDIR="$OUTPUT_ROOT/corba"
ohair@425 2358 CORBA_DIST="$OUTPUT_ROOT/corba/dist"
ohair@425 2359 CORBA_MAKE_ARGS=""
ohair@425 2360 AC_SUBST(CORBA_OUTPUTDIR)
ohair@425 2361 AC_SUBST(CORBA_DIST)
ohair@425 2362 AC_SUBST(CORBA_MAKE_ARGS)
ohair@425 2363
ohair@425 2364 JAXP_OUTPUTDIR="$OUTPUT_ROOT/jaxp"
ohair@425 2365 JAXP_DIST="$OUTPUT_ROOT/jaxp/dist"
ohair@425 2366 JAXP_MAKE_ARGS=""
ohair@425 2367 AC_SUBST(JAXP_OUTPUTDIR)
ohair@425 2368 AC_SUBST(JAXP_DIST)
ohair@425 2369 AC_SUBST(JAXP_MAKE_ARGS)
ohair@425 2370
ohair@425 2371 JAXWS_OUTPUTDIR="$OUTPUT_ROOT/jaxws"
ohair@425 2372 JAXWS_DIST="$OUTPUT_ROOT/jaxws/dist"
ohair@425 2373 JAXWS_MAKE_ARGS=""
ohair@425 2374 AC_SUBST(JAXWS_OUTPUTDIR)
ohair@425 2375 AC_SUBST(JAXWS_DIST)
ohair@425 2376 AC_SUBST(JAXWS_MAKE_ARGS)
ohair@425 2377
ohair@425 2378 HOTSPOT_OUTPUTDIR="$OUTPUT_ROOT/hotspot"
ohair@425 2379 HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
ohair@425 2380 HOTSPOT_MAKE_ARGS="ALT_OUTPUTDIR=$HOTSPOT_OUTPUTDIR ALT_EXPORT_PATH=$HOTSPOT_DIST $HOTSPOT_TARGET"
ohair@425 2381 AC_SUBST(HOTSPOT_OUTPUTDIR)
ohair@425 2382 AC_SUBST(HOTSPOT_DIST)
ohair@425 2383 AC_SUBST(HOTSPOT_MAKE_ARGS)
ohair@425 2384
ohair@425 2385 JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
ohair@425 2386 JDK_MAKE_ARGS="ALT_OUTPUTDIR=\"$OUTPUT_ROOT/jdk\""
ohair@425 2387 AC_SUBST(JDK_OUTPUTDIR)
ohair@425 2388 AC_SUBST(JDK_MAKE_ARGS)
ohair@425 2389
ohair@425 2390 IMAGES_OUTPUTDIR=$OUTPUT_ROOT/images
ohair@425 2391 IMAGES_MAKE_ARGS="ALT_OUTPUTDIR=$OUTPUT_ROOT/jdk \
ohair@425 2392 SHARE_SRC=$JDK_TOPDIR/src/share \
ohair@425 2393 PLATFORM_SRC=$JDK_TOPDIR/src/$LEGACY_HOST_OS_API \
ohair@425 2394 TEMPDIR=$IMAGES_OUTPUTDIR/tmp \
ohair@425 2395 ABS_TEMPDIR=$IMAGES_OUTPUTDIR/tmp "
ohair@425 2396 AC_SUBST(IMAGES_OUTPUTDIR)
ohair@425 2397 AC_SUBST(IMAGES_MAKE_ARGS)
ohair@425 2398
ohair@425 2399 ###############################################################################
ohair@425 2400 #
ohair@425 2401 # Now setup the CFLAGS and LDFLAGS for the JDK build.
ohair@425 2402 # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
ohair@425 2403 #
ohair@425 2404 case $COMPILER_NAME in
ohair@425 2405 gcc )
ohair@425 2406 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \
ohair@425 2407 -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
ohair@425 2408 CFLAGS_JDK="$CFLAGS_JDK -fno-strict-aliasing"
ohair@425 2409 ;;
ohair@425 2410 ossc )
ohair@425 2411 CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa REQUIRED -v -mt -norunpath -xnolib"
ohair@425 2412 CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt REQUIRED -features=no%except -DCC_NOEX"
ohair@425 2413 ;;
ohair@425 2414 cl )
ohair@425 2415 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
ohair@425 2416 -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
ohair@425 2417 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
ohair@425 2418 -DWIN32 -DIAL"
ohair@425 2419 case $LEGACY_HOST_CPU1 in
ohair@425 2420 i?86 )
ohair@425 2421 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
ohair@425 2422 ;;
ohair@425 2423 amd64 )
ohair@425 2424 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
ohair@425 2425 ;;
ohair@425 2426 esac
ohair@425 2427 ;;
ohair@425 2428 esac
ohair@425 2429
ohair@425 2430 CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
ohair@425 2431
ohair@425 2432 # The package path is used only on macosx?
ohair@425 2433 PACKAGE_PATH=/opt/local
ohair@425 2434 AC_SUBST(PACKAGE_PATH)
ohair@425 2435
ohair@425 2436 # Sometimes we use a cpu dir (.../lib/amd64/server)
ohair@425 2437 # Sometimes not (.../lib/server)
ohair@425 2438 LIBARCHDIR="$LEGACY_HOST_CPU2/"
ohair@425 2439 if test "x$ENDIAN" = xlittle; then
ohair@425 2440 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
ohair@425 2441 else
ohair@425 2442 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
ohair@425 2443 fi
ohair@425 2444 if test "x$HOST_OS" = xlinux; then
ohair@425 2445 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX"
ohair@425 2446 fi
ohair@425 2447 if test "x$HOST_OS" = xwindows; then
ohair@425 2448 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS"
ohair@425 2449 fi
ohair@425 2450 if test "x$HOST_OS" = xsolaris; then
ohair@425 2451 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS"
ohair@425 2452 fi
ohair@425 2453 if test "x$HOST_OS" = xmacosx; then
ohair@425 2454 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
ohair@425 2455 LIBARCHDIR=""
ohair@425 2456 fi
ohair@425 2457 if test "x$HOST_OS" = xbsd; then
ohair@425 2458 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE"
ohair@425 2459 fi
ohair@425 2460 if test "x$DEBUG_LEVEL" = xrelease; then
ohair@425 2461 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
ohair@425 2462 else
ohair@425 2463 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
ohair@425 2464 fi
ohair@425 2465
ohair@425 2466 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$LEGACY_HOST_CPU1\"' -D$LEGACY_HOST_CPU1"
ohair@425 2467 CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
ohair@425 2468
ohair@425 2469 CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
ohair@425 2470 -I${JDK_OUTPUTDIR}/include \
ohair@425 2471 -I${JDK_OUTPUTDIR}/include/$PLATFORM \
ohair@425 2472 -I${JDK_TOPDIR}/src/share/javavm/export \
ohair@425 2473 -I${JDK_TOPDIR}/src/$LEGACY_HOST_OS_API/javavm/export \
ohair@425 2474 -I${JDK_TOPDIR}/src/share/native/common \
ohair@425 2475 -I${JDK_TOPDIR}/src/$LEGACY_HOST_OS_API/native/common"
ohair@425 2476
ohair@425 2477 # The shared libraries are compiled using the picflag.
ohair@425 2478 CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
ohair@425 2479 CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG"
ohair@425 2480
ohair@425 2481 # Executable flags
ohair@425 2482 CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
ohair@425 2483 CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
ohair@425 2484
ohair@425 2485 # Now this is odd. The JDK native libraries have to link against libjvm.so
ohair@425 2486 # On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
ohair@425 2487 # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
ohair@425 2488 # is identical for client and server? Yes. Which is picked at runtime (client or server)?
ohair@425 2489 # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
ohair@425 2490 # libraries will link to whatever is in memory. Yuck.
ohair@425 2491 #
ohair@425 2492 # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
ohair@425 2493 if test "x$COMPILER_TYPE" = xCL; then
ohair@425 2494 LDFLAGS_JDKLIB="$LDFLAGS -libpath:${JDK_OUTPUTDIR}/lib jvm.lib java.lib"
ohair@425 2495 LDFLAGS_JDKLIB_SUFFIX=""
ohair@425 2496 if test "x$HOST_CPU_BITS" = "x64"; then
ohair@425 2497 LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj64/jli.lib"
ohair@425 2498 else
ohair@425 2499 LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj/jli.lib"
ohair@425 2500 fi
ohair@425 2501 LDFLAGS_JDKEXE_SUFFIX=""
ohair@425 2502 else
ohair@425 2503 # If this is a --hash-style=gnu system, use --hash-style=both, why?
ohair@425 2504 HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
ohair@425 2505 if test -n "$HAS_GNU_HASH"; then
ohair@425 2506 # And since we now know that the linker is gnu, then add -z defs, to forbid
ohair@425 2507 # undefined symbols in object files.
ohair@425 2508 LDFLAGS="$LDFLAGS -Xlinker --hash-style=both -Xlinker -z -Xlinker defs"
ohair@425 2509 if test "x$DEBUG_LEVEL" == "xrelease"; then
ohair@425 2510 # When building release libraries, tell the linker optimize them.
ohair@425 2511 # Should this be supplied to the OSS linker as well?
ohair@425 2512 LDFLAGS="$LDFLAGS -Xlinker -O1"
ohair@425 2513 fi
ohair@425 2514 fi
ohair@425 2515
ohair@425 2516 LDFLAGS_JDKLIB="$LDFLAGS $SHARED_LIBRARY_FLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \
ohair@425 2517 -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}client \
ohair@425 2518 -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}"
ohair@425 2519 LDFLAGS_JDKLIB_SUFFIX="-ljvm -ljava"
ohair@425 2520 if test "x$COMPILER_NAME" = xossc; then
ohair@425 2521 LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
ohair@425 2522 fi
ohair@425 2523
ohair@425 2524 # Only the jli library is explicitly linked when the launchers are built.
ohair@425 2525 # The libjvm is then dynamically loaded/linked by the launcher.
ohair@425 2526 LDFLAGS_JDKEXE="$LDFLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli"
ohair@425 2527 LDFLAGS_JDKEXE_SUFFIX="-ljli"
ohair@425 2528 fi
ohair@425 2529
ohair@425 2530
ohair@425 2531 AC_SUBST(CFLAGS_JDKLIB)
ohair@425 2532 AC_SUBST(CFLAGS_JDKEXE)
ohair@425 2533
ohair@425 2534 AC_SUBST(CXXFLAGS_JDKLIB)
ohair@425 2535 AC_SUBST(CXXFLAGS_JDKEXE)
ohair@425 2536
ohair@425 2537 AC_SUBST(LDFLAGS_JDKLIB)
ohair@425 2538 AC_SUBST(LDFLAGS_JDKEXE)
ohair@425 2539 AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
ohair@425 2540 AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
ohair@425 2541
ohair@425 2542
ohair@425 2543 ###############################################################################
ohair@425 2544 #
ohair@425 2545 # statically link libstdc++ before C++ ABI is stablized on Linux unless
ohair@425 2546 # dynamic build is configured on command line.
ohair@425 2547 #
ohair@425 2548 AC_ARG_ENABLE([static-link-stdc++], [AS_HELP_STRING([--disable-static-link-stdc++],
ohair@425 2549 [disable static linking of the C++ runtime on Linux @<:@enabled@:>@])],,
ohair@425 2550 [
ohair@425 2551 enable_static_link_stdc__=yes
ohair@425 2552 ])
ohair@425 2553
ohair@425 2554 if test "x$HOST_OS" = xlinux; then
ohair@425 2555 # Test if -lstdc++ works.
ohair@425 2556 AC_MSG_CHECKING([if dynamic link of stdc++ is possible])
ohair@425 2557 AC_LANG_PUSH(C++)
ohair@425 2558 OLD_CXXFLAGS="$CXXFLAGS"
ohair@425 2559 CXXFLAGS="$CXXFLAGS -lstdc++"
ohair@425 2560 AC_TRY_LINK([], [return 0;],
ohair@425 2561 has_dynamic_libstdcxx=yes,
ohair@425 2562 has_dynamic_libstdcxx=no)
ohair@425 2563 CXXFLAGS="$OLD_CXXFLAGS"
ohair@425 2564 AC_LANG_POP(C++)
ohair@425 2565 AC_MSG_RESULT([$has_dynamic_libstdcxx])
ohair@425 2566
ohair@425 2567 # Test if stdc++ can be linked statically.
ohair@425 2568 AC_MSG_CHECKING([if static link of stdc++ is possible])
ohair@425 2569 STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
ohair@425 2570 AC_LANG_PUSH(C++)
ohair@425 2571 OLD_LIBS="$LIBS"
ohair@425 2572 OLD_CXX="$CXX"
ohair@425 2573 LIBS="$STATIC_STDCXX_FLAGS"
ohair@425 2574 CXX="$CC"
ohair@425 2575 AC_TRY_LINK([], [return 0;],
ohair@425 2576 has_static_libstdcxx=yes,
ohair@425 2577 has_static_libstdcxx=no)
ohair@425 2578 LIBS="$OLD_LIBS"
ohair@425 2579 CXX="$OLD_CXX"
ohair@425 2580 AC_LANG_POP(C++)
ohair@425 2581 AC_MSG_RESULT([$has_static_libstdcxx])
ohair@425 2582
ohair@425 2583 if test "x$has_static_libcxx" = xno && test "x$has_dynamic_libcxx" = xno; then
ohair@425 2584 AC_ERROR([I cannot link to stdc++! Neither dynamically nor statically.])
ohair@425 2585 fi
ohair@425 2586
ohair@425 2587 if test "x$enable_static_link_stdc__" = xyes && test "x$has_static_libstdcxx" = xno; then
ohair@425 2588 AC_MSG_NOTICE([Static linking of libstdc++ was not possible reverting to dynamic linking.])
ohair@425 2589 enable_static_link_stdc__=no
ohair@425 2590 fi
ohair@425 2591
ohair@425 2592 if test "x$enable_static_link_stdc__" = xno && test "x$has_dynamic_libstdcxx" = xno; then
ohair@425 2593 AC_MSG_NOTICE([Dynamic linking of libstdc++ was not possible reverting to static linking.])
ohair@425 2594 enable_static_link_stdc__=yes
ohair@425 2595 fi
ohair@425 2596
ohair@425 2597 AC_MSG_CHECKING([how to link with libstdc++])
ohair@425 2598 if test "x$enable_static_link_stdc__" = xyes; then
ohair@425 2599 LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
ohair@425 2600 LDCXX="$CC"
ohair@425 2601 AC_MSG_RESULT([static])
ohair@425 2602 else
ohair@425 2603 LIBCXX="$LIBCXX -lstdc++"
ohair@425 2604 LDCXX="$CXX"
ohair@425 2605 AC_MSG_RESULT([dynamic])
ohair@425 2606 fi
ohair@425 2607 fi
ohair@425 2608
ohair@425 2609 ###############################################################################
ohair@425 2610 #
ohair@425 2611 # Could someone enlighten this configure script with a comment about libCrun?
ohair@425 2612 # The LEGACY_HOST_CPU3 is the setting for ISA_DIR.
ohair@425 2613 #
ohair@425 2614 if test "x$HOST_OS" = xsolaris; then
ohair@425 2615 LIBCXX="$LIBCXX /usr/lib${LEGACY_HOST_CPU3}/libCrun.so.1"
ohair@425 2616 fi
ohair@425 2617
ohair@425 2618 AC_SUBST(LIBCXX)
ohair@425 2619
ohair@425 2620 ###############################################################################
ohair@425 2621 #
ohair@425 2622 # Misc
ohair@425 2623 #
ohair@425 2624
ohair@425 2625 # Control wether Hotspot runs Queens test after build.
ohair@425 2626 AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
ohair@425 2627 [enable running of Queens test after Hotspot build (not yet available) @<:@disabled@:>@])],,
ohair@425 2628 [enable_hotspot_test_in_build=no])
ohair@425 2629 if test "x$enable_hotspot_test_in_build" = "xyes"; then
ohair@425 2630 TEST_IN_BUILD=true
ohair@425 2631 else
ohair@425 2632 TEST_IN_BUILD=false
ohair@425 2633 fi
ohair@425 2634 AC_SUBST(TEST_IN_BUILD)
ohair@425 2635
ohair@425 2636 ###############################################################################
ohair@425 2637 #
ohair@425 2638 # A helpful message at the end of the configure run.
ohair@425 2639 #
ohair@425 2640 if test "x$CCACHE_FOUND" = x && test "x$GCC" = xyes; then
ohair@425 2641 help_on_build_dependency ccache
ohair@425 2642
ohair@425 2643 printf "\nTip of the day:\nYou should really install ccache version 3.1.4 or newer.\n"
ohair@425 2644 printf "It gives a tremendous speedup for C++ recompilations with precompiled headers!\n"
ohair@425 2645 fi
ohair@425 2646
ohair@425 2647 if test "x$CCACHE_FOUND" != x && test "x$HAS_GOOD_CCACHE" = x; then
ohair@425 2648 printf "You have a ccache installed, but it is a version prior to 3.1.4. Try upgrading.\n"
ohair@425 2649 fi
ohair@425 2650
ohair@425 2651 AC_OUTPUT

mercurial