build: generate buildinfo.txt for test logs

Also:
- read `buildinfo.txt` from `runtests.pl` and dump it to the log.
- cmake: show `CROSS` target flag for cross-builds.
- cmake: add logic to detect arguments passed via the command-line.

It is meant to help filling out missing datapoints in the testclutch
matrix.

Closes #14802
This commit is contained in:
Viktor Szakats 2024-09-05 23:23:47 +02:00
parent b0a1c9bdca
commit 1fdea16846
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 119 additions and 12 deletions

View file

@ -1558,6 +1558,59 @@ use vars qw(
_EOF
])
dnl CURL_GENERATE_BUILDINFO_TXT
dnl -------------------------------------------------
dnl Save build info for test runner to pick up and log
AC_DEFUN([CURL_GENERATE_BUILDINFO_TXT], [
curl_pflags=""
case $host in
*-apple-*) curl_pflags="${curl_pflags} APPLE";;
esac
if test "$curl_cv_native_windows" = 'yes'; then
curl_pflags="${curl_pflags} WIN32"
else
case $host in
*-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*)
curl_pflags="${curl_pflags} UNIX";;
esac
fi
case $host_os in
cygwin*|msys*) curl_pflags="${curl_pflags} CYGWIN";;
esac
case $host_os in
msys*) curl_pflags="${curl_pflags} MSYS";;
esac
if test "x$compiler_id" = 'xGNU_C'; then
curl_pflags="${curl_pflags} GCC"
fi
case $host_os in
mingw*) curl_pflags="${curl_pflags} MINGW";;
esac
if test "x$cross_compiling" = 'xyes'; then
curl_pflags="${curl_pflags} CROSS"
fi
squeeze curl_pflags
cat >./tests/buildinfo.txt <<_EOF
[@%:@] This is a generated file. Do not edit.
configure.tool: configure
configure.args: $ac_configure_args
host: $build
host.os: $build_os
host.cpu: $build_cpu
host.vendor: $build_vendor
target: $host
target.os: $host_os
target.cpu: $host_cpu
target.vendor: $host_vendor
target.flags: $curl_pflags
compiler: $compiler_id
compiler.version: $compiler_num
_EOF
])
dnl CURL_CPP_P
dnl
dnl Check if $cpp -P should be used for extract define values due to gcc 5