building scotty on SVR4 solaris 2.3

John P. Rouillard (rouilj@cs.umb.edu)
Tue, 26 Jul 1994 21:32:40 -0400

A few things were missing. There was no code in configure to check for
-lsocket and -l nsl which are needed to compile ntping and scotty.

Also bzero and bcopy need to be replaced with memset and memcpy since
the ucb library is buggy on SVR4 boxes.

Also there were conflicting prototypes for rpc_call, so I replaced all
calls to rpc_call with tcl_rpc_call. It appears thet the rpc_call
defined in the rpc header files is of type enum rpc_return or some
such under solaris.

Also, I was compiling with gcc. The standard sun unbundled compiler
defines solaris I think and not __svr4__ so you may have to add an

#if defined(SOLARIS) || defined(__svr4__)

to the section in ntping that deals with replacing the b* functions
with mem* functions.

The patch to ntping/Makefile.in is not entirely successful. It does
pull in the -lsocket and -lnsl but it also pulls in snmp/libsnmp.a,
which of course doesn't exist in the ntping directory.

So far, I can get the stuff I need from the tkined and scotty, so we
will see how well works after I get done redrawing the network and
putting lots of monitors up 8-).

===================================================================
RCS file: /sources/cvsrepos/scotty_tkined/scotty/configure,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 configure
376a377,421
> LIBS_save="${LIBS}"
> LIBS="${LIBS} -lsocket"
> have_lib=""
> echo checking for -lsocket
> cat > conftest.c <<EOF
> #include "confdefs.h"
>
> int main() { exit(0); }
> int t() { main(); }
> EOF
> if eval $compile; then
> rm -rf conftest*
> have_lib="1"
>
> fi
> rm -f conftest*
> LIBS="${LIBS_save}"
> if test -n "${have_lib}"; then
> :; LIBS="$LIBS -lsocket"
> else
> :;
> fi
>
> LIBS_save="${LIBS}"
> LIBS="${LIBS} -lnsl"
> have_lib=""
> echo checking for -lnsl
> cat > conftest.c <<EOF
> #include "confdefs.h"
>
> int main() { exit(0); }
> int t() { main(); }
> EOF
> if eval $compile; then
> rm -rf conftest*
> have_lib="1"
>
> fi
> rm -f conftest*
> LIBS="${LIBS_save}"
> if test -n "${have_lib}"; then
> :; LIBS="$LIBS -lnsl"
> else
> :;
> fi
===================================================================
RCS file: /sources/cvsrepos/scotty_tkined/scotty/rpc.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 rpc.c
248c248
< Tcl_CreateCommand(interp, rh->rpcId, rpc_call,
- ---
> Tcl_CreateCommand(interp, rh->rpcId, tcl_rpc_call,
353c353
< rpc_call (clientData, interp, argc, argv)
- ---
> tcl_rpc_call (clientData, interp, argc, argv)
===================================================================
RCS file: /sources/cvsrepos/scotty_tkined/scotty/scotty.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 scotty.h
114c114
< extern int rpc_call _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char **));
- ---
> extern int tcl_rpc_call _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char **));
===================================================================
RCS file: /sources/cvsrepos/scotty_tkined/scotty/ntping/Makefile.in,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 Makefile.in
39c39
< LIBS = # -lresolve -ldbmalloc
- ---
> LIBS = @LIBS@ # -lresolve -ldbmalloc
===================================================================
RCS file: /sources/cvsrepos/scotty_tkined/scotty/ntping/ntping.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 ntping.c
91a92,96
> #if defined(__svr4__)
> #define bzero(a,b) memset(a, 0, b)
> #define bcopy(a,b,c) memmove(b, a, c)
> #endif
>
===================================================================
RCS file: /sources/cvsrepos/scotty_tkined/tkined/configure,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 configure
638a639,689
> #
> # check for existance of -lsocket for svr4 socket functions
> #
> LIBS_save="${LIBS}"
> LIBS="${LIBS} -lsocket"
> have_lib=""
> echo checking for -lsocket
> cat > conftest.c <<EOF
> #include "confdefs.h"
>
> int main() { exit(0); }
> int t() { main(); }
> EOF
> if eval $compile; then
> rm -rf conftest*
> have_lib="1"
>
> fi
> rm -f conftest*
> LIBS="${LIBS_save}"
> if test -n "${have_lib}"; then
> :; LIBS="$LIBS -lsocket"
> else
> :;
> fi
>
> #
> # check for existance of -lnsl for svr4 net support library functions
> #
> LIBS_save="${LIBS}"
> LIBS="${LIBS} -lnsl"
> have_lib=""
> echo checking for -lnsl
> cat > conftest.c <<EOF
> #include "confdefs.h"
>
> int main() { exit(0); }
> int t() { main(); }
> EOF
> if eval $compile; then
> rm -rf conftest*
> have_lib="1"
>
> fi
> rm -f conftest*
> LIBS="${LIBS_save}"
> if test -n "${have_lib}"; then
> :; LIBS="$LIBS -lnsl"
> else
> :;
> fi