Author Topic: cygwin support  (Read 3592 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
cygwin support
« 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
#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
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: cygwin support
« Reply #1 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.
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 tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: cygwin support
« Reply #2 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