Re: Language module support modified
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Lars Ivar Igesund wrote: > > I think you need to give a bit more explanation about using $DVERSION. > > I think I need to explain other things more, too. Look further down. Please correct and extend the docs in ref-modules when needed. > > On the other hand, $DEBUG and $OPTIMIZE are not arguments, but generic > > Aap settings. $DEBUG can be set to "yes". $OPTIMIZE is a number from > > zero to nine. For C the cflags_normal() function is used to turn them > > into arguments for the C compiler. > > > > Let me do a proposal: > > > > - For each language we have a set of variables similar to $CFLAGS, > > $DEFINE and $INCLUDE, but specific for that langauge. This is > > logical, since using the values given to the C compiler would probably > > not work for another language. > > For D we have $DFLAGS, $DDEFINE and $DINCLUDE. And as an extra > > $DVERSION, which is apparently specific for D. > > Ok; > DFLAGS is ok, > DDEFINE not very useful, except if people start using external > preprocessors for D (which the language designer wants to avoid) That means it's better to leave $DDEFINE out, right? > DINCLUDE is for including stuff, but they are called imports in D > (like Java). Should DIMPORT be the name, perhaps? Avoiding confusion between $INCLUDE and $DINCLUDE is good. Using $DIMPORT sounds logical to me. > DVERSION would be for the compiler arguments -version=level and > -version=ident. Several idents and a level can be used to compile > in or out parts of the source. It usually looks like this: OK, thus it's a language-related argument that has a specific syntax. It's good to keep these separate from $DFLAGS, so that they can be translated if there is a D compiler that uses /v:ident instead of -version=indent, for example. > DDEBUG was proposed by me because it in addition to setting the flags > -g [symbolic debug info] and -gt [trace profiling hooks], it > is also possible to compile in (and out) debug code in much > the same way as with -version. > The main difference as I see it, is that debug code don't HAVE > to be qualified by an identifier or level. Also, it will > always be compiled out when the release flag is used (probably > as a DFLAG). Compiling/excluding unittests is also a part of > this, as is contracts. It only makes sense to add arguments to a specific variable if we can do something with it. The use of $DEBUG is that the tool can check the value and then add the appropriate argument to the compiler. This only works for generic settings, in this case debugging on/off. If the compiler has specific arguments that other compilers are unlikely to have, these can be added to $DFLAGS. It's then up to the recipe writer to use the right arguments, since Aap can't offer him a generic way of doing it. This means the recipe isn't portable to another compiler. This would require a configure check. The same applies to optimizing flags. > OPTIMIZE might make sense as it is now. The current version of the > compiler takes only one optimize flag, -O, but it would probably > be ignorant not to expect more. > > > - Each tool and/or module uses the standard $DEBUG and $OPTIMIZE > > variables. These need to be converted to arguments that the specific > > compiler accepts. You could probably use something like: @if _no.OPTIMIZE and int(_no.OPTIMIZE) > 0: oarg = -O @else: oarg = :sys $DMD ... $oarg ... -- hundred-and-one symptoms of being an internet addict: 77. The phone company asks you to test drive their new PBX system /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html /// ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf