diff -r 367e5999a90e make/defines_COMMON.mk --- a/make/defines_COMMON.mk Thu May 07 03:20:10 2009 -0700 +++ b/make/defines_COMMON.mk Mon Jul 20 17:56:25 2009 +0000 @@ -90,6 +90,9 @@ #JDK_INFORMATION # JDK_DIR = /usr +ifeq ($(OS_ARCH),FreeBSD) +JDK_DIR = /usr/local/ +endif JAVA = $(JDK_DIR)/bin/java #Java defines diff -r 367e5999a90e make/defines___.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/defines___.mk Mon Jul 20 17:56:25 2009 +0000 @@ -0,0 +1,150 @@ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# +# THE BSD LICENSE +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# Neither the name of the nor the names of its contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +include $(BUILD_ROOT)/make/defines_UNIX.mk +LOCAL_COPY=0 + +PERL_DIR =/usr +PERL5 =$(PERL_DIR)/bin/perl +PERL =$(PERL5) +CC =$(PRE_CC) /usr/bin/g++ +C =$(PRE_C) /usr/bin/gcc +C++C =$(CC) +AR =/usr/bin/ar +TAR =/usr/bin/tar +RANLIB =/usr/bin/ranlib +LD =$(PRE_LD) /usr/bin/g++ +ZIP =/usr/local/bin/zip +UNZIP =/usr/local/bin/unzip +GZIP =/usr/bin/gzip +GUNZIP =/usr/bin/gunzip +SHELL =/bin/sh +DATE =/bin/date +MKDIR =/bin/mkdir +TOUCH =/usr/bin/touch +CHMOD =/bin/chmod +CP =/bin/cp +MV =/bin/mv +ECHO =/bin/echo +SED =/usr/bin/sed +MKDIR =/bin/mkdir +LN =/bin/ln -f +NMAKE =/usr/bin/make -f +STRIP =/usr/bin/strip -x +RM =/bin/rm + +# -L flag dereferences symbolic links, else symlinks are copied as is +CP_R =/bin/cp -rL + +ifndef GCC_VERSION +GCC_VERSION = $(shell $(C) -dumpversion) +endif + +BASEFLAGS = -Wall + +ifdef DEBUG_BUILD +# easy on the warnings for now +CC_DEBUG = -g $(BASEFLAGS) -Wno-unknown-pragmas -Wno-non-virtual-dtor -Wno-unused +C_DEBUG = -g $(BASEFLAGS) +LD_DEBUG = +else +# optimized settings here +CC_DEBUG = -O3 $(BASEFLAGS) -Wno-unknown-pragmas -Wno-non-virtual-dtor -Wno-unused +C_DEBUG = -O3 $(BASEFLAGS) +LD_DEBUG = -s +endif + +RPATH_PREFIX = -Wl,-rpath, +RPATH_ORIGIN = \$$ORIGIN + +PLATFORM_DEF = -DBSD -D_REENTRANT -D_LARGEFILE64_SOURCE + +# -verbose for printing all informational messags +# -w0 for stricter than ANSI-C prototype warnings +# -fPIC is needed for any code that ends up in a shared library +ifndef NO_KPIC +PLATFORM_CC_OPTS = -fPIC +PLATFORM_C_OPTS = -fPIC +endif +PLATFORM_LD_OPTS = +LD_DYNAMIC = $(PLATFORM_LD_OPTS) -shared +LD_SYMBOLIC = -Wl,-Bsymbolic + +# These libraries are platform-specific, not system-specific +# WARNING Don't use the -thread option, use -pthread option +PLATFORM_LIB += $(PRE_PLATFORM_LIB) pthread crypt + +JNI_MD_NAME = freebsd +JNI_MD_SYSNAME = i386 +JNI_MD_SYSNAME64 = amd64 +SETUPSDK_JNIDIR = Unix/Linux/X86 + +# Disable OS specific stats collection +#FEAT_PLATFORM_STATS + +# force native threads to be used at build runtime +export THREADS_FLAG=native + +# Linux needs to be taken by the hand and told each and every directory +# where it might find libaries that other shared libs have dependencies to +LD_FLAGS += $(addprefix -Xlinker -rpath-link -Xlinker ,$(LIBDIRS)) +LD_FLAGS += $(addprefix -Xlinker -rpath-link -Xlinker ,$(LOCAL_LIBDIRS)) +LD_FLAGS += $(addprefix -Xlinker -rpath-link -Xlinker ,$(SYSTEM_LIBDIRS)) + +# No support for mapfiles +USE_MAPFILE= + +# Add platform specific NSS modules +SECURITY_MODULE_LIBS += freebl3 + +NSPR_INC=-I/usr/local/include/nspr +NSPR_LIBDIR=/usr/local/lib +NSS_INC=-I/usr/local/include/nss -I/usr/local/include/nss/nss +NSS_LIBDIR=/usr/local/lib/nss +LDAPSDK_INC=-I/usr/local/include/mozldap +LDAPSDK_LIBDIR=/usr/local/lib/mozldap +ZLIB_INC=-I/usr/local/include +ZLIB_LIBDIR= +XERCESC_INC=-I/usr/local/include +XERCESC_LIBDIR=/usr/local/lib +XALANC_INC=-I/usr/local/include +XALANC_LIBDIR=/usr/local/lib +PCRE_INC=-I/usr/local/include +PCRE_LIBDIR=/usr/local/lib +ICU_INC=-I/usr/local/include +ICU_LIBDIR=/usr/local/lib +SASL_INC=-I/usr/local/include +SASL_LIBDIR=/usr/local/lib + +# Construct platform specific LD_LIBRARY path component +PLATFORM_LIBPATH=$(NSS_LIBDIR):$(LDAPSDK_LIBDIR) diff -r 367e5999a90e make/rules___.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/rules___.mk Mon Jul 20 17:56:25 2009 +0000 @@ -0,0 +1,34 @@ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# +# THE BSD LICENSE +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# Neither the name of the nor the names of its contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +include ${BUILD_ROOT}/make/rules_x86_Linux_2.4.mk diff -r 367e5999a90e src/server/base/Makefile --- a/src/server/base/Makefile Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/Makefile Mon Jul 20 17:56:25 2009 +0000 @@ -59,6 +59,9 @@ ifeq ($(OS_ARCH),Linux) LOCAL_DEF+= -DUSE_POSIXFDPASSING endif +ifeq ($(OS_ARCH),FreeBSD) +LOCAL_DEF+= -DUSE_POSIXFDPASSING +endif AR_TARGET=libbase EXPORT_LIBRARIES=$(AR_TARGET) diff -r 367e5999a90e src/server/base/crit.cpp --- a/src/server/base/crit.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/crit.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -61,10 +61,11 @@ PRLock *lock; PRUint32 count; PRThread *owner; -} critical_t; +} critical_t_webserver; + /* In /usr/include/sys/types.h:147: has 'critical_t'*/ typedef struct condvar { - critical_t *lock; + critical_t_webserver *lock; PRCondVar *cvar; } condvar_t; @@ -74,14 +75,14 @@ */ NSAPI_PUBLIC int crit_owner_is_me(CRITICAL id) { - critical_t *crit = (critical_t*)id; + critical_t_webserver *crit = (critical_t_webserver*)id; return (crit->owner == PR_GetCurrentThread()); } NSAPI_PUBLIC CRITICAL crit_init(void) { - critical_t *crit = (critical_t*)PERM_MALLOC(sizeof(critical_t)) ; + critical_t_webserver *crit = (critical_t_webserver*)PERM_MALLOC(sizeof(critical_t_webserver)) ; if (crit) { if (!(crit->lock = PR_NewLock())) { @@ -96,7 +97,7 @@ NSAPI_PUBLIC void crit_enter(CRITICAL id) { - critical_t *crit = (critical_t*)id; + critical_t_webserver *crit = (critical_t_webserver*)id; PRThread *me = PR_GetCurrentThread(); if ( crit->owner == me) { @@ -113,7 +114,7 @@ NSAPI_PUBLIC void crit_exit(CRITICAL id) { - critical_t *crit = (critical_t*)id; + critical_t_webserver *crit = (critical_t_webserver*)id; if (crit->owner != PR_GetCurrentThread()) return; @@ -127,7 +128,7 @@ NSAPI_PUBLIC void crit_terminate(CRITICAL id) { - critical_t *crit = (critical_t*)id; + critical_t_webserver *crit = (critical_t_webserver*)id; PR_DestroyLock((PRLock*)crit->lock); PERM_FREE(crit); @@ -139,7 +140,7 @@ NSAPI_PUBLIC CONDVAR condvar_init(CRITICAL id) { - critical_t *crit = (critical_t*)id; + critical_t_webserver *crit = (critical_t_webserver*)id; condvar_t *cvar = (condvar_t*)PERM_MALLOC(sizeof(condvar_t)) ; diff -r 367e5999a90e src/server/base/dll.cpp --- a/src/server/base/dll.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/dll.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -186,7 +186,7 @@ #endif } -NSAPI_PUBLIC char *dll_error(DLHANDLE) +NSAPI_PUBLIC const char *dll_error(DLHANDLE) { #if defined(USE_NSPR_DLL) return PR_DLLError(); diff -r 367e5999a90e src/server/base/dll.h --- a/src/server/base/dll.h Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/dll.h Mon Jul 20 17:56:25 2009 +0000 @@ -94,7 +94,7 @@ /* * dll_error returns a string describing the last error on the given handle */ -NSAPI_PUBLIC char *dll_error(DLHANDLE dlp); +NSAPI_PUBLIC const char *dll_error(DLHANDLE dlp); /* diff -r 367e5999a90e src/server/base/dnsdmain.cpp --- a/src/server/base/dnsdmain.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/dnsdmain.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -69,7 +69,7 @@ #ifdef XP_UNIX NSPR_BEGIN_EXTERN_C -#ifdef HPUX +#ifdef BSD extern int gethostname (char *name, size_t namelen); #else #if !defined(AIX) && !defined(IRIX) && !defined(LINUX) diff -r 367e5999a90e src/server/base/file.cpp --- a/src/server/base/file.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/file.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -68,6 +68,11 @@ #include "private/pprio.h" #include "prlock.h" +#if defined(BSD) +#define stat64 stat +#define fstat64 fstat +#define lstat64 lstat +#endif /* --- globals -------------------------------------------------------------*/ /* PRFileDesc * SYS_ERROR_FD = NULL; */ diff -r 367e5999a90e src/server/base/net.cpp --- a/src/server/base/net.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/net.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -42,7 +42,7 @@ #include "netsite.h" -#ifdef Linux +#if defined(Linux) || defined(BSD) #include #endif diff -r 367e5999a90e src/server/base/systems.h --- a/src/server/base/systems.h Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/systems.h Mon Jul 20 17:56:25 2009 +0000 @@ -88,7 +88,7 @@ #ifdef HW_THREADS #define THREAD_ANY #endif -#elif defined(BSDI) +#elif defined(BSD) #define AUTH_DBM #define BSD_MAIL @@ -107,6 +107,10 @@ #define SEM_FLOCK #define SHMEM_MMAP_FLAGS MAP_SHARED #define JAVA_STATIC_LINK +#define SA_HANDLER_T(x) (void (*)(int))x +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW #elif defined(HPUX) diff -r 367e5999a90e src/server/base/util.cpp --- a/src/server/base/util.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/util.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -1684,7 +1684,12 @@ // XXX this needs bounds checks char *start = pt; char *scrap; +#if defined(BSD) + /* Time.h on BSD doesn't have this daylight varaible */ + int isdst = 0; +#else int isdst = daylight ? -1 /* unknown */ : 0 /* TZ doesn't have DST */; +#endif for (; *format; ++format) { if (*format == '%') @@ -1838,7 +1843,7 @@ continue; case 'z': { -#ifdef BSD_TIME +#ifdef BSD int tz = t->tm_gmtoff; #else int tz = -timezone; @@ -1990,7 +1995,7 @@ { struct passwd *rv; -#if defined(AIX) || defined(LINUX) || defined(HPUX) +#if defined(AIX) || defined(LINUX) || defined(HPUX) || defined(BSD) errno = getpwnam_r(name, result, buffer, buflen, &rv); if (errno != 0) rv = NULL; @@ -2011,7 +2016,7 @@ { struct passwd *rv; -#if defined(AIX) || defined(LINUX) || defined(HPUX) +#if defined(AIX) || defined(LINUX) || defined(HPUX) || defined(BSD) errno = getpwuid_r(uid, result, buffer, buflen, &rv); if (errno != 0) rv = NULL; diff -r 367e5999a90e src/server/frame/aclframe.cpp --- a/src/server/frame/aclframe.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/frame/aclframe.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -48,7 +48,9 @@ #include "sys/types.h" #include +#if !defined(BSD) #include "malloc.h" +#endif #include "netsite.h" #ifdef XP_WIN32 #include "winsock.h" diff -r 367e5999a90e src/server/frame/tokenizer.cpp --- a/src/server/frame/tokenizer.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/frame/tokenizer.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -272,10 +272,10 @@ { } //----------------------------------------------------------------------------- -// TokenizerCharSource::getc +// TokenizerCharSource::getnextchar //----------------------------------------------------------------------------- -inline int TokenizerCharSource::getc() +inline int TokenizerCharSource::getnextchar() { int c; @@ -328,7 +328,7 @@ inline PRBool TokenizerCharSource::getlf() { - int c = getc(); + int c = getnextchar(); if (c != EOF && c != '\n') ungetc(c); return (c == '\n'); @@ -380,7 +380,7 @@ TokenPosition& pos) { // Couldn't find a valid token. Choose a character to blame. - int c = source.getc(); + int c = source.getnextchar(); if (c == EOF) { PR_ASSERT(value.length() > 0); c = value[0]; @@ -413,7 +413,7 @@ int c; // Get the first non-whitespace character - while (isspace(c = source.getc())); + while (isspace(c = source.getnextchar())); // Token begins at this character TokenPosition pos(source.getLine(), @@ -435,7 +435,7 @@ type = TOKEN_COMMENT; for (;;) { value.append(c); - c = source.getc(); + c = source.getnextchar(); if (c == EOF || c == '\n' || (c == '\r' && source.getlf())) break; } @@ -446,7 +446,7 @@ value.append(c); PRBool hex = PR_FALSE; if (c == '0') { - int nextc = source.getc(); + int nextc = source.getnextchar(); if (nextc == 'x') { value.append('x'); hex = PR_TRUE; @@ -456,7 +456,7 @@ } } for (;;) { - c = source.getc(); + c = source.getnextchar(); if (c == EOF) break; if ((hex && !isxdigit(c)) || (!hex && !isdigit(c))) { @@ -471,7 +471,7 @@ // escaped character sequences as we go. type = TOKEN_SINGLE_QUOTE_STRING; for (;;) { - c = source.getc(); + c = source.getnextchar(); if (c == EOF) throw TokenizerUnclosedException(pos, '\'', '\''); if (c == '\'') @@ -479,7 +479,7 @@ if (c == '\\') { // Escaped LF and CRLF are skipped, escaped single quotes // are unescaped - c = source.getc(); + c = source.getnextchar(); if (c == '\n' || (c == '\r' && source.getlf())) continue; if (c != '\'') @@ -497,14 +497,14 @@ // required during interpolation (e.g. "\$foo" vs "$foo"). type = TOKEN_DOUBLE_QUOTE_STRING; for (;;) { - c = source.getc(); + c = source.getnextchar(); if (c == EOF) throw TokenizerUnclosedException(pos, '"', '"'); if (c == '"') break; if (c == '\\') { // Escaped LF and CRLF are skipped - c = source.getc(); + c = source.getnextchar(); if (c == '\n' || (c == '\r' && source.getlf())) continue; value.append('\\'); @@ -546,7 +546,7 @@ checkOperator = potentialOperator; checkIdentifier = potentialIdentifier; - c = source.getc(); + c = source.getnextchar(); if (c == EOF) break; } diff -r 367e5999a90e src/server/frame/tokenizer.h --- a/src/server/frame/tokenizer.h Thu May 07 03:20:10 2009 -0700 +++ b/src/server/frame/tokenizer.h Mon Jul 20 17:56:25 2009 +0000 @@ -387,7 +387,7 @@ * Return the next char. Throws TokenizerIOErrorException on IO errors. * Returns EOF if no further chars are available. */ - inline int getc(); + inline int getnextchar(); /** * Push the char most recently returned by getc(), c, back into the diff -r 367e5999a90e src/server/httpdaemon/WebServer.cpp --- a/src/server/httpdaemon/WebServer.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/httpdaemon/WebServer.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -2000,7 +2000,7 @@ // jpierre 1/5 : if we were NOT started by the watchdog, let's become the // process group leader. When shutdown problems occur, this will allow us to // radically kill everything spawned by the server -#if defined(OSF1) +#if defined(BSD) (void) setpgid(0,0); #else (void) setpgrp(); diff -r 367e5999a90e src/server/ldaputil/LinkedList.cpp --- a/src/server/ldaputil/LinkedList.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/LinkedList.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -205,7 +205,7 @@ // Explicitly instantiate a template to make sure that it and all member // functions will be part of a library. // -#if defined(XP_PC) || defined(HPUX) || defined(LINUX) +#if defined(XP_PC) || defined(HPUX) || defined(LINUX) || defined(BSD) // REVISIT: Added "class" before Clist for HPUX. // This should be O.K for NT also but need to double check. // mohideen@cup.hp.com diff -r 367e5999a90e src/server/ldaputil/cert.cpp --- a/src/server/ldaputil/cert.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/cert.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -33,7 +33,9 @@ #include +#if !defined(BSD) #include +#endif #include "base/systems.h" /* Pick up some defines so this stupid NSS headers will work */ #include "prmem.h" #include "key.h" diff -r 367e5999a90e src/server/ldaputil/certmap.cpp --- a/src/server/ldaputil/certmap.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/certmap.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -35,7 +35,9 @@ #include #include #include +#if !defined(BSD) #include +#endif #include #include #include "base/systems.h" /* Pick up some defines so this stupid NSS headers will work */ diff -r 367e5999a90e src/server/ldaputil/dbconf.cpp --- a/src/server/ldaputil/dbconf.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/dbconf.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -38,7 +38,9 @@ // #include +#if !defined(BSD) #include +#endif #include #include "base/util.h" diff -r 367e5999a90e src/server/ldaputil/ldaputil.h --- a/src/server/ldaputil/ldaputil.h Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/ldaputil.h Mon Jul 20 17:56:25 2009 +0000 @@ -141,6 +141,13 @@ #endif #endif +#if defined(BSD) +#ifndef LDAP_CALL +#define LDAP_CALL +#define LDAP_CALLBACK +#endif +#endif + typedef struct { #ifdef USE_LDAP_SSL LDAP* (LDAP_CALL LDAP_CALLBACK *ldapuV_ssl_init) ( const char*, int, int ); diff -r 367e5999a90e src/server/libaccess/LdapRealm.cpp --- a/src/server/libaccess/LdapRealm.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/libaccess/LdapRealm.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -41,7 +41,9 @@ #include #endif #include +#if !defined(BSD) #include +#endif #include #include #include "ldaputil/LdapSessionPool.h" diff -r 367e5999a90e src/server/libaccess/cryptwrapper.cpp --- a/src/server/libaccess/cryptwrapper.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/libaccess/cryptwrapper.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -35,7 +35,11 @@ #include #include #if !defined (XP_WIN32) +#if defined(BSD) +#include +#else #include +#endif #else extern "C" char *crypt(const char *key, const char *salt); #endif diff -r 367e5999a90e src/server/plugins/fastcgi/circularbuffer.h --- a/src/server/plugins/fastcgi/circularbuffer.h Thu May 07 03:20:10 2009 -0700 +++ b/src/server/plugins/fastcgi/circularbuffer.h Mon Jul 20 17:56:25 2009 +0000 @@ -69,7 +69,7 @@ inline int getData(char* buffer, int size); inline void releaseData(int size); inline int peekc(char *c = NULL); - inline int getc(char *c = NULL); + inline int getnextchar(char *c = NULL); inline int move(CircularBuffer &toBuffer, int size, PRBool totalMove=PR_TRUE); @@ -230,10 +230,10 @@ } //----------------------------------------------------------------------------- -// CircularBuffer::getc +// CircularBuffer::getnextchar //----------------------------------------------------------------------------- -int CircularBuffer::getc(char *c) +int CircularBuffer::getnextchar(char *c) { int size = hasData(); if (size < 1) diff -r 367e5999a90e src/server/plugins/fastcgi/fastcgistub.cpp --- a/src/server/plugins/fastcgi/fastcgistub.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/plugins/fastcgi/fastcgistub.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -45,7 +45,7 @@ #include #include - #if !defined(LINUX) + #if !defined(LINUX) && !defined(BSD) #include #endif @@ -57,7 +57,7 @@ #include #include - #if defined(HPUX) || defined(AIX) + #if defined(HPUX) || defined(AIX) || defined(BSD) #include #else #include diff -r 367e5999a90e src/server/plugins/fastcgi/fcgiprocess.cpp --- a/src/server/plugins/fastcgi/fcgiprocess.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/plugins/fastcgi/fcgiprocess.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -41,6 +41,9 @@ #include #include #include +#if defined(BSD) + #include +#endif #else #include #endif // XP_UNIX diff -r 367e5999a90e src/server/plugins/htaccess/htpasswd.c --- a/src/server/plugins/htaccess/htpasswd.c Thu May 07 03:20:10 2009 -0700 +++ b/src/server/plugins/htaccess/htpasswd.c Mon Jul 20 17:56:25 2009 +0000 @@ -44,7 +44,9 @@ #include #if !defined (XP_WIN32) +#if !defined(BSD) #include +#endif #include #else #include diff -r 367e5999a90e src/server/safs/Cgistub.c --- a/src/server/safs/Cgistub.c Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/Cgistub.c Mon Jul 20 17:56:25 2009 +0000 @@ -59,7 +59,7 @@ #if defined(SOLARIS) #include /* dlopen */ #endif -#if !defined(LINUX) +#if !defined(LINUX) && !defined(BSD) #include #endif #if !defined(USE_CONNLD) @@ -67,7 +67,7 @@ #endif #include #include -#if defined(HPUX) || defined(AIX) +#if defined(HPUX) || defined(AIX) || defined(BSD) #include #else #include diff -r 367e5999a90e src/server/safs/Makefile --- a/src/server/safs/Makefile Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/Makefile Mon Jul 20 17:56:25 2009 +0000 @@ -59,6 +59,9 @@ ifeq ($(OS_ARCH),Linux) LOCAL_DEF+= -DUSE_POSIXFDPASSING endif +ifeq ($(OS_ARCH),FreeBSD) +LOCAL_DEF+= -DUSE_POSIXFDPASSING +endif AR_OBJS=$(SAFSOBJS) diff -r 367e5999a90e src/server/safs/Makefile.cgistub --- a/src/server/safs/Makefile.cgistub Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/Makefile.cgistub Mon Jul 20 17:56:25 2009 +0000 @@ -79,6 +79,9 @@ ifeq ($(OS_ARCH),Linux) C_FLAGS += -DLINUX -DUSE_POSIXFDPASSING endif +ifeq ($(OS_ARCH),FreeBSD) +C_FLAGS += -DBSD -DUSE_POSIXFDPASSING +endif all:: diff -r 367e5999a90e src/server/safs/aclsafs.cpp --- a/src/server/safs/aclsafs.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/aclsafs.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -39,7 +39,9 @@ */ #include +#if !defined(BSD) #include +#endif #include "netsite.h" #include "safs/acl.h" diff -r 367e5999a90e src/server/safs/dl.cpp --- a/src/server/safs/dl.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/dl.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -173,7 +173,7 @@ ereport(LOG_VERBOSE, "attempting to load %s", libname); if(!(dlp = dll_open2 (libname, parse_dlopen_flags (pblock_findval ("shlib_flags", pb))))) { - char* dllerr = dll_error(dlp); + const char* dllerr = dll_error(dlp); util_snprintf(err, MAGNUS_ERROR_LEN, "dlopen of %s failed (%s)", libname, dllerr); pblock_nvinsert("error", err, pb); return NULL; diff -r 367e5999a90e src/support/filecache/md_unix.cpp --- a/src/support/filecache/md_unix.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/support/filecache/md_unix.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -41,6 +41,12 @@ * intended publication of this Source Code. */ +#if defined(BSD) +#include +#include +#include +#endif + #include "nsfc_pvt.h" static PRInt64 diff -r 367e5999a90e src/support/libdbm/nsres.c --- a/src/support/libdbm/nsres.c Thu May 07 03:20:10 2009 -0700 +++ b/src/support/libdbm/nsres.c Mon Jul 20 17:56:25 2009 +0000 @@ -37,8 +37,10 @@ #ifdef BSDI #include #else +#ifndef BSD #include #endif +#endif #include #include diff -r 367e5999a90e src/support/xp/xpatomic.cpp --- a/src/support/xp/xpatomic.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/support/xp/xpatomic.cpp Mon Jul 20 17:56:25 2009 +0000 @@ -212,7 +212,7 @@ #define NUM_UNIT_TEST_THREADS 4 #define NUM_UNIT_TEST_ITERATIONS 16384 -#if defined(LINUX) || defined(AIX) +#if defined(LINUX) || defined(AIX) || defined(BSD) #define CONST_VALUE(x) x##LL #else #define CONST_VALUE(x) x