Browse code

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

Henning Westerholt authored on 27/04/2009 15:42:32
Showing 3 changed files
... ...
@@ -5,8 +5,21 @@
5 5
 include ../../Makefile.defs
6 6
 auto_gen=
7 7
 NAME=dialplan.so
8
-DEFS+=-I$(LOCALBASE)/include
9
-LIBS=-L$(LOCALBASE)/lib -lpcre
8
+
9
+BUILDER = $(shell which pcre-config)
10
+
11
+ifeq ($(BUILDER),)
12
+	PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \
13
+	-I/usr/sfw/include
14
+	PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \
15
+	-L/opt/lib -lpcre
16
+else
17
+	PCREDEFS = $(shell pcre-config --cflags)
18
+	PCRELIBS = $(shell pcre-config --libs)
19
+endif
20
+
21
+DEFS+=$(PCREDEFS)
22
+LIBS=$(PCRELIBS)
10 23
 
11 24
 DEFS+=-DOPENSER_MOD_INTERFACE
12 25
 
... ...
@@ -7,8 +7,21 @@
7 7
 include ../../Makefile.defs
8 8
 auto_gen=
9 9
 NAME=lcr.so
10
-DEFS+=-I$(LOCALBASE)/include
11
-LIBS=-L$(LOCALBASE)/lib -lpcre
10
+
11
+BUILDER = $(shell which pcre-config)
12
+
13
+ifeq ($(BUILDER),)
14
+	PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \
15
+	-I/usr/sfw/include
16
+	PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \
17
+	-L/opt/lib -lpcre
18
+else
19
+	PCREDEFS = $(shell pcre-config --cflags)
20
+	PCRELIBS = $(shell pcre-config --libs)
21
+endif
22
+
23
+DEFS+=$(PCREDEFS)
24
+LIBS=$(PCRELIBS)
12 25
 
13 26
 DEFS+=-DOPENSER_MOD_INTERFACE
14 27
 
... ...
@@ -3,8 +3,21 @@
3 3
 include ../../Makefile.defs
4 4
 auto_gen=
5 5
 NAME=regex.so
6
-DEFS+=-I$(LOCALBASE)/include
7
-LIBS=-L$(LOCALBASE)/lib -lpcre
6
+
7
+BUILDER = $(shell which pcre-config)
8
+
9
+ifeq ($(BUILDER),)
10
+	PCREDEFS=-I$(LOCALBASE)/include -I/usr/local/include -I/opt/include \
11
+	-I/usr/sfw/include
12
+	PCRELIBS=-L$(LOCALBASE)/lib -L/usr/local/lib -L/usr/sfw/lib \
13
+	-L/opt/lib -lpcre
14
+else
15
+	PCREDEFS = $(shell pcre-config --cflags)
16
+	PCRELIBS = $(shell pcre-config --libs)
17
+endif
18
+
19
+DEFS+=$(PCREDEFS)
20
+LIBS=$(PCRELIBS)
8 21
 
9 22
 DEFS+=-DOPENSER_MOD_INTERFACE
10 23