comparison m4/acinclude.m4 @ 27543:d7b18d44ae4e

Check if PCRE was compiled with --enable-utf (bug #35910). * acinclude.m4 (OCTAVE_CHECK_LIB_PCRE_OK): Add macro to check whether PCRE was compiled with --enable-utf. * configure.ac: Require that the new test passes.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 17 Oct 2019 22:01:28 +0200
parents c3ea5c772a84
children a8c5255c34b1
comparison
equal deleted inserted replaced
27542:b8aa62c1deb5 27543:d7b18d44ae4e
1454 $2 1454 $2
1455 : 1455 :
1456 fi 1456 fi
1457 ]) 1457 ])
1458 dnl 1458 dnl
1459 dnl Check whether PCRE is compiled with --enable-utf.
1460 dnl
1461 AC_DEFUN([OCTAVE_CHECK_LIB_PCRE_OK], [
1462 AC_CACHE_CHECK([whether PCRE library was compiled with UTF support],
1463 [octave_cv_lib_pcre_ok],
1464 [AC_LANG_PUSH(C++)
1465 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1466 #include <stdio.h>
1467 #if defined (HAVE_PCRE_H)
1468 # include <pcre.h>
1469 #elif defined (HAVE_PCRE_PCRE_H)
1470 # include <pcre/pcre.h>
1471 #endif
1472 ]], [[
1473 const char *pattern = "test";
1474 const char *err;
1475 int erroffset;
1476 pcre *data = pcre_compile (pattern, PCRE_UTF8, &err, &erroffset, nullptr);
1477 return (! data);
1478 ]])],
1479 octave_cv_lib_pcre_ok=yes,
1480 octave_cv_lib_pcre_ok=no,
1481 octave_cv_lib_pcre_ok=yes)
1482 AC_LANG_POP(C++)
1483 ])
1484 if test $octave_cv_lib_pcre_ok = yes; then
1485 $1
1486 :
1487 else
1488 $2
1489 :
1490 fi
1491 ])
1492 dnl
1459 dnl Check whether sndfile library is modern enough to include things like Ogg 1493 dnl Check whether sndfile library is modern enough to include things like Ogg
1460 dnl 1494 dnl
1461 AC_DEFUN([OCTAVE_CHECK_LIB_SNDFILE_OK], [ 1495 AC_DEFUN([OCTAVE_CHECK_LIB_SNDFILE_OK], [
1462 AC_CACHE_CHECK([whether sndfile library is modern enough], 1496 AC_CACHE_CHECK([whether sndfile library is modern enough],
1463 [octave_cv_lib_sndfile_ok], 1497 [octave_cv_lib_sndfile_ok],