diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/9c | 14 | ||||
-rwxr-xr-x | bin/9fs | 4 | ||||
-rwxr-xr-x | bin/9l | 17 | ||||
-rwxr-xr-x | bin/soelim | 16 |
4 files changed, 26 insertions, 25 deletions
@@ -93,28 +93,20 @@ case "$tag" in useclang cflags="$ngflags -g3 -m32" ;; -*Darwin*) usegcc +*Darwin*) usegcc cflags="$ngflags -g3 -no-cpp-precomp -m32" ;; *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;; -*Linux*) usegcc +*Linux*) usegcc case "${CC9:-gcc}" in tcc) cc=tcc cflags="-c -g" ;; esac - case "${SYSVERSION:-`uname -r`}" in - 2.4.*) - cflags="$cflags -D__Linux24__" - ;; - 2.6.*) - cflags="$cflags -D__Linux26__" - ;; - esac ;; *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;; *SunOS*-cc) cc=cc; - cflags="-mt -g -O -c -xCC -D__sun__" + cflags="-mt -g -O -c -xCC -D__sun__" u=`uname` v=`uname -r` s=`echo $u$v | tr '. ' '__'` @@ -19,10 +19,8 @@ fn srv1 { ns=`{namespace} switch($1){ -case tip - srv1 -a tip utumno.tip9ug.jp case sources - srv1 -n sources sources.cs.bell-labs.com + srv1 -n sources 9p.io case * srv1 $1 $1 } @@ -25,12 +25,7 @@ case "$tag" in *Linux*) ld=${CC9:-gcc} userpath=true - extralibs="$extralibs -lutil -lresolv" - case "${SYSVERSION:-`uname -r`}" in - 2.6.* | [3-9].* | [1-9][0-9].*) - extralibs="$extralibs -lpthread" - ;; - esac + extralibs="$extralibs -lutil -lresolv -lpthread" ;; *Darwin*x86_64*) ld="${CC9:-gcc} -m64" @@ -41,7 +36,7 @@ case "$tag" in *SunOS*) ld="${CC9:-cc} -g" extralibs="$extralibs -lrt -lpthread -lsocket -lnsl" - # Record paths to shared libraries to avoid needing LD_LIBRARY_PATH + # Record paths to shared libraries to avoid needing LD_LIBRARY_PATH for i in "$libsl $@" do case "$i" in @@ -106,7 +101,7 @@ then lpaths="$lpaths $l" esac done - + if $verbose then echo "ofiles $ofiles" @@ -309,7 +304,7 @@ then frameworks="" for i in $autoframeworks - do + do frameworks="-framework $i $frameworks" done fi @@ -335,8 +330,8 @@ fi xtmp="${TMPDIR-/tmp}/9l.$$.$USER.out" xxout() { - sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . | - egrep -v 'is (often|almost always) misused|is dangerous, better use|text-based stub' + sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . | + egrep -v 'is (often|almost always) misused|is dangerous, better use|text-based stub' rm -f $xtmp } diff --git a/bin/soelim b/bin/soelim new file mode 100755 index 00000000..2ba3de99 --- /dev/null +++ b/bin/soelim @@ -0,0 +1,16 @@ +#!/usr/local/plan9/bin/rc +# joyless reimplementation of soelim +# the $0 recursion is a bit ugly + +# canonicalise troff commands first with sed into ". so file" form. +# but the space after the dot has to come out; tbl can't cope with it. +# friggin' html macros can be longer than two characters; grrr. +sed '/^[.'']/{ + s/([^\\])\\".*$/\1/ +# s/^(.)[ ]*([^ \\][^ \\])[ ]*/\1 \2 / + s/^(.)[ ]*([^ \\][^ \\])/\1 \2/ +}' $* | awk ' BEGIN { me = "'$0'" } + $1 !~ /^[.'']$/ { print; next } + $2 == "so" { system(me " " $3) ; next } + $2 == "nx" { system(me " " $3) ; exit } + { print }' | sed 's/^([.'']) /\1/' |