RECIPE for building cross Cygwin and egcs etc[Re: PLEASE HELP: Making a Linux->Win32 egcs 1.1.1 cross compiler?]

Mumit Khan khan@xraylith.wisc.edu
Sun Jan 31 23:52:00 GMT 1999


Arcadio,

Here's an updated version of my original note to the mailing list (you did
check the mailing list archives before posting, right?).

btw, you should not mix the directories in b20.1 and egcs-1.1.1; ie.,
keep them under separate directories.

Use at your own risk. Also, please don't expect prompt a response if
you send me with problems that you may have with these various steps.
These are all from memory, and it's not what it used to be ....

============ building CROSS B20+ tools

Step 1: build the entire b20.1 cross-toolchain before you start with
  egcs-1.1.1

1. Download the b20.1 source tree: 
  
  ftp://sourceware.cygnus.com/pub/cygwin/latest/dev-src.tar.bz2

2. unpack, configure and build:
  
  $ mkdir /usr/local/src/cygwin-b20
  $ cd /usr/local/src/cygwin-b20
  $ bunzip2 -c /tmp/dev-src.tar.bz2 | tar -xf -
  [ this will unpack everything under src subdirectory ]
  $ cd src
  $ mkdir CROSS
  $ cd CROSS
  $ ../configure --prefix=/usr/local/cygb20 --target=i586-cygwin32 -v
  $ make > make.log 2>&1
  [ the '2>&1' depends on your shell of course. check for errors . If OK ]
  $ make install > install.log 2>&1

============ building CROSS egcs-1.1.1 for Cygwin b20+

1. Download sources and patches:

 ftp://egcs.cygnus.com/pub/egcs/releases/egcs-1.1.1/egcs-1.1.1.tar.bz2
 ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/egcs-1.1.1/patches/
    Get the egcs-1.1.1-x86-win32-patches.tar.gz

2. Unpack, patch, prep:
 
  $ cd /usr/local/src
  $ bunzip2 -c /tmp/egcs-1.1.1.tar.bz2 | tar -xf -

  Now patch time. If you look inside egcs-1.1.1-x86-win32-patches.tar.gz,
  you'll see the actual patche file -- egcs-1.1.1-x86-win32.diff. This
  is the file you need.

  $ cd egcs-1.1.1
  $ patch -p1 -s < /tmp/egcs-1.1.1-x86-win32.diff

3. Now build and install.

  $ mkdir CROSS
  $ cd CROSS
  $ ../configure --prefix=/usr/local/cygb20 --target=i586-cygwin32 -v
  $ cd gcc; make installdirs; cd ..
  [ this step is important, otherwise libobjc, libstdc++ etc will fail ]
  $ make > make.log 2>&1
  [ the '2>&1' depends on your shell of course. check for errors . If OK ]
  $ make install > install.log 2>&1

After you're done, add it to path (if you're using a bourne-shell
compatible, otherwise use csh syntax).
  
  $ export PATH=$PATH:/usr/local/cygb20/bin
  $ i586-cygwin32-gcc -v
  [ should report egcs-1.1.1 etc ]

All the binaries for i586-cygwin32 target are prefixed with i586-cygwin32-
prefix.

============ building NATIVE B20+ tools using CROSS tools just built.

Now if you want to build native tools on eg., a i686-pc-linux-gnu box with 
the same pathnames that Cygnus uses:

  $ cd /usr/local/src/cygwin-b20/src
  $ mkdir NATIVE
  $ cd NATIVE
  $ ../configure --prefix=/Cygnus/cygwin-b20 \
    --exec-prefix=/Cygnus/cygwin-b20/H-i586-cygwin32 \
    --target=i586-cygwin32 --host=i586-cygwin32 \
    --build=i686-pc-linux-gnu -v
  $ make > make.log 2>&1
  [ check for errors . If OK ]

============ building NATIVE egcs-1.1.1 tools using CROSS tools just built.

Now if you want to build native tools on eg., a i686-pc-linux-gnu box with 
the same pathnames that Cygnus uses:

  $ cd /usr/local/src/egcs-1.1.1
  $ mkdir NATIVE
  $ cd NATIVE
  $ ../configure --prefix=/Cygnus/cygwin-b20 \
    --exec-prefix=/Cygnus/cygwin-b20/H-i586-cygwin32 \
    --target=i586-cygwin32 --host=i586-cygwin32 \
    --build=i686-pc-linux-gnu -v
  $ make > make.log 2>&1
  [ check for errors . If OK ]

Now of course, you may want to install it to a *DIFFERENT* location 
than /Cygnus/cygwin-b20 on your Unix host before creating an archive 
to copy to a Cygwin box. Let's say you first install it to /tmp/cygwin.

  $ make prefix=/tmp/cygwin exec_prefix=/tmp/cygwin/H-i586-cygwin32 \
    install > install.log 2>&1
  $ cd /tmp/cygwin
  $ tar zcvf /tmp/dev-cygwin-b20.tar.gz .

Copy /tmp/dev-cygwin-b20.tar.gz to your Cygwin box and unpack:
  
  [win32]$ cd /Cygnus/cygwin-b20
  [win32]$ tar zxvf /tmp/dev-cygwin-b20.tar.gz

===== THE END

Regards,
Mumit


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list