[patch] build shared libraries
Rob Landley
rob at landley.net
Wed Sep 7 02:22:41 UTC 2005
On Tuesday 06 September 2005 07:28, Bernhard Fischer wrote:
> >>I can have a look at it. Allan, if you like, please send me that patch
> >>so we can work on that together.
> >
> >I made a START to a patch, I wanted some feedback (works/fails,
> >good/bad) but I didn't see any yet from Rob.
Haven't had a chance to look at it yet. Spent last night bashing on uniq.c.
> thanks.
> Why do both of you feel the need for a helper standalone.c?
That's my code, he just put it in the makefile.
> I'd simply say something to the effect of (untested):
> APPLET=$(shell echo $(@F) | sed -e "s \.[^\.]*$ ")
> $(CC) $(CFLAGS) -DAPPLET="\"$(APPLET)\"" -Dbb_applet_name="\"$(APPLET)\"" \
> -o $(APPLET) -Wl,-e,$(APPLET)_main $($(APPLET)-obj) $($(APPLET)-libs))
>
> i.e. let's define bb_applet_name and $(APPLET)_full_usage and just set
> the entry point to $(applet)_main instead of the default.
1) I'm not linking in applets.c, so bb_show_usage() is not defined. (And the
applets.c version would be bigger and more complicated than we actually need,
anyway.)
2) If you #define bb_applet_name rather than have it be a variable, then you
need to move verror_msg.c out of the libbb directory and compile a copy in to
each applet. (You also need to do something about copy_file.c and
remove_file.c.) Going there has no benefits I can see.
> 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.
Lemme put it this way:
I can support standalone. Initially I was pondering a shell script that built
every single applet standalone, and then you grab the ones you need, but
since then I figured out "make busybox.links" works before the rest of the
build, and can use that as the list of what to build.
I have yet to figure out how to get the makefile to do even what I can get the
shell script to do, and "cleanly" is a whole different can of worms...
Looking at your example, I'm deeply confused why on earth you would define
bb_applet_name="\"$(APPLET)\"" (nested quotes around a parenthesized variable
expansion that in theory should always yield a single argument anyway, and
that's aside from the issue of whether or not it would be sane for busybox to
produce an applet with a space in its name...?)
> >This only gets one section building, some builds fail, but it's a start
> >to show the possible framework to doing this. I can possibly repeat for
> >shared libs if necessary... if someone can either give me permission to
> >apply buildroot patch#391, or apply it for me (it should be my patch for
> >buildroot for Qt/E)...
I don't play with buildroot. I believe discussion of it belongs on the uclibc
list, since Erik hasn't shown any interest in forking it off to its own list.
(Actually half the reason I'm 540 messages behind on the uclibc list is that
so much of the content was buildroot I stopped reading it. I'm interested in
uclibc, but buildroot is a big makefile and I'm not good with those. I keep
meaning to add a "dogfood" mode to buildroot so it can replace coreutils and
util-linux and such with busybox the way my shellscript-based build system
does, but it's way far down on my todo list...)
Rob
More information about the busybox
mailing list