GCC_EXEC_PREFIX setup etc.

Miscellaneous Forums/General Discussion/GCC_EXEC_PREFIX setup etc.

After test MinGW for a while, I found why it has problem on Vista if we install MinGW on a secondary directory like C:\Dev\MinGW, so please test it if you have time and can stand messing up your MinGW for a short while.

No copy executable etc needed like the mod thread said, just keep the MinGW setup intact.

Let's say we install MinGW to "C:\Dev\MinGW"
It'll requre following variables:

1.MinGW
C:\Dev\MinGW

2.GCC_EXEC_PREFIX
C:\Dev\MinGW\lib\gcc\
(note the trailing slash or it won't work)

3.PATH
C:\Dev\MinGW\bin;C:\Dev\MinGW\libexec\gcc\mingw32\3.4.2
(or 3.4.5 if you're using current MinGW)

That's minimum things to work with BlitzMax, if you're working it with Code::Blocks, you may need more set some lib and include path.

Tested GCC_EXEC_PREFIX for many times and finally found where the gcc executable look, this only tested on Vista Home Preminium and XP SP2.

May not work on your configuration tho, and I didn't look into full MinGW configuration yet.

There are a number of ways to use MINGW one way is to write a batch file to setup the MINGW variables and start the application, this saves you messing around with the windows enviroment variables (and confusion when you have other compilers installed).

Here's one I did ages ago http://www.blitzbasic.com/Community/posts.php?topic=67297

The other is the way you mentioned. Though to keep the path enviroment variable easier to read. I would set the paths for MINGW in the MINGW variable and just add %MINGW%; to the paths variable.

One other thing.... Vista users and the UAC.
The best way of working any applications like BlitzMax is not to install it in the "Program Files" directory (this also goes for any project files), but to install into another directory and set the directories file permissions for other users if needed.

I saw that your batch has more complete, I'll try to implement it with some way, thanks.

I'm messing this with BMK Source, calling win32 extern, using API "SetEnvironmentVariableA" then call a local version of MinGW, it works, if I think it' stable enough I'll post the modify up.

[EDIT]
NVM, there's more cleaner way, posted below.
[/EDIT]

BTW, modules seems compile fine with g++ only, dunno if I need to include Obj-C or other compiles into the distribution.

OK, that's it, and don't write to system variables, very small tweak, nothing special.

edit your BMK source, insert

?Win32
putenv_ "MinGW="+BlitzMaxPath()+"/mingw"
putenv_ "GCC_EXEC_PREFIX="+BlitzMaxPath()+"/mingw/lib/gcc/"
putenv_ "PATH="+BlitzMaxPath()+"/mingw/bin;"+BlitzMaxPath()+"/mingw/libexec/gcc/mingw32/3.4.2"
?


Before "If AppArgs.length<2 CmdError"

and put a copy of installed MinGW to your BlitzMax directory.

It's a dumb way and I just test recompile brl/pub/axe(axe is from 1.26) OK, I didn't preserve the original PATH(only effective in current process), you can simply getenv_ and put it in the tail if you want.