diff --git a/changelog b/changelog index e6c9731..282bd89 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20070821 tpd src/sman/bookvol6 add axiom command +20070821 tpd src/sman/Makefile add axiom command +20070821 tpd src/etc/axiom remove axiom command +20070821 tpd src/etc/Makefile remove axiom command 20070821 tpd src/sman/Makefile remove ${DOC}/bookvol6.idx 20070819 tpd src/sman/Makefile rewrite to use bookvol6 20070819 tpd src/sman/spadclient.c removed diff --git a/src/etc/Makefile.pamphlet b/src/etc/Makefile.pamphlet index 2b113ff..624e504 100644 --- a/src/etc/Makefile.pamphlet +++ b/src/etc/Makefile.pamphlet @@ -9,14 +9,6 @@ \eject \tableofcontents \eject -\section{The axiom command} -<>= -${OUT}/axiom: ${IN}/axiom - @echo 1 making ${OUT}/axiom from ${IN}/axiom - @cp ${IN}/axiom ${OUT}/axiom - @chmod +x ${OUT}/axiom - -@ \section{The databases} The databases are built in this Makefile even though the prerequisites are actually made during the previous step in the algebra directory. @@ -91,14 +83,13 @@ DOC=${INT}/doc/src/etc INTERPSYS=${OBJ}/${SYS}/bin/interpsys all: ${MNT}/${SYS}/algebra/*.daase ${OUT}/asq ${LIB}/summary \ - ${LIB}/copyright ${OUT}/axiom + ${LIB}/copyright @echo 6 finished ${IN} <> <> <> <> -<> document: @echo 7 documenting ${IN} @( cd ${DOC} ; \ diff --git a/src/etc/axiom b/src/etc/axiom deleted file mode 100644 index 9034cc0..0000000 --- a/src/etc/axiom +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/sh - -# Start everything for Axiom. -# -# axiom -# [-ht |-noht] whether to use HyperDoc -# [-gr |-nogr] whether to use Graphics -# [-clef |-noclef] whether to use Clef -# [-nag |-nonag] whether to use NAG -# [-iw |-noiw] start in interpreter window -# [-ihere|-noihere] start an interpreter buffer in the original window -# [-nox] don't use X Windows -# [-go |-nogo] whether to start system -# [-ws wsname] use named workspace -# [-list] list workspaces only -# [-grprog fname] use named program for Graphics -# [-nagprog fname] use named program for Nag -# [-htprog fname] use named program for HyperDoc -# [-clefprog fname] use named program for Clef -# [-sessionprog fname] use named program for session -# [-clientprog fname] use named program for spadclient -# [-h] show usage -# -# - -MALLOCTYPE=3.1 -export MALLOCTYPE - -# NAGMAN needs to know the hostname -HOST=`hostname` -export HOST - -# 0. Basic utilities - -ciao() { - echo "Goodbye." - exit 1 -} - -needsubopt () { - echo "The $1 option requires an argument." - ciao -} - - -showuse() { -echo "axiom" -echo " [-ht |-noht] whether to use HyperDoc" -echo " [-gr |-nogr] whether to use Graphics" -echo " [-clef |-noclef] whether to use Clef" -echo " [-nag |-nonag] whether to use NAG" -echo " [-iw |-noiw] start in interpreter window" -echo " [-ihere|-noihere] start an interpreter buffer in the original window." -echo " [-nox] don't use X Windows" -echo " [-go |-nogo] whether to start system" -echo " [-ws wsname] use named workspace" -echo " [-list] list workspaces only" -#echo " [-grprog fname] use named program for Graphics" -#echo " [-nagprog fname] use named program for Nag" -#echo " [-htprog fname] use named program for HyperDoc" -#echo " [-clefprog fname] use named program for Clef" -#echo " [-sessionprog fname] use named program for session" -#echo " [-clientprog fname] use named program for spadclient" -echo " [-h] show usage" -} - -# 1. Ensure the environment is set. - -# Just process '-h' - -if [ "$*" = "-h" ] ; then - showuse -fi -SPADDEFAULT=/axiom/mnt/linux - -if [ "$SPAD" = "" ] ; then - if [ "$AXIOM" = "" ] ; then - SPAD=$SPADDEFAULT - echo "AXIOM variable is not set" - echo "assuming AXIOM = $SPAD" - AXIOM=$SPAD - export AXIOM - else - SPAD=$AXIOM - fi - export SPAD -else - if [ "$AXIOM" = "" ] ; then - echo "AXIOM variable is not set" - echo "but SPAD = $SPAD" - echo "Using AXIOM = $SPAD" - AXIOM=$SPAD - export AXIOM - else - if [ ! "$SPAD" = "$AXIOM" ] ; then - echo "ignoring SPAD variable" - SPAD=$AXIOM - fi - fi -fi - -if [ "$AXIOMXLROOT" = "" ] ; then -AXIOMXLROOT=${AXIOM}/compiler -fi -export AXIOMXLROOT -PATH=$AXIOM/bin:$AXIOMXLROOT/bin:${PATH} -export PATH - - - -if [ ! -d "$SPAD" ] ; then - echo "The directory for Axiom, $SPAD, does not exist." - ciao -fi - -# Name the workspace directories. -rootwsdir=$SPAD/bin - -# 2. Process command line arguments. - -# Defaults for command-line arguments. -list=no -go=yes -wsname=AXIOMsys - -otheropts="" - -while [ "$*" != "" ] ; do - - case $1 in - -list) list=yes - go=no;; - -go) go=yes ;; - -nogo) go=no ;; - - -ws) - if [ "$2" = "" ] ; then needsubopt "$1" ; fi - shift - wsname="$1" - ;; - - -nagprog|-grprog|-htprog|-clefprog|-sessionprog|-clientprog|-paste|-rm|-rv) - if [ "$2" = "" ] ; then needsubopt "$1" ; fi - otheropts="$otheropts $1 $2" - shift - ;; - -clef|-noclef|-gr|-nogr|-ht|-noht|-iw|-noiw|-ihere|-noihere|-nox|-nag|-nonag) - otheropts="$otheropts $1" - ;; - - -h) - go=no - ;; - - - *) echo "Unknown option: $1" - echo "To use a specific workspace use, e.g.: spad -ws $1" - ciao - ;; - esac - - shift -done - -# 3. List the available workspaces, if asked - -listwspaces() -{ - echo "$1" - ls -l $2 | grep "sys$" - echo "" -} - -if [ $list = yes ] ; then - listwspaces "AXIOM workspaces in \$AXIOM/bin = $rootwsdir: " $rootwsdir -fi - -# 5. Try to ensure a suitable workspace on this host. - -if [ `expr $wsname : '.*/.*'` = 0 ] ; then - serverws=$rootwsdir/$wsname -else - serverws=$wsname -fi - -if [ ! -f $serverws ] ; then - showuse - ciao -fi - -# 6. Start processes - -if [ $go = no ] ; then - echo "Would now start the processes." - echo exec $SPAD/bin/sman $otheropts -ws $serverws - exit 0 -fi - -exec $SPAD/bin/sman $otheropts -ws $serverws diff --git a/src/sman/Makefile.pamphlet b/src/sman/Makefile.pamphlet index 5c73b11..f95a511 100644 --- a/src/sman/Makefile.pamphlet +++ b/src/sman/Makefile.pamphlet @@ -39,6 +39,15 @@ DOCFILES=${DOC}/bookvol6.dvi SMANOBJS= ${LIB}/libspad.a @ +\section{The axiom command} +<>= +${OUT}/axiom: ${IN}/bookvol6.pamphlet + @echo 1 making ${OUT}/axiom from ${IN}/bookvol6.pamphlet + @ (cd ${OUT} ; \ + ${TANGLE} -R"axiomcmd" ${IN}/bookvol6.pamphlet >axiom ) + @chmod +x ${OUT}/axiom + +@ \section{session} <>= ${OUTLIB}/session: ${SMANOBJS} ${MIDOBJ}/session.o @@ -122,12 +131,14 @@ ${DOC}/bookvol6.dvi: ${IN}/bookvol6.pamphlet @ <<*>>= <> -all: ${OUTLIB}/session ${OUTLIB}/spadclient ${OUT}/sman ${DOCFILES} +all: ${OUTLIB}/session ${OUTLIB}/spadclient ${OUT}/sman ${OUT}/axiom \ + ${DOCFILES} @ echo 18 finished ${IN} clean: @echo 19 cleaning ${SRC}/sman +<> <> <> <> diff --git a/src/sman/bookvol6.pamphlet b/src/sman/bookvol6.pamphlet index 4ab4355..ade0c54 100644 --- a/src/sman/bookvol6.pamphlet +++ b/src/sman/bookvol6.pamphlet @@ -22,7 +22,7 @@ Jonathan\ Steinbach & Robert\ Sutor & Barry\ Trager \\ Stephen\ Watt & Jim\ Wen & Clifton\ Williamson \end{array} $$ -\center{\large{VOLUME 6: SMAN}} +\center{\large{VOLUME 6: AXIOM COMMAND}} \end{titlepage} \pagenumbering{roman} \begin{verbatim} @@ -197,6 +197,208 @@ November 10, 2003 ((iHy)) The superman process, called sman, is normally invoked from the axiom shell script in order to start a tree of subprocesses. +\chapter{The axiom Command} +<>= +#!/bin/sh + +# Start everything for Axiom. +# +# axiom +# [-ht |-noht] whether to use HyperDoc +# [-gr |-nogr] whether to use Graphics +# [-clef |-noclef] whether to use Clef +# [-nag |-nonag] whether to use NAG +# [-iw |-noiw] start in interpreter window +# [-ihere|-noihere] start an interpreter buffer in the original window +# [-nox] don't use X Windows +# [-go |-nogo] whether to start system +# [-ws wsname] use named workspace +# [-list] list workspaces only +# [-grprog fname] use named program for Graphics +# [-nagprog fname] use named program for Nag +# [-htprog fname] use named program for HyperDoc +# [-clefprog fname] use named program for Clef +# [-sessionprog fname] use named program for session +# [-clientprog fname] use named program for spadclient +# [-h] show usage +# +# + +MALLOCTYPE=3.1 +export MALLOCTYPE + +# NAGMAN needs to know the hostname +HOST=`hostname` +export HOST + +# 0. Basic utilities + +ciao() { + echo "Goodbye." + exit 1 +} + +needsubopt () { + echo "The $1 option requires an argument." + ciao +} + + +showuse() { +echo "axiom" +echo " [-ht |-noht] whether to use HyperDoc" +echo " [-gr |-nogr] whether to use Graphics" +echo " [-clef |-noclef] whether to use Clef" +echo " [-nag |-nonag] whether to use NAG" +echo " [-iw |-noiw] start in interpreter window" +echo " [-ihere|-noihere] start an interpreter buffer in the original window." +echo " [-nox] don't use X Windows" +echo " [-go |-nogo] whether to start system" +echo " [-ws wsname] use named workspace" +echo " [-list] list workspaces only" +#echo " [-grprog fname] use named program for Graphics" +#echo " [-nagprog fname] use named program for Nag" +#echo " [-htprog fname] use named program for HyperDoc" +#echo " [-clefprog fname] use named program for Clef" +#echo " [-sessionprog fname] use named program for session" +#echo " [-clientprog fname] use named program for spadclient" +echo " [-h] show usage" +} + +# 1. Ensure the environment is set. + +# Just process '-h' + +if [ "$*" = "-h" ] ; then + showuse +fi +SPADDEFAULT=/axiom/mnt/linux + +if [ "$SPAD" = "" ] ; then + if [ "$AXIOM" = "" ] ; then + SPAD=$SPADDEFAULT + echo "AXIOM variable is not set" + echo "assuming AXIOM = $SPAD" + AXIOM=$SPAD + export AXIOM + else + SPAD=$AXIOM + fi + export SPAD +else + if [ "$AXIOM" = "" ] ; then + echo "AXIOM variable is not set" + echo "but SPAD = $SPAD" + echo "Using AXIOM = $SPAD" + AXIOM=$SPAD + export AXIOM + else + if [ ! "$SPAD" = "$AXIOM" ] ; then + echo "ignoring SPAD variable" + SPAD=$AXIOM + fi + fi +fi + +if [ "$AXIOMXLROOT" = "" ] ; then +AXIOMXLROOT=${AXIOM}/compiler +fi +export AXIOMXLROOT +PATH=$AXIOM/bin:$AXIOMXLROOT/bin:${PATH} +export PATH + + + +if [ ! -d "$SPAD" ] ; then + echo "The directory for Axiom, $SPAD, does not exist." + ciao +fi + +# Name the workspace directories. +rootwsdir=$SPAD/bin + +# 2. Process command line arguments. + +# Defaults for command-line arguments. +list=no +go=yes +wsname=AXIOMsys + +otheropts="" + +while [ "$*" != "" ] ; do + + case $1 in + -list) list=yes + go=no;; + -go) go=yes ;; + -nogo) go=no ;; + + -ws) + if [ "$2" = "" ] ; then needsubopt "$1" ; fi + shift + wsname="$1" + ;; + + -nagprog|-grprog|-htprog|-clefprog|-sessionprog|-clientprog|-paste|-rm|-rv) + if [ "$2" = "" ] ; then needsubopt "$1" ; fi + otheropts="$otheropts $1 $2" + shift + ;; + -clef|-noclef|-gr|-nogr|-ht|-noht|-iw|-noiw|-ihere|-noihere|-nox|-nag|-nonag) + otheropts="$otheropts $1" + ;; + + -h) + go=no + ;; + + + *) echo "Unknown option: $1" + echo "To use a specific workspace use, e.g.: spad -ws $1" + ciao + ;; + esac + + shift +done + +# 3. List the available workspaces, if asked + +listwspaces() +{ + echo "$1" + ls -l $2 | grep "sys$" + echo "" +} + +if [ $list = yes ] ; then + listwspaces "AXIOM workspaces in \$AXIOM/bin = $rootwsdir: " $rootwsdir +fi + +# 5. Try to ensure a suitable workspace on this host. + +if [ `expr $wsname : '.*/.*'` = 0 ] ; then + serverws=$rootwsdir/$wsname +else + serverws=$wsname +fi + +if [ ! -f $serverws ] ; then + showuse + ciao +fi + +# 6. Start processes + +if [ $go = no ] ; then + echo "Would now start the processes." + echo exec $SPAD/bin/sman $otheropts -ws $serverws + exit 0 +fi + +exec $SPAD/bin/sman $otheropts -ws $serverws +@ \chapter{Support Routines} \section{Command Completion} Hyperdoc has the ability to do command completion. The known commands