Browse Source

Ticket 48797 - Add freebsd support to ns-slapd: Header files

Description: Add header file support for freeBSD

https://fedorahosted.org/389/ticket/48797

Author: wibrown

Reviewed by: lslebodn (Thanks!)
William Brown 9 years ago
parent
commit
eb4c74043c

+ 26 - 0
include/base/systems.h

@@ -142,6 +142,32 @@
 #define NET_SOCKETS
 #define SHMEM_MMAP_FLAGS MAP_SHARED
 
+#elif defined(__FreeBSD__)
+
+#define ACCELERATOR_CACHE
+#define DNS_CACHE
+#define FILE_INHERIT_FCNTL
+#define DAEMON_UNIX_MOBRULE
+#define BSD_RLIMIT
+#define BSD_SIGNALS
+#define FILE_UNIX_MMAP
+#define FILE_MMAP_FLAGS (MAP_FILE | MAP_SHARED)
+#define SHMEM_UNIX_MMAP
+#define SHMEM_MMAP_FLAGS MAP_SHARED
+#define AUTH_DBM
+#define SEM_FLOCK
+#define DLL_CAPABLE
+#define DLL_DLOPEN
+#define DLL_DLOPEN_FLAGS RTLD_NOW
+#define HAVE_ATEXIT
+#define HAS_STATFS
+#define JAVA_STATIC_LINK
+#undef NEED_CRYPT_PROTO
+#define NET_SOCKETS
+#ifndef NO_DOMAINNAME
+#define NO_DOMAINNAME
+#endif
+
 #else
 #error "Missing defines in ns/netsite/include/base/systems.h"
 #endif

+ 9 - 0
include/public/base/systems.h

@@ -65,6 +65,15 @@
 #define SHMEM_UNIX_MMAP
 #define ZERO(ptr,len) memset(ptr,0,len)
 
+#elif defined(__FreeBSD__)
+
+#define FILE_UNIX
+#define FILE_UNIX_MMAP
+#define MALLOC_POOLS
+#define SEM_FLOCK
+#define SHMEM_UNIX_MMAP
+#define ZERO(ptr,len) memset(ptr,0,len)
+
 #else
 #error "Missing defines in ns/netsite/include/public/base/systems.h"
 #endif

+ 4 - 4
ldap/include/portable.h

@@ -124,7 +124,7 @@
  * Are sys_errlist and sys_nerr declared in stdio.h?
  */
 #ifndef SYSERRLIST_IN_STDIO
-#if defined( freebsd ) || defined(Linux)
+#if defined( __FreeBSD__ ) || defined(Linux)
 #define SYSERRLIST_IN_STDIO
 #endif
 #endif
@@ -250,7 +250,7 @@ int strncasecmp(const char *, const char *, size_t);
     defined(UNIXWARE) || defined(SUNOS4) || defined(SNI) || defined(BSDI) || \
     defined(NCR) || defined(OSF1) || defined(NEC) || \
     ( defined(HPUX10) && !defined(_REENTRANT)) || defined(HPUX11) || \
-    defined(UnixWare) || defined(LINUX2_0)
+    defined(UnixWare) || defined(LINUX2_0) || defined (__FreeBSD__)
 #define GETHOSTBYNAME( n, r, b, l, e )  gethostbyname( n )
 #elif defined(AIX)
 #define GETHOSTBYNAME_BUF_T struct hostent_data
@@ -282,7 +282,7 @@ typedef char GETHOSTBYADDR_buf_t [BUFSIZ];
 
 
 #if defined(HPUX9) || defined(LINUX1_2) || defined(SUNOS4) || defined(SNI) || \
-    defined(SCOOS) || defined(BSDI) || defined(NCR) || \
+    defined(SCOOS) || defined(BSDI) || defined(NCR) || defined (__FreeBSD__) || \
     defined(NEC) || ( defined(HPUX10) && !defined(_REENTRANT)) 
 #define CTIME( c, b, l )		ctime( c )
 #elif defined( hpux10 )
@@ -312,7 +312,7 @@ char *strtok_r(char *, const char *, char **);
 extern char *strdup();
 #endif /* ultrix || nextstep */
 
-#if defined( sunos4 ) || defined( OSF1 )
+#if defined( sunos4 ) || defined( OSF1 ) || defined (__FreeBSD__)
 #define	BSD_TIME	1	/* for servers/slapd/log.h */
 #endif /* sunos4 || osf */
 

+ 5 - 0
ldap/servers/slapd/tools/ldclt/ldclt.h

@@ -172,6 +172,11 @@ dd/mm/yy | Author	| Comments
 #if defined(USE_OPENLDAP)
 #define ABS(x) ((x > 0) ? (x) : (-x))
 #endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 /*
  * Misc constant definitions
  */