From d2079ab482bc4741344a58a1fc1a163a3807839f Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 11 Nov 2014 11:45:39 -0800 Subject: [PATCH] makefile: Add link library path (-L) when needed on platforms which don't readily locate the PCRE library --- makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makefile b/makefile index 94403e1a..d2ae30a7 100644 --- a/makefile +++ b/makefile @@ -293,6 +293,8 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) $(info include paths are: $(INCPATH)) find_lib = $(strip $(firstword $(foreach dir,$(strip $(LIBPATH)),$(wildcard $(dir)/lib$(1).$(LIBEXT))))) find_include = $(strip $(firstword $(foreach dir,$(strip $(INCPATH)),$(wildcard $(dir)/$(1).h)))) + need_search = $(strip $(shell ld -l$(1) /dev/null 2>&1 | grep $(1) | sed s/$(1)//)) + LD_SEARCH_NEEDED := $(call need_search,ZzzzzzzZ) ifneq (,$(call find_lib,m)) OS_LDFLAGS += -lm $(info using libm: $(call find_lib,m)) @@ -337,6 +339,9 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) OS_CCDEFS += -DHAVE_PCREPOSIX_H OS_LDFLAGS += -lpcreposix $(info using libpcreposix: $(call find_lib,pcreposix) $(call find_include,pcreposix)) + ifeq ($(LD_SEARCH_NEEDED),$(call need_search,pcreposix)) + OS_LDFLAGS += -L$(dir $(call find_lib,pcreposix)) + endif endif else # If libpcreposix isn't available, fall back to the local regex.h