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

[t:3620] Merge #3620 to main, and delete tokudb.3620. Refs #3620.

git-svn-id: file:///svn/toku/tokudb@32348 c7de825b-a66e-492c-adef-691d508d4ae1
parent c487595b
...@@ -36,7 +36,7 @@ TARGETS = $(patsubst %.cpp,%,$(SRCS)) ...@@ -36,7 +36,7 @@ TARGETS = $(patsubst %.cpp,%,$(SRCS))
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage # GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CPPFLAGS = -I../ -I../../include -I../../linux -I$(TOKUROOT)toku_include -DUSE_ENV CPPFLAGS = -I../ -I../../include -I../../linux -I$(TOKUROOT)toku_include -DUSE_ENV
CXXFLAGS = $(GCC_VERSION_SPECIFIC) -Werror -Wall $(OPTFLAGS) -g $(GCOV_FLAGS) CXXFLAGS = $(GCC_VERSION_SPECIFIC) -Werror -Wall $(OPTFLAGS) -g $(GCOV_FLAGS)
LDLIBS = ../../lib/libtokudb_cxx.a -ltokudb -lz -lpthread LDLIBS = ../../lib/libtokudb_cxx.a -ltokudb -lz -lpthread -ltokuportability
RPATH_DIRS=$(TOKUROOT)lib RPATH_DIRS=$(TOKUROOT)lib
ifeq ($(CC),icc) ifeq ($(CC),icc)
......
...@@ -30,11 +30,12 @@ endif ...@@ -30,11 +30,12 @@ endif
ifdef BDBDIR ifdef BDBDIR
BDB_CPPFLAGS = -I$(BDBDIR)/include -DHAVE_CXX_STDHEADERS BDB_CPPFLAGS = -I$(BDBDIR)/include -DHAVE_CXX_STDHEADERS
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb_cxx -Wl,-rpath,$(BDBDIR)/lib -lpthread BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb_cxx -Wl,-rpath,$(BDBDIR)/lib
else else
BDB_CPPFLAGS = BDB_CPPFLAGS =
BDB_LDFLAGS = -ldb_cxx -lpthread BDB_LDFLAGS = -ldb_cxx
endif endif
BDB_LDFLAGS += -lpthread -L../lib -Wl,-rpath,$(PWD)/../lib -ltokuportability
TARGET_BDB = db-benchmark-test-bdb TARGET_BDB = db-benchmark-test-bdb
TARGET_TDB = db-benchmark-test-tokudb TARGET_TDB = db-benchmark-test-tokudb
...@@ -65,7 +66,7 @@ clean: ...@@ -65,7 +66,7 @@ clean:
db-benchmark-test-tokudb: ../lib/libtokudb_cxx.a db-benchmark-test-tokudb: ../lib/libtokudb_cxx.a
db-benchmark-test-tokudb: db-benchmark-test.cpp db-benchmark-test-tokudb: db-benchmark-test.cpp
$(CXX) $(CXXFLAGS) -I../include -I../toku_include -L../lib -Wl,-rpath,$(PWD)/../lib $< -o $@ -ltokudb -ltokudb_cxx -DDIRSUF=tokudb -lz -lpthread $(CXX) $(CXXFLAGS) -I../include -I../toku_include -L../lib -Wl,-rpath,$(PWD)/../lib $< -o $@ -ltokudb -ltokudb_cxx -DDIRSUF=tokudb -lz -lpthread -ltokuportability
db-benchmark-test-bdb: db-benchmark-test.cpp db-benchmark-test-bdb: db-benchmark-test.cpp
$(CXX) $(CXXFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS) $< -o $@ -DDIRSUF=bdb $(CXX) $(CXXFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS) $< -o $@ -DDIRSUF=bdb
...@@ -130,7 +130,7 @@ OFILES = \ ...@@ -130,7 +130,7 @@ OFILES = \
$(TOKUROOT)src/range_tree/rangetree.lib \ $(TOKUROOT)src/range_tree/rangetree.lib \
$(TOKUROOT)src/lock_tree/locktree.lib \ $(TOKUROOT)src/lock_tree/locktree.lib \
$(TOKUROOT)newbrt/newbrt.lib \ $(TOKUROOT)newbrt/newbrt.lib \
$(LIBPORTABILITY) \ $(LIBPORTABILITY_SO) \
#end #end
$(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL) $(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL)
...@@ -150,6 +150,7 @@ else ...@@ -150,6 +150,7 @@ else
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB): DLINK_FILES=$(TDB_DLINK_FILES) $(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB): DLINK_FILES=$(TDB_DLINK_FILES)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB): RPATH_DIRS=$(dir $(TDB_DLINK_FILES)) $(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB): RPATH_DIRS=$(dir $(TDB_DLINK_FILES))
endif endif
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB): LDLIBS+=-ltokuportability
$(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL) $(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST) $(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(SCANSCAN_TDB): scanscan.c $(PTHREAD_LOCAL) $(SCANSCAN_TDB): scanscan.c $(PTHREAD_LOCAL)
......
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
.DEFAULT_GOAL=install .DEFAULT_GOAL=install
TOKUROOT=../ TOKUROOT=../
INCLUDEDIRS=-I. INCLUDEDIRS=-I.
SKIP_LIBPORTABILITYRULE=1
include $(TOKUROOT)toku_include/Makefile.include include $(TOKUROOT)toku_include/Makefile.include
OPT_AROPT=-qnoipo #Disable ipo for lib creation even when optimization is on. OPT_AROPT=-qnoipo #Disable ipo for lib creation even when optimization is on.
SRCS = $(wildcard *.c) SRCS = $(wildcard *.c)
OBJS = $(patsubst %.c,%.$(OEXT),$(SRCS)) OBJS = $(patsubst %.c,%.$(OEXT),$(SRCS))
TARGET = $(LIBPORTABILITY) TARGET = $(LIBPORTABILITY_SO) $(LIBPORTABILITY_A)
build install: $(TARGET) build install: $(TARGET)
...@@ -21,9 +20,10 @@ else ...@@ -21,9 +20,10 @@ else
LINUX_NOSTDLIB= LINUX_NOSTDLIB=
endif endif
$(TARGET): $(OBJS) $(LIBPORTABILITY_SO): $(OBJS)
echo $(patsubst %,linux/%,$(OBJS)) > ../lib/tokuportability.olist $(CC) -shared $(SYMBOLS) $(OBJS) $(SKIP_WARNING) -o $@ $(LINUX_NOSTDLIB)
$(CC) -shared $(SYMBOLS) $(OBJS) $(SKIP_WARNING) -o $(TARGET) $(LINUX_NOSTDLIB) $(LIBPORTABILITY_A): $(OBJS)
$(CC) -shared $(SYMBOLS) $(OBJS) $(SKIP_WARNING) -o $@ $(LINUX_NOSTDLIB)
$(OBJS): CFLAGS += -DTOKU_ALLOW_DEPRECATED -D_GNU_SOURCE $(OBJS): CFLAGS += -DTOKU_ALLOW_DEPRECATED -D_GNU_SOURCE
$(OBJS): VISIBILITY= $(OBJS): VISIBILITY=
...@@ -33,6 +33,6 @@ check: $(TARGET) ...@@ -33,6 +33,6 @@ check: $(TARGET)
cd tests && $(MAKE) check cd tests && $(MAKE) check
clean: clean:
rm -rf $(TARGET) $(LIBPORTABILITY) rm -rf $(TARGET)
cd tests && $(MAKE) clean cd tests && $(MAKE) clean
...@@ -123,8 +123,8 @@ log_print.c log_header.h: log_code.c ...@@ -123,8 +123,8 @@ log_print.c log_header.h: log_code.c
test 1 = 1 test 1 = 1
#Needs to be done manually since it does not include newbrt. #Needs to be done manually since it does not include newbrt.
logformat$(BINSUF): logformat.c $(LIBPORTABILITY) logformat$(BINSUF): logformat.c $(LIBPORTABILITY_SO)
$(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LDFLAGS) $(ALWAYS_LINK) $(LINK_MUST_BE_LAST) $(LIBPORTABILITY) $(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LDFLAGS) $(ALWAYS_LINK) $(LINK_MUST_BE_LAST) $(LIBPORTABILITY_SO)
libs: $(NEWBRT_SO) libs: $(NEWBRT_SO)
...@@ -136,7 +136,7 @@ bins: $(BINS) ...@@ -136,7 +136,7 @@ bins: $(BINS)
check: bins check: bins
cd tests;$(MAKE) check cd tests;$(MAKE) check
$(BINS): $(NEWBRT_SO) $(LIBPORTABILITY) $(BINS): $(NEWBRT_SO) $(LIBPORTABILITY_SO)
foo2: foo2:
echo $(BINS) echo $(BINS)
......
...@@ -73,8 +73,7 @@ buildlocktrees: $(LOCKTREE) $(RANGETREE) ; ...@@ -73,8 +73,7 @@ buildlocktrees: $(LOCKTREE) $(RANGETREE) ;
$(LIBRARY): $(OBJS) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(DEPEND_COMPILE) $(DEPEND_LINK) $(LIBRARY): $(OBJS) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(DEPEND_COMPILE) $(DEPEND_LINK)
NEWBRT_OFILES = $(patsubst %,../%,$(shell cat ../lib/newbrt.olist)) NEWBRT_OFILES = $(patsubst %,../%,$(shell cat ../lib/newbrt.olist))
PORTABILITY_OFILES = $(patsubst %,../%,$(shell cat ../lib/tokuportability.olist)) $(LIBRARY): LINK_FILES=$(OBJS) $(LOCKTREE) $(RANGETREE) $(NEWBRT_OFILES)
$(LIBRARY): LINK_FILES=$(OBJS) $(LOCKTREE) $(RANGETREE) $(NEWBRT_OFILES) $(PORTABILITY_OFILES)
ifeq ($(CC),icc) ifeq ($(CC),icc)
ifeq ($(HAVE_CILK),1) ifeq ($(HAVE_CILK),1)
ifeq (0,1) ifeq (0,1)
......
...@@ -546,6 +546,7 @@ TDB_CFLAGS= ...@@ -546,6 +546,7 @@ TDB_CFLAGS=
%.tdb$(BINSUF) %.tdbt$(BINSUF): TDB_CFLAGS= -DENVDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1 %.tdb$(BINSUF) %.tdbt$(BINSUF): TDB_CFLAGS= -DENVDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1
%.tdb$(BINSUF) %.tdbt$(BINSUF): CPPFLAGS+=-I$(TOKUROOT)include %.tdb$(BINSUF) %.tdbt$(BINSUF): CPPFLAGS+=-I$(TOKUROOT)include
%.tdb$(BINSUF) %.tdbt$(BINSUF): LDFLAGS+=-ltokuportability
loader-stress-test: CPPFLAGS+=-I$(TOKUROOT)include -DENVDIR=\"dir.$<\" loader-stress-test: CPPFLAGS+=-I$(TOKUROOT)include -DENVDIR=\"dir.$<\"
loader-stress-test: LOADLIBES+=-L../lib -ltokudb -Wl,-rpath,.. loader-stress-test: LOADLIBES+=-L../lib -ltokudb -Wl,-rpath,..
......
...@@ -159,7 +159,8 @@ else ifeq ($(GCCVERSION),4.4.1) ...@@ -159,7 +159,8 @@ else ifeq ($(GCCVERSION),4.4.1)
else ifeq ($(GCCVERSION),4.4.0) else ifeq ($(GCCVERSION),4.4.0)
CFLAGS += -Wno-strict-aliasing CFLAGS += -Wno-strict-aliasing
endif endif
LIBPORTABILITY=$(TOKUROOT)lib/libtokuportability.$(SOEXT) LIBPORTABILITY_SO=$(TOKUROOT)lib/libtokuportability.$(SOEXT)
LIBPORTABILITY_A=$(TOKUROOT)lib/libtokuportability.$(AEXT)
PORTABILITY_HEADERS= $(TOKUROOT)$(SYSTEM) PORTABILITY_HEADERS= $(TOKUROOT)$(SYSTEM)
ALWAYS_LINK= -lz -lpthread ALWAYS_LINK= -lz -lpthread
...@@ -203,7 +204,8 @@ LINK_DLINK_FILES=$(patsubst %,$(LINK)%,$(notdir $(DLINK_FILES_PREPROCESS_2))) ...@@ -203,7 +204,8 @@ LINK_DLINK_FILES=$(patsubst %,$(LINK)%,$(notdir $(DLINK_FILES_PREPROCESS_2)))
CRUNTIME= CRUNTIME=
DEPEND_LINK += \ DEPEND_LINK += \
$(LIBPORTABILITY) \ $(LIBPORTABILITY_SO) \
$(LIBPORTABILITY_A) \
$(LINK_FILES) \ $(LINK_FILES) \
# keep this line so I can have a \ on the previous line # keep this line so I can have a \ on the previous line
...@@ -306,7 +308,7 @@ ifneq ($(CYGWIN),) ...@@ -306,7 +308,7 @@ ifneq ($(CYGWIN),)
#Cygwin (Windows) Must override some settings #Cygwin (Windows) Must override some settings
BINSUF=.exe BINSUF=.exe
WRONGBINSUF=#empty WRONGBINSUF=#empty
ALWAYS_LINK=$(LIBPORTABILITY) /usr/lib/libz.a ALWAYS_LINK=/usr/lib/libz.a
SRCPATH_DIRS = `find $(TOKUROOT) -type d | grep -v '/\.[^.]' | grep -F -v "$(TOKUROOT)$(OS_NOTCHOICE)" | tr '\n' ';'` SRCPATH_DIRS = `find $(TOKUROOT) -type d | grep -v '/\.[^.]' | grep -F -v "$(TOKUROOT)$(OS_NOTCHOICE)" | tr '\n' ';'`
ifeq ($(WINDBG),1) ifeq ($(WINDBG),1)
VGRIND = windbg -hd -y "$(SRCPATH_DIRS)" -srcpath "$(SRCPATH_DIRS)" #No Valgrind in cygwin #-G is quit at exit, but does not return ERROR on error!!! and quits on error to quickly VGRIND = windbg -hd -y "$(SRCPATH_DIRS)" -srcpath "$(SRCPATH_DIRS)" #No Valgrind in cygwin #-G is quit at exit, but does not return ERROR on error!!! and quits on error to quickly
...@@ -325,7 +327,7 @@ ifneq ($(CYGWIN),) ...@@ -325,7 +327,7 @@ ifneq ($(CYGWIN),)
CRUNTIME=MTd CRUNTIME=MTd
endif endif
endif endif
ALWAYS_LINK=$(LIBPORTABILITY) $(TOKUROOT)windows/lib/$(CRUNTIME)/zlib.lib Ws2_32.lib psapi.lib PowrProf.lib ALWAYS_LINK=$(TOKUROOT)windows/lib/$(CRUNTIME)/zlib.lib Ws2_32.lib psapi.lib PowrProf.lib
LINK=#Empty LINK=#Empty
BINOUTPUT=-Fe BINOUTPUT=-Fe
OOUTPUT=-Fo OOUTPUT=-Fo
...@@ -448,19 +450,6 @@ clean-default: ...@@ -448,19 +450,6 @@ clean-default:
%.$(WRONGSOEXT): %.$(WRONGSOEXT):
echo "Wrong target type: $@ should be $*.$(SOEXT)" && false echo "Wrong target type: $@ should be $*.$(SOEXT)" && false
ifeq ($(SKIP_LIBPORTABILITYRULE),)
ifeq ($(CYGWIN),)
$(LIBPORTABILITY): $(TOKUROOT)$(SYSTEM)/*.[ch]
pwd && cd $(TOKUROOT)$(SYSTEM) && $(MAKE) install
else ifneq ($(CC),icc)
$(LIBPORTABILITY): $(TOKUROOT)$(SYSTEM)/*.[ch]
cd $(TOKUROOT)$(SYSTEM) && $(MAKE) install
else
$(LIBPORTABILITY): $(TOKUROOT)windows/*.[ch]
cd $(TOKUROOT)windows && $(MAKE) install
endif
endif
ifeq ($(SKIP_LOCKTREERULE),) ifeq ($(SKIP_LOCKTREERULE),)
LOCKTREE = $(TOKUROOT)src/lock_tree/locktree.$(AEXT) LOCKTREE = $(TOKUROOT)src/lock_tree/locktree.$(AEXT)
LOCKTREE_BUNDLE = $(TOKUROOT)src/lock_tree/locktree.bundle LOCKTREE_BUNDLE = $(TOKUROOT)src/lock_tree/locktree.bundle
...@@ -469,7 +458,7 @@ LOCKTREE_TLOG = $(TOKUROOT)src/lock_tree/locktree_tlog.$(AEXT) ...@@ -469,7 +458,7 @@ LOCKTREE_TLOG = $(TOKUROOT)src/lock_tree/locktree_tlog.$(AEXT)
LOCKTREE_LOG = $(TOKUROOT)src/lock_tree/locktree_log.$(AEXT) LOCKTREE_LOG = $(TOKUROOT)src/lock_tree/locktree_log.$(AEXT)
$(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(@D)*.[ch] $(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F) cd $(@D) && $(MAKE) $(@F)
$(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(LIBPORTABILITY) $(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(LIBPORTABILITY_SO)
endif endif
ifeq ($(SKIP_RANGETREERULE),) ifeq ($(SKIP_RANGETREERULE),)
...@@ -480,7 +469,7 @@ RANGETREE_TLOG = $(TOKUROOT)src/range_tree/rangetree_tlog.$(AEXT) ...@@ -480,7 +469,7 @@ RANGETREE_TLOG = $(TOKUROOT)src/range_tree/rangetree_tlog.$(AEXT)
RANGETREE_LOG = $(TOKUROOT)src/range_tree/rangetree_log.$(AEXT) RANGETREE_LOG = $(TOKUROOT)src/range_tree/rangetree_log.$(AEXT)
$(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(@D)*.[ch] $(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F) cd $(@D) && $(MAKE) $(@F)
$(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(LIBPORTABILITY) $(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(LIBPORTABILITY_SO)
endif endif
ifeq ($(SKIP_NEWBRTRULE),) ifeq ($(SKIP_NEWBRTRULE),)
......
...@@ -42,7 +42,7 @@ ifeq ($(OS_CHOICE),windows) ...@@ -42,7 +42,7 @@ ifeq ($(OS_CHOICE),windows)
$(UTILS): LINK_FILES+=$(WIN_YDB) $(UTILS): LINK_FILES+=$(WIN_YDB)
$(UTILS): $(WIN_YDB) $(UTILS): $(WIN_YDB)
else else
$(UTILS): DLINK_FILES=$(TOKUROOT)lib/libtokudb.$(SOEXT) $(UTILS): DLINK_FILES=$(TOKUROOT)lib/libtokudb.$(SOEXT) $(TOKUROOT)lib/libtokuportability.$(SOEXT)
NEWBRT_OBJS=$(patsubst %,../%,$(shell cat $(TOKUROOT)lib/newbrt.olist)) NEWBRT_OBJS=$(patsubst %,../%,$(shell cat $(TOKUROOT)lib/newbrt.olist))
TOKUPORTABILITY_OBJS=$(patsubst %,../%,$(shell cat $(TOKUROOT)lib/tokuportability.olist)) TOKUPORTABILITY_OBJS=$(patsubst %,../%,$(shell cat $(TOKUROOT)lib/tokuportability.olist))
YDB_OBJS=$(wildcard ../src/*.$(OEXT)) YDB_OBJS=$(wildcard ../src/*.$(OEXT))
...@@ -124,8 +124,8 @@ coverage: $(UTILS) ...@@ -124,8 +124,8 @@ coverage: $(UTILS)
%.bdb$(BINSUF): %.c %.bdb$(BINSUF): %.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST) -DUSE_BDB=1 $(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST) -DUSE_BDB=1
%_static$(BINSUF): %.c ../lib/libtokudb.$(AEXT) %_static$(BINSUF): %.c $(TOKUROOT)lib/libtokuportability.$(AEXT)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST) $(CC) $< $(BIN_FROM_C_FLAGS) $(TOKUROOT)lib/libtokuportability.$(AEXT) $(LINK_MUST_BE_LAST)
strip: $(STATIC_UTILS) strip: $(STATIC_UTILS)
strip $(STATIC_UTILS) strip $(STATIC_UTILS)
......
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