cross-compilation documentation
Daniel Jacobowitz
drow@mvista.com
Mon Jun 23 13:01:00 GMT 2003
On Sun, Jun 22, 2003 at 10:59:52PM -0400, Peter Barada wrote:
>
> >Well, sure! My script at http://kegel.com/crosstool does this:
> >1) configure glibc and do 'make install-headers'; a wee bit of hackery
> > circumvents its urge to build everything
> >2) build and install bootstrap compiler
> >3) build and install real glibc
> >4) build and install real gcc
> >
> >My step #1 isn't pretty, but it only takes a couple minutes, and I'm
> >sure it's faster than what you described. I thought you knew about
> >that already...
>
> Yes I did. I use the following Makefile fragment to get the headers:
>
> glibc1: ${GLIBC_BUILDDIR1} glibc1-fix
> export PATH=${INSTALL_DIR}/bin:${HOST_INSTALL_DIR}/bin:$$PATH; \
> cd ${GLIBC_BUILDDIR1}; \
> CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \
> ${GLIBC_SOURCE_PATH}/configure --host=${TARGET} \
> --prefix=/usr --without-cvs --disable-sanity-checks \
> --with-headers=${INSTALL_DIR}/${TARGET}/include ; \
> make cross-compiling=yes install_root=${INSTALL_DIR}/${TARGET} prefix="" install-headers
>
> glibc1-fix:
> mkdir -p ${INSTALL_DIR}/${TARGET}/include/gnu ; \
> touch ${INSTALL_DIR}/${TARGET}/include/gnu/stubs.h ; \
> cp -f ${GLIBC_SOURCE_PATH}/include/features.h ${INSTALL_DIR}/include/features.h
>
>
> But this fragment *requires* a cross-compiler to build it. I'm sure I
Not really. I do it with a sufficiently new native compiler to run
configure. Configure determines $target by the command line arguments,
not by querying the $CC you specify.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Gcc
mailing list