Re: cons and different environments

[email protected] Tue, 22 Feb 2005 11:19:48 -0800
Newsgroups gmane.comp.gnu.cons.general
Message-ID <OFE5C6BE77.82B8C555-ON85256FB0.0068F278-88256FB0.006A4B32@philips.com>
This is a multipart message in MIME format.
--===============1774844905==
Content-Type: multipart/alternative;
	boundary="=_alternative 006A4B2988256FB0_="

This is a multipart message in MIME format.
--=_alternative 006A4B2988256FB0_=
Content-Type: text/plain; charset="US-ASCII"

There are two ways to handle this, and Daniel has pointed out one approach 
to one of the solutions.  First decide whether or not the shared code is a 
variant, in that it is common code that MUST have different compile 
options.  If this is not a variant code situation, then Daniel has the 
right idea, although it would always be better, for maintainability, to 
manage common code by building a static library and then linking the 
library in all places required.  If however this is variant code, then you 
must allow cons to put the output somewhere else, so that means you have 
at least one more separate target directory for ErrorHanlder.o to go to, 
and at that point cons will see that each target has a unique and separate 
set of build rules.

---
Rick Croote
Software Engineer
Environment and Tools Team
Philips Medical Systems
Bothell, WA
[email protected]
Phone: 425-487-7834










<[email protected]>
Sent by: 
[email protected]
02/22/2005 09:02 AM
 
        To:     <[email protected]>
        cc:     (bcc: Rick Croote/ATL-BTL/MS/PHILIPS)
        Subject:        Re: cons and different environments
        Classification: 





Daniel Graupner <[email protected]> schrieb am 22.02.2005,
17:48:19:
> Program $CONS 'Scheduler', 
'Scheduler.cpp','../classes/Scheduler.cpp','../classe
> s/SchedulerEvent.cpp','../classes/ErrorHandler.cpp';
> Program $CONS 'Configuration', 'Configuration.cpp', 
'../classes/Configuration.cp
> p', '../classes/ErrorHandler.cpp';
> 
> 
> Scheduler builds fine, to build Configuration I need the Compiler-Switch 
'-lxerces-c'. I tried to 
> clone the $CONS Environment in $CONS2 with LIBS=>'-lxerces-c' .
> But no cons exits with the error that there are two ways to build 
'../classes/ErrorHandler.cpp'. OK, 
> I know why this error appears, but I have no idea how to deal with it!


Hmm, is it common to define a 2nd environment and write:
Program $CONS 'Configuration', 'Configuration.cpp',
'../classes/Configuration.cpp', '../classes/ErrorHandler.o';

This seem to work.

Regards, Daniel.


_______________________________________________
[email protected]
http://lists.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/


--=_alternative 006A4B2988256FB0_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">There are two ways to handle this, and
Daniel has pointed out one approach to one of the solutions. &nbsp;First
decide whether or not the shared code is a variant, in that it is common
code that MUST have different compile options. &nbsp;If this is not a variant
code situation, then Daniel has the right idea, although it would always
be better, for maintainability, to manage common code by building a static
library and then linking the library in all places required. &nbsp;If however
this is variant code, then you must allow cons to put the output somewhere
else, so that means you have at least one more separate target directory
for ErrorHanlder.o to go to, and at that point cons will see that each
target has a unique and separate set of build rules.</font>
<br><font size=2 face="sans-serif"><br>
---<br>
Rick Croote<br>
Software Engineer<br>
Environment and Tools Team<br>
Philips Medical Systems<br>
Bothell, WA<br>
[email protected]<br>
Phone: 425-487-7834<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td>
<br>
<br>
<br>
<br>
<br><font size=1 face="sans-serif"><b>&lt;[email protected]&gt;</b></font>
<p><font size=1 face="sans-serif">Sent by: </font>
<br><font size=1 face="sans-serif">[email protected]</font>
<p><font size=1 face="sans-serif">02/22/2005 09:02 AM</font>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To:
&nbsp; &nbsp; &nbsp; &nbsp;&lt;[email protected]&gt;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc:
&nbsp; &nbsp; &nbsp; &nbsp;(bcc: Rick Croote/ATL-BTL/MS/PHILIPS)</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject:
&nbsp; &nbsp; &nbsp; &nbsp;Re: cons and different environments</font>
<p><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Classification:
&nbsp; &nbsp; &nbsp; &nbsp;</font>
<br>
<br></table>
<br>
<br>
<br><font size=2><tt><br>
Daniel Graupner &lt;[email protected]&gt; schrieb am 22.02.2005,<br>
17:48:19:<br>
&gt; Program $CONS 'Scheduler', 'Scheduler.cpp','../classes/Scheduler.cpp','../classe<br>
&gt; s/SchedulerEvent.cpp','../classes/ErrorHandler.cpp';<br>
&gt; Program $CONS 'Configuration', 'Configuration.cpp', '../classes/Configuration.cp<br>
&gt; p', '../classes/ErrorHandler.cpp';<br>
&gt; <br>
&gt; <br>
&gt; Scheduler builds fine, to build Configuration I need the Compiler-Switch
'-lxerces-c'. I tried to <br>
&gt; clone the $CONS Environment in $CONS2 with LIBS=&gt;'-lxerces-c' .<br>
&gt; But no cons exits with the error that there are two ways to build
'../classes/ErrorHandler.cpp'. OK, <br>
&gt; I know why this error appears, but I have no idea how to deal with
it!<br>
<br>
<br>
Hmm, is it common to define a 2nd environment and write:<br>
Program $CONS 'Configuration', 'Configuration.cpp',<br>
'../classes/Configuration.cpp', '../classes/ErrorHandler.o';<br>
<br>
This seem to work.<br>
<br>
Regards, Daniel.<br>
<br>
<br>
_______________________________________________<br>
[email protected]<br>
http://lists.gnu.org/mailman/listinfo/cons-discuss<br>
Cons URL: http://www.dsmit.com/cons/<br>
</tt></font>
<br>
--=_alternative 006A4B2988256FB0_=--



--===============1774844905==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
[email protected]
http://lists.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/
--===============1774844905==--