Re: [RFA/gdb-9-branch] Abort configure immediately if building GDB in tree

Simon Marchi
2020-01-17T18:24:41Z

On 2020-01-17 1:15 p.m., Joel Brobecker wrote:
> Hi Simon,
>
> Thanks for the review.
>
>>> +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])
>>
>> Finish the message with a period?
>
> Of course! FWIW, I modeled this to other calls to AC_MSG_ERROR ;-)
>
>> Some people who only know the "./configure && make && make install" recipe
>> might not know how (or that it's even possible) to configure and build in a
>> separate directory, so they'll be stuck there. I think it would be helpful
>> to give an example of how to do that, like:
>>
>> 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 my-gdb-build
>> $ cd my-gdb-build
>> $ ../path/to/gdb-x.y.z/configure [configure args]
>> $ make
>>
>> Otherwise, that looks good to me.
>
> Attached is a revised patch. I chose to use the same sequence as
> the one in gdb/README, just for consistency.

LGTM, thanks!