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

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

Loading…
Cancel
Save