(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.9  	# DRMS / IDL-interface scripts
139 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" \;
140 arta  1.9  
141 arta  1.4  	# Project-specific scripts - these won't show up if you don't have the project source.
142 arta  1.10 	if (-x ../proj/configure) then
143            	    ../proj/configure
144 arta  1.4  	endif
145 arta  1.3  
146 arta  1.1  	cd ..
147            	echo "done"
148            	echo
149            
150            	echo "Setting links to jsds..."
151 arta  1.47 	if (!(-d jsds)) then
152            	    mkdir jsds
153            	endif
154 arta  1.1  	cd jsds
155 arta  1.10 	find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o \( -name \*.jsd -exec echo "  " {} " ERROR - couldn't create link" \; \)
156 arta  1.1  	cd ..
157            	echo "done"
158            	echo
159 arta  1.14 
160 arta  1.1  	# generate links for DSDS/SOI dynamic libraries - only do this if 
161            	# user's environment has access to /home/soi/CM
162            	if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
163 arta  1.10 	    if (-x base/local/libs/dsds/scripts/genlinks.csh) then
164            		base/local/libs/dsds/scripts/genlinks.csh
165 arta  1.1  	    endif
166            
167 arta  1.10 	    if (-x base/local/libs/soi/scripts/genlinks.csh) then
168            		base/local/libs/soi/scripts/genlinks.csh
169 arta  1.1  	    endif
170            	endif
171 arta  1.53 
172 arta  1.57 	echo "done"
173            	echo
174            
175 arta  1.53         # Site Localization
176 arta  1.57 
177                    # Path to the configuration file - at some point, make this an argument to the configure script
178                    set conflocal = "config.local"
179                    set LOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
180            
181                    if ($LOCALIZATIONDIR == "") then
182                        set LOCALIZATIONDIR = ${PWD}/localization
183                    endif
184            
185                    # Eventually, dump all these generated files into a user-specified location.
186                    # This script will need to read the config.local file to get the 
187                    # localization directory. Otherwise, just use JSOC/localization as the default.
188                    # We should put custom.mk in the localization directory too.
189                    if (!(-d ${LOCALIZATIONDIR})) then
190                        mkdir ${LOCALIZATIONDIR}
191                        if ($? != 0) then
192                            echo "Error creating localization directory."
193                        endif
194                    endif
195                    
196                    if (-e ${LOCALIZATIONDIR}/custom.mk) then
197 arta  1.57             rm ${LOCALIZATIONDIR}/custom.mk
198                    endif
199            
200                    # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection 
201                    # in perl. It also reads suflag.txt (if it exists) to set the default Stanford values for certain make variables
202                    ./moreconfigure.pl -f${LOCALIZATIONDIR}/custom.mk
203            
204 arta  1.53         if (!(-e suflag.txt)) then
205                        if (!(-e config.local)) then
206                            echo "Error: config.local not found. If you have a saved version of this"
207                            echo "       file from a previous installation, you should copy that into"
208                            echo "       this directory and rerun configure. Otherwise, copy the file"
209                            echo "       config.local.template to config.local and edit the config.local"
210                            echo "       file to contain site-appropriate values."
211                            echo 
212                            echo "*** IMPORTANT *** The edited config.local will contain site-specific"
213                            echo "    values that should not be modified during subsequent updates to"
214                            echo "    NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
215                            echo "    directory tree, for example in /usr/local. After each NetDRMS"
216                            echo "    update, ensure this file is in place."
217 arta  1.54                 exit 1;
218 arta  1.53             else
219 arta  1.57                 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk
220 arta  1.53                 ./gen_init.csh
221 arta  1.57                 ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
222 arta  1.53             endif
223                    else if (-e config.local) then
224                        # config.local is optional at Stanford, but it won't necessarily contain the same information that 
225                        # a NetDRMS config.local contains. The first section contains items that will override the
226                        # the items in serverdefs.h. The second section contains items used to populate custom.mk, 
227                        # which causes make systems variables to be defined that override the default make behavior
228                        # (such as overriding the name of the directory to which binary data are written - linux_x86_64_n02
229                        # instead of linux_x86_64, for example).
230            
231                        # Override the defaults defined in serverdefs.h (don't use gen_init.csh as it does several things, 
232                        # most of which are relevant only to non-SU NetDRMS sites). This script causes all 
233                        # items included in config.local to override those defined in serverdefs.h, but not all
234                        # items need be specified in config.local.
235                        ./customizedefs.pl
236 arta  1.57             echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk
237 arta  1.53 
238                        # update custom.mk with data from config.local
239 arta  1.57             ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
240 arta  1.53         endif
241            
242                    echo "Setting links to headers..."
243            
244                    cd base/include
245                    find .. -path '../include' -prune -o -name \*.h  \( \( -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o -exec echo "  " {} " ERROR - couldn't create link" \; \)
246                    cd ../..
247            
248                    cd include
249                    if (-d ../base/include) then
250                        find ../base/include -name \*.h -exec ln -s {} . \;
251                    endif
252                    cd ..
253                    echo "done"
254                    echo
255            
256 arta  1.55         # Custom make variable values - these will override the values set in moreconfigure.pl
257 arta  1.53         # echo "JSOC_COMPILER = gcc" >> custom.mk
258                    # echo "JSOC_FCOMPILER = gfortran" >> custom.mk
259 arta  1.55         # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
260 arta  1.53 
261 arta  1.1      endif
262 arta  1.53 else
263            # $CHKLIBS == "yes"
264            # Enter required library names and versions here.
265 arta  1.1  
266            
267            endif 
268 arta  1.33 

Karen Tian
Powered by
ViewCVS 0.9.4