This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gfortran mingw build script


[second try, the gcc.gnu.org robot first refused my attached HTML file]


Dear all,


I've finally found my mingw build scripts. Here is the description of how I make it work (I just rebuilt a new mingw system on a clean windows box in a few hours, so it's pretty straightforward).

-- install a fully updated mingw system + MSYS system

-- you need to download NSIS, "nullsoft scriptable install system", from http://nsis.sourceforge.net/ (any version will do) and install it in C:\Program Files\NSIS

-- also install pthreads-win32: the three include files, pthreadGC2.dll and libpthreadGC2.a (which needs to be renamed into libpthread.a); they go into /mingw/include, /mingw/bin and /mingw/lib

-- in my HOME, I create a gfortran directory, within which I put the build_gfortran script and the installer source file (gfortran.nsi)

-- in $HOME/gfortran/, create a directory named dependencies that includes gmp and mpfr (headers in dependencies/include/ and libraries in dependencies/lib/); both libraries should be compiled with a specific build triplet to avoid excessive optimization (that would not allow other people to run your compiler): I use i586-pc-linux.

-- in $HOME/gfortran/, put your source into a directory named gcc- trunk

-- finally, create a directory $HOME/gfortran/mingw_to_include where you put all the files you want to have in your final package; usually I put there all the mingw include files (w32api), relevant binaries from /mingw/bin (binutils and other tools; you can rename mingw32- make.exe into make.exe), all object files from /mingw/lib and almost all static libraries from /mingw/lib (I just remove the GCC libraries). The exact list of files has changed over time (and requests by people), but for those interested, I am attaching the list of files in my "mingw_to_include" directory that I used for the last two years (the file is mingw_to_include.list).

-- in mingw_to_include, I add a GPL.txt file and a README.html file that I wrote some time ago (with links to documentation, licences and other things). I am attaching the README.html file to this mail.


Once that is set up, all you should have to do is run "build_gfortran" and you'll get a gfortran-windows-YYYYMMDD.exe installer. The script even used to scp that installer to the server, but that is now bypassed.


Some comments on what I do:

-- the script updates the SVN trunk everytime it is run
-- I build for i586-pc-mingw32, because a) we want something that runs everywhere, and b) libgomp requires at least i586 to work (I think it is for TLS emulation)
-- I currently use the latest mingw "candidate" binutils, but you can also compile something even more recent and install it system-wide (and in mingw_to_include)
-- apparently, you need to configure with --disable-werror (due to PR38580), but that should only be temporary
-- PDF documentation ("make pdf") currently doesn't work on my system, though I have no idea why (some strange message about unbalanced parentheses).
-- I've never managed to get the testsuite running :(



Here you go, I hope it helps. Merry Christmas! (though a few days in advance)


FX



Attached: build_gfortran, gfortran.nsi, mingw_to_include.list, README.html

Attachment: build_gfortran
Description: Binary data

Attachment: gfortran.nsi
Description: Binary data

Attachment: mingw_to_include.list
Description: Binary data

Attachment: README.html.gz
Description: GNU Zip compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]