--- Makefile.orig Fri Dec 30 13:26:31 1994 +++ Makefile Fri Dec 30 13:27:28 1994 @@ -1,5 +1,6 @@ CC=cc -COMFLAGS=-O +COMFLAGS=-O2 +LDFLAGS=-s BIN=/usr/bin MAN=/usr/man/man1 #define to "l" if manuals go on /usr/man/manl @@ -8,7 +9,7 @@ all : compress atob btoa compress : compress.c USERMEM - $(CC) $(COMFLAGS) -DUSERMEM=`cat USERMEM` -o compress compress.c + $(CC) $(LDFLAGS) $(COMFLAGS) -DUSERMEM=`cat USERMEM` -o compress compress.c # USERMEM may have to be set by hand. It should contain the amount of # available user memory in bytes. See the README file for more info. @@ -16,10 +17,10 @@ sh usermem > USERMEM atob: atob.c - $(CC) $(COMFLAGS) -o atob atob.c + $(CC) $(LDFLAGS) $(COMFLAGS) -o atob atob.c btoa: btoa.c - $(CC) $(COMFLAGS) -o btoa btoa.c + $(CC) $(LDFLAGS) $(COMFLAGS) -o btoa btoa.c install: compress atob btoa zmore zcmp zdiff compressdir uncompressdir btoa.1 compress.1 compressdir.1 zmore.1 zcmp.1 tarmail untarmail cp compress $(BIN) --- usermem.orig Tue Aug 20 19:01:57 1985 +++ usermem Mon Jan 25 21:30:01 1999 @@ -12,13 +12,16 @@ CLICKSIZE=512 eval $* -SIZE=0 -if test -r /usr/adm/messages # probably the most transportable -then - SIZE=`grep avail /usr/adm/messages | sed -n '$s/.*[ ]//p'` -fi +# Used below to eliminate excess whitespace: +crunch() { + while read line ; do + echo $line + done +} + +SIZE=`cat /proc/meminfo | head -2 | tail -1 | crunch | cut -f 2 -d ' '` -if test 0$SIZE -le 0 # no SIZE in /usr/adm/messages +if test $SIZE -le 0 # no SIZE in /usr/adm/messages then if test -r $KMEM # Readable KMEM then @@ -40,11 +43,11 @@ if test -n "$UNIX" then SIZE=`echo maxmem/D | adb $UNIX $KMEM | sed -n '$s/.*[ ]//p'` - if test 0$SIZE -le 0 + if test $SIZE -le 0 then SIZE=`echo physmem/D | adb $UNIX $KMEM | sed -n '$s/.*[ ]//p'` fi - SIZE=`expr 0$SIZE '*' $CLICKSIZE` + SIZE=`expr $SIZE '*' $CLICKSIZE` fi fi fi @@ -61,7 +64,7 @@ ;; esac -if test 0$SIZE -le 0 +if test $SIZE -le 0 then echo 0;exit 1 else