|
@@ -9,11 +9,25 @@ LD=g++
|
|
auto_gen=
|
|
auto_gen=
|
|
NAME=ndb_cassandra.so
|
|
NAME=ndb_cassandra.so
|
|
|
|
|
|
-THRIFT_DIR = /usr/local/include/thrift
|
|
|
|
-LIB_DIR = /usr/local/lib
|
|
|
|
-
|
|
|
|
-DEFS += -I${THRIFT_DIR}
|
|
|
|
-LIBS += -L${LIB_DIR} thrift_wrapper.o cassandra_constants.o cassandra_types.o Cassandra.o -lthrift
|
|
|
|
|
|
+ifeq ($(CROSS_COMPILE),)
|
|
|
|
+ BUILDER = $(shell which pkg-config)
|
|
|
|
+ifneq ($(BUILDER),)
|
|
|
|
+ PKGLIBTHRIFT = $(shell $(BUILDER) --exists thrift > /dev/null 2>&1 ; echo $$? )
|
|
|
|
+ifneq ($(PKGLIBTHRIFT),0)
|
|
|
|
+ BUILDER =
|
|
|
|
+endif
|
|
|
|
+endif
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+ifneq ($(BUILDER),)
|
|
|
|
+ THRIFT_INC = $(shell $(BUILDER) --cflags thrift)
|
|
|
|
+ DEFS += $(THRIFT_INC)
|
|
|
|
+ LIBS += $(shell $(BUILDER) --libs thrift)
|
|
|
|
+else
|
|
|
|
+ THRIFT_INC = -I/usr/local/include
|
|
|
|
+ DEFS += $(THRIFT_INC)
|
|
|
|
+ LIBS += -L/usr/local/lib thrift_wrapper.o cassandra_constants.o cassandra_types.o Cassandra.o -lthrift
|
|
|
|
+endif
|
|
|
|
|
|
CXXFLAGS=$(CFLAGS:-Wno-deprecated option=)
|
|
CXXFLAGS=$(CFLAGS:-Wno-deprecated option=)
|
|
CXXFLAGS+=-Wno-write-strings -Wno-deprecated -Wno-unused-function -Wno-sign-compare -Wno-strict-aliasing
|
|
CXXFLAGS+=-Wno-write-strings -Wno-deprecated -Wno-unused-function -Wno-sign-compare -Wno-strict-aliasing
|
|
@@ -22,18 +36,18 @@ include ../../Makefile.modules
|
|
|
|
|
|
cassandra_constants.o: cassandra_constants.cpp cassandra_constants.h
|
|
cassandra_constants.o: cassandra_constants.cpp cassandra_constants.h
|
|
@echo "Compiling $<"
|
|
@echo "Compiling $<"
|
|
- $(CXX) $(CXXFLAGS) -I/usr/local/include/thrift -c $< -o $@
|
|
|
|
|
|
+ $(CXX) $(CXXFLAGS) $(THRIFT_INC) -c $< -o $@
|
|
|
|
|
|
cassandra_types.o: cassandra_types.cpp cassandra_types.h
|
|
cassandra_types.o: cassandra_types.cpp cassandra_types.h
|
|
@echo "Compiling $<"
|
|
@echo "Compiling $<"
|
|
- $(CXX) $(CXXFLAGS) -I/usr/local/include/thrift -c $< -o $@
|
|
|
|
|
|
+ $(CXX) $(CXXFLAGS) $(THRIFT_INC) -c $< -o $@
|
|
|
|
|
|
Cassandra.o: Cassandra.cpp Cassandra.h
|
|
Cassandra.o: Cassandra.cpp Cassandra.h
|
|
@echo "Compiling $<"
|
|
@echo "Compiling $<"
|
|
- $(CXX) $(CXXFLAGS) -I/usr/local/include/thrift -c $< -o $@
|
|
|
|
|
|
+ $(CXX) $(CXXFLAGS) $(THRIFT_INC) -c $< -o $@
|
|
|
|
|
|
thrift_wrapper.o: thrift_wrapper.cpp thrift_wrapper.h
|
|
thrift_wrapper.o: thrift_wrapper.cpp thrift_wrapper.h
|
|
@echo "Compiling $<"
|
|
@echo "Compiling $<"
|
|
$(CXX) $(CXXFLAGS) $(CFLAGS) $(C_DEFS) $(DEFS) -c $< -o $@
|
|
$(CXX) $(CXXFLAGS) $(CFLAGS) $(C_DEFS) $(DEFS) -c $< -o $@
|
|
|
|
|
|
-ndb_cassandra.so: thrift_wrapper.o cassandra_constants.o cassandra_types.o Cassandra.o
|
|
|
|
|
|
+ndb_cassandra.so: thrift_wrapper.o cassandra_constants.o cassandra_types.o Cassandra.o
|