#! /bin/csh # ############################################################################### # # # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993 # # The Regents of the University of California. All rights reserved. # # # # Permission to use, copy, modify, and distribute this software and its # # documentation for any purpose, without fee, and without written agreement # # is hereby granted, provided that the above copyright notice and the # # following two paragraphs appear in all copies of this software. # # # # IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR # # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT # # OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY # # OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # # THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, # # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY # # AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS # # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO # # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # # # ############################################################################### # # ############################################################# ###### Configuration ###################################### ############################################################# set arch = `./ARCHITECTURE` set xincloc = /projects/X11/X11/mips/include set xlibloc = /projects/X11/X11/mips/lib set xapploc = /usr/lib/X11/app-defaults # # X Notes: # You will need X11R4 or later. # You will need the Athena widget set (Xaw). # X11 libraries are often found in /usr/lib/X11 or # /usr/X11/lib, depending on the platform. # xapploc is less important than xincloc and xlibloc # ############################################################# ###### DEFAULTS ###################################### ############################################################# set make = make set cc = "CC=cc" set cplusplus = "g++" set lintflag = "-C" set lintextras set ldextras set p # Number of processors to use (Sequent) # # Compilation Notes: # Some tools compile *only* with certain versions # of Gnu C++ (g++). # Some tools will *not* compile with Gnu C (gcc). # ######################################################### ######################################################### ###### Remember to check the TOOL-LIST files; ######## ###### they determine which tools get compiled. ######## ######################################################### ######################################################### echo "" echo "Installation Script for OCTTOOLS 5.2" echo "" echo " You should have read the README file before running INSTALL." echo "" ##### Check the OCTTOOLS variable, and set it up if necessary. set CWD = `pwd` set OO = $CWD/$arch if ( $?OCTTOOLS ) then if ( $OCTTOOLS != $OO ) then set oct = $OCTTOOLS cd $oct:h if ( `pwd` != $CWD ) then echo echo "---------------------------------------------------------" echo "The OCTTOOLS variable may be wrong." echo " It is $OCTTOOLS" echo " It should be $OO" echo " If the two paths are equivalent, you can continue." echo " If not, you should stop and fix the value of OCTTOOLS." echo -n " Continue anyway (yes or no)? " set rep = $< if ( $rep != "yes" ) exit 1 else echo $OCTTOOLS is the same as $OO echo "---------------------------------------------------------" cd $CWD endif endif else echo "Setting the OCTTOOLS environment variable to $OO," echo " and adding it to ~/.cshrc)." echo "setenv OCTTOOLS $OO" >> ~/.cshrc setenv OCTTOOLS $OO endif ##### Create all needed directories. foreach i ( \ ./common/include \ ./common/man \ ./common/man/man1 \ ./common/man/man3 \ ./common/man/man5 \ ./common/document \ ./common/doc \ ./common/lib \ ./common/lib/utils \ ${OCTTOOLS} \ ${OCTTOOLS}/bin \ ${OCTTOOLS}/bin/rpc \ ${OCTTOOLS}/lib \ ) if ( ! -d $i ) then echo " -- making $i" mkdir $i endif end cd $OCTTOOLS if ( ! -e Makefile ) ln -s ../Makefile Makefile # Create shared directories, one level first, then two levels. foreach i ( src tech include doc document man ) if ( ! -d $OCTTOOLS/$i ) then echo -- making symbolic link ../common/$i to ./$i ln -s ../common/$i ./$i endif end cd lib foreach i (vem vov utils musa phyt oct2hilo misII) if ( ! -d ../../common/lib/$i ) then echo Creating directory ../../common/lib/$i mkdir ../../common/lib/$i endif if ( ! -d ./$i ) then echo -- making symbolic link to ../../common/lib/$i ln -s ../../common/lib/$i $i endif end cd $OCTTOOLS ##### Query the user about options echo "What compiler optimization level do you want" echo -n " (the default is the compiler default; examples are -O and -O3)?" set opt = $< echo "Do you want to create -g versions of the packages" echo -n " (y/n, the default is n)?" set debugg = $< if (${debugg} == 'y') then set debugg = 1 else set debugg = 0 endif echo "Do you want to create -pg versions of the packages" echo -n " (y/n, the default is n)?" set debugpg = $< if (${debugpg} == 'y') then set debugpg = 1 else set debugpg = 0 endif if (${debugg} && ${debugpg}) then set debug = "debug" else if (${debugg}) then set debug = "debug-g" else if (${debugpg}) then set debug = "debug-pg" else set debug endif echo "Do you want to create lint libraries for the packages" echo -n " (y/n, the default is n)?" set lint = $< if (${lint} == 'y') then set lint = "install.lint" else set lint endif echo "Do you want to build the programs that use the X window system" echo -n " (y/n, the default is y)?" set xwindows = $< set makefile = "Makefile" if (${xwindows} == 'n') then setenv NO_X set install = "NO_X= install" else set install = "install" echo -n "Location of X includes ($xincloc)?" set in = $< if ("${in}" != "") then set xincloc = ${in} endif echo -n "Location of X libraries ($xlibloc)?" set in = $< if ("${in}" != "") then set xlibloc = ${in} endif echo -n "Location of X application defaults ($xapploc)?" set in = $< if ("${in}" != "") then set xapploc = ${in} endif if ( ! -e ${xincloc}/X11/X.h ) then echo "?? Bad location for XINCLOC: ${xincloc} ??" echo "-- You will have to change it." exit 1 endif if ( ! -e ${xlibloc}/libX11.a ) then echo "?? Bad location for XLIBLOC: ${xlibloc} ??" echo " You will have to change it." exit 1 endif endif ##### Perform general setup. # Do this in all cases: get the variables ready. set xlibloc = -L${xlibloc} set xincloc = -I${xincloc} rm -rf make.out.old if (-e make.out) then mv make.out make.out.old endif # Some tools in the installation script may be vov-ized. # Make sure that VOV is made inactive. if ( $?VOV_HOST_NAME ) then unsetenv VOV_HOST_NAME endif # for those who install as a user with restrictive umasks umask 022 ##### Perform platform-dependent setup. # DEC MIPS if ("${arch}" == "mips") then set lintflag = "-o" set lintextras = "-h" endif # HP-UX (PA-RISC) if ("${arch}" == "hpux") then # set compiler options via environment variable setenv CCOPTS "-Dhpux -Dunix -D_HPUX_SOURCE -DSYSV" set cplusplus = "CC" setenv CXXOPTS "-Dhpux -D_HPUX_SOURCE -DSYSV -Aa" # set loader options via environment variable # (this is needed only for /bin/ld commands; it's automatic with cc -g) # if (${debugg}) setenv LDOPTS "/usr/lib/end.o" # HP-UX's df is not BSD rm -f $OCTTOOLS/bin/df ln -s /usr/bin/bdf $OCTTOOLS/bin/df # no rdist with HP-UX rm -f $OCTTOOLS/bin/rdist ln -s $OCTTOOLS/src/Utils/bin/hpux-rdist $OCTTOOLS/bin/rdist # install a touch that deals with -f rm -f $OCTTOOLS/bin/touch ln -s $OCTTOOLS/src/Utils/bin/hpux-touch $OCTTOOLS/bin/touch endif # IBM RS/6000, AIX V3.1 if (($arch == "rs6000") || ("${arch}" == "aixv3.1") || ("${arch}" == "ibmr2")) then set cc = "CC=xlc" set ldextras = "-lbsd" set lintflag = "-o" endif # SEQUENT if (("${arch}" == "sequent") || ("${arch}" == "symmetry")) then # The sequent compiler does not understand the -L option set xlibloc = "" setenv PARALLEL 10 set p = '&' endif # HP APOLLO -- historic, perhaps still relevant (see HP-UX) if ("${arch}" == "apollo") then set cc = "CC=cc -A nansi" # the PA-RISC options may apply here as well endif ##### Do the work -- start compilation. echo "Octtools make started at `date`" > make.out echo "" >> make.out set command = "$make -k ${cc} MAKE=$make OCTTOOLS=$OCTTOOLS MAKEFILE=$makefile LINTCREATEFLAG=$lintflag LINTEXTRAS=$lintextras LDEXTRAS=${ldextras} XAPPLOC=${xapploc} XINCLOC=${xincloc} XLIBLOC=${xlibloc} OPTFLAG=$opt P=$p ${install} ${lint} CPLUSPLUS=$cplusplus $debug" echo "" echo "Issuing the command:" echo " $command" echo "" echo "The log file will be in $OCTTOOLS/make.out" echo "" echo "Do you want to delay the execution of the installation" echo -n " (delay in seconds -- default is 0)? " set delay = $< if ( $delay > 0 ) then echo "Sleeping for $delay seconds." sleep $delay endif echo $command >> make.out echo "" >> make.out $command >>& make.out echo "" >> make.out echo "ended at `date`" >> make.out echo "done"