Yet another patch (dmd.py this time)

Lars Ivar Igesund <[email protected]> Wed, 25 Feb 2004 20:19:27 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Cleanup time. Seems like I did some stuff more complicated
than necessary. Also, I've forgot to add the contents of
$LIBS to the build command line ...
Interspersed is also one or two bugfixes.

So now I believe it's perfect. :)

Lars Ivar Igesund
dmd.diff (text/plain, 2.8 KB)
Index: dmd.py
===================================================================
RCS file: /cvsroot/a-a-p/Exec/tools/dmd.py,v
retrieving revision 1.8
diff -u -r1.8 dmd.py
--- dmd.py	25 Feb 2004 10:04:18 -0000	1.8
+++ dmd.py	25 Feb 2004 19:09:19 -0000
@@ -50,14 +50,7 @@
     # Build a program from object files
     rpstack = [ RecPos("build_dmd action") ]
     action_add(rpstack, rd, str2dictlist(rpstack, "build_dmd object"),
-            "cmd = \n"
-            "@if os.name == \"nt\":\n"
-            "   :progsearch LINK link\n"
-            "   @exec \"import tools.dmd\"\n"
-            "   DLINKFLAGS = `tools.dmd.find_phobos()` $?DLINKFLAGS \n"
-            "   :sys $LINK /noi $source,$target,,$DLINKFLAGS\n"
-            "@else:\n"
-            "   :sys $DMD $?DLINKFLAGS -of$target $source")
+            ":sys $DMD -L$*?DLINKFLAGS -L+$*?LIBS -of$target $source")
     # Build a static lib from object files
     rpstack = [ RecPos("buildlib_dmd action") ]
     action_add(rpstack, rd, str2dictlist(rpstack, "buildlib_dmd libobject"),
@@ -72,14 +65,14 @@
             "@exec \"import tools.dmd\"\n"
             "@if os.name == \"nt\":\n"
             "   @if _no.DIMPLIB and _no.DIMPLIB == \"yes\":\n"
-            "       DLINKFLAGS += -L/implib\n"
+            "       DLINKFLAGS += /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"
             "   @f.close()\n"
             "   :do compile {target = aap_dllmain.obj} aap_dllmain.d\n"
             "   source += aap_dllmain.obj\n"
-            ":sys $DMD $?DLINKFLAGS -of$target $source\n"
+            ":sys $DMD -L$*?DLINKFLAGS -L+$*?LIBS -of$target $source\n"
             ":del {f} {q} aap_dllmain.*")
     # Build a program directly from source
     rpstack = [ RecPos("buildonestep_dmd d action") ]
@@ -92,7 +85,7 @@
             "@if _no.DEBUG == 'yes':\n"
             "  dbg = -g\n"
             ":sys $DMD $?DFLAGS $?DVERSION $opt $dbg $?DDEBUG $?DIMPORT"
-            "       $?DLINKFLAGS -of$target $source\n"
+            "       -L$*?DLINKFLAGS -L+$*?LIBS -of$target $source\n"
             ":del {f} {q} *.obj")
     # Build a static lib directly from source
     rpstack = [ RecPos("buildlibonestep_dmd d action") ]
@@ -131,7 +124,7 @@
             "   @f.close()\n"
             "   source += aap_dllmain.d\n"
             ":sys $DMD $?DFLAGS $?DVERSION $opt $dbg $?DDEBUG $?DIMPORT"
-            "       $?DLINKFLAGS -of$target $source\n"
+            "       -L$*?DLINKFLAGS -L+$*?LIBS -of$target $source\n"
             ":del {f} {q} aap_dllmain.d\n"
             ":del {q} *.obj")
         
@@ -192,6 +185,7 @@
             void _moduleCtor();
         }
 
+        export:
         extern (Windows)
         BOOL DllMain(HINSTANCE hInstance,
                      ULONG ulReason,