0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

Make MongoDB compile and work on OpenBSD (gcc4 archs, tested on OpenBSD-current/amd64).

This commit is contained in:
Frank DENIS 2010-06-21 04:29:03 +08:00 committed by Eliot
parent e1e111d05e
commit ab204d9f24
5 changed files with 23 additions and 4 deletions

View File

@ -270,6 +270,7 @@ linux64 = False
darwin = False
windows = False
freebsd = False
openbsd = False
solaris = False
force64 = not GetOption( "force64" ) is None
if not force64 and os.getcwd().endswith( "mongo-64" ):
@ -555,6 +556,13 @@ elif os.sys.platform.startswith( "freebsd" ):
env.Append( LIBPATH=[ "/usr/local/lib" ] )
env.Append( CPPDEFINES=[ "__freebsd__" ] )
elif os.sys.platform.startswith( "openbsd" ):
nix = True
openbsd = True
env.Append( CPPPATH=[ "/usr/local/include" ] )
env.Append( LIBPATH=[ "/usr/local/lib" ] )
env.Append( CPPDEFINES=[ "__openbsd__" ] )
elif "win32" == os.sys.platform:
windows = True
#if force64:
@ -991,6 +999,10 @@ def doConfigure( myenv , needPcre=True , shell=False ):
myCheckLib( "ncurses" , True )
else:
myenv.Append( LINKFLAGS=" /usr/lib/libreadline.dylib " )
elif openbsd:
myenv.Append( CPPDEFINES=[ "USE_READLINE" ] )
myCheckLib( "termcap" , True )
myCheckLib( "readline" , True )
elif myCheckLib( "readline" , release and nix , staticOnly=release ):
myenv.Append( CPPDEFINES=[ "USE_READLINE" ] )
myCheckLib( "ncurses" , staticOnly=release )
@ -1002,7 +1014,7 @@ def doConfigure( myenv , needPcre=True , shell=False ):
myCheckLib( "rt" , True )
# requires ports devel/libexecinfo to be installed
if freebsd:
if freebsd or openbsd:
myCheckLib( "execinfo", True )
env.Append( LIBS=[ "execinfo" ] )

View File

@ -52,7 +52,7 @@ string historyFile;
bool gotInterrupted = 0;
bool inMultiLine = 0;
#if defined(USE_READLINE) && !defined(__freebsd__) && !defined(_WIN32)
#if defined(USE_READLINE) && !defined(__freebsd__) && !defined(__openbsd__) && !defined(_WIN32)
#define CTRLC_HANDLE
#endif

View File

@ -18,7 +18,7 @@
#include "../pch.h"
#include <fcntl.h>
#include <errno.h>
#if defined(__freebsd__)
#if defined(__freebsd__) || defined(__openbsd__)
#include <sys/stat.h>
#endif

View File

@ -32,7 +32,7 @@ namespace mongo {
return s.str();
}
#if !defined(_WIN32) && !defined(NOEXECINFO) && !defined(__freebsd__) && !defined(__sun__)
#if !defined(_WIN32) && !defined(NOEXECINFO) && !defined(__freebsd__) && !defined(__openbsd__) && !defined(__sun__)
} // namespace mongo

View File

@ -67,6 +67,13 @@ namespace mongo {
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
#ifdef __openbsd__
# include <sys/uio.h>
#endif
#ifndef AI_ADDRCONFIG
# define AI_ADDRCONFIG 0
#endif
namespace mongo {