Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: tiwag on January 02, 2007, 03:19:50 pm

Title: cygwin support
Post by: tiwag on January 02, 2007, 03:19:50 pm
thanks for adding the cygwin support

i've tested it with some of my cygwin projects and building and debugging is working fine  :D

i wonder, how the cygwin pathes are set up from within CB ?
can you tell me how you did initialize the cygwin environment from within CB ?

example: built using cygwin compiler ...
Code: [Select]
#include <stdio.h>
#include <stdlib.h>

main()
{
    char *envp = getenv("PATH");
    printf("PATH=\n%s\n\n",envp);
    return 0;
}

... and run from CB prints
Code: [Select]
PATH=
/usr/bin:/cygdrive/c/Python24/:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/
System32/Wbem:/cygdrive/d/Programme/Subversion/bin:/cygdrive/d/Programme/Gemeinsame Dateien/GTK/2.0/
bin:/cygdrive/d/IAR/EXE:/cygdrive/d/TOOLS

thanks,
--tiwag
Title: Re: cygwin support
Post by: MortenMacFly on January 02, 2007, 04:21:18 pm
can you tell me how you did initialize the cygwin environment from within CB ?
AFAIK it's based on reading the Cygwin drive prefix from the registry (e.g. "cygdrive")) and then just exchanging the drive letter with /cygdrive/[DRV_LETTER].
Anyway, keep in mind that your application actually should already use the Cygwin layer at run-time to print the PATH's. Thus the printout (which is fully correct btw) should originate from Cygwin (DLL)...?!
With regards, Morten.
Title: Re: cygwin support
Post by: tiwag on January 02, 2007, 04:28:26 pm
can you tell me how you did initialize the cygwin environment from within CB ?
AFAIK it's based on reading the Cygwin drive prefix from the registry (e.g. "cygdrive")) and then just exchanging the drive letter with /cygdrive/[DRV_LETTER].
Anyway, keep in mind that your application actually should already use the Cygwin layer at run-time to print the PATH's. Thus the printout (which is fully correct btw) should originate from Cygwin (DLL)...?!
With regards, Morten.

this means with other words, that CB only adds "X:\cygwin\bin" to the actual PATH environment variable and that's it ?
thanks for giving me the hint !
--tiwag