Commit 2b5ae996 authored by gejun's avatar gejun

Compilable in linux-mint 17.3 gcc 4.8/5.4, programs hang after being linked with libunwind

Change-Id: Ie49d643b5f53d393bedc79496ca252631bedffac
parent c24d2663
include config.mk
CC=gcc
CXX=g++
CPPFLAGS=-D__const__= -DNDEBUG -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DBRPC_REVISION=\"$(shell git rev-parse --short HEAD)\"
CPPFLAGS=-D__const__= -D_GNU_SOURCE -DNDEBUG -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DBRPC_REVISION=\"$(shell git rev-parse --short HEAD)\"
CXXFLAGS=$(CPPFLAGS) -O2 -g -pipe -Wall -W -Werror -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x -include brpc/config.h
CFLAGS=$(CPPFLAGS) -O2 -g -pipe -Wall -W -Werror -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer
INCPATH=-I. -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
LIBS= $(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(PROTOBUF_PATH)/lib/libprotoc.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
INCPATH=-I. $(addprefix -I, $(INCS))
SRCEXTS = .c .cc .cpp .proto
HDREXTS = .h .hpp
LDFLAGS = -lpthread -lrt -ldl -lz -lssl -lcrypto
BASE_SOURCES = \
base/third_party/dmg_fp/g_fmt.cc \
......@@ -104,8 +93,6 @@ BASE_SOURCES = \
base/process/kill_posix.cc \
base/process/launch.cc \
base/process/launch_posix.cc \
base/process/memory.cc \
base/process/memory_linux.cc \
base/process/process_handle_linux.cc \
base/process/process_handle_posix.cc \
base/process/process_info_linux.cc \
......@@ -208,7 +195,7 @@ MCPACK2PB_SOURCES = \
MCPACK2PB_OBJS = idl_options.pb.o $(addsuffix .o, $(basename $(MCPACK2PB_SOURCES)))
.PHONY:all
all: libbase.a libbvar.a libbthread.a libjson2pb.a libmcpack2pb.a protoc-gen-mcpack libbrpc.a output/include output/lib output/bin
all: libbase.a libbvar.a libbthread.a libjson2pb.a libmcpack2pb.a mcpack2pb/generator.o protoc-gen-mcpack libbrpc.a output/include output/lib output/bin
.PHONY:clean
clean:
......@@ -239,7 +226,7 @@ libmcpack2pb.a:$(MCPACK2PB_OBJS)
protoc-gen-mcpack:mcpack2pb/generator.o libmcpack2pb.a libbase.a libbthread.a libbvar.a
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o protoc-gen-mcpack
@$(CXX) -o protoc-gen-mcpack -Xlinker "-(" $^ $(LIBS) $(PROTOC_LIB) -Xlinker "-)" $(LDFLAGS)
libbrpc.a:$(BRPC_OBJS)
@echo "Linking $@"
......@@ -266,7 +253,7 @@ output/bin:protoc-gen-mcpack
%.pb.cc %.pb.h:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. --proto_path=$(PROTOBUF_PATH)/include $<
@$(PROTOC) --cpp_out=. --proto_path=. --proto_path=$(PROTOBUF_INC) $<
%.o:%.cpp
@echo "Compiling $@"
......
......@@ -40,7 +40,7 @@ void ThreadsService::default_method(::google::protobuf::RpcController* cntl_base
// and pclose will fail:
// CHECK failed: 0 == pclose(pipe): Resource temporarily unavailable
size_t fake_buf;
(void)fread(&fake_buf, sizeof(fake_buf), 1, pipe);
base::ignore_result(fread(&fake_buf, sizeof(fake_buf), 1, pipe));
CHECK_EQ(0, pclose(pipe)) << berror();
tm.stop();
resp.append(base::string_printf("\n\ntime=%lums", tm.m_elapsed()));
......
......@@ -4,6 +4,7 @@
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Aug 31 16:27:49 CST 2014
#include <signal.h>
#include <openssl/md5.h>
#include <google/protobuf/descriptor.h>
#include <gflags/gflags.h>
......
......@@ -7,6 +7,7 @@
#include <openssl/ssl.h>
#include <gflags/gflags.h>
#include <fcntl.h> // O_RDONLY
#include <signal.h>
// Naming services
#ifdef BAIDU_INTERNAL
......
......@@ -4,7 +4,7 @@
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Aug 31 16:27:49 CST 2014
#include <unistd.h>
#include "base/macros.h"
#include "brpc/reloadable_flags.h"
namespace google {
......@@ -61,7 +61,7 @@ static bool RegisterFlagValidatorOrDieImpl(
}
// Error printed by gflags does not have newline. Add one to it.
char newline = '\n';
write(2, &newline, 1);
base::ignore_result(write(2, &newline, 1));
_exit(1);
}
......
......@@ -321,7 +321,7 @@ private:
std::string cmd = base::string_printf("rm -rf %s %s",
id_db_name.c_str(),
time_db_name.c_str());
system(cmd.c_str());
base::ignore_result(system(cmd.c_str()));
}
}
};
......
......@@ -11,6 +11,7 @@
#include <limits> // std::numeric_limits
#include <ostream> // std::ostream
#include <algorithm> // std::sort
#include <math.h> // ceil
#include "base/macros.h" // ARRAY_SIZE
#include "bvar/reducer.h" // Reducer
#include "bvar/window.h" // Window
......
......@@ -5,6 +5,7 @@
#ifndef BVAR_DETAIL_SERIES_H
#define BVAR_DETAIL_SERIES_H
#include <math.h> // round
#include <ostream>
#include "base/scoped_lock.h" // BAIDU_SCOPED_LOCK
#include "base/type_traits.h"
......
......@@ -6,6 +6,7 @@
#define BVAR_WINDOW_H
#include <limits> // std::numeric_limits
#include <math.h> // round
#include <gflags/gflags_declare.h>
#include "base/logging.h" // LOG
#include "bvar/detail/sampler.h"
......
$(error GFLAGS_PATH is not defined, run config_brpc.sh first)
$(error Run config_brpc.sh first)
#!/bin/bash
# NOTE: This requires GNU getopt. On Mac OS X and FreeBSD, you have to install this
# separately; see below.
TEMP=`getopt -o vdm: --long verbose:,gflags:,protobuf:,leveldb:,tcmalloc: -n 'config_brpc' -- "$@"`
TEMP=`getopt -o v: --long incs:,libs:,cc:,cxx: -n 'config_brpc' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
......@@ -8,36 +9,65 @@ if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
# Convert to abspath always so that generated mk is include-able from everywhere
VERBOSE=false
CC=gcc
CXX=g++
while true; do
case "$1" in
-v | --verbose ) VERBOSE=true; shift ;;
--gflags ) GFLAGS_PATH="$(readlink -f $2)"; shift 2 ;;
--protobuf ) PROTOBUF_PATH="$(readlink -f $2)"; shift 2 ;;
--leveldb ) LEVELDB_PATH="$(readlink -f $2)"; shift 2 ;;
--tcmalloc ) TCMALLOC_PATH="$(readlink -f $2)"; shift 2 ;;
--incs ) INCS="$(readlink -f $2)"; shift 2 ;;
--libs ) LIBS="$(readlink -f $2)"; shift 2 ;;
--cc ) CC=$2; shift 2 ;;
--cxx ) CXX=$2; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
if [[ -z "$GFLAGS_PATH" ]];then
>&2 echo "config_brpc: --gflags=<GFLAGS_PATH> must be specified"
if [ -z "$INCS" ] || [ -z "$LIBS" ]; then
>&2 echo "config_brpc: --incs=INCPATHS --libs=LIBPATHS must be specified"
exit 1
fi
if [[ -z "$PROTOBUF_PATH" ]];then
>&2 echo "config_brpc: --protobuf=<PROTOBUF_PATH> must be specified"
exit 1
fi
if [[ -z "$LEVELDB_PATH" ]];then
>&2 echo "config_brpc: --leveldb=<LEVELDB_PATH> must be specified"
find_lib() {
find ${LIBS} -name "$1" | head -n1
}
find_lib_or_die() {
local lib=$(find_lib $1)
if [ -z "$lib" ]; then
>&2 echo "fail to find $1 from -libs"
exit 1
else
echo $lib
fi
}
find_dir_of_header() {
find ${INCS} -path "*/$1" | sed "s|$1||g"
}
GFLAGS_LIB=$(find_lib_or_die libgflags.a)
PROTOBUF_LIB=$(find_lib_or_die libprotobuf.a)
PROTOC_LIB=$(find_lib_or_die libprotoc.a)
PROTOC=$(which protoc)
if [ -z "$PROTOC" ]; then
PROTOC=$(find_lib_or_die protoc)
fi
CONTENT1="GFLAGS_PATH=$GFLAGS_PATH\nPROTOBUF_PATH=$PROTOBUF_PATH\nLEVELDB_PATH=$LEVELDB_PATH"
echo -e $CONTENT1 > config.mk
PROTOBUF_INC=$(find_dir_of_header google/protobuf/message.h)
LEVELDB_LIB=$(find_lib_or_die libleveldb.a)
SNAPPY_LIB=$(find_lib_or_die libsnappy.a)
if [[ ! -z "$TCMALLOC_PATH" ]]; then
CONTENT2="$CONTENT1\nTCMALLOC_PATH=$TCMALLOC_PATH"
else
CONTENT2="\$(error TCMALLOC_PATH is not defined, run config_brpc.sh with --tcmalloc again)"
#can't use \n in texts because sh does not support -e
echo "INCS=$INCS" > config.mk
echo "LIBS=$GFLAGS_LIB $PROTOBUF_LIB $LEVELDB_LIB $SNAPPY_LIB" >> config.mk
echo "PROTOC_LIB=$PROTOC_LIB" >> config.mk
echo "PROTOC=$PROTOC" >> config.mk
echo "PROTOBUF_INC=$PROTOBUF_INC" >> config.mk
echo "CC=$CC" >> config.mk
echo "CXX=$CXX" >> config.mk
echo "ifeq (\$(LINK_PERFTOOLS), 1)" >> config.mk
TCMALLOC_LIB=$(find_lib libtcmalloc_and_profiler.a)
if [ ! -z "$TCMALLOC_LIB" ]; then
echo " LIBS+=$TCMALLOC_LIB" >> config.mk
fi
UNWIND_LIB=$(find_lib libunwind.a)
if [ ! -z "$UNWIND_LIB" ]; then
echo " LIBS+=$UNWIND_LIB" >> config.mk
fi
echo -e $CONTENT2 > config_with_tcmalloc.mk
echo "endif" >> config.mk
$(error TCMALLOC_PATH is not defined, run config_brpc.sh with --tcmalloc again)
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
BRPC_PATH = ../../output
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH = ../../output
CC = gcc
CXX = g++
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC = $(PROTOBUF_PATH)/bin/protoc
LIBS = $(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -28,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH = ../../output
CC = gcc
CXX = g++
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC = $(PROTOBUF_PATH)/bin/protoc
LIBS = $(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -28,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
......@@ -58,7 +58,7 @@ public:
stub.Echo(&cntl2, &request2, &response2, NULL);
if (cntl2.Failed()) {
LOG(ERROR) << "Fail to send EchoRequest, " << cntl2.ErrorText();
cntl->SetFailed(cntl2.ErrorCode(), cntl2.ErrorText().c_str());
cntl->SetFailed(cntl2.ErrorCode(), "%s", cntl2.ErrorText().c_str());
return;
}
response->set_message(response2.message());
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH = ../../output
CC = gcc
CXX = g++
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC = $(PROTOBUF_PATH)/bin/protoc
LIBS = $(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -28,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH = ../../output
CC = gcc
CXX = g++
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC = $(PROTOBUF_PATH)/bin/protoc
LIBS = $(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -28,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH = ../../output
CC = gcc
CXX = g++
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC = $(PROTOBUF_PATH)/bin/protoc
LIBS = $(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -28,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
BRPC_PATH = ../../output
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,15 +25,15 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_PATH)/include --cpp_out=. --mcpack_out=. $<
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_INC) --cpp_out=. --mcpack_out=. $<
%.o:%.cpp
@echo "Compiling $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
LIBS+=-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS+=-llzma
endif
CLIENT_SOURCES = http_client.cpp
BENCHMARK_SOURCES = benchmark_http.cpp
......@@ -31,15 +33,15 @@ clean:
http_client:$(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
benchmark_http:$(BENCHMARK_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
http_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
include ../../config.mk
BRPC_PATH = ../../output
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
SOURCES = $(wildcard *.cpp)
OBJS = $(addsuffix .o, $(basename $(SOURCES)))
......@@ -23,7 +19,7 @@ clean:
memcache_client:$(OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.o:%.cpp
@echo "Compiling $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,15 +31,15 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_PATH)/include --cpp_out=. --mcpack_out=. $<
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_INC) --cpp_out=. --mcpack_out=. $<
%.o:%.cpp
@echo "Compiling $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,15 +31,15 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_PATH)/include --cpp_out=. --mcpack_out=. $<
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_INC) --cpp_out=. --mcpack_out=. $<
%.o:%.cpp
@echo "Compiling $@"
......
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
BRPC_PATH = ../../output
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
BRPC_PATH = ../../output
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz -lreadline -lncurses
include ../../config.mk
BRPC_PATH = ../../output
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz -lreadline -lncurses
PRESS_SOURCES = redis_press.cpp
CLI_SOURCES = redis_cli.cpp
......@@ -25,11 +22,11 @@ clean:
redis_press:$(PRESS_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
redis_cli:$(CLI_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.o:%.cpp
@echo "Compiling $@"
......
......@@ -8,6 +8,7 @@
// A baidu-rpc based command-line interface to talk with redis-server
#include <signal.h>
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config_with_tcmalloc.mk
LINK_PERFTOOLS=0
include ../../config.mk
BRPC_PATH=../../output
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a $(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH=-I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS+=$(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS=-lpthread -lrt -lssl -lcrypto -ldl -lz
ifeq ($(LINK_PERFTOOLS), 1)
CPPFLAGS += -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
LDFLAGS += -llzma
endif
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -29,11 +31,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
include ../../config.mk
BRPC_PATH = ../../output
CC = gcc
CXX = g++
CPPFLAGS = -std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS = $(CPPFLAGS)
INCPATH = -I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC = $(PROTOBUF_PATH)/bin/protoc
LIBS = $(wildcard $(BRPC_PATH)/lib/lib*.a) $(GFLAGS_PATH)/lib/libgflags.a $(LEVELDB_PATH)/lib/libleveldb.a $(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
INCPATH = -I$(BRPC_PATH)/include $(addprefix -I, $(INCS))
LIBS += $(wildcard $(BRPC_PATH)/lib/lib*.a)
LDFLAGS = -lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
......@@ -28,11 +25,11 @@ clean:
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" $(LDFLAGS) -o $@
%.pb.cc:%.proto
@echo "Generating $@"
......
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