[Spread-users] NetBSD patch
Patrick Welche
prlw1 at newn.cam.ac.uk
Tue Jan 29 13:56:12 EST 2002
I found the patch below useful when just trying out CVS-spread on
NetBSD-1.5ZA/i386. BTW many of the man pages refer to libsp(3) - where can I
find it? (What's the difference between libsp and libtsp? Where do threads
come in?)
Cheers,
Patrick
Index: NetBSD_makefile
===================================================================
RCS file: /storage/cvsroot/spread/daemon/NetBSD_makefile,v
retrieving revision 1.1
diff -p -r1.1 NetBSD_makefile
*** NetBSD_makefile 22 Aug 2001 21:33:39 -0000 1.1
--- NetBSD_makefile 29 Jan 2002 18:42:45 -0000
*************** CC=gcc
*** 2,19 ****
MAKEFILE=NetBSD_makefile
YACC = bison -y
LEX = flex
#if you want more than one dir and include files will be taken auto
#remove comments from next 3 line and comment fourth line
#SRCDIRS= dir1 dir2
#INCL=$(SRCDIRS:%=-I%)
#CFLAGS = -O does not always work on BSDI pc
! CFLAGS = -ansi -c -Wall -O
TCFLAGS = $(CFLAGS) -D_REENTRANT
COBJS = lex.yy.o y.tab.o configuration.o skiplist.o acm.o
OBJS = alarm.o events.o memory.o membership.o data_link.o network.o status.o log.o flow_control.o message.o acp-permit.o auth-null.o auth-ip.o
BINS = spread spmonitor spuser simple_user spflooder
.SUFFIXES : .o .to .lo .tlo
--- 2,31 ----
MAKEFILE=NetBSD_makefile
YACC = bison -y
LEX = flex
+ STRIPFLAG ?= -s
+ COPY ?= -c
+ INSTALL = /usr/bin/install ${COPY} ${STRIPFLAG}
+ INSTALL_FILE ?= /usr/bin/install ${COPY}
+
+ LOCALDIR ?= /usr/local
+ BINDIR ?= ${LOCALDIR}/bin
+ LIBDIR ?= ${LOCALDIR}/lib
+ INCSDIR ?= ${LOCALDIR}/include
+ MANDIR ?= ${LOCALDIR}/man
#if you want more than one dir and include files will be taken auto
#remove comments from next 3 line and comment fourth line
#SRCDIRS= dir1 dir2
#INCL=$(SRCDIRS:%=-I%)
#CFLAGS = -O does not always work on BSDI pc
! CFLAGS = -ansi -c -Wall -O2
TCFLAGS = $(CFLAGS) -D_REENTRANT
COBJS = lex.yy.o y.tab.o configuration.o skiplist.o acm.o
OBJS = alarm.o events.o memory.o membership.o data_link.o network.o status.o log.o flow_control.o message.o acp-permit.o auth-null.o auth-ip.o
BINS = spread spmonitor spuser simple_user spflooder
+ LIBS = libsp.a
+ INCS = sp.h sp_events.h sp_func.h
.SUFFIXES : .o .to .lo .tlo
*************** y.tab.c y.tab.h: config_parse.y c
*** 71,76 ****
--- 83,95 ----
.c.to:
$(CC) $(TCFLAGS) -D_THREAD_SAFE -D_REENTRANT $*.c -o $*.to
+
+ install: ${BINS}
+ ${INSTALL} ${BINS} ${BINDIR}
+ ${INSTALL} ${LIBS} ${LIBDIR}
+ ${INSTALL_FILE} ${INCS} ${INCSDIR}
+ ${INSTALL_FILE} docs/*.1 ${MANDIR}/man1
+ ${INSTALL_FILE} docs/*.3 ${MANDIR}/man3
depend:
cp $(MAKEFILE) $(MAKEFILE).bak \
Index: arch.h
===================================================================
RCS file: /storage/cvsroot/spread/daemon/arch.h,v
retrieving revision 1.6
diff -p -r1.6 arch.h
*** arch.h 24 Jan 2002 04:47:49 -0000 1.6
--- arch.h 29 Jan 2002 18:42:46 -0000
***************
*** 46,52 ****
* #define HAVE_GOOD_VARGS ( exists if true )
* #define HAVE_LRAND48 ( exists if true )
* #define HAVE_STDINT_H ( exists if true --currently glibc2.1 needs it )
! * typedef {sys dependent type} sockopt_len_t
*/
#ifdef _AIX
--- 46,52 ----
* #define HAVE_GOOD_VARGS ( exists if true )
* #define HAVE_LRAND48 ( exists if true )
* #define HAVE_STDINT_H ( exists if true --currently glibc2.1 needs it )
! * typedef {sys dependent type} sockopt_len_t;
*/
#ifdef _AIX
***************
*** 57,62 ****
--- 57,66 ----
#endif
#endif
+ #ifdef __NetBSD__
+ #define ARCH_NETBSD
+ #endif
+
#ifdef __alpha__
#ifdef __linux__
#define ARCH_ALPHA_LINUX
***************
*** 124,137 ****
#define ARCH_SGI_IRIX
#endif
- #ifdef __m68k__
-
- #ifdef __NetBSD__
- #define ARCH_M68K_NETBSD
- #endif
-
- #endif /* __m68k */
-
#undef INTSIZE32
#undef INTSIZE64
#undef INTSIZE16
--- 128,133 ----
*************** typedef int socklen_t;
*** 364,384 ****
#define ERR_TIMEDOUT ETIMEDOUT
#endif /* ARCH_SGI_UNIX */
! #ifdef ARCH_M68K_NETBSD
! #define INTSIZE32
#define ARCH_SCATTER_CONTROL
! #define ARCH_ENDIAN 0x00000000
! #define LOC_INLINE __inline__
! #include <sys/types.h>
#include <sys/uio.h>
! #define ARCH_SCATTER_SIZE UIO_MAXIOV
#define HAVE_GOOD_VARGS
typedef int sockopt_len_t;
! /* Already defined
! typedef int socklen_t; */
! #define ERR_TIMEDOUT ETIMEDOUT
! #endif /* ARCH_M68K_NETBSD */
!
#ifdef ARCH_PC_WIN95
#define INTSIZE32
#define ARCH_SCATTER_NONE
--- 360,395 ----
#define ERR_TIMEDOUT ETIMEDOUT
#endif /* ARCH_SGI_UNIX */
! #ifdef ARCH_NETBSD
! #include <machine/limits.h>
! #if LONG_BIT == 64
! #define INTSIZE64
! #elif LONG_BIT == 32
! #define INTSIZE32
! #elif LONG_BIT == 16
! #define INTSIZE16
! #else
! #error LONG_BIT not defined.
! #endif /* LONG_BIT */
#define ARCH_SCATTER_CONTROL
! #include <machine/endian.h>
! #if BYTE_ORDER == BIG_ENDIAN
! #define ARCH_ENDIAN 0x00000000
! #elif BYTE_ORDER == LITTLE_ENDIAN
! #define ARCH_ENDIAN 0x80000080
! #else
! #error BYTE_ORDER not defined.
! #endif /* BYTE_ORDER */
! #define LOC_INLINE __inline__
#include <sys/uio.h>
! #define ARCH_SCATTER_SIZE UIO_MAXIOV
#define HAVE_GOOD_VARGS
+ /* #undef HAVE_LRAND48 */
+ #define HAVE_STDINT_H
typedef int sockopt_len_t;
! #define ERR_TIMEDOUT ETIMEDOUT
! #endif /* ARCH_NETBSD */
!
#ifdef ARCH_PC_WIN95
#define INTSIZE32
#define ARCH_SCATTER_NONE
Index: sp_events.h
===================================================================
RCS file: /storage/cvsroot/spread/daemon/sp_events.h,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 sp_events.h
*** sp_events.h 21 Aug 2001 14:28:21 -0000 1.1.1.1
--- sp_events.h 29 Jan 2002 18:42:46 -0000
***************
*** 35,41 ****
#define INC_SP_EVENTS
/*
! User level code shoud NOT include this file directly.
Include sp.h instead.
Spread daemon level code should include this file directly and NOT include sp.h
*/
--- 35,41 ----
#define INC_SP_EVENTS
/*
! User level code should NOT include this file directly.
Include sp.h instead.
Spread daemon level code should include this file directly and NOT include sp.h
*/
*************** void E_handle_events(void);
*** 100,108 ****
void E_exit_events(void);
#endif /* INC_SP_EVENTS */
-
-
-
-
-
-
--- 100,102 ----
Index: spread.c
===================================================================
RCS file: /storage/cvsroot/spread/daemon/spread.c,v
retrieving revision 1.6
diff -p -r1.6 spread.c
*** spread.c 12 Dec 2001 15:07:38 -0000 1.6
--- spread.c 29 Jan 2002 18:42:47 -0000
***************
*** 41,46 ****
--- 41,53 ----
#include "log.h"
#include "alarm.h"
+ /* auth-null.c: */
+ void null_init(void);
+ /* auth-ip.c: */
+ void ip_init(void);
+ /* acp-permit.c: */
+ void permit_init(void);
+
#ifndef ARCH_PC_WIN95
#include <grp.h>
#include <pwd.h>
More information about the Spread-users
mailing list