Skip to content

Commit

Permalink
fix link error under mac os
Browse files Browse the repository at this point in the history
  • Loading branch information
cyshi committed Apr 30, 2016
1 parent 7db9c8e commit b58949c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 5 deletions.
6 changes: 3 additions & 3 deletions depends.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
## $(BOOST_HEADER_DIR)/boost/smart_ptr.hpp
##
#BOOST_HEADER_DIR=/home/users/qinzuoyan01/libs/boost_1_53_0
BOOST_HEADER_DIR=/usr
BOOST_HEADER_DIR=/usr/local/Cellar/boost/1.57.0/include
################################################################

################################################################
Expand All @@ -28,7 +28,7 @@ BOOST_HEADER_DIR=/usr
## $(PROTOBUF_DIR)/lib/libprotobuf.a
##
#PROTOBUF_DIR=/home/users/qinzuoyan01/libs/protobuf-2.4.1/output
PROTOBUF_DIR=/usr/local
PROTOBUF_DIR=/usr/local/Cellar/protobuf/2.6.1
################################################################

################################################################
Expand All @@ -39,7 +39,7 @@ PROTOBUF_DIR=/usr/local
## $(SNAPPY_DIR)/lib/libsnappy.a
##
#SNAPPY_DIR=/home/users/qinzuoyan01/libs/snappy-1.1.1/output
SNAPPY_DIR=/usr
SNAPPY_DIR=/usr/local/Cellar/snappy/1.1.1
################################################################

################################################################
Expand Down
4 changes: 4 additions & 0 deletions sample/compress_sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lz
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
else
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
endif

PROTO_SRC=echo_service.proto
Expand Down
4 changes: 4 additions & 0 deletions sample/echo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lz
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
else
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
endif

PROTO_SRC=echo_service.proto
Expand Down
4 changes: 4 additions & 0 deletions sample/mock_sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lz
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
else
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
endif

PROTO_SRC=echo_service.proto
Expand Down
4 changes: 4 additions & 0 deletions sample/multi_server_sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lz
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
else
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
endif

PROTO_SRC=echo_service.proto
Expand Down
4 changes: 4 additions & 0 deletions sample/timeout_sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lz
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
else
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
endif

PROTO_SRC=sleep_service.proto
Expand Down
11 changes: 10 additions & 1 deletion test/kill_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ INCPATH=-I. -I$(SOFA_PBRPC)/include -I$(BOOST_HEADER_DIR) -I$(PROTOBUF_DIR)/incl
CXXFLAGS += $(OPT) -pipe -W -Wall -fPIC -D_GNU_SOURCE -D__STDC_LIMIT_MACROS $(INCPATH)

LIBRARY=$(SOFA_PBRPC)/lib/libsofa-pbrpc.a $(PROTOBUF_DIR)/lib/libprotobuf.a $(SNAPPY_DIR)/lib/libsnappy.a
LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lrt -lz
LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lz

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
else
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
endif

PROTO_SRC=echo_service.proto
PROTO_OBJ=$(patsubst %.proto,%.pb.o,$(PROTO_SRC))
Expand Down
11 changes: 10 additions & 1 deletion test/perf_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ INCPATH=-I. -I$(SOFA_PBRPC)/include -I$(BOOST_HEADER_DIR) -I$(PROTOBUF_DIR)/incl
CXXFLAGS += $(OPT) -pipe -W -Wall -fPIC -D_GNU_SOURCE -D__STDC_LIMIT_MACROS $(INCPATH)

LIBRARY=$(SOFA_PBRPC)/lib/libsofa-pbrpc.a $(PROTOBUF_DIR)/lib/libprotobuf.a $(SNAPPY_DIR)/lib/libsnappy.a
LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lrt -lz
LDFLAGS += -L$(ZLIB_DIR)/lib -lpthread -lz

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
else
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
endif

PROTO_SRC=echo_service.proto
PROTO_OBJ=$(patsubst %.proto,%.pb.o,$(PROTO_SRC))
Expand Down

0 comments on commit b58949c

Please sign in to comment.