461
462 # Save the original version of TOPDIR for string comparisons
463 ORIGINAL_TOPDIR="$TOPDIR"
464 AC_SUBST(ORIGINAL_TOPDIR)
465
466 # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
467 BASIC_FIXUP_PATH(CURDIR)
468 BASIC_FIXUP_PATH(TOPDIR)
469 # SRC_ROOT is a traditional alias for TOPDIR.
470 SRC_ROOT=$TOPDIR
471
472 # Calculate a canonical version of TOPDIR for string comparisons
473 CANONICAL_TOPDIR=$TOPDIR
474 BASIC_REMOVE_SYMBOLIC_LINKS([CANONICAL_TOPDIR])
475 AC_SUBST(CANONICAL_TOPDIR)
476
477 # Locate the directory of this script.
478 AUTOCONF_DIR=$TOPDIR/common/autoconf
479 ])
480
481 AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
482 [
483 AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
484 [use this devkit for compilers, tools and resources])],
485 [
486 BASIC_FIXUP_PATH([with_devkit])
487 DEVKIT_ROOT="$with_devkit"
488 # Check for a meta data info file in the root of the devkit
489 if test -f "$DEVKIT_ROOT/devkit.info"; then
490 # This potentially sets the following:
491 # DEVKIT_NAME: A descriptive name of the devkit
492 # DEVKIT_TOOLCHAIN_PATH: Corresponds to --with-toolchain-path
493 # DEVKIT_EXTRA_PATH: Corresponds to --with-extra-path
494 # DEVKIT_SYSROOT: Corresponds to --with-sysroot
495 . $DEVKIT_ROOT/devkit.info
496 fi
497
498 AC_MSG_CHECKING([for devkit])
499 if test "x$DEVKIT_NAME" != x; then
500 AC_MSG_RESULT([$DEVKIT_NAME in $DEVKIT_ROOT])
501 else
502 AC_MSG_RESULT([$DEVKIT_ROOT])
503 fi
504
505 if test "x$DEVKIT_EXTRA_PATH" != x; then
506 BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH)
507 fi
508
509 # Fallback default of just /bin if DEVKIT_PATH is not defined
510 if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
511 DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
512 fi
513 BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$DEVKIT_TOOLCHAIN_PATH)
514
515 # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
516 # places for backwards compatiblity.
517 if test "x$DEVKIT_SYSROOT" != x; then
518 SYSROOT="$DEVKIT_SYSROOT"
519 elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
520 SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
521 elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
522 SYSROOT="$DEVKIT_ROOT/$host/sys-root"
523 fi
524 ]
525 )
526
527 # You can force the sysroot if the sysroot encoded into the compiler tools
664 else
665 # We are running configure from outside of the src dir.
666 # Then use the current directory as output dir!
667 # If configuration is situated in normal build directory, just use the build
668 # directory name as configuration name, otherwise use the complete path.
669 if test "x${CONF_NAME}" = x; then
670 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
671 fi
672 OUTPUT_ROOT="$CURDIR"
673 AC_MSG_RESULT([in current directory])
674
675 # WARNING: This might be a bad thing to do. You need to be sure you want to
676 # have a configuration in this directory. Do some sanity checks!
677
678 if test ! -e "$OUTPUT_ROOT/spec.gmk"; then
679 # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
680 # other files
681 files_present=`$LS $OUTPUT_ROOT`
682 # Configure has already touched config.log and confdefs.h in the current dir when this check
683 # is performed.
684 filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \
685 | $TR -d '\n'`
686 if test "x$filtered_files" != x; then
687 AC_MSG_NOTICE([Current directory is $CURDIR.])
688 AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])
689 AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).])
690 AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
691 AC_MSG_NOTICE([seriously mess up just about everything.])
692 AC_MSG_NOTICE([Try 'cd $SRC_ROOT' and restart configure])
693 AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
694 AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
695 fi
696 fi
697 fi
698 AC_MSG_CHECKING([what configuration name to use])
699 AC_MSG_RESULT([$CONF_NAME])
700
701 BASIC_FIXUP_PATH(OUTPUT_ROOT)
702
703 CONFIGURESUPPORT_OUTPUTDIR="$OUTPUT_ROOT/configure-support"
704 $MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
|
461
462 # Save the original version of TOPDIR for string comparisons
463 ORIGINAL_TOPDIR="$TOPDIR"
464 AC_SUBST(ORIGINAL_TOPDIR)
465
466 # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
467 BASIC_FIXUP_PATH(CURDIR)
468 BASIC_FIXUP_PATH(TOPDIR)
469 # SRC_ROOT is a traditional alias for TOPDIR.
470 SRC_ROOT=$TOPDIR
471
472 # Calculate a canonical version of TOPDIR for string comparisons
473 CANONICAL_TOPDIR=$TOPDIR
474 BASIC_REMOVE_SYMBOLIC_LINKS([CANONICAL_TOPDIR])
475 AC_SUBST(CANONICAL_TOPDIR)
476
477 # Locate the directory of this script.
478 AUTOCONF_DIR=$TOPDIR/common/autoconf
479 ])
480
481 # Evaluates platform specific overrides for devkit variables.
482 # $1: Name of variable
483 AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
484 [
485 if test "x[$]$1" = x; then
486 eval $1="\${$1_${OPENJDK_TARGET_CPU}}"
487 fi
488 ])
489
490 AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
491 [
492 AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
493 [use this devkit for compilers, tools and resources])],
494 [
495 BASIC_FIXUP_PATH([with_devkit])
496 DEVKIT_ROOT="$with_devkit"
497 # Check for a meta data info file in the root of the devkit
498 if test -f "$DEVKIT_ROOT/devkit.info"; then
499 . $DEVKIT_ROOT/devkit.info
500 # This potentially sets the following:
501 # A descriptive name of the devkit
502 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_NAME])
503 # Corresponds to --with-extra-path
504 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_EXTRA_PATH])
505 # Corresponds to --with-toolchain-path
506 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_TOOLCHAIN_PATH])
507 # Corresponds to --with-sysroot
508 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_SYSROOT])
509
510 # Identifies the Visual Studio version in the devkit
511 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_VERSION])
512 # The Visual Studio include environment variable
513 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_INCLUDE])
514 # The Visual Studio lib environment variable
515 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_LIB])
516 # Corresponds to --with-msvcr-dll
517 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCR_DLL])
518 # Corresponds to --with-msvcp-dll
519 BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCP_DLL])
520 fi
521
522 AC_MSG_CHECKING([for devkit])
523 if test "x$DEVKIT_NAME" != x; then
524 AC_MSG_RESULT([$DEVKIT_NAME in $DEVKIT_ROOT])
525 else
526 AC_MSG_RESULT([$DEVKIT_ROOT])
527 fi
528
529 BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH)
530
531 # Fallback default of just /bin if DEVKIT_PATH is not defined
532 if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
533 DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
534 fi
535 BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$DEVKIT_TOOLCHAIN_PATH)
536
537 # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
538 # places for backwards compatiblity.
539 if test "x$DEVKIT_SYSROOT" != x; then
540 SYSROOT="$DEVKIT_SYSROOT"
541 elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
542 SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
543 elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
544 SYSROOT="$DEVKIT_ROOT/$host/sys-root"
545 fi
546 ]
547 )
548
549 # You can force the sysroot if the sysroot encoded into the compiler tools
686 else
687 # We are running configure from outside of the src dir.
688 # Then use the current directory as output dir!
689 # If configuration is situated in normal build directory, just use the build
690 # directory name as configuration name, otherwise use the complete path.
691 if test "x${CONF_NAME}" = x; then
692 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
693 fi
694 OUTPUT_ROOT="$CURDIR"
695 AC_MSG_RESULT([in current directory])
696
697 # WARNING: This might be a bad thing to do. You need to be sure you want to
698 # have a configuration in this directory. Do some sanity checks!
699
700 if test ! -e "$OUTPUT_ROOT/spec.gmk"; then
701 # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
702 # other files
703 files_present=`$LS $OUTPUT_ROOT`
704 # Configure has already touched config.log and confdefs.h in the current dir when this check
705 # is performed.
706 filtered_files=`$ECHO "$files_present" \
707 | $SED -e 's/config.log//g' \
708 -e 's/confdefs.h//g' \
709 -e 's/fixpath.exe//g' \
710 -e 's/ //g' \
711 | $TR -d '\n'`
712 if test "x$filtered_files" != x; then
713 AC_MSG_NOTICE([Current directory is $CURDIR.])
714 AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])
715 AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).])
716 AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
717 AC_MSG_NOTICE([seriously mess up just about everything.])
718 AC_MSG_NOTICE([Try 'cd $SRC_ROOT' and restart configure])
719 AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
720 AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
721 fi
722 fi
723 fi
724 AC_MSG_CHECKING([what configuration name to use])
725 AC_MSG_RESULT([$CONF_NAME])
726
727 BASIC_FIXUP_PATH(OUTPUT_ROOT)
728
729 CONFIGURESUPPORT_OUTPUTDIR="$OUTPUT_ROOT/configure-support"
730 $MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
|