home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / condor40.zip / CONDOR / NewArch < prev   
Text File  |  1989-10-17  |  7KB  |  218 lines

  1. #!/bin/sh
  2. #
  3. #    This script is used to set up a sub-directory to contain
  4. #    everything that is needed for a new architecture and operating
  5. #    system.  Refer to the Condor Installation Guide for a list of
  6. #    currently supported architectures and operating systems.
  7. #
  8. TEST=/bin/test
  9. XLIBDIR=/usr/misc/X11/lib
  10. NDBM=
  11. LIBX=
  12.  
  13.  
  14. if $TEST $# != 2 ; then
  15.     echo Usage: $0 Architecture Operating-System
  16.     echo For example: $0 SPARC SUNOS40
  17.     exit
  18. fi
  19.  
  20. ARCH=$1
  21. OPSYS=$2
  22.  
  23. #
  24. #    Check to make sure that we know about the specified architecture
  25. #    and operating system
  26. #
  27. case "$ARCH" in
  28.     IBM032 | VAX | I386 | SPARC | MC68020 | MIPS )
  29.         break
  30.         ;;
  31.     
  32.     *)
  33.         echo Unknown architecture: $ARCH
  34.         echo Known architectures are: VAX, I386, SPARC, MC68020, and MIPS
  35.         echo You will need to modify this $0 as well as the rest of Condor.
  36.         exit
  37. esac
  38.  
  39. case "$OPSYS" in
  40.     ULTRIX | BSD43 | DYNIX | SUNOS32 | SUNOS40 )
  41.         break
  42.         ;;
  43.     
  44.     *)
  45.         echo Unknown operating system: $OPSYS
  46.         echo Known operating systems are: ULTRIX, BSD43, DYNIX, SUNOS32, and SUNOS40
  47.         echo You will need to modify this $0 as well as the rest of Condor.
  48.         exit
  49. esac
  50.  
  51. #
  52. # Check to make sure that we are on the archetecture/operating system
  53. # that we are trying to build.
  54. #
  55. echo Checking validity of $ARCH/$OPSYS
  56. rm -f C.$ARCH.$OPSYS
  57. cc -o C.$ARCH.$OPSYS GENERIC/CheckMachType.c -D$ARCH -D$OPSYS
  58. ./C.$ARCH.$OPSYS
  59.  
  60. if $TEST $? != 0 ; then
  61.     rm -f C.$ARCH.$OPSYS
  62.     exit
  63. fi
  64.  
  65. rm -f C.$ARCH.$OPSYS
  66.  
  67. CONDIRS="condor condor_collector condor_lib \
  68.     condor_master condor_negotiator condor_q condor_rm condor_schedd \
  69.     condor_shadow condor_startd condor_starter condor_tools \
  70.     ckpt_lib client h release release/bin release/lib standalone \
  71.     util_lib xdr_lib condor_kbdd"
  72.  
  73. SYSNAME=$ARCH"_"$OPSYS
  74. CONFIG=$SYSNAME/release/lib/condor_config
  75. SYSBIN=$SYSNAME/release/bin
  76.  
  77. #
  78. # Make directories
  79. #
  80. echo Making directories
  81. mkdir $SYSNAME
  82. cd $SYSNAME
  83. mkdir $CONDIRS
  84. cd ..
  85.  
  86. #
  87. # Make condor_config
  88. #
  89. echo Making condor_config
  90. echo "#"                                                      > $CONFIG
  91. echo "# Machine Description"                                 >> $CONFIG
  92. echo "#"                                                     >> $CONFIG
  93. echo "ARCH=$ARCH"                                            >> $CONFIG
  94. echo "OPSYS=$OPSYS"                                            >> $CONFIG
  95. echo ""                                                     >> $CONFIG
  96. cat GENERIC/condor_config                                    >> $CONFIG
  97.  
  98. RELDIR=`grep "^RELEASEDIR" $CONFIG`
  99.  
  100. #
  101. # Make Condor.on, Condor.off, and Condor.init
  102. #
  103. echo Making Condor.on, Condor.off, and Condor.init
  104. cp GENERIC/Condor.off $SYSBIN/Condor.off
  105. cp GENERIC/Condor.on $SYSBIN/Condor.on
  106. echo ""                                                    >> $SYSBIN/Condor.on
  107. echo set $RELDIR                                        >> $SYSBIN/Condor.on
  108. echo \$"RELEASEDIR"/bin/condor_master                    >> $SYSBIN/Condor.on
  109. echo echo Condor has been started                        >> $SYSBIN/Condor.on
  110.  
  111. echo "#!/bin/csh -f"                                     > $SYSBIN/Condor.init
  112. echo ""                                                    >> $SYSBIN/Condor.init
  113. echo set CHMOD=/bin/chmod                                >> $SYSBIN/Condor.init
  114. echo set CHOWN=/etc/chown                                >> $SYSBIN/Condor.init
  115. echo set CHGRP=/bin/chgrp                                >> $SYSBIN/Condor.init
  116. echo set $RELDIR                                        >> $SYSBIN/Condor.init
  117. echo set CONFIG_VAL=\$"RELEASEDIR"/bin/config_val        >> $SYSBIN/Condor.init
  118. echo ""                                                    >> $SYSBIN/Condor.init
  119. echo rm -f ~condor/condor_config                        >> $SYSBIN/Condor.init
  120. echo ln -s \$"RELEASEDIR"/lib/condor_config ~condor/condor_config \
  121.                                                         >> $SYSBIN/Condor.init
  122. echo 'eval `$CONFIG_VAL LOG EXECUTE SPOOL`'                >> $SYSBIN/Condor.init
  123. echo mkdir \$"LOG" \$"EXECUTE" \$"SPOOL"                >> $SYSBIN/Condor.init
  124. echo \$"CHMOD" 700 \$"EXECUTE"                            >> $SYSBIN/Condor.init
  125. echo \$"CHMOD" 770 \$"SPOOL"                            >> $SYSBIN/Condor.init
  126. echo \$"CHMOD" 775 \$"LOG"                                >> $SYSBIN/Condor.init
  127. echo \$"CHOWN" condor \$"LOG" \$"EXECUTE" \$"SPOOL"        >> $SYSBIN/Condor.init
  128. echo \$"CHGRP" condor \$"LOG" \$"EXECUTE" \$"SPOOL"        >> $SYSBIN/Condor.init
  129. chmod 775 $SYSBIN/Condor.on $SYSBIN/Condor.off $SYSBIN/Condor.init
  130. echo echo Condor has been initialized, but not started.    >> $SYSBIN/Condor.init
  131.  
  132. #
  133. # Make INSTALL script
  134. #
  135. echo Making INSTALL script
  136. echo "#!/bin/csh -f"                                         > $SYSNAME/INSTALL
  137. echo ""                                                        >> $SYSNAME/INSTALL
  138. echo set $RELDIR                                            >> $SYSNAME/INSTALL
  139. echo "set FILESERVER=YourFavoriteFileServer"                >> $SYSNAME/INSTALL
  140. echo "#"                                                    >> $SYSNAME/INSTALL
  141. echo "# Uncomment one of the following lines."                >> $SYSNAME/INSTALL
  142. echo "# If the executables are going to be on"                >> $SYSNAME/INSTALL
  143. echo "# another machine, you should perform"                >> $SYSNAME/INSTALL
  144. echo "# an/some rdist(s).  If the executables"                >> $SYSNAME/INSTALL
  145. echo "# are on this machine, you should remove"                >> $SYSNAME/INSTALL
  146. echo "# any existing symbolic link and make a"                >> $SYSNAME/INSTALL
  147. echo "# new one."                                            >> $SYSNAME/INSTALL
  148. echo "#"                                                    >> $SYSNAME/INSTALL
  149. echo ""                                                        >> $SYSNAME/INSTALL
  150. echo "#rdist" -c release \$"FILESERVER"'":"'\$"RELEASEDIR"    >> $SYSNAME/INSTALL
  151. echo "#rm" -f \$"RELEASEDIR"                                >> $SYSNAME/INSTALL
  152. echo "#ln" -s `pwd`/$SYSNAME/release \$"RELEASEDIR"            >> $SYSNAME/INSTALL
  153. echo "echo You must edit this INSTALL script."                >> $SYSNAME/INSTALL
  154. chmod 775 $SYSNAME/INSTALL
  155.  
  156. #
  157. # Make a machine specific Makefile
  158. #
  159. echo Making $SYSNAME/Makefile.mach
  160. echo TILDE=`pwd`                                     > $SYSNAME/Makefile.mach
  161. echo DSTDIR="$(TILDE)"/$SYSNAME/release                >> $SYSNAME/Makefile.mach
  162.  
  163. if $TEST -s /usr/include/ndbm.h ; then
  164.     NDBM=-DNDBM
  165. fi
  166.  
  167. if $TEST -s $XLIBDIR/libX11.a; then
  168.     echo LIBX=-lX11                                   >> $SYSNAME/Makefile.mach ;
  169.     echo XPROGS=condor_kbdd                           >> $SYSNAME/Makefile.mach ;
  170. fi
  171.  
  172. echo IDENT=-D$ARCH -D$OPSYS $NDBM                    >> $SYSNAME/Makefile.mach ;
  173.  
  174. if $TEST -s /usr/lib/libndbm.a ; then
  175.     echo LIBDBM=-lndbm                                >> $SYSNAME/Makefile.mach ;
  176. elif $TEST -s /usr/lib/libdbm.a ; then
  177.     echo LIBDBM=-ldbm                                >> $SYSNAME/Makefile.mach ;
  178. else
  179.     echo LIBDBM=                                    >> $SYSNAME/Makefile.mach ;
  180. fi
  181.  
  182. if $TEST "$OPSYS" = "SUNOS40" ; then
  183.     echo "SUN_SIGVEC = _SIGVEC.o"                    >> $SYSNAME/Makefile.mach ;
  184.     echo "LDOPTS=-dc -e start -Bstatic"                >> $SYSNAME/Makefile.mach ;
  185.     echo "COPTS="                                    >> $SYSNAME/Makefile.mach ;
  186.     echo "# Don't optimize, causes problems on Sun4's for  some reason"\
  187.                                                     >> $SYSNAME/Makefile.mach ;
  188. else
  189.     echo "LDOPTS="                                    >> $SYSNAME/Makefile.mach ;
  190.     echo "COPTS= -O"                                >> $SYSNAME/Makefile.mach ;
  191. fi
  192.  
  193.  
  194. cat GENERIC/Makefile.mach                            >> $SYSNAME/Makefile.mach
  195.  
  196. #
  197. # Make a program to make sure that we are compiling on the
  198. # correct architecture/operating system.
  199. #
  200. echo Making $SYSNAME/CheckMachType.c
  201. rm -f $SYSNAME/CheckMachType.c
  202. ln GENERIC/CheckMachType.c $SYSNAME/CheckMachType.c
  203.  
  204. cd $SYSNAME
  205. rm -f Makefile
  206. ln -s ../Makefile Makefile
  207. cd ..
  208.  
  209. if $TEST ! -s $XLIBDIR/libX11.a; then
  210.     echo ""
  211.     echo "         ***  WARNING  ***"
  212.     echo "I have searched for the X library libX11.a in $XLIBDIR,"
  213.     echo "but can't find it.  If you are not running X, this is OK."
  214.     echo "If you are running X, you should remove $SYSNAME, edit"
  215.     echo "NewArch and set \$XLIBDIR to reflect the correct pathname"
  216.     echo "for your site, and re-run NewArch."
  217. fi
  218.