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

  1 arta  1.1 #! /bin/csh -f
  2           
  3 arta  1.48 rm custom.mk
  4            
  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                    if (-e suflag.txt) then           
163                        # Stanford third-party libraries
164                        echo 'POSTGRES_LIB = pq' >> custom.mk
165                        echo 'CFITSIO_LIB = cfitsio' >> custom.mk
166            
167 arta  1.52             echo 'ifeq ($(JSOC_MACHINE), linux_x86_64)' >> custom.mk
168 arta  1.51             echo '  POSTGRES_INCS = /usr/include' >> custom.mk
169                        echo '  POSTGRES_LIBS = /usr/lib64' >> custom.mk
170                        echo '  CFITSIO_INCS = /home/jsoc/include' >> custom.mk
171                        echo '  CFITSIO_LIBS = /home/jsoc/lib/linux-x86_64' >> custom.mk
172                        echo 'endif' >> custom.mk
173            
174 arta  1.52             echo 'ifeq ($(JSOC_MACHINE), linux_ia32)' >> custom.mk
175 arta  1.51             echo '  POSTGRES_INCS = /usr/include' >> custom.mk
176                        echo '  POSTGRES_LIBS = /usr/lib' >> custom.mk
177                        echo '  CFITSIO_INCS = /home/jsoc/include' >> custom.mk
178                        echo '  CFITSIO_LIBS = /home/jsoc/lib/linux-ia32' >> custom.mk
179                        echo 'endif' >> custom.mk
180            
181                        # Set custom make file to tell the make system that the gcc cfitsio library is called
182                        # libcfitsio_gcc.a
183                        echo 'ifeq ($(COMPILER), gcc)' >> custom.mk
184                        echo '  ifeq ($(JSOC_MACHINE), linux_x86_64)' >> custom.mk
185                        echo '    CFITSIO_LIB = cfitsio_gcc' >> custom.mk
186                        echo '  endif' >> custom.mk
187                        echo 'endif' >> custom.mk
188 arta  1.31         endif
189            
190 arta  1.32         # Make customizations - ensure changes here are synchronized to changes in make_basic.mk
191                    if (!(-e suflag.txt)) then
192                        # put compilation customizations here
193                        # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
194                    endif
195            
196 arta  1.14 	echo "done"
197            	echo
198            
199 arta  1.1  	# generate links for DSDS/SOI dynamic libraries - only do this if 
200            	# user's environment has access to /home/soi/CM
201            	if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
202 arta  1.10 	    if (-x base/local/libs/dsds/scripts/genlinks.csh) then
203            		base/local/libs/dsds/scripts/genlinks.csh
204 arta  1.1  	    endif
205            
206 arta  1.10 	    if (-x base/local/libs/soi/scripts/genlinks.csh) then
207            		base/local/libs/soi/scripts/genlinks.csh
208 arta  1.1  	    endif
209            	endif
210 arta  1.53 
211                    # Site Localization
212                    if (!(-e suflag.txt)) then
213                        if (!(-e config.local)) then
214                            echo "Error: config.local not found. If you have a saved version of this"
215                            echo "       file from a previous installation, you should copy that into"
216                            echo "       this directory and rerun configure. Otherwise, copy the file"
217                            echo "       config.local.template to config.local and edit the config.local"
218                            echo "       file to contain site-appropriate values."
219                            echo 
220                            echo "*** IMPORTANT *** The edited config.local will contain site-specific"
221                            echo "    values that should not be modified during subsequent updates to"
222                            echo "    NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
223                            echo "    directory tree, for example in /usr/local. After each NetDRMS"
224                            echo "    update, ensure this file is in place."
225                        else
226                            echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> custom.mk
227                            ./gen_init.csh
228                            ./customizemake.pl
229                        endif
230                    else if (-e config.local) then
231 arta  1.53             # 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                        echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> custom.mk
244            
245                        # update custom.mk with data from config.local
246                        ./customizemake.pl
247                    endif
248            
249                    echo "Setting links to headers..."
250            
251                    cd base/include
252 arta  1.53         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                    # Customize compilers
264                    # echo "JSOC_COMPILER = gcc" >> custom.mk
265                    # echo "JSOC_FCOMPILER = gfortran" >> custom.mk
266            
267                    # run perl script to do even more configuration
268                    ./moreconfigure.pl -fcustom.mk
269 arta  1.1      endif
270 arta  1.53 else
271            # $CHKLIBS == "yes"
272            # Enter required library names and versions here.
273 arta  1.1  
274            
275            endif 
276 arta  1.33 

Karen Tian
Powered by
ViewCVS 0.9.4