Deprecate in-source autotools builds
authorJonathan Roelofs <jonathan@codesourcery.com>
Mon, 4 May 2015 02:04:54 +0000 (02:04 +0000)
committerJonathan Roelofs <jonathan@codesourcery.com>
Mon, 4 May 2015 02:04:54 +0000 (02:04 +0000)
This is a followup from:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150323/268067.html

Upgrade instructions:
  $ mv llvm/include/llvm/Config/config.h ./config.h.BACKUP
  # copy the configure line from line 7 of llvm/config.log
  # (for example: `$ ./configure --no-create --no-recursion`)
  $ mkdir build
  $ cd build
  # run the configure line, but this time with '../llvm' at the beginning:
  $ ../llvm/configure --no-create --no-recursion

These warnings will soon be turned into hard errors after a week.  Speak up now
if this is going to be a problem for you.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236399 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.config.in
autoconf/configure.ac
configure

index a4d641040f336a781264be1d3433d28164ba887a..7af5d3c90200f2ce1f89d5ea27fd4950af708fab 100644 (file)
@@ -58,6 +58,22 @@ LLVM_OBJ_ROOT   := $(call realpath, @abs_top_builddir@)
 PROJ_SRC_ROOT   := $(LLVM_SRC_ROOT)
 PROJ_SRC_DIR    := $(LLVM_SRC_ROOT)$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))
 
+# FIXME: This is temporary during the grace period where in-source builds are
+# deprecated. Convert to a hard error when that period is up.
+#
+# See: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150323/268067.html
+ifeq ($(LLVM_SRC_ROOT), $(LLVM_OBJ_ROOT))
+  $(warning ######################################################################################)
+  $(warning #                                                                                    #)
+  $(warning #                                   WARNING                                          #)
+  $(warning #                                                                                    #)
+  $(warning #                        In-source builds are deprecated.                            #)
+  $(warning #                                                                                    #)
+  $(warning #               Please configure from a separate build directory!                    #)
+  $(warning #                                                                                    #)
+  $(warning ######################################################################################)
+endif
+
 ifneq ($(CLANG_SRC_ROOT),)
   CLANG_SRC_ROOT:= $(call realpath, $(CLANG_SRC_ROOT))
   PROJ_SRC_DIR  := $(patsubst $(LLVM_SRC_ROOT)/tools/clang%,$(CLANG_SRC_ROOT)%,$(PROJ_SRC_DIR))
index 39ce9f353ee30792c2611e7fdd200db10b172e4f..586f3f26cb313ba5aa00d6f8b8c1508ad11cffac 100644 (file)
@@ -73,6 +73,19 @@ if test ${srcdir} != "." ; then
   fi
 fi
 
+dnl Quit if it is an in-source build
+if test ${srcdir} == "." ; then
+  AC_MSG_WARN([**************************************************************************************])
+  AC_MSG_WARN([*                                                                                    *])
+  AC_MSG_WARN([*                                   WARNING                                          *])
+  AC_MSG_WARN([*                                                                                    *])
+  AC_MSG_WARN([*                        In-source builds are deprecated.                            *])
+  AC_MSG_WARN([*                                                                                    *])
+  AC_MSG_WARN([*               Please configure from a separate build directory!                    *])
+  AC_MSG_WARN([*                                                                                    *])
+  AC_MSG_WARN([**************************************************************************************])
+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=}
index f51617639b3f9bb36ccbfbb374e8e063b20bc218..37f3d7d95ae66434f7480c85fd1b749291886b18 100755 (executable)
--- a/configure
+++ b/configure
@@ -2030,6 +2030,27 @@ echo "$as_me: error: Already configured in ${srcdir}" >&2;}
   fi
 fi
 
+if test ${srcdir} == "." ; then
+  { echo "$as_me:$LINENO: WARNING: **************************************************************************************" >&5
+echo "$as_me: WARNING: **************************************************************************************" >&2;}
+  { echo "$as_me:$LINENO: WARNING: *                                                                                    *" >&5
+echo "$as_me: WARNING: *                                                                                    *" >&2;}
+  { echo "$as_me:$LINENO: WARNING: *                                   WARNING                                          *" >&5
+echo "$as_me: WARNING: *                                   WARNING                                          *" >&2;}
+  { echo "$as_me:$LINENO: WARNING: *                                                                                    *" >&5
+echo "$as_me: WARNING: *                                                                                    *" >&2;}
+  { echo "$as_me:$LINENO: WARNING: *                        In-source builds are deprecated.                            *" >&5
+echo "$as_me: WARNING: *                        In-source builds are deprecated.                            *" >&2;}
+  { echo "$as_me:$LINENO: WARNING: *                                                                                    *" >&5
+echo "$as_me: WARNING: *                                                                                    *" >&2;}
+  { echo "$as_me:$LINENO: WARNING: *               Please configure from a separate build directory!                    *" >&5
+echo "$as_me: WARNING: *               Please configure from a separate build directory!                    *" >&2;}
+  { echo "$as_me:$LINENO: WARNING: *                                                                                    *" >&5
+echo "$as_me: WARNING: *                                                                                    *" >&2;}
+  { echo "$as_me:$LINENO: WARNING: **************************************************************************************" >&5
+echo "$as_me: WARNING: **************************************************************************************" >&2;}
+fi
+
 : ${CFLAGS=}
 : ${CXXFLAGS=}