build system: look for & require the PCRE2 library

This commit is contained in:
Moritz Bunkus 2020-08-19 17:40:04 +02:00
parent 1465b58342
commit 941e47d97c
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
7 changed files with 30 additions and 1 deletions

View File

@ -26,6 +26,10 @@
* mkvmerge: MP4 reader: fixed handling of `tkhd` atoms of version 1. Fixes
#2900.
## Build system changes
* The PCRE2 library (the 8-bit variant) is now required.
# Version 49.0.0 "Sick Of Losing Soulmates" 2020-08-02

View File

@ -103,6 +103,9 @@ programs and libraries you absolutely need are:
[DocBook XSL stylesheets](https://sourceforge.net/projects/docbook/files/docbook-xsl/)
— for creating man pages from XML documents
- [PCRE2](https://pcre.org/) — the Perl-compatible regular expression
library
You also need the `rake` or `drake` build program. I suggest `rake`
v10.0.0 or newer (this is included with Ruby 2.1) as it offers
parallel builds out of the box. If you only have an earlier version of

View File

@ -141,7 +141,7 @@ def setup_globals
cflags_common += " -Ilib/libebml -Ilib/libmatroska" if c?(:EBML_MATROSKA_INTERNAL)
cflags_common += " -Ilib/nlohmann-json/include" if c?(:NLOHMANN_JSON_INTERNAL)
cflags_common += " -Ilib/fmt/include" if c?(:FMT_INTERNAL)
cflags_common += " #{c(:MATROSKA_CFLAGS)} #{c(:EBML_CFLAGS)} #{c(:PUGIXML_CFLAGS)} #{c(:CMARK_CFLAGS)} #{c(:DVDREAD_CFLAGS)} #{c(:EXTRA_CFLAGS)} #{c(:USER_CPPFLAGS)}"
cflags_common += " #{c(:MATROSKA_CFLAGS)} #{c(:EBML_CFLAGS)} #{c(:PUGIXML_CFLAGS)} #{c(:CMARK_CFLAGS)} #{c(:DVDREAD_CFLAGS)} #{c(:PCRE2_CFLAGS)} #{c(:EXTRA_CFLAGS)} #{c(:USER_CPPFLAGS)}"
cflags_common += " -mno-ms-bitfields -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 " if $building_for[:windows] # 0x0601 = Windows 7/Server 2008 R2
cflags_common += " -march=i686" if $building_for[:windows] && /i686/.match(c(:host))
cflags_common += " -fPIC " if c?(:USE_QT) && !$building_for[:windows]
@ -1047,6 +1047,7 @@ $common_libs = [
:intl,
:iconv,
:fmt,
:pcre2,
]
$common_libs += [:cmark] if c?(:USE_QT)

17
ac/pcre2.m4 Normal file
View File

@ -0,0 +1,17 @@
dnl
dnl Check for pcre2
dnl
PKG_CHECK_EXISTS([libpcre2-8],[libpcre2_8_found=yes],[libpcre2_8_found=no])
if test x"$libpcre2_8_found" = xyes; then
PKG_CHECK_MODULES([PCRE2],[libpcre2-8],[libpcre2_8_found=yes])
PCRE2_CFLAGS="`$PKG_CONFIG --cflags libpcre2-8`"
PCRE2_LIBS="`$PKG_CONFIG --libs libpcre2-8`"
fi
if test x"$libpcre2_8_found" != xyes; then
AC_MSG_ERROR([Could not find the PCRE2 library])
fi
AC_SUBST(PCRE2_CFLAGS)
AC_SUBST(PCRE2_LIBS)

View File

@ -113,6 +113,8 @@ MINGW_PROCESSOR_ARCH = @MINGW_PROCESSOR_ARCH@
MINGW = @MINGW@
NLOHMANN_JSON_INTERNAL = @NLOHMANN_JSON_INTERNAL@
OGG_LIBS = @OGG_LIBS@
PCRE2_CFLAGS = @PCRE2_CFLAGS@
PCRE2_LIBS = @PCRE2_LIBS@
PO4A = @PO4A@
PO4A_TRANSLATE = @PO4A_TRANSLATE@
PO4A_FLAGS = @PO4A_FLAGS@

View File

@ -33,6 +33,7 @@ m4_include(ac/pugixml.m4)
m4_include(ac/nlohmann_jsoncpp.m4)
m4_include(ac/utf8cpp.m4)
m4_include(ac/fmt.m4)
m4_include(ac/pcre2.m4)
m4_include(ac/zlib.m4)
m4_include(ac/qt5.m4)
m4_include(ac/cmark.m4)

View File

@ -165,6 +165,7 @@ class Target
when :dvdread then c(:DVDREAD_LIBS)
when :boost_filesystem then c(:BOOST_FILESYSTEM_LIB)
when :boost_system then c(:BOOST_SYSTEM_LIB)
when :pcre2 then c(:PCRE2_LIBS)
when :pugixml then c?(:PUGIXML_INTERNAL) ? [ '-Llib/pugixml/src', '-lpugixml' ] : c(:PUGIXML_LIBS)
when :qt then c(:QT_LIBS)
when :static then c(:LINK_STATICALLY)