build: use configurehelp.pm.in with autotools and cmake

Before this patch, each build tool generated `tests/configurehelp.pm`
manually.

Ref: https://github.com/curl/curl/pull/14802#issuecomment-2332734326
Closes #14819
This commit is contained in:
Viktor Szakats 2024-09-07 01:49:40 +02:00
parent 7100c5bc9b
commit 867c187fdf
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 62 additions and 60 deletions

View file

@ -1518,44 +1518,20 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
])
dnl CURL_GENERATE_CONFIGUREHELP_PM
dnl CURL_PREPARE_CONFIGUREHELP_PM
dnl -------------------------------------------------
dnl Generate test harness configurehelp.pm module, defining and
dnl Prepare test harness configurehelp.pm module, defining and
dnl initializing some perl variables with values which are known
dnl when the configure script runs. For portability reasons, test
dnl harness needs information on how to run the C preprocessor.
AC_DEFUN([CURL_GENERATE_CONFIGUREHELP_PM], [
AC_DEFUN([CURL_PREPARE_CONFIGUREHELP_PM], [
AC_REQUIRE([AC_PROG_CPP])dnl
tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null`
if test -z "$tmp_cpp"; then
tmp_cpp='cpp'
fi
cat >./tests/configurehelp.pm <<_EOF
[@%:@] This is a generated file. Do not edit.
package configurehelp;
use strict;
use warnings;
use Exporter;
use vars qw(
@ISA
@EXPORT_OK
\$Cpreprocessor
);
@ISA = qw(Exporter);
@EXPORT_OK = qw(
\$Cpreprocessor
);
\$Cpreprocessor = '$tmp_cpp';
1;
_EOF
AC_SUBST(CURL_CPP, $tmp_cpp)
])