Skip to content

Commit

Permalink
8294549: configure script should detect unsupported path
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Duigou <[email protected]>
Reviewed-by: erikj
  • Loading branch information
magicus and Mike Duigou committed Nov 27, 2023
1 parent 4977922 commit a006d7e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 8 additions & 4 deletions configure
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}" "$@"
8 changes: 7 additions & 1 deletion make/autoconf/configure
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a006d7e

Please sign in to comment.