[patch] build shared libraries
Rob Landley
rob at landley.net
Wed Sep 7 04:56:55 UTC 2005
On Tuesday 06 September 2005 07:48, Allan Clark wrote:
> >Why do both of you feel the need for a helper standalone.c?
>
> I don't; I did this for simplicity, and assumed that it could be done
> better later if someone wanted. I just worked towards a makefile.
I explained my reasons for this in a previous message.
> >PS:
> >We need a clean list of $(BB_CONFIG_$(APPLET))-obj = whereever/whatever.o
> >and a list of objects -- be they system-libs, e.g. -lm -- or internal --
> >libbb -- or multi-obj applets. Without it, i don't think we can cleanly
> >support the standalone idea. ymmv.
>
> It sould be simple to convert a list of files to a makefile using some
> kind of awk, piping that to "make -f -", but it would save little over
> using a makefile that called out specific targets.
I've fiddled with building lots of stuff. Maybe half the applets can be built
using just one file (whatever the *.c file is for that applet name).
The next largest set of low hanging fruit is applets that need to link with
things like "libcoreutils", which really should be consolidated with libbb.
I really don't see much point in having "locally" shared code; it's either
shared or it isn't shared. (We can always prefix the filenames with
coreutils_ if it makes people feel better. :)
Some things need other libraries; miscutils/dc.c needs "-lm", for example.
If there are any applets that actually need two .c files, then either another
applet needs one of those .c files (so it can go in libbb), or else the
two .c files should probably be consolidated. (Anybody complaining about
this making a .c file too long should either A) try to shrink it, B) look at
"ash.c" until they get a sense of perspective.)
By the way, probably the worst case scenario for a standalone build is
"ash.c". This doesn't come close to building standalone; spits out a ton of
unintelligible errors, and after about half an hour of reading through it I
had to go lie down.
P.S. part of the reason I've dredged standalone back up and put more work
into it recently is it lets us close bug 18. :)
Rob
More information about the busybox
mailing list