From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: Something for the FAQ - How do I cross compile... 23 Aug 1997 19:23:36 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199708210648.BAA04701.cygnus.gnu-win32@eh_pc11.xraylith.wisc.edu> Original-To: root Original-cc: gnu-win32 AT cygnus DOT com In-reply-to: Your message of "Wed, 20 Aug 1997 12:06:29 EDT." <97Aug20 DOT 120611edt DOT 32257 AT brickwall DOT ceddec DOT com> Original-Sender: owner-gnu-win32 AT cygnus DOT com root writes: > If I want to build the Gnu-win32 so that I can produce NT programs > under Linux or another host/build machine, what do I use for the > --target entry? i686-cygwin32-gnu says fcntl.h is missing, and I > will try some other things, but it would really help if you would > say somewhere in the faq how to do this. > - I remember a post by Geoffrey Noer a long time back with the essentials, and I've successfully used that since b17 to build everything under i386-linux. I'll use i386-linux instead of the more specific i[456] etc. I do this regularly and haven't had any problems. Here's an excerpt from a message that I had sent someone else (replace b17 with 18.1): -- using template mhl.format -- From: Mumit Khan Subject: BUILDING CROSS COMPILER You really need to start with getting the whole source tree for cygnus gnu-win32 b17.1 from cygnus's ftp site. You of course do need a C compiler already installed on your machine (eg., gcc) to bootstrap the cross compiler. GCC 2.7.2* work quite well when building the cross compiler. You don't need the source for gcc other than what comes with gnu-win32 source distribution (there is gcc in there already, as well as a whole bunch of other things). Here's what I've done: Part 1: Building the cross-compiler 1. Get Cygnus b17.1 source tree for the compiler toolchain ftp://ftp.cygnus.com/pub/gnu-win32/cdk-src/* Comes as a bunch of files xaa, xab, etc. 2. Unzip and untar on your Unix machine (say a Linux machine). Let's assume you untar everything under $srcdir (where $srcdir in my case is /src/gnu/gnu-win32-b17.1) % mkdir gnu-win32-b17.1 % cd gnu-win32-b17.1 % cat ../xa* | tar zxvf - 3. Now create a build tree. % mkdir cross-build % cd cross-build 4. Configure for cross compiler % $srcdir/configure --target=i386-cygwin32 --host=i386-linux \ -v --prefix=/scratch/gnu Replace /scratch/gnu above with what you want. This is where the cross-compilers will eventually end up! 5. Make the cross-compiler now % make >& make.log % make install Part 2: [OPTIONAL] Building the native tools 1. Add $prefix/bin to your path <<<<<<<< Make sure you do this! 2. Create a new build tree % mkdir cygwin32 % cd cygwin32 3. Configure for native tools % $srcdir/configure --prefix=/scratch/gnu-win32 \ --exec-prefix=/scratch/gnu-win32/H-i386-cygwin32 \ --target=i386-cygwin32 --host=i386-cygwin32 \ --build=i386-linux -v 4. ``make'' and ``make install'' Part 3: [OPTIONAL] Build native user tools. [... same as Part 2 ... ] -- regards, Mumit -- khan AT xraylith DOT wisc DOT edu http://www.xraylith.wisc.edu/~khan/ - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".