[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] fix building when readline is disabled

From: Chet Ramey
Subject: Re: [patch] fix building when readline is disabled
Date: Mon, 23 Apr 2012 20:08:26 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

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?
Then configured it to build with a system readline library installation
that you remove?

> 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?

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]