9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | LICENSE

commit 4e6a3f7520886923dc03eb96764fc0b09c52733e
parent abc072187111c9098f80518e9c8d0b81ae1577d0
Author: Anselm R Garbe <anselm@garbe.us>
Date:   Sun,  2 Aug 2009 10:07:10 +0100

some tweaks, install into /usr/local/plan9 to provide better compatibility with p9p and apps written on top of p9p such as werc
Diffstat:
config.mk | 2+-
lib9/Makefile | 242+++++++++++--------------------------------------------------------------------
rc/plan9ish.c | 2+-
3 files changed, 36 insertions(+), 210 deletions(-)

diff --git a/config.mk b/config.mk @@ -1,7 +1,7 @@ # Customize to fit your system # paths -PREFIX = /usr/local/9 +PREFIX = /usr/local/plan9 MANPREFIX = ${PREFIX}/share/man VERSION = 200907 diff --git a/lib9/Makefile b/lib9/Makefile @@ -1,223 +1,31 @@ # lib9 - unix port from plan9 lib9 -# this works in gnu make -SYSNAME:=${shell uname} -OBJTYPE:=${shell uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'} - -# this works in bsd make -SYSNAME!=uname -OBJTYPE!=uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g' - -# the gnu rules will mess up bsd but not vice versa, -# hence the gnu rules come first. - include ../config.mk LIB=lib9.a TARG=lib9 -O=o # following objects are not compiled for several reasons -# crypt.$(O) -# netcrypt.$(O) -# convD2M.$(O) -# convM2D.$(O) -# convM2S.$(O) -# convS2M.$(O) +# crypt.o +# netcrypt.o +# convD2M.o +# convM2D.o +# convM2S.o +# convS2M.o NUM=\ - fmt/charstod.$(O)\ - fmt/pow10.$(O)\ + fmt/charstod.o\ + fmt/pow10.o\ FMTOFILES=\ - fmt/dofmt.$(O)\ - fmt/fltfmt.$(O)\ - fmt/fmt.$(O)\ - fmt/fmtfd.$(O)\ - fmt/fmtfdflush.$(O)\ - fmt/fmtlocale.$(O)\ - fmtlock2.$(O)\ - fmt/fmtnull.$(O)\ - fmt/fmtprint.$(O)\ - fmt/fmtquote.$(O)\ - fmt/fmtrune.$(O)\ - fmt/fmtstr.$(O)\ - fmt/fmtvprint.$(O)\ - fmt/fprint.$(O)\ - fmt/nan64.$(O)\ - fmt/print.$(O)\ - fmt/runefmtstr.$(O)\ - fmt/runeseprint.$(O)\ - fmt/runesmprint.$(O)\ - fmt/runesnprint.$(O)\ - fmt/runesprint.$(O)\ - fmt/runevseprint.$(O)\ - fmt/runevsmprint.$(O)\ - fmt/runevsnprint.$(O)\ - fmt/seprint.$(O)\ - fmt/smprint.$(O)\ - fmt/snprint.$(O)\ - fmt/sprint.$(O)\ - fmt/strtod.$(O)\ - fmt/vfprint.$(O)\ - fmt/vseprint.$(O)\ - fmt/vsmprint.$(O)\ - fmt/vsnprint.$(O)\ - $(NUM)\ - -UTFOFILES=\ - utf/rune.$(O)\ - utf/runestrcat.$(O)\ - utf/runestrchr.$(O)\ - utf/runestrcmp.$(O)\ - utf/runestrcpy.$(O)\ - utf/runestrdup.$(O)\ - utf/runestrlen.$(O)\ - utf/runestrecpy.$(O)\ - utf/runestrncat.$(O)\ - utf/runestrncmp.$(O)\ - utf/runestrncpy.$(O)\ - utf/runestrrchr.$(O)\ - utf/runestrstr.$(O)\ - utf/runetype.$(O)\ - utf/utfecpy.$(O)\ - utf/utflen.$(O)\ - utf/utfnlen.$(O)\ - utf/utfrrune.$(O)\ - utf/utfrune.$(O)\ - utf/utfutf.$(O)\ - -BIOFILES=\ - bio/bbuffered.$(O)\ - bio/bfildes.$(O)\ - bio/bflush.$(O)\ - bio/bgetc.$(O)\ - bio/bgetrune.$(O)\ - bio/bgetd.$(O)\ - bio/binit.$(O)\ - bio/boffset.$(O)\ - bio/bprint.$(O)\ - bio/bputc.$(O)\ - bio/bputrune.$(O)\ - bio/brdline.$(O)\ - bio/brdstr.$(O)\ - bio/bread.$(O)\ - bio/bseek.$(O)\ - bio/bvprint.$(O)\ - bio/bwrite.$(O)\ - -REGEXFILES=\ - regex/regcomp.$(O)\ - regex/regerror.$(O)\ - regex/regexec.$(O)\ - regex/regsub.$(O)\ - regex/regaux.$(O)\ - regex/rregexec.$(O)\ - regex/rregsub.$(O)\ - -LIB9OFILES=\ - _exits.$(O)\ - _p9dialparse.$(O)\ - _p9dir.$(O)\ - announce.$(O)\ - argv0.$(O)\ - atexit.$(O)\ - atoi.$(O)\ - atol.$(O)\ - atoll.$(O)\ - atnotify.$(O)\ - await.$(O)\ - cistrcmp.$(O)\ - cistrncmp.$(O)\ - cistrstr.$(O)\ - cleanname.$(O)\ - create.$(O)\ - ctime.$(O)\ - dial.$(O)\ - dirfstat.$(O)\ - dirfwstat.$(O)\ - dirmodefmt.$(O)\ - dirread.$(O)\ - dirstat.$(O)\ - dirwstat.$(O)\ - dup.$(O)\ - encodefmt.$(O)\ - errstr.$(O)\ - exec.$(O)\ - execl.$(O)\ - exitcode.$(O)\ - fcallfmt.$(O)\ - get9root.$(O)\ - getcallerpc-$(OBJTYPE).$(O)\ - getenv.$(O)\ - getfields.$(O)\ - getnetconn.$(O)\ - getns.$(O)\ - getuser.$(O)\ - getwd.$(O)\ - jmp.$(O)\ - lrand.$(O)\ - lnrand.$(O)\ - main.$(O)\ - malloc.$(O)\ - malloctag.$(O)\ - mallocz.$(O)\ - nan.$(O)\ - needsrcquote.$(O)\ - needstack.$(O)\ - netmkaddr.$(O)\ - notify.$(O)\ - nrand.$(O)\ - nulldir.$(O)\ - open.$(O)\ - opentemp.$(O)\ - pin.$(O)\ - pipe.$(O)\ - post9p.$(O)\ - postnote.$(O)\ - qlock.$(O)\ - quote.$(O)\ - rand.$(O)\ - read9pmsg.$(O)\ - readcons.$(O)\ - readn.$(O)\ - rfork.$(O)\ - searchpath.$(O)\ - seek.$(O)\ - sendfd.$(O)\ - sleep.$(O)\ - strdup.$(O)\ - strecpy.$(O)\ - sysfatal.$(O)\ - syslog.$(O)\ - sysname.$(O)\ - time.$(O)\ - tm2sec.$(O)\ - tokenize.$(O)\ - truerand.$(O)\ - u16.$(O)\ - u32.$(O)\ - u64.$(O)\ - unsharp.$(O)\ - wait.$(O)\ - waitpid.$(O)\ - write.$(O)\ - zoneinfo.$(O)\ - -OFILES=\ - $(FMTOFILES)\ - $(UTFOFILES)\ - $(BIOFILES)\ - $(REGEXFILES)\ - $(LIB9OFILES) - -OFILESOLD=\ fmt/dofmt.o\ fmt/fltfmt.o\ fmt/fmt.o\ fmt/fmtfd.o\ fmt/fmtfdflush.o\ - fmt/fmtlock.o\ + fmt/fmtlocale.o\ + fmtlock2.o\ + fmt/fmtnull.o\ fmt/fmtprint.o\ fmt/fmtquote.o\ fmt/fmtrune.o\ @@ -243,8 +51,9 @@ OFILESOLD=\ fmt/vseprint.o\ fmt/vsmprint.o\ fmt/vsnprint.o\ - fmt/charstod.o\ - fmt/pow10.o\ + $(NUM)\ + +UTFOFILES=\ utf/rune.o\ utf/runestrcat.o\ utf/runestrchr.o\ @@ -265,12 +74,14 @@ OFILESOLD=\ utf/utfrrune.o\ utf/utfrune.o\ utf/utfutf.o\ + +BIOFILES=\ bio/bbuffered.o\ bio/bfildes.o\ bio/bflush.o\ bio/bgetc.o\ - bio/bgetd.o\ bio/bgetrune.o\ + bio/bgetd.o\ bio/binit.o\ bio/boffset.o\ bio/bprint.o\ @@ -282,6 +93,8 @@ OFILESOLD=\ bio/bseek.o\ bio/bvprint.o\ bio/bwrite.o\ + +REGEXFILES=\ regex/regcomp.o\ regex/regerror.o\ regex/regexec.o\ @@ -289,6 +102,8 @@ OFILESOLD=\ regex/regaux.o\ regex/rregexec.o\ regex/rregsub.o\ + +LIB9OFILES=\ _exits.o\ _p9dialparse.o\ _p9dir.o\ @@ -306,7 +121,6 @@ OFILESOLD=\ cleanname.o\ create.o\ ctime.o\ - date.o\ dial.o\ dirfstat.o\ dirfwstat.o\ @@ -319,9 +133,10 @@ OFILESOLD=\ errstr.o\ exec.o\ execl.o\ + exitcode.o\ fcallfmt.o\ - getcallerpc-$(OBJTYPE).o\ get9root.o\ + getcallerpc-$(OBJTYPE).o\ getenv.o\ getfields.o\ getnetconn.o\ @@ -344,6 +159,7 @@ OFILESOLD=\ nulldir.o\ open.o\ opentemp.o\ + pin.o\ pipe.o\ post9p.o\ postnote.o\ @@ -364,6 +180,7 @@ OFILESOLD=\ syslog.o\ sysname.o\ time.o\ + tm2sec.o\ tokenize.o\ truerand.o\ u16.o\ @@ -372,6 +189,15 @@ OFILESOLD=\ unsharp.o\ wait.o\ waitpid.o\ + write.o\ + zoneinfo.o\ + +OFILES=\ + $(FMTOFILES)\ + $(UTFOFILES)\ + $(BIOFILES)\ + $(REGEXFILES)\ + $(LIB9OFILES) all: ${LIB} @echo built lib9 diff --git a/rc/plan9ish.c b/rc/plan9ish.c @@ -27,7 +27,7 @@ char *syssigname[]={ char* Rcmain(void) { - return unsharp("#9/rcmain"); + return unsharp("#9/etc/rcmain"); } char Fdprefix[]="/dev/fd/";