[SR-Dev] git:master: use pcre-config when available, based on patch #2781237 from Jinke Jiang

Henning Westerholt henning.westerholt at 1und1.de
Mon Apr 27 17:44:26 CEST 2009


Module: sip-router
Branch: master
Commit: 019f41eba69e8f5f7a80cd8882b87b0d6f0a183b
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=019f41eba69e8f5f7a80cd8882b87b0d6f0a183b

Author: Henning Westerholt <henning.westerholt at 1und1.de>
Committer: Henning Westerholt <henning.westerholt at 1und1.de>
Date:   Mon Apr 27 17:42:32 2009 +0200

use pcre-config when available, based on patch #2781237 from Jinke Jiang

---

 modules/dialplan/Makefile |   17 +++++++++++++++--
 modules_k/lcr/Makefile    |   17 +++++++++++++++--
 modules_k/regex/Makefile  |   17 +++++++++++++++--
 3 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/modules/dialplan/Makefile b/modules/dialplan/Makefile
index aeb0c6f..87b4acd 100644
--- a/modules/dialplan/Makefile
+++ b/modules/dialplan/Makefile
@@ -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
 
diff --git a/modules_k/lcr/Makefile b/modules_k/lcr/Makefile
index 240a68f..67b5aa3 100644
--- a/modules_k/lcr/Makefile
+++ b/modules_k/lcr/Makefile
@@ -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
 
diff --git a/modules_k/regex/Makefile b/modules_k/regex/Makefile
index 6934d0a..cc03890 100644
--- a/modules_k/regex/Makefile
+++ b/modules_k/regex/Makefile
@@ -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
 




More information about the sr-dev mailing list