aboutsummaryrefslogtreecommitdiff
path: root/net/aircrack-ng/patches/102-autotools-indicate-if-PCRE-or-PCRE2-is-being-used.patch
blob: 8dc2ce4d88eda2efcd308b2bd9720d4f65c39cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
From b381ef3f6b6cc83a4aa016f4c0aebb58fcffcf3f Mon Sep 17 00:00:00 2001
From: Andras Gemes <andrasgemes@outlook.com>
Date: Mon, 23 Jan 2023 16:58:38 +0100
Subject: [PATCH] autotools: indicate if PCRE or PCRE2 is being used

---
 build/m4/aircrack_ng_pcre.m4  | 28 ++++++++++++++--
 build/m4/aircrack_ng_pcre2.m4 | 61 -----------------------------------
 configure.ac                  |  3 +-
 3 files changed, 26 insertions(+), 66 deletions(-)
 delete mode 100644 build/m4/aircrack_ng_pcre2.m4

--- a/build/m4/aircrack_ng_pcre.m4
+++ b/build/m4/aircrack_ng_pcre.m4
@@ -55,7 +55,29 @@ else
 	PKG_CHECK_MODULES(PCRE, libpcre, HAVE_PCRE=yes, HAVE_PCRE=no)
 fi
 
-AS_IF([test "x$HAVE_PCRE" = "xyes"], [
+AC_ARG_ENABLE(static-pcre2,
+    AS_HELP_STRING([--enable-static-pcre2],
+		[Enable statically linked PCRE2 libpcre2-8.]),
+    [static_pcre2=$enableval], [static_pcre2=no])
+
+if test "x$static_pcre2" != "xno"; then
+	AC_REQUIRE([AX_EXT_HAVE_STATIC_LIB_DETECT])
+	AX_EXT_HAVE_STATIC_LIB(PCRE2, ${DEFAULT_STATIC_LIB_SEARCH_PATHS}, pcre2 libpcre2-8, pcre2_version)
+	if test "x$PCRE2_FOUND" = xyes; then
+		HAVE_PCRE2=yes
+	else
+		HAVE_PCRE2=no
+	fi
+else
+	PKG_CHECK_MODULES(PCRE2, libpcre2-8, HAVE_PCRE2=yes, HAVE_PCRE2=no)
+fi
+
+if test "x$HAVE_PCRE" = "xyes" && test "x$HAVE_PCRE2" = "xyes"; then
+    AC_DEFINE([HAVE_PCRE2], [1], [Define this if you have libpcre2-8 on your system])
+    PCRE2_NOTE="(Pcre and Pcre2 found, using Pcre2)"
+elif test "x$HAVE_PCRE" = "xyes"; then
     AC_DEFINE([HAVE_PCRE], [1], [Define this if you have libpcre on your system])
-])
-])
+elif test "x$HAVE_PCRE2" = "xyes"; then
+    AC_DEFINE([HAVE_PCRE2], [1], [Define this if you have libpcre2-8 on your system])
+fi
+])
\ No newline at end of file
--- a/build/m4/aircrack_ng_pcre2.m4
+++ /dev/null
@@ -1,61 +0,0 @@
-dnl Aircrack-ng
-dnl
-dnl Copyright (C) 2023 Andras Gemes <andrasgemes@outlook.com>
-dnl
-dnl Autotool support was written by: Joseph Benden <joe@benden.us>
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-dnl
-dnl In addition, as a special exception, the copyright holders give
-dnl permission to link the code of portions of this program with the
-dnl OpenSSL library under certain conditions as described in each
-dnl individual source file, and distribute linked combinations
-dnl including the two.
-dnl
-dnl You must obey the GNU General Public License in all respects
-dnl for all of the code used other than OpenSSL.
-dnl
-dnl If you modify file(s) with this exception, you may extend this
-dnl exception to your dnl version of the file(s), but you are not obligated
-dnl to do so.
-dnl
-dnl If you dnl do not wish to do so, delete this exception statement from your
-dnl version.
-dnl
-dnl If you delete this exception statement from all source files in the
-dnl program, then also delete it here.
-
-AC_DEFUN([AIRCRACK_NG_PCRE2], [
-AC_ARG_ENABLE(static-pcre2,
-    AS_HELP_STRING([--enable-static-pcre2],
-		[Enable statically linked PCRE2 libpcre2-8.]),
-    [static_pcre2=$enableval], [static_pcre2=no])
-
-if test "x$static_pcre2" != "xno"; then
-	AC_REQUIRE([AX_EXT_HAVE_STATIC_LIB_DETECT])
-	AX_EXT_HAVE_STATIC_LIB(PCRE2, ${DEFAULT_STATIC_LIB_SEARCH_PATHS}, pcre2 libpcre2-8, pcre2_version)
-	if test "x$PCRE2_FOUND" = xyes; then
-		HAVE_PCRE2=yes
-	else
-		HAVE_PCRE2=no
-	fi
-else
-	PKG_CHECK_MODULES(PCRE2, libpcre2-8, HAVE_PCRE2=yes, HAVE_PCRE2=no)
-fi
-
-AS_IF([test "x$HAVE_PCRE2" = "xyes"], [
-    AC_DEFINE([HAVE_PCRE2], [1], [Define this if you have libpcre2-8 on your system])
-])
-])
\ No newline at end of file
--- a/configure.ac
+++ b/configure.ac
@@ -144,7 +144,6 @@ AIRCRACK_NG_EXT_SCRIPTS
 AIRCRACK_NG_HWLOC
 AIRCRACK_NG_PCAP
 AIRCRACK_NG_PCRE
-AIRCRACK_NG_PCRE2
 AIRCRACK_NG_RFKILL
 AIRCRACK_NG_SQLITE
 AIRCRACK_NG_ZLIB
@@ -321,7 +320,7 @@ ${PACKAGE} ${VERSION}
     Jemalloc:                    ${JEMALLOC}
     Pcap:                        ${PCAP_FOUND}
     Pcre:                        ${HAVE_PCRE}
-    Pcre2:                       ${HAVE_PCRE2}
+    Pcre2:                       ${HAVE_PCRE2} ${PCRE2_NOTE}
     Sqlite:                      ${HAVE_SQLITE3}
     Tcmalloc:                    ${TCMALLOC}
     Zlib:                        ${HAVE_ZLIB}