Skip to content

Commit

Permalink
Discourage in-source autoconf builds (as we already do for the cmake …
Browse files Browse the repository at this point in the history
…build)

http://reviews.llvm.org/D7961


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230812 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
jroelofs committed Feb 27, 2015
1 parent 88bbdc7 commit dcd2094
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ if test ${srcdir} != "." ; then
fi
fi

dnl Quit if it is an in-source build
if test ${srcdir} == "." ; then
AC_MSG_ERROR([In-source builds are discouraged. Configure from a separate build directory.])
fi

dnl Default to empty (i.e. assigning the null string to) CFLAGS and CXXFLAGS,
dnl instead of the autoconf default (for example, '-g -O2' for CC=gcc).
: ${CFLAGS=}
Expand Down
6 changes: 6 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,12 @@ echo "$as_me: error: Already configured in ${srcdir}" >&2;}
fi
fi

if test ${srcdir} == "." ; then
{ { echo "$as_me:$LINENO: error: In-source builds are discouraged. Configure from a separate build directory." >&5
echo "$as_me: error: In-source builds are discouraged. Configure from a separate build directory." >&2;}
{ (exit 1); exit 1; }; }
fi

: ${CFLAGS=}
: ${CXXFLAGS=}

Expand Down

0 comments on commit dcd2094

Please sign in to comment.