Skip to content

Commit

Permalink
autotools: indicate if PCRE or PCRE2 is being used
Browse files Browse the repository at this point in the history
  • Loading branch information
gemesa committed Jan 23, 2023
1 parent 2fb4de2 commit b381ef3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 66 deletions.
28 changes: 25 additions & 3 deletions build/m4/aircrack_ng_pcre.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
])
61 changes: 0 additions & 61 deletions build/m4/aircrack_ng_pcre2.m4

This file was deleted.

3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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
Expand Down Expand Up @@ -320,7 +319,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}
Expand Down

0 comments on commit b381ef3

Please sign in to comment.