1 arta 1.1 #! /bin/csh -f
2
|
3 arta 1.26 # set up $JSOC_MACHINE
4 set JSOC_MACHINE = `build/jsoc_machine.csh`
5 echo "Machine type is $JSOC_MACHINE"
6 echo ""
|
7 arta 1.24
|
8 arta 1.1 set CLEAN = "no"
|
9 arta 1.61 set PROJCONFIG = ""
10 set CLEANCMD = "d"
11 set CONFIGCMD = "c"
|
12 arta 1.51 set LOCALIZE = "L"
|
13 arta 1.1
|
14 arta 1.60 set CUSTOMDEFSFILE = ""
15
|
16 arta 1.1 foreach ARG ($argv)
|
17 arta 1.61 set FLAG = `echo $ARG | awk '{print substr($0, 2, 1)}'`
18
19 if ($FLAG == $CLEANCMD) then
|
20 arta 1.1 set CLEAN = "yes"
|
21 arta 1.61 else if ($FLAG == $CONFIGCMD) then
22 set PROJCONFIG = `echo $ARG | awk '{print substr($0, 3)}'`
|
23 arta 1.1 endif
24 end
25
26 echo -n "Remove links to man pages..."
|
27 arta 1.47 if (-e man) then
28 rm -rf man
29 endif
|
30 arta 1.1 echo "done"
31
32 echo -n "Removing links to headers..."
|
33 arta 1.10 if (-d base/include) then
|
34 arta 1.47 cd base/include
35 find . -name "*.h" -exec rm {} \;
36 cd ../..
|
37 arta 1.1 endif
|
38 arta 1.19
39 if (-d include) then
|
40 arta 1.47 cd include
41 find . -name "*.h" -exec rm {} \;
42 cd ..
|
43 arta 1.19 endif
|
44 arta 1.1 echo "done"
45
46 echo -n "Removing links to scripts..."
47 if (-d scripts) then
|
48 arta 1.47 cd scripts
49 find . -name "*" -exec rm {} \;
50 cd ..
|
51 arta 1.1 endif
52 echo "done"
53
54 echo -n "Removing links to jsds..."
55 if (-d jsds) then
|
56 arta 1.47 cd jsds
57 find . -name "*" -exec rm {} \;
58 cd ..
|
59 arta 1.1 endif
60 echo "done"
61
62 echo
63
64 if ($CLEAN == "yes") then
|
65 arta 1.10 if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
66 base/local/libs/dsds/scripts/rmlinks.csh
|
67 arta 1.1 endif
68
|
69 arta 1.10 if (-x base/local/libs/soi/scripts/rmlinks.csh) then
70 base/local/libs/soi/scripts/rmlinks.csh
|
71 arta 1.1 endif
72 else
|
73 arta 1.53 # Make include directories here, since they are used by multiple script blocks below
74 if (!(-d base/include)) then
75 mkdir -p base/include
76 endif
77
78 if (!(-d include)) then
79 mkdir -p include
80 endif
81
|
82 arta 1.13 echo "Setting links to man pages..."
83 if (-d /home/jsoc/man) then
84 if (!(-e man)) then
85 ln -s /home/jsoc/man man
86 endif
87 endif
|
88 arta 1.1 echo "done"
|
89 arta 1.52 echo
|
90 arta 1.1
91 echo "Setting links to scripts..."
|
92 arta 1.47 if (!(-d scripts)) then
93 mkdir scripts
94 endif
|
95 arta 1.1 cd scripts
|
96 arta 1.3
97 # Sums scripts
|
98 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" \;
|
99 arta 1.3
100 # Util scripts
|
101 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" \;
|
102 arta 1.3
|
103 arta 1.59 # Export scripts
104 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" \;
105
|
106 arta 1.9 # DRMS / IDL-interface scripts
|
107 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" \;
|
108 arta 1.9
|
109 arta 1.4 # Project-specific scripts - these won't show up if you don't have the project source.
|
110 arta 1.10 if (-x ../proj/configure) then
111 ../proj/configure
|
112 arta 1.4 endif
|
113 arta 1.3
|
114 arta 1.1 cd ..
115 echo "done"
116 echo
117
118 echo "Setting links to jsds..."
|
119 arta 1.47 if (!(-d jsds)) then
120 mkdir jsds
121 endif
|
122 arta 1.1 cd jsds
|
123 arta 1.10 find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o \( -name \*.jsd -exec echo " " {} " ERROR - couldn't create link" \; \)
|
124 arta 1.1 cd ..
125 echo "done"
126 echo
|
127 arta 1.14
|
128 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
129 # user's environment has access to /home/soi/CM
130 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
|
131 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
132 base/local/libs/dsds/scripts/genlinks.csh
|
133 arta 1.1 endif
134
|
135 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
136 base/local/libs/soi/scripts/genlinks.csh
|
137 arta 1.1 endif
138 endif
|
139 arta 1.53
|
140 arta 1.57 echo "done"
141 echo
142
|
143 arta 1.53 # Site Localization
|
144 arta 1.57
145 # Path to the configuration file - at some point, make this an argument to the configure script
|
146 arta 1.58 set LOCALIZATIONDIR = ""
|
147 arta 1.57 set conflocal = "config.local"
|
148 arta 1.58
149 if (-e $conflocal) then
150 set LOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
151 endif
|
152 arta 1.57
153 if ($LOCALIZATIONDIR == "") then
154 set LOCALIZATIONDIR = ${PWD}/localization
155 endif
156
157 # Eventually, dump all these generated files into a user-specified location.
158 # This script will need to read the config.local file to get the
159 # localization directory. Otherwise, just use JSOC/localization as the default.
160 # We should put custom.mk in the localization directory too.
161 if (!(-d ${LOCALIZATIONDIR})) then
162 mkdir ${LOCALIZATIONDIR}
163 if ($? != 0) then
164 echo "Error creating localization directory."
165 endif
166 endif
167
168 if (-e ${LOCALIZATIONDIR}/custom.mk) then
169 rm ${LOCALIZATIONDIR}/custom.mk
170 endif
171
|
172 arta 1.61 if (!(-e configsdp.txt)) then
|
173 arta 1.53 if (!(-e config.local)) then
174 echo "Error: config.local not found. If you have a saved version of this"
175 echo " file from a previous installation, you should copy that into"
176 echo " this directory and rerun configure. Otherwise, copy the file"
177 echo " config.local.template to config.local and edit the config.local"
178 echo " file to contain site-appropriate values."
179 echo
180 echo "*** IMPORTANT *** The edited config.local will contain site-specific"
181 echo " values that should not be modified during subsequent updates to"
182 echo " NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
183 echo " directory tree, for example in /usr/local. After each NetDRMS"
184 echo " update, ensure this file is in place."
|
185 arta 1.54 exit 1;
|
186 arta 1.53 else
|
187 arta 1.57 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk
|
188 arta 1.53 ./gen_init.csh
|
189 arta 1.60
190 set CUSTOMDEFSFILE = "base/include/localization.h"
191
192 # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection
|
193 arta 1.61 # in perl. It also reads configdsp.txt (if it exists) to set the default Stanford values for certain make variables
|
194 arta 1.60 ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}
195
196 # must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables,
197 # which are then referenced by lines in custom.mk generated by customizemake.pl.
|
198 arta 1.57 ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
|
199 arta 1.53 endif
200 else if (-e config.local) then
201 # config.local is optional at Stanford, but it won't necessarily contain the same information that
202 # a NetDRMS config.local contains. The first section contains items that will override the
203 # the items in serverdefs.h. The second section contains items used to populate custom.mk,
204 # which causes make systems variables to be defined that override the default make behavior
205 # (such as overriding the name of the directory to which binary data are written - linux_x86_64_n02
206 # instead of linux_x86_64, for example).
207
208 # Override the defaults defined in serverdefs.h (don't use gen_init.csh as it does several things,
209 # most of which are relevant only to non-SU NetDRMS sites). This script causes all
210 # items included in config.local to override those defined in serverdefs.h, but not all
211 # items need be specified in config.local.
|
212 arta 1.60 echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk
|
213 arta 1.53 ./customizedefs.pl
|
214 arta 1.60
215 set CUSTOMDEFSFILE = "base/include/customizeddefs.h"
216
217 # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection
|
218 arta 1.61 # in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables
|
219 arta 1.60 ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}
|
220 arta 1.53
221 # update custom.mk with data from config.local
|
222 arta 1.60 # must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables,
223 # which are then referenced by lines in custom.mk generated by customizemake.pl.
|
224 arta 1.57 ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
|
225 arta 1.60 else
226 # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection
|
227 arta 1.61 # in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables
|
228 arta 1.60 ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk
|
229 arta 1.53 endif
230
|
231 arta 1.61
232 if (${PROJCONFIG} == "") then
233 if (-e configsdp.txt) then
234 set PROJCONFIG = configsdp.txt
235 endif
236 endif
237
238 if (-e configsdp.txt) then
239 set PROJCONFIGEXE = "/home/jsoc/bin/linux_x86_64/perl5.12.2 configproj.pl"
240 else
241 set PROJCONFIGEXE = "perl"
242 endif
243
244 if (${PROJCONFIG} != "") then
245 ${PROJCONFIGEXE} -c${PROJCONFIG} -d${LOCALIZATIONDIR}
246 endif
247
|
248 arta 1.53 echo "Setting links to headers..."
249
250 cd base/include
251 find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \)
252 cd ../..
253
254 cd include
255 if (-d ../base/include) then
256 find ../base/include -name \*.h -exec ln -s {} . \;
257 endif
258 cd ..
259 echo "done"
260 echo
261
|
262 arta 1.55 # Custom make variable values - these will override the values set in moreconfigure.pl
|
263 arta 1.53 # echo "JSOC_COMPILER = gcc" >> custom.mk
264 # echo "JSOC_FCOMPILER = gfortran" >> custom.mk
|
265 arta 1.55 # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
|
266 arta 1.53
|
267 arta 1.1 endif
268
|
269 arta 1.33
|