Skip to content

Commit

Permalink
configure: reject out-of-source builds and paths to sources containin…
Browse files Browse the repository at this point in the history
…g spaces
  • Loading branch information
danchr committed Oct 11, 2020
1 parent b493d53 commit 46b45b9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,27 @@ $as_echo "$as_me: WARNING: Please consider upgrading as some ports fail compilin
;;
esac

# Check whether the source location is valid; Tcl does not build in
# locations containing spaces, and we don't support out-of-source
# builds.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in-tree build" >&5
$as_echo_n "checking for in-tree build... " >&6; }
if test "x$srcdir" != "x."; then
as_fn_error $? "failed; out-of-source builds not supported" "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source directory location is valid" >&5
$as_echo_n "checking whether source directory location is valid... " >&6; }
if echo "$ac_abs_confdir" | grep -q ' '; then
as_fn_error $? "failed; path to source directory must not contain spaces" "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
fi

# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
Expand Down
17 changes: 17 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,23 @@ case "$XCODE_VERSION" in
;;
esac

# Check whether the source location is valid; Tcl does not build in
# locations containing spaces, and we don't support out-of-source
# builds.
AC_MSG_CHECKING(for in-tree build)
if test "x$srcdir" != "x."; then
AC_MSG_ERROR([failed; out-of-source builds not supported])
else
AC_MSG_RESULT([ok])
fi

AC_MSG_CHECKING(whether source directory location is valid)
if echo "$ac_abs_confdir" | grep -q ' '; then
AC_MSG_ERROR([failed; path to source directory must not contain spaces])
else
AC_MSG_RESULT([ok])
fi

# Checks for programs.
AC_PROG_CC([clang cc gcc])
AC_PROG_INSTALL
Expand Down

0 comments on commit 46b45b9

Please sign in to comment.