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

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

Karen Tian
Powered by
ViewCVS 0.9.4