Debian Codegraph @

build/m4/aircrack_ng_pcre.m4

raw
1 dnl Aircrack-ng
2 dnl
3 dnl Copyright (C) 2017 Joseph Benden <[email protected]>
4 dnl
5 dnl Autotool support was written by: Joseph Benden <[email protected]>
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 dnl
21 dnl In addition, as a special exception, the copyright holders give
22 dnl permission to link the code of portions of this program with the
23 dnl OpenSSL library under certain conditions as described in each
24 dnl individual source file, and distribute linked combinations
25 dnl including the two.
26 dnl
27 dnl You must obey the GNU General Public License in all respects
28 dnl for all of the code used other than OpenSSL.
29 dnl
30 dnl If you modify file(s) with this exception, you may extend this
31 dnl exception to your dnl version of the file(s), but you are not obligated
32 dnl to do so.
33 dnl
34 dnl If you dnl do not wish to do so, delete this exception statement from your
35 dnl version.
36 dnl
37 dnl If you delete this exception statement from all source files in the
38 dnl program, then also delete it here.
39
40 AC_DEFUN([AIRCRACK_NG_PCRE], [
41 AC_ARG_ENABLE(static-pcre,
42 AS_HELP_STRING([--enable-static-pcre],
43 [Enable statically linked PCRE libpcre.]),
44 [static_pcre=$enableval], [static_pcre=no])
45
46 if test "x$static_pcre" != "xno"; then
47 AC_REQUIRE([AX_EXT_HAVE_STATIC_LIB_DETECT])
48 AX_EXT_HAVE_STATIC_LIB(PCRE, ${DEFAULT_STATIC_LIB_SEARCH_PATHS}, pcre libpcre, pcre_version)
49 if test "x$PCRE_FOUND" = xyes; then
50 HAVE_PCRE=yes
51 else
52 HAVE_PCRE=no
53 fi
54 else
55 PKG_CHECK_MODULES(PCRE, libpcre, HAVE_PCRE=yes, HAVE_PCRE=no)
56 fi
57
58 AC_ARG_ENABLE(static-pcre2,
59 AS_HELP_STRING([--enable-static-pcre2],
60 [Enable statically linked PCRE2 libpcre2-8.]),
61 [static_pcre2=$enableval], [static_pcre2=no])
62
63 if test "x$static_pcre2" != "xno"; then
64 AC_REQUIRE([AX_EXT_HAVE_STATIC_LIB_DETECT])
65 AX_EXT_HAVE_STATIC_LIB(PCRE2, ${DEFAULT_STATIC_LIB_SEARCH_PATHS}, pcre2 libpcre2-8, pcre2_version)
66 if test "x$PCRE2_FOUND" = xyes; then
67 HAVE_PCRE2=yes
68 else
69 HAVE_PCRE2=no
70 fi
71 else
72 PKG_CHECK_MODULES(PCRE2, libpcre2-8, HAVE_PCRE2=yes, HAVE_PCRE2=no)
73 fi
74
75 if test "x$HAVE_PCRE" = "xyes" && test "x$HAVE_PCRE2" = "xyes"; then
76 AC_DEFINE([HAVE_PCRE2], [1], [Define this if you have libpcre2-8 on your system])
77 PCRE2_NOTE="(Pcre and Pcre2 found, using Pcre2)"
78 elif test "x$HAVE_PCRE" = "xyes"; then
79 AC_DEFINE([HAVE_PCRE], [1], [Define this if you have libpcre on your system])
80 elif test "x$HAVE_PCRE2" = "xyes"; then
81 AC_DEFINE([HAVE_PCRE2], [1], [Define this if you have libpcre2-8 on your system])
82 fi
83 ])