7455 |
7458 |
7456 |
7459 |
7457 # Check whether --with-tools-dir was given. |
7460 # Check whether --with-tools-dir was given. |
7458 if test "${with_tools_dir+set}" = set; then : |
7461 if test "${with_tools_dir+set}" = set; then : |
7459 withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir |
7462 withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir |
|
7463 |
|
7464 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then |
|
7465 |
|
7466 # Input might be given as Windows format, start by converting to |
|
7467 # unix format. |
|
7468 path="$TOOLS_DIR" |
|
7469 new_path=`$CYGPATH -u "$path"` |
|
7470 |
|
7471 # Cygwin tries to hide some aspects of the Windows file system, such that binaries are |
|
7472 # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered |
|
7473 # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then |
|
7474 # "foo.exe" is OK but "foo" is an error. |
|
7475 # |
|
7476 # This test is therefore slightly more accurate than "test -f" to check for file precense. |
|
7477 # It is also a way to make sure we got the proper file name for the real test later on. |
|
7478 test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` |
|
7479 if test "x$test_shortpath" = x; then |
|
7480 { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&5 |
|
7481 $as_echo "$as_me: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&6;} |
|
7482 as_fn_error $? "Cannot locate the the path of TOOLS_DIR" "$LINENO" 5 |
|
7483 fi |
|
7484 |
|
7485 # Call helper function which possibly converts this using DOS-style short mode. |
|
7486 # If so, the updated path is stored in $new_path. |
|
7487 |
|
7488 input_path="$new_path" |
|
7489 # Check if we need to convert this using DOS-style short mode. If the path |
|
7490 # contains just simple characters, use it. Otherwise (spaces, weird characters), |
|
7491 # take no chances and rewrite it. |
|
7492 # Note: m4 eats our [], so we need to use [ and ] instead. |
|
7493 has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` |
|
7494 if test "x$has_forbidden_chars" != x; then |
|
7495 # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) |
|
7496 shortmode_path=`$CYGPATH -s -m -a "$input_path"` |
|
7497 path_after_shortmode=`$CYGPATH -u "$shortmode_path"` |
|
7498 if test "x$path_after_shortmode" != "x$input_to_shortpath"; then |
|
7499 # Going to short mode and back again did indeed matter. Since short mode is |
|
7500 # case insensitive, let's make it lowercase to improve readability. |
|
7501 shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
|
7502 # Now convert it back to Unix-stile (cygpath) |
|
7503 input_path=`$CYGPATH -u "$shortmode_path"` |
|
7504 new_path="$input_path" |
|
7505 fi |
|
7506 fi |
|
7507 |
|
7508 test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` |
|
7509 if test "x$test_cygdrive_prefix" = x; then |
|
7510 # As a simple fix, exclude /usr/bin since it's not a real path. |
|
7511 if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then |
|
7512 # The path is in a Cygwin special directory (e.g. /home). We need this converted to |
|
7513 # a path prefixed by /cygdrive for fixpath to work. |
|
7514 new_path="$CYGWIN_ROOT_PATH$input_path" |
|
7515 fi |
|
7516 fi |
|
7517 |
|
7518 |
|
7519 if test "x$path" != "x$new_path"; then |
|
7520 TOOLS_DIR="$new_path" |
|
7521 { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOOLS_DIR to \"$new_path\"" >&5 |
|
7522 $as_echo "$as_me: Rewriting TOOLS_DIR to \"$new_path\"" >&6;} |
|
7523 fi |
|
7524 |
|
7525 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
|
7526 |
|
7527 path="$TOOLS_DIR" |
|
7528 has_colon=`$ECHO $path | $GREP ^.:` |
|
7529 new_path="$path" |
|
7530 if test "x$has_colon" = x; then |
|
7531 # Not in mixed or Windows style, start by that. |
|
7532 new_path=`cmd //c echo $path` |
|
7533 fi |
|
7534 |
|
7535 |
|
7536 input_path="$new_path" |
|
7537 # Check if we need to convert this using DOS-style short mode. If the path |
|
7538 # contains just simple characters, use it. Otherwise (spaces, weird characters), |
|
7539 # take no chances and rewrite it. |
|
7540 # Note: m4 eats our [], so we need to use [ and ] instead. |
|
7541 has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` |
|
7542 if test "x$has_forbidden_chars" != x; then |
|
7543 # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) |
|
7544 new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
|
7545 fi |
|
7546 |
|
7547 |
|
7548 windows_path="$new_path" |
|
7549 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then |
|
7550 unix_path=`$CYGPATH -u "$windows_path"` |
|
7551 new_path="$unix_path" |
|
7552 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
|
7553 unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` |
|
7554 new_path="$unix_path" |
|
7555 fi |
|
7556 |
|
7557 if test "x$path" != "x$new_path"; then |
|
7558 TOOLS_DIR="$new_path" |
|
7559 { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOOLS_DIR to \"$new_path\"" >&5 |
|
7560 $as_echo "$as_me: Rewriting TOOLS_DIR to \"$new_path\"" >&6;} |
|
7561 fi |
|
7562 |
|
7563 # Save the first 10 bytes of this path to the storage, so fixpath can work. |
|
7564 all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") |
|
7565 |
|
7566 else |
|
7567 # We're on a posix platform. Hooray! :) |
|
7568 path="$TOOLS_DIR" |
|
7569 has_space=`$ECHO "$path" | $GREP " "` |
|
7570 if test "x$has_space" != x; then |
|
7571 { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&5 |
|
7572 $as_echo "$as_me: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&6;} |
|
7573 as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 |
|
7574 fi |
|
7575 |
|
7576 # Use eval to expand a potential ~ |
|
7577 eval path="$path" |
|
7578 if test ! -f "$path" && test ! -d "$path"; then |
|
7579 as_fn_error $? "The path of TOOLS_DIR, which resolves as \"$path\", is not found." "$LINENO" 5 |
|
7580 fi |
|
7581 |
|
7582 TOOLS_DIR="`cd "$path"; $THEPWDCMD -L`" |
|
7583 fi |
|
7584 |
|
7585 |
7460 fi |
7586 fi |
7461 |
7587 |
7462 |
7588 |
7463 |
7589 |
7464 # Check whether --with-devkit was given. |
7590 # Check whether --with-devkit was given. |
7465 if test "${with_devkit+set}" = set; then : |
7591 if test "${with_devkit+set}" = set; then : |
7466 withval=$with_devkit; |
7592 withval=$with_devkit; |
7467 if test "x$with_sys_root" != x; then |
7593 if test "x$with_sys_root" != x; then |
7468 as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5 |
7594 as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5 |
7469 fi |
7595 fi |
7470 if test "x$with_tools_dir" != x; then |
7596 |
7471 as_fn_error $? "Cannot specify both --with-devkit and --with-tools-dir at the same time" "$LINENO" 5 |
7597 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then |
7472 fi |
7598 |
7473 TOOLS_DIR=$with_devkit/bin |
7599 # Input might be given as Windows format, start by converting to |
|
7600 # unix format. |
|
7601 path="$with_devkit" |
|
7602 new_path=`$CYGPATH -u "$path"` |
|
7603 |
|
7604 # Cygwin tries to hide some aspects of the Windows file system, such that binaries are |
|
7605 # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered |
|
7606 # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then |
|
7607 # "foo.exe" is OK but "foo" is an error. |
|
7608 # |
|
7609 # This test is therefore slightly more accurate than "test -f" to check for file precense. |
|
7610 # It is also a way to make sure we got the proper file name for the real test later on. |
|
7611 test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` |
|
7612 if test "x$test_shortpath" = x; then |
|
7613 { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 |
|
7614 $as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;} |
|
7615 as_fn_error $? "Cannot locate the the path of with_devkit" "$LINENO" 5 |
|
7616 fi |
|
7617 |
|
7618 # Call helper function which possibly converts this using DOS-style short mode. |
|
7619 # If so, the updated path is stored in $new_path. |
|
7620 |
|
7621 input_path="$new_path" |
|
7622 # Check if we need to convert this using DOS-style short mode. If the path |
|
7623 # contains just simple characters, use it. Otherwise (spaces, weird characters), |
|
7624 # take no chances and rewrite it. |
|
7625 # Note: m4 eats our [], so we need to use [ and ] instead. |
|
7626 has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` |
|
7627 if test "x$has_forbidden_chars" != x; then |
|
7628 # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) |
|
7629 shortmode_path=`$CYGPATH -s -m -a "$input_path"` |
|
7630 path_after_shortmode=`$CYGPATH -u "$shortmode_path"` |
|
7631 if test "x$path_after_shortmode" != "x$input_to_shortpath"; then |
|
7632 # Going to short mode and back again did indeed matter. Since short mode is |
|
7633 # case insensitive, let's make it lowercase to improve readability. |
|
7634 shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
|
7635 # Now convert it back to Unix-stile (cygpath) |
|
7636 input_path=`$CYGPATH -u "$shortmode_path"` |
|
7637 new_path="$input_path" |
|
7638 fi |
|
7639 fi |
|
7640 |
|
7641 test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` |
|
7642 if test "x$test_cygdrive_prefix" = x; then |
|
7643 # As a simple fix, exclude /usr/bin since it's not a real path. |
|
7644 if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then |
|
7645 # The path is in a Cygwin special directory (e.g. /home). We need this converted to |
|
7646 # a path prefixed by /cygdrive for fixpath to work. |
|
7647 new_path="$CYGWIN_ROOT_PATH$input_path" |
|
7648 fi |
|
7649 fi |
|
7650 |
|
7651 |
|
7652 if test "x$path" != "x$new_path"; then |
|
7653 with_devkit="$new_path" |
|
7654 { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5 |
|
7655 $as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} |
|
7656 fi |
|
7657 |
|
7658 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
|
7659 |
|
7660 path="$with_devkit" |
|
7661 has_colon=`$ECHO $path | $GREP ^.:` |
|
7662 new_path="$path" |
|
7663 if test "x$has_colon" = x; then |
|
7664 # Not in mixed or Windows style, start by that. |
|
7665 new_path=`cmd //c echo $path` |
|
7666 fi |
|
7667 |
|
7668 |
|
7669 input_path="$new_path" |
|
7670 # Check if we need to convert this using DOS-style short mode. If the path |
|
7671 # contains just simple characters, use it. Otherwise (spaces, weird characters), |
|
7672 # take no chances and rewrite it. |
|
7673 # Note: m4 eats our [], so we need to use [ and ] instead. |
|
7674 has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` |
|
7675 if test "x$has_forbidden_chars" != x; then |
|
7676 # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) |
|
7677 new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
|
7678 fi |
|
7679 |
|
7680 |
|
7681 windows_path="$new_path" |
|
7682 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then |
|
7683 unix_path=`$CYGPATH -u "$windows_path"` |
|
7684 new_path="$unix_path" |
|
7685 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
|
7686 unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` |
|
7687 new_path="$unix_path" |
|
7688 fi |
|
7689 |
|
7690 if test "x$path" != "x$new_path"; then |
|
7691 with_devkit="$new_path" |
|
7692 { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5 |
|
7693 $as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} |
|
7694 fi |
|
7695 |
|
7696 # Save the first 10 bytes of this path to the storage, so fixpath can work. |
|
7697 all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") |
|
7698 |
|
7699 else |
|
7700 # We're on a posix platform. Hooray! :) |
|
7701 path="$with_devkit" |
|
7702 has_space=`$ECHO "$path" | $GREP " "` |
|
7703 if test "x$has_space" != x; then |
|
7704 { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 |
|
7705 $as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;} |
|
7706 as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 |
|
7707 fi |
|
7708 |
|
7709 # Use eval to expand a potential ~ |
|
7710 eval path="$path" |
|
7711 if test ! -f "$path" && test ! -d "$path"; then |
|
7712 as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5 |
|
7713 fi |
|
7714 |
|
7715 with_devkit="`cd "$path"; $THEPWDCMD -L`" |
|
7716 fi |
|
7717 |
|
7718 |
|
7719 if test "x$TOOLS_DIR" = x; then |
|
7720 TOOLS_DIR="$with_devkit/bin" |
|
7721 else |
|
7722 TOOLS_DIR="$TOOLS_DIR:$with_devkit/bin" |
|
7723 fi |
|
7724 |
7474 if test -d "$with_devkit/$host_alias/libc"; then |
7725 if test -d "$with_devkit/$host_alias/libc"; then |
7475 SYS_ROOT=$with_devkit/$host_alias/libc |
7726 SYS_ROOT=$with_devkit/$host_alias/libc |
7476 elif test -d "$with_devkit/$host/sys-root"; then |
7727 elif test -d "$with_devkit/$host/sys-root"; then |
7477 SYS_ROOT=$with_devkit/$host/sys-root |
7728 SYS_ROOT=$with_devkit/$host/sys-root |
7478 fi |
7729 fi |
7479 |
7730 |
7480 fi |
7731 fi |
7481 |
|
7482 |
7732 |
7483 |
7733 |
7484 |
7734 |
7485 # Setup default logging of stdout and stderr to build.log in the output root. |
7735 # Setup default logging of stdout and stderr to build.log in the output root. |
7486 BUILD_LOG='$(OUTPUT_ROOT)/build.log' |
7736 BUILD_LOG='$(OUTPUT_ROOT)/build.log' |