(file) Return to configure CVS log (file) (dir) Up to [Development] / JSOC

  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 arta  1.81         find . -name "drmsparams*" -exec rm {} \;
 92 arta  1.47 	cd ..
 93 arta  1.19     endif
 94 arta  1.1      echo "done"
 95            
 96                echo -n "Removing links to scripts..."
 97                if (-d scripts) then
 98 arta  1.47 	cd scripts
 99 arta  1.81         if ($? == 0) then
100                        find . -type l -exec rm {} \;
101                    endif
102 arta  1.47 	cd ..
103 arta  1.1      endif
104                echo "done"
105            
106                echo -n "Removing links to jsds..."
107                if (-d jsds) then
108 arta  1.47 	cd jsds
109 arta  1.81         if ($? == 0) then
110                        find . -type l -exec rm {} \;
111                    endif
112 arta  1.47 	cd ..
113 arta  1.1      endif
114                echo "done"
115                echo
116            
117                if ($CLEAN == "yes") then
118 arta  1.10 	if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
119            	    base/local/libs/dsds/scripts/rmlinks.csh
120 arta  1.1  	endif
121            
122 arta  1.10 	if (-x base/local/libs/soi/scripts/rmlinks.csh) then
123            	    base/local/libs/soi/scripts/rmlinks.csh
124 arta  1.1  	endif
125                else
126 arta  1.53         # Make include directories here, since they are used by multiple script blocks below
127                    if (!(-d base/include)) then
128                        mkdir -p base/include
129                    endif
130            
131                    if (!(-d include)) then
132                        mkdir -p include
133                    endif
134            
135 arta  1.13 	echo "Setting links to man pages..."
136            	if (-d /home/jsoc/man) then
137            	    if (!(-e man)) then
138            		ln -s /home/jsoc/man man
139            	    endif
140            	endif
141 arta  1.1  	echo "done"
142 arta  1.52         echo
143 arta  1.1  	
144            	echo "Setting links to jsds..."
145 arta  1.47 	if (!(-d jsds)) then
146            	    mkdir jsds
147            	endif
148 arta  1.1  	cd jsds
149 arta  1.10 	find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o \( -name \*.jsd -exec echo "  " {} " ERROR - couldn't create link" \; \)
150 arta  1.1  	cd ..
151            	echo "done"
152            	echo
153 arta  1.14 
154 arta  1.1  	# generate links for DSDS/SOI dynamic libraries - only do this if 
155            	# user's environment has access to /home/soi/CM
156            	if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
157 arta  1.10 	    if (-x base/local/libs/dsds/scripts/genlinks.csh) then
158            		base/local/libs/dsds/scripts/genlinks.csh
159 arta  1.1  	    endif
160            
161 arta  1.10 	    if (-x base/local/libs/soi/scripts/genlinks.csh) then
162            		base/local/libs/soi/scripts/genlinks.csh
163 arta  1.1  	    endif
164            	endif
165 arta  1.53 
166 arta  1.57 	echo "done"
167            	echo
168            
169 arta  1.53         # Site Localization
170 arta  1.57 
171                    # Path to the configuration file - at some point, make this an argument to the configure script
172 arta  1.58         set LOCALIZATIONDIR = ""
173 arta  1.77         set RELLOCALIZATIONDIR = ""
174 arta  1.57         set conflocal = "config.local"
175 arta  1.58 
176                    if (-e $conflocal) then
177 arta  1.77             set RELLOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
178 arta  1.58         endif
179 arta  1.57 
180                    if ($LOCALIZATIONDIR == "") then
181 arta  1.77             set RELLOCALIZATIONDIR = localization
182 arta  1.57         endif
183            
184 arta  1.75         # Make the path absoluate
185 arta  1.77         set LOCALIZATIONDIR = ${PWD}/${RELLOCALIZATIONDIR}
186 arta  1.75 
187 arta  1.57         # Eventually, dump all these generated files into a user-specified location.
188                    # This script will need to read the config.local file to get the 
189                    # localization directory. Otherwise, just use JSOC/localization as the default.
190                    if (!(-d ${LOCALIZATIONDIR})) then
191                        mkdir ${LOCALIZATIONDIR}
192                        if ($? != 0) then
193                            echo "Error creating localization directory."
194                        endif
195                    endif
196 arta  1.71 
197 arta  1.73         if (-e ${LOCALIZATIONDIR}/drmsparams.h) then
198                        rm ${LOCALIZATIONDIR}/drmsparams.h
199                    endif
200            
201                    if (-e ${LOCALIZATIONDIR}/drmsparams.mk) then
202                        rm ${LOCALIZATIONDIR}/drmsparams.mk
203                    endif
204 arta  1.71 
205 arta  1.73         if (-e ${LOCALIZATIONDIR}/drmsparams.pm) then
206                        rm ${LOCALIZATIONDIR}/drmsparams.pm
207 arta  1.57         endif
208            
209 arta  1.81         if (-e ${LOCALIZATIONDIR}/drmsparams.py) then
210                        rm ${LOCALIZATIONDIR}/drmsparams.py
211                    endif
212            
213            
214 arta  1.65         # Must create the scripts subdirectory before the call to gen_init.csh
215                    if (!(-d scripts)) then
216 arta  1.73             mkdir scripts
217                    endif
218 arta  1.65 
219 arta  1.61         if (!(-e configsdp.txt)) then
220 arta  1.66             # This is NetDRMS.
221 arta  1.53             if (!(-e config.local)) then
222                            echo "Error: config.local not found. If you have a saved version of this"
223                            echo "       file from a previous installation, you should copy that into"
224                            echo "       this directory and rerun configure. Otherwise, copy the file"
225                            echo "       config.local.template to config.local and edit the config.local"
226                            echo "       file to contain site-appropriate values."
227                            echo 
228                            echo "*** IMPORTANT *** The edited config.local will contain site-specific"
229                            echo "    values that should not be modified during subsequent updates to"
230                            echo "    NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
231                            echo "    directory tree, for example in /usr/local. After each NetDRMS"
232                            echo "    update, ensure this file is in place."
233 arta  1.54                 exit 1;
234 arta  1.61             endif
235                    endif
236 arta  1.73         
237                    # We now call localize.py for both Stanford and NetDRMS builds.
238 arta  1.79         if ($CFGSERVER == "yes") then
239                        $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams -s
240                    else
241                        $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams
242                    endif
243 arta  1.61 
244 arta  1.73         echo "Setting links to scripts..."
245                    cd scripts
246 arta  1.61 
247 arta  1.73         # Sums scripts
248                    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" \;
249 arta  1.62 
250 arta  1.73         # Util scripts
251                    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" \;
252 arta  1.62 
253                    # Export scripts
254 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" \;
255 arta  1.62 
256 arta  1.73         # DRMS / IDL-interface scripts
257                    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" \;
258 arta  1.62 
259 arta  1.73         # Project-specific scripts - these won't show up if you don't have the project source.
260                    if (-x ${LOCALIZATIONDIR}/configure) then
261                        ${LOCALIZATIONDIR}/configure
262                    endif
263 arta  1.62 
264 arta  1.73         cd ..
265                    echo "done"
266                    echo
267 arta  1.62 
268 arta  1.53         echo "Setting links to headers..."
269            
270 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.
271                    # To support legacy code, we need to make a link from serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for serverdefs.h
272                    # at Stanford) and from JSOC/base/include/localization.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for localization.h
273                    # for NetDRMs builds). However, some files are looking for JSOC/base/drms/apps/serverdefs.h (instead of JSOC/base/include, the correct path).
274                    # If we make a link from JSOC/base/drms/apps/serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h, then the script below will make links from 
275                    # JSOC/base/include/serverdefs.h and JSOC/include/serverdefs.h to JSOC/base/drms/apps/serverdefs.h, which then links to ${LOCALIZATIONDIR}/drmsparams.h.
276                    cd base/drms/apps
277 arta  1.77             ln -s ../../../${RELLOCALIZATIONDIR}/drmsparams.h serverdefs.h
278 arta  1.73         cd ../../..
279            
280                    cd base/include
281 arta  1.80             ln -s ../../${RELLOCALIZATIONDIR}/drmsparams.h localization.h
282 arta  1.73         cd ../..
283            
284 arta  1.53         cd base/include
285                    find .. -path '../include' -prune -o -name \*.h  \( \( -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o -exec echo "  " {} " ERROR - couldn't create link" \; \)
286                    cd ../..
287            
288                    cd include
289                    if (-d ../base/include) then
290                        find ../base/include -name \*.h -exec ln -s {} . \;
291                    endif
292 arta  1.81 
293                    # ${LOCALIZATIONDIR} is an absolute path
294                    ln -s ../${RELLOCALIZATIONDIR}/drmsparams.h
295                    ln -s ../${RELLOCALIZATIONDIR}/drmsparams.pm
296                    ln -s ../${RELLOCALIZATIONDIR}/drmsparams.py
297            
298 arta  1.53         cd ..
299                    echo "done"
300                    echo
301            
302 arta  1.1      endif
303            
304 arta  1.33 

Karen Tian
Powered by
ViewCVS 0.9.4