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

Diff for /JSOC/configure between version 1.72 and 1.83

version 1.72, 2013/11/12 02:38:49 version 1.83, 2015/03/30 15:17:12
Line 1 
Line 1 
 #! /bin/csh -f #! /bin/csh -f
  
 # system configuration for configure script  # The system configuration for configure script
 set PERLBIN = "" set PERLBIN = ""
   set PYBIN = ""
  
 if ($PERLBIN == "") then if ($PERLBIN == "") then
     if (-e configsdp.txt) then      if (-x /home/jsoc/bin/linux_x86_64/activeperl) then
         # at stanford, use  
         set PERLBIN = "/home/jsoc/bin/linux_x86_64/activeperl"         set PERLBIN = "/home/jsoc/bin/linux_x86_64/activeperl"
     else     else
         set PERLBIN = "perl"         set PERLBIN = "perl"
     endif     endif
 endif endif
  
   if ($PYBIN == "") then
       if (-x /home/jsoc/bin/linux_x86_64/activepython) then
           set PYBIN = "/home/jsoc/bin/linux_x86_64/activepython"
       else
           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"  # Clean by default.
   set CLEAN = "yes"
 set PROJCONFIG = "" set PROJCONFIG = ""
 set CLEANCMD = "d" set CLEANCMD = "d"
   set CFGSERVER = "no"
   set CFGSERVERARG = "s"
 set CUSTOMDEFSFILE = "" set CUSTOMDEFSFILE = ""
  
 foreach THEARG ($argv) foreach THEARG ($argv)
Line 28  foreach THEARG ($argv)
Line 38  foreach THEARG ($argv)
     set FLAG = `$PERLBIN -e "$LITERALSTR"`     set FLAG = `$PERLBIN -e "$LITERALSTR"`
  
     if ($FLAG == $CLEANCMD) then     if ($FLAG == $CLEANCMD) then
         set CLEAN = "yes"          set CLEAN = "no"
       else if ($FLAG == $CFGSERVERARG) then
           set CFGSERVER = "yes"
     else if (-e $THEARG) then     else if (-e $THEARG) then
         set PROJCONFIG = $THEARG         set PROJCONFIG = $THEARG
     endif     endif
 end end
  
 # Usage: # Usage:
 #   configure [ -c ] [ <project config file> ]  #   configure [ -d ] [ -s ] [ <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
Line 55  if (-d proj) then
Line 67  if (-d proj) then
     cd ..     cd ..
 endif endif
  
     echo -n "Remove links to man pages..."      # Always clean up links to man pages and re-create them.
       echo -n "Removing links to man pages..."
     if (-e man) then     if (-e man) then
         rm -rf man         rm -rf man
     endif     endif
     echo "done"     echo "done"
  
     echo -n "Removing links to headers..."      if ($CLEAN == "yes") then
           echo -n "Removing links in base/include to headers..."
           # Links in base/include
     if (-d base/include) then     if (-d base/include) then
         cd base/include         cd base/include
         find . -name "*.h" -exec rm {} \;         find . -name "*.h" -exec rm {} \;
         cd ../..         cd ../..
     endif     endif
           echo "done"
   
           # Special link from base/drms/apps/serverdefs.h to localization/drmsparams.h
           echo -n "Removing link to serverdefs.h..."
           if (-e base/drms/apps) then
               cd base/drms/apps
               rm serverdefs.h
               cd ../../..
           endif
           echo "done"
  
           # Links in include
           echo -n "Removing links in include to headers..."
     if (-d include) then     if (-d include) then
         cd include         cd include
         find . -name "*.h" -exec rm {} \;         find . -name "*.h" -exec rm {} \;
               find . -name "drmsparams*" -exec rm {} \;
         cd ..         cd ..
     endif     endif
     echo "done"     echo "done"
  
     echo -n "Removing links to scripts..."     echo -n "Removing links to scripts..."
           # Links in scripts
     if (-d scripts) then     if (-d scripts) then
         cd scripts         cd scripts
         find . -name "*" -exec rm {} \;              if ($? == 0) then
                   find . -type l -exec rm {} \;
               endif
         cd ..         cd ..
     endif     endif
     echo "done"     echo "done"
       # End clean flag
       endif
  
       # Always clean-up links to jsds and re-create them.
     echo -n "Removing links to jsds..."     echo -n "Removing links to jsds..."
     if (-d jsds) then     if (-d jsds) then
         cd jsds         cd jsds
         find . -name "*" -exec rm {} \;          if ($? == 0) then
               find . -type l -exec rm {} \;
           endif
         cd ..         cd ..
     endif     endif
     echo "done"     echo "done"
   
     echo     echo
  
     if ($CLEAN == "yes") then     if ($CLEAN == "yes") then
Line 101  endif
Line 136  endif
         if (-x base/local/libs/soi/scripts/rmlinks.csh) then         if (-x base/local/libs/soi/scripts/rmlinks.csh) then
             base/local/libs/soi/scripts/rmlinks.csh             base/local/libs/soi/scripts/rmlinks.csh
         endif         endif
     else      endif
   
         # Make include directories here, since they are used by multiple script blocks below         # Make include directories here, since they are used by multiple script blocks below
         if (!(-d base/include)) then         if (!(-d base/include)) then
             mkdir -p base/include             mkdir -p base/include
Line 149  endif
Line 185  endif
  
         # Path to the configuration file - at some point, make this an argument to the configure script         # Path to the configuration file - at some point, make this an argument to the configure script
         set LOCALIZATIONDIR = ""         set LOCALIZATIONDIR = ""
       set RELLOCALIZATIONDIR = ""
         set conflocal = "config.local"         set conflocal = "config.local"
  
         if (-e $conflocal) then         if (-e $conflocal) then
             set LOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`          set RELLOCALIZATIONDIR = `perl -n -e 'if ($_ =~ /^LOCALIZATIONDIR\s+(.+)/) { print $1; }' $conflocal`
         endif         endif
  
         if ($LOCALIZATIONDIR == "") then         if ($LOCALIZATIONDIR == "") then
             set LOCALIZATIONDIR = ${PWD}/localization          set RELLOCALIZATIONDIR = localization
         endif         endif
  
       # Make the path absoluate
       set LOCALIZATIONDIR = ${PWD}/${RELLOCALIZATIONDIR}
   
         # 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 170  endif
Line 209  endif
             endif             endif
         endif         endif
  
         # TEMPORARILY create a link from ${LOCALIZATIONDIR}/drmsparams.h to JSOC/base/libs/perl/JSOC_DB_INFO_INCLUDE.pl      if (-e ${LOCALIZATIONDIR}/drmsparams.h) then
         cd ${LOCALIZATIONDIR}          rm ${LOCALIZATIONDIR}/drmsparams.h
         rm -f drmsparams.pm      endif
         ln -s ../base/libs/perl/JSOC_DB_INFO_INCLUDE.pl drmsparams.pm  
         cd ..  
  
       if (-e ${LOCALIZATIONDIR}/drmsparams.mk) then
           rm ${LOCALIZATIONDIR}/drmsparams.mk
       endif
  
         if (-e ${LOCALIZATIONDIR}/custom.mk) then      if (-e ${LOCALIZATIONDIR}/drmsparams.pm) then
             rm ${LOCALIZATIONDIR}/custom.mk          rm ${LOCALIZATIONDIR}/drmsparams.pm
       endif
   
       if (-e ${LOCALIZATIONDIR}/drmsparams.py) then
           rm ${LOCALIZATIONDIR}/drmsparams.py
         endif         endif
  
         # Must create the scripts subdirectory before the call to gen_init.csh         # Must create the scripts subdirectory before the call to gen_init.csh
Line 201  endif
Line 245  endif
                 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  
                 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk  
   
                 set CUSTOMDEFSFILE = "base/include/localization.h"  
                 echo "*** generating $CUSTOMDEFSFILE ***"  
                 cat /dev/null > $CUSTOMDEFSFILE  
                 echo '#ifndef __LOCALIZATION_H' >> $CUSTOMDEFSFILE  
                 echo '#define __LOCALIZATION_H' >> $CUSTOMDEFSFILE  
                 ./gen_init.csh  
   
                 # Non-customizable parameters. There are certain features that are not  
                 # present in NetDRMS, but that are present in the SDP JSOC version of DRMS.  
                 # Set defines needed to accomplish this here.  
                 # NetDRMS sites do not have DSDS.  
                 echo '#define DSDS_SUPPORT (0)' >> $CUSTOMDEFSFILE  
                 echo '#endif' >> $CUSTOMDEFSFILE  
   
                 # 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  
                 $PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}  
   
                 # 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.  
                 $PERLBIN ./customizemake.pl ./config.local ${LOCALIZATIONDIR}  
             endif  
         else if (-e config.local) then  
             # This is Stanford.  
   
             # config.local is optional at Stanford, but it won't necessarily contain the same information that  
             # a NetDRMS config.local contains. The first section contains items that will override the  
             # 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.  
             echo "CUSTOM_DEFINES = __CUSTOMIZED_DEFS__" >> ${LOCALIZATIONDIR}/custom.mk  
             $PERLBIN ./customizedefs.pl  
   
             set CUSTOMDEFSFILE = "base/include/customizeddefs.h"  
   
             # 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  
             $PERLBIN ./moreconfigure.pl -d${LOCALIZATIONDIR} -fcustom.mk -c${CUSTOMDEFSFILE}  
   
             # update custom.mk with data from config.local  
             # 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.  
             $PERLBIN ./customizemake.pl ./config.local ${LOCALIZATIONDIR}  
         else  
             # 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  
             $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  
   
         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  
                 set PROJCONFIG = configsdp.txt  
             endif             endif
         endif         endif
  
         if (${PROJCONFIG} != "") then      if ($CLEAN == "yes") then
             echo "Running project configuration [${PERLBIN} configproj.pl -c${PROJCONFIG} -d${LOCALIZATIONDIR}]."          # We now call localize.py for both Stanford and NetDRMS builds.
             ${PERLBIN} configproj.pl -c${PROJCONFIG} -d${LOCALIZATIONDIR}          if ($CFGSERVER == "yes") then
               $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams -s
           else
               $PYBIN ./localize.py -d ${LOCALIZATIONDIR} -b drmsparams
           endif
         endif         endif
  
         echo "Setting links to scripts..."         echo "Setting links to scripts..."
         cd scripts         cd scripts
  
         # Sums 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" \;      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"; } }'
  
         # Util scripts         # 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" \;      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"; } }'
  
         # Export scripts         # 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" \;      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"; } }'
  
         # DRMS / IDL-interface scripts         # 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" \;      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"; } }'
  
         # Project-specific scripts - these won't show up if you don't have the project source.         # Project-specific scripts - these won't show up if you don't have the project source.
         if (-x ${LOCALIZATIONDIR}/configure) then         if (-x ${LOCALIZATIONDIR}/configure) then
Line 312  endif
Line 283  endif
  
         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.
       if (!(-l base/drms/apps/serverdefs.h)) then
           cd base/drms/apps
           ln -s ../../../${RELLOCALIZATIONDIR}/drmsparams.h serverdefs.h
           cd ../../..
       endif
   
       if (!(-l base/include/localization.h)) then
         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" \; \)          ln -s ../../${RELLOCALIZATIONDIR}/drmsparams.h localization.h
           cd ../..
       endif
   
       cd base/include
       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"; } }'
         cd ../..         cd ../..
  
         cd include         cd include
         if (-d ../base/include) then         if (-d ../base/include) then
             find ../base/include -name \*.h -exec ln -s {} . \;          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"; } }'
         endif         endif
         cd ..  
         echo "done"  
         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  
  
       # ${LOCALIZATIONDIR} is an absolute path
       if (!(-l drmsparams.h)) then
           ln -s ../${RELLOCALIZATIONDIR}/drmsparams.h
       endif
       if (!(-l drmsparams.pm)) then
           ln -s ../${RELLOCALIZATIONDIR}/drmsparams.pm
       endif
       if (!(-l drmsparams.py)) then
           ln -s ../${RELLOCALIZATIONDIR}/drmsparams.py
     endif     endif
  
       cd ..
       echo "done"
       echo


Legend:
Removed from v.1.72  
changed lines
  Added in v.1.83

Karen Tian
Powered by
ViewCVS 0.9.4