Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Broken Build when using Flex/Bison

Date2008-02-26 18:17
FromMichael Gogins
SubjectRe: [Cs-dev] Broken Build when using Flex/Bison
Thanks for the info. The problem I was trying to solve is this. SCons contains a built-in "tool detector" which, unfortunately, doesn't only look at paths and environment variables. On Windows, it also (I think) looks at the Windows registry. (I could be wrong about this...) Since I have 3 C++ compilers installed and use them all, this is no good. 

At any rate, by passing the tools to SCons programmatically, I defeat the tool auto-detection.

We should look at the SCons source code to figure out a smarter way of doing this. Looking at the code could tell us how to turn a tool "off", which would get rid of cl in the MinGW build or g++ in the msvc build. Or, looking at the code could tell us just how to programatically set up the lex/yacc tools.

Did you try just adding 'default' as a tool?...

Regards,
Mike

-----Original Message-----
>From: Steven Yi 
>Sent: Feb 26, 2008 12:34 PM
>To: Developer discussions 
>Subject: Re: [Cs-dev] Broken Build when using Flex/Bison
>
>Hi Michael,
>
>As Andres noted, adding lex and yacc (which, btw, is what flex and
>bison are detected as when I remove the hardcoding of the tools for
>MinGW) does not work.  My guess is that more than just a Tool need be
>added, as Scons complains it doesn't know what to do with the .l file,
>not that a tool couldn't be found.
>
>steven
>
>
>
>On Tue, Feb 26, 2008 at 5:48 AM, Andres Cabrera  wrote:
>> I added the tools 'lex' and 'yacc' which are their names on my system
>>  but that didn't seem to do it...
>>
>>  Cheers,
>>  Andrés
>>
>>
>>
>>
>>  On Tue, Feb 26, 2008 at 8:16 AM, Michael Gogins  wrote:
>>  > This is where you should simply be able to add the tools to the list. But you have to know what their real names are. That, in turn, will be apparent from when you comment out these lines and SConstruct prints its built up list of tools for the environment.
>>  >
>>  >
>>  >  Hope this helps,
>>  >  Mike
>>  >
>>  >  -----Original Message-----
>>  >  >From: Steven Yi 
>>  >
>>  > >Sent: Feb 26, 2008 2:16 AM
>>  >  >To: Developer discussions 
>>  >
>>  >
>>  > >Subject: Re: [Cs-dev] Broken Build when using Flex/Bison
>>  >  >
>>  >  >Hi Andres,
>>  >  >
>>  >  >Unfortunately the changes do not work and it is still broken regarding
>>  >  >flex and bison.  Commenting out:
>>  >  >
>>  >  >commonEnvironment = Environment(tools = ['mingw', 'swig', 'javac', 'jar'])
>>  >  >
>>  >  >Is the only way I've been able to get things to compile. Moving the
>>  >  >addition of the lex and yacc Tool() earlier does not solve the problem
>>  >  >and Scons still gets confused about what to do with .l files. I don't
>>  >  >know what the solution is though.
>>  >  >
>>  >  >steven
>>  >  >
>>  >  >On Mon, Feb 25, 2008 at 6:20 PM, Andres Cabrera  wrote:
>>  >  >> Hi,
>>  >  >>  I've commited some small changes to SConstruct, and I've added
>>  >  >>  hardcoded 'lex' and 'yacc' to the tools when building the new parser
>>  >  >>  on windows. I can't test here since I don't have windows, but maybe
>>  >  >>  this addition is enough?
>>  >  >>
>>  >  >>  Cheers,
>>  >  >>  Andrés
>>  >  >>
>>  >  >>
>>  >  >>
>>  >  >>
>>  >  >>  On Mon, Feb 25, 2008 at 5:52 PM, Michael Gogins  wrote:
>>  >  >>  > In order to have MSVC and MinGW (and the Intel compiler) co-exist in SConstruct, I have changed it to (1) detect user's choice of tools either from environment or from option (withMSVC etc.), (2) re-construct the commonEnvironment from scratch, (3) add specific tools suitable to the user's choice to the commonEnvironment programmatically.
>>  >  >>  >
>>  >  >>  >  I think the best thing is to add bison and and flex to the tools in the appropriate platform cases.
>>  >  >>  >
>>  >  >>  >  Hope this helps,
>>  >  >>  >  Mike
>>  >  >>  >
>>  >  >>  >
>>  >  >>  >
>>  >  >>  >  -----Original Message-----
>>  >  >>  >  >From: Steven Yi 
>>  >  >>  >  >Sent: Feb 25, 2008 4:32 PM
>>  >  >>  >  >To: Developer discussions 
>>  >  >>  >  >Subject: [Cs-dev] Broken Build when using Flex/Bison
>>  >  >>  >  >
>>  >  >>  >  >Hi All,
>>  >  >>  >  >
>>  >  >>  >  >Recent changes to SConstruct broke detection of flex/bison (as far as
>>  >  >>  >  >I can tell that is the problem).  During configuration, Scons shows:
>>  >  >>  >  >
>>  >  >>  >  >SCons tools on this platform:  ['mingw', 'gcc', 'g++', 'gnulink',
>>  >  >>  >  >'ar', 'gas', 'm4', 'swig', 'javac', 'jar', 'mingw', 'gcc', 'g++',
>>  >  >>  >  >'gnulink', 'ar', 'gas', 'm4']
>>  >  >>  >  >
>>  >  >>  >  >
>>  >  >>  >  >which show the mingw tool set twice and no detection of flex/bison.
>>  >  >>  >  >Because of this I get:
>>  >  >>  >  >
>>  >  >>  >  >scons: *** While building `['Engine\\csound_orclex.c']' from
>>  >  >>  >  >`['Engine\\csound_orc.l']': Don't know how to build from a source file
>>  >  >>  >  >with suffix `.l'.  Expected a suffix in this list: ['.i'].
>>  >  >>  >  >
>>  >  >>  >  >
>>  >  >>  >  >I think this is all due to the change to hardcode the tools on the
>>  >  >>  >  >platforms for MinGW?
>>  >  >>  >  >
>>  >  >>  >  >(BTW: For anyone on Windows, the version of flex and bison I am using
>>  >  >>  >  >are from http://gnuwin32.sourceforge.net/)
>>  >  >>  >  >
>>  >  >>  >  >Thanks!
>>  >  >>  >  >steven
>>  >  >>  >  >
>>  >  >>  >  >-------------------------------------------------------------------------
>>  >  >>  >  >This SF.net email is sponsored by: Microsoft
>>  >  >>  >  >Defy all challenges. Microsoft(R) Visual Studio 2008.
>>  >  >>  >  >http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>  >  >>  >  >_______________________________________________
>>  >  >>  >  >Csound-devel mailing list
>>  >  >>  >  >Csound-devel@lists.sourceforge.net
>>  >  >>  >  >https://lists.sourceforge.net/lists/listinfo/csound-devel
>>  >  >>  >
>>  >  >>  >
>>  >  >>  >
>>  >  >>  >
>>  >  >>  >  -------------------------------------------------------------------------
>>  >  >>  >  This SF.net email is sponsored by: Microsoft
>>  >  >>  >  Defy all challenges. Microsoft(R) Visual Studio 2008.
>>  >  >>  >  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>  >  >>  >  _______________________________________________
>>  >  >>  >  Csound-devel mailing list
>>  >  >>  >  Csound-devel@lists.sourceforge.net
>>  >  >>  >  https://lists.sourceforge.net/lists/listinfo/csound-devel
>>  >  >>  >
>>  >  >>
>>  >  >>  -------------------------------------------------------------------------
>>  >  >>  This SF.net email is sponsored by: Microsoft
>>  >  >>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>>  >  >>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>  >  >>  _______________________________________________
>>  >  >>  Csound-devel mailing list
>>  >  >>  Csound-devel@lists.sourceforge.net
>>  >  >>  https://lists.sourceforge.net/lists/listinfo/csound-devel
>>  >  >>
>>  >  >
>>  >  >-------------------------------------------------------------------------
>>  >  >This SF.net email is sponsored by: Microsoft
>>  >  >Defy all challenges. Microsoft(R) Visual Studio 2008.
>>  >  >http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>  >  >_______________________________________________
>>  >  >Csound-devel mailing list
>>  >  >Csound-devel@lists.sourceforge.net
>>  >  >https://lists.sourceforge.net/lists/listinfo/csound-devel
>>  >
>>  >
>>  >
>>  >
>>  >  -------------------------------------------------------------------------
>>  >  This SF.net email is sponsored by: Microsoft
>>  >  Defy all challenges. Microsoft(R) Visual Studio 2008.
>>  >  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>  >  _______________________________________________
>>  >  Csound-devel mailing list
>>  >  Csound-devel@lists.sourceforge.net
>>  >  https://lists.sourceforge.net/lists/listinfo/csound-devel
>>  >
>>
>>  -------------------------------------------------------------------------
>>  This SF.net email is sponsored by: Microsoft
>>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>  _______________________________________________
>>  Csound-devel mailing list
>>  Csound-devel@lists.sourceforge.net
>>  https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2008.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.s

Date2008-02-26 21:53
From"Steven Yi"
SubjectRe: [Cs-dev] Broken Build when using Flex/Bison
AttachmentsNone