(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.57         set conflocal = "config.local"
167 arta  1.58 
168                    if (-e $conflocal) then
169                        set LOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
170                    endif
171 arta  1.57 
172                    if ($LOCALIZATIONDIR == "") then
173 arta  1.73             set LOCALIZATIONDIR = localization
174 arta  1.57         endif
175            
176 arta  1.75         # Make the path absoluate
177                    set LOCALIZATIONDIR = ${PWD}/${LOCALIZATIONDIR}
178            
179 arta  1.57         # Eventually, dump all these generated files into a user-specified location.
180                    # This script will need to read the config.local file to get the 
181                    # localization directory. Otherwise, just use JSOC/localization as the default.
182                    if (!(-d ${LOCALIZATIONDIR})) then
183                        mkdir ${LOCALIZATIONDIR}
184                        if ($? != 0) then
185                            echo "Error creating localization directory."
186                        endif
187                    endif
188 arta  1.71 
189 arta  1.73         if (-e ${LOCALIZATIONDIR}/drmsparams.h) then
190                        rm ${LOCALIZATIONDIR}/drmsparams.h
191                    endif
192            
193                    if (-e ${LOCALIZATIONDIR}/drmsparams.mk) then
194                        rm ${LOCALIZATIONDIR}/drmsparams.mk
195                    endif
196 arta  1.71 
197 arta  1.73         if (-e ${LOCALIZATIONDIR}/drmsparams.pm) then
198                        rm ${LOCALIZATIONDIR}/drmsparams.pm
199 arta  1.57         endif
200            
201 arta  1.65         # Must create the scripts subdirectory before the call to gen_init.csh
202                    if (!(-d scripts)) then
203 arta  1.73             mkdir scripts
204                    endif
205 arta  1.65 
206 arta  1.61         if (!(-e configsdp.txt)) then
207 arta  1.66             # This is NetDRMS.
208 arta  1.53             if (!(-e config.local)) then
209                            echo "Error: config.local not found. If you have a saved version of this"
210                            echo "       file from a previous installation, you should copy that into"
211                            echo "       this directory and rerun configure. Otherwise, copy the file"
212                            echo "       config.local.template to config.local and edit the config.local"
213                            echo "       file to contain site-appropriate values."
214                            echo 
215                            echo "*** IMPORTANT *** The edited config.local will contain site-specific"
216                            echo "    values that should not be modified during subsequent updates to"
217                            echo "    NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
218                            echo "    directory tree, for example in /usr/local. After each NetDRMS"
219                            echo "    update, ensure this file is in place."
220 arta  1.54                 exit 1;
221 arta  1.61             endif
222                    endif
223 arta  1.73         
224                    # We now call localize.py for both Stanford and NetDRMS builds.
225                    $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams
226 arta  1.61 
227 arta  1.73         echo "Setting links to scripts..."
228                    cd scripts
229 arta  1.61 
230 arta  1.73         # Sums scripts
231                    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" \;
232 arta  1.62 
233 arta  1.73         # Util scripts
234                    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" \;
235 arta  1.62 
236                    # Export scripts
237 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" \;
238 arta  1.62 
239 arta  1.73         # DRMS / IDL-interface scripts
240                    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" \;
241 arta  1.62 
242 arta  1.73         # Project-specific scripts - these won't show up if you don't have the project source.
243                    if (-x ${LOCALIZATIONDIR}/configure) then
244                        ${LOCALIZATIONDIR}/configure
245                    endif
246 arta  1.62 
247 arta  1.73         cd ..
248                    echo "done"
249                    echo
250 arta  1.62 
251 arta  1.53         echo "Setting links to headers..."
252            
253 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.
254                    # To support legacy code, we need to make a link from serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for serverdefs.h
255                    # at Stanford) and from JSOC/base/include/localization.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for localization.h
256                    # for NetDRMs builds). However, some files are looking for JSOC/base/drms/apps/serverdefs.h (instead of JSOC/base/include, the correct path).
257                    # If we make a link from JSOC/base/drms/apps/serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h, then the script below will make links from 
258                    # JSOC/base/include/serverdefs.h and JSOC/include/serverdefs.h to JSOC/base/drms/apps/serverdefs.h, which then links to ${LOCALIZATIONDIR}/drmsparams.h.
259                    cd base/drms/apps
260                        ln -s ../../../${LOCALIZATIONDIR}/drmsparams.h serverdefs.h
261                    cd ../../..
262            
263                    cd base/include
264                        ln -s ../../../${LOCALIZATIONDIR}/drmsparams.h localization.h
265                    cd ../..
266            
267 arta  1.53         cd base/include
268                    find .. -path '../include' -prune -o -name \*.h  \( \( -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o -exec echo "  " {} " ERROR - couldn't create link" \; \)
269                    cd ../..
270            
271                    cd include
272                    if (-d ../base/include) then
273                        find ../base/include -name \*.h -exec ln -s {} . \;
274                    endif
275                    cd ..
276                    echo "done"
277                    echo
278            
279 arta  1.1      endif
280            
281 arta  1.33 

Karen Tian
Powered by
ViewCVS 0.9.4