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

Karen Tian
Powered by
ViewCVS 0.9.4