Package: doris / 4.06~beta2+dfsg-3

0003-tools-build.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
From: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
Date: Tue, 26 Nov 2013 09:08:12 +0000
Subject: tools-build

Fix tools buiding and use system epr-api
---
 ENVISAT_TOOLS/Makefile              | 45 ++++++++++++++++++-------------------
 ENVISAT_TOOLS/envisat_dump_HH.c     | 14 ++++++------
 ENVISAT_TOOLS/envisat_dump_VV.c     | 14 ++++++------
 ENVISAT_TOOLS/envisat_dump_data.c   | 14 ++++++------
 ENVISAT_TOOLS/envisat_dump_header.c | 12 +++++-----
 SARtools/Makefile                   | 40 +++++++++++++++------------------
 6 files changed, 67 insertions(+), 72 deletions(-)

diff --git a/ENVISAT_TOOLS/Makefile b/ENVISAT_TOOLS/Makefile
index b5a1760..6de1cff 100755
--- a/ENVISAT_TOOLS/Makefile
+++ b/ENVISAT_TOOLS/Makefile
@@ -17,10 +17,10 @@
 ### Check if you agree with the options below (install_dir OK?)
 ### then simply type: "make install"
 SHELL = 	/bin/sh
-CC = 		gcc
+#CC = 		gcc
 #CFLAGS =	-O3
 #CFLAGS =        -m32         # for 64-bit systems, it requires compatibility lib32, no need for epr_api v2.2
-LFLAGS =	-lm
+LFLAGS =	-lm $(LDFLAGS)
 INSTALL_DIR =	/usr/local/bin
 
 
@@ -47,35 +47,34 @@ LIB_SRC = 	epr_api-2.2/src/epr_api.c \
 		epr_api-2.2/src/epr_typconv.c
 
 ### targets ###
-default: 	envisat_dump_header envisat_dump_data envisat_dump_HH envisat_dump_VV  
+default: 	envisat_dump_header envisat_dump_data envisat_dump_HH envisat_dump_VV
 ### compile envisat_dump_header program (dumps envisat header info to stdout) ###
-envisat_dump_header:	BEST
-		$(CC) $(CFLAGS) $(LFLAGS) \
+envisat_dump_header:
+		$(CC) $(CPPFLAGS) $(CFLAGS) $(LFLAGS) \
 		-o envisat_dump_header \
