Commit 12d7fdbb authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

simplify the config and build. addresses #317

git-svn-id: file:///svn/mysql/tokudb-engine/src@3017 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1e0b6b32
MYSQL_SRC = $(HOME)/mysql-5.1.23-rc
MYSQL_LIBDIR = $(HOME)/mysql-5.1.23-rc-build/lib/mysql
TOKUDB = /usr/local/tokudb-4.4
SRCS = $(wildcard *.cc)
OBJS = $(patsubst %.cc,%.o,$(SRCS))
TARGET = $(patsubst %.o,%.so,$(OBJS))
OPTFLAGS = -O0
# GCOV_FLAGS = -ftest-coverage -fprofile-arcs
MYSQL_FLAGS = -DHAVE_CONFIG_H -DDBUG_ON -DSAFE_MUTEX -DEXTRA_DEBUG -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX
MYSQL_FLAGS += -DMYSQL_DYNAMIC_PLUGIN
MYSQL_CXXFLAGS = -fno-implicit-templates -fno-exceptions -fno-rtti
CPPFLAGS = -I. -I$(MYSQL_SRC)/sql -I$(MYSQL_SRC)/include -I$(MYSQL_SRC)/regex -I$(TOKUDB)/include
# CPPFLAGS += -DMT -DMD -DMP -DMF
CPPFLAGS += $(MYSQL_FLAGS)
CXXFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS)
CXXFLAGS += -fPIC
LDFLAGS = -shared -nostdlib -Wl,-soname -Wl,libtokudb_engine.so
LIBS = -L$(TOKUDB)/lib -ltokudb -lpthread -lz -lstdc++ -lm -lgcc_s -lc
# LIBDIR = /usr/lib
# GCCLIBDIR = /usr/lib/gcc/i386-redhat-linux/4.1.1
# BEGINLIBS = $(LIBDIR)/crti.o $(GCCLIBDIR)/crtbeginS.o
# ENDLIBS = $(GCCLIBDIR)/crtendS.o $(LIBDIR)/crtn.o
all: $(TARGET)
%.so: %.o
$(CXX) $(LDFLAGS) $(GCOV_FLAGS) $(MYSQL_CXXFLAGS) $(BEGINLIBS) $< $(LIBS) $(ENDLIBS) -o $@
clean:
rm -rf $(TARGET) $(OBJS)
install: $(TARGET)
cp $(TARGET) $(MYSQL_LIBDIR)/libtokudb_engine.so
#!/bin/bash
# create the Makefile from the Makefile.tokutek template and some
# command line parameters
tokudb=/usr/local/tokudb
mysql=/usr/local/mysql
libdir=/usr/local/mysql/lib
while [ $# -gt 0 ] ; do
arg=$1; shift
if [[ $arg =~ "--with-tokudb=(.*)" ]] ; then
tokudb=${BASH_REMATCH[1]}
fi
if [[ $arg =~ "--with-mysql=(.*)" ]] ; then
mysql=${BASH_REMATCH[1]}
fi
if [[ $arg =~ "--libdir=(.*)" ]] ; then
libdir=${BASH_REMATCH[1]}
fi
done
error=0
if [ ! -d $tokudb ] ; then
echo $tokudb missing
# error=1
fi
if [ ! -d $mysql ] ; then
echo $mysql missing
error=1
fi
if [ ! -d $libdir ] ; then
echo $libdir missing
error=1
fi
if [ $error -ne 0 ] ; then exit 1 ; fi
# escape the path names so that the sed works
# note: i was not smart enough to get this right without a sequence of experiments
tokudb=`echo $tokudb | sed -e s/\\\//\\\\\\\\\\\//g`
# echo $tokudb
mysql=`echo $mysql | sed -e s/\\\//\\\\\\\\\\\//g`
# echo $mysql
libdir=`echo $libdir | sed -e s/\\\//\\\\\\\\\\\//g`
# echo $libdir
sed -e "s/^TOKUDB =\(.*\)$/TOKUDB = $tokudb/" \
-e "s/^MYSQL_SRC = \(.*\)/MYSQL_SRC = $mysql/" \
-e "s/^MYSQL_LIBDIR = \(.*\)/MYSQL_LIBDIR = $libdir/" <Makefile.tokutek >Makefile
......@@ -24,7 +24,7 @@ unsigned int my_tid() {
#undef HAVE_DTRACE
#undef _DTRACE_VERSION
#include "tokudb_config.h"
//#include "tokudb_config.h"
/* We define DTRACE after mysql_priv.h in case it disabled dtrace in the main server */
#ifdef HAVE_DTRACE
......
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