[BusyBox] cross compiling
Robert P. J. Day
rpjday at mindspring.com
Wed May 5 11:05:41 UTC 2004
On Wed, 5 May 2004, Wolfgang Denk wrote:
> In message <BDCFDAEC07D52A4ABDAC29167EA2BA6D0155EF77 at OTOCLEX.otomelara.it> you wrote:
> >
> > can someone show me how cross compiling Busybox for PowerPC, from an =
> > Intel target?
>
> -> wget http://busybox.net/downloads/busybox-1.00-pre10.tar.bz2
> -> tar jxf busybox-1.00-pre10.tar.bz2
> -> cd busybox-1.00-pre10
> -> make config
> ...
> Do you want to build BusyBox with a Cross Compiler? (USING_CROSS_COMPILER) [N/y/?] y
> Cross Compiler prefix (CROSS_COMPILER_PREFIX) [/usr/i386-linux-uclibc/bin/i386-uclibc-] (NEW) ppc_8xx-
> ...
> -> make
i take a slightly different approach. i have a project that is
constructed from numerous pieces -- kernel, busybox, minit, ppp -- and so
on. the directory structure looks something like this:
proj/
kernel/
busybox/
minit/
ppp/
...
Makefile
each software component directory has the following structure:
busybox/
makefile
busybox-configure.sh
a.config, b.config, c.config, ...
busybox-1.00-pre8/
busybox-1.00-pre9/
busybox-20040427/
...
and so on. so, for each generic component (like busybox), i have a
directory for that component, inside of which i have everything i need to
compile that component using a choice of config file, which version of the
software i want and so on -- total flexibility.
each makefile has to define two targets:
configure:
install:
for busybox, here's part of the makefile:
configure:
(cd $(SUBDIR) ; \
sh ../$(PKG)-configure.sh )
install:
make -C $(SUBDIR) \
CROSS=${CROSS_COMPILE} \
TARGET_ARCH=${TDEARCH} \
install
the configure script is pretty simple:
cp ../busybox.config ./.config
yes '' | make oldconfig
so all i need to do is invoke that makefile with the appropriate CROSS
cross-compile value and TARGET_ARCH, and the busybox source will be
configured and built appropriately.
one of these days, i'll go back and do some cleaning, but this
structure has worked well so far, and you can appreciate the flexibility.
under my busybox/ directory, for example, i will have as many different
config files and source trees as i want, and i should always be able to
select *just* the combination i want for the current build.
thoughts?
rday
currently, i'm using the ELDK 3.0 cross-compiler, so i'll have
CROSS=ppc_8xx-.
More information about the busybox
mailing list