Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: reckless on July 03, 2011, 09:56:11 am

Title: gcc-4.6.1 builds availiable
Post by: reckless on July 03, 2011, 09:56:11 am
made some i686-w64-mingw32 and x86_64-w64-mingw32 builds of gcc-4.6.1 available on my google code site.

lots of bugfixing since 4.6.0 (one was a bug causing codeblocks to crash when calling cpp.exe)  typo in cppspec.c.

gcc now supports i7 processors.

wxwidgets can now be build without the dllinline patch by adding this to wxwidgets/build/msw/config.gcc

# Standard flags for CC
CFLAGS ?= -fno-keep-inline-dllexport

# Standard flags for C++
CXXFLAGS ?= -fno-keep-inline-dllexport

32 bit build here http://mingw-wine.googlecode.com/files/mingw32-gcc-4.6.1-release.7z
64 bit build here http://mingw-wine.googlecode.com/files/mingw64-gcc-4.6.1-release.7z

specific questions ? pm me or send me a mail. i cannot answer them here.
Title: Re: gcc-4.6.1 builds availiable
Post by: ollydbg on July 06, 2011, 05:02:19 am
good, and there is another mingw 4.6.1 by xunxun
MinGW_gcc4.6.1release_static_win32.7z  (http://code.google.com/p/pcxprj/downloads/detail?name=MinGW_gcc4.6.1release_static_win32.7z&can=2&q=)
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 05, 2011, 07:16:20 pm
not hosted on my google code site because of it's size but here's a link to my development environment (warning its big).

ftp://90.184.233.166:21/cb-setup.exe (ftp://90.184.233.166:21/cb-setup.exe) or if you prefer you can use my downloader ftp://90.184.233.166:21/cb-adv-downloader.exe (ftp://90.184.233.166:21/cb-adv-downloader.exe)

the downloader is just a 7zip selfextracter with a download folder inside. just doubleclick the download.bat in the folder and it will get the installer and when done downloading start the setup.

the suite includes pretty much anything you could need for emediate development and a few tools i created myself to get around vista/win 7 problems like UAC and admin access.

the Msys shells are auto elevated to admin level so you dont have to rightclick and select run as admin anymore.

both Local/bin mingw32/bin and mingw64/bin are added to path so that part is not nessesary anymore either.

Local contains some tools shared between both mingw versions like cmake/ruby/python/svn and putty. these tools are also visible to codeblocks when Local is added to path.

CodeBlocks itself is latest svn version (built yesterday) and i included tools in the root folder codeblocks use, like cscope cccc and cppcheck. i modified the compilerplugin a bit to use the mingw64 32 bit compiler by default.

msys was also heavily modified by me to work a bit more like the cygwin shell and includes some stuff you probably cant get anywhere else like ncurses (shared build) and lynx for msys.
you can build msys packages also by selcting msysdvlpr posix shell from the msys shell. ncurses was also ported to mingw recently so now theres an alternative to pdcurses.

all questions related to the above should be mailed to me or send me a PM, i cannot answer them here.



Title: Re: gcc-4.6.1 builds availiable
Post by: MortenMacFly on August 05, 2011, 09:04:02 pm
i modified the compilerplugin a bit to use the mingw64 32 bit compiler by default.
I appreciate your effort, but did you ensure to provide the sources, too to comply with the GPL license? I didn't find it. You wrote that you modified the core, thus a patch / sources is required. Especially if you distribute the link through our forum.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 05, 2011, 09:51:47 pm
not packaged yet but its in my home folder so no problem :) ill make a patch but the changes are pretty small basically i just changed the name of the mingw folder to mingw32 for the 32 bit compiler and the prefix for the mingw executables from mingw32-gcc.exe etc. to i686-w64-mingw32-gcc.exe.

all changes are in the compilermingw.cpp plugin source.

if possible ill try to get it to autodetect both the 64 and 32 bit compiler atm only the 32 bit one is autodetected.
Title: Re: gcc-4.6.1 builds availiable
Post by: MortenMacFly on August 05, 2011, 10:02:40 pm
if possible ill try to get it to autodetect both the 64 and 32 bit compiler atm only the 32 bit one is autodetected.
That would be a nice contribution. :-)
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 05, 2011, 10:12:00 pm
ok ill see what i can cook up :) packaging the source now should be on the ftp in a few minutes. or if you prefer ill put it on my google code site the size should be ok for that.

then ill make a diff.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 05, 2011, 10:42:15 pm
modified trunk source should be up now.

ftp://90.184.233.166:21/codeblocks-trunk-modified-src.7z
 (ftp://90.184.233.166:21/codeblocks-trunk-modified-src.7z)
might have a solution to the detection of the 64 bit compiler allready but still running some tests. still pretty new to wxwidgets :)
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 05, 2011, 11:06:14 pm
ftp://90.184.233.166:21/compilerMINGW.diff (ftp://90.184.233.166:21/compilerMINGW.diff)

diff of the changes unfortunatly still needs some work, as it seems checking wxIsPlatform64Bit() only applies to wxwidget itself hm ? ideas are welcome.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 06, 2011, 08:27:01 am
slight change to the diff the first one was a bit messy.

Code
--- compilerMINGW.cpp.orig	2011-08-05 20:58:41 +0000
+++ compilerMINGW.cpp 2011-08-06 06:23:08 +0000
@@ -25,7 +25,7 @@
 #include <configmanager.h>
 
 #ifdef __WXMSW__
