Skip to content

Commit 75415ad

Browse files
Add check to error out if prefix is not an absolute path
Signed-off-by: Shreyas Khandekar <[email protected]>
1 parent 3d62163 commit 75415ad

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

configure

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,24 @@ rm -f configured-prefix
8282
CONFIGURED=""
8383
if [ "$DEST_DIR_SET" -ne 0 ]
8484
then
85+
case $DEST_DIR in
86+
(/*) pathchk -- "$1";;
87+
(*)
88+
echo "error: expected an absolute directory name for --chpl-home: $DEST_DIR"
89+
exit -1
90+
;;
91+
esac
8592
# Save target installation directory for 'make install' / install.sh
8693
echo "$DEST_DIR" > configured-chpl-home
8794
CONFIGURED=configured-chpl-home
8895
else
96+
case $PREFIX in
97+
(/*) pathchk -- "$1";;
98+
(*)
99+
echo "error: expected an absolute directory name for --prefix: $PREFIX"
100+
exit -1
101+
;;
102+
esac
89103
# Save prefix for building the compiler
90104
echo "$PREFIX" > configured-prefix
91105
CONFIGURED=configured-prefix

0 commit comments

Comments
 (0)