Web lists-archives.com

Re: [Mingw-users] I'm a newbie to MinGW. How Can I build MinGW from source?

Thanks for Keith,I'm just a copycat. ;)
I copy the steps that build gcc-5.3 cross compiler as follow:

build enviroment:
os: ubuntu x86(i386) 14.10
gcc version: 4.9.1
gcc source version: 5.3

mingw32 build steps:
1) download source:
from sourceforge's mingw project:
  mingwrt-5.0 preview snapshot
  w32api-5.0 preview snapshot
  gcc-5.3.0 (distributed by MinGW.org)
from GNU mirror:

2) make dirs:
$ cd $HOME
$ mkdir -p $HOME/mingw32-src/build/{binutils,gcc,mingwrt,w32api}
$ mkdir $HOME/mingw32-gcc-sandbox
$ ln -fs mingw32-gcc-sandbox mingw32
$ cd $HOME/mingw32
$ ln -s . mingw

3)prepare source:
unpack downloaded source packages to $HOME/mingw32-src.
$ cd $HOME/mingw32-src/gcc-5.3.0
$ ln -s ../gmp-6.1.0 gmp
$ ln -s ../mpfr-3.1.3 mpfr
$ ln -s ../mpc-1.0.2 mpc

4)export PATH:
$ export PATH=$PATH:$HOME/mingw32/bin

5)install mingw-pkg tool:
download mingw-pkg snapshot from

unpack downloaded mingw-pkg,configure,make and make install mingw-pkg. You
can get information form this thread:

If you get error: sh: ../configure: No such file or directory.
No panic, just get autoconf installed( form ubuntu packages or get source
form gnu and install).

6)mingwrt (just headers):
$ cd $HOME/mingw32-src/build/mingwrt
$ ../../mingwrt-5.0/configure --build=unknown --host=mingw32
$ make install-headers

7)w32api (just headers):
$ cd ../w32api
$ ../../w32api-5.0/configure --build=unknown --host=mingw32
$ make install-headers

$ cd ../binutils
$ ../../binutils-2.26/configure --target=mingw32
--{prefix,with-sysroot}=$HOME/mingw32 --disable-nls
$ make
$ make install

9)gcc: stage-1 build
$ cd $HOME/mingw32-src/gcc-5.3.0
$ mingw-pkg patch
$ cd $HOME/mingw32-src/build/gcc
$ ../../gcc-5.3.0/configure --{prefix,with-sysroot}=$HOME/mingw32 \ 
     --target=mingw32 --with-arch=i586 --with-tune=generic \ 
     --enable-shared --enable-threads --disable-win32-registry \ 
     --disable-sjlj-exceptions --disable-multilib --disable-nls \ 
     --disable-libvtv --with-dwarf2 --enable-languages=c,c++
$ make all-gcc && make install-gcc

10)gcc: check
make sure we can access it via $PATH
$ which mingw32-gcc

Here terminal display message should be different:
/home/**/mingw32/bin/mingw32-gcc   (** is your login account if you logined
with nonroot)

$ mingw32-gcc --version 
  mingw32-gcc (GCC) 5.3.0 
  Copyright (C) 2015 Free Software Foundation, Inc.

$ cd ../mingwrt
$ ./config.status --recheck 
$ ./config.status 
$ make 
$ make install 

$ cd ../w32api 
$ ./config.status --recheck 
$ ./config.status 
$ make 
$ make install

13)gcc: stage-2 build
$ cd ../gcc 
$ make all 
$ make instal

If you get some error like awk, get and install ubuntu gawk package.
If you get some error like m4, get and install ubuntu m4 package.
If you get error: 'wcstof' is not a member of 'std', you can apply the
workaround provided by keith:

Now we get building work done. Enjoy it!
Next, I'll move on and try to build windows-host ARM toolchain according to
Keith's advice.

View this message in context: http://mingw.5.n7.nabble.com/SPAM-I-m-a-newbie-to-MinGW-How-Can-I-build-MinGW-from-source-tp35651p35690.html
Sent from the MinGW - User mailing list archive at Nabble.com.

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe