version 1.63, 2011/02/08 22:23:47
|
version 1.65, 2011/02/17 23:15:55
|
|
|
#! /bin/csh -f | #! /bin/csh -f |
| |
|
# system configuration for configure script |
|
set PERLBIN = "" |
|
|
|
if ($PERLBIN == "") then |
|
if (-e configsdp.txt) then |
|
# at stanford, use |
|
set PERLBIN = "/home/jsoc/bin/linux_x86_64/perl5.12.2" |
|
else |
|
set PERLBIN = "perl" |
|
endif |
|
endif |
|
|
# set up $JSOC_MACHINE | # set up $JSOC_MACHINE |
set JSOC_MACHINE = `build/jsoc_machine.csh` | set JSOC_MACHINE = `build/jsoc_machine.csh` |
echo "Machine type is $JSOC_MACHINE" | echo "Machine type is $JSOC_MACHINE" |
|
|
set CLEAN = "no" | set CLEAN = "no" |
set PROJCONFIG = "" | set PROJCONFIG = "" |
set CLEANCMD = "d" | set CLEANCMD = "d" |
set CONFIGCMD = "c" |
|
set LOCALIZE = "L" |
|
| |
set CUSTOMDEFSFILE = "" | set CUSTOMDEFSFILE = "" |
| |
foreach ARG ($argv) |
foreach THEARG ($argv) |
set FLAG = `echo $ARG | awk '{print substr($0, 2, 1)}'` |
set LITERALSTR = '{ my($argin) = "'${THEARG}'"; my($flagout); $flagout = ($argin =~ /^-(.+)/)[0]; print $flagout; }' |
|
set FLAG = `$PERLBIN -e "$LITERALSTR"` |
| |
if ($FLAG == $CLEANCMD) then | if ($FLAG == $CLEANCMD) then |
set CLEAN = "yes" | set CLEAN = "yes" |
else if ($FLAG == $CONFIGCMD) then |
else if (-e $THEARG) then |
set PROJCONFIG = `echo $ARG | awk '{print substr($0, 3)}'` |
set PROJCONFIG = $THEARG |
endif | endif |
end | end |
| |
|
# Usage: |
|
# configure [ -c ] [ <project config file> ] |
|
|
# Backward compatibility - remove the links to the old make files in projconf | # Backward compatibility - remove the links to the old make files in projconf |
if (-d proj) then | if (-d proj) then |
cd proj | cd proj |
|
|
rm ${LOCALIZATIONDIR}/custom.mk | rm ${LOCALIZATIONDIR}/custom.mk |
endif | endif |
| |
|
# Must create the scripts subdirectory before the call to gen_init.csh |
|
if (!(-d scripts)) then |
|
mkdir scripts |
|
endif |
|
|
if (!(-e configsdp.txt)) then | if (!(-e configsdp.txt)) then |
if (!(-e config.local)) then | if (!(-e config.local)) then |
echo "Error: config.local not found. If you have a saved version of this" | echo "Error: config.local not found. If you have a saved version of this" |
|
|
| |
# run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection | # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection |
# in perl. It also reads configdsp.txt (if it exists) to set the default Stanford values for certain make variables | # in perl. It also reads configdsp.txt (if it exists) to set the default Stanford values for certain make variables |
./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE} |
$PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE} |
| |
# must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables, | # must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables, |
# which are then referenced by lines in custom.mk generated by customizemake.pl. | # which are then referenced by lines in custom.mk generated by customizemake.pl. |
./customizemake.pl ./config.local ${LOCALIZATIONDIR} |
$PERLBIN ./customizemake.pl ./config.local ${LOCALIZATIONDIR} |
endif | endif |
else if (-e config.local) then | else if (-e config.local) then |
# config.local is optional at Stanford, but it won't necessarily contain the same information that | # config.local is optional at Stanford, but it won't necessarily contain the same information that |
|
|
# items included in config.local to override those defined in serverdefs.h, but not all | # items included in config.local to override those defined in serverdefs.h, but not all |
# items need be specified in config.local. | # items need be specified in config.local. |
echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk | echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk |
./customizedefs.pl |
$PERLBIN ./customizedefs.pl |
| |
set CUSTOMDEFSFILE = "base/include/customizeddefs.h" | set CUSTOMDEFSFILE = "base/include/customizeddefs.h" |
| |
# run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection | # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection |
# in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables | # in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables |
./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE} |
$PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE} |
| |
# update custom.mk with data from config.local | # update custom.mk with data from config.local |
# must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables, | # must follow moreconfigure.pl, because moreconfigure.pl will possibly set the compiler make variables, |
# which are then referenced by lines in custom.mk generated by customizemake.pl. | # which are then referenced by lines in custom.mk generated by customizemake.pl. |
./customizemake.pl ./config.local ${LOCALIZATIONDIR} |
$PERLBIN ./customizemake.pl ./config.local ${LOCALIZATIONDIR} |
else | else |
# run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection | # run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection |
# in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables | # in perl. It also reads configsdp.txt (if it exists) to set the default Stanford values for certain make variables |
./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk |
$PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk |
|
endif |
|
|
|
# Figure out if this is a custom checkout |
|
set CUSTCO = "no" |
|
set LITERALSTR = '{ open(CFG, "<'${LOCALIZATIONDIR}'/dlset.txt") || die "BAD"; my $line = <CFG>; chomp($line); print $line; }' |
|
set CUSTCO = `$PERLBIN -e "$LITERALSTR"` |
|
|
|
if (${CUSTCO} == "BAD") then |
|
echo "Unable to open checkout state file ${LOCALIZATIONDIR}/dlset.txt" |
|
exit 1 |
|
else if (${CUSTCO} == "custom") then |
|
set CUSTCO = "yes" |
endif | endif |
| |
if (${PROJCONFIG} == "") then | if (${PROJCONFIG} == "") then |
|
if (${CUSTCO} == "yes") then |
|
echo "Must provide configuration file as an argument to this configure script" |
|
exit 1; |
|
endif |
if (-e configsdp.txt) then | if (-e configsdp.txt) then |
set PROJCONFIG = configsdp.txt | set PROJCONFIG = configsdp.txt |
endif | endif |
endif | endif |
| |
if (-e configsdp.txt) then |
|
set PROJCONFIGEXE = "/home/jsoc/bin/linux_x86_64/perl5.12.2 configproj.pl" |
|
else |
|
set PROJCONFIGEXE = "configproj.pl" |
|
endif |
|
|
|
if (${PROJCONFIG} != "") then | if (${PROJCONFIG} != "") then |
echo "Running project configuration [${PROJCONFIGEXE} -c${PROJCONFIG} -d${LOCALIZATIONDIR}]." |
echo "Running project configuration [${PERLBIN} configproj.pl -c${PROJCONFIG} -d${LOCALIZATIONDIR}]." |
${PROJCONFIGEXE} -c${PROJCONFIG} -d${LOCALIZATIONDIR} |
${PERLBIN} configproj.pl -c${PROJCONFIG} -d${LOCALIZATIONDIR} |
endif | endif |
| |
echo "Setting links to scripts..." | echo "Setting links to scripts..." |
if (!(-d scripts)) then |
|
mkdir scripts |
|
endif |
|
cd scripts | cd scripts |
| |
# Sums scripts | # Sums scripts |