3 * Avoid modifying source code at compile time
4 * Avoid install-exec-hook
5 --- a/colors/Makefile.am
6 +++ b/colors/Makefile.am
8 AUTOMAKE_OPTIONS = foreign
10 -colordir = $(prefix)/lib/colors
11 +colordir = $(datadir)/rsl1/colors
14 EXTRA_DIST = $(color_DATA)
18 ## Process w/ automake. Or, autoreconf; make ##
19 +AM_CFLAGS = -DDATADIR="\"$(datadir)/rsl1\""
20 AUTOMAKE_OPTIONS = foreign
21 SUBDIRS = . colors doc examples
22 INCLUDES = -I. -I$(srcdir) -I$(prefix)/include -I$(prefix)/toolkit/include
24 -includedir = $(prefix)/include
25 -colordir = $(libdir)/colors
27 lib_LTLIBRARIES = librsl.la
29 -librsl_la_LDFLAGS = -version-info 1:43
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 - radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
35 - range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
36 - carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
37 - ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
38 - mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
39 - gzip.c prune.c reverse.c fix_headers.c \
40 - nsig_to_radar.c nsig.c nsig2_to_radar.c \
41 - africa_to_radar.c africa.c \
42 - radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
43 - radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
45 -librsl_la_DEPENDENCIES = $(build_headers)
46 +wsr88ddir = $(datadir)/rsl1/
47 +dist_wsr88d_DATA = wsr88d_locations.dat
49 -build_headers = rsl.h wsr88d.h toolkit_1BC-51_appl.h
50 +include_HEADERS = rsl.h toolkit_1BC-51_appl.h
52 headers = africa.h dorade.h lassen.h \
53 mcgill.h nsig.h radtec.h rainbow.h \
54 rapic_routines.h toga.h \
59 +librsl_la_LDFLAGS = -version-info 1:43
60 +librsl_la_SOURCES = \
61 + $(rapic_c) $(radtec_c) \
62 + dorade.c dorade_print.c dorade_to_radar.c \
63 + lassen.c lassen_to_radar.c \
64 + radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
65 + range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
66 + carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
67 + ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
68 + mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
69 + gzip.c prune.c reverse.c fix_headers.c \
70 + nsig_to_radar.c nsig.c nsig2_to_radar.c \
71 + africa_to_radar.c africa.c \
72 + radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
73 + radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
76 rapic_c = rapic_to_radar.c rapic.y rapic-lex.l rapic_routines.c
77 radtec_c = radtec_to_radar.c radtec.c
81 - @for h in $(build_headers); do \
82 - echo -n "Checking substitutions in header file $$h ... "; \
84 - sed -e 's/RSL_VERSION_STR.*/RSL_VERSION_STR \"$(VERSION)\"/' \
85 - -e 's|#define COLORDIR.*|#define COLORDIR \"$(colordir)\"|' \
86 - -e 's|#define WSR88D_SITE_INFO_FILE.*|#define WSR88D_SITE_INFO_FILE \"$(libdir)/wsr88d_locations.dat\"|' \
87 - < $$h.in > $$h.new; \
88 - if cmp -s $$h $$h.new; then \
90 - echo "$$h remains untouched."; \
93 - echo "substitutions made in $$h."; \
100 YFLAGS = -d -p $(PREFIX)
101 LEX_OUTPUT_ROOT = lex.$(PREFIX)
105 - $(INSTALL) -d $(includedir)
106 - $(INSTALL) -m 644 rsl.h $(includedir)
107 - $(INSTALL) -m 644 toolkit_1BC-51_appl.h $(includedir)
108 - $(INSTALL) -m 644 wsr88d_locations.dat $(libdir)
110 EXTRA_DIST = CHANGES Copyright GPL LGPL wsr88d_locations.dat rapic.h
112 DISTCLEANFILES = rapic.c rapic-lex.c
117 void RSL_print_version()
119 - printf("RSL version %s.\n", RSL_VERSION_STR);
120 + printf("RSL version %s.\n", VERSION);
123 /* Debug printing global variable: radar_verbose_flag */
126 @@ -321,7 +321,7 @@ void RSL_radar_to_uf_fp(Radar *r, FILE *fp)
127 uf_ma[37] = tm->tm_year % 100; /* Same format as data year */
128 uf_ma[38] = tm->tm_mon+1;
129 uf_ma[39] = tm->tm_mday;
130 - memcpy(&uf_ma[40], "RSL" RSL_VERSION_STR, 8);
131 + memcpy(&uf_ma[40], "RSL" VERSION, 8);
132 if (little_endian()) swap2(&uf_ma[40], 8/2);
133 uf_ma[44] = (signed short)UF_NO_DATA;
137 @@ -314,7 +314,7 @@ int RSL_write_radar_fp(Radar *radar, FILE *fp)
138 if (radar == NULL) return 0;
140 memset(title, 0, sizeof(title));
141 - (void)sprintf(title, "RSL v%s. sizeof(Range) %d", RSL_VERSION_STR, sizeof(Range));
142 + (void)sprintf(title, "RSL v%s. sizeof(Range) %d", VERSION, sizeof(Range));
143 n += fwrite(title, sizeof(char), sizeof(title), fp);
145 memset(header_buf, 0, sizeof(header_buf));
152 -#define RSL_VERSION_STR "v1.43"
154 /**********************************************************************/
155 /* Configure: Define USE_TWO_BYTE_PRECISION to have RSL store internal*/
156 /* values with two bytes. Otherwise, use one byte. */
158 /* so you shouldn't have to modify anything here. */
159 /**********************************************************************/
161 -#define COLORDIR "/usr/local/trmm/lib/colors"
162 +#define COLORDIR DATADIR "/colors"
165 /* These are the color table indexes. See RSL_set/get_color_table. */
167 /* The default color tables for reflectivity, velocity, spectral width,
168 * height, rainfall, and zdr.
170 -#define REFL_RED_FILE COLORDIR "/red_reflectivity.clr"
171 -#define REFL_GREEN_FILE COLORDIR "/grn_reflectivity.clr"
172 -#define REFL_BLUE_FILE COLORDIR "/blu_reflectivity.clr"
173 -#define VEL_RED_FILE COLORDIR "/red_velocity.clr"
174 -#define VEL_GREEN_FILE COLORDIR "/grn_velocity.clr"
175 -#define VEL_BLUE_FILE COLORDIR "/blu_velocity.clr"
176 -#define SW_RED_FILE COLORDIR "/red_spectral_width.clr"
177 -#define SW_GREEN_FILE COLORDIR "/grn_spectral_width.clr"
178 -#define SW_BLUE_FILE COLORDIR "/blu_spectral_width.clr"
179 -#define HEIGHT_RED_FILE COLORDIR "/red_height.clr"
180 -#define HEIGHT_GREEN_FILE COLORDIR "/grn_height.clr"
181 -#define HEIGHT_BLUE_FILE COLORDIR "/blu_height.clr"
182 +#define REFL_RED_FILE COLORDIR "/red_reflectivity.clr"
183 +#define REFL_GREEN_FILE COLORDIR "/grn_reflectivity.clr"
184 +#define REFL_BLUE_FILE COLORDIR "/blu_reflectivity.clr"
185 +#define VEL_RED_FILE COLORDIR "/red_velocity.clr"
186 +#define VEL_GREEN_FILE COLORDIR "/grn_velocity.clr"
187 +#define VEL_BLUE_FILE COLORDIR "/blu_velocity.clr"
188 +#define SW_RED_FILE COLORDIR "/red_spectral_width.clr"
189 +#define SW_GREEN_FILE COLORDIR "/grn_spectral_width.clr"
190 +#define SW_BLUE_FILE COLORDIR "/blu_spectral_width.clr"
191 +#define HEIGHT_RED_FILE COLORDIR "/red_height.clr"
192 +#define HEIGHT_GREEN_FILE COLORDIR "/grn_height.clr"
193 +#define HEIGHT_BLUE_FILE COLORDIR "/blu_height.clr"
194 #define RAINFALL_RED_FILE COLORDIR "/red_rainfall.clr"
195 #define RAINFALL_GREEN_FILE COLORDIR "/grn_rainfall.clr"
196 #define RAINFALL_BLUE_FILE COLORDIR "/blu_rainfall.clr"
200 * The directory should be the same as the LIBDIR in the makefile.
202 #ifndef WSR88D_SITE_INFO_FILE
203 -#define WSR88D_SITE_INFO_FILE "/usr/local/trmm/lib/wsr88d_locations.dat"
204 +#define WSR88D_SITE_INFO_FILE DATADIR "/wsr88d_locations.dat"
206 /*===============================================================*/
208 --- a/doc/Makefile.am
209 +++ b/doc/Makefile.am
211 AUTOMAKE_OPTIONS = foreign
213 -docdir = $(prefix)/doc/$(PACKAGE)
214 -doc_DATA = *.html *.gif *.jpg
216 -EXTRA_DIST = $(doc_DATA) *.fig
219 - -mkdir $(prefix)/doc
221 - $(INSTALL) -m 444 ../README $(docdir)
222 - $(INSTALL) -m 444 ../CHANGES $(docdir)
223 +dist_doc_DATA = *.html *.gif *.jpg *.fig ../README ../CHANGES