1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Improve tests for finding libpcre2. Close #2907, see #2851, see #2913

- Include definition of PCRE2_CODE_UNIT_WIDTH to allow the header test
  to compile correctly
- Add description to the definition of HAVE_PCRE2_PCRE2_H
  to prevent an autoheader missing template error
This commit is contained in:
nnposter
2024-09-01 20:36:02 +00:00
parent 28e47f9361
commit bef25962e7
2 changed files with 17 additions and 11 deletions

View File

@@ -529,12 +529,17 @@ AC_HELP_STRING([--with-libpcre=included], [Always use the version included with
# If they didn't specify it, we try to find it
if test $have_pcre != yes -a $requested_included_pcre != yes ; then
AC_CHECK_HEADER(pcre2.h,
AC_CHECK_LIB(pcre2-8, pcre2_compile_8, [have_pcre=yes ]),
[AC_CHECK_HEADER(pcre2/pcre2.h,
[AC_CHECK_LIB(pcre2-8, pcre2_compile_8, [have_pcre=yes
AC_DEFINE(HAVE_PCRE2_PCRE2_H, 1)])]
)]
)
AC_CHECK_LIB(pcre2-8,
pcre2_compile_8,
[have_pcre=yes ]),
AC_CHECK_HEADER(pcre2/pcre2.h,
AC_CHECK_LIB(pcre2-8,
pcre2_compile_8,
[have_pcre=yes
AC_DEFINE(HAVE_PCRE2_PCRE2_H, 1, [Using system pcre2/pcre2.h])]),
[],
[#define PCRE2_CODE_UNIT_WIDTH 8]),
[#define PCRE2_CODE_UNIT_WIDTH 8])
fi
# If we still don't have it, we use our own