shithub: mc

Download patch

ref: 5fcdb860c1c14604c276bc98a49f162d6fd367c2
parent: 68b11241dc9da7153cfcae2218c11e0b1b545d88
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Dec 28 20:08:10 EST 2014

Use the more portable mtime() calls in libstd.

--- a/bldfile
+++ b/bldfile
@@ -1,11 +1,9 @@
-# comment
+# the mbld binary
 bin mbld =
 	build.myr
 	clean.myr
-	config.myr
-	config+posixy.myr
-	config+plan9.myr
-	config+posixy-x64.myr
+	config.myr	# config, as generated by the ./configure script
+	config+plan9.myr	# config, as hardcoded for Plan 9
 	deps.myr
 	fsel.myr
 	install.myr
--- a/build.myr
+++ b/build.myr
@@ -1,5 +1,4 @@
 use std
-use sys
 
 use "config.use"
 use "deps.use"
@@ -294,14 +293,8 @@
 }
 
 const isfresh = {src, dst
-	var srcsb, dstsb
+	var srcmt, dstmt
 
-	if sys.stat(src, &srcsb) != 0
-		std.fatal(1, "could not stat %s\n", src)
-	;;
-	if sys.stat(dst, &dstsb) != 0
-		-> false
-	;;
 	/*
 	OSX only has single second resolution on modification
 	times. Since most builds happen within one second of each
@@ -311,10 +304,14 @@
 	So, we treat times where both secs and nsecs are equal as
 	up to date.
 	*/
-	if srcsb.mtime.sec != dstsb.mtime.sec
-		-> srcsb.mtime.sec < dstsb.mtime.sec
-	else
-		-> srcsb.mtime.nsec <= dstsb.mtime.nsec
+	match std.mtime(src)
+	| `std.Some mt:	srcmt = mt
+	| `std.None:	std.fatal(1, "could not stat %s\n", src)
 	;;
+	match std.mtime(dst)
+	| `std.Some mt:	dstmt = mt
+	| `std.None:	-> false
+	;;
+	-> srcmt <= dstmt
 }
 
--- /dev/null
+++ b/config+plan9-x64.myr
@@ -1,0 +1,9 @@
+pkg config =
+	const Instroot	= "/amd64"
+	const Sys	= "Plan9"
+	const Objsuffix	= ".6"
+	const Linkcmd	= ["6l", "-l", "-o"]
+	const Arcmd	= ["ar", "vu"]
+	const Ascmd	= ["6a"]
+	const Directlib	= true
+;;