URI: 
       tMore Mac tweaks. - 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 8f314994dbcc11b2d8397535ce8b0cf9d84150d0
   DIR parent 53dbac948575b07e95d184bbfbe4d8953c5ccc4c
  HTML Author: rsc <devnull@localhost>
       Date:   Tue,  2 Mar 2004 17:34:15 +0000
       
       More Mac tweaks.
       
       Diffstat:
         M INSTALL                             |       2 +-
         M bin/9c                              |       9 ++++-----
         M bin/9l                              |       2 +-
         M src/Makefile                        |       2 ++
         M src/cmd/mk/main.c                   |       1 +
         M src/cmd/mk/mk.h                     |      36 +------------------------------
         M src/cmd/mk/shprint.c                |       2 ++
         M src/cmd/mk/unix.c                   |       1 +
         M src/lib9/sendfd.c                   |       4 ++--
         M src/mkfile                          |       6 ++++--
         M src/mkmk.sh                         |      81 +++++++++++++++++++++++++++++--
         M unix/mkfile.mk                      |       4 ++++
       
       12 files changed, 101 insertions(+), 49 deletions(-)
       ---
   DIR diff --git a/INSTALL b/INSTALL
       t@@ -9,5 +9,5 @@ mk clean
        mk install
        
        echo "Set PLAN9=$PLAN9 in your profile environment."
       -echo 'Add $PLAN9/bin to your profile PATH.'
       +echo 'Add $PLAN9/bin to your PATH.'
        
   DIR diff --git a/bin/9c b/bin/9c
       t@@ -3,10 +3,9 @@
        usegcc()
        {
                cc=gcc
       -        cflags=" \
       +        ngflags=" \
                        -O2 \
                        -c \
       -                -ggdb \
                        -Wall \
                        -Wno-parentheses \
                        -Wno-missing-braces \
       t@@ -14,14 +13,14 @@ usegcc()
                        -Wno-comment \
                        -Wno-sign-compare \
                "
       +        cflags="$cflags -ggdb"
        }
        
       -tag="`uname`-`uname -m`-${CC9:-cc}"
       +tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
        case "$tag" in
        *BSD*)                usegcc ;;
        *Darwin*)        usegcc 
       -        cflags=`echo $cflags|sed 's/-ggdb/-g3 -no-cpp-precomp/'`
       -        ;;
       +                cflags="$ngflags -g3 -no-cpp-precomp" ;;
        *HP-UX*)        cc=cc; cflags="-g -O -c -Ae" ;;
        *Linux*)        usegcc ;;
        *OSF1*)                cc=cc; cflags="-g -O -c" ;;
   DIR diff --git a/bin/9l b/bin/9l
       t@@ -1,7 +1,7 @@
        #!/bin/sh
        
        extralibs=-lm
       -tag="`uname`-`uname -m`"
       +tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}"
        case "$tag" in
        *FreeBSD*)        ld=gcc ;;
        *BSD*)                ld=gcc ;;
   DIR diff --git a/src/Makefile b/src/Makefile
       t@@ -1,4 +1,6 @@
        ../bin/mk: mkmk.sh
       +        SYSNAME=`uname` export SYSNAME; \
       +        OBJTYPE=`uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'` export OBJTYPE; \
                PATH=`pwd`/../bin:$$PATH export PATH; \
                PLAN9=`pwd`/.. export PLAN9; \
                sh -x mkmk.sh
   DIR diff --git a/src/cmd/mk/main.c b/src/cmd/mk/main.c
       t@@ -226,6 +226,7 @@ main(int argc, char **argv)
                if(uflag)
                        prusage();
                exits(0);
       +        return 0;
        }
        
        void
   DIR diff --git a/src/cmd/mk/mk.h b/src/cmd/mk/mk.h
       t@@ -1,38 +1,4 @@
       -#include <utf.h>
       -#include <fmt.h>
       -#include <setjmp.h>
       -#include <string.h>
       -#include <stdlib.h>
       -#include <unistd.h>
       -#include        <bio.h>
       -#include        <regexp9.h>
       -#include <time.h>
       -
       -#define uchar _mkuchar
       -#define ushort _mkushort
       -#define uint _mkuint
       -#define ulong _mkulong
       -#define vlong _mkvlong
       -#define uvlong _mkuvlong
       -
       -#define nil ((void*)0)
       -
       -typedef unsigned char                uchar;
       -typedef unsigned short                ushort;
       -typedef unsigned int                uint;
       -typedef unsigned long                ulong;
       -
       -#define nelem(x) (sizeof(x)/sizeof((x)[0]))
       -
       -#define OREAD O_RDONLY
       -#define OWRITE O_WRONLY
       -#define ORDWR O_RDWR
       -#define USED(x) if(x);else
       -#define remove unlink
       -#define seek lseek
       -#define exits(s) exit((s) && ((char*)s)[0] ? 1 : 0)
       -#define create(name, mode, perm) creat(name, perm)
       -#define ERRMAX 256
       +#include "sys.h"
        
        #undef assert
        #define        assert        mkassert
   DIR diff --git a/src/cmd/mk/shprint.c b/src/cmd/mk/shprint.c
       t@@ -2,6 +2,8 @@
        
        static char *vexpand(char*, Envy*, Bufblock*);
        
       +#define getfields mkgetfields
       +
        static int
        getfields(char *str, char **args, int max, int mflag, char *set)
        {
   DIR diff --git a/src/cmd/mk/unix.c b/src/cmd/mk/unix.c
       t@@ -1,3 +1,4 @@
       +#define NOPLAN9DEFINES
        #include        "mk.h"
        #include        <sys/wait.h>
        #include        <signal.h>
   DIR diff --git a/src/lib9/sendfd.c b/src/lib9/sendfd.c
       t@@ -34,7 +34,7 @@ sendfd(int s, int fd)
                sfd.cmsg.cmsg_type = SCM_RIGHTS;
                sfd.fd = fd;
        
       -        msg.msg_control = &sfd;
       +        msg.msg_control = (caddr_t)&sfd;
                msg.msg_controllen = sizeof sfd;
        
                if((n=sendmsg(s, &msg, 0)) != iov.iov_len)
       t@@ -66,7 +66,7 @@ recvfd(int s)
                sfd.cmsg.cmsg_level = SOL_SOCKET;
                sfd.cmsg.cmsg_type = SCM_RIGHTS;
        
       -        msg.msg_control = &sfd;
       +        msg.msg_control = (caddr_t)&sfd;
                msg.msg_controllen = sizeof sfd;
        
                if((n=recvmsg(s, &msg, 0)) < 0)
   DIR diff --git a/src/mkfile b/src/mkfile
       t@@ -1,3 +1,5 @@
       +<mkhdr
       +
        DIRS=\
                lib9\
                libbin\
       t@@ -27,7 +29,7 @@ MKDIRS=\
        mkmk.sh:VD:
                (
                        echo cd lib9
       -                (cd lib9; mk -n -a 'LIB9OFILES=' install)
       +                (cd lib9; mk -n -a install)
                        echo cd ..
                        for i in libbio libregexp cmd/mk
                        do        
       t@@ -35,7 +37,7 @@ mkmk.sh:VD:
                                (cd $i; mk -n -a install)
                                echo cd ..
                        done
       -        ) >$target
       +        ) | sed 's/'$SYSNAME'/$SYSNAME/; s/'$OBJTYPE'/$OBJTYPE/' >$target
        
        testmkmk:V:
                mk mkmk.sh
   DIR diff --git a/src/mkmk.sh b/src/mkmk.sh
       t@@ -1,6 +1,81 @@
        cd lib9
       +9c  _exits.c
       +9c  _p9dialparse.c
       +9c  _p9dir.c
       +9c  _p9proc.c
       +9c  _p9translate.c
       +9c  access.c
       +9c  announce.c
       +9c  argv0.c
       +9c  atexit.c
       +9c  atnotify.c
       +9c  await.c
       +9c  cistrcmp.c
       +9c  cistrncmp.c
       +9c  cistrstr.c
       +9c  cleanname.c
       +9c  convD2M.c
       +9c  convM2D.c
       +9c  convM2S.c
       +9c  convS2M.c
       +9c  create.c
       +9c  ctime.c
       +9c  date.c
       +9c  dial.c
       +9c  dirfstat.c
       +9c  dirfwstat.c
       +9c  dirmodefmt.c
       +9c  dirread.c
       +9c  dirstat.c
       +9c  dirwstat.c
       +9c  dup.c
       +9c  encodefmt.c
       +9c  errstr.c
       +9c  exec.c
       +9c  fcallfmt.c
       +9c  ffork-$SYSNAME.c
       +9a  getcallerpc-$OBJTYPE.s
       +9c  getenv.c
       +9c  getfields.c
       +9c  getns.c
       +9c  getuser.c
       +9c  getwd.c
       +9c  jmp.c
       +9c  lock.c
       +9c  main.c
       +9c  malloc.c
       +9c  malloctag.c
       +9c  mallocz.c
       +9c  nan.c
       +9c  needsrcquote.c
       +9c  netmkaddr.c
       +9c  notify.c
       +9c  nrand.c
       +9c  nulldir.c
       +9c  open.c
       +9c  pipe.c
       +9c  post9p.c
       +9c  postnote.c
       +9c  qlock.c
       +9c  quote.c
       +9c  read9pmsg.c
       +9c  readn.c
       +9c  rendez-$SYSNAME.c
       +9c  rfork.c
       +9c  seek.c
       +9c  sendfd.c
       +9c  sleep.c
       +9c  strecpy.c
       +9c  sysfatal.c
       +9c  tas-$OBJTYPE.c
       +9c  time.c
       +9c  tokenize.c
       +9c  u16.c
       +9c  u32.c
       +9c  u64.c
       +9c  wait.c
       +9c  waitpid.c
        9c  -Ifmt fmt/dofmt.c
       -9c  -Ifmt fmt/errfmt.c
        9c  -Ifmt fmt/fltfmt.c
        9c  -Ifmt fmt/fmt.c
        9c  -Ifmt fmt/fmtfd.c
       t@@ -53,7 +128,7 @@ cd lib9
        9c  utf/utfrrune.c
        9c  utf/utfrune.c
        9c  utf/utfutf.c
       -9ar rvc ../../lib/lib9.a dofmt.o errfmt.o fltfmt.o fmt.o fmtfd.o fmtfdflush.o fmtlock.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
mx1.adamsgaard.dk:70 /src/plan9port/commit/8f314994dbcc11b2d8397535ce8b0cf9d84150d0.gph:288: line too long