This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Step-By-Step Build Instructions for MinGW gcc/gcj 3.4 Compilers
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: GCJ Java <java at gcc dot gnu dot org>
- Date: Sun, 27 Jul 2003 03:39:52 -0500
- Subject: Step-By-Step Build Instructions for MinGW gcc/gcj 3.4 Compilers
- Reply-to: gnustuff at thisiscool dot com
Hi People,
Here is my attempt to provide step-by-step instructions
for building your own MinGW gcc/gcj 3.4 cross and native
compilers. This can be done on both Linux and Windows
via Cygwin. (I am still in the process of churning through
the Cygwin build, so it hasn't been validated yet.)
I highly doubt the Cygwin build will work on Win9X
(only WinNT, 2K, XP, etc.).
With these instructions in hand, both UNIX and Windows
users should be able to build your own MinGW compiler any
time you want from the CVS sources (provided that the sources
aren't broken for MinGW). That theoretically means that
you don't need to come knocking on my door each time
you need a new build.
Feedback is welcome. What is inaccurate and/or missing here?
If there are enough successes with this, I'll update my website.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
(This file is in scripts/ReadMe.txt in mingw32-gcc-scripts.tar.gz.)
0. Download MinGW build scripts and patches:
- http://www.thisiscool.com/mingw32-gcc-scripts.tar.gz
Windows users: download and install Cygwin as
per Appendix A. Everything you type from here on is
from within the Cygwin bash shell.
1. Download the MinGW sources and libraries:
- First time setup:
$ mkdir -p /datal/gcc/sources
- Download the following files to /datal/gcc/sources.
Get these from http://www.mingw.org/download.shtml
Do not unzip/untar them!
binutils-2.14.90-20030612-1.tar.gz
binutils-2.14.90-20030612-1-src.tar.gz
mingw-runtime-3.0.tar.gz
w32api-2.3.tar.gz
CYGWIN USERS: Note that if you installed Cygwin to
c:\cygwin, /datal really maps to c:\cygwin\datal
so you'll have to put the files in
c:\cygwin\datal\gcc\sources.
Type:
$ cd /datal/gcc
$ tar xvfz /pathto/mingw32-gcc-scripts.tar.gz
Thanks to Ranjit Mathew for his original groundwork:
http://ranjitmathew.tripod.com/phartz/gcj/bldgcj.html
2. Download the GCC sources
$ cd /datal/gcc
$ . /datal/gcc/scripts/cvs/genv
$ co34.sh
$ cd gcc
$ contrib/gcc_update --touch
3. Apply some patches
$ cd /datal/gcc/gcc/gcc/java/
$ patch -p0 < /datal/gcc/diffs/34/msg00565.diff
/* Note: if patch complains that a patch has
already been applied, hit [Ctrl+C] and continue
on. */
$ cd /datal/gcc/gcc/libjava/
$ patch -p0 < /datal/gcc/diffs/34/msg00064.diff
4. Build the cross compiler
$ cd /datal/gcc/scripts/build/
$ ./buildxgcc.sh
/*
Press [Enter] these two times:
1. At the end of the gcc configure phase if
no errors are reported.
("About to build GCC... <<Press enter>>")
2. At the end of the build, to install gcc.
("Press ENTER when you are ready to install...")
*/
The cross compiler is now in /datal/gcc/build/crossgcc.
5. Build the native compiler
$ cd /datal/gcc/scripts/build/
$ ./buildwgcc.sh
/*
Press [Enter] these two times:
1. At the end of the gcc configure phase if
no errors are reported.
("About to build GCC... <<Press enter>>")
2. At the end of the build, to install gcc.
("Press ENTER when you are ready to install...")
*/
The native compiler is now in /datal/gcc/build/wingcc.
Appendix A: Cygwin Setup
1. Execute http://www.cygwin.com/setup.exe; press [Next>]
on the intro screen.
2. Choose Install from Internet; press [Next>]
3. Enter appropriate values in Choose Installation Directory;
press [Next>].
4. Enter something meaningful for Select Local Package Directory;
press [Next>].
5. Enter something meaningful for Select Your Internet Connection;
press [Next>].
6. Select a download site; press [Next>].
7. On the Select Packages page, click the [View] button until
the text "Full" appears on the label to the right of the
button.
8. Single-click the "Skip" icon for each of these packages
so that the word Skip disappears and is replaced by
a version number. If you accidentally click more than
once, keep clicking until the word "Skip" reappears,
then single-click once more:
- binutils
- bison
- flex
- cvs
- gcc
- make
- mktemp
- patch
Thanks to John Murga for his original groundwork:
http://gcc.gnu.org/ml/java/2003-01/msg00299.html
9. Before launching Cygwin, edit cygwin.bat (which is
in c:\cygwin if you chose the default install location)
and add the following line before the "bash" line:
set CYGWIN=check_case:strict