[PATCH] Discourage in-source autoconf builds (as we already do for the cmake build)

Jonathan Roelofs jonathan at codesourcery.com
Fri Feb 27 15:34:38 PST 2015


@echristo twisted my arm... so I built the appropriate autoconf/automake, and generated a new configure. Also discarded the Makefile.config.in change.


http://reviews.llvm.org/D7961

Files:
  autoconf/configure.ac
  configure

Index: autoconf/configure.ac
===================================================================
--- autoconf/configure.ac
+++ autoconf/configure.ac
@@ -73,6 +73,11 @@
   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=}
Index: configure
===================================================================
--- configure
+++ configure
@@ -1999,6 +1999,12 @@
   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=}

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7961.20907.patch
Type: text/x-patch
Size: 991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150227/72d50db2/attachment.bin>


More information about the llvm-commits mailing list