Re: Language module support modified

"Lars Ivar Igesund" <[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <01bf01c387ff$49010640$0200000a@mesmer>
----- Original Message ----- 
From: "Bram Moolenaar" <[email protected]>

> 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.)

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.

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

Lars Ivar Igesund
moddoc.diff (application/octet-stream, 3.1 KB)
Index: ref-modules.sgml
===================================================================
RCS file: /cvsroot/a-a-p/Exec/doc/ref-modules.sgml,v
retrieving revision 1.1
diff -u -r1.1 ref-modules.sgml
--- ref-modules.sgml	30 Sep 2003 17:45:17 -0000	1.1
+++ ref-modules.sgml	1 Oct 2003 08:23:49 -0000
@@ -19,8 +19,71 @@
 <variablelist>
   <varlistentry>
     <term>d</term>
-    <listitem><para>Support for the "D" language.
+    <listitem><para>Support for the "D" programming language. With this module
+      imported, <computeroutput>:program</computeroutput>, <computeroutput>:dll
+      </computeroutput> and <computeroutput>:lib</computeroutput> commands can 
+      be used as easily as with C or C++. To customize compilation and linking,
+      the variables below can be filled.
     </para></listitem>
+    <table frame="none">
+      <title>Standard Variables</title>
+      <tgroup cols="2">
+        <colspec colwidth="170"/>
+        <thead>
+          <row>
+            <entry>name</entry>
+            <entry>type&nbsp;&nbsp;</entry>
+            <entry>description</entry>
+          </row>
+        </thead>
+        <tbody>
+    <row>
+      <entry valign="top"><anchor id="var-d_compile_action"/> $D_COMPILE_ACTION
+      </entry>
+      <entry valign="top"> Aap </entry>
+      <entry valign="top"> When not empty, specifies the action name to be 
+        executed for compiling a D file into an object, dllobject or libobject 
+        file. See <xref linkend="user-tools"/>. </entry>
+    </row>
+    <row>
+      <entry valign="top"><anchor id="var-d_build_action"/> $D_BUILD_ACTION
+      </entry>
+      <entry valign="top"> Aap </entry>
+      <entry valign="top"> When not empty, specifies the action name to be 
+        executed for building a program or library from object files compiled
+        by a D compiler. A "buildaction" attribute on one of the object files 
+        is used before $D_BUILD_ACTION. See <xref linkend="user-tools"/>. 
+      </entry>
+    </row>
+    <row>
+      <entry valign="top"><anchor id="var-dflags"/> $DFLAGS </entry>
+      <entry valign="top"> user </entry>
+      <entry valign="top"> Compiler arguments passed to the D compiler </entry>
+    </row>
+    <row>
+      <entry valign="top"><anchor id="var-dlinkflags"/> $DLINKFLAGS </entry>
+      <entry valign="top"> user </entry>
+      <entry valign="top"> Arguments passed to the linker; in most cases
+        libraries to link in </entry>
+    </row>
+    <row>
+      <entry valign="top"><anchor id="var-ddebug"/> $DDEBUG </entry>
+      <entry valign="top"> user </entry>
+      <entry valign="top"> Debug arguments passed to the D compiler </entry>
+    </row>
+    <row>
+      <entry valign="top"><anchor id="var-doptimize"/> $DOPTIMIZE </entry>
+      <entry valign="top"> user </entry>
+      <entry valign="top"> Optimize arguments passed to the D compiler </entry>
+    </row>
+    <row>
+      <entry valign="top"><anchor id="var-dversion"/> $DVERSION </entry>
+      <entry valign="top"> user </entry>
+      <entry valign="top"> Version arguments passed to the D compiler </entry>
+    </row>
+        </tbody>
+      </tgroup>
+    </table> 
   </varlistentry>
 
   <varlistentry>
d.diff (application/octet-stream, 1.4 KB)
Index: d.aap
===================================================================
RCS file: /cvsroot/a-a-p/Exec/modules/d.aap,v
retrieving revision 1.1
diff -u -r1.1 d.aap
--- d.aap	29 Sep 2003 17:26:43 -0000	1.1
+++ d.aap	1 Oct 2003 08:23:21 -0000
@@ -5,13 +5,7 @@
 # If this file is missing you can find it here: http://www.a-a-p.org/COPYING
 
 # Info on this module/ TODO:
-# 
-# DMD is not an established standard for holding the D compiler in the
-# same way that CC is for C. 2003-09-13
-#
-# TODO: Find out if the OPTIMIZE and DEBUG variables should have impact when
-# compiling D source. 2003-09-13
-#
+
 # At the moment there are no differences between program objects, 
 # dllobjects and libobjects when compiling D source. This might change,
 # especially for dllobjects when shared libraries are supported on other
@@ -52,9 +46,11 @@
     @if _no.get("D_COMPILE_ACTION"):
 	:do $D_COMPILE_ACTION {target = $target} $source
     @else:
-	:sys $DMD $?DFLAGS $?INCLUDE -of$target -c $source
+	:sys $DMD $?DFLAGS $?DDEBUG $?DVERSION $?DOPTIMIZE
+                $?INCLUDE -of$target -c $source
 
-:rule {default} %$OBJSUF : {buildcheck = $DMD $?DFLAGS $?INCLUDE } %.d
+:rule {default} %$OBJSUF : {buildcheck = $DMD $?DFLAGS $?DDEBUG $?DVERSION
+                                $?DOPTIMIZE $?INCLUDE } %.d
     :do compile {target = $target} $source
 
 # :do build for object files resulting from "d" source files.
dmd.diff (application/octet-stream, 1.4 KB)
Index: dmd.py
===================================================================
RCS file: /cvsroot/a-a-p/Exec/tools/dmd.py,v
retrieving revision 1.1
diff -u -r1.1 dmd.py
--- dmd.py	25 Sep 2003 19:14:05 -0000	1.1
+++ dmd.py	1 Oct 2003 07:47:25 -0000
@@ -8,12 +8,6 @@
 # This module sets up variables and actions for using the DMD compiler tools.
 #
 
-# Information on this tool / TODO:
-#
-# DMD and the default linker (optlink) don't accept objectfiles without
-# the single .obj suffix. That is; some other suffix will break the
-# build process, as will .<presuff>.obj 2003-09-13
-
 from RecPython import *
 import Global
 from Action import action_add
@@ -35,15 +29,14 @@
     rd = Global.globals
     rpstack = [ RecPos("compile_dmd d action") ]
     action_add(rpstack, rd, str2dictlist(rpstack, "compile_dmd object,dllobject,libobject d"),
-            ":sys $DMD $?DFLAGS $?INCLUDE -of$target -c $source")
+            ":sys $DMD $?DFLAGS $?DDEBUG $?DVERSION $?DOPTIMIZE"
+            "$?INCLUDE -of$target -c $source")
     rpstack = [ RecPos("build_dmd action") ]
     action_add(rpstack, rd, str2dictlist(rpstack, "build_dmd object,dllobject,libobject"),
-            ":sys $DMD $DLINKFLAGS -of$target $source")
+            ":sys $DMD $?DLINKFLAGS -of$target $source")
     
     if not rd["_top"].get("DMD"):
         rd["_top"]["DMD"] = "dmd"
-    if not rd["_top"].get("DLINKFLAGS"):
-        rd["_top"]["DLINKFLAGS"] = ""
 
 
 def use_actions(scope):
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.