Another D feature

Lars Ivar Igesund <[email protected]> Sat, 21 Feb 2004 23:47:09 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Hi again!

The attached pathces add a new feature for D programmers in
addition to documenting it. (Also, my last patch is overwritten
by this one since it doesn't seem that it has come through to
the cvs server.)

The feature in question, is the possibility to create an import
library while building a dll.

Lars Ivar Igesund
dmd.diff (text/plain, 1.5 KB)
Index: dmd.py
===================================================================
RCS file: /cvsroot/a-a-p/Exec/tools/dmd.py,v
retrieving revision 1.6
diff -u -r1.6 dmd.py
--- dmd.py	1 Feb 2004 15:28:06 -0000	1.6
+++ dmd.py	21 Feb 2004 22:36:44 -0000
@@ -70,6 +70,9 @@
     rpstack = [ RecPos("builddll_dmd action") ]
     action_add(rpstack, rd, str2dictlist(rpstack, "builddll_dmd dllobject"),
             "@exec \"import tools.dmd\"\n"
+            "@if os.name == \"nt\":\n"
+            "   @if _no.DIMPLIB and _no.DIMPLIB == \"yes\":\n"
+            "       DLINKFLAGS += -L/implib\n"
             "@if not tools.dmd.find_dll_main_object(source):\n"
             "   @f = file(\"aap_dllmain.d\", 'w')\n"
             "   @f.write(tools.dmd.dll_main_source())\n"
@@ -118,6 +121,9 @@
             "DEBUG ?=\n"
             "@if _no.DEBUG == 'yes':\n"
             "  dbg = -g\n"
+            "@if os.name == \"nt\":\n"
+            "   @if _no.DIMPLIB and _no.DIMPLIB == \"yes\":\n"
+            "       DLINKFLAGS += -L/implib\n"
             "@exec \"import tools.dmd\"\n"
             "@if not tools.dmd.find_dll_main_source(source):\n"
             "   @f = file(\"aap_dllmain.d\", 'w')\n"
@@ -145,6 +151,7 @@
     scope["D_BUILDDLLONESTEP_ACTION"] = "builddllonestep_dmd"
     scope["D_BUILDLIBONESTEP_ACTION"] = "buildlibonestep_dmd"
 
+
 def find_phobos():
     dmd_path = program_path("dmd")
     import re
@@ -173,7 +180,7 @@
 
 def dll_main_source():
     source = """
-        import windows;
+        import std.c.windows.windows;
 
         HINSTANCE g_hInst;
docmod.diff (text/plain, 840 B)
Index: ref-modules.sgml
===================================================================
RCS file: /cvsroot/a-a-p/Exec/doc/ref-modules.sgml,v
retrieving revision 1.6
diff -u -r1.6 ref-modules.sgml
--- ref-modules.sgml	30 Oct 2003 20:10:36 -0000	1.6
+++ ref-modules.sgml	21 Feb 2004 22:36:14 -0000
@@ -145,6 +145,14 @@
               enabling profiling hooks, use $DFLAGS.
               </entry>
             </row> 
+          <row>
+            <entry valign="top"><anchor id="var-dimplib"/> $DIMPLIB </entry>
+            <entry valign="top"> user </entry>
+            <entry valign="top"> If this variable is set to 'yes', an import
+              library will be created when building a dll on the Windows
+              platform.
+              </entry>
+            </row>
           </tbody>
         </tgroup>
       </table>