On Wed, July 6, 2011 2:14 pm, Steve Reinhardt wrote:
> I was going to suggest something like:
>
> if buildEnv['RUBY']:
>    Ruby.define_options(parser)
>
> (if that flag still exists) or maybe
>
> if 'PROTOCOL' in buildEnv:
>   Ruby.define_options(parser)
>
> that would at least avoid the error on "import PROTOCOL".
>
> Nate's solution seems OK too, though you could still run into weird errors
> if someone specifies '--ruby' without having compiled in Ruby (unless you
> add an explicit check for that).
>
> Steve
>
> On Wed, Jul 6, 2011 at 11:44 AM, Lisa Hsu <[email protected]> wrote:
>
>> That's lowest tech and least burdensome on anyone.  I like.
>>
>>
>>
>> On Wed, Jul 6, 2011 at 10:56 AM, nathan binkert <[email protected]>
>> wrote:
>>
>> > > if options.ruby:
>> > >    Ruby.define_options(parser)
>> > >    (options, args) = parser.parse_args()
>> >
>> > Instead of this, you could simply do the following before any
>> > arguments are parsed:
>> >
>> > if '--ruby' in sys.argv:
>> >   Ruby.define_options(parser)
>> >
>> > Then you only do one parse_args().

I am thinking of adding both the checks, '--ruby' would ensure that user
does want ruby and concomitant options, buildEnv['RUBY'] will ensure that
it has actually been compiled in.

--
Nilay

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to