-		epr_api-2.2/src/*.o \
-		envisat_dump_header.c
+		envisat_dump_header.c \
+		-lepr_api
 
 ### compile envisat_dump_data program (dumps envisat slc short int data to file) ###
-envisat_dump_data:	BEST
-		$(CC) $(CFLAGS) $(LFLAGS) \
+envisat_dump_data:
+		$(CC) $(CPPFLAGS) $(CFLAGS) $(LFLAGS) \
 		-o envisat_dump_data \
-		epr_api-2.2/src/*.o \
-		envisat_dump_data.c
+		envisat_dump_data.c \
+		-lepr_api
 
 ### compile envisat_dump_data program (dumps envisat slc short int data to file) ###
-envisat_dump_HH:  BEST
-		$(CC) $(CFLAGS) $(LFLAGS) \
+envisat_dump_HH:
+		$(CC) $(CPPFLAGS) $(CFLAGS) $(LFLAGS) \
     -o envisat_dump_HH \
-    epr_api-2.2/src/*.o \
-    envisat_dump_HH.c
+    envisat_dump_HH.c \
+    -lepr_api
 
 ### compile envisat_dump_data program (dumps envisat slc short int data to file) ###
-envisat_dump_VV:  BEST
-		$(CC) $(CFLAGS) $(LFLAGS) \
+envisat_dump_VV:
+		$(CC) $(CPPFLAGS) $(CFLAGS) $(LFLAGS) \
     -o envisat_dump_VV \
-    epr_api-2.2/src/*.o \
-    envisat_dump_VV.c
-
+    envisat_dump_VV.c \
+    -lepr_api
 
 
 ### create object code BEST library functions ###
@@ -88,6 +87,7 @@ PROGS =		envisat_dump_header envisat_dump_data envisat_dump_HH envisat_dump_VV
 SCRIPTS =	envisat_dump_header2doris.csh
 install:	$(PROGS) $(SCRIPTS)
 		@echo "installing envisat tools..."
+		mkdir -p $(INSTALL_DIR)
 		cp -f $(PROGS) $(SCRIPTS) $(INSTALL_DIR)/.
 		#if test -d /cygdrive/c/cygwin; then \
                 #  echo "* cygwin detected"; \
@@ -96,7 +96,6 @@ install:	$(PROGS) $(SCRIPTS)
 		#  cp -f envisat_dump_header.exe $(INSTALL_DIR)/.; \
 		#  cp -f envisat_dump_data.exe $(INSTALL_DIR)/.; \
 		#fi;
-		make cleaner;
 		@echo " "
 		@echo "------------------------------------"
 		@echo "FINISHED INSTALLING ENVISAT TOOLS..."
@@ -109,9 +108,9 @@ uninstall:	cleaner
 		@echo "now you can rm this directory yourself"
 		@echo "for a full uninstall"
 		@echo " "
-clean:		
+clean:
 		@echo "cleaning envisat tools..."
-		(cd epr_api-2.2/src/; make clean)
+		#(cd epr_api-2.2/src/; make clean)
 		rm -f *.o
 cleaner:	clean
 		rm -f $(PROGS)
diff --git a/ENVISAT_TOOLS/envisat_dump_HH.c b/ENVISAT_TOOLS/envisat_dump_HH.c
index b496abe..cef5caa 100755
--- a/ENVISAT_TOOLS/envisat_dump_HH.c
+++ b/ENVISAT_TOOLS/envisat_dump_HH.c
@@ -1,4 +1,4 @@
-/* BK: simple program to dump binary data for ENVISAT 
+/* BK: simple program to dump binary data for ENVISAT
    for alternating pol, HH channel.
    #%// BK 24-Nov-2003
    $Id: envisat_dump_HH.c,v 1.2 2004/05/13 18:13:39 kampes Exp $
@@ -12,13 +12,13 @@ THIS program is not really good, but a fast hack for Z.Perksi..
 #include <string.h>
 #include <math.h>
 #include <time.h>
-#include "epr_api-2.2/src/epr_api.h"
+#include <epr_api.h>
 #if defined(WIN32) && defined(_DEBUG)
 #include <crtdbg.h>
 #endif /* if defined(WIN32) && defined(_DEBUG) */
 
 
