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))
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CPPFLAGS = -I../ -I../../include -I../../linux -I$(TOKUROOT)toku_include -DUSE_ENV
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
ifeq ($(CC),icc)
......
......@@ -30,11 +30,12 @@ endif
ifdef BDBDIR
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
BDB_CPPFLAGS =
BDB_LDFLAGS = -ldb_cxx -lpthread
BDB_LDFLAGS = -ldb_cxx
endif
BDB_LDFLAGS += -lpthread -L../lib -Wl,-rpath,$(PWD)/../lib -ltokuportability
TARGET_BDB = db-benchmark-test-bdb
TARGET_TDB = db-benchmark-test-tokudb
......@@ -65,7 +66,7 @@ clean:
db-benchmark-test-tokudb: ../lib/libtokudb_cxx.a
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
$(CXX) $(CXXFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS) $< -o $@ -DDIRSUF=bdb
......@@ -130,7 +130,7 @@ OFILES = \
$(TOKUROOT)src/range_tree/rangetree.lib \
$(TOKUROOT)src/lock_tree/locktree.lib \
$(TOKUROOT)newbrt/newbrt.lib \
$(LIBPORTABILITY) \
$(LIBPORTABILITY_SO) \
#end
$(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL)
......@@ -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): RPATH_DIRS=$(dir $(TDB_DLINK_FILES))
endif
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB) $(MULTIBENCH_TDB): LDLIBS+=-ltokuportability
$(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(SCANSCAN_TDB): scanscan.c $(PTHREAD_LOCAL)
......
......@@ -3,14 +3,13 @@
.DEFAULT_GOAL=install
TOKUROOT=../
INCLUDEDIRS=-I.
SKIP_LIBPORTABILITYRULE=1
include $(TOKUROOT)toku_include/Makefile.include
OPT_AROPT=-qnoipo #Disable ipo for lib creation even when optimization is on.
SRCS = $(wildcard *.c)
OBJS = $(patsubst %.c,%.$(OEXT),$(SRCS))
TARGET = $(LIBPORTABILITY)
TARGET = $(LIBPORTABILITY_SO) $(LIBPORTABILITY_A)
build install: $(TARGET)
......@@ -21,9 +20,10 @@ else
LINUX_NOSTDLIB=
endif
$(TARGET): $(OBJS)
echo $(patsubst %,linux/%,$(OBJS)) > ../lib/tokuportability.olist
$(CC) -shared $(SYMBOLS) $(OBJS) $(SKIP_WARNING) -o $(TARGET) $(LINUX_NOSTDLIB)
$(LIBPORTABILITY_SO): $(OBJS)
$(CC) -shared $(SYMBOLS) $(OBJS) $(SKIP_WARNING) -o $@ $(LINUX_NOSTDLIB)
$(LIBPORTABILITY_A): $(OBJS)
$(CC) -shared $(SYMBOLS) $(OBJS) $(SKIP_WARNING) -o $@ $(LINUX_NOSTDLIB)
$(OBJS): CFLAGS += -DTOKU_ALLOW_DEPRECATED -D_GNU_SOURCE
$(OBJS): VISIBILITY=
......@@ -33,6 +33,6 @@ check: $(TARGET)
cd tests && $(MAKE) check
clean:
rm -rf $(TARGET) $(LIBPORTABILITY)
rm -rf $(TARGET)
cd tests && $(MAKE) clean
......@@ -123,8 +123,8 @@ log_print.c log_header.h: log_code.c
test 1 = 1
#Needs to be done manually since it does not include newbrt.
logformat$(BINSUF): logformat.c $(LIBPORTABILITY)
$(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LDFLAGS) $(ALWAYS_LINK) $(LINK_MUST_BE_LAST) $(LIBPORTABILITY)
logformat$(BINSUF): logformat.c $(LIBPORTABILITY_SO)
$(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LDFLAGS) $(ALWAYS_LINK) $(LINK_MUST_BE_LAST) $(LIBPORTABILITY_SO)
libs: $(NEWBRT_SO)
......@@ -136,7 +136,7 @@ bins: $(BINS)
check: bins
cd tests;$(MAKE) check
$(BINS): $(NEWBRT_SO) $(LIBPORTABILITY)
$(BINS): $(NEWBRT_SO) $(LIBPORTABILITY_SO)
foo2:
echo $(BINS)
......
......@@ -73,8 +73,7 @@ buildlocktrees: $(LOCKTREE) $(RANGETREE) ;
$(LIBRARY): $(OBJS) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(DEPEND_COMPILE) $(DEPEND_LINK)
NEWBRT_OFILES = $(patsubst %,../%,$(shell cat ../lib/newbrt.olist))
PORTABILITY_OFILES = $(patsubst %,../%,$(shell cat ../lib/tokuportability.olist))
$(LIBRARY): LINK_FILES=$(OBJS) $(LOCKTREE) $(RANGETREE) $(NEWBRT_OFILES) $(PORTABILITY_OFILES)
$(LIBRARY): LINK_FILES=$(OBJS) $(LOCKTREE) $(RANGETREE) $(NEWBRT_OFILES)
ifeq ($(CC),icc)
ifeq ($(HAVE_CILK),1)
ifeq (0,1)
......
......@@ -546,6 +546,7 @@ TDB_CFLAGS=
%.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): LDFLAGS+=-ltokuportability
loader-stress-test: CPPFLAGS+=-I$(TOKUROOT)include -DENVDIR=\"dir.$<\"
loader-stress-test: LOADLIBES+=-L../lib -ltokudb -Wl,-rpath,..
......
......@@ -159,7 +159,8 @@ else ifeq ($(GCCVERSION),4.4.1)
else ifeq ($(GCCVERSION),4.4.0)
CFLAGS += -Wno-strict-aliasing
endif
LIBPORTABILITY=$(TOKUROOT)lib/libtokuportability.$(SOEXT)
LIBPORTABILITY_SO=$(TOKUROOT)lib/libtokuportability.$(SOEXT)
LIBPORTABILITY_A=$(TOKUROOT)lib/libtokuportability.$(AEXT)
PORTABILITY_HEADERS= $(TOKUROOT)$(SYSTEM)
ALWAYS_LINK= -lz -lpthread
......@@ -203,7 +204,8 @@ LINK_DLINK_FILES=$(patsubst %,$(LINK)%,$(notdir $(DLINK_FILES_PREPROCESS_2)))
CRUNTIME=
DEPEND_LINK += \
$(LIBPORTABILITY) \
$(LIBPORTABILITY_SO) \
$(LIBPORTABILITY_A) \
$(LINK_FILES) \
# keep this line so I can have a \ on the previous line
......@@ -306,7 +308,7 @@ ifneq ($(CYGWIN),)
#Cygwin (Windows) Must override some settings
BINSUF=.exe
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' ';'`
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
......@@ -325,7 +327,7 @@ ifneq ($(CYGWIN),)
CRUNTIME=MTd
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
BINOUTPUT=-Fe
OOUTPUT=-Fo
......@@ -448,19 +450,6 @@ clean-default:
%.$(WRONGSOEXT):
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),)
LOCKTREE = $(TOKUROOT)src/lock_tree/locktree.$(AEXT)
LOCKTREE_BUNDLE = $(TOKUROOT)src/lock_tree/locktree.bundle
......@@ -469,7 +458,7 @@ LOCKTREE_TLOG = $(TOKUROOT)src/lock_tree/locktree_tlog.$(AEXT)
LOCKTREE_LOG = $(TOKUROOT)src/lock_tree/locktree_log.$(AEXT)
$(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(@D)*.[ch]
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
ifeq ($(SKIP_RANGETREERULE),)
......@@ -480,7 +469,7 @@ RANGETREE_TLOG = $(TOKUROOT)src/range_tree/rangetree_tlog.$(AEXT)
RANGETREE_LOG = $(TOKUROOT)src/range_tree/rangetree_log.$(AEXT)
$(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(@D)*.[ch]
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
ifeq ($(SKIP_NEWBRTRULE),)
......
......@@ -42,7 +42,7 @@ ifeq ($(OS_CHOICE),windows)
$(UTILS): LINK_FILES+=$(WIN_YDB)
$(UTILS): $(WIN_YDB)
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))
TOKUPORTABILITY_OBJS=$(patsubst %,../%,$(shell cat $(TOKUROOT)lib/tokuportability.olist))
YDB_OBJS=$(wildcard ../src/*.$(OEXT))
......@@ -124,8 +124,8 @@ coverage: $(UTILS)
%.bdb$(BINSUF): %.c
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST) -DUSE_BDB=1
%_static$(BINSUF): %.c ../lib/libtokudb.$(AEXT)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
%_static$(BINSUF): %.c $(TOKUROOT)lib/libtokuportability.$(AEXT)
$(CC) $< $(BIN_FROM_C_FLAGS) $(TOKUROOT)lib/libtokuportability.$(AEXT) $(LINK_MUST_BE_LAST)
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