View previous topic :: View next topic |
Author |
Message |
sylverpyro
Joined: 23 May 2006 Posts: 28
|
Posted: Tue Jan 23, 2007 12:19 pm Post subject: Some odd scenarios for build.cfg |
|
|
I have a few quick questions about the nuances of the build.cfg file and how the options are interpreted.
First off, if a person has a windows or linux box and Both GDC and DMD compilers installed, how does build decide which to use?
Related to this, if you have a [DigitalMars] And [GNU] declaration in build.cfg, how do you know which of the two it decided to use (again assuming the above scenario)?
Finally, is there any way to, say in the .cfg file, have build run a script or some other action after either a failed or successful build? (I ask this because the -cleanup command does not get run if there is a compier error, and -op does not seem to work either for keeping .o files in the same folder as the .d source files anymore) |
|
Back to top |
|
|
sylverpyro
Joined: 23 May 2006 Posts: 28
|
Posted: Tue Jan 23, 2007 1:25 pm Post subject: |
|
|
Some more issues with build.cfg that I just ran into.
Using OS X, gdc, and the following build.cfg file:
Code: |
[darwin]
CMDLINE=-cleanup
[Posix:GNU]
CMDLINE=-op
CMDLINE=-release ## This is to work around the std.boxer bug (issue 8 at digitalmars)
CMDLINE=-cleanup
[Posix:DigitalMars]
CMDLINE=-op
CMDLINE=-I/home/sylverpyro/Software/Linux/D/DMD/dmd1.00/dmd/src/phobos
CMDLINE=-release ## This is to work around the std.boxer bug (issue 8 at digitalmars)
CMDLINE=-cleanup
|
The output when I go to build the project is:
Code: |
powerpc-apple-darwin8-gdc-4.0.1: unrecognized option '-release'
|
Why is build reading and trying to execute parts of build.cfg not related to the [darwin] tag? |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
|
Back to top |
|
|
sylverpyro
Joined: 23 May 2006 Posts: 28
|
Posted: Tue Jan 30, 2007 2:33 pm Post subject: |
|
|
I am still curious though how build decides which of the two config options ( [Posix:GNU] or [Posix:DigitalMars] ) it will use.
Also, the config file posted in the above post does not help much as build is reading commands meant for environments other than darwin (which it is building on at the moment) and -release is not an INIT switch that is present on the GNU build config. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Tue Jan 30, 2007 10:31 pm Post subject: Re: Some odd scenarios for build.cfg |
|
|
sylverpyro wrote: | I have a few quick questions about the nuances of the build.cfg file and how the options are interpreted.
First off, if a person has a windows or linux box and Both GDC and DMD compilers installed, how does build decide which to use?
|
When Build is itself compiled, either version(GNU) or version(DigitalMars) is set. And either version(linux), version(unix), version(Windows), or version(darwin) is set. The combination of these determines the default compiler that will be used. Note that versions linux, unix and darwin all cause version(Posix) to be set.
If version(GNU) and version(Windows) then gdc.exe is default.
If version(GNU) and version(Posix) then gdc is default.
If version(DigitalMars) and version(Windows) then dmd.exe is default.
If version(DigitalMars) and version(Posix) then dmd is default.
If you don't want the default compiler then set the one you do want to use with ...
Code: | INIT:CompilerExe = whatever |
in your config file.
sylverpyro wrote: | Related to this, if you have a [DigitalMars] And [GNU] declaration in build.cfg, how do you know which of the two it decided to use (again assuming the above scenario)?
|
Which one is used is determined at the time you build the Build program.
sylverpyro wrote: | Finally, is there any way to, say in the .cfg file, have build run a script or some other action after either a failed or successful build? (I ask this because the -cleanup command does not get run if there is a compier error, and -op does not seem to work either for keeping .o files in the same folder as the .d source files anymore) |
After a successful build: yes. Read up on the FINAL= command that can be placed in the config file.
After a failed build: no. The assumption is that you might need to see the output to workout why it failed.
sylverpyro wrote: | (I ask this because the -cleanup command does not get run if there is a compier error, and -op does not seem to work either for keeping .o files in the same folder as the .d source files anymore) | Note that if you specify both -op and -od, then -op is ignored for version(DigitalMars) editions. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Tue Jan 30, 2007 10:33 pm Post subject: |
|
|
sylverpyro wrote: |
Why is build reading and trying to execute parts of build.cfg not related to the [darwin] tag? |
Because 'darwin' is a form of Posix.
You could try this in your config file to avoid that issue.
Code: |
[Posix:GNU]
... stuff ...
CMDLINE=-release
[Windows:GNU]
... stuff ...
CMDLINE=-release
[darwin]
CMDLINE=--release # Note the double dash. This 'deletes' the switch from
# the command line used on the compiler.
|
_________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
sylverpyro
Joined: 23 May 2006 Posts: 28
|
Posted: Sat Feb 03, 2007 8:57 pm Post subject: |
|
|
Unfortunately modding the config file to :
Code: |
[Posix:GNU]
#CMDLINE=-op
CMDLINE=-release ## This is to work around the std.boxer bug (issue 8 at digitalmars)
#CMDLINE=-cleanup
[darwin]
CMDLINE=--release
#CMDLINE=--op
|
gives this output :
Code: |
powerpc-apple-darwin8-gdc-4.0.1: unrecognized option '-release'
|
|
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Sun Feb 04, 2007 4:49 am Post subject: |
|
|
sylverpyro wrote: | Unfortunately modding the config file to :
Code: |
[Posix:GNU]
#CMDLINE=-op
CMDLINE=-release ## This is to work around the std.boxer bug (issue 8 at digitalmars)
#CMDLINE=-cleanup
[darwin]
CMDLINE=--release
#CMDLINE=--op
|
gives this output :
Code: |
powerpc-apple-darwin8-gdc-4.0.1: unrecognized option '-release'
|
|
That would be a bug then. I'll check it out tonight. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
sylverpyro
Joined: 23 May 2006 Posts: 28
|
Posted: Sun Feb 04, 2007 12:19 pm Post subject: |
|
|
I am still curious how build decides which compiler to use when envoked if you have both GDC and DMD installed on the same machine. Is it whichever one build was compiled with? |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Sun Feb 04, 2007 1:45 pm Post subject: |
|
|
sylverpyro wrote: | I am still curious how build decides which compiler to use when envoked if you have both GDC and DMD installed on the same machine. Is it whichever one build was compiled with? |
Yes.
If you built Bud using GDC then the default compiler is GDC.
If you built Bud using DMD then the default compiler is DMD.
If you have, and use, both compilers then you need to build two editions of Bud. Obviously you'd call them them different names too. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
|