[MLton-devel] Problem with NetBSD build really nailed down

Jesper Louis Andersen jlouis@mongers.org
Sun, 5 Oct 2003 17:04:37 +0200


Quoting Stephen Weeks (sweeks@sweeks.com):

> Maybe the easiest fix is to not use "#!/usr/bin/env sh" at the start
> of upgrade-basis, and rather use "#!/bin/sh".  That way the shell
> script will see the current path.  I've checked in the changes for
> this.  Lemme know how it works.

I do not really like this. First off, that wont work when (not if) we do
the HP-UX port, since /bin/sh is nonexistant there. Next problem is that
it seems to me sourceforge has done some wierd things. The change you
have checked in has yet to show up in my anonymous checkout from SF[1].

In the meantime I did the following hack:

--- ../../mlton-cvs/mlton/mlton/Makefile	Wed Oct  1 23:12:14 2003
+++ Makefile	Sat Oct  4 20:25:01 2003
@@ -47,8 +47,9 @@
 # We pass the full path to mlton, via `which mlton`, because
 # upgrade-basis is written with #!/usr/bin/env sh, which ignores the
 # current path.
+CURRENTMLTON = $(shell whereis -p mlton | head -n 1)
 $(UP):
-	$(SRC)/bin/upgrade-basis `which mlton` >$(UP)
+	$(SRC)/bin/upgrade-basis $(CURRENTMLTON) >$(UP)
 
 mlton.cm: mlton-stubs.cm
 	grep -v mlton-stubs mlton-stubs.cm >mlton.cm

But I find that rather ugly. 

I do also find that using a csh-script from 44bsd heritage quite ugly.
So I thought about porting the C-versioned which(1) from either OpenBSD
or FreeBSD to NetBSD. It should be quite painless. 

But this is also quite ugly, because my life is to short to use it for 
writing buggy C code (We all know it is impossible to write correct C,
how much experience you may have). Maybe we should write a which(1) in
SML. It should be possible by using POSIX alone and should be doable in 
less than 100 lines if you compress it a bit and abuse String.fields
from the Basis.

[1] :pserver:anonymous@cvs.mlton.org:/cvsroot/mlton is the CVSROOT

-- 
j. 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel