[Spread-cvs] cvs commit: spread/daemon NetBSD_makefile arch.h sp_events.h spread.c Readme.txt

jonathan at spread.org jonathan at spread.org
Mon Feb 4 17:35:10 EST 2002


jonathan    02/02/04 17:35:10

  Modified:    daemon   NetBSD_makefile arch.h sp_events.h spread.c
                        Readme.txt
  Log:
  Improved NetBSD makefile (should work on platforms besides m68k) and
  warning fixes from Patrick Welche.
  
  Revision  Changes    Path
  1.2       +20 -1     spread/daemon/NetBSD_makefile
  
  Index: NetBSD_makefile
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/NetBSD_makefile,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NetBSD_makefile	22 Aug 2001 21:33:39 -0000	1.1
  +++ NetBSD_makefile	4 Feb 2002 22:35:08 -0000	1.2
  @@ -2,18 +2,30 @@
   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 -O
  +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
   
  @@ -71,6 +83,13 @@
   
   .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 \
  
  
  
  1.8       +35 -9     spread/daemon/arch.h
  
  Index: arch.h
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/arch.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- arch.h	3 Feb 2002 21:08:48 -0000	1.7
  +++ arch.h	4 Feb 2002 22:35:08 -0000	1.8
  @@ -46,7 +46,7 @@
    *      #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
  + *      typedef         {sys dependent type} sockopt_len_t;
    */
   
   #ifdef _AIX
  @@ -57,6 +57,10 @@
   #endif
   #endif
   
  +#ifdef __NetBSD__
  +#define ARCH_ALL_NETBSD
  +#endif
  +
   #ifdef __alpha__
   #ifdef __linux__
   #define ARCH_ALPHA_LINUX
  @@ -364,20 +368,38 @@
   #define         ERR_TIMEDOUT    ETIMEDOUT
   #endif /* ARCH_SGI_UNIX */
   
  -#ifdef ARCH_M68K_NETBSD
  -#define         INTSIZE32       
  +#ifdef ARCH_ALL_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
  -#define         ARCH_ENDIAN     0x00000000
  +
  +#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/types.h>
   #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;
  -/* Already defined
  -typedef         int socklen_t;  */
   #define         ERR_TIMEDOUT    ETIMEDOUT
  -#endif  /* ARCH_M68K_NETBSD */
  +#endif  /* ARCH_ALL_NETBSD */
    
   #ifdef ARCH_PC_WIN95 
   #define         INTSIZE32
  @@ -393,9 +415,13 @@
   #define         MAXPATHLEN      _MAX_PATH
   #define         snprintf        _snprintf
   #define         alloca          _alloca
  +/* Sockets are not file descriptors on windows so they need a special close function. */
   #define         close           closesocket
  +/* Windows defines a default size of 64. However, the size of fd_set array for select
  + * can be raised by defining a larger constant before including windows.h winsock.h
  + */
   #define         FD_SETSIZE      1024
  -#endif /* ARCH */
  +#endif /* ARCH_PC_WIN95 */
   
   /* to grab UINT32_MAX definitions if they exist */
   #ifdef HAVE_STDINT_H
  
  
  
  1.2       +1 -7      spread/daemon/sp_events.h
  
  Index: sp_events.h
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/sp_events.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sp_events.h	21 Aug 2001 14:28:21 -0000	1.1
  +++ sp_events.h	4 Feb 2002 22:35:09 -0000	1.2
  @@ -35,7 +35,7 @@
   #define	INC_SP_EVENTS
   
   /*
  -  User level code shoud NOT include this file directly. 
  +  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
   */ 
  @@ -100,9 +100,3 @@
   void 	E_exit_events(void);
   
   #endif	/* INC_SP_EVENTS */
  -
  -
  -
  -
  -
  -
  
  
  
  1.8       +7 -0      spread/daemon/spread.c
  
  Index: spread.c
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/spread.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- spread.c	3 Feb 2002 21:10:59 -0000	1.7
  +++ spread.c	4 Feb 2002 22:35:09 -0000	1.8
  @@ -63,6 +63,13 @@
   
   static	void	Usage(int argc, char *argv[]);
   
  +/* auth-null.c: */
  +void null_init(void);
  +/* auth-ip.c: */
  +void ip_init(void);
  +/* acp-permit.c: */
  +void permit_init(void);
  +
   int main(int argc, char *argv[])
   {
   #ifdef	ARCH_PC_WIN95
  
  
  
  1.14      +1 -0      spread/daemon/Readme.txt
  
  Index: Readme.txt
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/Readme.txt,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Readme.txt	3 Feb 2002 21:10:59 -0000	1.13
  +++ Readme.txt	4 Feb 2002 22:35:09 -0000	1.14
  @@ -58,6 +58,7 @@
         Thanks to Marc Zyngier for discovering the problem and writing and 
         testing a patch for it.
      c) Raise the FD_SETSIZE for windows to 1024 by #defining it in arch.h.
  +4) Included improved NetBSD makefile and warning fix from Patrick Welche.
   
   December 11, 2001 Ver 3.16.1  
   ------------------------
  
  
  





More information about the Spread-cvs mailing list