1 # |
1 # |
2 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
5 # This code is free software; you can redistribute it and/or modify it |
6 # under the terms of the GNU General Public License version 2 only, as |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. Oracle designates this |
7 # published by the Free Software Foundation. Oracle designates this |
416 ]) |
416 ]) |
417 |
417 |
418 # Setup basic configuration paths, and platform-specific stuff related to PATHs. |
418 # Setup basic configuration paths, and platform-specific stuff related to PATHs. |
419 AC_DEFUN_ONCE([BASIC_SETUP_PATHS], |
419 AC_DEFUN_ONCE([BASIC_SETUP_PATHS], |
420 [ |
420 [ |
|
421 # We get the top-level directory from the supporting wrappers. |
|
422 AC_MSG_CHECKING([for top-level directory]) |
|
423 AC_MSG_RESULT([$TOPDIR]) |
|
424 BASIC_FIXUP_PATH(TOPDIR) |
|
425 AC_SUBST(TOPDIR) |
|
426 |
|
427 # SRC_ROOT is a traditional alias for TOPDIR. |
|
428 SRC_ROOT=$TOPDIR |
|
429 |
421 # Locate the directory of this script. |
430 # Locate the directory of this script. |
422 SCRIPT="[$]0" |
431 AUTOCONF_DIR=$TOPDIR/common/autoconf |
423 AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` |
432 |
424 |
433 # Save the current directory this script was started from |
425 # Where is the source? It is located two levels above the configure script. |
|
426 CURDIR="$PWD" |
434 CURDIR="$PWD" |
427 cd "$AUTOCONF_DIR/../.." |
435 BASIC_FIXUP_PATH(CURDIR) |
428 SRC_ROOT="`$THEPWDCMD -L`" |
|
429 |
436 |
430 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
437 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
431 PATH_SEP=";" |
438 PATH_SEP=";" |
432 BASIC_CHECK_PATHS_WINDOWS |
439 BASIC_CHECK_PATHS_WINDOWS |
433 else |
440 else |
434 PATH_SEP=":" |
441 PATH_SEP=":" |
435 fi |
442 fi |
436 |
|
437 AC_SUBST(SRC_ROOT) |
|
438 AC_SUBST(PATH_SEP) |
443 AC_SUBST(PATH_SEP) |
439 cd "$CURDIR" |
|
440 |
|
441 BASIC_FIXUP_PATH(SRC_ROOT) |
|
442 BASIC_FIXUP_PATH(CURDIR) |
|
443 |
444 |
444 if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then |
445 if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then |
445 # Add extra search paths on solaris for utilities like ar and as etc... |
446 # Add extra search paths on solaris for utilities like ar and as etc... |
446 PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" |
447 PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" |
447 fi |
448 fi |
485 AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name], |
486 AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name], |
486 [use this as the name of the configuration @<:@generated from important configuration options@:>@])], |
487 [use this as the name of the configuration @<:@generated from important configuration options@:>@])], |
487 [ CONF_NAME=${with_conf_name} ]) |
488 [ CONF_NAME=${with_conf_name} ]) |
488 |
489 |
489 # Test from where we are running configure, in or outside of src root. |
490 # Test from where we are running configure, in or outside of src root. |
|
491 AC_MSG_CHECKING([where to store configuration]) |
490 if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ |
492 if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ |
491 || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ |
493 || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ |
492 || test "x$CURDIR" = "x$SRC_ROOT/make" ; then |
494 || test "x$CURDIR" = "x$SRC_ROOT/make" ; then |
493 # We are running configure from the src root. |
495 # We are running configure from the src root. |
494 # Create a default ./build/target-variant-debuglevel output root. |
496 # Create a default ./build/target-variant-debuglevel output root. |
495 if test "x${CONF_NAME}" = x; then |
497 if test "x${CONF_NAME}" = x; then |
|
498 AC_MSG_RESULT([in default location]) |
496 CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" |
499 CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" |
|
500 else |
|
501 AC_MSG_RESULT([in build directory with custom name]) |
497 fi |
502 fi |
498 OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" |
503 OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" |
499 $MKDIR -p "$OUTPUT_ROOT" |
504 $MKDIR -p "$OUTPUT_ROOT" |
500 if test ! -d "$OUTPUT_ROOT"; then |
505 if test ! -d "$OUTPUT_ROOT"; then |
501 AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT]) |
506 AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT]) |
507 # directory name as configuration name, otherwise use the complete path. |
512 # directory name as configuration name, otherwise use the complete path. |
508 if test "x${CONF_NAME}" = x; then |
513 if test "x${CONF_NAME}" = x; then |
509 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` |
514 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` |
510 fi |
515 fi |
511 OUTPUT_ROOT="$CURDIR" |
516 OUTPUT_ROOT="$CURDIR" |
|
517 AC_MSG_RESULT([in current directory]) |
512 |
518 |
513 # WARNING: This might be a bad thing to do. You need to be sure you want to |
519 # WARNING: This might be a bad thing to do. You need to be sure you want to |
514 # have a configuration in this directory. Do some sanity checks! |
520 # have a configuration in this directory. Do some sanity checks! |
515 |
521 |
516 if test ! -e "$OUTPUT_ROOT/spec.gmk"; then |
522 if test ! -e "$OUTPUT_ROOT/spec.gmk"; then |