works on Linux 2.6
This commit is contained in:
parent
78e51a8c66
commit
359c1e017e
14 changed files with 33 additions and 28 deletions
12
bin/9l
12
bin/9l
|
|
@ -27,7 +27,7 @@ then
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
case "$i" in
|
case "$i" in
|
||||||
*.o)
|
*.[ao])
|
||||||
ofiles="$ofiles $i"
|
ofiles="$ofiles $i"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -58,11 +58,15 @@ then
|
||||||
workq=""
|
workq=""
|
||||||
for i in $w
|
for i in $w
|
||||||
do
|
do
|
||||||
|
# can't trust the libraries about using
|
||||||
|
# libthread - we might not be linking with
|
||||||
|
# those object files.
|
||||||
a=`
|
a=`
|
||||||
nm $PLAN9/lib/lib$i.a |
|
nm $PLAN9/lib/lib$i.a |
|
||||||
grep '__p9l_autolib_[a-zA-Z0-9+-]*$' |
|
grep '__p9l_autolib_[a-zA-Z0-9+-]*$' |
|
||||||
sed 's/.*__p9l_autolib_//' |
|
sed 's/.*__p9l_autolib_//' |
|
||||||
sort -u
|
sort -u |
|
||||||
|
grep -v thread
|
||||||
`
|
`
|
||||||
okayfn="true"
|
okayfn="true"
|
||||||
for j in $a
|
for j in $a
|
||||||
|
|
@ -131,9 +135,9 @@ then
|
||||||
libsl="$libsl -l9"
|
libsl="$libsl -l9"
|
||||||
|
|
||||||
# cycle: lib9 expects p9main, which is defined in libthread. oops.
|
# cycle: lib9 expects p9main, which is defined in libthread. oops.
|
||||||
if $havethread
|
if havethread
|
||||||
then
|
then
|
||||||
libsl="$libsl -lthread"
|
libsl="$libsl -lthread -l9"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$needdraw" = xtrue ]
|
if [ "x$needdraw" = xtrue ]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
../bin/mk: mkmk.sh
|
../bin/mk: mkmk.sh
|
||||||
SYSNAME=`uname` export SYSNAME; \
|
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; \
|
PATH=`pwd`/../bin:$$PATH export PATH; \
|
||||||
PLAN9=`pwd`/.. export PLAN9; \
|
PLAN9=`pwd`/.. export PLAN9; \
|
||||||
sh -x mkmk.sh
|
sh -x mkmk.sh
|
||||||
|
|
|
||||||
|
|
@ -18,18 +18,16 @@ OFILES=\
|
||||||
HFILES=grap.h\
|
HFILES=grap.h\
|
||||||
y.tab.h\
|
y.tab.h\
|
||||||
|
|
||||||
YFILES=grap.y\
|
YFILES=grap.y
|
||||||
|
LFILES=grapl.lx
|
||||||
LFILES=grapl.lx\
|
|
||||||
|
|
||||||
<$PLAN9/src/mkone
|
<$PLAN9/src/mkone
|
||||||
YFLAGS = -d -S
|
YFLAGS=-d -S
|
||||||
LEX=9lex
|
|
||||||
|
|
||||||
grap.c: y.tab.c
|
grap.c: y.tab.c
|
||||||
mv $prereq $target
|
mv $prereq $target
|
||||||
|
|
||||||
grapl.c: $LFILES
|
grapl.c:D: $LFILES
|
||||||
$LEX -t $prereq > $target
|
$LEX -t $prereq > $target
|
||||||
|
|
||||||
clean:V:
|
clean:V:
|
||||||
|
|
|
||||||
|
|
@ -25,5 +25,13 @@ delatex.c:D: delatex.lx $PLAN9/bin/lex
|
||||||
$PLAN9/bin/lex: $PLAN9/bin/yacc
|
$PLAN9/bin/lex: $PLAN9/bin/yacc
|
||||||
cd lex; mk install
|
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
|
CLEANFILES=$CLEANFILES bc.tab.[ch] units.tab.[ch] delatex.c
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,11 @@ YFILES=picy.y\
|
||||||
|
|
||||||
<$PLAN9/src/mkone
|
<$PLAN9/src/mkone
|
||||||
YFLAGS=-S -d
|
YFLAGS=-S -d
|
||||||
LEX=9lex
|
|
||||||
|
|
||||||
picy.c: y.tab.c
|
picy.c: y.tab.c
|
||||||
mv $prereq $target
|
mv $prereq $target
|
||||||
|
|
||||||
picl.c: picl.lx
|
picl.c:D: picl.lx
|
||||||
$LEX -t $prereq > $target
|
$LEX -t $prereq > $target
|
||||||
|
|
||||||
clean:V:
|
clean:V:
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ struct penvir E[9] = {
|
||||||
struct penvir *e0 = E, *e1 = &E[1], *esave;
|
struct penvir *e0 = E, *e1 = &E[1], *esave;
|
||||||
int
|
int
|
||||||
bcolor(char *s){
|
bcolor(char *s){
|
||||||
int c;
|
|
||||||
while (*s != 0) {
|
while (*s != 0) {
|
||||||
switch (*s) {
|
switch (*s) {
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
case '0': case '1': case '2': case '3': case '4':
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,13 @@
|
||||||
#ifndef _POSIX_SOURCE
|
|
||||||
#include <u.h>
|
|
||||||
#include <libc.h>
|
|
||||||
#endif
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#define ERR(str, chr) if(opterr){fprintf(stderr, "%s%s%c\n", argv[0], str, chr);}
|
#define ERR(str, chr) if(opterr){fprintf(stderr, "%s%s%c\n", argv[0], str, chr);}
|
||||||
int opterr = 1;
|
int opterr = 1;
|
||||||
int optind = 1;
|
int optind = 1;
|
||||||
int optopt;
|
int optopt;
|
||||||
char *optarg;
|
char *optarg;
|
||||||
char *strchr();
|
|
||||||
|
|
||||||
int
|
int
|
||||||
getopt (argc, argv, opts)
|
getopt (int argc, char **argv, char *opts)
|
||||||
char **argv, *opts;
|
|
||||||
{
|
{
|
||||||
static int sp = 1;
|
static int sp = 1;
|
||||||
register int c;
|
register int c;
|
||||||
|
|
@ -22,7 +17,7 @@ char **argv, *opts;
|
||||||
if (optind >= argc ||
|
if (optind >= argc ||
|
||||||
argv[optind][0] != '-' || argv[optind][1] == '\0')
|
argv[optind][0] != '-' || argv[optind][1] == '\0')
|
||||||
return EOF;
|
return EOF;
|
||||||
else if (strcmp(argv[optind], "--") == NULL) {
|
else if (strcmp(argv[optind], "--") == 0) {
|
||||||
optind++;
|
optind++;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,4 @@ HFILES=comments.h\
|
||||||
|
|
||||||
<$PLAN9/src/mklib
|
<$PLAN9/src/mklib
|
||||||
|
|
||||||
CFLAGS=-c -D$SYSTEM -D_POSIX_SOURCE
|
CFLAGS=-c -D$SYSTEM
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ threadmain(int argc, char *argv[])
|
||||||
char *host = nil;
|
char *host = nil;
|
||||||
int statsflag = 0;
|
int statsflag = 0;
|
||||||
|
|
||||||
threadlinklibrary();
|
|
||||||
atexit(cleanup);
|
atexit(cleanup);
|
||||||
|
|
||||||
ARGBEGIN{
|
ARGBEGIN{
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ AFLAGS=
|
||||||
CLEANFILES=
|
CLEANFILES=
|
||||||
NUKEFILES=
|
NUKEFILES=
|
||||||
YACC=9 yacc
|
YACC=9 yacc
|
||||||
|
LEX=9 lex
|
||||||
YFLAGS=-d
|
YFLAGS=-d
|
||||||
LIB=
|
LIB=
|
||||||
SHORTLIB=9
|
SHORTLIB=9
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ default:V: $LIB
|
||||||
|
|
||||||
$LIB(%):N: %
|
$LIB(%):N: %
|
||||||
$LIB: ${OFILES:%=$LIB(%)}
|
$LIB: ${OFILES:%=$LIB(%)}
|
||||||
$AR rvc $LIB `membername $newprereq`
|
$AR rvc $LIB $newmember
|
||||||
|
|
||||||
&:n: &.$O
|
&:n: &.$O
|
||||||
$AR rvc $LIB $stem.$O
|
$AR rvc $LIB $stem.$O
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ cd lib9
|
||||||
9c utf/utfrrune.c
|
9c utf/utfrrune.c
|
||||||
9c utf/utfrune.c
|
9c utf/utfrune.c
|
||||||
9c utf/utfutf.c
|
9c utf/utfutf.c
|
||||||
9ar rvc $PLAN9/lib/lib9.a *.o
|
9ar rvc $PLAN9/lib/lib9.a _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 convD2M.o convM2D.o convM2S.o convS2M.o create.o ctime.o date.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 fcallfmt.o get9root.o getcallerpc-$OBJTYPE.o getenv.o getfields.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 pipe.o post9p.o postnote.o qlock.o quote.o rand.o read9pmsg.o readn.o rfork.o seek.o sendfd.o sleep.o strdup.o strecpy.o sysfatal.o sysname.o time.o tokenize.o truerand.o u16.o u32.o u64.o unsharp.o wait.o waitpid.o dofmt.o fltfmt.o fmt.o fmtfd.o fmtfdflush.o fmtlock2.o fmtprint.o fmtquote.o fmtrune.o fmtstr.o fmtvprint.o fprint.o nan64.o print.o runefmtstr.o runeseprint.o runesmprint.o runesnprint.o runesprint.o runevseprint.o runevsmprint.o runevsnprint.o seprint.o smprint.o snprint.o sprint.o strtod.o vfprint.o vseprint.o vsmprint.o vsnprint.o charstod.o pow10.o rune.o runestrcat.o runestrchr.o runestrcmp.o runestrcpy.o runestrdup.o runestrlen.o runestrecpy.o runestrncat.o runestrncmp.o runestrncpy.o runestrrchr.o runestrstr.o runetype.o utfecpy.o utflen.o utfnlen.o utfrrune.o utfrune.o utfutf.o
|
||||||
cd ..
|
cd ..
|
||||||
cd libbio
|
cd libbio
|
||||||
9c bbuffered.c
|
9c bbuffered.c
|
||||||
|
|
@ -155,7 +155,7 @@ cd libbio
|
||||||
9c bseek.c
|
9c bseek.c
|
||||||
9c bvprint.c
|
9c bvprint.c
|
||||||
9c bwrite.c
|
9c bwrite.c
|
||||||
9ar rvc $PLAN9/lib/libbio.a *.o
|
9ar rvc $PLAN9/lib/libbio.a bbuffered.o bfildes.o bflush.o bgetc.o bgetrune.o bgetd.o binit.o boffset.o bprint.o bputc.o bputrune.o brdline.o brdstr.o bread.o bseek.o bvprint.o bwrite.o
|
||||||
cd ..
|
cd ..
|
||||||
cd libregexp
|
cd libregexp
|
||||||
9c regcomp.c
|
9c regcomp.c
|
||||||
|
|
@ -165,7 +165,7 @@ cd libregexp
|
||||||
9c regaux.c
|
9c regaux.c
|
||||||
9c rregexec.c
|
9c rregexec.c
|
||||||
9c rregsub.c
|
9c rregsub.c
|
||||||
9ar rvc $PLAN9/lib/libregexp9.a *.o
|
9ar rvc $PLAN9/lib/libregexp9.a regcomp.o regerror.o regexec.o regsub.o regaux.o rregexec.o rregsub.o
|
||||||
cd ..
|
cd ..
|
||||||
cd cmd/mk
|
cd cmd/mk
|
||||||
9c arc.c
|
9c arc.c
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue