8294549: configure script should detect unsupported path

Co-authored-by: Mike Duigou <mduigou@openjdk.org>
Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2023-11-27 14:52:42 +00:00
parent 4977922a3f
commit a006d7eae0
2 changed files with 15 additions and 5 deletions

12
configure vendored
View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -26,10 +26,14 @@
# make sure that is called using bash.
# Get an absolute path to this script, since that determines the top-level directory.
this_script_dir=`dirname $0`
this_script_dir=`cd $this_script_dir > /dev/null && pwd`
source_path="$(dirname ${0})"
this_script_dir="$(cd -- "${source_path}" > /dev/null && pwd)"
if test -z "${this_script_dir}"; then
echo "Error: Could not determine location of configure script"
exit 1
fi
# Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c.
# This trick is needed to get autoconf to co-operate properly.
# The ${-:+-$-} construction passes on bash options.
bash ${-:+-$-} -c ". $this_script_dir/make/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@"
bash ${-:+-$-} -c ". \"${this_script_dir}/make/autoconf/configure\"" "${this_script_dir}/configure" CHECKME "${this_script_dir}" "$@"

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -39,6 +39,12 @@ if test "x$BASH" = x; then
echo "Error: This script must be run using bash." 1>&2
exit 1
fi
if [[ "$TOPDIR" =~ .*[[:space:]]+.* ]]; then
echo "Error: Build path containing space character is not supported" 1>&2
exit 1
fi
# Force autoconf to use bash. This also means we must disable autoconf re-exec.
export CONFIG_SHELL=$BASH
export _as_can_reexec=no