]> Pileus Git - aweather/blob - opt/rsl/rsl-automake.patch
Update RSL patches
[aweather] / opt / rsl / rsl-automake.patch
1 diff --git a/colors/Makefile.am b/colors/Makefile.am
2 index 709a367..b043f7f 100644
3 --- a/colors/Makefile.am
4 +++ b/colors/Makefile.am
5 @@ -1,6 +1,6 @@
6  AUTOMAKE_OPTIONS = foreign
7  
8 -colordir = $(prefix)/lib/colors
9 +colordir = $(datadir)/rsl/colors
10  color_DATA = *.???
11  
12  EXTRA_DIST = $(color_DATA)
13 diff --git a/Makefile.am b/Makefile.am
14 index 3c106a8..6aca2ec 100644
15 --- a/Makefile.am
16 +++ b/Makefile.am
17 @@ -1,73 +1,49 @@
18  ## Process w/ automake.  Or, autoreconf; make ##
19 +AM_CFLAGS = -DDATADIR="\"$(datadir)/rsl\""
20  AUTOMAKE_OPTIONS = foreign
21  SUBDIRS = . colors doc examples
22  INCLUDES = -I. -I$(srcdir) -I$(prefix)/include -I$(prefix)/toolkit/include
23  
24 -includedir = $(prefix)/include 
25 -colordir = $(libdir)/colors
26 -
27  lib_LTLIBRARIES = librsl.la
28  
29 -librsl_la_LDFLAGS = -version-info 1:41
30 -librsl_la_SOURCES = \
31 -$(rapic_c) $(radtec_c)\
32 -dorade.c dorade_print.c dorade_to_radar.c\
33 -lassen.c lassen_to_radar.c \
34 -edge_to_radar.c \
35 - radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
36 - range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
37 - carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
38 - ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
39 - mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
40 - gzip.c prune.c reverse.c fix_headers.c \
41 - nsig_to_radar.c nsig.c nsig2_to_radar.c \
42 - africa_to_radar.c africa.c \
43 - radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
44 - radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
45 -
46 -librsl_la_DEPENDENCIES = $(build_headers)
47 +wsr88ddir = $(datadir)/rsl/
48 +dist_wsr88d_DATA = wsr88d_locations.dat
49  
50 -build_headers = rsl.h wsr88d.h toolkit_1BC-51_appl.h
51 +include_HEADERS = rsl.h toolkit_1BC-51_appl.h
52  
53  headers = africa.h dorade.h lassen.h \
54            mcgill.h nsig.h radtec.h rainbow.h \
55            rapic_routines.h toga.h \
56 -                 $(build_headers)
57 +          wsr88d.h \
58 +         $(include_HEADERS)
59 +
60 +librsl_la_LDFLAGS = -version-info 1:41
61 +librsl_la_SOURCES = \
62 +    $(rapic_c) $(radtec_c) \
63 +    dorade.c dorade_print.c dorade_to_radar.c \
64 +    lassen.c lassen_to_radar.c \
65 +    edge_to_radar.c \
66 +    radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
67 +    range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
68 +    carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
69 +    ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
70 +    mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
71 +    gzip.c prune.c reverse.c fix_headers.c \
72 +    nsig_to_radar.c nsig.c nsig2_to_radar.c \
73 +    africa_to_radar.c africa.c \
74 +    radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
75 +    radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
76 +
77  
78  rapic_c =  rapic_to_radar.c rapic.y rapic-lex.l rapic_routines.c
79  radtec_c = radtec_to_radar.c radtec.c
80  
81  
82 -rsl.h: Makefile
83 -       @for h in $(build_headers); do \
84 -       echo -n "Checking substitutions in header file $$h ... "; \
85 -       cp $$h $$h.in; \
86 -       sed -e 's/RSL_VERSION_STR.*/RSL_VERSION_STR \"$(VERSION)\"/' \
87 -         -e 's|#define COLORDIR.*|#define COLORDIR \"$(colordir)\"|' \
88 -         -e 's|#define WSR88D_SITE_INFO_FILE.*|#define WSR88D_SITE_INFO_FILE \"$(libdir)/wsr88d_locations.dat\"|' \
89 -    < $$h.in > $$h.new; \
90 -       if cmp -s $$h $$h.new; then \
91 -       rm $$h.new; \
92 -       echo "$$h remains untouched."; \
93 -    else \
94 -       mv $$h.new $$h; \
95 -       echo "substitutions made in $$h."; \
96 -    fi; \
97 -       rm -f $$h.in; \
98 -    done
99 -
100  PREFIX = rapic
101  LFLAGS = -P$(PREFIX)
102  YFLAGS = -d -p $(PREFIX)
103  LEX_OUTPUT_ROOT = lex.$(PREFIX)
104  
105 -
106 -install-exec-hook:
107 -       $(INSTALL) -d  $(includedir)
108 -       $(INSTALL) -m 644 rsl.h $(includedir)
109 -       $(INSTALL) -m 644 toolkit_1BC-51_appl.h $(includedir)
110 -       $(INSTALL) -m 644 wsr88d_locations.dat $(libdir)
111 -
112  EXTRA_DIST = CHANGES Copyright GPL LGPL wsr88d_locations.dat rapic.h
113  
114  DISTCLEANFILES = rapic.c rapic-lex.c
115 diff --git a/radar.c b/radar.c
116 index 4078f17..7c07d01 100644
117 --- a/radar.c
118 +++ b/radar.c
119 @@ -60,7 +60,7 @@
120  
121  void RSL_print_version()
122  {
123 -  printf("RSL version %s.\n", RSL_VERSION_STR);
124 +  printf("RSL version %s.\n", VERSION);
125  }
126  
127  /* Debug printing global variable: radar_verbose_flag */
128 diff --git a/radar_to_uf.c b/radar_to_uf.c
129 index 0d3af56..53d2d8d 100644
130 --- a/radar_to_uf.c
131 +++ b/radar_to_uf.c
132 @@ -321,7 +321,7 @@ void RSL_radar_to_uf_fp(Radar *r, FILE *fp)
133          uf_ma[37] = tm->tm_year % 100; /* Same format as data year */
134          uf_ma[38] = tm->tm_mon+1;
135          uf_ma[39] = tm->tm_mday;
136 -        memcpy(&uf_ma[40], "RSL" RSL_VERSION_STR, 8);
137 +        memcpy(&uf_ma[40], "RSL" VERSION, 8);
138          if (little_endian()) swap2(&uf_ma[40], 8/2);
139          uf_ma[44] = (signed short)UF_NO_DATA;
140          len_ma = 45;
141 diff --git a/read_write.c b/read_write.c
142 index 644a7b2..1e5f319 100644
143 --- a/read_write.c
144 +++ b/read_write.c
145 @@ -314,7 +314,7 @@ int RSL_write_radar_fp(Radar *radar, FILE *fp)
146    if (radar == NULL) return 0;
147    
148    memset(title, 0, sizeof(title));
149 -  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", RSL_VERSION_STR, sizeof(Range));
150 +  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", VERSION, sizeof(Range));
151    n += fwrite(title, sizeof(char), sizeof(title), fp);
152    
153    memset(header_buf, 0, sizeof(header_buf));
154 diff --git a/rsl.h b/rsl.h
155 index a821765..597069c 100644
156 --- a/rsl.h
157 +++ b/rsl.h
158 @@ -27,8 +27,6 @@
159  #include "config.h"
160  #endif
161  
162 -#define RSL_VERSION_STR "v1.41"
163 -
164  /**********************************************************************/
165  /* Configure: Define USE_TWO_BYTE_PRECISION to have RSL store internal*/
166  /*            values with two bytes.  Otherwise, use one byte.        */
167 @@ -46,7 +44,7 @@
168  /*            so you shouldn't have to modify anything here.          */
169  /**********************************************************************/
170  #ifndef COLORDIR
171 -#define COLORDIR "/usr/local/trmm/GVBOX/lib/colors"
172 +#define COLORDIR DATADIR "/colors"
173  #endif
174  
175  /* These are the color table indexes. See RSL_set/get_color_table. */
176 @@ -57,18 +55,18 @@
177  /* The default color tables for reflectivity, velocity, spectral width,
178   * height, rainfall, and zdr.
179   */
180 -#define REFL_RED_FILE   COLORDIR "/red_reflectivity.clr"
181 -#define REFL_GREEN_FILE COLORDIR "/grn_reflectivity.clr"
182 -#define REFL_BLUE_FILE  COLORDIR "/blu_reflectivity.clr"
183 -#define VEL_RED_FILE    COLORDIR "/red_velocity.clr"
184 -#define VEL_GREEN_FILE  COLORDIR "/grn_velocity.clr"
185 -#define VEL_BLUE_FILE   COLORDIR "/blu_velocity.clr"
186 -#define SW_RED_FILE     COLORDIR "/red_spectral_width.clr"
187 -#define SW_GREEN_FILE   COLORDIR "/grn_spectral_width.clr"
188 -#define SW_BLUE_FILE    COLORDIR "/blu_spectral_width.clr"
189 -#define HEIGHT_RED_FILE   COLORDIR "/red_height.clr"
190 -#define HEIGHT_GREEN_FILE COLORDIR "/grn_height.clr"
191 -#define HEIGHT_BLUE_FILE  COLORDIR "/blu_height.clr"
192 +#define REFL_RED_FILE       COLORDIR "/red_reflectivity.clr"
193 +#define REFL_GREEN_FILE     COLORDIR "/grn_reflectivity.clr"
194 +#define REFL_BLUE_FILE      COLORDIR "/blu_reflectivity.clr"
195 +#define VEL_RED_FILE        COLORDIR "/red_velocity.clr"
196 +#define VEL_GREEN_FILE      COLORDIR "/grn_velocity.clr"
197 +#define VEL_BLUE_FILE       COLORDIR "/blu_velocity.clr"
198 +#define SW_RED_FILE         COLORDIR "/red_spectral_width.clr"
199 +#define SW_GREEN_FILE       COLORDIR "/grn_spectral_width.clr"
200 +#define SW_BLUE_FILE        COLORDIR "/blu_spectral_width.clr"
201 +#define HEIGHT_RED_FILE     COLORDIR "/red_height.clr"
202 +#define HEIGHT_GREEN_FILE   COLORDIR "/grn_height.clr"
203 +#define HEIGHT_BLUE_FILE    COLORDIR "/blu_height.clr"
204  #define RAINFALL_RED_FILE   COLORDIR "/red_rainfall.clr"
205  #define RAINFALL_GREEN_FILE COLORDIR "/grn_rainfall.clr"
206  #define RAINFALL_BLUE_FILE  COLORDIR "/blu_rainfall.clr"
207 diff --git a/wsr88d.h b/wsr88d.h
208 index ecad620..7d22427 100644
209 --- a/wsr88d.h
210 +++ b/wsr88d.h
211 @@ -7,7 +7,7 @@
212   * The directory should be the same as the LIBDIR in the makefile.
213   */
214  #ifndef WSR88D_SITE_INFO_FILE
215 -#define WSR88D_SITE_INFO_FILE "/usr/local/trmm/GVBOX/lib/wsr88d_locations.dat"
216 +#define WSR88D_SITE_INFO_FILE DATADIR "/wsr88d_locations.dat"
217  #endif
218  /*===============================================================*/
219  typedef struct {
220 diff --git a/doc/Makefile.am b/doc/Makefile.am
221 index 6acc059..d4fc3fd 100644
222 --- a/doc/Makefile.am
223 +++ b/doc/Makefile.am
224 @@ -1,12 +1,3 @@
225  AUTOMAKE_OPTIONS = foreign
226  
227 -docdir = $(prefix)/doc/$(PACKAGE)
228 -doc_DATA = *.html *.gif *.jpg
229 -
230 -EXTRA_DIST = $(doc_DATA) *.fig 
231 -
232 -install-exec-hook:
233 -       -mkdir $(prefix)/doc
234 -       -mkdir $(docdir)
235 -       $(INSTALL) -m 444 ../README $(docdir)
236 -       $(INSTALL) -m 444 ../CHANGES $(docdir)
237 +dist_doc_DATA = *.html *.gif *.jpg *.fig ../README ../CHANGES
238 -- 
239 1.7.3.4
240