1 arta 1.1 #! /bin/csh -f
2
|
3 arta 1.78 # The system configuration for configure script
|
4 arta 1.64 set PERLBIN = ""
|
5 arta 1.73 set PYBIN = ""
|
6 arta 1.64
7 if ($PERLBIN == "") then
|
8 arta 1.74 if (-x /home/jsoc/bin/linux_x86_64/activeperl) then
|
9 arta 1.70 set PERLBIN = "/home/jsoc/bin/linux_x86_64/activeperl"
|
10 arta 1.74 else
11 set PERLBIN = "perl"
12 endif
13 endif
14
15 if ($PYBIN == "") then
16 if (-x /home/jsoc/bin/linux_x86_64/activepython) then
|
17 arta 1.73 set PYBIN = "/home/jsoc/bin/linux_x86_64/activepython"
|
18 arta 1.64 else
|
19 arta 1.73 set PYBIN = "python"
|
20 arta 1.64 endif
21 endif
22
|
23 arta 1.26 # set up $JSOC_MACHINE
24 set JSOC_MACHINE = `build/jsoc_machine.csh`
25 echo "Machine type is $JSOC_MACHINE"
26 echo ""
|
27 arta 1.24
|
28 arta 1.1 set CLEAN = "no"
|
29 arta 1.61 set PROJCONFIG = ""
30 set CLEANCMD = "d"
|
31 arta 1.79 set CFGSERVER = "no"
32 set CFGSERVERARG = "s"
|
33 arta 1.60 set CUSTOMDEFSFILE = ""
34
|
35 arta 1.64 foreach THEARG ($argv)
36 set LITERALSTR = '{ my($argin) = "'${THEARG}'"; my($flagout); $flagout = ($argin =~ /^-(.+)/)[0]; print $flagout; }'
37 set FLAG = `$PERLBIN -e "$LITERALSTR"`
38
|
39 arta 1.61 if ($FLAG == $CLEANCMD) then
|
40 arta 1.64 set CLEAN = "yes"
|
41 arta 1.79 else if ($FLAG == $CFGSERVERARG) then
42 set CFGSERVER = "yes"
|
43 arta 1.64 else if (-e $THEARG) then
44 set PROJCONFIG = $THEARG
|
45 arta 1.1 endif
46 end
47
|
48 arta 1.64 # Usage:
49 # configure [ -c ] [ <project config file> ]
50
|
51 arta 1.63 # Backward compatibility - remove the links to the old make files in projconf
52 if (-d proj) then
53 cd proj
54 if (-e configure) then
55 rm configure
56 endif
57 if (-e make_basic.mk) then
58 rm make_basic.mk
59 endif
60 if (-e Rules.mk) then
61 rm Rules.mk
62 endif
63 if (-e target.mk) then
64 rm target.mk
65 endif
66 cd ..
67 endif
68
|
69 arta 1.1 echo -n "Remove links to man pages..."
|
70 arta 1.47 if (-e man) then
71 rm -rf man
72 endif
|
73 arta 1.1 echo "done"
74
75 echo -n "Removing links to headers..."
|
76 arta 1.10 if (-d base/include) then
|
77 arta 1.47 cd base/include
78 find . -name "*.h" -exec rm {} \;
79 cd ../..
|
80 arta 1.73
81 # Special link from base/drms/apps/serverdefs.h to localization/drmsparams.h
82 cd base/drms/apps
83 rm serverdefs.h
84 cd ../../..
85
|
86 arta 1.1 endif
|
87 arta 1.19
88 if (-d include) then
|
89 arta 1.47 cd include
90 find . -name "*.h" -exec rm {} \;
91 cd ..
|
92 arta 1.19 endif
|
93 arta 1.1 echo "done"
94
95 echo -n "Removing links to scripts..."
96 if (-d scripts) then
|
97 arta 1.47 cd scripts
98 find . -name "*" -exec rm {} \;
99 cd ..
|
100 arta 1.1 endif
101 echo "done"
102
103 echo -n "Removing links to jsds..."
104 if (-d jsds) then
|
105 arta 1.47 cd jsds
106 find . -name "*" -exec rm {} \;
107 cd ..
|
108 arta 1.1 endif
109 echo "done"
110
111 echo
112
113 if ($CLEAN == "yes") then
|
114 arta 1.10 if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
115 base/local/libs/dsds/scripts/rmlinks.csh
|
116 arta 1.1 endif
117
|
118 arta 1.10 if (-x base/local/libs/soi/scripts/rmlinks.csh) then
119 base/local/libs/soi/scripts/rmlinks.csh
|
120 arta 1.1 endif
121 else
|
122 arta 1.53 # Make include directories here, since they are used by multiple script blocks below
123 if (!(-d base/include)) then
124 mkdir -p base/include
125 endif
126
127 if (!(-d include)) then
128 mkdir -p include
129 endif
130
|
131 arta 1.13 echo "Setting links to man pages..."
132 if (-d /home/jsoc/man) then
133 if (!(-e man)) then
134 ln -s /home/jsoc/man man
135 endif
136 endif
|
137 arta 1.1 echo "done"
|
138 arta 1.52 echo
|
139 arta 1.1
140 echo "Setting links to jsds..."
|
141 arta 1.47 if (!(-d jsds)) then
142 mkdir jsds
143 endif
|
144 arta 1.1 cd jsds
|
145 arta 1.10 find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o \( -name \*.jsd -exec echo " " {} " ERROR - couldn't create link" \; \)
|
146 arta 1.1 cd ..
147 echo "done"
148 echo
|
149 arta 1.14
|
150 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
151 # user's environment has access to /home/soi/CM
152 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
|
153 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
154 base/local/libs/dsds/scripts/genlinks.csh
|
155 arta 1.1 endif
156
|
157 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
158 base/local/libs/soi/scripts/genlinks.csh
|
159 arta 1.1 endif
160 endif
|
161 arta 1.53
|
162 arta 1.57 echo "done"
163 echo
164
|
165 arta 1.53 # Site Localization
|
166 arta 1.57
167 # Path to the configuration file - at some point, make this an argument to the configure script
|
168 arta 1.58 set LOCALIZATIONDIR = ""
|
169 arta 1.77 set RELLOCALIZATIONDIR = ""
|
170 arta 1.57 set conflocal = "config.local"
|
171 arta 1.58
172 if (-e $conflocal) then
|
173 arta 1.77 set RELLOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
|
174 arta 1.58 endif
|
175 arta 1.57
176 if ($LOCALIZATIONDIR == "") then
|
177 arta 1.77 set RELLOCALIZATIONDIR = localization
|
178 arta 1.57 endif
179
|
180 arta 1.75 # Make the path absoluate
|
181 arta 1.77 set LOCALIZATIONDIR = ${PWD}/${RELLOCALIZATIONDIR}
|
182 arta 1.75
|
183 arta 1.57 # Eventually, dump all these generated files into a user-specified location.
184 # This script will need to read the config.local file to get the
185 # localization directory. Otherwise, just use JSOC/localization as the default.
186 if (!(-d ${LOCALIZATIONDIR})) then
187 mkdir ${LOCALIZATIONDIR}
188 if ($? != 0) then
189 echo "Error creating localization directory."
190 endif
191 endif
|
192 arta 1.71
|
193 arta 1.73 if (-e ${LOCALIZATIONDIR}/drmsparams.h) then
194 rm ${LOCALIZATIONDIR}/drmsparams.h
195 endif
196
197 if (-e ${LOCALIZATIONDIR}/drmsparams.mk) then
198 rm ${LOCALIZATIONDIR}/drmsparams.mk
199 endif
|
200 arta 1.71
|
201 arta 1.73 if (-e ${LOCALIZATIONDIR}/drmsparams.pm) then
202 rm ${LOCALIZATIONDIR}/drmsparams.pm
|
203 arta 1.57 endif
204
|
205 arta 1.65 # Must create the scripts subdirectory before the call to gen_init.csh
206 if (!(-d scripts)) then
|
207 arta 1.73 mkdir scripts
208 endif
|
209 arta 1.65
|
210 arta 1.61 if (!(-e configsdp.txt)) then
|
211 arta 1.66 # This is NetDRMS.
|
212 arta 1.53 if (!(-e config.local)) then
213 echo "Error: config.local not found. If you have a saved version of this"
214 echo " file from a previous installation, you should copy that into"
215 echo " this directory and rerun configure. Otherwise, copy the file"
216 echo " config.local.template to config.local and edit the config.local"
217 echo " file to contain site-appropriate values."
218 echo
219 echo "*** IMPORTANT *** The edited config.local will contain site-specific"
220 echo " values that should not be modified during subsequent updates to"
221 echo " NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
222 echo " directory tree, for example in /usr/local. After each NetDRMS"
223 echo " update, ensure this file is in place."
|
224 arta 1.54 exit 1;
|
225 arta 1.61 endif
226 endif
|
227 arta 1.73
228 # We now call localize.py for both Stanford and NetDRMS builds.
|
229 arta 1.79 if ($CFGSERVER == "yes") then
230 $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams -s
231 else
232 $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams
233 endif
|
234 arta 1.61
|
235 arta 1.73 echo "Setting links to scripts..."
236 cd scripts
|
237 arta 1.61
|
238 arta 1.73 # Sums scripts
239 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" \;
|
240 arta 1.62
|
241 arta 1.73 # Util scripts
242 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" \;
|
243 arta 1.62
244 # Export scripts
|
245 arta 1.73 find ../base/export/scripts -mindepth 1 \( -path \*CVS -prune -o -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \;
|
246 arta 1.62
|
247 arta 1.73 # DRMS / IDL-interface scripts
248 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" \;
|
249 arta 1.62
|
250 arta 1.73 # Project-specific scripts - these won't show up if you don't have the project source.
251 if (-x ${LOCALIZATIONDIR}/configure) then
252 ${LOCALIZATIONDIR}/configure
253 endif
|
254 arta 1.62
|
255 arta 1.73 cd ..
256 echo "done"
257 echo
|
258 arta 1.62
|
259 arta 1.53 echo "Setting links to headers..."
260
|
261 arta 1.73 # When localize.py was added, we removed the repository version of serverdefs.h, and we stopped generating JSOC/base/include/localization.h.
262 # To support legacy code, we need to make a link from serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for serverdefs.h
263 # at Stanford) and from JSOC/base/include/localization.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for localization.h
264 # for NetDRMs builds). However, some files are looking for JSOC/base/drms/apps/serverdefs.h (instead of JSOC/base/include, the correct path).
265 # If we make a link from JSOC/base/drms/apps/serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h, then the script below will make links from
266 # JSOC/base/include/serverdefs.h and JSOC/include/serverdefs.h to JSOC/base/drms/apps/serverdefs.h, which then links to ${LOCALIZATIONDIR}/drmsparams.h.
267 cd base/drms/apps
|
268 arta 1.77 ln -s ../../../${RELLOCALIZATIONDIR}/drmsparams.h serverdefs.h
|
269 arta 1.73 cd ../../..
270
271 cd base/include
|
272 arta 1.77 ln -s ../../../${RELLOCALIZATIONDIR}/drmsparams.h localization.h
|
273 arta 1.73 cd ../..
274
|
275 arta 1.53 cd base/include
276 find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \)
277 cd ../..
278
279 cd include
280 if (-d ../base/include) then
281 find ../base/include -name \*.h -exec ln -s {} . \;
282 endif
283 cd ..
284 echo "done"
285 echo
286
|
287 arta 1.1 endif
288
|
289 arta 1.33
|