summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-04-14 00:17:46 -0700
committerOri Bernstein <ori@eigenstate.org>2015-04-14 00:17:46 -0700
commit6126262772590d74d00325f6c33c7ab5c6ba3987 (patch)
treee78296a015c82b2118640f1a6ba071c9b6f6a997
parenta6b13e22bbb7cbeeae4cffa335ac04065a90f6db (diff)
downloadmc-6126262772590d74d00325f6c33c7ab5c6ba3987.tar.gz
Fix installing manpages.
-rwxr-xr-xgenbootstrap.sh1
-rw-r--r--mbld/install.myr19
-rw-r--r--mbld/opts.myr6
-rw-r--r--mbld/parse.myr8
-rw-r--r--mbld/types.myr36
5 files changed, 42 insertions, 28 deletions
diff --git a/genbootstrap.sh b/genbootstrap.sh
index 73cae12..9fbd086 100755
--- a/genbootstrap.sh
+++ b/genbootstrap.sh
@@ -2,6 +2,7 @@
export MYR_MUSE=../muse/muse
export MYR_MC=../6/6m
+export MYR_RT=../rt/_myrrt.o
mbld clean
# The generated shell script should be a compatible bourne
# shell script.
diff --git a/mbld/install.myr b/mbld/install.myr
index a895166..88c80bf 100644
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -29,18 +29,18 @@ const movetargs = {b, delete
for tn in b.all
match gettarg(b.targs, tn)
| `Bin bt:
- movefile(delete, bt.name, opt_instroot, opt_destdir, "bin", 0o755)
+ movefile(b, delete, bt.dir, bt.name, opt_instroot, opt_destdir, "bin", 0o755)
| `Lib lt:
- movefile(delete, lt.name, opt_instroot, opt_destdir, "lib/myr", 0o644)
+ movefile(b, delete, lt.dir, lt.name, opt_instroot, opt_destdir, "lib/myr", 0o644)
libarchive = std.fmt("lib%s.a", lt.name)
- movefile(delete, libarchive, opt_instroot, opt_destdir, "lib/myr", 0o644)
+ movefile(b, delete, lt.dir, libarchive, opt_instroot, opt_destdir, "lib/myr", 0o644)
std.slfree(libarchive)
| `Gen gt:
/* nothing to do (?) */
- | `Man mans:
+ | `Man mt:
/* FIXME: figure out man section by number */
- for m in mans
- moveman(delete, m)
+ for m in mt.pages
+ moveman(b, delete, mt.dir, m)
;;
| `Test tt: /* nothing */
;;
@@ -49,9 +49,10 @@ const movetargs = {b, delete
}
-const movefile = {delete, file, instdir, destdir, prefix, perm
+const movefile = {b, delete, dir, file, instdir, destdir, prefix, perm
var path
+ setdir(b, dir)
path = std.pathjoin([destdir, instdir, prefix, file][:])
if delete
std.put("\tdelete %s\n", path)
@@ -73,7 +74,7 @@ const movefile = {delete, file, instdir, destdir, prefix, perm
std.slfree(path)
}
-const moveman = {delete, man
+const moveman = {b, delete, dir, man
var sect, manrel
match std.strrfind(man, ".")
@@ -87,6 +88,6 @@ const moveman = {delete, man
;;
manrel = std.fmt("%s%s", opt_manpath, man[sect:])
- movefile(delete, man, opt_instroot, opt_destdir, manrel, 0o644)
+ movefile(b, delete, dir, man, opt_instroot, opt_destdir, manrel, 0o644)
std.slfree(manrel)
}
diff --git a/mbld/opts.myr b/mbld/opts.myr
index 1adfab9..0043c5d 100644
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -75,11 +75,13 @@ const initopts = {
opt_destdir = std.getenvv("DESTDIR", "")
opt_mc = std.getenvv("MYR_MC", "6m")
opt_muse = std.getenvv("MYR_MUSE", "muse")
+ opt_runtime = std.getenvv("MYR_RT", "")
+ if opt_runtime.len == 0
+ opt_runtime = std.pathjoin([opt_instroot, "lib/myr", config.Runtime][:])
+ ;;
sysarchstr = std.fmt("+%s-%s", opt_sys, opt_arch)
sysstr = std.fmt("+%s", opt_sys)
archstr = std.fmt("+%s", opt_arch)
-
- opt_runtime = std.pathjoin([opt_instroot, "lib/myr", config.Runtime][:])
}
diff --git a/mbld/parse.myr b/mbld/parse.myr
index 75efe3d..3753166 100644
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -132,7 +132,13 @@ const testtarget = {b, p
/* mantarget: anontarget */
const mantarget = {b, p
- addtarg(p, b, "__man__", `Man anontarget(p, "man"))
+ var targ
+
+ targ = std.mk([
+ .dir=std.sldup(p.fdir),
+ .pages=anontarget(p, "man")
+ ])
+ addtarg(p, b, "__man__", `Man targ)
}
/* subtarget : anontarget */
diff --git a/mbld/types.myr b/mbld/types.myr
index 90d1d0c..03c822a 100644
--- a/mbld/types.myr
+++ b/mbld/types.myr
@@ -16,16 +16,12 @@ pkg bld =
arch : byte[:]
;;
-
- type depgraph = struct
- roots : byte[:][:]
- deps : std.htab(byte[:], byte[:][:])#
- libs : std.htab(byte[:], byte[:][:])#
- input : std.htab(byte[:], byte[:])#
- sources : std.htab(byte[:], bool)#
- updated : std.htab(byte[:], bool)#
- seen : std.htab(byte[:], bool)#
- done : std.htab(byte[:], bool)#
+ type targ = union
+ `Bin myrtarg#
+ `Lib myrtarg#
+ `Test myrtarg#
+ `Gen gentarg#
+ `Man mantarg#
;;
type myrtarg = struct
@@ -49,11 +45,19 @@ pkg bld =
done : bool
;;
- type targ = union
- `Bin myrtarg#
- `Lib myrtarg#
- `Test myrtarg#
- `Gen gentarg#
- `Man byte[:][:]
+ type mantarg = struct
+ dir : byte[:]
+ pages : byte[:][:]
+ ;;
+
+ type depgraph = struct
+ roots : byte[:][:]
+ deps : std.htab(byte[:], byte[:][:])#
+ libs : std.htab(byte[:], byte[:][:])#
+ input : std.htab(byte[:], byte[:])#
+ sources : std.htab(byte[:], bool)#
+ updated : std.htab(byte[:], bool)#
+ seen : std.htab(byte[:], bool)#
+ done : std.htab(byte[:], bool)#
;;
;;