[MLton-commit] r6882

Wesley Terpstra wesley at mlton.org
Tue Sep 23 06:43:34 PDT 2008


The archive, dll and def file should all have the same name. It depends on
-output and not on the library name. 
eg: libgmp.dll, libgmp.dll.a, libgmp.def
    gmp.h PART_OF_LIBRARY_GMP gmp_open gmp_some_fn



----------------------------------------------------------------------

U   mlton/trunk/mlton/main/main.fun

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/main/main.fun
===================================================================
--- mlton/trunk/mlton/main/main.fun	2008-09-23 07:04:05 UTC (rev 6881)
+++ mlton/trunk/mlton/main/main.fun	2008-09-23 13:43:32 UTC (rev 6882)
@@ -1174,22 +1174,28 @@
                          | StabsPlus => (["-gstabs+", "-g2"], "-Wa,--gstabs")
                      fun compileO (inputs: File.t list): unit =
                         let
-                           val (libOpts, libExt) = 
+                           val libExt = 
                               case targetOS of
-                                 Darwin => ([ "-dynamiclib" ], ".dylib")
-                               | MinGW => ([ "-shared", 
-                                             "-Wl,--out-implib," ^
-                                                libname () ^ ".a",
-                                             "-Wl,--output-def," ^
-                                                libname () ^ ".def"], 
-                                           ".dll")
-                               | _ => ([ "-shared" ], ".so")
+                                 Darwin => ".dylib"
+                               | MinGW => ".dll"
+                               | _ => ".so"
                            val output = 
                               case !format of
                                  Archive => maybeOut ".a"
                                | Executable => maybeOut ""
                                | LibArchive => maybeOut ".a"
                                | Library => maybeOut libExt
+                           val { base = outputBase, ext=_ } = 
+                              OS.Path.splitBaseExt output
+                           val libOpts = 
+                              case targetOS of
+                                 Darwin => [ "-dynamiclib" ]
+                               | MinGW =>  [ "-shared", 
+                                             "-Wl,--out-implib," ^
+                                                output ^ ".a",
+                                             "-Wl,--output-def," ^
+                                                outputBase ^ ".def"]
+                               | _ =>      [ "-shared" ]
                            val _ =
                               trace (Top, "Link")
                               (fn () =>




More information about the MLton-commit mailing list