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

Comparing configure (file contents):
Revision 1.63 by arta, Tue Feb 8 22:23:47 2011 UTC vs.
Revision 1.64 by arta, Thu Feb 17 20:11:23 2011 UTC

# Line 1 | Line 1
1   #! /bin/csh -f
2  
3 + # system configuration for configure script
4 + set PERLBIN = ""
5 +
6 + if ($PERLBIN == "") then
7 +    if (-e configsdp.txt) then
8 +        # at stanford, use
9 +        set PERLBIN = "/home/jsoc/bin/linux_x86_64/perl5.12.2"
10 +    else
11 +        set PERLBIN = "perl"
12 +    endif
13 + endif
14 +
15   # set up $JSOC_MACHINE
16   set JSOC_MACHINE = `build/jsoc_machine.csh`
17   echo "Machine type is $JSOC_MACHINE"
# Line 8 | Line 20 | echo ""
20   set CLEAN = "no"
21   set PROJCONFIG = ""
22   set CLEANCMD = "d"
11 set CONFIGCMD = "c"
12 set LOCALIZE = "L"
23  
24   set CUSTOMDEFSFILE = ""
25  
26 < foreach ARG ($argv)
27 <    set FLAG = `echo $ARG | awk '{print substr($0, 2, 1)}'`
28 <
26 > foreach THEARG ($argv)
27 >    set LITERALSTR = '{ my($argin) = "'${THEARG}'"; my($flagout); $flagout = ($argin =~ /^-(.+)/)[0]; print $flagout; }'
28 >    set FLAG = `$PERLBIN -e "$LITERALSTR"`
29 >    
30      if ($FLAG == $CLEANCMD) then
31 <      set CLEAN = "yes"
32 <    else if ($FLAG == $CONFIGCMD) then
33 <      set PROJCONFIG = `echo $ARG | awk '{print substr($0, 3)}'`
31 >        set CLEAN = "yes"
32 >    else if (-e $THEARG) then
33 >        set PROJCONFIG = $THEARG
34      endif
35   end
36  
37 + # Usage:
38 + #   configure [ -c ] [ <project config file> ]
39 +
40   # Backward compatibility - remove the links to the old make files in projconf
41   if (-d proj) then        
42      cd proj      
# Line 182 | Line 196 | endif
196  
197                  # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection
198                  # in perl. It also reads configdsp.txt (if it exists) to set the default Stanford values for certain make variables
199 <                ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}
199 >                $PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}
200  
201                  # must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables,
202                  # which are then referenced by lines in custom.mk generated by customizemake.pl.
203 <                ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
203 >                $PERLBIN ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
204              endif
205          else if (-e config.local) then
206              # config.local is optional at Stanford, but it won't necessarily contain the same information that
# Line 201 | Line 215 | endif
215              # items included in config.local to override those defined in serverdefs.h, but not all
216              # items need be specified in config.local.
217              echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk
218 <            ./customizedefs.pl
218 >            $PERLBIN ./customizedefs.pl
219  
220              set CUSTOMDEFSFILE = "base/include/customizeddefs.h"
221  
222              # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection
223              # in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables
224 <            ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}
224 >            $PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}
225  
226              # update custom.mk with data from config.local
227              # must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables,
228              # which are then referenced by lines in custom.mk generated by customizemake.pl.
229 <            ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
229 >            $PERLBIN ./customizemake.pl ./config.local ${LOCALIZATIONDIR}
230          else
231              # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection
232              # in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables
233 <            ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk
233 >            $PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk
234 >        endif
235 >
236 >        # Figure out if this is a custom checkout
237 >        set CUSTCO = "no"
238 >        set LITERALSTR = '{ open(CFG, "<'${LOCALIZATIONDIR}'/dlset.txt") || die "BAD"; my $line = <CFG>; chomp($line); print $line; }'
239 >        set CUSTCO = `$PERLBIN -e "$LITERALSTR"`
240 >
241 >        if (${CUSTCO} == "BAD") then
242 >            echo "Unable to open checkout state file ${LOCALIZATIONDIR}/dlset.txt"
243 >            exit 1
244 >        else if (${CUSTCO} == "custom") then
245 >            set CUSTCO = "yes"
246          endif
247  
248          if (${PROJCONFIG} == "") then
249 +            if (${CUSTCO} == "yes") then
250 +                echo "Must provide configuration file as an argument to this configure script"
251 +                exit 1;
252 +            endif
253              if (-e configsdp.txt) then
254                  set PROJCONFIG = configsdp.txt
255              endif
256          endif
257  
228        if (-e configsdp.txt) then
229            set PROJCONFIGEXE = "/home/jsoc/bin/linux_x86_64/perl5.12.2 configproj.pl"
230        else
231            set PROJCONFIGEXE = "configproj.pl"
232        endif
233
258          if (${PROJCONFIG} != "") then
259 <            echo "Running project configuration [${PROJCONFIGEXE} -c${PROJCONFIG} -d${LOCALIZATIONDIR}]."
260 <            ${PROJCONFIGEXE} -c${PROJCONFIG} -d${LOCALIZATIONDIR}
259 >            echo "Running project configuration [${PERLBIN} configproj.pl -c${PROJCONFIG} -d${LOCALIZATIONDIR}]."
260 >            ${PERLBIN} configproj.pl -c${PROJCONFIG} -d${LOCALIZATIONDIR}
261          endif
262  
263          echo "Setting links to scripts..."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines