Debian Codegraph @

modules/pcre/module.ac

raw
1 ## This file is part of GNU Dico
2 ## Copyright (C) 2014-2024 Sergey Poznyakoff
3 ##
4 ## GNU Dico is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 3, or (at your option)
7 ## any later version.
8 ##
9 ## GNU Dico is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
13 ##
14 ## You should have received a copy of the GNU General Public License
15 ## along with GNU Dico. If not, see <http://www.gnu.org/licenses/>.
16
17 ## module description: Perl-compatible regexs
18
19 AC_ARG_WITH([pcre],
20 AS_HELP_STRING([--with-pcre],
21 [compile Perl-compatible regular expressions support]),
22 [
23 case "${withval}" in
24 yes) status_pcre=yes ;;
25 no) status_pcre=no ;;
26 *) AC_MSG_ERROR(bad value ${withval} for --with-pcre) ;;
27 esac],[status_pcre=yes])
28
29 if test $status_pcre = yes; then
30 AC_CHECK_HEADER([pcre2.h], [], [status_pcre=no], [#define PCRE2_CODE_UNIT_WIDTH 8])
31 if test $status_pcre = yes; then
32 DICO_CHECK_LIB(pcre2-8, main, [],
33 [:],
34 [status_pcre=no])
35 fi
36 fi
37 AM_CONDITIONAL([PCRE_COND],[test $status_pcre = yes])