URI: 
       tworks on Linux 2.6 - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 359c1e017ee367c34b082b1b4e6c002686d01bce
   DIR parent 78e51a8c6678b6e3dff3d619aa786669f531f4bc
  HTML Author: rsc <devnull@localhost>
       Date:   Fri, 14 Jan 2005 04:24:09 +0000
       
       works on Linux 2.6
       
       Diffstat:
         M bin/9l                              |      12 ++++++++----
         M src/Makefile                        |       2 +-
         M src/cmd/grap/mkfile                 |      10 ++++------
         M src/cmd/mkfile                      |       8 ++++++++
         M src/cmd/pic/mkfile                  |       3 +--
         M src/cmd/plot/libplot/subr.c         |       1 -
         M src/cmd/postscript/common/bbox.c    |       1 +
         M src/cmd/postscript/common/getopt.c  |      11 +++--------
         M src/cmd/postscript/common/misc.c    |       1 +
         M src/cmd/postscript/common/mkfile    |       2 +-
         M src/cmd/vac/vac.c                   |       1 -
         M src/mkhdr                           |       1 +
         M src/mklib                           |       2 +-
         M src/mkmk.sh                         |       6 +++---
       
       14 files changed, 33 insertions(+), 28 deletions(-)
       ---
   DIR diff --git a/bin/9l b/bin/9l
       t@@ -27,7 +27,7 @@ then
                for i
                do
                        case "$i" in
       -                *.o)
       +                *.[ao])
                                ofiles="$ofiles $i"
                                ;;
                        esac
       t@@ -58,11 +58,15 @@ then
                        workq=""
                        for i in $w
                        do
       +                        # can't trust the libraries about using
       +                        # libthread - we might not be linking with
       +                        # those object files.
                                a=`
                                        nm $PLAN9/lib/lib$i.a |
                                        grep '__p9l_autolib_[a-zA-Z0-9+-]*$' |
                                        sed 's/.*__p9l_autolib_//' |
       -                                sort -u
       +                                sort -u |
       +                                grep -v thread
                                `
                                okayfn="true"
                                for j in $a
       t@@ -131,9 +135,9 @@ then
                libsl="$libsl -l9"
        
                # cycle: lib9 expects p9main, which is defined in libthread.  oops.
       -        if $havethread
       +        if havethread
                then
       -                libsl="$libsl -lthread"
       +                libsl="$libsl -lthread -l9"
                fi
        
                if [ "x$needdraw" = xtrue ]
   DIR diff --git a/src/Makefile b/src/Makefile
       t@@ -1,6 +1,6 @@
        ../bin/mk: mkmk.sh
                SYSNAME=`uname` export SYSNAME; \
       -        OBJTYPE=`uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g' | sed 's/ppc64/power/g' | sed 's/ppc/power/g'` export OBJTYPE; \
       +        OBJTYPE=`uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g; s/PowerMacintosh/power/; s/ppc64/power/g; s/ppc/power/g'` export OBJTYPE; \
                PATH=`pwd`/../bin:$$PATH export PATH; \
                PLAN9=`pwd`/.. export PLAN9; \
                sh -x mkmk.sh
   DIR diff --git a/src/cmd/grap/mkfile b/src/cmd/grap/mkfile
       t@@ -18,18 +18,16 @@ OFILES=\
        HFILES=grap.h\
                y.tab.h\
        
       -YFILES=grap.y\
       -
       -LFILES=grapl.lx\
       +YFILES=grap.y
       +LFILES=grapl.lx
        
        <$PLAN9/src/mkone
       -YFLAGS = -d -S
       -LEX=9lex
       +YFLAGS=-d -S
        
        grap.c:        y.tab.c
                mv $prereq $target
        
       -grapl.c:        $LFILES
       +grapl.c:D: $LFILES
                $LEX -t $prereq > $target
        
        clean:V:
   DIR diff --git a/src/cmd/mkfile b/src/cmd/mkfile
       t@@ -25,5 +25,13 @@ delatex.c:D: delatex.lx $PLAN9/bin/lex
        $PLAN9/bin/lex: $PLAN9/bin/yacc
                cd lex; mk install
        
       +# This should not be necessary.
       +$PLAN9/bin/yacc: $O.yacc
       +        install -c $O.yacc $PLAN9/bin/yacc
       +$O.yacc: yacc.$O
       +        $LD -o $target $prereq
       +yacc.$O: yacc.c
       +        $CC $CFLAGS yacc.c
       +
        CLEANFILES=$CLEANFILES bc.tab.[ch] units.tab.[ch] delatex.c
        
   DIR diff --git a/src/cmd/pic/mkfile b/src/cmd/pic/mkfile
       t@@ -25,12 +25,11 @@ YFILES=picy.y\
        
        <$PLAN9/src/mkone
        YFLAGS=-S -d
       -LEX=9lex
        
        picy.c:        y.tab.c
                mv $prereq $target
        
       -picl.c:        picl.lx
       +picl.c:D: picl.lx
                $LEX -t $prereq > $target
        
        clean:V:
   DIR diff --git a/src/cmd/plot/libplot/subr.c b/src/cmd/plot/libplot/subr.c
       t@@ -13,7 +13,6 @@ struct penvir  E[9] = {
        struct penvir *e0 = E, *e1 = &E[1], *esave;
        int
        bcolor(char *s){
       -        int c;
                while (*s != 0) {
                        switch (*s) {
                        case '0': case '1': case '2': case '3': case '4':
   DIR diff --git a/src/cmd/postscript/common/bbox.c b/src/cmd/postscript/common/bbox.c
       t@@ -11,6 +11,7 @@
         */
        
        #include <stdio.h>
       +#include <string.h>
        #include <ctype.h>
        #include <sys/types.h>
        #include <fcntl.h>
   DIR diff --git a/src/cmd/postscript/common/getopt.c b/src/cmd/postscript/common/getopt.c
       t@@ -1,18 +1,13 @@
       -#ifndef _POSIX_SOURCE
       -#include <u.h>
       -#include <libc.h>
       -#endif
        #include        <stdio.h>
       +#include <string.h>
        #define ERR(str, chr)       if(opterr){fprintf(stderr, "%s%s%c\n", argv[0], str, chr);}
        int     opterr = 1;
        int     optind = 1;
        int        optopt;
        char    *optarg;
       -char    *strchr();
        
        int
       -getopt (argc, argv, opts)
       -char **argv, *opts;
       +getopt (int argc, char **argv, char *opts)
        {
                static int sp = 1;
                register int c;
       t@@ -22,7 +17,7 @@ char **argv, *opts;
                        if (optind >= argc ||
                           argv[optind][0] != '-' || argv[optind][1] == '\0')
                                return EOF;
       -                else if (strcmp(argv[optind], "--") == NULL) {
       +                else if (strcmp(argv[optind], "--") == 0) {
                                optind++;
                                return EOF;
                        }
   DIR diff --git a/src/cmd/postscript/common/misc.c b/src/cmd/postscript/common/misc.c
       t@@ -5,6 +5,7 @@
         */
        
        #include <stdio.h>
       +#include <stdlib.h>
        #include <ctype.h>
        #include <sys/types.h>
        #include <fcntl.h>
   DIR diff --git a/src/cmd/postscript/common/mkfile b/src/cmd/postscript/common/mkfile
       t@@ -20,4 +20,4 @@ HFILES=comments.h\
        
        <$PLAN9/src/mklib
        
       -CFLAGS=-c -D$SYSTEM -D_POSIX_SOURCE
       +CFLAGS=-c -D$SYSTEM 
   DIR diff --git a/src/cmd/vac/vac.c b/src/cmd/vac/vac.c
       t@@ -115,7 +115,6 @@ threadmain(int argc, char *argv[])
                char *host = nil;
                int statsflag = 0;
        
       -        threadlinklibrary();
                atexit(cleanup);
        
                ARGBEGIN{
   DIR diff --git a/src/mkhdr b/src/mkhdr
       t@@ -29,6 +29,7 @@ AFLAGS=
        CLEANFILES=
        NUKEFILES=
        YACC=9 yacc
       +LEX=9 lex
        YFLAGS=-d
        LIB=
        SHORTLIB=9
   DIR diff --git a/src/mklib b/src/mklib
       t@@ -2,7 +2,7 @@ default:V:        $LIB
        
        $LIB(%):N: %
        $LIB:        ${OFILES:%=$LIB(%)}
       -        $AR rvc $LIB `membername $newprereq`
       +        $AR rvc $LIB $newmember
        
        &:n:        &.$O
                $AR rvc $LIB $stem.$O
   DIR diff --git a/src/mkmk.sh b/src/mkmk.sh
       t@@ -135,7 +135,7 @@ cd lib9
        9c  utf/utfrrune.c
        9c  utf/utfrune.c
        9c  utf/utfutf.c
       -9ar rvc $PLAN9/lib/lib9.a *.o
mx1.adamsgaard.dk:70 /src/plan9port/commit/359c1e017ee367c34b082b1b4e6c002686d01bce.gph:235: line too long