Author Topic: Setting codeblocks to auto-detect MinGW32 & MinGW64 cross compilers.  (Read 7601 times)

Offline PerryWerneck

  • Multiple posting newcomer
  • *
  • Posts: 21
Hi,

I was wondering how complex is to setup the linux versio of codeblocks to auto-detect MinGW32 and MinGW64 cross-compilers and create the right settings.

I looked for some info at the compilers/compiler_*.xml files but seens like it detects the compiler based on the instalation path am I right? The problem is: On OpenSUSE packets the mingw compilers are installed in the normal system path with modified names (see below) and they'r not automatically detected. One can always configure the compilers manually but, I think, it would be better if everithing goes "automagically"

Is the compiler_*.xml files the right & better way? Am I doing something wrong? Glad if someone points me to the right direction.

The MinGW paths on OpenSUSE (and, problably, other distros):

32 bits:

/usr/bin/i686-w64-mingw32-gcc
/usr/bin/i686-w64-mingw32-gcc-4.8.3
/usr/bin/i686-w64-mingw32-gcc-ar

64 bits:

/usr/bin/i686-w64-mingw32-gcc
/usr/bin/i686-w64-mingw32-gcc-4.8.3
/usr/bin/i686-w64-mingw32-gcc-ar

---
Perry Werneck
Brasilia - DF - Brazil

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Setting codeblocks to auto-detect MinGW32 & MinGW64 cross compilers.
« Reply #1 on: July 10, 2014, 02:53:44 am »
For simple detection routines, this can be done via the xml configs.  To start with, you could copy compiler_clang.xml and options_gcc.xml to (for example) compiler_NewId.xml and options_NewId.xml (Edit: Or even easier, create a options_* file with the extends attribute on gcc.).  Edit the relevant descriptions and id in the compiler_*, and the <Program name=* value="NewExecutable"/> in the options_* .

This should give you a working starting point (though, much refinement will probably be needed).  See documentation: compiler_*.xml and options_*.xml.

(For more complicated autodetection, and other accessories, explore implementations in compilerMINGW.cpp and related files.)
« Last Edit: July 10, 2014, 03:03:59 am by Alpha »

Offline PerryWerneck

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Setting codeblocks to auto-detect MinGW32 & MinGW64 cross compilers.
« Reply #2 on: July 11, 2014, 02:23:02 am »
Hi,

Thanks! That was I need. It's detecting the cross compiler with a few adjustments in the xml files. Will work with the options to see if it's working.
---
Perry Werneck
Brasilia - DF - Brazil

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Setting codeblocks to auto-detect MinGW32 & MinGW64 cross compilers.
« Reply #3 on: July 11, 2014, 08:14:00 am »
Thanks! That was I need. It's detecting the cross compiler with a few adjustments in the xml files. Will work with the options to see if it's working.
Contributions of new compilers to (public) C::B are welcome, btw... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline PerryWerneck

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Setting codeblocks to auto-detect MinGW32 & MinGW64 cross compilers.
« Reply #4 on: July 16, 2014, 02:15:54 am »
Hi,

Great! I'll submit the xml file as soon as I have time to test it better. Just had to delay the tests 'cause of a big project who starts this days but I'll back to it as soon as it finishes.


By the way I'm keeping the source in my personal codeblocks package, comments will be appreciated.  ;D

https://build.opensuse.org/package/show/home:PerryWerneck/codeblocks
---
Perry Werneck
Brasilia - DF - Brazil