-int main(int argc, char** argv) 
+int main(int argc, char** argv)
   {
   const char*     product_file_path;
   const char*     outfile;
@@ -145,22 +145,22 @@ int main(int argc, char** argv)
 
 
   /* --- Check if input as acceptable ---------------------------- */
-  if (l0 < 1)  
+  if (l0 < 1)
     {
     printf("l0<1 not allowed.  first line is 1 not 0.\n");
     exit(1);
     }
-  if (p0 < 1)  
+  if (p0 < 1)
     {
     printf("p0<1 not allowed.  first line is 1 not 0.\n");
     exit(1);
     }
-  if (lN > numlines)  
+  if (lN > numlines)
     {
     printf("lN>numlines not allowed.\n");
     exit(1);
     }
-  if (pN > numpixels)  
+  if (pN > numpixels)
     {
     printf("pN>numpixels not allowed.\n");
     exit(1);
diff --git a/ENVISAT_TOOLS/envisat_dump_VV.c b/ENVISAT_TOOLS/envisat_dump_VV.c
index eb5cca5..8b0f66a 100755
--- a/ENVISAT_TOOLS/envisat_dump_VV.c
+++ b/ENVISAT_TOOLS/envisat_dump_VV.c
@@ -1,4 +1,4 @@
-/* BK: simple program to dump binary data for ENVISAT 
+/* BK: simple program to dump binary data for ENVISAT
    for alternating pol, VV channel.
    #%// BK 24-Nov-2003
    $Id: envisat_dump_VV.c,v 1.2 2004/05/13 18:13:39 kampes Exp $
@@ -12,13 +12,13 @@ THIS program is not really good, but a fast hack for Z.Perksi..
 #include <string.h>
 #include <math.h>
 #include <time.h>
-#include "epr_api-2.2/src/epr_api.h"
+#include <epr_api.h>
 #if defined(WIN32) && defined(_DEBUG)
 #include <crtdbg.h>
 #endif /* if defined(WIN32) && defined(_DEBUG) */
 
 
-int main(int argc, char** argv) 
+int main(int argc, char** argv)
   {
   const char*     product_file_path;
   const char*     outfile;
@@ -139,22 +139,22 @@ int main(int argc, char** argv)
 
 
   /* --- Check if input as acceptable ---------------------------- */
-  if (l0 < 1)  
+  if (l0 < 1)
     {
     printf("l0<1 not allowed.  first line is 1 not 0.\n");
     exit(1);
     }
-  if (p0 < 1)  
+  if (p0 < 1)
     {
     printf("p0<1 not allowed.  first line is 1 not 0.\n");
     exit(1);
     }
-  if (lN > numlines)  
+  if (lN > numlines)
     {
     printf("lN>numlines not allowed.\n");
     exit(1);
     }
-  if (pN > numpixels)  
+  if (pN > numpixels)
     {
     printf("pN>numpixels not allowed.\n");
     exit(1);
diff --git a/ENVISAT_TOOLS/envisat_dump_data.c b/ENVISAT_TOOLS/envisat_dump_data.c
index 8535e77..385323f 100755
--- a/ENVISAT_TOOLS/envisat_dump_data.c
+++ b/ENVISAT_TOOLS/envisat_dump_data.c
@@ -1,4 +1,4 @@
-/* BK: simple program to dump binary data for ENVISAT 
+/* BK: simple program to dump binary data for ENVISAT
    08-July-2004
    $Id: envisat_dump_data.c,v 1.5 2004/08/09 09:43:28 kampes Exp $
 */
@@ -9,13 +9,13 @@
 #include <string.h>
 #include <math.h>
 #include <time.h>
-#include "epr_api-2.2/src/epr_api.h"
+#include <epr_api.h>
 #if defined(WIN32) && defined(_DEBUG)
 #include <crtdbg.h>
 #endif /* if defined(WIN32) && defined(_DEBUG) */
 //#include <typeinfo>
 
-int main(int argc, char** argv) 
+int main(int argc, char** argv)
   {
   const char*     product_file_path;
   const char*     outfile;
@@ -126,22 +126,22 @@ int main(int argc, char** argv)
 
 
   /* --- Check if input as acceptable ---------------------------- */
-  if (l0 < 1)  
+  if (l0 < 1)
     {
     printf("l0<1 not allowed.  first line is 1 not 0.\n");
     exit(1);
     }
-  if (p0 < 1)  
+  if (p0 < 1)
     {
     printf("p0<1 not allowed.  first line is 1 not 0.\n");
     exit(1);
     }
-  if (lN > numlines)  
+  if (lN > numlines)
     {
     printf("lN>numlines not allowed.\n");
     exit(1);
     }
-  if (pN > numpixels)  
+  if (pN > numpixels)
     {
     printf("pN>numpixels not allowed.\n");
     exit(1);
diff --git a/ENVISAT_TOOLS/envisat_dump_header.c b/ENVISAT_TOOLS/envisat_dump_header.c
index 7e9bce5..ea7b7b3 100755
--- a/ENVISAT_TOOLS/envisat_dump_header.c
+++ b/ENVISAT_TOOLS/envisat_dump_header.c
@@ -1,6 +1,6 @@
 /* BK: simple program to get header info for ENVISAT
 *   13-Jun-2003
-*   simply dumps all header info.  a unix script will be used to 
+*   simply dumps all header info.  a unix script will be used to
 *   convert this to doris input
     $Id: envisat_dump_header.c,v 1.4 2004/05/13 18:13:39 kampes Exp $
 */
@@ -11,13 +11,13 @@
 #include <string.h>
 #include <math.h>
 #include <time.h>
-#include "epr_api-2.2/src/epr_api.h"
+#include <epr_api.h>
 #if defined(WIN32) && defined(_DEBUG)
 #include <crtdbg.h>
 #endif /* if defined(WIN32) && defined(_DEBUG) */
 
 
-int main(int argc, char** argv) 
+int main(int argc, char** argv)
   {
   EPR_SProductId* product_id;
   EPR_SDatasetId* MDS1_SQ_ADS;
@@ -73,7 +73,7 @@ int main(int argc, char** argv)
   printf("-------------------------------------------------\n");
   product_id = epr_open_product(product_file_path);
   err_code   = epr_get_last_err_code();
-  if (err_code != e_err_none) 
+  if (err_code != e_err_none)
     {
     printf("envisat_dump_header: fatal error in epr_open_product\n");
     printf("exiting.\n");
@@ -89,7 +89,7 @@ int main(int argc, char** argv)
   printf("-------------------------------------------------\n");
   mph      = epr_get_mph(product_id);
   err_code = epr_get_last_err_code();
-  if (err_code == e_err_none) 
+  if (err_code == e_err_none)
     {
     epr_print_record(mph,  stdout);
     }
@@ -107,7 +107,7 @@ int main(int argc, char** argv)
   printf("-------------------------------------------------\n");
   sph      = epr_get_sph(product_id);
   err_code = epr_get_last_err_code();
-  if (err_code == e_err_none) 
+  if (err_code == e_err_none)
     {
     epr_print_record(sph,  stdout);
     }
diff --git a/SARtools/Makefile b/SARtools/Makefile
index d4be559..6694c4c 100644
--- a/SARtools/Makefile
+++ b/SARtools/Makefile
@@ -26,7 +26,7 @@ INSTALL_DIR =	/usr/local/bin
 
 ### GCC compiler
 CC 	=	g++
-CFLAGS  =       -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -D_LARGEFILE64_SOURCE #-m32 to force 32bit on 64bit platform
+CFLAGS  +=       -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -D_LARGEFILE64_SOURCE #-m32 to force 32bit on 64bit platform
 
 ### Intel compiler
 #CC	=	icpc
@@ -52,7 +52,7 @@ PROGS	=	wrap \
 		dateconv
 
 # usedin install:
-SCRIPTS =	
+SCRIPTS =
 #SCRIPTS =	cpx2ps \
 #		philamh2ps
 
@@ -65,27 +65,27 @@ dummy:
 
 # the utilities.
 bkconvert:	bkconvert.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 wrap:		wrap.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 cpxmult:	cpxmult.o
-		$(CC) $(CFLAGS) $@.o -o $@
-cpxdiv: 	cpxdiv.o 
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
+cpxdiv: 	cpxdiv.o
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 cpxconj:	cpxconj.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 cpxfiddle:	cpxfiddle.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 flapjack:	flapjack.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 floatmult:	floatmult.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 readrasterheader:	readrasterheader.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 rasterheader:	rasterheader.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 dateconv:	dateconv.o
-		$(CC) $(CFLAGS) $@.o -o $@
+		$(CC) $(CFLAGS) $(LDFLAGS) $@.o -o $@
 
 
 ### Install in CB_INSTALL by linking/copying executables ###
@@ -99,15 +99,11 @@ install:	$(PROGS)
 
 ### Use symbolic links at our system, copy to /usr/local/bin on other.
 definstall:	$(PROGS)
-		dir=$(INSTALL_DIR); \
-        	if test ! -d $$dir; then \
-		  echo "Sorry, dir $(INSTALL_DIR) does not exist, exiting..."; exit; fi; \
-		echo Installing in directory: $$dir; \
+		mkdir -p $(INSTALL_DIR)
 		list='$(PROGS) $(SCRIPTS)'; for p in $$list; do \
 		  echo "Installing (copy): $$p"; \
 		  cp -f $$p $(INSTALL_DIR)/$$p; \
 		done
-		$(MAKE) cleaner
 
 ### Use symbolic links at our system, copy to /usr/local/bin on other.
 cbinstall:
@@ -134,7 +130,7 @@ lninstall:
 		$(MAKE) cleaner
 
 ### Helpers ###
-clean:	
+clean:
 		@rm -f *.o *dummy* *.bak
 		@echo "* Removed junk."
 ### some reason under cygwin progs are not removed without ".exe"???
@@ -153,8 +149,8 @@ uninstall:	cleaner
 		  echo "* Removed executables in install dir: $(INSTALL_DIR)."; fi;
 
 ### How to make object files ###
-.cc.o:		
-	$(CC) $(CFLAGS) -c -o $(@) $<
+.cc.o:
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $(@) $<
 
 ### EOF.