title: How to build GCC (change compile configuration of GCC) (mingw)
body: <p>I've read all the internet and try many solutions but nothing worked for me.
  I have gcc 4.5.2 (specially this version, because newer versions of gcc add a lot of unnecessary when compiling, and the file size will grow significantly).</p>
  
  <p>So gcc -v:</p>
  
  <pre><code>C:\MinGW\bin&gt;gcc -v
  Using built-in specs.
  COLLECT_GCC=gcc
  COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe
  Target: mingw32
  Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
  Thread model: win32
  gcc version 4.5.2 (GCC)
  </code></pre>
  
  <p>So question: How to change this confire on windows? (I have msys, I think I need it for changing config with './configure') For example I want to write '--disable-libgomp'. How can I make this?</p>
  
  <p>PS: maybe it will be usefull, I build my program with 'gcc -o prog.exe prog.cpp prog.o -s -Os -lole32 -luuid -lshlwapi -lcomctl32 -mwindows -lstdc++' (60Kb with gcc 4.8.1 and 20Kb with gcc 4.5.2).</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><a href="https://stackoverflow.com/a/9450422/3706301">This is the perfect solution of "How build GCC"</a></p>
  
  <p>My configure flags:</p>
  
  <pre><code>./configure --enable-languages=c,c++ --disable-static --enable-shared --disable-sjlj-exceptions --disable-libgcj --disable-bootstrap --disable-libstdcxx-pch --disable-libgomp --with-dwarf2 --disable-win32-registry --disable-libstdcxx-debug --disable-concept-checks --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw --with-gmp=c:/mingw/src/gmp --with-mpfr=c:/mingw/src/mpfr --with-mpc=c:/mingw/src/mpc --with-libelf=c:/mingw/src/libelf
  </code></pre>
  
  <p>or with other flags you need.</p>
  
  <p><strong>Don't forget to mount with MSYS: mount PATH_TO_MINGW /mingw</strong> like </p>
  
  <pre><code>mount c:/mingw /mingw
  </code></pre>
  
  <p>You will run into some errors, but they are very simple to correct.</p>
  
  <p>Good luck!</p>