[MLton-devel] cvs commit: -link and -lib-search gone

Stephen Weeks sweeks@users.sourceforge.net
Sun, 17 Aug 2003 20:32:44 -0700


sweeks      03/08/17 20:32:44

  Modified:    doc      changelog
               doc/user-guide man-page.tex
               man      mlton.1
               mlton/main main.sml
  Log:
  Eliminated -link and -lib-search, which are no longer needed.
  Eliminated support for passing -l*, -L*, and *.a on the command line.
  Use -link-opt instead.

Revision  Changes    Path
1.63      +5 -0      mlton/doc/changelog

Index: changelog
===================================================================
RCS file: /cvsroot/mlton/mlton/doc/changelog,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- changelog	16 Aug 2003 21:29:18 -0000	1.62
+++ changelog	18 Aug 2003 03:32:43 -0000	1.63
@@ -1,5 +1,10 @@
 Here are the changes since version 20030716.
 
+* 2003-08-17
+  - Eliminated -link and -lib-search, which are no longer needed.
+    Eliminated support for passing -l*, -L*, and *.a on the command
+    line.  Use -link-opt instead. 
+
 * 2003-08-16
   - Added -link-opt, for passing options to gcc when linking.
 



1.37      +25 -24    mlton/doc/user-guide/man-page.tex

Index: man-page.tex
===================================================================
RCS file: /cvsroot/mlton/mlton/doc/user-guide/man-page.tex,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- man-page.tex	16 Jul 2003 00:44:05 -0000	1.36
+++ man-page.tex	18 Aug 2003 03:32:44 -0000	1.37
@@ -1,34 +1,35 @@
 \sec{Manual page}{manual-page}
 
 {\mlton} is run from the command line with a collection of options
-followed by a file name and a list of files to assemble and to link
-with.
+followed by a file name and a list of files to compile, assemble, and
+link with.
 \begin{verbatim}
-mlton [option ...] file.{cm|sml|c|o} [file.{S|o} ...] [linker arg ...]
+mlton [option ...] file.{cm|sml|c|o} [file.{c|S|o} ...]
 \end{verbatim}
 The simplest case is to run {\tt mlton foo.sml}, where {\tt foo.sml}
 contains a valid SML program, in which case {\mlton} compiles the
-program to produce an executable called {\tt foo}.  Since {\mlton} has
+program to produce an executable {\tt foo}.  Since {\mlton} has
 no notion of separate compilation, the program must be the entire
 program you wish to compile.  However, the program may refer to
 signatures and structures defined in the SML basis library.
-The linker arguments are passed unchanged to the linker, and must have
-a suffix of {\tt .a} or {\tt .o} or a prefix of {\tt -l} or {\tt -L}.
 
-For developing large programs spanning many files, {\mlton} supports a limited
-subset of SML/NJ Compilation Manager (CM) files.  For example, {\tt mlton
-foo.cm} will compile the complete SML program consisting of the concatenatation
-of all the SML files referred to (either directly or indirectly) by {\tt
-foo.cm}.  See \secref{cm} for details.
+For developing large programs spanning many files, {\mlton} supports a
+limited subset of SML/NJ Compilation Manager (CM) files.  For example,
+{\tt mlton foo.cm} will compile the complete SML program consisting of
+the concatenatation of all the SML files referred to (either directly
+or indirectly) by {\tt foo.cm}.  See \secref{cm} for details.
 
 \subsec{Compile-time options}{compile-time-options}
 
