View previous topic :: View next topic |
Author |
Message |
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Thu Mar 03, 2005 11:26 am Post subject: cygwin |
|
|
There're a number of issues with Build on Cygwin.
First, build.d, util/fdt.d, util/pathext.d, and source.d, should add this line:
Code: | version(Unix) version = Posix; |
Because gdc on Cygwin defines Unix and not much else, I think.
Also, in util/fdt.d, this should be added:
Code: | version(Unix)
{
import std.c.unix;
} |
In a misterious bug (it shouldn't have compiled on linux), build.d has 'vUseResponseFile' defined only on Windows, so its static ctor fails. That variable should be moved outside the version(Windows) block.
After that, it compiles and runs ok.
However, it still doesn't work. gdc doesn't recognize '-version': it uses '-fversion', instead. Also, '-op' shouldn't be used, and neither '-of'. Instead of '-of<target>' it should be '-o <target>'. I don't know about '-op'. (notice that this holds for all gdc and not only on Cygwin)
Finally, the main problem: I don't know what file gdc uses as config file, but Build also fails trying to include Phobos modules in the command line.
Maybe I should try to compile Build on gdc/linux to see what happens. |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Thu Mar 03, 2005 3:31 pm Post subject: Re: cygwin |
|
|
Carlos wrote: | In a misterious bug (it shouldn't have compiled on linux), build.d has 'vUseResponseFile' defined only on Windows, so its static ctor fails. That variable should be moved outside the version(Windows) block. |
I guess it was introduced in 1.9, because now Build doesn't compile on linux. Doing the change fixes it. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Thu Mar 03, 2005 5:00 pm Post subject: |
|
|
Ok, the vUseResponseFile was a mistake. I didn't see the enclosing version(Windows) block.
I'll set Posix if Unix (or unix) is set. However, are you sure the import module for Unix is because the other OpSys import modules take the format Code: | import std.c.unix.unix; |
I'll fix up the GDC command line switches. I didn't know that there were any differences. I'm not sure how the lack of a "-op" switch will effect things. When I use this with DigitalMars, all the object files are created in the same directory as their respective source files, so I hope that's how GDC does it.
I was told that GDC does not use a configuration file, so I don't try to analyze any for it. Should I?
The way that the phobos issue works is that Build scans the full path name for every import file and if it finds the substring "/phobos/" it will ignore that module (that is, it won't compile it). So all I can guess is that the path name that build sees does not have it in it. If you use the -V switch on build, you should see what path names it is using.
I'll release the updated build in a few hours if I don't find anything else. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Thu Mar 03, 2005 6:39 pm Post subject: |
|
|
Derek Parnell wrote: | I'll set Posix if Unix (or unix) is set. However, are you sure the import module for Unix is because the other OpSys import modules take the format Code: | import std.c.unix.unix; |
|
Yes, I'm sure.
Derek Parnell wrote: | I'll fix up the GDC command line switches. I didn't know that there were any differences. I'm not sure how the lack of a "-op" switch will effect things. When I use this with DigitalMars, all the object files are created in the same directory as their respective source files, so I hope that's how GDC does it. |
gdc has a script named "dmd" to convert DMD parameters to gdc. So, keeping dmd is an option. However, I (and maybe others too) have dmd before gdc in the path, expecting to get Walter's dmd and David's gdc, so that'd be a problem.
Derek Parnell wrote: | I was told that GDC does not use a configuration file, so I don't try to analyze any for it. Should I? |
Well, if it doesn't have it, it doesn't have it.
Derek Parnell wrote: | The way that the phobos issue works is that Build scans the full path name for every import file and if it finds the substring "/phobos/" it will ignore that module (that is, it won't compile it). So all I can guess is that the path name that build sees does not have it in it. If you use the -V switch on build, you should see what path names it is using. |
Then the solution would be to do "-IPATH_TO_PHOBOS" ?
How about a pragma: pragma(phobos, "path_to_phobos") ? Or a environment variable PHOBOS? Just ideas. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Thu Mar 03, 2005 11:35 pm Post subject: |
|
|
Carlos wrote: | Derek Parnell wrote: | The way that the phobos issue works is that Build scans the full path name for every import file and if it finds the substring "/phobos/" it will ignore that module (that is, it won't compile it). So all I can guess is that the path name that build sees does not have it in it. If you use the -V switch on build, you should see what path names it is using. |
Then the solution would be to do "-IPATH_TO_PHOBOS" ?
How about a pragma: pragma(phobos, "path_to_phobos") ? Or a environment variable PHOBOS? Just ideas. |
I notice that GDC seems to use an environment symbol called DFLAGS. So I now scan this, as well as any configuration file specified. So you would need to set DFLAGS to have a "-IPATH_TO_PHOBOS" in it. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Fri Mar 04, 2005 8:15 am Post subject: |
|
|
Derek Parnell wrote: | I notice that GDC seems to use an environment symbol called DFLAGS. So I now scan this, as well as any configuration file specified. So you would need to set DFLAGS to have a "-IPATH_TO_PHOBOS" in it. |
It'd be good if someone could confirm that. If confirmed, then I think it'd be a good idea. |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Fri Mar 04, 2005 8:40 am Post subject: |
|
|
Derek Parnell wrote: | I notice that GDC seems to use an environment symbol called DFLAGS. So I now scan this, as well as any configuration file specified. So you would need to set DFLAGS to have a "-IPATH_TO_PHOBOS" in it. |
Aaargh, it doesn't work yet. You said Build scans for roots and if it finds "phobos", it doesn't compile those files. Well, gdc (gcc in general) use /usr/include/ (/usr/include/d/ for gdc) for includes. No "phobos", then they're passed to the compiler, then it fails.
I wish David (and Anders too) could join us here and help a bit. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Fri Mar 04, 2005 3:12 pm Post subject: |
|
|
Carlos wrote: | Derek Parnell wrote: | I notice that GDC seems to use an environment symbol called DFLAGS. So I now scan this, as well as any configuration file specified. So you would need to set DFLAGS to have a "-IPATH_TO_PHOBOS" in it. |
Aaargh, it doesn't work yet. You said Build scans for roots and if it finds "phobos", it doesn't compile those files. Well, gdc (gcc in general) use /usr/include/ (/usr/include/d/ for gdc) for includes. No "phobos", then they're passed to the compiler, then it fails.
I wish David (and Anders too) could join us here and help a bit. |
Try using the switch -Xd on build's command line. That will cause it to exclude any import paths that contain "/d/" in them. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Tue Mar 15, 2005 8:22 pm Post subject: |
|
|
Derek Parnell wrote: | Try using the switch -Xd on build's command line. That will cause it to exclude any import paths that contain "/d/" in them. |
While testing this workaround, I discovered a few mistakes in the code. Thanks for making be see things from a different perspective. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|