version 1.59, 2011/01/10 20:57:51
|
version 1.73, 2013/11/15 17:05:49
|
|
|
#! /bin/csh -f | #! /bin/csh -f |
| |
|
# system configuration for configure script |
|
set PERLBIN = "" |
|
set PYBIN = "" |
|
|
|
if ($PERLBIN == "") then |
|
if (-e configsdp.txt) then |
|
# at stanford, use |
|
set PERLBIN = "/home/jsoc/bin/linux_x86_64/activeperl" |
|
set PYBIN = "/home/jsoc/bin/linux_x86_64/activepython" |
|
else |
|
set PERLBIN = "perl" |
|
set PYBIN = "python" |
|
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" |
echo "" | echo "" |
| |
set CLEAN = "no" | set CLEAN = "no" |
set CHKLIBS = "no" |
set PROJCONFIG = "" |
set CCMD = "c" |
set CLEANCMD = "d" |
set LCMD = "l" |
|
set LOCALIZE = "L" |
set CUSTOMDEFSFILE = "" |
|
|
foreach ARG ($argv) |
foreach THEARG ($argv) |
set FLAG = `echo $ARG | awk '{print substr($0, 2)}'` |
set LITERALSTR = '{ my($argin) = "'${THEARG}'"; my($flagout); $flagout = ($argin =~ /^-(.+)/)[0]; print $flagout; }' |
if ($FLAG == $CCMD) then |
set FLAG = `$PERLBIN -e "$LITERALSTR"` |
|
|
|
if ($FLAG == $CLEANCMD) then |
set CLEAN = "yes" | set CLEAN = "yes" |
else if ($FLAG == $LCMD) then |
else if (-e $THEARG) then |
set CHKLIBS = "yes" |
set PROJCONFIG = $THEARG |
endif | endif |
end | end |
| |
if ($CHKLIBS == "no") then |
# Usage: |
echo -n "Remove links for local project configuration..." |
# configure [ -c ] [ <project config file> ] |
|
|
|
# Backward compatibility - remove the links to the old make files in projconf |
if (-d proj) then | if (-d proj) then |
cd proj | cd proj |
if (-e configure) then | if (-e configure) then |
Line 38 if ($CHKLIBS == "no") then |
|
Line 57 if ($CHKLIBS == "no") then |
|
endif | endif |
cd .. | cd .. |
endif | endif |
echo "done" |
|
| |
echo -n "Remove links to man pages..." | echo -n "Remove links to man pages..." |
if (-e man) then | if (-e man) then |
Line 51 if ($CHKLIBS == "no") then |
|
Line 69 if ($CHKLIBS == "no") then |
|
cd base/include | cd base/include |
find . -name "*.h" -exec rm {} \; | find . -name "*.h" -exec rm {} \; |
cd ../.. | cd ../.. |
|
|
|
# Special link from base/drms/apps/serverdefs.h to localization/drmsparams.h |
|
cd base/drms/apps |
|
rm serverdefs.h |
|
cd ../../.. |
|
|
endif | endif |
| |
if (-d include) then | if (-d include) then |
Line 96 if ($CHKLIBS == "no") then |
|
Line 120 if ($CHKLIBS == "no") then |
|
mkdir -p include | mkdir -p include |
endif | endif |
| |
echo -n "Setting links for local project configuration..." |
|
if (-e suflag.txt) then |
|
cd proj |
|
ln -sf ../projconf/su/configure configure |
|
ln -sf ../projconf/su/make_basic.mk make_basic.mk |
|
ln -sf ../projconf/su/Rules.mk Rules.mk |
|
ln -sf ../projconf/su/target.mk target.mk |
|
cd .. |
|
else |
|
cd proj |
|
ln -sf ../projconf/ex/configure configure |
|
ln -sf ../projconf/ex/make_basic.mk make_basic.mk |
|
ln -sf ../projconf/ex/Rules.mk Rules.mk |
|
ln -sf ../projconf/ex/target.mk target.mk |
|
cd .. |
|
endif |
|
echo "done" |
|
|
|
echo "Setting links to man pages..." | echo "Setting links to man pages..." |
if (-d /home/jsoc/man) then | if (-d /home/jsoc/man) then |
if (!(-e man)) then | if (!(-e man)) then |
Line 123 if ($CHKLIBS == "no") then |
|
Line 129 if ($CHKLIBS == "no") then |
|
echo "done" | echo "done" |
echo | echo |
| |
echo "Setting links to scripts..." |
|
if (!(-d scripts)) then |
|
mkdir scripts |
|
endif |
|
cd scripts |
|
|
|
# Sums scripts |
|
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" \; |
|
|
|
# Util scripts |
|
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" \; |
|
|
|
# Export scripts |
|
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" \; |
|
|
|
# DRMS / IDL-interface scripts |
|
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" \; |
|
|
|
# Project-specific scripts - these won't show up if you don't have the project source. |
|
if (-x ../proj/configure) then |
|
../proj/configure |
|
endif |
|
|
|
cd .. |
|
echo "done" |
|
echo |
|
|
|
echo "Setting links to jsds..." | echo "Setting links to jsds..." |
if (!(-d jsds)) then | if (!(-d jsds)) then |
mkdir jsds | mkdir jsds |
Line 186 if ($CHKLIBS == "no") then |
|
Line 165 if ($CHKLIBS == "no") then |
|
endif | endif |
| |
if ($LOCALIZATIONDIR == "") then | if ($LOCALIZATIONDIR == "") then |
set LOCALIZATIONDIR = ${PWD}/localization |
set LOCALIZATIONDIR = localization |
endif | endif |
| |
# Eventually, dump all these generated files into a user-specified location. | # Eventually, dump all these generated files into a user-specified location. |
# This script will need to read the config.local file to get the | # This script will need to read the config.local file to get the |
# localization directory. Otherwise, just use JSOC/localization as the default. | # localization directory. Otherwise, just use JSOC/localization as the default. |
# We should put custom.mk in the localization directory too. |
|
if (!(-d ${LOCALIZATIONDIR})) then | if (!(-d ${LOCALIZATIONDIR})) then |
mkdir ${LOCALIZATIONDIR} | mkdir ${LOCALIZATIONDIR} |
if ($? != 0) then | if ($? != 0) then |
Line 200 if ($CHKLIBS == "no") then |
|
Line 178 if ($CHKLIBS == "no") then |
|
endif | endif |
endif | endif |
| |
if (-e ${LOCALIZATIONDIR}/custom.mk) then |
if (-e ${LOCALIZATIONDIR}/drmsparams.h) then |
rm ${LOCALIZATIONDIR}/custom.mk |
rm ${LOCALIZATIONDIR}/drmsparams.h |
|
endif |
|
|
|
if (-e ${LOCALIZATIONDIR}/drmsparams.mk) then |
|
rm ${LOCALIZATIONDIR}/drmsparams.mk |
endif | endif |
| |
# run moreconfigure.pl - this script is written in perl because it is easier to do the compiler detection |
if (-e ${LOCALIZATIONDIR}/drmsparams.pm) then |
# in perl. It also reads suflag.txt (if it exists) to set the default Stanford values for certain make variables |
rm ${LOCALIZATIONDIR}/drmsparams.pm |
./moreconfigure.pl -f${LOCALIZATIONDIR}/custom.mk |
endif |
| |
if (!(-e suflag.txt)) then |
# Must create the scripts subdirectory before the call to gen_init.csh |
|
if (!(-d scripts)) then |
|
mkdir scripts |
|
endif |
|
|
|
if (!(-e configsdp.txt)) then |
|
# This is NetDRMS. |
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" |
echo " file from a previous installation, you should copy that into" | echo " file from a previous installation, you should copy that into" |
Line 222 if ($CHKLIBS == "no") then |
|
Line 210 if ($CHKLIBS == "no") then |
|
echo " directory tree, for example in /usr/local. After each NetDRMS" | echo " directory tree, for example in /usr/local. After each NetDRMS" |
echo " update, ensure this file is in place." | echo " update, ensure this file is in place." |
exit 1; | exit 1; |
else |
endif |
echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk |
endif |
./gen_init.csh |
|
./customizemake.pl ./config.local ${LOCALIZATIONDIR} |
# We now call localize.py for both Stanford and NetDRMS builds. |
endif |
$PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams |
else if (-e config.local) then |
|
# config.local is optional at Stanford, but it won't necessarily contain the same information that |
echo "Setting links to scripts..." |
# a NetDRMS config.local contains. The first section contains items that will override the |
cd scripts |
# the items in serverdefs.h. The second section contains items used to populate custom.mk, |
|
# which causes make systems variables to be defined that override the default make behavior |
|
# (such as overriding the name of the directory to which binary data are written - linux_x86_64_n02 |
|
# instead of linux_x86_64, for example). |
|
|
|
# Override the defaults defined in serverdefs.h (don't use gen_init.csh as it does several things, |
|
# most of which are relevant only to non-SU NetDRMS sites). This script causes all |
|
# items included in config.local to override those defined in serverdefs.h, but not all |
|
# items need be specified in config.local. |
|
./customizedefs.pl |
|
echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk |
|
| |
# update custom.mk with data from config.local |
# Sums scripts |
./customizemake.pl ./config.local ${LOCALIZATIONDIR} |
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" \; |
|
|
|
# Util scripts |
|
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" \; |
|
|
|
# Export scripts |
|
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" \; |
|
|
|
# DRMS / IDL-interface scripts |
|
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" \; |
|
|
|
# Project-specific scripts - these won't show up if you don't have the project source. |
|
if (-x ${LOCALIZATIONDIR}/configure) then |
|
${LOCALIZATIONDIR}/configure |
endif | endif |
| |
|
cd .. |
|
echo "done" |
|
echo |
|
|
echo "Setting links to headers..." | echo "Setting links to headers..." |
| |
|
# When localize.py was added, we removed the repository version of serverdefs.h, and we stopped generating JSOC/base/include/localization.h. |
|
# To support legacy code, we need to make a link from serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for serverdefs.h |
|
# at Stanford) and from JSOC/base/include/localization.h to ${LOCALIZATIONDIR}/drmsparams.h (the replacement for localization.h |
|
# for NetDRMs builds). However, some files are looking for JSOC/base/drms/apps/serverdefs.h (instead of JSOC/base/include, the correct path). |
|
# If we make a link from JSOC/base/drms/apps/serverdefs.h to ${LOCALIZATIONDIR}/drmsparams.h, then the script below will make links from |
|
# JSOC/base/include/serverdefs.h and JSOC/include/serverdefs.h to JSOC/base/drms/apps/serverdefs.h, which then links to ${LOCALIZATIONDIR}/drmsparams.h. |
|
cd base/drms/apps |
|
ln -s ../../../${LOCALIZATIONDIR}/drmsparams.h serverdefs.h |
|
cd ../../.. |
|
|
|
cd base/include |
|
ln -s ../../../${LOCALIZATIONDIR}/drmsparams.h localization.h |
|
cd ../.. |
|
|
cd base/include | cd base/include |
find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \) | find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \) |
cd ../.. | cd ../.. |
Line 260 if ($CHKLIBS == "no") then |
|
Line 268 if ($CHKLIBS == "no") then |
|
echo "done" | echo "done" |
echo | echo |
| |
# Custom make variable values - these will override the values set in moreconfigure.pl |
|
# echo "JSOC_COMPILER = gcc" >> custom.mk |
|
# echo "JSOC_FCOMPILER = gfortran" >> custom.mk |
|
# echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk |
|
|
|
endif | endif |
else |
|
# $CHKLIBS == "yes" |
|
# Enter required library names and versions here. |
|
| |
| |
endif |
|
|
|