From: Robert Zubek Newsgroups: comp.os.msdos.djgpp Subject: Re: Cross-compiling Date: Thu, 12 Feb 1998 01:37:03 -0600 Organization: Northwestern University, Evanston, IL, US Lines: 53 Message-ID: <34E2A69F.EF373C5D@cs.nwu.edu> References: NNTP-Posting-Host: robzilla.res-hall.nwu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Luke Roth wrote: > I have heard that GCC can cross-compile to different CPU's, is > this possible using djgpp as well? I am interested in writing some > freeware applications for WindowsCE machines (they don't seem to exist > yet), but I can't afford to spend $100's on a commercial compiler for my > PC. Thanks! i'm presently about half-way through making an msdos->mips cross-compiler, so i thought i'd throw in what the experience taught me so far - i'm not sure how useful this'll be in your particular situation, though. it seems that to make the target anything other than dos, you will have to recompile original gcc sources, rather than just djgpp. from now, i'm assuming you're planning on using dos/win as your host environment (since you mention djgpp) - if you're in fact using linux, the procedure might be much simpler. first of all, you will need gcc and binutils, because the latter contains assembler and linker - so make sure your target (cpu-vendor-os) is supported by both packages. secondly, get bash and associated utilities - they will make your life much, much easier. after you get sources for binutils and gcc, get also sources for binutils for djgpp - they contain a patch to apply to the original binutils. don't know how/whether this patch is useful, though. also, read the readme from djgpp version for info on an important symlink bug. when configuring, run the configure script, and NOT the configure.bat batch file. giving it just the host and target might be enough. after that finishes, run make, and then make install. by then you should have working cross versions of as and ld, as well as other misc. utilities. now configure gcc in the same way - but use --with-gnu-as and --with-gnu-ld to use your newly compiled executables. you might need to tweak the makefile this creates. note that make will break when trying to make libgcc library for the target - this is to be expected, look in the install file in gcc source dir for details. and this is where i am right now, but the instructions that came with gcc should take you from there... good luck! rob -- ** please remove '-spam' from my email address before replying, ** ** or your message might get fed to /dev/null **