Index: /issm/trunk/externalpackages/shapelib/shapelib.patch
===================================================================
--- /issm/trunk/externalpackages/shapelib/shapelib.patch	(revision 10211)
+++ /issm/trunk/externalpackages/shapelib/shapelib.patch	(revision 10211)
@@ -0,0 +1,119 @@
+Only in src: .cvsignore
+diff -rc src/Makefile src_new/Makefile
+*** src/Makefile	2003-04-07 06:03:22.000000000 -0700
+--- src_new/Makefile	2011-10-14 15:16:16.185467035 -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,56 ****
+  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
+  
+--- 40,62 ----
+  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:	test2 test3
+  
+Only in src: shprewind
+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);
