Fix build with system c-ares

pull/7900/head
Yuchen Zeng 9 years ago
parent c1da234693
commit df2a7b7e40
  1. 11
      Makefile
  2. 11
      templates/Makefile.template

@ -675,18 +675,13 @@ CPPFLAGS := -Ithird_party/c-ares -Isrc/c-ares $(CPPFLAGS)
LDFLAGS := -L$(LIBDIR)/$(CONFIG)/c-ares $(LDFLAGS)
else
ifeq ($(HAS_PKG_CONFIG),true)
CARES_PKG_CONFIG = true
PC_REQUIRES_GRPC += libcares
CPPFLAGS += $(shell $(PKG_CONFIG) --cflags libcares)
LDFLAGS_CARES_PKG_CONFIG = $(shell $(PKG_CONFIG) --libs-only-L libcares)
ifeq ($(SYSTEM),Linux)
ifneq ($(LDFLAGS_CARES_PKG_CONFIG),)
LDFLAGS_CARES_PKG_CONFIG += $(shell $(PKG_CONFIG) --libs-only-L libcares | sed s/L/Wl,-rpath,/)
endif
endif
LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libcares)
LIBS += $(patsubst -l%,%,$(shell $(PKG_CONFIG) --libs-only-l libcares))
else
PC_LIBS_GRPC += -lcares
LIBS += libcares
LIBS += cares
endif
endif

@ -563,18 +563,13 @@
LDFLAGS := -L$(LIBDIR)/$(CONFIG)/c-ares $(LDFLAGS)
else
ifeq ($(HAS_PKG_CONFIG),true)
CARES_PKG_CONFIG = true
PC_REQUIRES_GRPC += libcares
CPPFLAGS += $(shell $(PKG_CONFIG) --cflags libcares)
LDFLAGS_CARES_PKG_CONFIG = $(shell $(PKG_CONFIG) --libs-only-L libcares)
ifeq ($(SYSTEM),Linux)
ifneq ($(LDFLAGS_CARES_PKG_CONFIG),)
LDFLAGS_CARES_PKG_CONFIG += $(shell $(PKG_CONFIG) --libs-only-L libcares | sed s/L/Wl,-rpath,/)
endif
endif
LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libcares)
LIBS += $(patsubst -l%,%,$(shell $(PKG_CONFIG) --libs-only-l libcares))
else
PC_LIBS_GRPC += -lcares
LIBS += libcares
LIBS += cares
endif
endif

Loading…
Cancel
Save