autoconf
[Top][All Lists]
Advanced

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

Re: configure busybox


From: Steve M. Robbins
Subject: Re: configure busybox
Date: Thu, 20 Sep 2001 10:04:10 -0400
User-agent: Mutt/1.3.22i

Hello Glenn,

On Thu, Sep 20, 2001 at 02:53:03PM +1000, Glenn McGrath wrote:

> 1) all libbb files are compiled, however some have system calls that
> obviously depend on the linux kernel (and other portability problems),
> there needs to be a way to only compile functions that will work on the
> target machine.

That is really autoconf's raison d'etre.  

Using AC_CHECK_FUNCS(f1 f2 f3 ...) in configure.ac, you end up with a
bunch of preprocessor symbols defined in config.h.  You can use them
as follows in the libbb sources.

        #if HAVE_F1
        ... code that uses function f1()
        #else
        ... ?
        #endif


> 2) Config.h assumes that libbb is fully functional and therefore any of the
> commands will compile, however functions that may be required to compile a
> specific command may not have been compiled in libbb and may be missing. It
> would be good if a Config.h could be generated  that only lists commands
> that are compilable, then the user could manually select what they want
> (and will work) prior to making it.

Without looking at busybox, I can't be sure how much work it will be
to implement what you suggest.  It sounds like you would need to keep
track of which libbb functions are needed to compile each "command",
which could get a bit heavy to maintain.  If you want to go this
route, you could use the "HAVE_F1" symbols again, or perhaps
automake's conditionals if you need conditionals in the makefile.

You may be able to get a similar effect for less work.  For example,
if you do nothing the link will just fail when libbb is missing a
required functionality.  ;-)

-Steve

-- 
by Rocket to the Moon,
by Airplane to the Rocket,
by Taxi to the Airport,
by Frontdoor to the Taxi,
by throwing back the blanket and laying down the legs ...
- They Might Be Giants




reply via email to

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