Building gcc
../configure --prefix=/mingw --enable-languages=c,c++ --disable-nls --enable-threads --with-gnu-as --with-gnu-ld --with-gcc
or
/src/G95/gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++ --disable-win32-registry --disable-shared --without-x
- Download gcc from ftp://gcc.gnu.org/pub/gcc/releases/4.0.3/gcc-core-4.0.3.tar.gz
- This version of GCC stores object files in a directory distinct from the source directories.
G95 expects to find gcc object files and libraries in a directory named 'g95' under the main 'gcc-4.0.3'
directory. Run the commands:
cd gcc403
mkdir g95
cd g95
- The gcc 'configure' script must be run in the directory that you expect to receive the object files. Configure gcc with
../configure --prefix=/mingw --enable-languages=c,c++ --disable-nls --enable-threads --with-gnu-as --with-gnu-ld --with-gcc
- Run 'make' to build gcc. A full build isn't necessary. If you end up with libbackend.a, and libgcc.a, you've got enough to build g95. If libgcc.a isn't present, try 'make libgcc.a'.
- Download the g95 source and unpack it in some convenient directory.
- Change to the main g95 directory and configure with
./configure --prefix=<installation directory> \
--with-gcc-dir=<path of your GCC directory>
make bootstrap
make install
cd ../../g95-0.50
./configure --prefix=/mingw --with-gcc-dir=/c/tmp/gnu/gcc403
in Makefile: replace 'gcc-lib' with 'gcc'
make
make install
- Build g95 with 'make' or 'make install' to install in the installation directory.
- Unpack the libf95.a-0.50.tgz, configure and build it to get libf95.a. Make sure --prefix is the same as with g95.
- Do 'make install' to build and install the library.
- The exact name of the executable depends on the platform. Create a convenient symbolic link to this.
- You should now be able to compile fortran 95 programs with g95.
cd libf95.a-0.50
./configure --prefix=/mingw --with-gcc-dir=/c/tmp/gnu/gcc403
in Makefile: replace 'gcc-lib' with 'gcc'
cd ..
make
make install
get:
/mingw/lib/gcc/i686-pc-mingw32/4.0.3/libf95.a
/mingw/bin/i686-pc-mingw32-g95.exe (copt to g95.exe)
/mingw/lib/gcc/i686-pc-mingw32/4.0.3/f951.exe
/mingw/lib/gcc/i686-pc-mingw32/4.0.3/libgcc.a