FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some odd scenarios for build.cfg

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
sylverpyro



Joined: 23 May 2006
Posts: 28

PostPosted: Tue Jan 23, 2007 12:19 pm    Post subject: Some odd scenarios for build.cfg Reply with quote

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
View user's profile Send private message
sylverpyro



Joined: 23 May 2006
Posts: 28

PostPosted: Tue Jan 23, 2007 1:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Tue Jan 23, 2007 5:24 pm    Post subject: Reply with quote

For gdc, you can use the CFG file Gregor posted here http://www.dsource.org/forums/viewtopic.php?t=2156&start=15#12393
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
sylverpyro



Joined: 23 May 2006
Posts: 28

PostPosted: Tue Jan 30, 2007 2:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Tue Jan 30, 2007 10:31 pm    Post subject: Re: Some odd scenarios for build.cfg Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Tue Jan 30, 2007 10:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
sylverpyro



Joined: 23 May 2006
Posts: 28

PostPosted: Sat Feb 03, 2007 8:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Sun Feb 04, 2007 4:49 am    Post subject: Reply with quote

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
View user's profile Send private message
sylverpyro



Joined: 23 May 2006
Posts: 28

PostPosted: Sun Feb 04, 2007 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Sun Feb 04, 2007 1:45 pm    Post subject: Reply with quote

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. Exclamation

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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