[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] fix building when readline is disabled
From: |
Mike Frysinger |
Subject: |
Re: [patch] fix building when readline is disabled |
Date: |
Tue, 24 Apr 2012 00:00:13 -0400 |
User-agent: |
KMail/1.13.7 (Linux/3.4.0-rc1; KDE/4.6.5; x86_64; ; ) |
On Monday 23 April 2012 20:08:26 Chet Ramey wrote:
> On 4/23/12 7:40 PM, Mike Frysinger wrote:
> > On Monday 23 April 2012 18:57:05 Chet Ramey wrote:
> >> On 4/23/12 12:22 AM, Mike Frysinger wrote:
> >>> if you disable readline, the complete.def code fails to build. simple
> >>> patch below (not sure if it's correct, but at least gets the
> >>> conversation going).
> >>
> >> How did you disable readline? Running configure --disable-readline and
> >> building as usual works for me. You might want to run `make clean'
> >> before rebuilding.
> >
> > i suspect you have readline files still being included and it appears to
> > work.
>
> OK, so you've stripped the local readline copy out of the source tree?
yes
> Then configured it to build with a system readline library installation
> that you remove?
the system doesn't have readline at all
> > let's look at vanilla bash-4.2:
> > $ tar xf bash-4.2.tar.gz
> > $ cd bash-4.2
> > $ ./configure --disable-readline
> > $ make
> > ...
> > rm -f complete.o
> > ./mkbuiltins -D . complete.def
> > gcc -c -DHAVE_CONFIG_H -DSHELL -I. -I.. -I.. -I../include -I../lib -I.
> > -g -O2 complete.c || ( rm -f complete.c ; exit 1 ) rm -f complete.c
> > ...
> >
> > so, let's go into that dir and run it by hand:
> > $ cd builtins
> > $ ./mkbuiltins -D . complete.def
> > $ strace -f -eopen gcc -c -DHAVE_CONFIG_H -DSHELL -I. -I.. -I..
> > -I../include -I../lib -I. -g -O2 complete.c |& grep readline.h ...
> > [pid 12453] open("../lib/readline/readline.h", O_RDONLY|O_NOCTTY) = 4
> > ...
> >
> > if you were to clean out your readline code first, you'd see the build
> > error i'm seeing instead of the local readline code getting implicitly
> > used even though it was explicitly disabled.
>
> What does "clean out your readline code" mean? Disabled means that it
> doesn't end up in the resulting binary, and the bash binary is not linked
> against readline. There aren't any link errors because the builtins are
> in a library, and no other bash code calls any function in complete.c, so
> complete.o is not linked out of libbuiltins.a. What kind of "build error"
> are you seeing?
without a readline.h header available (system or local copy), the build fails.
there's plenty of READLINE and HISTORY ifdefs in the other files, so this looks
like one place that got missed. imo, there should be no attempts to include a
readline header if support is disabled.
-mike
signature.asc
Description: This is a digitally signed message part.
- [patch] fix building when readline is disabled, Mike Frysinger, 2012/04/23
- Re: [patch] fix building when readline is disabled, Chet Ramey, 2012/04/23
- Re: [patch] fix building when readline is disabled, Mike Frysinger, 2012/04/23
- Re: [patch] fix building when readline is disabled, Chet Ramey, 2012/04/23
- Re: [patch] fix building when readline is disabled,
Mike Frysinger <=
- Re: [patch] fix building when readline is disabled, Chet Ramey, 2012/04/24
- Re: [patch] fix building when readline is disabled, Mike Frysinger, 2012/04/24
- Re: [patch] fix building when readline is disabled, Chet Ramey, 2012/04/24
- Re: [patch] fix building when readline is disabled, Mike Frysinger, 2012/04/26