[MLton] Minor build problems under Tiger

Wesley W.Terpstra wesley@terpstra.ca
Thu, 28 Jul 2005 15:21:22 +0200


--Apple-Mail-7-368277666
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed

So, my new laptop arrived (a powerbook).
Naturally, the first thing I did was compile MLton on it. :-)
Unfortunately, for CVS I needed the attached patch.

Rationale:
Including #define's for the output C is redundant (it includes  
"platform.h")
zcat on Tiger expects good old-school compress .Z extensions.
If you are using gzip, why not use it directly? It will always be there.
Tiger system headers are broken, disabling that define fixes the  
problem.





--Apple-Mail-7-368277666
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="buggy-mac.patch"
Content-Disposition: attachment;
	filename=buggy-mac.patch

Index: mlton/main/lookup-constant.fun
===================================================================
RCS file: /cvsroot/mlton/mlton/mlton/main/lookup-constant.fun,v
retrieving revision 1.17
diff -u -r1.17 lookup-constant.fun
--- mlton/main/lookup-constant.fun	19 Jun 2005 21:34:01 -0000	1.17
+++ mlton/main/lookup-constant.fun	28 Jul 2005 12:14:09 -0000
@@ -73,10 +73,7 @@
    in
       List.foreach
       (List.concat
-       [["#define _ISOC99_SOURCE",
-	 "#define _POSIX_C_SOURCE 200112L",
-	 "",
-	 "#include \"platform.h\"",
+       [["#include \"platform.h\"",
 	 "struct GC_state gcState;",
 	 "",
 	 "int main (int argc, char **argv) {"],
Index: runtime/Makefile
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/Makefile,v
retrieving revision 1.100
diff -u -r1.100 Makefile
--- runtime/Makefile	18 Jul 2005 00:06:11 -0000	1.100
+++ runtime/Makefile	28 Jul 2005 12:14:09 -0000
@@ -96,7 +96,7 @@
 	$(RANLIB) libgdtoa.a
 
 gdtoa/arithchk.c:
-	zcat gdtoa.tgz | tar xf -	
+	gzip -dc gdtoa.tgz | tar xf -	
 	patch -p0 <gdtoa-patch
 
 gdtoa/arithchk.out: gdtoa/arithchk.c
@@ -147,7 +147,7 @@
 gdtoa-patch:
 	cd gdtoa && $(MAKE) clean && rm -f &~
 	mv gdtoa gdtoa-new
-	zcat gdtoa.tgz | tar xf -
+	gzip -dc gdtoa.tgz | tar xf -
 	diff -P -C 2 -r gdtoa gdtoa-new >gdtoa-patch || exit 0
 	rm -rf gdtoa
 	mv gdtoa-new gdtoa
Index: runtime/platform.h
===================================================================
RCS file: /cvsroot/mlton/mlton/runtime/platform.h,v
retrieving revision 1.24
diff -u -r1.24 platform.h
--- runtime/platform.h	13 May 2005 05:02:28 -0000	1.24
+++ runtime/platform.h	28 Jul 2005 12:14:09 -0000
@@ -11,7 +11,12 @@
 
 #define _ISOC99_SOURCE
 #define _BSD_SOURCE
+#ifndef __APPLE_CC__
+/* Apple system headers are broken; they use u_char, u_int, ...
+ * That's fine except _POSIX_C_SOURCE (correctly) turns this off.
+ */
 #define _POSIX_C_SOURCE 200112L
+#endif
 
 #include <sys/types.h> // lots of includes depend on this
 #include <dirent.h>

--Apple-Mail-7-368277666
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed





--Apple-Mail-7-368277666--