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

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

Karen Tian
Powered by
ViewCVS 0.9.4