diff -rc src/Makefile src_new/Makefile
*** src/Makefile	2003-04-07 06:03:22.000000000 -0700
--- src_new/Makefile	2011-10-19 11:58:13.993411828 -0700
***************
*** 1,20 ****
  
  #LINKOPT	=	/usr/local/lib/libdbmalloc.a
! CFLAGS	=	-g
  
  default:	all
  
! all:	shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shptest
  
  shpopen.o:	shpopen.c shapefil.h
  	$(CC) $(CFLAGS) -c shpopen.c
  
- shptree.o:	shptree.c shapefil.h
- 	$(CC) $(CFLAGS) -c shptree.c
- 
  dbfopen.o:	dbfopen.c shapefil.h
  	$(CC) $(CFLAGS) -c dbfopen.c
  
  shpcreate:	shpcreate.c shpopen.o
  	$(CC) $(CFLAGS) shpcreate.c shpopen.o $(LINKOPT) -o shpcreate
  
--- 1,24 ----
  
  #LINKOPT	=	/usr/local/lib/libdbmalloc.a
! CC =		gcc
! #CFLAGS	=	-g
! CFLAGS	=	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
! AR =		/usr/bin/ar rcv
! RANLIB =	/usr/bin/ranlib
  
  default:	all
  
! all:	libshape.a shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shputils shptest
  
  shpopen.o:	shpopen.c shapefil.h
  	$(CC) $(CFLAGS) -c shpopen.c
  
  dbfopen.o:	dbfopen.c shapefil.h
  	$(CC) $(CFLAGS) -c dbfopen.c
  
+ libshape.a:    shpopen.o dbfopen.o
+ 	${AR} libshape.a shpopen.o dbfopen.o ; ${RANLIB} libshape.a
+ 
  shpcreate:	shpcreate.c shpopen.o
  	$(CC) $(CFLAGS) shpcreate.c shpopen.o $(LINKOPT) -o shpcreate
  
***************
*** 36,58 ****
  dbfdump:	dbfdump.c dbfopen.o
  	$(CC) $(CFLAGS) dbfdump.c dbfopen.o $(LINKOPT) -o dbfdump
  
  shptest:	shptest.c shpopen.o
  	$(CC) $(CFLAGS) shptest.c shpopen.o $(LINKOPT) -o shptest
  
! shputils:	shputils.c shpopen.o dbfopen.o
! 	$(CC) $(CFLAGS) shputils.c shpopen.o dbfopen.o $(LINKOPT) -o shputils
  
  shptreedump:	shptreedump.c shptree.o shpopen.o
  	$(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o $(LINKOPT) \
  		-o shptreedump
  
  clean:
! 	rm -f *.o dbfdump dbfcreate dbfadd shpdump shpcreate shpadd shputils
  	rm -f shptreedump
  	rm -rf *.lo *.la .libs
- 	rm -f shptest
  
! test:	test2 test3
  
  #
  #	Note this stream only works if example data is accessable.
--- 40,64 ----
  dbfdump:	dbfdump.c dbfopen.o
  	$(CC) $(CFLAGS) dbfdump.c dbfopen.o $(LINKOPT) -o dbfdump
  
+ shputils:	shputils.c shpopen.o dbfopen.o
+ 	$(CC) $(CFLAGS) shputils.c shpopen.o dbfopen.o $(LINKOPT) -o shputils
+ 
  shptest:	shptest.c shpopen.o
  	$(CC) $(CFLAGS) shptest.c shpopen.o $(LINKOPT) -o shptest
  
! shptree.o:	shptree.c shapefil.h
! 	$(CC) $(CFLAGS) -c shptree.c
  
  shptreedump:	shptreedump.c shptree.o shpopen.o
  	$(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o $(LINKOPT) \
  		-o shptreedump
  
  clean:
! 	rm -f *.o *.a shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shputils shptest
  	rm -f shptreedump
  	rm -rf *.lo *.la .libs
  
! test:	test1 test2 test3
  
  #
  #	Note this stream only works if example data is accessable.
diff -rc src/shputils.c src_new/shputils.c
*** src/shputils.c	2003-04-07 06:03:22.000000000 -0700
--- src_new/shputils.c	2011-10-14 14:52:32.179022813 -0700
***************
*** 274,280 ****
                  if (factor == 0)
                  {
                    if (infactor ==0)
!                   { puts("ERROR: Input unit must be defined before output unit"); exit(); }
                    factor=infactor/outfactor;
                  }
                  printf("Output file coordinate values will be factored by %lg\n",factor);
--- 274,280 ----
                  if (factor == 0)
                  {
                    if (infactor ==0)
!                   { puts("ERROR: Input unit must be defined before output unit"); exit( 1 ); }
                    factor=infactor/outfactor;
                  }
                  printf("Output file coordinate values will be factored by %lg\n",factor);
diff -rc src/stream1.sh src_new/stream1.sh
*** src/stream1.sh	2003-04-07 06:03:22.000000000 -0700
--- src_new/stream1.sh	2011-10-19 11:45:08.192964291 -0700
***************
*** 1,6 ****
  #!/bin/sh
  	
! EG_DATA=/u/www/projects/shapelib/eg_data
  
  echo -------------------------------------------------------------------------
  echo Test 1: dump anno.shp
--- 1,6 ----
  #!/bin/sh
  	
! EG_DATA=./eg_data
  
  echo -------------------------------------------------------------------------
  echo Test 1: dump anno.shp