-    #include <wx/msw/registry.h>
+#include <wx/msw/registry.h>
 #endif
 
 CompilerMINGW::CompilerMINGW(const wxString& name, const wxString& ID)
@@ -55,13 +55,27 @@
 {
     if (platform::windows)
     {
-        m_Programs.C         = _T("mingw32-gcc.exe");
-        m_Programs.CPP       = _T("mingw32-g++.exe");
-        m_Programs.LD        = _T("mingw32-g++.exe");
-        m_Programs.DBG       = _T("gdb.exe");
-        m_Programs.LIB       = _T("ar.exe");
-        m_Programs.WINDRES   = _T("windres.exe");
-        m_Programs.MAKE      = _T("mingw32-make.exe");
+        // need an idea to also reset the standard mingw compiler ?
+        if (wxIsPlatform64Bit())
+        {
+            m_Programs.C         = _T("x86_64-w64-mingw32-gcc.exe");
+            m_Programs.CPP       = _T("x86_64-w64-mingw32-g++.exe");
+            m_Programs.LD        = _T("x86_64-w64-mingw32-g++.exe");
+            m_Programs.DBG       = _T("gdb.exe");
+            m_Programs.LIB       = _T("ar.exe");
+            m_Programs.WINDRES   = _T("windres.exe");
+            m_Programs.MAKE      = _T("winmake.exe");
+        }
+        else
+        {
+            m_Programs.C         = _T("i686-w64-mingw32-gcc.exe");
+            m_Programs.CPP       = _T("i686-w64-mingw32-g++.exe");
+            m_Programs.LD        = _T("i686-w64-mingw32-g++.exe");
+            m_Programs.DBG       = _T("gdb.exe");
+            m_Programs.LIB       = _T("ar.exe");
+            m_Programs.WINDRES   = _T("windres.exe");
+            m_Programs.MAKE      = _T("winmake.exe");
+        }
     }
     else
     {
@@ -96,12 +110,12 @@
 
     m_Options.ClearOptions();
     m_Options.AddOption(_("Produce debugging symbols"),
-                _T("-g"),
-                _("Debugging"),
-                _T(""),
-                true,
-                _T("-O -O1 -O2 -O3 -Os"),
-                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
+                        _T("-g"),
+                        _("Debugging"),
+                        _T(""),
+                        true,
+                        _T("-O -O1 -O2 -O3 -Os"),
+                        _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
     wxString gprof_link = _T("-pg");
     if (platform::windows)
         gprof_link = _T("-pg -lgmon");
@@ -144,6 +158,7 @@
     m_Options.AddOption(_("Optimize generated code (for size)"), _T("-Os"), category);
     m_Options.AddOption(_("Expensive optimizations"), _T("-fexpensive-optimizations"), category);
     m_Options.AddOption(_("Don't keep the frame pointer in a register for functions that don't need one"), _T("-fomit-frame-pointer"), category);
+
     // machine dependent options - cpu arch
     category = _("CPU architecture tuning (choose none, or only one of these)");
     m_Options.AddOption(_("i386"), _T("-march=i386"), category);
@@ -175,6 +190,7 @@
     m_Commands[(int)ctGenDependenciesCmd].push_back(CompilerTool(_T("$compiler -MM $options -MF $dep_object -MT $object $includes $file")));
     m_Commands[(int)ctCompileResourceCmd].push_back(CompilerTool(_T("$rescomp -i $file -J rc -o $resource_output -O coff $res_includes")));
     m_Commands[(int)ctLinkConsoleExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs")));
+
     if (platform::windows)
     {
         m_Commands[(int)ctLinkNativeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs --subsystem,native")));
@@ -249,15 +265,25 @@
             }
         }
     }
-
     wxString sep = wxFileName::GetPathSeparator();
+
     if (platform::windows)
     {
         // look first if MinGW was installed with Code::Blocks (new in beta6)
         m_MasterPath = ConfigManager::GetExecutableFolder();
         if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
+        {
             // if that didn't do it, look under C::B\MinGW, too (new in 08.02)
             m_MasterPath += sep + _T("MinGW");
+        }
+
+        if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
+        {
+            // if that didn't do it, look under C::B\MinGW32 or C::B\MinGW64, too (new in 08.02)
+            m_MasterPath += wxIsPlatform64Bit() ? sep + _T("MinGW64") : sep + _T("MinGW32");
+        }
+
+        // standard mingw no 64 bit compiler and the mingw64 compiler has no ini.
         if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
         {
             // no... search for MinGW installation dir
@@ -300,16 +326,15 @@
 #endif
             }
         }
-        else
-            m_Programs.MAKE = _T("make.exe"); // we distribute "make" not "mingw32-make"
+        else m_Programs.MAKE = _T("make.exe"); // we distribute "make" not "mingw32-make"
     }
-    else
-        m_MasterPath = _T("/usr");
+    else m_MasterPath = _T("/usr");
 
     AutoDetectResult ret = wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C) ? adrDetected : adrGuessed;
     // don't add lib/include dirs. GCC knows where its files are located
 
     SetVersionString();
+
     return ret;
 }
 
@@ -317,7 +342,7 @@
 {
     /*  NOTE (Biplab#9#): There is a critical bug which blocks C::B from starting up.
         So we'll disable version string checking till we fix the bug. */
-    #if !wxCHECK_VERSION(2, 9, 0)
+#if !wxCHECK_VERSION(2, 9, 0)
 //    Manager::Get()->GetLogManager()->DebugLog(_T("Compiler detection for compiler ID: '") + GetID() + _T("' (parent ID= '") + GetParentID() + _T("')"));
 
     wxArrayString output, errors;
@@ -394,5 +419,5 @@
             }
         }
     }
