Re: Language module support modified

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Lars Ivar Igesund wrote:

> > It would be very good if you can write down those things that a user of
> > the "D" language would like to know.
> 
> Ok, I've made some additions to ref-modules.sgml, attached in
> moddoc.diff. (I don't know if the syntax is correct or if it will look
> well, but at least the information should be there.)

Great!  I'll fix a few things to make it look good.

> I have also made some additions/changes to the compile command used.
> The user can now specify the argument variables
> DFLAGS, DLINKFLAGS, DDEBUG, DOPTIMIZE and DVERSION.

I think you need to give a bit more explanation about using $DVERSION.

> Except for the DLINKFLAGS, all of the arguments can in theory be put
> into the DFLAGS variable, but the rationale is to make it easier for the
> user to see what goes where and that the D language has the possibility
> to specify lots of debug and version flags that decide which parts of the
> code to compile (a preprocessor replacement).
> 
> These changes can be found in d.diff and dmd.diff

This makes me wonder how we should use the optional arguments for a
compiler other than the C or C++ compiler.

For C we use $CFLAGS, $DEFINE, $INCLUDE, $DEBUG and $OPTIMIZE.  The idea
is that all C compilers use these and convert them from the standard
syntax (what is used on Unix) to whatever the compiler accepts.

Since the D language appears to use similar arguments, should we use the
same variables, or with a "D" prepended, like what Lars is using now?

I think we should at least be consistent, thus either use the C flags
for D as well, or only use D specific flags.  That means $INCLUDE should
not be used for D as it is now.

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.

- Each tool and/or module uses the standard $DEBUG and $OPTIMIZE
  variables.  These need to be converted to arguments that the specific
  compiler accepts.

For the D module and tool this shell command would be used:

    $DMD $?DFLAGS $?DVERSION $?DDEFINE $?DINCLUDE -of$target -c $source

$DEBUG and $OPTIMIZE could be used as well, if you know what dmd
areguments are used for this.

-- 
Time is money.  Especially if you make clocks.

 /// 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.