Commit 4b9a1341 authored by Yoni Fogel's avatar Yoni Fogel

Port to OSX for some tests.

git-svn-id: file:///svn/tokudb@2187 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7ba48c08
...@@ -13,6 +13,7 @@ endif ...@@ -13,6 +13,7 @@ endif
ifeq ($(OSX),OSX) ifeq ($(OSX),OSX)
#Note: OSX 10.4 needs DYLD_LIBRARY_PATH. OSX 10.5 claims to support -rpath. #Note: OSX 10.4 needs DYLD_LIBRARY_PATH. OSX 10.5 claims to support -rpath.
CFLAGS = -DOSX
LIBEXT=dylib LIBEXT=dylib
VGRIND= VGRIND=
BDB_SUPPRESSIONS= BDB_SUPPRESSIONS=
...@@ -20,6 +21,7 @@ ifeq ($(OSX),OSX) ...@@ -20,6 +21,7 @@ ifeq ($(OSX),OSX)
SETTOKUENV=export DYLD_LIBRARY_PATH=.. ; SETTOKUENV=export DYLD_LIBRARY_PATH=.. ;
UNSETTOKUENV=unset DYLD_LIBRARY_PATH ; UNSETTOKUENV=unset DYLD_LIBRARY_PATH ;
else else
CFLAGS =
SETTOKUENV= SETTOKUENV=
UNSETTOKUENV= UNSETTOKUENV=
LIBEXT=so LIBEXT=so
...@@ -40,7 +42,7 @@ endif ...@@ -40,7 +42,7 @@ endif
LIBNAME=libdb.$(LIBEXT) LIBNAME=libdb.$(LIBEXT)
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage # GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CFLAGS = -Wall -Werror $(OPTFLAGS) -g $(GCOV_FLAGS) CFLAGS += -Wall -Werror $(OPTFLAGS) -g $(GCOV_FLAGS)
TDB_CPPFLAGS = -I../../include TDB_CPPFLAGS = -I../../include
......
...@@ -18,6 +18,10 @@ void handle_error (const DB_ENV *dbenv, const char *errpfx, const char *msg) { ...@@ -18,6 +18,10 @@ void handle_error (const DB_ENV *dbenv, const char *errpfx, const char *msg) {
int main (int argc, const char *argv[]) { int main (int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
#if defined(OSX)
if (verbose) printf("Warning: fmemopen does not exist in OSX!\n");
#else
system("rm -rf " DIR); system("rm -rf " DIR);
int r=mkdir(DIR, 0777); assert(r==0); int r=mkdir(DIR, 0777); assert(r==0);
...@@ -59,6 +63,6 @@ int main (int argc, const char *argv[]) { ...@@ -59,6 +63,6 @@ int main (int argc, const char *argv[]) {
} }
} }
} }
#endif
return 0; return 0;
} }
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <db.h> #include <db.h>
#include <syscall.h> #if defined(OSX)
#include <sys/syscall.h>
#else
#include <syscall.h>
#endif
#include <pthread.h> #include <pthread.h>
#include "test.h" #include "test.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment