(CDT 3.1 RC2 managed build) Switch between mingw and cygwin toolchains [message #170624] |
Thu, 01 June 2006 21:00  |
Eclipse User |
|
|
|
I just started using eclipse CDT 3.1 RC2 with a managed C++ project and I
am trying to figure out how to easily switch between different toolchains.
The problem is I have mingw, cygwin, and a specialized linux powerpc
toolchain all installed on my windows machine. All of these toolchains
are gcc based and they use the same commands (gcc, g++, ar, etc) so I
don't really need a custom managed builder for each. The only real
difference is that each toolchain is located in a different directory.
I tried to force CDT to use the cygwin compiler by prepending
"c:\cygwin\bin;" to the "PATH" environment variable under the
properties->C/C++ Build->Environemnt tab. But that didn't work. CDT
still is using the mingw g++ since mingw is the only toolchain that adds
itslef to the windows system PATH. What is the recomended way to switch
compilers?
On the same subject, I noticed that whenever I create a new managed make
project, all of the mingw standard include paths are automatically added
to the include folder in the project tree. What If I wanted to use the
standard includes from cygwin or our linux powerpc toolchain instead?
What are these paths really used for anyway? I never explicitly add
standard header paths using the g++ -I option since the compiler typically
knows where its standard headers are located.
Doug
|
|
|
|
|
|
|
|
Re: (CDT 3.1 RC2 managed build) Switch between mingw and cygwin toolchains [message #170816 is a reply to message #170777] |
Mon, 05 June 2006 22:10   |
Eclipse User |
|
|
|
> like for example cygwin_. CDT seems still to assume that cygwin is
> in the previous path so mingw is used instead.
Thanks, that works. Actually, CDT seems to pull the cygwin path from the
registry upon restart - HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus
Solutions\Cygwin\mounts v2 (at least it doesn't search all the drives for
it).
So, after searching through the documentation for cygwin (particulary
http://cygwin.com/faq/faq.setup.html#faq.setup.registry), I found that
you're able to remove or change the information in the registry using
cygwin's mount.
You can "trick" eclipse unto using different toolchains by manipulating the
cygwin mountpoints with a batch file:
c:\cygwin\bin\mount -f -s -b "C:\msys\1.0/bin" "/usr/bin"
c:\cygwin\bin\mount -f -s -b "C:\msys\1.0/lib" "/usr/lib"
c:\cygwin\bin\mount -f -s -b "C:\msys\1.0" "/"
There are some small problems with this approach, but nothing that isn't
possible to fix:
* using mingw without msys - mingw's make is called mingw32-make, so you
won't be able to transparently switch between projects (and if you do
provide a make.exe as a copy or link to mingw32-make.exe, you could get into
troubles when you want to use msys later on)
* using msys alone isn't enough, you have to provide the path to mingw as
well. Fortunately, CDT is "dumb" and prepends everything it finds in the
registry to the path so you can simply write
c:\cygwin\bin\mount -f -s -b "C:\msys\1.0\bin;c:\MinGW\bin" "/usr/bin"
* You need to restart Eclipse for the changes to take effect
* I have no idea what manipulating mountpoints does to services running
under cygwin, so if you're using cygwin heavily for real work (and not just
for the ocassional bash session), this might not be for you.
Hope someone will find this useful,
Kim
|
|
|
|
Powered by
FUDForum. Page generated in 0.03123 seconds