Skip to content

Commit 46b45b9

Browse files
committed
configure: reject out-of-source builds and paths to sources containing spaces
1 parent b493d53 commit 46b45b9

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

configure

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,6 +2845,27 @@ $as_echo "$as_me: WARNING: Please consider upgrading as some ports fail compilin
28452845
;;
28462846
esac
28472847

2848+
# Check whether the source location is valid; Tcl does not build in
2849+
# locations containing spaces, and we don't support out-of-source
2850+
# builds.
2851+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in-tree build" >&5
2852+
$as_echo_n "checking for in-tree build... " >&6; }
2853+
if test "x$srcdir" != "x."; then
2854+
as_fn_error $? "failed; out-of-source builds not supported" "$LINENO" 5
2855+
else
2856+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
2857+
$as_echo "ok" >&6; }
2858+
fi
2859+
2860+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source directory location is valid" >&5
2861+
$as_echo_n "checking whether source directory location is valid... " >&6; }
2862+
if echo "$ac_abs_confdir" | grep -q ' '; then
2863+
as_fn_error $? "failed; path to source directory must not contain spaces" "$LINENO" 5
2864+
else
2865+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
2866+
$as_echo "ok" >&6; }
2867+
fi
2868+
28482869
# Checks for programs.
28492870
ac_ext=c
28502871
ac_cpp='$CPP $CPPFLAGS'

configure.ac

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ case "$XCODE_VERSION" in
105105
;;
106106
esac
107107

108+
# Check whether the source location is valid; Tcl does not build in
109+
# locations containing spaces, and we don't support out-of-source
110+
# builds.
111+
AC_MSG_CHECKING(for in-tree build)
112+
if test "x$srcdir" != "x."; then
113+
AC_MSG_ERROR([failed; out-of-source builds not supported])
114+
else
115+
AC_MSG_RESULT([ok])
116+
fi
117+
118+
AC_MSG_CHECKING(whether source directory location is valid)
119+
if echo "$ac_abs_confdir" | grep -q ' '; then
120+
AC_MSG_ERROR([failed; path to source directory must not contain spaces])
121+
else
122+
AC_MSG_RESULT([ok])
123+
fi
124+
108125
# Checks for programs.
109126
AC_PROG_CC([clang cc gcc])
110127
AC_PROG_INSTALL

0 commit comments

Comments
 (0)