Commit a910a893 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Fixes #1322.

git-svn-id: file:///svn/toku/tokudb.1032b@8301 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4fc04593
......@@ -16,7 +16,7 @@ TARGETS = $(patsubst %.cpp,%,$(SRCS))
# OPTFLAGS = -O0
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CPPFLAGS = -I../ -I../../include
CPPFLAGS = -I../ -I../../include -I../../linux
CXXFLAGS = -Wall $(OPTFLAGS) -g $(GCOV_FLAGS)
LDLIBS = ../../lib/libtokudb_cxx.a ../../lib/libtokudb.a -lz -lpthread
......
......@@ -5,7 +5,7 @@
#include <db_cxx.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <toku_os.h>
#include <sys/time.h>
#include <unistd.h>
......@@ -520,7 +520,7 @@ int main (int argc, const char *argv[]) {
switch (mode) {
case MODE_DEFAULT:
system("rm -rf " DIR);
mkdir(DIR, 0777);
toku_os_mkdir(DIR, 0777);
create_databases();
{
int i;
......
......@@ -22,12 +22,14 @@ include $(TOKUROOT)include/Makefile.include
BENCHDBS = bench.bdb/ bench.tokudb ptest*.dir/ x.dir/ xfast.dir/
ifdef BDBDIR
BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include -I../linux
BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include $(PORTABILITY_HEADERS)
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -Wl,-rpath,$(BDBDIR)/lib $(LIBPORTABILITY) -lpthread
else
BDB_CPPFLAGS =
BDB_LDFLAGS = -ldb
BDB_CPPFLAGS = -I$(PORTABILITY_HEADERS) -I../include
BDB_LDFLAGS = -ldb $(LIBPORTABILITY)
endif
BDB_CPPFLAGS += -D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
TOKUDB=libtokudb.$(SOEXT)
TDB_DLINK_FILES = $(TOKUROOT)lib/$(TOKUDB)
......@@ -60,7 +62,7 @@ clean:
$(MAYBEATSIGN)rm -f $(TARGETS)
$(MAYBEATSIGN)rm -rf $(BENCHDBS)
$(TARGET_TDB) $(SCANSCAN_TDB): BIN_FROM_C_FLAGS += -DDIRSUF=tokudb
$(TARGET_TDB) $(SCANSCAN_TDB): BIN_FROM_C_FLAGS += -DDIRSUF=tokudb -I$(PORTABILITY_HEADERS) -I../include
ifneq ($(PROF),)
USE_STATIC=1
......
......@@ -336,6 +336,7 @@ endif
ifeq ($(SKIP_NEWBRTRULE),)
NEWBRT = $(TOKUROOT)newbrt/newbrt.$(AEXT)
NEWBRT_BUNDLE = $(TOKUROOT)newbrt/newbrt.bundle
$(NEWBRT): $(@D)*.[ch]
$(MAYBEATSIGN)cd $(@D) && $(MAKE) -s $(@F)
endif
......@@ -355,8 +356,9 @@ O_FROM_C_FLAGS= $(CFLAGS) $(CPPFLAGS) -c $(OOUTPUT)$@
$(MAYBEATSIGN)$(CC) $< $(O_FROM_C_FLAGS)
%.$(AEXT):
$(MAYBEATSIGN)$(AR) $(ARFLAGS) $(AROUTPUT)$@ $^
$(MAYBEATSIGN)$(AR) $(ARFLAGS) $(AROUTPUT)$@ $(filter %.$(OEXT),$^) $(patsubst %.bundle, %.bundle/*.$(OEXT), $^)
%.bundle: %.$(AEXT)
mkdir -p $@; cd $@; $(AR) x ../$(<F)
ifeq ($(SOEXT),so)
EXPORTMAPFILE=export.map
......
......@@ -11,6 +11,7 @@ DEPEND_COMPILE += \
# keep this line so I can have a \ on the previous line
NEWBRT = newbrt.$(AEXT)
NEWBRT_BUNDLE = newbrt.bundle
#All executables need to statically link to newbrt
LINK_FILES += $(NEWBRT)
......@@ -71,15 +72,17 @@ newbrt.$(OEXT): $(BRT_C_FILES) $(DEPEND_COMPILE)
ifneq ($(CYGWIN),)
$(NEWBRT): $(BRT_O_FILES)
NEWBRT_O_FILES = $(BRT_O_FILES)
else ifeq ($(CC),icc)
$(NEWBRT): $(BRT_O_FILES)
NEWBRT_O_FILES = $(BRT_O_FILES)
else ifeq ($(COMBINE),0)
$(NEWBRT): $(BRT_O_FILES)
NEWBRT_O_FILES = $(BRT_O_FILES)
else
$(NEWBRT): newbrt.o
NEWBRT_O_FILES = newbrt.o
endif
$(NEWBRT): $(NEWBRT_O_FILES)
log_code.$(OEXT): log_header.h wbuf.h log-internal.h rbuf.h
log_header.h: log_code.c
@echo generated log_code.c so log_header.c was also generated
......@@ -90,7 +93,7 @@ logformat$(BINSUF): logformat.c $(LIBPORTABILITY)
$(MAYBEATSIGN)$(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LIBPORTABILITY)
libs: $(NEWBRT)
libs: $(NEWBRT) $(NEWBRT_BUNDLE)
bins: $(BINS)
# Put the benchmarktest_256 first since it takes the longest (and we want to use parallelism in the make)
......
......@@ -79,8 +79,8 @@ $(TLIBRARY): LINK_FILES=$(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT)
#Skip all BDB tests for CYGWIN+ICC
ifeq ($(CYGWIN),)
$(LIBRARY_S): $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
$(TLIBRARY_S): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
$(LIBRARY_S): $(patsubst %.$(AEXT),%.bundle, $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY))
$(TLIBRARY_S): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT_BUNDLE) $(LIBPORTABILITY)
else ifneq ($(CC),icc)
$(LIBRARY_S): $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
$(TLIBRARY_S): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
......@@ -102,7 +102,7 @@ ipo_libtokudb.lib: ipo_libtokudb.obj
xilib /out:$@ $^
check_globals: $(LIBNAME).$(AEXT)
check_globals: $(LIBNAME).$(SOEXT)
$(MAYBEATSIGN)python tokuglobals.py $<
.PHONY: check_tests
......
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