ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/configure
(Generate patch)

Comparing configure (file contents):
Revision 1.81 by arta, Wed May 7 19:02:29 2014 UTC vs.
Revision 1.82 by arta, Tue Feb 10 04:00:37 2015 UTC

# Line 25 | Line 25 | set JSOC_MACHINE = `build/jsoc_machine.c
25   echo "Machine type is $JSOC_MACHINE"
26   echo ""
27  
28 < set CLEAN = "no"
28 > # Clean by default.
29 > set CLEAN = "yes"
30   set PROJCONFIG = ""
31   set CLEANCMD = "d"
32   set CFGSERVER = "no"
# Line 37 | Line 38 | foreach THEARG ($argv)
38      set FLAG = `$PERLBIN -e "$LITERALSTR"`
39      
40      if ($FLAG == $CLEANCMD) then
41 <        set CLEAN = "yes"
41 >        set CLEAN = "no"
42      else if ($FLAG == $CFGSERVERARG) then
43          set CFGSERVER = "yes"
44      else if (-e $THEARG) then
# Line 46 | Line 47 | foreach THEARG ($argv)
47   end
48  
49   # Usage:
50 < #   configure [ -c ] [ <project config file> ]
50 > #   configure [ -d ] [ -s ] [ <project config file> ]
51  
52   # Backward compatibility - remove the links to the old make files in projconf
53   if (-d proj) then        
# Line 66 | Line 67 | if (-d proj) then
67      cd ..        
68   endif
69  
70 <    echo -n "Remove links to man pages..."
70 >    # Always clean up links to man pages and re-create them.
71 >    echo -n "Removing links to man pages..."
72      if (-e man) then
73          rm -rf man
74      endif
75      echo "done"
76  
77 <    echo -n "Removing links to headers..."
78 <    if (-d base/include) then
79 <        cd base/include
80 <        find . -name "*.h" -exec rm {} \;
81 <        cd ../..
82 <
83 <    # Special link from base/drms/apps/serverdefs.h to localization/drmsparams.h
84 <    cd base/drms/apps
85 <    rm serverdefs.h
84 <    cd ../../..
77 >    if ($CLEAN == "yes") then
78 >        echo -n "Removing links in base/include to headers..."
79 >        # Links in base/include
80 >        if (-d base/include) then
81 >            cd base/include
82 >            find . -name "*.h" -exec rm {} \;
83 >            cd ../..
84 >        endif
85 >        echo "done"
86  
87 <    endif
87 >        # Special link from base/drms/apps/serverdefs.h to localization/drmsparams.h
88 >        echo -n "Removing link to serverdefs.h..."
89 >        if (-e base/drms/apps) then
90 >            cd base/drms/apps
91 >            rm serverdefs.h
92 >            cd ../../..
93 >        endif
94 >        echo "done"
95  
96 <    if (-d include) then
97 <        cd include
98 <        find . -name "*.h" -exec rm {} \;
99 <        find . -name "drmsparams*" -exec rm {} \;
100 <        cd ..
101 <    endif
102 <    echo "done"
96 >        # Links in include
97 >        echo -n "Removing links in include to headers..."
98 >        if (-d include) then
99 >            cd include
100 >            find . -name "*.h" -exec rm {} \;
101 >            find . -name "drmsparams*" -exec rm {} \;
102 >            cd ..
103 >        endif
104 >        echo "done"
105  
106 <    echo -n "Removing links to scripts..."
107 <    if (-d scripts) then
108 <        cd scripts
109 <        if ($? == 0) then
110 <            find . -type l -exec rm {} \;
106 >        echo -n "Removing links to scripts..."
107 >        # Links in scripts
108 >        if (-d scripts) then
109 >            cd scripts
110 >            if ($? == 0) then
111 >                find . -type l -exec rm {} \;
112 >            endif
113 >            cd ..
114          endif
115 <        cd ..
115 >        echo "done"
116 >    # End clean flag
117      endif
104    echo "done"
118  
119 +    # Always clean-up links to jsds and re-create them.
120      echo -n "Removing links to jsds..."
121      if (-d jsds) then
122          cd jsds
# Line 122 | Line 136 | endif
136          if (-x base/local/libs/soi/scripts/rmlinks.csh) then
137              base/local/libs/soi/scripts/rmlinks.csh
138          endif
139 <    else
126 <        # Make include directories here, since they are used by multiple script blocks below
127 <        if (!(-d base/include)) then
128 <            mkdir -p base/include
129 <        endif
139 >    endif
140  
141 <        if (!(-d include)) then
142 <            mkdir -p include
143 <        endif
141 >    # Make include directories here, since they are used by multiple script blocks below
142 >    if (!(-d base/include)) then
143 >        mkdir -p base/include
144 >    endif
145  
146 <        echo "Setting links to man pages..."
147 <        if (-d /home/jsoc/man) then
148 <            if (!(-e man)) then
149 <                ln -s /home/jsoc/man man
150 <            endif
146 >    if (!(-d include)) then
147 >        mkdir -p include
148 >    endif
149 >
150 >    echo "Setting links to man pages..."
151 >    if (-d /home/jsoc/man) then
152 >       if (!(-e man)) then
153 >            ln -s /home/jsoc/man man
154          endif
155 <        echo "done"
156 <        echo
155 >    endif
156 >    echo "done"
157 >    echo
158          
159 <        echo "Setting links to jsds..."
160 <        if (!(-d jsds)) then
161 <            mkdir jsds
162 <        endif
163 <        cd jsds
164 <        find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o \( -name \*.jsd -exec echo "  " {} " ERROR - couldn't create link" \; \)
165 <        cd ..
166 <        echo "done"
167 <        echo
159 >    echo "Setting links to jsds..."
160 >    if (!(-d jsds)) then
161 >        mkdir jsds
162 >    endif
163 >    cd jsds
164 >    find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o \( -name \*.jsd -exec echo "  " {} " ERROR - couldn't create link" \; \)
165 >    cd ..
166 >    echo "done"
167 >    echo
168  
169 <        # generate links for DSDS/SOI dynamic libraries - only do this if
170 <        # user's environment has access to /home/soi/CM
171 <        if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
172 <            if (-x base/local/libs/dsds/scripts/genlinks.csh) then
173 <                base/local/libs/dsds/scripts/genlinks.csh
174 <            endif
160 <
161 <            if (-x base/local/libs/soi/scripts/genlinks.csh) then
162 <                base/local/libs/soi/scripts/genlinks.csh
163 <            endif
164 <        endif
169 >    # generate links for DSDS/SOI dynamic libraries - only do this if
170 >    # user's environment has access to /home/soi/CM
171 >    if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
172 >        if (-x base/local/libs/dsds/scripts/genlinks.csh) then
173 >            base/local/libs/dsds/scripts/genlinks.csh
174 >        endif
175  
176 <        echo "done"
177 <        echo
176 >        if (-x base/local/libs/soi/scripts/genlinks.csh) then
177 >            base/local/libs/soi/scripts/genlinks.csh
178 >        endif
179 >    endif
180  
181 <        # Site Localization
181 >    echo "done"
182 >    echo
183  
184 <        # Path to the configuration file - at some point, make this an argument to the configure script
172 <        set LOCALIZATIONDIR = ""
173 <        set RELLOCALIZATIONDIR = ""
174 <        set conflocal = "config.local"
184 >    # Site Localization
185  
186 <        if (-e $conflocal) then
187 <            set RELLOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
188 <        endif
186 >    # Path to the configuration file - at some point, make this an argument to the configure script
187 >    set LOCALIZATIONDIR = ""
188 >    set RELLOCALIZATIONDIR = ""
189 >    set conflocal = "config.local"
190  
191 <        if ($LOCALIZATIONDIR == "") then
192 <            set RELLOCALIZATIONDIR = localization
193 <        endif
191 >    if (-e $conflocal) then
192 >        set RELLOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
193 >    endif
194  
195 <        # Make the path absoluate
196 <        set LOCALIZATIONDIR = ${PWD}/${RELLOCALIZATIONDIR}
195 >    if ($LOCALIZATIONDIR == "") then
196 >        set RELLOCALIZATIONDIR = localization
197 >    endif
198  
199 <        # Eventually, dump all these generated files into a user-specified location.
200 <        # This script will need to read the config.local file to get the
189 <        # localization directory. Otherwise, just use JSOC/localization as the default.
190 <        if (!(-d ${LOCALIZATIONDIR})) then
191 <            mkdir ${LOCALIZATIONDIR}
192 <            if ($? != 0) then
193 <                echo "Error creating localization directory."
194 <            endif
195 <        endif
199 >    # Make the path absoluate
200 >    set LOCALIZATIONDIR = ${PWD}/${RELLOCALIZATIONDIR}
201  
202 <        if (-e ${LOCALIZATIONDIR}/drmsparams.h) then
203 <            rm ${LOCALIZATIONDIR}/drmsparams.h
202 >    # Eventually, dump all these generated files into a user-specified location.
203 >    # This script will need to read the config.local file to get the
204 >    # localization directory. Otherwise, just use JSOC/localization as the default.
205 >    if (!(-d ${LOCALIZATIONDIR})) then
206 >        mkdir ${LOCALIZATIONDIR}
207 >        if ($? != 0) then
208 >            echo "Error creating localization directory."
209          endif
210 +    endif
211  
212 <        if (-e ${LOCALIZATIONDIR}/drmsparams.mk) then
213 <            rm ${LOCALIZATIONDIR}/drmsparams.mk
214 <        endif
212 >    if (-e ${LOCALIZATIONDIR}/drmsparams.h) then
213 >        rm ${LOCALIZATIONDIR}/drmsparams.h
214 >    endif
215  
216 <        if (-e ${LOCALIZATIONDIR}/drmsparams.pm) then
217 <            rm ${LOCALIZATIONDIR}/drmsparams.pm
218 <        endif
216 >    if (-e ${LOCALIZATIONDIR}/drmsparams.mk) then
217 >        rm ${LOCALIZATIONDIR}/drmsparams.mk
218 >    endif
219  
220 <        if (-e ${LOCALIZATIONDIR}/drmsparams.py) then
221 <            rm ${LOCALIZATIONDIR}/drmsparams.py
222 <        endif
220 >    if (-e ${LOCALIZATIONDIR}/drmsparams.pm) then
221 >        rm ${LOCALIZATIONDIR}/drmsparams.pm
222 >    endif
223  
224 +    if (-e ${LOCALIZATIONDIR}/drmsparams.py) then
225 +        rm ${LOCALIZATIONDIR}/drmsparams.py
226 +    endif
227  
228 <        # Must create the scripts subdirectory before the call to gen_init.csh
229 <        if (!(-d scripts)) then
230 <            mkdir scripts
231 <        endif
228 >    # Must create the scripts subdirectory before the call to gen_init.csh
229 >    if (!(-d scripts)) then
230 >        mkdir scripts
231 >    endif
232  
233 <        if (!(-e configsdp.txt)) then
234 <            # This is NetDRMS.
235 <            if (!(-e config.local)) then
236 <                echo "Error: config.local not found. If you have a saved version of this"
237 <                echo "       file from a previous installation, you should copy that into"
238 <                echo "       this directory and rerun configure. Otherwise, copy the file"
239 <                echo "       config.local.template to config.local and edit the config.local"
240 <                echo "       file to contain site-appropriate values."
241 <                echo
242 <                echo "*** IMPORTANT *** The edited config.local will contain site-specific"
243 <                echo "    values that should not be modified during subsequent updates to"
244 <                echo "    NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
245 <                echo "    directory tree, for example in /usr/local. After each NetDRMS"
246 <                echo "    update, ensure this file is in place."
247 <                exit 1;
234 <            endif
233 >    if (!(-e configsdp.txt)) then
234 >        # This is NetDRMS.
235 >        if (!(-e config.local)) then
236 >            echo "Error: config.local not found. If you have a saved version of this"
237 >            echo "       file from a previous installation, you should copy that into"
238 >            echo "       this directory and rerun configure. Otherwise, copy the file"
239 >            echo "       config.local.template to config.local and edit the config.local"
240 >            echo "       file to contain site-appropriate values."
241 >            echo
242 >            echo "*** IMPORTANT *** The edited config.local will contain site-specific"
243 >            echo "    values that should not be modified during subsequent updates to"
244 >            echo "    NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
245 >            echo "    directory tree, for example in /usr/local. After each NetDRMS"
246 >            echo "    update, ensure this file is in place."
247 >            exit 1;
248          endif
249 +    endif
250          
251 <        # We now call localize.py for both Stanford and NetDRMS builds.
252 <        if ($CFGSERVER == "yes") then
253 <            $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams -s
254 <        else
255 <            $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams
256 <        endif
251 >    # We now call localize.py for both Stanford and NetDRMS builds.
252 >    if ($CFGSERVER == "yes") then
253 >        $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams -s
254 >    else
255 >        $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams
256 >    endif
257  
258 <        echo "Setting links to scripts..."
259 <        cd scripts
258 >    echo "Setting links to scripts..."
259 >    cd scripts
260  
261 <        # Sums scripts
262 <        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" \;
261 >    # Sums scripts
262 >    find ../base/sums/scripts -mindepth 1 -path \*CVS -prune -o -print | ${PERLBIN} -MFile::Basename -n -e 'my($bn) = basename($_); chomp($bn); my($path) = $_; chomp($path); if (!(-e $bn)) { `ln -s $_`; if ($? >> 8 == 0) { print "   " . $path . " OK\n"; } else { print "   " . $path . " ERROR - could not create link\n"; } }'
263  
264 <        # Util scripts
265 <        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" \;
264 >    # Util scripts
265 >    find ../base/util/scripts -mindepth 1 -path \*CVS -prune -o -print | ${PERLBIN} -MFile::Basename -n -e 'my($bn) = basename($_); chomp($bn); my($path) = $_; chomp($path); if (!(-e $bn)) { `ln -s $_`; if ($? >> 8 == 0) { print "   " . $path . " OK\n"; } else { print "   " . $path . " ERROR - could not create link\n"; } }'
266  
267 <        # Export scripts
268 <        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" \;
267 >    # Export scripts
268 >    find ../base/export/scripts -mindepth 1 -path \*CVS -prune -o -print | ${PERLBIN} -MFile::Basename -n -e 'my($bn) = basename($_); chomp($bn); my($path) = $_; chomp($path); if (!(-e $bn)) { `ln -s $_`; if ($? >> 8 == 0) { print "   " . $path . " OK\n"; } else { print "   " . $path . " ERROR - could not create link\n"; } }'
269  
270 <        # DRMS / IDL-interface scripts
271 <        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" \;
270 >    # DRMS / IDL-interface scripts
271 >    find ../base/drms/scripts -mindepth 1 -path \*CVS -prune -o -print | ${PERLBIN} -MFile::Basename -n -e 'my($bn) = basename($_); chomp($bn); my($path) = $_; chomp($path); if (!(-e $bn)) { `ln -s $_`; if ($? >> 8 == 0) { print "   " . $path . " OK\n"; } else { print "   " . $path . " ERROR - could not create link\n"; } }'
272  
273 <        # Project-specific scripts - these won't show up if you don't have the project source.
274 <        if (-x ${LOCALIZATIONDIR}/configure) then
275 <            ${LOCALIZATIONDIR}/configure
276 <        endif
273 >    # Project-specific scripts - these won't show up if you don't have the project source.
274 >    if (-x ${LOCALIZATIONDIR}/configure) then
275 >        ${LOCALIZATIONDIR}/configure
276 >    endif
277  
278 <        cd ..
279 <        echo "done"
280 <        echo
278 >    cd ..
279 >    echo "done"
280 >    echo
281  
282 <        echo "Setting links to headers..."
282 >    echo "Setting links to headers..."
283  
284 <        # When localize.py was added, we removed the repository version of serverdefs.h, and we stopped generating JSOC/base/include/localization.h.
285 <        # To support legacy code, we need to make a link from serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for serverdefs.h
286 <        # at Stanford) and from JSOC/base/include/localization.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for localization.h
287 <        # for NetDRMs builds). However, some files are looking for JSOC/base/drms/apps/serverdefs.h (instead of JSOC/base/include, the correct path).
288 <        # If we make a link from JSOC/base/drms/apps/serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h, then the script below will make links from
289 <        # JSOC/base/include/serverdefs.h and JSOC/include/serverdefs.h to JSOC/base/drms/apps/serverdefs.h, which then links to ${LOCALIZATIONDIR}/drmsparams.h.
284 >    # When localize.py was added, we removed the repository version of serverdefs.h, and we stopped generating JSOC/base/include/localization.h.
285 >    # To support legacy code, we need to make a link from serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for serverdefs.h
286 >    # at Stanford) and from JSOC/base/include/localization.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for localization.h
287 >    # for NetDRMs builds). However, some files are looking for JSOC/base/drms/apps/serverdefs.h (instead of JSOC/base/include, the correct path).
288 >    # If we make a link from JSOC/base/drms/apps/serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h, then the script below will make links from
289 >    # JSOC/base/include/serverdefs.h and JSOC/include/serverdefs.h to JSOC/base/drms/apps/serverdefs.h, which then links to ${LOCALIZATIONDIR}/drmsparams.h.
290 >    if (!(-l base/drms/apps/serverdefs.h)) then
291          cd base/drms/apps
292 <            ln -s ../../../${RELLOCALIZATIONDIR}/drmsparams.h serverdefs.h
292 >        ln -s ../../../${RELLOCALIZATIONDIR}/drmsparams.h serverdefs.h
293          cd ../../..
294 +    endif
295  
296 +    if (!(-l base/include/localization.h)) then
297          cd base/include
298 <            ln -s ../../${RELLOCALIZATIONDIR}/drmsparams.h localization.h
282 <        cd ../..
283 <
284 <        cd base/include
285 <        find .. -path '../include' -prune -o -name \*.h  \( \( -exec ln -s {} . \; -a -exec echo "  " {} " OK" \; \) -o -exec echo "  " {} " ERROR - couldn't create link" \; \)
298 >        ln -s ../../${RELLOCALIZATIONDIR}/drmsparams.h localization.h
299          cd ../..
300 +    endif
301  
302 <        cd include
303 <        if (-d ../base/include) then
304 <            find ../base/include -name \*.h -exec ln -s {} . \;
305 <        endif
302 >    cd base/include
303 >    find .. -path '../include' -prune -o -name \*.h -print | ${PERLBIN} -MFile::Basename -n -e 'my($bn) = basename($_); chomp($bn); my($path) = $_; chomp($path); if (!(-e $bn)) { `ln -s $_`; if ($? >> 8 == 0) { print "   " . $path . " OK\n"; } else { print "   " . $path . " ERROR - could not create link\n"; } }'
304 >    cd ../..
305 >
306 >    cd include
307 >    if (-d ../base/include) then
308 >        find ../base/include -name \*.h -print | ${PERLBIN} -MFile::Basename -n -e 'my($bn) = basename($_); chomp($bn); my($path) = $_; chomp($path); if (!(-e $bn)) { `ln -s $_`; if ($? >> 8 == 0) { print "   " . $path . " OK\n"; } else { print "   " . $path . " ERROR - could not create link\n"; } }'
309 >    endif
310  
311 <        # ${LOCALIZATIONDIR} is an absolute path
311 >    # ${LOCALIZATIONDIR} is an absolute path
312 >    if (!(-l drmsparams.h)) then
313          ln -s ../${RELLOCALIZATIONDIR}/drmsparams.h
314 +    endif
315 +    if (!(-l drmsparams.pm)) then
316          ln -s ../${RELLOCALIZATIONDIR}/drmsparams.pm
317 +    endif
318 +    if (!(-l drmsparams.py)) then
319          ln -s ../${RELLOCALIZATIONDIR}/drmsparams.py
297
298        cd ..
299        echo "done"
300        echo
301
320      endif
321  
322 <
322 >    cd ..
323 >    echo "done"
324 >    echo

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines