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
118 echo "Setting links to headers..."
|
119 arta 1.10 if (!(-d base/include)) then
120 mkdir -p base/include
|
121 arta 1.1 endif
|
122 arta 1.10 cd base/include
|
123 arta 1.1 find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \)
|
124 arta 1.10 cd ../..
|
125 arta 1.19
|
126 arta 1.47 if (!(-d include)) then
127 mkdir -p include
128 endif
|
129 arta 1.19 cd include
130 if (-d ../base/include) then
131 find ../base/include -name \*.h -exec ln -s {} . \;
132 endif
133 cd ..
|
134 arta 1.1 echo "done"
135 echo
136
137 echo "Setting links to scripts..."
|
138 arta 1.47 if (!(-d scripts)) then
139 mkdir scripts
140 endif
|
141 arta 1.1 cd scripts
|
142 arta 1.3
143 # Sums scripts
|
144 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" \;
|
145 arta 1.3
146 # Util scripts
|
147 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" \;
|
148 arta 1.3
|
149 arta 1.9 # DRMS / IDL-interface scripts
|
150 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" \;
|
151 arta 1.9
|
152 arta 1.4 # Project-specific scripts - these won't show up if you don't have the project source.
|
153 arta 1.10 if (-x ../proj/configure) then
154 ../proj/configure
|
155 arta 1.4 endif
|
156 arta 1.3
|
157 arta 1.1 cd ..
158 echo "done"
159 echo
160
161 echo "Setting links to jsds..."
|
162 arta 1.47 if (!(-d jsds)) then
163 mkdir jsds
164 endif
|
165 arta 1.1 cd jsds
|
166 arta 1.10 find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o \( -name \*.jsd -exec echo " " {} " ERROR - couldn't create link" \; \)
|
167 arta 1.1 cd ..
168 echo "done"
169 echo
|
170 arta 1.51
171 if (-e suflag.txt) then
172 # Stanford third-party libraries
173 echo 'POSTGRES_LIB = pq' >> custom.mk
174 echo 'CFITSIO_LIB = cfitsio' >> custom.mk
175
176 echo 'ifeq (\$(JSOC_MACHINE), linux_x86_64)\n' >> custom.mk
177 echo ' POSTGRES_INCS = /usr/include' >> custom.mk
178 echo ' POSTGRES_LIBS = /usr/lib64' >> custom.mk
179 echo ' CFITSIO_INCS = /home/jsoc/include' >> custom.mk
180 echo ' CFITSIO_LIBS = /home/jsoc/lib/linux-x86_64' >> custom.mk
181 echo 'endif' >> custom.mk
182
183 echo 'ifeq (\$(JSOC_MACHINE), linux_ia32)\n' >> custom.mk
184 echo ' POSTGRES_INCS = /usr/include' >> custom.mk
185 echo ' POSTGRES_LIBS = /usr/lib' >> custom.mk
186 echo ' CFITSIO_INCS = /home/jsoc/include' >> custom.mk
187 echo ' CFITSIO_LIBS = /home/jsoc/lib/linux-ia32' >> custom.mk
188 echo 'endif' >> custom.mk
189
190 # Set custom make file to tell the make system that the gcc cfitsio library is called
191 arta 1.51 # libcfitsio_gcc.a
192 echo 'ifeq ($(COMPILER), gcc)' >> custom.mk
193 echo ' ifeq ($(JSOC_MACHINE), linux_x86_64)' >> custom.mk
194 echo ' CFITSIO_LIB = cfitsio_gcc' >> custom.mk
195 echo ' endif' >> custom.mk
196 echo 'endif' >> custom.mk
|
197 arta 1.31 endif
198
|
199 arta 1.32 # Make customizations - ensure changes here are synchronized to changes in make_basic.mk
200 if (!(-e suflag.txt)) then
201 # put compilation customizations here
202 # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
203 endif
204
|
205 arta 1.14 echo "done"
206 echo
207
|
208 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
209 # user's environment has access to /home/soi/CM
210 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
|
211 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
212 base/local/libs/dsds/scripts/genlinks.csh
|
213 arta 1.1 endif
214
|
215 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
216 base/local/libs/soi/scripts/genlinks.csh
|
217 arta 1.1 endif
218 endif
219 endif
220 endif
221
222 # Enter required library names and versions here.
223 if ($CHKLIBS == "yes") then
224
225 endif
|
226 arta 1.33
|
227 arta 1.37 # Site Localization
|
228 arta 1.33 if (!(-e suflag.txt)) then
|
229 arta 1.44 if (!(-e config.local)) then
230 echo "Error: config.local not found. If you have a saved version of this"
231 echo " file from a previous installation, you should copy that into"
232 echo " this directory and rerun configure. Otherwise, copy the file"
233 echo " config.local.template to config.local and edit the config.local"
234 echo " file to contain site-appropriate values."
235 echo
236 echo "*** IMPORTANT *** The edited config.local will contain site-specific"
237 echo " values that should not be modified during subsequent updates to"
|
238 rick 1.45 echo " NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
|
239 arta 1.44 echo " directory tree, for example in /usr/local. After each NetDRMS"
240 echo " update, ensure this file is in place."
241 else
242 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> custom.mk
243 ./gen_init.csh
|
244 arta 1.51 ./customizemake.pl
|
245 arta 1.44 endif
|
246 arta 1.51 else if (-e config.local)
247 # config.local is optional at Stanford, but it won't necessarily contain the same information that
248 # a NetDRMS config.local contains. The first section contains items that will override the
249 # the items in serverdefs.h. The second section contains items used to populate custom.mk,
250 # which causes make systems variables to be defined that override the default make behavior
251 # (such as overriding the name of the directory to which binary data are written - linux_x86_64_n02
252 # instead of linux_x86_64, for example).
253
254 # Override the defaults defined in serverdefs.h (don't use gen_init.csh as it does several things,
255 # most of which are relevant only to non-SU NetDRMS sites). This script causes all
256 # items included in config.local to override those defined in serverdefs.h, but not all
257 # items need be specified in config.local.
258 ./customizedefs.pl
259 echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> custom.mk
|
260 arta 1.39
|
261 arta 1.51 # update custom.mk with data from config.local
262 ./customizemake.pl
|
263 arta 1.39 endif
|
264 arta 1.48
265 # Customize compilers
|
266 arta 1.50 # echo "JSOC_COMPILER = gcc" >> custom.mk
267 # echo "JSOC_FCOMPILER = gfortran" >> custom.mk
|
268 arta 1.48
269 # run perl script to do even more configuration
|
270 jsoc 1.49 ./moreconfigure.pl -fcustom.mk
|