[BusyBox] autoconf stuff

Erik Andersen andersen at lineo.com
Wed Jun 13 15:53:33 UTC 2001


On Wed Jun 13, 2001 at 02:20:54PM -0700, Larry Doolittle wrote:
> Erik wrote:
> > Using CML will make supporting multiple OSs quite easy.
> >     Choose your OS:
> >         [X] Linux
> >         [ ] FeeeBsd
> >         [ ] HURD
> >         [ ] <blah>
> 
> This is exactly what autoconf was developed in reaction to.
> The developers assume (and tested on their own machines) that
> Linux has feature A, B, and C, but FreeBSD has feature A, C,
> and D.  What happens when FreeBSD develops feature B?  The

I was not sufficiently clear in my example.  I fully agree that ifdefs should
whenever possible be feature based, not platform based.  In a former job, I had
to work on a product that was riddled with platform based ifdefs and quickly
learned to hate such things.  However there are some platfom specific things in
busybox which really should be hidden when not relevant.  For example, the
pivot_root applet isn't going to be much use on Solaris or on the HURD.  So it
makes sense to only show that option on Linux, using something like

    if [ "$LINUX" = "y" ] ; then
	    bool 'pivot_root'	BB_PIVOT_ROOT
    fi

so then you never even see pivot_root on the hurd or freebsd.  When finished
configuring your system, you will end up with a .config file (which will
replace the current Config.h) which will contain things like
    
    #
    # Archival Utilities
    #
    BB_AR=y
    BB_GUNZIP=y
    BB_GZIP=y
    BB_TAR=n

    #
    # Init Utilities
    #
    BB_INIT=y
    BB_FEATURE_USE_INITTAB=n
    BB_FEATURE_LINUXRC=n
    BB_HALT=y
    BB_REBOOT=y
    BB_POWEROFF=y

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list