use pcre-config when available, based on patch #2781237 from Jinke Jiang
authorHenning Westerholt <henning.westerholt@1und1.de>
Mon, 27 Apr 2009 15:42:32 +0000 (17:42 +0200)
committerHenning Westerholt <henning.westerholt@1und1.de>
Mon, 27 Apr 2009 15:44:20 +0000 (17:44 +0200)
modules/dialplan/Makefile
modules_k/lcr/Makefile
modules_k/regex/Makefile

index aeb0c6f..87b4acd 100644 (file)
@@ -5,8 +5,21 @@
 include ../../Makefile.defs
 auto_gen=
 NAME=dialplan.so
-DEFS+=-I$(LOCALBASE)/include
-LIBS=-L$(LOCALBASE)/lib -lpcre
+
+BUILDER = $(shell which pcre-config)
+
+ifeq ($(BUILDER),)
+       PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \
+       -I/usr/sfw/include
+       PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \
+       -L/opt/lib -lpcre
+else
+       PCREDEFS = $(shell pcre-config --cflags)
+       PCRELIBS = $(shell pcre-config --libs)
+endif
+
+DEFS+=$(PCREDEFS)
+LIBS=$(PCRELIBS)
 
 DEFS+=-DOPENSER_MOD_INTERFACE
 
index 240a68f..67b5aa3 100644 (file)
@@ -7,8 +7,21 @@
 include ../../Makefile.defs
 auto_gen=
 NAME=lcr.so
-DEFS+=-I$(LOCALBASE)/include
-LIBS=-L$(LOCALBASE)/lib -lpcre
+
+BUILDER = $(shell which pcre-config)
+
+ifeq ($(BUILDER),)
+       PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \
+       -I/usr/sfw/include
+       PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \
+       -L/opt/lib -lpcre
+else
+       PCREDEFS = $(shell pcre-config --cflags)
+       PCRELIBS = $(shell pcre-config --libs)
+endif
+
+DEFS+=$(PCREDEFS)
+LIBS=$(PCRELIBS)
 
 DEFS+=-DOPENSER_MOD_INTERFACE
 
index 6934d0a..cc03890 100644 (file)
@@ -3,8 +3,21 @@
 include ../../Makefile.defs
 auto_gen=
 NAME=regex.so
-DEFS+=-I$(LOCALBASE)/include
-LIBS=-L$(LOCALBASE)/lib -lpcre
+
+BUILDER = $(shell which pcre-config)
+
+ifeq ($(BUILDER),)
+       PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \
+       -I/usr/sfw/include
+       PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \
+       -L/opt/lib -lpcre
+else
+       PCREDEFS = $(shell pcre-config --cflags)
+       PCRELIBS = $(shell pcre-config --libs)
+endif
+
+DEFS+=$(PCREDEFS)
+LIBS=$(PCRELIBS)
 
 DEFS+=-DOPENSER_MOD_INTERFACE