Skip to content

Commit a006d7e

Browse files
magicusMike Duigou
and
Mike Duigou
committed
8294549: configure script should detect unsupported path
Co-authored-by: Mike Duigou <[email protected]> Reviewed-by: erikj
1 parent 4977922 commit a006d7e

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

configure

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,14 @@
2626
# make sure that is called using bash.
2727

2828
# Get an absolute path to this script, since that determines the top-level directory.
29-
this_script_dir=`dirname $0`
30-
this_script_dir=`cd $this_script_dir > /dev/null && pwd`
29+
source_path="$(dirname ${0})"
30+
this_script_dir="$(cd -- "${source_path}" > /dev/null && pwd)"
31+
if test -z "${this_script_dir}"; then
32+
echo "Error: Could not determine location of configure script"
33+
exit 1
34+
fi
3135

3236
# Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c.
3337
# This trick is needed to get autoconf to co-operate properly.
3438
# The ${-:+-$-} construction passes on bash options.
35-
bash ${-:+-$-} -c ". $this_script_dir/make/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@"
39+
bash ${-:+-$-} -c ". \"${this_script_dir}/make/autoconf/configure\"" "${this_script_dir}/configure" CHECKME "${this_script_dir}" "$@"

make/autoconf/configure

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

0 commit comments

Comments
 (0)