source: issm/trunk/externalpackages/shapelib/shapelib.patch

Last change on this file was 10238, checked in by jschierm, 13 years ago

shapelib: Adding extraction of sample files so that first test could be run.

File size: 4.1 KB
Line 
1diff -rc src/Makefile src_new/Makefile
2*** src/Makefile 2003-04-07 06:03:22.000000000 -0700
3--- src_new/Makefile 2011-10-19 11:58:13.993411828 -0700
4***************
5*** 1,20 ****
6
7 #LINKOPT = /usr/local/lib/libdbmalloc.a
8! CFLAGS = -g
9
10 default: all
11
12! all: shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shptest
13
14 shpopen.o: shpopen.c shapefil.h
15 $(CC) $(CFLAGS) -c shpopen.c
16
17- shptree.o: shptree.c shapefil.h
18- $(CC) $(CFLAGS) -c shptree.c
19-
20 dbfopen.o: dbfopen.c shapefil.h
21 $(CC) $(CFLAGS) -c dbfopen.c
22
23 shpcreate: shpcreate.c shpopen.o
24 $(CC) $(CFLAGS) shpcreate.c shpopen.o $(LINKOPT) -o shpcreate
25
26--- 1,24 ----
27
28 #LINKOPT = /usr/local/lib/libdbmalloc.a
29! CC = gcc
30! #CFLAGS = -g
31! CFLAGS = -fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
32! AR = /usr/bin/ar rcv
33! RANLIB = /usr/bin/ranlib
34
35 default: all
36
37! all: libshape.a shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shputils shptest
38
39 shpopen.o: shpopen.c shapefil.h
40 $(CC) $(CFLAGS) -c shpopen.c
41
42 dbfopen.o: dbfopen.c shapefil.h
43 $(CC) $(CFLAGS) -c dbfopen.c
44
45+ libshape.a: shpopen.o dbfopen.o
46+ ${AR} libshape.a shpopen.o dbfopen.o ; ${RANLIB} libshape.a
47+
48 shpcreate: shpcreate.c shpopen.o
49 $(CC) $(CFLAGS) shpcreate.c shpopen.o $(LINKOPT) -o shpcreate
50
51***************
52*** 36,58 ****
53 dbfdump: dbfdump.c dbfopen.o
54 $(CC) $(CFLAGS) dbfdump.c dbfopen.o $(LINKOPT) -o dbfdump
55
56 shptest: shptest.c shpopen.o
57 $(CC) $(CFLAGS) shptest.c shpopen.o $(LINKOPT) -o shptest
58
59! shputils: shputils.c shpopen.o dbfopen.o
60! $(CC) $(CFLAGS) shputils.c shpopen.o dbfopen.o $(LINKOPT) -o shputils
61
62 shptreedump: shptreedump.c shptree.o shpopen.o
63 $(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o $(LINKOPT) \
64 -o shptreedump
65
66 clean:
67! rm -f *.o dbfdump dbfcreate dbfadd shpdump shpcreate shpadd shputils
68 rm -f shptreedump
69 rm -rf *.lo *.la .libs
70- rm -f shptest
71
72! test: test2 test3
73
74 #
75 # Note this stream only works if example data is accessable.
76--- 40,64 ----
77 dbfdump: dbfdump.c dbfopen.o
78 $(CC) $(CFLAGS) dbfdump.c dbfopen.o $(LINKOPT) -o dbfdump
79
80+ shputils: shputils.c shpopen.o dbfopen.o
81+ $(CC) $(CFLAGS) shputils.c shpopen.o dbfopen.o $(LINKOPT) -o shputils
82+
83 shptest: shptest.c shpopen.o
84 $(CC) $(CFLAGS) shptest.c shpopen.o $(LINKOPT) -o shptest
85
86! shptree.o: shptree.c shapefil.h
87! $(CC) $(CFLAGS) -c shptree.c
88
89 shptreedump: shptreedump.c shptree.o shpopen.o
90 $(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o $(LINKOPT) \
91 -o shptreedump
92
93 clean:
94! rm -f *.o *.a shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump shputils shptest
95 rm -f shptreedump
96 rm -rf *.lo *.la .libs
97
98! test: test1 test2 test3
99
100 #
101 # Note this stream only works if example data is accessable.
102diff -rc src/shputils.c src_new/shputils.c
103*** src/shputils.c 2003-04-07 06:03:22.000000000 -0700
104--- src_new/shputils.c 2011-10-14 14:52:32.179022813 -0700
105***************
106*** 274,280 ****
107 if (factor == 0)
108 {
109 if (infactor ==0)
110! { puts("ERROR: Input unit must be defined before output unit"); exit(); }
111 factor=infactor/outfactor;
112 }
113 printf("Output file coordinate values will be factored by %lg\n",factor);
114--- 274,280 ----
115 if (factor == 0)
116 {
117 if (infactor ==0)
118! { puts("ERROR: Input unit must be defined before output unit"); exit( 1 ); }
119 factor=infactor/outfactor;
120 }
121 printf("Output file coordinate values will be factored by %lg\n",factor);
122diff -rc src/stream1.sh src_new/stream1.sh
123*** src/stream1.sh 2003-04-07 06:03:22.000000000 -0700
124--- src_new/stream1.sh 2011-10-19 11:45:08.192964291 -0700
125***************
126*** 1,6 ****
127 #!/bin/sh
128
129! EG_DATA=/u/www/projects/shapelib/eg_data
130
131 echo -------------------------------------------------------------------------
132 echo Test 1: dump anno.shp
133--- 1,6 ----
134 #!/bin/sh
135
136! EG_DATA=./eg_data
137
138 echo -------------------------------------------------------------------------
139 echo Test 1: dump anno.shp
Note: See TracBrowser for help on using the repository browser.