This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Anyone cross-bootstrap a GCC compiler onto a linux board?


Peter Barada wrote:
... I'm thinking this would be an easier approach
than having to hack up software packages Makefiles to get them to
cross-compile.

Everybody says that, but the fact is, you *don't* have to hack up their Makefiles. If the Makefile is well-written, you simply have to set CC and CFLAGS on the commandline when running make or configure. I write a little Makefile or shell script to unpack sources, configure, and make, and usually it works right off. About a third of the time I have to think, and about a sixth of the time I have to fix a bug in the Makefile that caused this not to work; I always submit the change back to the project in question, so others won't have to struggle.

Here's an example of such a Makefile (which just invokes the
real Makefile):

NAME=nc110
DEST=/home3/dank/wk/ixos/dap/sh4-release/host/usr/bin

PROGS_BIN:= $(DEST)/nc
PROGS   := sh4/nc

all: $(PROGS)

install: $(PROGS_BIN)

uninstall:
        rm -f $(PROGS_BIN)

clean:
        rm -rf sh4

sh4/Makefile: /home3/dank/ixia_tarballs/$(NAME).tgz
        test -d sh4 || mkdir sh4
        cd sh4 ; \
                tar -xzvf  /home3/dank/ixia_tarballs/$(NAME).tgz ; \
                patch -p0 < ../nc-resolv.patch
        touch sh4/Makefile

$(PROGS): sh4/Makefile
        make -C sh4 CC="/opt/cegl-1.5/hardhat/devkit/sh/sh4_le/bin/sh_sh4_le-gcc -ml -m4 -DLINUX -lresolv" nc

$(DEST)/nc: sh4/nc
        if test -f $@ ; then chmod +w $@ ; fi
        cp $< $@

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]