Abort configure immediately if building GDB in tree
authorJoel Brobecker <brobecker@adacore.com>
Fri, 17 Jan 2020 18:30:39 +0000 (19:30 +0100)
committerJoel Brobecker <brobecker@adacore.com>
Fri, 17 Jan 2020 18:30:39 +0000 (19:30 +0100)
The move of gnulib to the top src directory is causing the GDB build
to break if configured in tree. We hope to lift that limitation at
some point but, in the meantime, this commit allows us to abort
the initial configure right away with a clear error message should
the user attempt to build in tree.

ChangeLog:

        * configure.ac: Abort the build with an error if trying to build
        GDB in tree.
        * configure: Regenerate.

ChangeLog
configure
configure.ac

index 8c6046634562093f8954794eda07d0b9e84185c5..0bfe9898853694206c58144f78fb39d0c7208247 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-01-17  Joel Brobecker  <brobecker@adacore.com>
+
+       * configure.ac: Abort the build with an error if trying to build
+       GDB in tree.
+       * configure: Regenerate.
+
 2019-10-17  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        * src-release.sh (GDB_SUPPORT_DIRS): Add libctf.
index 6a9719f60911b43a61f13bb2a267cf21941ebd84..7168a4e90e0df2cb0d4d9e74f6d83195f277601d 100755 (executable)
--- a/configure
+++ b/configure
@@ -2279,6 +2279,23 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+if test x"${enable_gdb}" != x"no"; then
+  # For this branch, we do not support building GDB in-tree.
+  # Try to detect whether we are in this situation or not by
+  # searching for a couple of known files in the source directory.
+  if test -f gnulib/update-gnulib.sh -a -f gdb/ChangeLog; then
+    as_fn_error $? "GDB must be configured and built in a directory separate from its sources.
+
+To do so, create a dedicated directory for your GDB build and invoke
+the configure script from that directory:
+
+      $ mkdir build
+      $ cd build
+      $ <full path to your sources>/gdb-VERSION/configure [etc...]
+      $ make" "$LINENO" 5
+  fi
+fi
+
 progname=$0
 # if PWD already has a value, it is probably wrong.
 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
index 7433badc217f06710d5aa4ebaf580a0b2d00e5ce..e5ca1eaa57a30ab6f63e3c06b2503e8f19f050ff 100644 (file)
@@ -33,6 +33,23 @@ m4_include([config/isl.m4])
 AC_INIT(move-if-change)
 AC_DISABLE_OPTION_CHECKING
 
+if test x"${enable_gdb}" != x"no"; then
+  # For this branch, we do not support building GDB in-tree.
+  # Try to detect whether we are in this situation or not by
+  # searching for a couple of known files in the source directory.
+  if test -f gnulib/update-gnulib.sh -a -f gdb/ChangeLog; then
+    AC_MSG_ERROR([GDB must be configured and built in a directory separate from its sources.
+
+To do so, create a dedicated directory for your GDB build and invoke
+the configure script from that directory:
+
+      $ mkdir build
+      $ cd build
+      $ <full path to your sources>/gdb-VERSION/configure [[etc...]]
+      $ make])
+  fi
+fi
+
 progname=$0
 # if PWD already has a value, it is probably wrong.
 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
This page took 0.036297 seconds and 4 git commands to generate.