Skip to content

Commit d52bf35

Browse files
authored
Merge pull request #8128 from jsquyres/pr/in-space-no-one-hears-you-scream
Check for spaces in prefix, srcdir, and builddir
2 parents 9afcb8e + 8841b12 commit d52bf35

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

config/opal_get_version.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ m4_define([OPAL_GET_VERSION],[
8383
if test -d "$srcdir/.git" && test $git_happy -eq 1; then
8484
if test "$srcdir" != "`pwd`"; then
8585
git_save_dir=`pwd`
86-
cd $srcdir
86+
cd "$srcdir"
8787
$2_REPO_REV=`git describe --tags --always`
88-
cd $git_save_dir
88+
cd "$git_save_dir"
8989
unset git_save_dir
9090
else
9191
$2_REPO_REV=`git describe --tags --always`

configure.ac

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@ AM_SILENT_RULES([yes])
117117
# Make configure depend on the VERSION file, since it's used in AC_INIT
118118
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
119119

120+
# Sanity checks
121+
AC_DEFUN([OMPI_CHECK_DIR_FOR_SPACES],[
122+
dir="$1"
123+
article="$2"
124+
label="$3"
125+
126+
AC_MSG_CHECKING([directory of $label])
127+
AC_MSG_RESULT([$dir])
128+
AS_IF([test -n "`echo $dir | grep ' '`"],
129+
[AC_MSG_WARN([This version of Open MPI does not support $article $label])
130+
AC_MSG_WARN([with a path that contains spaces])
131+
AC_MSG_ERROR([Cannot continue.])])
132+
])
133+
134+
OMPI_CHECK_DIR_FOR_SPACES([$srcdir], [a], [source tree])
135+
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f $srcdir`], [an], [absolute source tree])
136+
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f .`], [a], [build tree])
137+
OMPI_CHECK_DIR_FOR_SPACES([$prefix], [a], [prefix])
138+
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f $prefix`], [an], [absolute prefix])
139+
120140
opal_show_subtitle "Checking versions"
121141

122142
# Get the version of OMPI that we are installing

0 commit comments

Comments
 (0)