Skip to content

Commit de6d3c5

Browse files
committed
[Core] Move project to PCRE2
Move project to PCRE2 as PCRE is EOL and won't receive any security updates anymore. PCRE2 have different API compared to PCRE. Mainly PCRE2 have the concept of match_data, no ovector needs to be passed, different handling for error string and different handling for substring manipulation. Update any user of PCRE library with the new API Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
1 parent 0c3287c commit de6d3c5

File tree

39 files changed

+482
-327
lines changed

39 files changed

+482
-327
lines changed

Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ CORE_LIBS+=libfreeswitch_libyuv.la
231231
endif
232232

233233
lib_LTLIBRARIES = libfreeswitch.la
234-
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(SOFIA_SIP_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS)
234+
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE2_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(SOFIA_SIP_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS)
235235
libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined
236-
libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(SYSTEMD_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS)
236+
libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE2_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(SYSTEMD_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS)
237237
libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)
238238

239239
if HAVE_PNG

build/Makefile.centos5

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ DOWNLOAD=http://files.freeswitch.org/downloads/libs
1313
JPEG=v8d
1414
OPENSSL=1.0.1l
1515
SQLITE=autoconf-3080403
16-
PCRE=8.35
16+
PCRE2=10.42
1717
CURL=7.40.0
1818
SPEEX=1.2rc1
1919
LIBEDIT=20140618-3.1
@@ -45,7 +45,7 @@ has-git:
4545
@git --version || (echo "please install git by running 'make install-git'" && false)
4646

4747
clean:
48-
@rm -rf openssl* ldns* jpeg* pcre* perl* pkg-config* speex* sqlite* libedit* curl* *~
48+
@rm -rf openssl* ldns* jpeg* pcre2* perl* pkg-config* speex* sqlite* libedit* curl* *~
4949
(cd freeswitch.git && git clean -fdx && git reset --hard HEAD && git pull)
5050

5151
libjpeg: jpeg-8d/.done
@@ -66,9 +66,9 @@ sqlite-$(SQLITE):
6666
(test -d $@) || (wget -4 -O $@.tar.gz $(DOWNLOAD)/$@.tar.gz && tar zxfv $@.tar.gz)
6767
(cd $@ && ./configure --prefix=$(PREFIX) && make && sudo make install && touch .done_sqlite && touch .done)
6868

69-
pcre: pcre-$(PCRE)/.done
70-
pcre-$(PCRE)/.done: pcre-$(PCRE)
71-
pcre-$(PCRE):
69+
pcre2: pcre2-$(PCRE2)/.done
70+
pcre2-$(PCRE2)/.done: pcre2-$(PCRE2)
71+
pcre2-$(PCRE2):
7272
(test -d $@) || (wget -4 -O $@.tar.gz $(DOWNLOAD)/$@.tar.gz && tar zxfv $@.tar.gz)
7373
(cd $@ && ./configure --prefix=$(PREFIX) && make && sudo make install && touch .done)
7474

build/Makefile.centos6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# in that same directory.
77
#
88
#
9-
RPMS=git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel e2fsprogs-devel sqlite-devel libcurl-devel pcre-devel speex-devel ldns-devel libedit-devel
10-
DEBS=git build-essential automake autoconf 'libtool-bin|libtool' wget python uuid-dev zlib1g-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libpcre3-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev pkg-config
9+
RPMS=git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel e2fsprogs-devel sqlite-devel libcurl-devel pcre2-devel speex-devel ldns-devel libedit-devel
10+
DEBS=git build-essential automake autoconf 'libtool-bin|libtool' wget python uuid-dev zlib1g-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libpcre2-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev pkg-config
1111

1212
freeswitch: deps has-git freeswitch.git/Makefile
1313
cd freeswitch.git && make

build/Makefile.openbsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99

10-
PKG=rsync-3.1.0 git automake-1.14.1 autoconf-2.69p1 libtool gmake bzip2 jpeg wget pcre speex libldns
10+
PKG=rsync-3.1.0 git automake-1.14.1 autoconf-2.69p1 libtool gmake bzip2 jpeg wget pcre2 speex libldns
1111
PREFIX=/usr/local/freeswitch
1212
DOWNLOAD=http://files.freeswitch.org/downloads/libs
1313
OPENSSL=1.0.1j

build/Makefile.solaris11

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DOWNLOAD=http://files.freeswitch.org/downloads/libs
1212
JP=v8d
1313
SSL=1.0.1j
1414
SQLITE=autoconf-3080403
15-
PCRE=8.35
15+
PCRE2=10.42
1616
CURL=7.35.0
1717
SPEEX=1.2rc1
1818
LIBEDIT=20140618-3.1
@@ -43,7 +43,7 @@ has-git:
4343
@git --version || (echo "please install git by running 'gmake install-git'" && false)
4444

4545
clean:
46-
@rm -rf openssl* ldns* jpeg* pcre* perl* pkg-config* speex* sqlite* libedit* curl* *~
46+
@rm -rf openssl* ldns* jpeg* pcre2* perl* pkg-config* speex* sqlite* libedit* curl* *~
4747
(cd freeswitch.git && git clean -fdx && git reset --hard HEAD && git pull)
4848

