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

  1 arta  1.1 #! /bin/csh -f
  2           
  3 arta  1.26 # set up $JSOC_MACHINE
  4            set JSOC_MACHINE = `build/jsoc_machine.csh`
  5            echo "Machine type is $JSOC_MACHINE"
  6            echo ""
  7 arta  1.24 
  8 arta  1.1  set CLEAN = "no"
  9            set CHKLIBS = "no"
 10            set CCMD = "c"
 11            set LCMD = "l"
 12 arta  1.51 set LOCALIZE = "L"
 13 arta  1.1  
 14            foreach ARG ($argv)
 15                set FLAG = `echo $ARG | awk '{print substr($0, 2)}'`
 16                if ($FLAG == $CCMD) then
 17                  set CLEAN = "yes"
 18                else if ($FLAG == $LCMD) then
 19                  set CHKLIBS = "yes"
 20                endif
 21            end
 22            
 23            if ($CHKLIBS == "no") then
 24 arta  1.5      echo -n "Remove links for local project configuration..."
 25 arta  1.47     if (-d proj) then
 26            	cd proj
 27            	if (-e configure) then
 28            	    rm configure
 29            	endif
 30            	if (-e make_basic.mk) then
 31            	    rm make_basic.mk
 32            	endif
 33            	if (-e Rules.mk) then
 34            	    rm Rules.mk
 35            	endif
 36            	if (-e target.mk) then
 37            	    rm target.mk
 38            	endif
 39            	cd ..
 40                endif
 41 arta  1.5      echo "done"
 42            
 43 arta  1.1      echo -n "Remove links to man pages..."
 44 arta  1.47     if (-e man) then
 45            	rm -rf man
 46                endif
 47 arta  1.1      echo "done"
 48            
 49                echo -n "Removing links to headers..."
 50 arta  1.10     if (-d base/include) then
 51 arta  1.47 	cd base/include
 52            	find . -name "*.h" -exec rm {} \;
 53            	cd ../..
 54 arta  1.1      endif
 55 arta  1.19 
 56                if (-d include) then
 57 arta  1.47 	cd include
 58            	find . -name "*.h" -exec rm {} \;
 59            	cd ..
 60 arta  1.19     endif
 61 arta  1.1      echo "done"
 62            
 63                echo -n "Removing links to scripts..."
 64                if (-d scripts) then
 65 arta  1.47 	cd scripts
 66            	find . -name "*" -exec rm {} \;
 67            	cd ..
 68 arta  1.1      endif
 69                echo "done"
 70            
 71                echo -n "Removing links to jsds..."
 72                if (-d jsds) then
 73 arta  1.47 	cd jsds
 74            	find . -name "*" -exec rm {} \;
 75            	cd ..
 76 arta  1.1      endif
 77                echo "done"
 78            
 79                echo
 80            
 81                if ($CLEAN == "yes") then
 82 arta  1.10 	if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
 83            	    base/local/libs/dsds/scripts/rmlinks.csh
 84 arta  1.1  	endif
 85            
 86 arta  1.10 	if (-x base/local/libs/soi/scripts/rmlinks.csh) then
 87            	    base/local/libs/soi/scripts/rmlinks.csh
 88 arta  1.1  	endif
 89                else
 90 arta  1.53         # Make include directories here, since they are used by multiple script blocks below
 91                    if (!(-d base/include)) then
 92                        mkdir -p base/include
 93                    endif
 94            
 95                    if (!(-d include)) then
 96                        mkdir -p include
 97                    endif
 98            
 99 arta  1.5  	echo -n "Setting links for local project configuration..."
100 arta  1.6  	if (-e suflag.txt) then
101 arta  1.10 	    cd proj
102            	    ln -sf ../projconf/su/configure configure
103            	    ln -sf ../projconf/su/make_basic.mk make_basic.mk
104            	    ln -sf ../projconf/su/Rules.mk Rules.mk
105            	    ln -sf ../projconf/su/target.mk target.mk
106            	    cd ..
107 arta  1.6  	else
108 arta  1.10 	    cd proj
109            	    ln -sf ../projconf/ex/configure configure
110            	    ln -sf ../projconf/ex/make_basic.mk make_basic.mk
111            	    ln -sf ../projconf/ex/Rules.mk Rules.mk
112            	    ln -sf ../projconf/ex/target.mk target.mk
113            	    cd ..
114 arta  1.5  	endif
115            	echo "done"
116            
117 arta  1.13 	echo "Setting links to man pages..."
118            	if (-d /home/jsoc/man) then
119            	    if (!(-e man)) then
120            		ln -s /home/jsoc/man man
121            	    endif
122            	endif
123 arta  1.1  	echo "done"
124 arta  1.52         echo
125 arta  1.1  	
126            	echo "Setting links to scripts..."
127 arta  1.47         if (!(-d scripts)) then
128            	    mkdir scripts
129            	endif
130 arta  1.1  	cd scripts
131 arta  1.3  
132            	# Sums scripts
133 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" \;
134 arta  1.3  
135            	# Util scripts
136 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" \;
137 arta  1.3  
138 arta  1.59         # Export scripts
139            	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" \;
140            
141 arta  1.9  	# DRMS / IDL-interface scripts
142 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" \;
143 arta  1.9  
144 arta  1.4  	# Project-specific scripts - these won't show up if you don't have the project source.
145 arta  1.10 	if (-x ../proj/configure) then
146            	    ../proj/configure
147 arta  1.4  	endif
148 arta  1.3  
149 arta  1.1  	cd ..
150            	echo "done"
151            	echo
152            
153            	echo "Setting links to jsds..."
154 arta  1.47 	if (!(-d jsds)) then
155            	    mkdir jsds
156            	endif
157 arta  1.1  	cd jsds
158 arta  1.10 	find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o \( -name \*.jsd -exec echo "  " {} " ERROR - couldn't create link" \; \)
159 arta  1.1  	cd ..
160            	echo "done"
161            	echo
162 arta  1.14 
163 arta  1.1  	# generate links for DSDS/SOI dynamic libraries - only do this if 
164            	# user's environment has access to /home/soi/CM
165            	if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
166 arta  1.10 	    if (-x base/local/libs/dsds/scripts/genlinks.csh) then
167            		base/local/libs/dsds/scripts/genlinks.csh
168 arta  1.1  	    endif
169            
170 arta  1.10 	    if (-x base/local/libs/soi/scripts/genlinks.csh) then
171            		base/local/libs/soi/scripts/genlinks.csh
172 arta  1.1  	    endif
173            	endif
174 arta  1.53 
175 arta  1.57 	echo "done"
176            	echo
177            
178 arta  1.53         # Site Localization
179 arta  1.57 
180                    # Path to the configuration file - at some point, make this an argument to the configure script
181 arta  1.58         set LOCALIZATIONDIR = ""
182 arta  1.57         set conflocal = "config.local"
183 arta  1.58 
184                    if (-e $conflocal) then
185                        set LOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
186                    endif
187 arta  1.57 
188                    if ($LOCALIZATIONDIR == "") then
189                        set LOCALIZATIONDIR = ${PWD}/localization
190                    endif
191            
192                    # Eventually, dump all these generated files into a user-specified location.
193                    # This script will need to read the config.local file to get the 
194                    # localization directory. Otherwise, just use JSOC/localization as the default.
195                    # We should put custom.mk in the localization directory too.
196                    if (!(-d ${LOCALIZATIONDIR})) then
197                        mkdir ${LOCALIZATIONDIR}
198                        if ($? != 0) then
199                            echo "Error creating localization directory."
200                        endif
201                    endif
202                    
203                    if (-e ${LOCALIZATIONDIR}/custom.mk) then
204                        rm ${LOCALIZATIONDIR}/custom.mk
205                    endif
206            
207                    # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection 
208 arta  1.57         # in perl. It also reads suflag.txt (if it exists) to set the default Stanford values for certain make variables
209                    ./moreconfigure.pl -f${LOCALIZATIONDIR}/custom.mk
210            
211 arta  1.53         if (!(-e suflag.txt)) then
212                        if (!(-e config.local)) then
213                            echo "Error: config.local not found. If you have a saved version of this"
214                            echo "       file from a previous installation, you should copy that into"
215                            echo "       this directory and rerun configure. Otherwise, copy the file"
216                            echo "       config.local.template to config.local and edit the config.local"
217                            echo "       file to contain site-appropriate values."
218                            echo 
219                            echo "*** IMPORTANT *** The edited config.local will contain site-specific"
220                            echo "    values that should not be modified during subsequent updates to"
221                            echo "    NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
222                            echo "    directory tree, for example in /usr/local. After each NetDRMS"
223                            echo "    update, ensure this file is in place."
224 arta  1.54                 exit 1;
225 arta  1.53             else
226 arta  1.57                 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk
227 arta  1.53                 ./gen_init.csh
228 arta  1.57                 ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
229 arta  1.53             endif
230                    else if (-e config.local) then
231                        # config.local is optional at Stanford, but it won't necessarily contain the same information that 
232                        # a NetDRMS config.local contains. The first section contains items that will override the
233                        # the items in serverdefs.h. The second section contains items used to populate custom.mk, 
234                        # which causes make systems variables to be defined that override the default make behavior
235                        # (such as overriding the name of the directory to which binary data are written - linux_x86_64_n02
236                        # instead of linux_x86_64, for example).
237            
238                        # Override the defaults defined in serverdefs.h (don't use gen_init.csh as it does several things, 
239                        # most of which are relevant only to non-SU NetDRMS sites). This script causes all 
240                        # items included in config.local to override those defined in serverdefs.h, but not all
241                        # items need be specified in config.local.
242                        ./customizedefs.pl
243 arta  1.57             echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk
244 arta  1.53 
245                        # update custom.mk with data from config.local
246 arta  1.57             ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
247 arta  1.53         endif
248            
249                    echo "Setting links to headers..."
250            
251                    cd base/include
252                    find .. -path '../include' -prune -o -name \*.h  \( \( -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o -exec echo "  " {} " ERROR - couldn't create link" \; \)
253                    cd ../..
254            
255                    cd include
256                    if (-d ../base/include) then
257                        find ../base/include -name \*.h -exec ln -s {} . \;
258                    endif
259                    cd ..
260                    echo "done"
261                    echo
262            
263 arta  1.55         # Custom make variable values - these will override the values set in moreconfigure.pl
264 arta  1.53         # echo "JSOC_COMPILER = gcc" >> custom.mk
265                    # echo "JSOC_FCOMPILER = gfortran" >> custom.mk
266 arta  1.55         # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
267 arta  1.53 
268 arta  1.1      endif
269 arta  1.53 else
270            # $CHKLIBS == "yes"
271            # Enter required library names and versions here.
272 arta  1.1  
273            
274            endif 
275 arta  1.33 

Karen Tian
Powered by
ViewCVS 0.9.4