[MLton-user] mlton script typo

Matthew Fluet fluet at tti-c.org
Fri Oct 12 20:47:04 PDT 2007


On Fri, 12 Oct 2007, Vesa Karvonen wrote:
> On 10/10/07, Petersen, Leaf <leaf.petersen at intel.com> wrote:
>> There seems to be a minor problem with the /bin/mlton script in the new
>> cygwin binary release (20070826).  Specifically, the binding of the lib
>> variable on line 8 is given as:
>>
>> lib='//lib/mlton'
>>
>> instead of:
>>
>> lib='/lib/mlton'
>>
>> The former generates a syntax error from bash.  Easily diagnosed and
>> fixed, but I thought I'd mention it.
>
> I think that the /bin/mlton script is generated by the root Makefile
> and the following patch should fix the above problem:
>
> Index: Makefile
> ===================================================================
> --- Makefile	(revision 6066)
> +++ Makefile	(working copy)
> @@ -362,7 +362,7 @@
> DESTDIR := $(CURDIR)/install
> PREFIX := /usr
> ifeq ($(TARGET_OS), cygwin)
> -PREFIX := /
> +PREFIX :=
> endif
> ifeq ($(TARGET_OS), darwin)
> PREFIX := /usr/local
>
> Unfortunately, I can't test this, because I don't have a Windows
> machine (hardware donations are welcome :-)).  So, if someone would
> test that this works correctly (by building MLton under Windows+Cygwin
> *after* applying the above patch), I could then commit the patch.

That appears to work (though, like you, I don't have a machine suitable 
for building MLton under Windows+Cygwin).  However, it still leaves the 
man pages at / rather than at /usr/.  So, I would suggest either:

Index: Makefile
===================================================================
--- Makefile    (revision 6023)
+++ Makefile    (working copy)
@@ -362,7 +362,7 @@
  DESTDIR := $(CURDIR)/install
  PREFIX := /usr
  ifeq ($(TARGET_OS), cygwin)
-PREFIX := /
+PREFIX :=
  endif
  ifeq ($(TARGET_OS), darwin)
  PREFIX := /usr/local
@@ -384,6 +384,7 @@
  TMAN := $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1
  TDOC := $(DESTDIR)$(prefix)/share/doc/mlton
  ifeq ($(TARGET_OS), cygwin)
+TMAN := $(DESTDIR)$(prefix)/usr/man/man1
  TDOC := $(DESTDIR)$(prefix)/usr/share/doc/mlton
  endif
  ifeq ($(TARGET_OS), solaris)

or

Index: Makefile
===================================================================
--- Makefile    (revision 6023)
+++ Makefile    (working copy)
@@ -361,9 +361,6 @@
  # puts them.
  DESTDIR := $(CURDIR)/install
  PREFIX := /usr
-ifeq ($(TARGET_OS), cygwin)
-PREFIX := /
-endif
  ifeq ($(TARGET_OS), darwin)
  PREFIX := /usr/local
  endif
@@ -383,9 +380,6 @@
  TLIB := $(DESTDIR)$(prefix)/$(ULIB)
  TMAN := $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1
  TDOC := $(DESTDIR)$(prefix)/share/doc/mlton
-ifeq ($(TARGET_OS), cygwin)
-TDOC := $(DESTDIR)$(prefix)/usr/share/doc/mlton
-endif
  ifeq ($(TARGET_OS), solaris)
  TDOC := $(DESTDIR)$(prefix)/doc/mlton
  endif

That latter reverses the changes of revision 4288.



More information about the MLton-user mailing list