home *** CD-ROM | disk | FTP | other *** search
- :
- #!/bin/sh
- #
- # $Header: genosntab.sh,v 6.14 89/08/02 08:17:07 csimmons Exp $
- #
- # Genosntab generates osntab.c
- # usage: genosntab [-n prefix-letter ... ]
- # -c: Force utilization of a client directory structure.
- # Provided for installation scripts.
- # -n: do not include drivers with given prefix letters
- # e.g. "genosntab -n T A" excludes TCP/IP and ASYNC drivers
- #
- # List of valid driver prefixes:
- PREFIXES='A|D|F|P|T|M|N|TT|STAR|APPC|NTT'
- #
- USAGE="usage: $0 [-c -n prefix-letter ... ]"
-
- CHECK='[ "$NSEEN" = "" ] && { echo $USAGE; exit 1; }'
-
- CLIENT="F"
-
- # Default is to use all available drivers
- for lett in `echo $PREFIXES | sed 's/|/ /g'`
- do
- eval USE_$lett=true
- done
-
- for arg in $* # check for drivers to exclude
- do
- case $arg in
-
- -n) NSEEN=1
- ;;
-
- A|D|F|P|T|M|N|TT|STAR|APPC|NTT|a|d|f|p|t|m|n|tt|star|appc|ntt)
- eval "$CHECK" # must have -n
- lett=`echo $arg | tr [a-z] [A-Z]` # uppercase arg
- eval USE_$lett=no
- ;;
-
- -c) # Force install scripts to assume client site.
- CLIENT="T"
- ;;
-
- *) echo $USAGE; exit 1 ;;
- esac
- done
-
- if [ "$SRCHOME" != "" -a "$CLIENT" != "T" ] ; then
- ASYNCLIB=$SRCHOME/net/async/libasync.a
- DNTLIB=$SRCHOME/net/dnt/libdnt.a
- MBXLIB=$SRCHOME/net/mbx/libmbx.a
- NETEXLIB=$SRCHOME/net/netex/libnetex.a
- TCPLIB=$SRCHOME/net/tcp/libtcp.a
- TCPTLILIB=$SRCHOME/net/tli/tcptli/libtcptli.a
- STARLIB=$SRCHOME/net/tli/star/libstar.a
- APPCLIB=$SRCHOME/net/lu62/liblu62.a
- SQLNETLIB=$SRCHOME/net/utt/libutt.a
- NTTLIB=$SRCHOME/net/ntt/libntt.a
- else
- nm $ORACLE_HOME/rdbms/lib/libsqlnet.a > /tmp/sqlnet$$ 2> /dev/null
- if [ "`grep osnasy /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_A="false"
- fi
- if [ "`grep osndnt /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_D="false"
- fi
- if [ "`grep osnmbx /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_M="false"
- fi
- if [ "`grep osnnetex /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_N="false"
- fi
- if [ "`grep osnttt /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_T="false"
- fi
- if [ "`grep osntlitcp /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_TT="false"
- fi
- if [ "`grep osntlistar /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_STAR="false"
- fi
- if [ "`grep osnl62 /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_APPC="false"
- fi
- if [ "`grep ntt_connect /tmp/sqlnet$$ 2> /dev/null`" = "" ] ; then
- USE_NTT="false"
- fi
- rm /tmp/sqlnet$$ 2> /dev/null
- SQLNETLIB=$ORACLE_HOME/rdbms/lib/libsqlnet.a
- ASYNCLIB=$ORACLE_HOME/async/lib/libasync.a
- DNTLIB=$ORACLE_HOME/dnt/lib/libdnt.a
- MBXLIB=$ORACLE_HOME/mbx/lib/libmbx.a
- NETEXLIB=$ORACLE_HOME/netex/lib/libnetex.a
- TCPLIB=$ORACLE_HOME/tcp/lib/libtcp.a
- TCPTLILIB=$ORACLE_HOME/tcptli/lib/libtcptli.a
- STARLIB=$ORACLE_HOME/star/lib/libstar.a
- APPCLIB=$ORACLE_HOME/lu62/lib/liblu62.a
- NTTLIB=$ORACLE_HOME/ntt/lib/libntt.a
- fi
-
- NO_DRIVERS="true"
-
- echo "\
-
- /*
- **
- ** This File Is GENERATED By genosntab.
- **
- */
- "
-
- echo "extern int osnsgl(); /* single task private */"
-
- if [ -f $ASYNCLIB -a "$USE_A" = "true" ]
- then
- echo "extern int osnasy(); /* Async driver */"
- NO_DRIVERS="false"
- fi
- if [ -f $DNTLIB -a "$USE_D" = "true" ]
- then
- echo "extern int osndnt(); /* DECNET two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $MBXLIB -a "$USE_M" = "true" ]
- then
- echo "extern int osnmbx(); /* MBX two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $NETEXLIB -a "$USE_N" = "true" ]
- then
- echo "extern int osnnetex(); /* NETEX two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $TCPLIB -a "$USE_T" = "true" ]
- then
- echo "extern int osnttt(); /* TCP two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $TCPTLILIB -a "$USE_TT" = "true" ]
- then
- echo "extern int osntlitcp(); /* TCPTLI two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $STARLIB -a "$USE_STAR" = "true" ]
- then
- echo "extern int osntlistar(); /* STARLAN two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $APPCLIB -a "$USE_APPC" = "true" ]
- then
- echo "extern int osnl62(); /* LU 6.2 two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $NTTLIB -a "$USE_NTT" = "true" ]
- then
- echo "extern int ntt_connect(); /* NCube two task */"
- NO_DRIVERS="false"
- fi
- if [ -f $SQLNETLIB ]
- then
- if [ "$USE_P" = "true" ]
- then
- echo "extern int osnptt(); /* pipe two task */"
- NO_DRIVERS="false"
- fi
- if [ "$USE_F" = "true" ]
- then
- echo "extern int osnftt(); /* Fast two task */"
- NO_DRIVERS="false"
- fi
- fi
-
- echo "struct ifcdef"
- echo "{"
- echo "int (*ifcfun)(); /* connect function */"
- echo "char * ifcfnm; /* fixed name */"
- echo "char * ifcprf; /* interface prefix w/ delimeter (P:,S:,TT:,...) */"
- echo "char * ifcdsc; /* interface description (private,shared,...) */"
- echo "char * ifcdfl; /* char * to pass if none from attach */"
- echo "char * ifcprm; /* add'l parameter char * for connect calls */"
- echo "};"
- echo "typedef struct ifcdef ifcdef;"
- echo ""
- echo "ifcdef osntab[] ="
- echo "{"
- echo "/* FUNC NAME PREFIX DESCRIPTION DFLT PARAM */"
- echo '# if defined(SYS_SGL)'
- echo ' { osnsgl, "SINGLE_TASK:", "S:", "Single task", "", ""},'
- echo '# else'
- if [ -f $SQLNETLIB ]
- then
- if [ "$USE_P" = "true" ]
- then
- echo ' { osnptt, "PIPE_TWO_TASK:", "P:", "Pipe Two-Task","", ""},'
- fi
- if [ "$USE_F" = "true" ]
- then
- echo ' { osnftt, "FAST_TWO_TASK:", "F:", "Fast Two-Task","", ""},'
- fi
- fi
- if [ -f $ASYNCLIB -a "$USE_A" = "true" ]
- then
- echo ' { osnasy, "ASYNC:", "A:", "Async link", "", ""},'
- fi
- if [ -f $DNTLIB -a "$USE_D" = "true" ]
- then
- echo ' { osndnt, "DECNET_TWO_TASK:", "D:", "Decnet Two-Task","", ""}, '
- fi
- if [ -f $MBXLIB -a "$USE_M" = "true" ]
- then
- echo ' { osnmbx, "MBX_TWO_TASK:", "M:", "MBX Two-Task","", ""}, '
- fi
- if [ -f $NETEXLIB -a "$USE_N" = "true" ]
- then
- echo ' { osnntx, "NETEX_TWO_TASK:", "N:", "NETEX Two-Task","sqlnet", ""}, '
- fi
- if [ -f $TCPLIB -a "$USE_T" = "true" ]
- then
- echo ' { osnttt, "TCP_TWO_TASK:", "T:", "TCP Two-Task","sqlnet", ""}, '
- fi
- if [ -f $TCPTLILIB -a "$USE_TT" = "true" ]
- then
- echo ' { osntlitcp, "TCPTLI_TWO_TASK:", "TT:", "TCPTLI Two-Task","sqlnet", ""}, '
- fi
- if [ -f $STARLIB -a "$USE_STAR" = "true" ]
- then
- echo ' { osntlistar, "STAR_TWO_TASK:", "STAR:", "Starlan Two-Task","sqlnet", ""}, '
- fi
- if [ -f $APPCLIB -a "$USE_APPC" = "true" ]
- then
- echo ' { osnl62, "LU62_TWO_TASK:", "APPC:", "LU62 Two-Task","sqlnet", ""}, '
- fi
- if [ -f $NTTLIB -a "$USE_NTT" = "true" ]
- then
- echo ' { ntt_connect, "NCUBE_TWO_TASK:", "NTT:", "NCube Two-Task","", ""}, '
- fi
- echo '# endif'
- echo '{ 0,0,0,0,0,0 }'
- echo '};'
-
- echo 'ifcdef *osndfn = &osntab[0]; /* without host: default is single */'
- echo 'ifcdef *osndfh = &osntab[0]; /* with host: default is Two Task */'
-
- if [ $NO_DRIVERS = "true" ]; then
- echo
- echo " YOU HAVE NOT INCLUDED ANY DRIVERS IN osntab[], CHECK $SQLNETLIB"
- exit 1
- else
- exit 0
- fi
-