-{\mlton}'s options allow you to control the name of the output file, the
-verbosity of compile-time messages, and whether or not certain optimizations are
-performed.  They also allow you to specify which intermediate files are saved
-and to stop the compilation process early, at some intermediate pass.  {\mlton}
-uses the input file suffix to determine the type of input program.  The
-possibilities are {\tt .cm}, {\tt .sml}, {\tt .c}, {\tt .S} and {\tt .o}.
+{\mlton}'s options allow you to control the name of the output file,
+the verbosity of compile-time messages, and whether or not certain
+optimizations are performed.  They also allow you to specify which
+intermediate files are saved and to stop the compilation process
+early, at some intermediate pass, in which case compilation can be
+resumed by passing the resulting files to {\mlton}.  {\mlton} uses the
+input file suffix to determine the type of input program.  The
+possibilities are {\tt .cm}, {\tt .sml}, {\tt .c}, {\tt .S} and {\tt
+.o}.
 
 With no arguments, {\mlton} prints the version number and exits.  For
 a usage message, run {\mlton} with an invalid switch, e.g. {\tt mlton
@@ -107,13 +108,13 @@
 {\tt sml} & SML file\\
 \end{tabular}
 
-\option{-lib-search {\it dir}}
-Specify an additional directory to be searched for libraries when
-linking.  Like {\tt gcc -L}{\it dir}.
-
-\option{-link {\it lib}}
-Specify an additional library to link with.  Like {\tt gcc -l}{\it
-lib}.
+\option{-link-opt {\it opt}}
+Pass the option to {\tt gcc} when linking.  You can use this to
+specify library search paths, e.g. {\tt -link-opt -Lpath}, and
+libraries to link with, e.g. {\tt -link-opt -lfoo}, or even both at
+the same time, e.g. {\tt -link-opt '-Lpath -lfoo'}.  If you wish to
+pash an option to the linker, you must use {\tt gcc}'s {\tt -Wl,}
+syntax, e.g., {\tt -link-opt '-Wl,--export-dynamic'}.
 
 \option{-may-load-world \trueFalse}
 Controls whether or not the generated executable supports the {\tt



1.33      +21 -25    mlton/man/mlton.1

Index: mlton.1
===================================================================
RCS file: /cvsroot/mlton/mlton/man/mlton.1,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- mlton.1	16 Jul 2003 00:44:05 -0000	1.32
+++ mlton.1	18 Aug 2003 03:32:44 -0000	1.33
@@ -4,16 +4,22 @@
 language
 .SH SYNOPSIS
 \fBmlton\fP \fI[option ...] file\fB.\fP{\fBcm\fP|\fBsml\fP|\fBc\fP|\fBo\fP} 
-[file\fB.\fP{\fBS\fP|\fBo\fP} ...] [linker arg ...]\fR
+[file\fB.\fP{\fBc\fP|\fBS\fP|\fBo\fP} ...]\fR
 .SH DESCRIPTION
 .PP
-Typical use of \fBMLton\fP is \fBmlton \fIxxx\fB.sml\fR, which will
-produce the executable \fIxxx\fP.
-\fBMLton\fP has no notion of separate compilation.
-The program must be the entire program you wish to compile; however, it may
-refer to signatures and structures defined in the SML basis library.
-The linker arguments are passed unchanged to the linker, and must have
-a suffix of \fB.a\fP or \fB.o\fP or a prefix of \fB-l\fP or \fB-L\fP.
+\fBMLton\fP is run from the command line with a collection of options
+followed by a file name and a list of files to compile, assemble, and
+link with.  The simplest case is to run \fBmlton foo.sml\fP, which
+will produce an executable \fBfoo\fP.  Since \fBMLton\fP has no notion
+of separate compilation, the program must be the entire program you
+wish to compile.  However, the program may refer to signatures and
+structures defined in the SML basis library.
+
+For developing large programs spanning many files, \fBMLton\fP supports
+a limited subset of SML/NJ Compilation Manager (CM) files.  For example,
+\fBmlton foo.cm\fP will compile the complete SML program consisting of
+the concatenatation of all the SML files referred to (either directly
+or indirectly) by \fBfoo.cm\fP.
 
 \fBMLton\fP's options allow you to control the name of the output
 file, the verbosity of compile-time messages, and whether or not
@@ -24,15 +30,6 @@
 uses the input file suffix to determine the type of input program.
 The possibilities are \fB.cm\fR, \fB.sml\fR, \fB.c\fR, \fB.S\fR, and \fB.o\fR.
 
-For developing large programs spanning many files, \fBMLton\fP upports
-a limited subset of SML/NJ Compilation Manager (CM) files.  From
-\fBMLton\fP's point of view, a CM file \fBfoo.cm\fR defines a list of
-SML source files.  The call \fBmlton foo.cm\fR is equivalent to
-compiling an SML program consisting of the concatenation of these
-files.  As always with \fBMLton\fP, the concatenation must be the
-whole program you wish to compile.  See the \fBMLton User Guide\fP for
-details.
-
 With no arguments, \fBMLton\fP prints the version number and exits.
 For a usage message, run \fBMLton\fP with an invalid switch, e.g.,
 \fBmlton -z\fP.  In the explanation below and in the usage message,
@@ -110,14 +107,13 @@
 .in -.5i
 
 .TP
-\fB-lib-search \fIdir\fR
-Specify an additional directory to be searched for libraries when
-linking.  Like \fBgcc -L\fP\fIdir\fP.
-
-.TP
-\fB-link \fIlib\fR
-Specify an additional library to link with.  Like \fBgcc
--l\fP\fIlib\fP.
+\fB-link-opt \fIopt\fR
+Pass the option to \fBgcc\fP when linking.  You can use this to
+specify library search paths, e.g. \fB-link-opt -Lpath\fP, and
+libraries to link with, e.g. \fB-link-opt -lfoo\fP, or even both at
+the same time, e.g. \fB-link-opt '-Lpath -lfoo'\fP.  If you wish to
+pash an option to the linker, you must use \fBgcc\fP's \fB-Wl,\fP
+syntax, e.g., \fB-link-opt '-Wl,--export-dynamic'\fP.
 
 .TP
 \fB-may-load-world \fI{\fBtrue\fP|\fBfalse\fP}\fP



1.151     +10 -23    mlton/mlton/main/main.sml

Index: main.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/mlton/main/main.sml,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -r1.150 -r1.151
--- main.sml	16 Aug 2003 21:29:18 -0000	1.150
+++ main.sml	18 Aug 2003 03:32:44 -0000	1.151
@@ -228,8 +228,6 @@
 		   | NONE => usage (concat ["invalid -keep-pass flag: ", s])))),
        (Expert, "lib", " <lib>", "set MLton lib directory",
 	SpaceString (fn s => libDir := s)),
