configure: make libpsl detection failure cause error

To force users to explictily disable it if they really don't want it
used and make it harder to accidentally miss it.

--without-libpsl is the option to use if PSL is not wanted.

Closes #12661
This commit is contained in:
Daniel Stenberg 2024-01-08 16:28:50 +01:00
parent 912d80c680
commit 2998874bb6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2054,17 +2054,16 @@ dnl **********************************************************************
AC_ARG_WITH(libpsl,
AS_HELP_STRING([--without-libpsl],
[disable support for libpsl cookie checking]),
[disable support for libpsl]),
with_libpsl=$withval,
with_libpsl=yes)
curl_psl_msg="no (libpsl disabled)"
if test $with_libpsl != "no"; then
AC_SEARCH_LIBS(psl_builtin, psl,
[curl_psl_msg="enabled";
AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
],
[curl_psl_msg="no (libpsl not found)";
AC_MSG_WARN([libpsl was not found])
]
[AC_MSG_ERROR([libpsl was not found]) ]
)
fi
AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])