소스 검색

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

Henning Westerholt 16 년 전
부모
커밋
019f41eba6
3개의 변경된 파일45개의 추가작업 그리고 6개의 파일을 삭제
  1. 15 2
      modules/dialplan/Makefile
  2. 15 2
      modules_k/lcr/Makefile
  3. 15 2
      modules_k/regex/Makefile

+ 15 - 2
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
 

+ 15 - 2
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
 

+ 15 - 2
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