Bug 18632 - Don't build readline/libreadline.a, when --with-system-readline is supplied
Summary: Don't build readline/libreadline.a, when --with-system-readline is supplied
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 8.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-07 10:20 UTC by dilyan.palauzov@aegee.org
Modified: 2022-10-21 07:00 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dilyan.palauzov@aegee.org 2015-07-07 10:20:23 UTC
The bundled libreadline is always built, even if the system is ./configure'd --with-system-readline and the build libreadline.a is not used.

Proposed patch:

Fix ./configure.ac not to proceed readline/, when --with-system-readline is provided

diff --git a/configure.ac b/configure.ac
index 159f968..adf6dfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -253,6 +253,12 @@ if test x$with_system_zlib = xyes ; then
   noconfigdirs="$noconfigdirs zlib"
 fi
 
+# Don't compile the bundled readline/libreadline.a if --with-system-readline
+# is provided.
+if test x$with_system_readline = xyes ; then
+  noconfigdirs="$noconfigdirs readline"
+fi
+
 # some tools are so dependent upon X11 that if we're not building with X, 
 # it's not even worth trying to configure, much less build, that tool.
Comment 1 Tom Tromey 2018-09-26 12:04:09 UTC
This seems good, but since the top-level configury is canonically maintained
in gcc, the patch should go to gcc-patches.
Comment 2 dilyan.palauzov@aegee.org 2018-10-24 15:17:42 UTC
GCC do not use readline, why shall it integrate this snippet?
Comment 3 Tom Tromey 2018-10-24 18:41:11 UTC
(In reply to dilyan.palauzov@aegee.org from comment #2)
> GCC do not use readline, why shall it integrate this snippet?

The top-level configure+Makefile code is maintained in the
gcc repository, then sync'd over to binutils-gdb.
So even though gcc doesn't use this, it has this code in it.
Comment 4 dilyan.palauzov@aegee.org 2018-10-24 19:43:08 UTC
I submitted https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87741 .
Comment 6 Tom Tromey 2018-12-11 21:29:24 UTC
Ok, sorry about that.
My understand has long been that changes should be made in gcc
and then sync'd to gdb -- and that bidirectional syncing was
to be avoided.  It seems gcc disagrees :-)

Can you send your patches to gdb-patches, then?
See the gdb contribution checklist:
https://sourceware.org/gdb/wiki/ContributionChecklist
Comment 7 Tom Tromey 2019-01-10 15:28:35 UTC
I believe this fix was checked in.
Comment 8 Andrew Pinski 2021-08-26 05:58:34 UTC
(In reply to Tom Tromey from comment #7)
> I believe this fix was checked in.

Yes
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;f=configure.ac;h=69961a84c9b3744a10248fb6cbccc3c688a1e0a5
Comment 9 Tom de Vries 2022-10-20 09:14:43 UTC
Unfixed by commit 228cf97dd3c ("Merge configure.ac from gcc project").
Comment 10 Tom de Vries 2022-10-20 15:06:37 UTC
Reapplied in gdb.  Now let's not close this one before we've propagated to gcc.
Comment 11 Tom de Vries 2022-10-21 07:00:28 UTC
(In reply to Tom de Vries from comment #10)
> Reapplied in gdb.  Now let's not close this one before we've propagated to
> gcc.

Done: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=36ba985145ffa8e2078033fc1f1cf22851707a8e

Marking fixed again.  Keeping milestone 8.3 because releases are not affected.