diff options
author | Michael Steed <msteed68@gmail.com> | 2016-04-23 22:09:17 -0600 |
---|---|---|
committer | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2016-04-27 12:14:53 +0800 |
commit | c4c7983497e7be798c3bd1c97df38e8d1d1a58b8 (patch) | |
tree | 599198615fbfb5e1f97f42bed97dd311a7e84c51 /configure.ac | |
parent | 1f06e5f0b9ee483053b987c9cab9f1f5fce2590c (diff) |
configure: require at least pcre2-10.21
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 90065e9b..87bf46b7 100644 --- a/configure.ac +++ b/configure.ac @@ -789,6 +789,7 @@ else AC_MSG_RESULT(no) fi +pcre2_min_version=10.21 EXTRA_PCRE2= AC_ARG_WITH( included-pcre2, @@ -817,8 +818,28 @@ if test "x$included_pcre2" != "xyes"; then # and so AC_CHECK_LIB won't work (can't use a variable as library name) # AC_SEARCH_LIBS will use the existing $LIBS flags with no additional library first AC_SEARCH_LIBS([pcre2_compile_$WCHAR_T_BITS], [], - [ working_pcre2=yes - AC_MSG_NOTICE([using system PCRE2 library]) + [ # pcre2 lib found, check for minimum version + pcre2_version=`$PCRE2_CONFIG --version` + AS_VERSION_COMPARE([$pcre2_version], [$pcre2_min_version], + [ # version < minimum + AC_MSG_NOTICE([system PCRE2 library version $pcre2_version, need $pcre2_min_version or later]) + if test "x$included_pcre2" = "xno"; then + # complain about pcre2 version + AC_MSG_ERROR([system PCRE2 library is too old, but --without-included-pcre2 was given.]) + else + # use the internal version; undo changes to LIBS/CXXFLAGS + included_pcre2=yes + LIBS="$XLIBS" + CXXFLAGS="$XCXXFLAGS" + fi + ], + [ # version == minimum + working_pcre2=yes + ], + [ # version > minimum + working_pcre2=yes + ] + ) ], [ # fail case; undo the changes to LIBS/CXXFLAGS working_pcre2=no @@ -828,7 +849,9 @@ if test "x$included_pcre2" != "xyes"; then ) fi - if test "x$working_pcre2" != "xyes"; then + if test "x$working_pcre2" = "xyes"; then + AC_MSG_NOTICE([using system PCRE2 library]) + else # pcre2 size wrong or pcre2-config not found # is it OK to use the included version? if test "x$included_pcre2" = "xno"; then |