4949
libjpeg: jpeg-8d/.done
@@ -64,9 +64,9 @@ sqlite-$(SQLITE):
6464
(test -d $@) || (wget -4 -O $@.tar.gz $(DOWNLOAD)/$@.tar.gz && tar zxfv $@.tar.gz)
6565
(cd $@ && CFLAGS=-m64 LDFLAGS=-m64 ./configure --prefix=$(PREFIX) && gmake && sudo gmake install && touch .done)
6666

67-
pcre: pcre-$(PCRE)/.done
68-
pcre-$(PCRE)/.done: pcre-$(PCRE)
69-
pcre-$(PCRE):
67+
pcre2: pcre2-$(PCRE2)/.done
68+
pcre2-$(PCRE2)/.done: pcre2-$(PCRE2)
69+
pcre2-$(PCRE2):
7070
(test -d $@) || (wget -4 -O $@.tar.gz $(DOWNLOAD)/$@.tar.gz && tar zxfv $@.tar.gz)
7171
(cd $@ && CXXFLAGS=-m64 CFLAGS=-m64 LDFLAGS=-m64 ./configure --prefix=$(PREFIX) && gmake && sudo gmake install && touch .done)
7272

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ PKG_CHECK_MODULES([TPL], [libtpl >= 1.5],[
13231323

13241324
PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20])
13251325
PKG_CHECK_MODULES([CURL], [libcurl >= 7.19])
1326-
PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
1326+
PKG_CHECK_MODULES([PCRE2], [libpcre2-8 >= 10.00])
13271327
PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])
13281328
PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[
13291329
AM_CONDITIONAL([HAVE_YAML],[true])],[

freeswitch.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ BuildRequires: libtool >= 1.5.17
142142
BuildRequires: openssl-devel >= 1.0.1e
143143
BuildRequires: sofia-sip-devel >= 1.13.15
144144
BuildRequires: spandsp3-devel >= 3.0
145-
BuildRequires: pcre-devel
145+
BuildRequires: pcre2-devel
146146
BuildRequires: speex-devel
147147
BuildRequires: sqlite-devel >= 3.6.20
148148
BuildRequires: libtiff-devel
@@ -156,7 +156,7 @@ BuildRequires: zlib-devel
156156
BuildRequires: libxml2-devel
157157
BuildRequires: libsndfile-devel
158158
Requires: curl >= 7.19
159-
Requires: pcre
159+
Requires: pcre2
160160
Requires: speex
161161
Requires: sqlite >= 3.6.20
162162
Requires: libtiff

libs/.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ opal
554554
/win32/celt/*/*/libcelt.log
555555
/win32/libg722_1/*/*/libg722_1.log
556556
/win32/libshout/*/*/libshout.log
557-
/win32/pcre/pcre_chartables.c
557+
/win32/pcre2/pcre2_chartables.c
558558
/win32/tmp*.bat
559559
!/xmlrpc-c/include/xmlrpc-c/config.h.in
560560
/xmlrpc-c/stamp-h2
@@ -610,9 +610,9 @@ opal
610610
broadvoice/config/compile
611611
ilbc/config/compile
612612
libg722_1/config/compile
613-
pcre/compile
613+
pcre2/compile
614614
srtp/build/compile
615-
/pcre-*/
615+
/pcre2-*/
616616
/speex-*/
617617
/curl-*/
618618
/sqlite-*.zip
@@ -637,8 +637,8 @@ curl-*/
637637
curl-*
638638
flite-*/
639639
flite-*
640-
pcre-*/
641-
pcre-*
640+
pcre2-*/
641+
pcre2-*
642642
libsndfile-*/
643643
libsndfile-*
644644
opencv-*/

libs/apr/build/prebuildNW.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.
3535
copy ..\..\apr-util\xml\expat\lib\config.hnw ..\..\apr-util\xml\expat\lib\config.h
3636
copy ..\..\apr-util\include\private\apu_select_dbm.hw ..\..\apr-util\include\private\apu_select_dbm.h
3737

38-
@echo Fixing up the pcre headers
39-
copy ..\..\pcre\config.hw ..\..\pcre\config.h
40-
copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h
38+
@echo Fixing up the pcre2 headers
39+
copy ..\..\pcre2\config.hw ..\..\pcre2\config.h
40+
copy ..\..\pcre2\pcre2.hw ..\..\pcre2\pcre2.h
4141

4242
@echo Generating the import list...
4343
set MWCIncludes=..\include;..\include\arch\netware;..\include\arch\unix;..\..\apr-util\include;+%NovellLibC%

src/include/switch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
* - APR (http://apr.apache.org)
173173
* - APR-Util (http://apr.apache.org)
174174
* - SQLite (http://www.sqlite.org)
175-
* - Pcre (http://www.pcre.org/)
175+
* - Pcre2 (http://www.pcre.org/)
176176
* - SRTP (http://srtp.sourceforge.net/srtp.html)
177177
*
178178
* Additionally, the various external modules make use of several external modules:

0 commit comments

Comments
 (0)