-    #endif
+#endif
 }

wxIsPlatform64Bit() should actually work but my C++ fu is a bit impaired so i likely made some mistake. im normally used to working in old C mode.

still need to find a solution to reset the standard MinGW compiler's executables with the new autodetect code. atm it will only work for the mingw64 compiler. it should be as easy as checking for a certain #define only present in mingw64 but i forgot its name so i need to find it again.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 06, 2011, 10:28:26 am
slight update.

codeblocks spellchecker was missing its dictionaries so i added all i could get my hands on.

link for codeblocks only ftp://90.184.233.166:21/codeblocks-only.7z (ftp://90.184.233.166:21/codeblocks-only.7z) can overwrite the one from the installer i only added the dictionaries so the spellchecker works.

edit: also added gcc-4.6.1's CPU optimization option to the compiler plugin aka -march=corei7. several other optimization options i will be adding as soon as i get the list complete ;)

ill keep the diff updated with changes so redownloading it will give you the one with the latest changes.

edit: changed latest diff name to compilerMINGW.diff2 (only includes the CPU optimization change) might not be good to apply it to trunk yet if the gcc you want to use is older than 4.6 though as i havent implemented checking  for gcc version yet. so you might end up with an issue with older mingw compilers that dont support this.

i could use a couple of define checks to check gcc version but im not sure if you're ok with that ?.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 06, 2011, 03:21:43 pm
updated installer with recent changes.

mysql connect interface was using the wrong include and library paths (/usr/local/include and /usr/local/lib) fixed now to use (/mingw32/lib and /mingw32/include for the 32 bit mingw and /mingw64/lib and /mingw64/include for the 64 bit mingw) changes only realy apply to users who will use mysql from the Msys shells with mysql_config.exe.

merged changes for codeblocks-only into the installer.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 08, 2011, 03:26:47 am
more updates.

msys now has a working lynx :) helpfull in some cases. uses s-lang and openssl.
tools in /usr/local updated (crapload of python extentions added like wxpython pyqt easyinstall kid cherrypy etc) several tools to go with these two like a special python shell in wx and a gui editor for pyqt.
added several source revision tools like git and mercurial and the console svn client now has a rapidsvn gui you can add to codeblocks tools.
also added qtgit which can be used like the svn gui from codeblocks tools menu (can be a bit hard setting qtgit up so i left the tcl gui in as a default) git is made for mingw not msys and was patched a bit because the tcl gui thinks im using cygwin /facedesk. it can use both msys perl's and the mingw python's interfaces.

modified /etc/profile a bit more. now msys will autocreate reparse points for the sysroot for both compilers.

still not satisfied with C::B's detection of the mingw64 compiler but its better than it was atleast. still working on it.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 08, 2011, 11:10:49 pm
taking ftp offline for about a day moving my files to an old computer i setup as server cause my work computer is rather expensive to have running 24/7  :lol:
one of the downfalls of having a monster PC.

it should be up again tomorrow evening.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 09, 2011, 06:29:55 pm
heh seems the old computer i wanted to use for a server hit the end of life in the hard way (boom) :S

so im back to hosting it on my work machine for the time being. i might opt for a sourceforge account if there limit allows files of this size. anyone know ?
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 09, 2011, 07:13:22 pm
oh they do :) ok account created and uploading now. if anyone could help me setup a wiki id be much obliged.

for C:.B itself i have set the support page to the C::B forums, i hope thats ok ?.

also as a token if anyone has ideas or need space for something cool for C::B they can host it on my sourceforge account (if its GPL or otherwise compliant). feel free to pm me and ill setup access.

since theres so many things you can do with this package allready i suspect ill have to write up one massive wiki  :lol: so any help in that regard is most welcome as stated above.

i hope to also make the sources for my special tools and ports available and setup a patch tracker + svn access. if anyone got inside on how to do that on sourceforge let me know :).
Title: Re: gcc-4.6.1 builds availiable
Post by: xunxun on August 09, 2011, 09:30:48 pm
You may enter your project, and install svn from Admin-Tools-svn, you can named it svnCode, and you will find svnCode tab in your project.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 10, 2011, 02:55:37 am
thanks for the hint :) and page is up https://sourceforge.net/p/cbadvanced/home/Home/ (https://sourceforge.net/p/cbadvanced/home/Home/)

ill add svn tools soon took me all day to get the page setup and writing a bit about it so i rather smashed  :lol: ill get to it after a good nights sleep :)
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 10, 2011, 06:51:42 pm
seems the setup autocreated the svn setup allthough it seems im the only one with access ? hmm.

going to read a bit on correctly modifying things on sourceforge.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 15, 2011, 02:39:14 am
slowly getting there :)

https://sourceforge.net/projects/cbadvanced/files/

some neat additions to the msys toolset also added like rsync msys build ;)

source availiable to.
Title: Re: gcc-4.6.1 builds availiable
Post by: ollydbg on August 15, 2011, 03:45:38 am
1, cb-setup.exe (http://sourceforge.net/projects/cbadvanced/files/cb-setup.exe/download), it was 1G size, I guess no body would like to download this beast :D.
2, Need some detail description about your packages on your C::B advanced / Home / Home (http://sourceforge.net/p/cbadvanced/home/Home/)
3, about your patch on mingw. I can't test that because I only have 32 bit windows. but reading the patch, I think that you have 32bit compiler installed MinGW32/bin and 64bit compiler installed in MinGW64/bin. then it seems you just hard coded the source to distinguish those two compilers, this is not quite flexible. :D
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 15, 2011, 04:52:59 am
yep its quite a beast but so is msvc 2010 ;) its a complete development environment.

atleast im going to provide plugins and sdk's as standalone zip's :) i made this for ease of use for people who are not used to working with a gcc compiler.

and aye the patch works for mingw32 i havent magically ported C::B to 64 bit (no need either since 64 bit win handles 32 bit quite fine).

as for hardcoded hmm well its allready hardcoded in the standard source to some degree as in if mingw is not installed with C::B then it looks in C:\\MinGW (or it gets the path from mingw's ini file)
and in Dev-Cpp dir it seems but atleast it does that from a registry key so that part is portable.  i could maybe use a similar approach to the ini read but then the installer will have to be modified to write the
correct values to an ini.

im not to satisfied with how i made it but still learning C++ (im used to pure C) so it might take me some time to come up with a better way.

atm i use wx's 64 bit OS check to set the 64 bit mingw compiler (it works) but some might want to use the 32 bit mingw on say win 7 64 and in that case it fails but i suspect i could make an option to select either one.

any help in that regard is most welcome.

Title: Re: gcc-4.6.1 builds availiable
Post by: xunxun on August 15, 2011, 01:44:33 pm
it was 1G size, I guess no body would like to download this
I think reckless built the tools using LTO, so the package is very large.
At the another point, we can mix LTO and PGO to build it, according to my test, PGO can reduce the package's size strikingly.
But building with PGO can cost very long time and there are some bugs when mixing LTO and PGO, for avoiding the errors, we must guarantee that the PGO information is gathered only once.
Title: Re: gcc-4.6.1 builds availiable
Post by: xunxun on August 15, 2011, 01:48:42 pm
atm i use wx's 64 bit OS check to set the 64 bit mingw compiler (it works) but some might want to use the 32 bit mingw on say win 7 64 and in that case it fails but i suspect i could make an option to select either one.
You can release the 32bit package and the 64bit package.
I think mixing 32bit and 64bit package is not a good idea.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 15, 2011, 10:05:56 pm
there not mixed in fact that is what im trying to avoid at all cost ;) as that would indeed screw things up badly.

Code
void CompilerMINGW::Reset()
{
/* yep its windose */
    if (platform::windows)
    {
/* checking OS is it 64 bit ? */
        if (wxIsPlatform64Bit())
        {
/* we got a 64 bit OS set the MinGW 64 compiler */
            m_Programs.C         = _T("x86_64-w64-mingw32-gcc.exe");
            m_Programs.CPP       = _T("x86_64-w64-mingw32-g++.exe");
            m_Programs.LD        = _T("x86_64-w64-mingw32-g++.exe");
            m_Programs.DBG       = _T("gdb.exe");
            m_Programs.LIB       = _T("ar.exe");
            m_Programs.WINDRES   = _T("windres.exe");
            m_Programs.MAKE      = _T("winmake.exe");
        }
        else
        {
/* 32 bit OS set the MinGW32 compiler */
            m_Programs.C         = _T("i686-w64-mingw32-gcc.exe");
            m_Programs.CPP       = _T("i686-w64-mingw32-g++.exe");
            m_Programs.LD        = _T("i686-w64-mingw32-g++.exe");
            m_Programs.DBG       = _T("gdb.exe");
            m_Programs.LIB       = _T("ar.exe");
            m_Programs.WINDRES   = _T("windres.exe");
            m_Programs.MAKE      = _T("winmake.exe");
        }
/* heh and now it gets hairy cause i just destroyed the check for the standard MinGW compiler :( */
    }
    else
    {
        m_Programs.C         = _T("gcc");
        m_Programs.CPP       = _T("g++");
        m_Programs.LD        = _T("g++");
        m_Programs.DBG       = _T("gdb");
        m_Programs.LIB       = _T("ar");
        m_Programs.WINDRES   = _T("");
        m_Programs.MAKE      = _T("make");
    }
    m_Switches.includeDirs             = _T("-I");
    m_Switches.libDirs                 = _T("-L");
    m_Switches.linkLibs                = _T("-l");
    m_Switches.defines                 = _T("-D");
    m_Switches.genericSwitch           = _T("-");
    m_Switches.objectExtension         = _T("o");
    m_Switches.needDependencies        = true;
    m_Switches.forceCompilerUseQuotes  = false;
    m_Switches.forceLinkerUseQuotes    = false;
    m_Switches.logging                 = clogSimple;
    m_Switches.libPrefix               = _T("lib");
    m_Switches.libExtension            = _T("a");
    m_Switches.linkerNeedsLibPrefix    = false;
    m_Switches.linkerNeedsLibExtension = false;
    m_Switches.supportsPCH             = true;
    m_Switches.PCHExtension            = _T("h.gch");
    m_Switches.UseFullSourcePaths      = true; // use the GDB workaround !!!!!!!!

    // Summary of GCC options: http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html

    m_Options.ClearOptions();
    m_Options.AddOption(_("Produce debugging symbols"),
                _T("-g"),
                _("Debugging"),
                _T(""),
                true,
                _T("-O -O1 -O2 -O3 -Os"),
                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
    wxString gprof_link = _T("-pg");
    if (platform::windows)
        gprof_link = _T("-pg -lgmon");
    m_Options.AddOption(_("Profile code when executed"), _T("-pg"), _("Profiling"), gprof_link);

    wxString category = _("Warnings");

    // warnings
    m_Options.AddOption(_("In C mode, support all ISO C90 programs. In C++ mode, remove GNU extensions that conflict with ISO C++"), _T("-ansi"), category);
    m_Options.AddOption(_("Enable all compiler warnings (overrides many other settings)"), _T("-Wall"), category);
    m_Options.AddOption(_("Enable extra compiler warnings"), _T("-Wextra"), category);
    m_Options.AddOption(_("Stop compiling after first error"), _T("-Wfatal-errors"), category);
    m_Options.AddOption(_("Inhibit all warning messages"), _T("-w"), category);
    m_Options.AddOption(_("Have g++ follow the 1998 ISO C++ language standard"), _T("-std=c++98"), category);
    m_Options.AddOption(_("Have g++ follow the coming C++0x ISO C++ language standard"), _T("-std=c++0x"), category);
    m_Options.AddOption(_("Enable warnings demanded by strict ISO C and ISO C++"), _T("-pedantic"), category);
    m_Options.AddOption(_("Treat as errors the warnings demanded by strict ISO C and ISO C++"), _T("-pedantic-errors"), category);
    m_Options.AddOption(_("Warn if main() is not conformant"), _T("-Wmain"), category);
    m_Options.AddOption(_("Enable Effective-C++ warnings (thanks Scott Meyers)"), _T("-Weffc++"), category);
    m_Options.AddOption(_("Warn whenever a switch statement does not have a default case"), _T("-Wswitch-default"), category);
    m_Options.AddOption(_("Warn whenever a switch statement has an index of enumerated type and lacks a case for one or more of the named codes of that enumeration"), _T("-Wswitch-enum"), category);
    m_Options.AddOption(_("Warn if a user supplied include directory does not exist"), _T("-Wmissing-include-dirs"), category);
    m_Options.AddOption(_("Warn if a global function is defined without a previous declaration"), _T("-Wmissing-declarations"), category);
    m_Options.AddOption(_("Warn if the compiler detects that code will never be executed"), _T("-Wunreachable-code"), category);
    m_Options.AddOption(_("Warn if a function can not be inlined and it was declared as inline"), _T("-Winline"), category);
    m_Options.AddOption(_("Warn if floating point values are used in equality comparisons"), _T("-Wfloat-equal"), category);
    m_Options.AddOption(_("Warn if an undefined identifier is evaluated in an '#if' directive"), _T("-Wundef"), category);
    m_Options.AddOption(_("Warn whenever a pointer is cast such that the required alignment of the target is increased"), _T("-Wcast-align"), category);
    m_Options.AddOption(_("Warn if anything is declared more than once in the same scope"), _T("-Wredundant-decls"), category);
    m_Options.AddOption(_("Warn about unitialized variables which are initialized with themselves"), _T("-Winit-self"), category);
    m_Options.AddOption(_("Warn whenever a local variable shadows another local variable, parameter or global variable or whenever a built-in function is shadowed"), _T("-Wshadow"), category);

    // optimization
    category = _("Optimization");
    m_Options.AddOption(_("Strip all symbols from binary (minimizes size)"), _T(""), category, _T("-s"), true, _T("-g -ggdb"), _("Stripping the binary will strip debugging symbols as well!"));
    m_Options.AddOption(_("Optimize generated code (for speed)"), _T("-O"), category);
    m_Options.AddOption(_("Optimize more (for speed)"), _T("-O1"), category);
    m_Options.AddOption(_("Optimize even more (for speed)"), _T("-O2"), category);
    m_Options.AddOption(_("Optimize fully (for speed)"), _T("-O3"), category);
    m_Options.AddOption(_("Optimize generated code (for size)"), _T("-Os"), category);
    m_Options.AddOption(_("Expensive optimizations"), _T("-fexpensive-optimizations"), category);
    m_Options.AddOption(_("Don't keep the frame pointer in a register for functions that don't need one"), _T("-fomit-frame-pointer"), category);
    // machine dependent options - cpu arch
    category = _("CPU architecture tuning (choose none, or only one of these)");
    m_Options.AddOption(_("i386"), _T("-march=i386"), category);
    m_Options.AddOption(_("i486"), _T("-march=i486"), category);
    m_Options.AddOption(_("Intel Pentium"), _T("-march=i586"), category);
    m_Options.AddOption(_("Intel Pentium (MMX)"), _T("-march=pentium-mmx"), category);
    m_Options.AddOption(_("Intel Pentium PRO"), _T("-march=i686"), category);
    m_Options.AddOption(_("Intel Pentium 2 (MMX)"), _T("-march=pentium2"), category);
    m_Options.AddOption(_("Intel Pentium 3 (MMX, SSE)"), _T("-march=pentium3"), category);
    m_Options.AddOption(_("Intel Pentium 4 (MMX, SSE, SSE2)"), _T("-march=pentium4"), category);
    m_Options.AddOption(_("Intel Pentium 4 Prescott (MMX, SSE, SSE2, SSE3)"), _T("-march=prescott"), category);
    m_Options.AddOption(_("Intel Pentium 4 Nocona (MMX, SSE, SSE2, SSE3, 64bit extensions)"), _T("-march=nocona"), category);
    m_Options.AddOption(_("Intel Pentium M (MMX, SSE, SSE2)"), _T("-march=pentium-m"), category);
    m_Options.AddOption(_("Intel Core2 (MMX, SSE, SSE2, SSE3, SSSE3, 64bit extensions)"), _T("-march=core2"), category);
m_Options.AddOption(_("Intel Corei7 (MMX, SSE, SSE2, SSE3, SSSE3, 64bit extensions)"), _T("-march=corei7"), category);
    m_Options.AddOption(_("AMD K6 (MMX)"), _T("-march=k6"), category);
    m_Options.AddOption(_("AMD K6-2 (MMX, 3DNow!)"), _T("-march=k6-2"), category);
    m_Options.AddOption(_("AMD K6-3 (MMX, 3DNow!)"), _T("-march=k6-3"), category);
    m_Options.AddOption(_("AMD Athlon (MMX, 3DNow!, enhanced 3DNow!, SSE prefetch)"), _T("-march=athlon"), category);
    m_Options.AddOption(_("AMD Athlon Thunderbird (MMX, 3DNow!, enhanced 3DNow!, SSE prefetch)"), _T("-march=athlon-tbird"), category);
    m_Options.AddOption(_("AMD Athlon 4 (MMX, 3DNow!, enhanced 3DNow!, full SSE)"), _T("-march=athlon-4"), category);
    m_Options.AddOption(_("AMD Athlon XP (MMX, 3DNow!, enhanced 3DNow!, full SSE)"), _T("-march=athlon-xp"), category);
    m_Options.AddOption(_("AMD Athlon MP (MMX, 3DNow!, enhanced 3DNow!, full SSE)"), _T("-march=athlon-mp"), category);
    m_Options.AddOption(_("AMD K8 core (x86-64 instruction set)"), _T("-march=k8"), category);
    m_Options.AddOption(_("AMD Opteron (x86-64 instruction set)"), _T("-march=opteron"), category);
    m_Options.AddOption(_("AMD Athlon64 (x86-64 instruction set)"), _T("-march=athlon64"), category);
    m_Options.AddOption(_("AMD Athlon-FX (x86-64 instruction set)"), _T("-march=athlon-fx"), category);

    m_Commands[(int)ctCompileObjectCmd].push_back(CompilerTool(_T("$compiler $options $includes -c $file -o $object")));
    m_Commands[(int)ctGenDependenciesCmd].push_back(CompilerTool(_T("$compiler -MM $options -MF $dep_object -MT $object $includes $file")));
    m_Commands[(int)ctCompileResourceCmd].push_back(CompilerTool(_T("$rescomp $res_includes -J rc -O coff -i $file -o $resource_output")));
    m_Commands[(int)ctLinkConsoleExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs")));
    if (platform::windows)
    {
        m_Commands[(int)ctLinkNativeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs --subsystem,native")));
        m_Commands[(int)ctLinkExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -mwindows")));
        m_Commands[(int)ctLinkDynamicCmd].push_back(CompilerTool(_T("$linker -shared -Wl,--output-def=$def_output -Wl,--out-implib=$static_output -Wl,--dll $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs")));
    }
    else
    {
        m_Commands[(int)ctLinkExeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // no -mwindows
        m_Commands[(int)ctLinkNativeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // no -mwindows
        m_Commands[(int)ctLinkDynamicCmd].push_back(CompilerTool(_T("$linker -shared $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs")));
    }
    m_Commands[(int)ctLinkStaticCmd].push_back(CompilerTool(_T("$lib_linker -r -s $static_output $link_objects")));

    LoadDefaultRegExArray();

    m_CompilerOptions.Clear();
    m_LinkerOptions.Clear();
    m_LinkLibs.Clear();
    m_CmdsBefore.Clear();
    m_CmdsAfter.Clear();
    SetVersionString();
}

as you can see it kept it seperate but in doing it like this i broke the standard MinGW compiler detection.

Code
AutoDetectResult CompilerMINGW::AutoDetectInstallationDir()
{
    // try to find MinGW in environment variable PATH first
    wxString pathValues;
    wxGetEnv(_T("PATH"), &pathValues);
    if (!pathValues.IsEmpty())
    {
        wxString sep = platform::windows ? _T(";") : _T(":");
        wxChar pathSep = platform::windows ? _T('\\') : _T('/');
        wxArrayString pathArray = GetArrayFromString(pathValues, sep);
        for (size_t i = 0; i < pathArray.GetCount(); ++i)
        {
            if (wxFileExists(pathArray[i] + pathSep + m_Programs.C))
            {
                if (pathArray[i].AfterLast(pathSep).IsSameAs(_T("bin")))
                {
                    m_MasterPath = pathArray[i].BeforeLast(pathSep);
                    return adrDetected;
                }
            }
        }
    }

    wxString sep = wxFileName::GetPathSeparator();
    if (platform::windows)
    {
        // look first if MinGW was installed with Code::Blocks (new in beta6)
        m_MasterPath = ConfigManager::GetExecutableFolder();
        if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
{
            // if that didn't do it, look under C::B\MinGW32 or C::B\MinGW64, too (new in 08.02)
            m_MasterPath += wxIsPlatform64Bit() ? sep + _T("MinGW64") : sep + _T("MinGW32");

            if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
            {
#ifdef __WXMSW__ // for wxRegKey
                // not found...
                // look for dev-cpp installation
                wxRegKey key; // defaults to HKCR
                key.SetName(_T("HKEY_LOCAL_MACHINE\\Software\\Dev-C++"));
                if (key.Exists() && key.Open(wxRegKey::Read))
                {
                    // found; read it
                    key.QueryValue(_T("Install_Dir"), m_MasterPath);
                }
                else
                {
                    // installed by inno-setup
                    // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Minimalist GNU for Windows 4.1_is1
                    wxString name;
                    long index;
                    key.SetName(_T("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"));
                    //key.SetName("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion");
                    bool ok = key.GetFirstKey(name, index);
                    while (ok && !name.StartsWith(_T("Minimalist GNU for Windows")))
                    {
                        ok = key.GetNextKey(name, index);
                    }
                    if (ok)
                    {
                        name = key.GetName() + _T("\\") + name;
                        key.SetName(name);
                        if (key.Exists() && key.Open(wxRegKey::Read))
                            key.QueryValue(_T("InstallLocation"), m_MasterPath);
                    }
                }
#endif
            }
        }
        else
            m_Programs.MAKE = _T("make.exe"); // we distribute "make" not "mingw32-make"
    }
    else
        m_MasterPath = _T("/usr");

    AutoDetectResult ret = wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C) ? adrDetected : adrGuessed;
    // don't add lib/include dirs. GCC knows where its files are located

    SetVersionString();
    return ret;
}


and this is the same problem.

Code
    if (master_path.IsEmpty())
    {
        /* Notice: In general this is bad luck as e.g. all copies of a
         * compiler have a different path, most likely.
         * Thus the following might even return a wrong command!
         */

/* revelator aye this is not portable as is */
        if (platform::windows)
    m_MasterPath += wxIsPlatform64Bit() ? _T("C:\\CodeBlocks\\MinGW64") : _T("C:\\CodeBlocks\\MinGW32");
        else
            master_path = _T("/usr");
    }

and the hardcoded option which normally just looks in C:\\MinGW

the big size of the package is because theres a whole plethora of tools and libraries included not so much LTO related actually i compiled this with -fno-lto.

the list of whats in it is rather large still working on it. but to name a few theres my mingw python (old version but it works) with a whole slew of plugins and tools like wxpython and PyQt which are large by themself and several tools that use these.

then theres ruby with tools.

and offcourse all the dependant libraries. keept size down a bit by only using shared libraries eg. dll's.

could cut sizes further by removing the includes and import libraries but then noone could do any plugins of their own to say python without rebuilding those.

so its the usual choice between apples and rotten tomatoes.


Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 15, 2011, 11:34:42 pm
well since people obviously still use 56K modems (joke) :) i decided to make a minimal package as well.

no extras no svn no hg no git no python no ruby and no development libraries only mingw32 and mingw64 + Msys and codeblocks.

ill pack the extras up as seperate packages that can be unzipped directly in the codeblocks folder.

new structure will be a bit different for the extras.

atm the extras reside in the local folder this will change for the minimal package and all will be in the Opt folder so something like this C:\CodeBlocks\Opt\plugin1 C:\CodeBlocks\Opt\plugin2 etc.

all tools will have there own folder under Opt.

all extras will have scripts in /etc/profile.d setting paths to tools libraries and headers, so removing something from the build chain is as easy as removing the script for it from the /etc/profile.d folder.

i hope this is more to peoples taste.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 16, 2011, 10:26:56 am
well you will have a few tools youre not used to in my package :)

i finally managed to port openjade to msys and with that you now have access to the full docbook suite ;) 

damn thing took me years to port so you better bow hehe. 

the bow part is offcourse a joke ;)
Title: Re: gcc-4.6.1 builds availiable
Post by: Jenna on August 16, 2011, 10:46:51 am
well since people obviously still use 56K modems (joke) :) i decided to make a minimal package as well.

Not really a joke.
In germany in some places you are still forced to use slow connections.
At home I still only have ISDN, which means 64 kBit normally or as amximum 128 kBit, if both channels are used.
Title: Re: gcc-4.6.1 builds availiable
Post by: thomas on August 16, 2011, 10:55:11 am
Heh, I would not download something that is 1GB on my 50 Mbit line either, unless that is something like a complete operating system DVD.  That's 5 times larger than Eclipse 8)
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 16, 2011, 12:59:16 pm
minimal version uploaded :)  it should be a bit more digestable.

had no idea about that jens jokes on me then :(.

i can atleast pass from one of my friends from inside3d that the big package works pretty well for those who can afford to download it.

ill still make all my ports and utilities availiable to those using the minimal package as seperate downloads.

allready a small bunch of things to download, but i need to reorder the site a bit so people dont get confused and start owerwriting stuff the compiler allready has installed. 

no harm in doing so but they might get a bit dissapointed when they discover that it doesnt add anything besides what they allready had.

atm most of the smaller downloads are allready in the installer besides the irrlicht sdk.
Title: Re: gcc-4.6.1 builds availiable
Post by: xunxun on August 16, 2011, 01:19:35 pm
I think you can try the method:
built with "-flto", and then using objcopy -R to remove your libraries' LTO information,
in the end the package will be small.

Another: using PGO also can reduce the libraries' size.
Title: Re: gcc-4.6.1 builds availiable
Post by: oBFusCATed on August 16, 2011, 01:31:18 pm
Reckless, why would I want to download something if there is no list with the things contained in this something?
Especially an executable?!

p.s. Please fix you shift, button and start to use it, especially when writing something, half official :)
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 16, 2011, 02:50:15 pm

Besides my own additions to the msys package its just C::B+ MinGW32 and MinGW64 (version 4.6.1)
coreutils 2.22 (not released but only one that seems to support the LTO plugin correctly).

If you want to know which additions i made to Msys heres a short list.

Updated some api stuff to support building newer posix stuff (msyscore internal) (version ? since its my own hackery we could call it 1.0).

By ported i mean made to work with Msys itself.

Ported ncurses to msys and made bash and sh use it instead of termios. allows for more color styles. (version 5.7)
Ported rsync (very powerfull client/server). (version 3.8 )
Ported abook (address book gimmick). (version ? did it way back)
Ported openjade and opensp as well as Cygwins Docbook system to Msys. (used for creating documentation from xml pages) (OpenSP version 1.5.2 and OpenJade 1.3.3-1)
Added xslt (needed by some doc tools). (version 1.73.2)
Ported lynx (console browser. also used by some applications for downloading stuff like perl when updating CPAN packages). (version 1.48)
Ported pth threads (thread library). (version 2.07)
Ported coreutils 8.10-1 (newer again). (version 8.10-1)
Ported s-lang (like ncurses a terminal library). (version 2.2.2)
Ported zsh (z shell from dave korn can use it instead of bash if you like it better). (version 4.3.10)
Ported yaml (data serialization). (version 0.71)
Ported neon (http and webdav library). (0.28.4)
Ported cocom (compiler build tool used internally in some projects). (version 0.996)
Ported gpg. (might also be availiable from mingw site though). (version 1.4.11)
Ported xmlto (openjade uses it for building its own documentation). (version 0.0.21)
Ported gsar (general search and replace) stems back from the dos days but its rather handy. (version 121)
Autotools (added pretty much any version of autoconf and automake with wrappers to msys). (automake 1.4 to 1.11 and autoconf 2.13 to 2.68)
Ported curl (another fine tool for transfering stuff by net). (version 7.19.0)

Ill add this info to the site also.

Title: Re: gcc-4.6.1 builds availiable
Post by: oBFusCATed on August 16, 2011, 03:26:11 pm
And this is 1gb? You're kidding me.
For full readability you should add version numbers.
You should state what "ported" means.
Because as far as I know curl works perfectly on windows...for example.

And of course you're ignoring the shift-key advise (add to it no-new-lines-advise between lines).
Your posts are barely readable, most of the time I'm just ignoring them.

BTW. this topic should be moved somewhere else because it is not related to C::B development at all.
Title: Re: gcc-4.6.1 builds availiable
Post by: ollydbg on August 16, 2011, 03:35:14 pm
And of course you're ignoring the shift-key advise (add to it no-new-lines-advise between lines).
Your posts are barely readable.
Agreed, and reckless's posts sometimes were hard to read and understand, You should wrote clearly, especially I'm not a native English speaker.
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 16, 2011, 03:43:53 pm
Ok big fat readme at the bottom of the files page, and i started reordering things a bit.
Ill update the readme with new additions.
Uploading select packages to there respective folders now.
SoftWare Development Kits will contain things like IrrLicht and Ogre Sdk's and the file ending will contain 32 or 64 to point out which architecture it was build for.
Tools Will be for general use. Ill Probably add stuff like My MinGW python to this.
Msys Specific will be for Msys tools And Libraries.
Sources Will Contain My ported sources.

uploading things now.


Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 16, 2011, 03:57:40 pm
Am i that hard to read ?.  Sorry about that, ill see if i can write a bit cleaner, but english is not my native language either.
It is not 1 GB anymore, im removing that package as it seems to confuse people. The new package is about 360 mb still big but im working on stripping everything to the bone,
so i might be able to squash its size a little more. Everything that was in the old package will be uploaded as seperate packages.

And sorry for the offtopic stuff its not exactly related to C::B itself. I just wanted to create something as ready to go as possible for people not used to working with a gcc compiler.

Title: Re: gcc-4.6.1 builds availiable
Post by: Dreamy on August 21, 2011, 06:22:05 pm
Okey, I've read whole thread and it really needs to be a crypto analyst to extract a simple "what the hell is this":

Hello, I'm XY
and I'm trying to do XY,
I believe it's gonna be really useful for XY.

Until now, I've done:
- this
- this
- and this

And if I do:
- this
- this
- and this

It's gonna be the best stuff ever.


So if you say I just wanted to create something as ready to go as possible for people not used to working with a gcc compiler, I am pretty sure those people would love an introduction like this.

P.S.: Is this thread in right category?
Title: Re: gcc-4.6.1 builds availiable
Post by: reckless on August 22, 2011, 02:22:11 pm
I think the message came through that i need to be a little more clear. 
In short it was an attempt to make an easy to use package for the MinGW64 compilers with C::B,
plus a posix shell environment with some otherwise not to easy things allready setup for use.

Question.
So why would i need Msys for C::B ?.
A: Because many tools and libraries you might need dont have a C::B workspace.
B: To port something from say linux to windows, and use it in your application.
C: Because one of the tools you intend to use needs a posix shell.

Hmm might be usefull.

Answer.
A: I only use windows libraries or tools ported from msvc.
B: see A.
C: I dont use scripts and/or autotools again see A.

Cool go ahead and use the normal distribution :) .