1 arta 1.1 #! /bin/csh -f
2
|
3 arta 1.48 rm custom.mk
4
|
5 arta 1.26 # set up $JSOC_MACHINE
6 set JSOC_MACHINE = `build/jsoc_machine.csh`
7 echo "Machine type is $JSOC_MACHINE"
8 echo ""
|
9 arta 1.24
|
10 arta 1.1 set CLEAN = "no"
11 set CHKLIBS = "no"
12 set CCMD = "c"
13 set LCMD = "l"
|
14 arta 1.51 set LOCALIZE = "L"
|
15 arta 1.1
16 foreach ARG ($argv)
17 set FLAG = `echo $ARG | awk '{print substr($0, 2)}'`
18 if ($FLAG == $CCMD) then
19 set CLEAN = "yes"
20 else if ($FLAG == $LCMD) then
21 set CHKLIBS = "yes"
22 endif
23 end
24
25 if ($CHKLIBS == "no") then
|
26 arta 1.5 echo -n "Remove links for local project configuration..."
|
27 arta 1.47 if (-d proj) then
28 cd proj
29 if (-e configure) then
30 rm configure
31 endif
32 if (-e make_basic.mk) then
33 rm make_basic.mk
34 endif
35 if (-e Rules.mk) then
36 rm Rules.mk
37 endif
38 if (-e target.mk) then
39 rm target.mk
40 endif
41 cd ..
42 endif
|
43 arta 1.5 echo "done"
44
|
45 arta 1.1 echo -n "Remove links to man pages..."
|
46 arta 1.47 if (-e man) then
47 rm -rf man
48 endif
|
49 arta 1.1 echo "done"
50
51 echo -n "Removing links to headers..."
|
52 arta 1.10 if (-d base/include) then
|
53 arta 1.47 cd base/include
54 find . -name "*.h" -exec rm {} \;
55 cd ../..
|
56 arta 1.1 endif
|
57 arta 1.19
58 if (-d include) then
|
59 arta 1.47 cd include
60 find . -name "*.h" -exec rm {} \;
61 cd ..
|
62 arta 1.19 endif
|
63 arta 1.1 echo "done"
64
65 echo -n "Removing links to scripts..."
66 if (-d scripts) then
|
67 arta 1.47 cd scripts
68 find . -name "*" -exec rm {} \;
69 cd ..
|
70 arta 1.1 endif
71 echo "done"
72
73 echo -n "Removing links to jsds..."
74 if (-d jsds) then
|
75 arta 1.47 cd jsds
76 find . -name "*" -exec rm {} \;
77 cd ..
|
78 arta 1.1 endif
79 echo "done"
80
81 echo
82
83 if ($CLEAN == "yes") then
|
84 arta 1.10 if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
85 base/local/libs/dsds/scripts/rmlinks.csh
|
86 arta 1.1 endif
87
|
88 arta 1.10 if (-x base/local/libs/soi/scripts/rmlinks.csh) then
89 base/local/libs/soi/scripts/rmlinks.csh
|
90 arta 1.1 endif
91 else
|
92 arta 1.5 echo -n "Setting links for local project configuration..."
|
93 arta 1.6 if (-e suflag.txt) then
|
94 arta 1.10 cd proj
95 ln -sf ../projconf/su/configure configure
96 ln -sf ../projconf/su/make_basic.mk make_basic.mk
97 ln -sf ../projconf/su/Rules.mk Rules.mk
98 ln -sf ../projconf/su/target.mk target.mk
99 cd ..
|
100 arta 1.6 else
|
101 arta 1.10 cd proj
102 ln -sf ../projconf/ex/configure configure
103 ln -sf ../projconf/ex/make_basic.mk make_basic.mk
104 ln -sf ../projconf/ex/Rules.mk Rules.mk
105 ln -sf ../projconf/ex/target.mk target.mk
106 cd ..
|
107 arta 1.5 endif
108 echo "done"
109
|
110 arta 1.13 echo "Setting links to man pages..."
111 if (-d /home/jsoc/man) then
112 if (!(-e man)) then
113 ln -s /home/jsoc/man man
114 endif
115 endif
|
116 arta 1.1 echo "done"
|
117 arta 1.52 echo
|
118 arta 1.1
119 echo "Setting links to scripts..."
|
120 arta 1.47 if (!(-d scripts)) then
121 mkdir scripts
122 endif
|
123 arta 1.1 cd scripts
|
124 arta 1.3
125 # Sums scripts
|
126 arta 1.10 find ../base/sums/scripts -mindepth 1 \( -path \*CVS -prune -o -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \;
|
127 arta 1.3
128 # Util scripts
|
129 arta 1.10 find ../base/util/scripts -mindepth 1 \( -path \*CVS -prune -o -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \;
|
130 arta 1.3
|
131 arta 1.9 # DRMS / IDL-interface scripts
|
132 arta 1.10 find ../base/drms/scripts -mindepth 1 \( -path \*CVS -prune -o -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \;
|
133 arta 1.9
|
134 arta 1.4 # Project-specific scripts - these won't show up if you don't have the project source.
|
135 arta 1.10 if (-x ../proj/configure) then
136 ../proj/configure
|
137 arta 1.4 endif
|
138 arta 1.3
|
139 arta 1.1 cd ..
140 echo "done"
141 echo
142
143 echo "Setting links to jsds..."
|
144 arta 1.47 if (!(-d jsds)) then
145 mkdir jsds
146 endif
|
147 arta 1.1 cd jsds
|
148 arta 1.10 find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o \( -name \*.jsd -exec echo " " {} " ERROR - couldn't create link" \; \)
|
149 arta 1.1 cd ..
150 echo "done"
151 echo
|
152 arta 1.51
153 if (-e suflag.txt) then
154 # Stanford third-party libraries
155 echo 'POSTGRES_LIB = pq' >> custom.mk
156 echo 'CFITSIO_LIB = cfitsio' >> custom.mk
157
|
158 arta 1.52 echo 'ifeq ($(JSOC_MACHINE), linux_x86_64)' >> custom.mk
|
159 arta 1.51 echo ' POSTGRES_INCS = /usr/include' >> custom.mk
160 echo ' POSTGRES_LIBS = /usr/lib64' >> custom.mk
161 echo ' CFITSIO_INCS = /home/jsoc/include' >> custom.mk
162 echo ' CFITSIO_LIBS = /home/jsoc/lib/linux-x86_64' >> custom.mk
163 echo 'endif' >> custom.mk
164
|
165 arta 1.52 echo 'ifeq ($(JSOC_MACHINE), linux_ia32)' >> custom.mk
|
166 arta 1.51 echo ' POSTGRES_INCS = /usr/include' >> custom.mk
167 echo ' POSTGRES_LIBS = /usr/lib' >> custom.mk
168 echo ' CFITSIO_INCS = /home/jsoc/include' >> custom.mk
169 echo ' CFITSIO_LIBS = /home/jsoc/lib/linux-ia32' >> custom.mk
170 echo 'endif' >> custom.mk
171
172 # Set custom make file to tell the make system that the gcc cfitsio library is called
173 # libcfitsio_gcc.a
174 echo 'ifeq ($(COMPILER), gcc)' >> custom.mk
175 echo ' ifeq ($(JSOC_MACHINE), linux_x86_64)' >> custom.mk
176 echo ' CFITSIO_LIB = cfitsio_gcc' >> custom.mk
177 echo ' endif' >> custom.mk
178 echo 'endif' >> custom.mk
|
179 arta 1.31 endif
180
|
181 arta 1.32 # Make customizations - ensure changes here are synchronized to changes in make_basic.mk
182 if (!(-e suflag.txt)) then
183 # put compilation customizations here
184 # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
185 endif
186
|
187 arta 1.14 echo "done"
188 echo
189
|
190 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
191 # user's environment has access to /home/soi/CM
192 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
|
193 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
194 base/local/libs/dsds/scripts/genlinks.csh
|
195 arta 1.1 endif
196
|
197 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
198 base/local/libs/soi/scripts/genlinks.csh
|
199 arta 1.1 endif
200 endif
201 endif
202 endif
203
204 # Enter required library names and versions here.
205 if ($CHKLIBS == "yes") then
206
207 endif
|
208 arta 1.33
|
209 arta 1.37 # Site Localization
|
210 arta 1.33 if (!(-e suflag.txt)) then
|
211 arta 1.44 if (!(-e config.local)) then
212 echo "Error: config.local not found. If you have a saved version of this"
213 echo " file from a previous installation, you should copy that into"
214 echo " this directory and rerun configure. Otherwise, copy the file"
215 echo " config.local.template to config.local and edit the config.local"
216 echo " file to contain site-appropriate values."
217 echo
218 echo "*** IMPORTANT *** The edited config.local will contain site-specific"
219 echo " values that should not be modified during subsequent updates to"
|
220 rick 1.45 echo " NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
|
221 arta 1.44 echo " directory tree, for example in /usr/local. After each NetDRMS"
222 echo " update, ensure this file is in place."
223 else
224 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> custom.mk
225 ./gen_init.csh
|
226 arta 1.51 ./customizemake.pl
|
227 arta 1.44 endif
|
228 arta 1.52 else if (-e config.local) then
|
229 arta 1.51 # config.local is optional at Stanford, but it won't necessarily contain the same information that
230 # a NetDRMS config.local contains. The first section contains items that will override the
231 # the items in serverdefs.h. The second section contains items used to populate custom.mk,
232 # which causes make systems variables to be defined that override the default make behavior
233 # (such as overriding the name of the directory to which binary data are written - linux_x86_64_n02
234 # instead of linux_x86_64, for example).
235
236 # Override the defaults defined in serverdefs.h (don't use gen_init.csh as it does several things,
237 # most of which are relevant only to non-SU NetDRMS sites). This script causes all
238 # items included in config.local to override those defined in serverdefs.h, but not all
239 # items need be specified in config.local.
240 ./customizedefs.pl
241 echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> custom.mk
|
242 arta 1.39
|
243 arta 1.51 # update custom.mk with data from config.local
244 ./customizemake.pl
|
245 arta 1.39 endif
|
246 arta 1.48
|
247 arta 1.52 echo "Setting links to headers..."
248 if (!(-d base/include)) then
249 mkdir -p base/include
250 endif
251 cd base/include
252 find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \)
253 cd ../..
254
255 if (!(-d include)) then
256 mkdir -p include
257 endif
258 cd include
259 if (-d ../base/include) then
260 find ../base/include -name \*.h -exec ln -s {} . \;
261 endif
262 cd ..
263 echo "done"
264 echo
265
|
266 arta 1.48 # Customize compilers
|
267 arta 1.50 # echo "JSOC_COMPILER = gcc" >> custom.mk
268 # echo "JSOC_FCOMPILER = gfortran" >> custom.mk
|
269 arta 1.48
270 # run perl script to do even more configuration
|
271 jsoc 1.49 ./moreconfigure.pl -fcustom.mk
|