-       (Normal, "lib-search", " <dir>", "search dir for libraries (like gcc -L)",
-	SpaceString (fn s => List.push (linkOpts, concat ["-L", s]))),
        (Expert, "limit-check", " {lhle|pb|ebb|lh|lhf|lhfle}",
 	"limit check insertion algorithm",
 	SpaceString (fn s =>
@@ -248,8 +246,6 @@
        (Expert, "limit-check-counts", " {false|true}",
 	"compute dynamic counts of limit checks",
 	boolRef limitCheckCounts),
-       (Normal, "link", " <library>", "link with library (like gcc -l)",
-	SpaceString (fn s => List.push (linkOpts, concat ["-l", s]))),
        (Normal, "link-opt", " <opt>", "pass option to linker",
 	SpaceString (fn s =>
 		     if s = ""
@@ -377,7 +373,7 @@
    end
 
 val mainUsage =
-   "mlton [option ...] file.{cm|sml|c|o} [file.{c|S|o} ...] [linker arg ...]"
+   "mlton [option ...] file.{cm|sml|c|o} [file.{c|S|o} ...]"
 
 val {parse, usage} =
    Popt.makeUsage {mainUsage = mainUsage,
@@ -584,24 +580,15 @@
 			(".c", Generated, true),
 			(".o", O, true)]
 	       end
-	    val (csoFiles, rest) =
-	       List.splitPrefix (rest, fn s =>
-				 List.exists
-				 ([".c", ".o", ".s", ".S"], fn suffix =>
-				  String.isSuffix {string = s,
-						   suffix = suffix}))
 	    val _ =
-	       case List.peek (rest, fn s =>
-			       not
-			       (List.exists ([".a", ".o"], fn suffix =>
-					     String.isSuffix {string = s,
-							      suffix = suffix})
-				orelse
-				List.exists (["-l", "-L"], fn prefix =>
-					     String.isPrefix {prefix = prefix,
-							      string = s}))) of
-		  NONE => ()
-		| SOME s => usage (concat ["invalid linker argument: ", s])
+	       List.foreach
+	       (rest, fn f =>
+		if List.exists ([".c", ".o", ".s", ".S"], fn suffix =>
+				String.isSuffix {string = f, suffix = suffix})
+		   andalso File.canRead f
+		   then ()
+		else usage (concat ["invalid file: ", f]))
+	    val csoFiles = rest
 	    val stop = !stop
 	 in
 	    case Place.compare (start, stop) of
@@ -672,7 +659,7 @@
 				       | Self => [],
 				      if !debug then gccDebug else [],
 				      if !static then ["-static"] else []],
-				     rest @ linkOpts))
+				     linkOpts))
 			      ()
 			   (* gcc on Cygwin appends .exe, which I don't want, so
 			    * move the output file to it's rightful place.





-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel