buildinfo: move from tests/server/ to src/, rename to curlinfo

Since a16485a42e, the test servers build with a different set of
options than the tool/lib - for example a different CURLDEBUG. To make
buildinfo better reflect the curl build, move it to src/ and build it
here using the local CURLDEBUG. Renamed to curlinfo to not get confused
with buildinfo.txt

I chose src/ and not lib/ because the file also uses tool-specific headers.

Assisted-by: Viktor Szakats
Closes #17187
This commit is contained in:
Daniel Stenberg 2025-04-27 17:35:20 +02:00
parent 4a70b9823b
commit 7a1211d474
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
8 changed files with 30 additions and 9 deletions

View file

@ -92,6 +92,12 @@ target_compile_definitions(${EXE_NAME} PRIVATE ${_curl_definitions})
add_executable(${PROJECT_NAME}::${EXE_NAME} ALIAS ${EXE_NAME})
add_executable(
curlinfo
EXCLUDE_FROM_ALL
curlinfo.c
)
add_library(
curltool # special libcurltool library just for unittests
STATIC

View file

@ -48,6 +48,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
bin_PROGRAMS = curl
curlinfo_SOURCES = curlinfo.c
noinst_PROGRAMS = curlinfo
if USE_CPPFLAG_CURL_STATICLIB
AM_CPPFLAGS += -DCURL_STATICLIB
endif
@ -60,7 +63,7 @@ endif
AM_LDFLAGS =
if USE_UNICODE
AM_LDFLAGS += -municode
UNICODEFLAG = -municode
endif
include Makefile.inc
@ -90,7 +93,7 @@ curl_SOURCES += $(CURL_RCFILES)
$(CURL_RCFILES): tool_version.h
endif
curl_LDFLAGS = $(AM_LDFLAGS) $(CURL_LDFLAGS_BIN)
curl_LDFLAGS = $(AM_LDFLAGS) $(CURL_LDFLAGS_BIN) $(UNICODEFLAG)
# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@

244
src/curlinfo.c Normal file
View file

@ -0,0 +1,244 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* SPDX-License-Identifier: curl
*
***************************************************************************/
/*
* The purpose of this tool is to figure out which, if any, features that are
* disabled which should otherwise exist and work. These are not visible in
* regular curl -V output.
*
* Disabled protocols are visible in curl_version_info() and are not included
* in this table.
*/
#include "curl_setup.h"
#include "multihandle.h" /* for ENABLE_WAKEUP */
#include "tool_xattr.h" /* for USE_XATTR */
#include "curl_sha512_256.h" /* for CURL_HAVE_SHA512_256 */
#include <stdio.h>
static const char *disabled[]={
"bindlocal: "
#ifdef CURL_DISABLE_BINDLOCAL
"OFF"
#else
"ON"
#endif
,
"cookies: "
#ifdef CURL_DISABLE_COOKIES
"OFF"
#else
"ON"
#endif
,
"basic-auth: "
#ifdef CURL_DISABLE_BASIC_AUTH
"OFF"
#else
"ON"
#endif
,
"bearer-auth: "
#ifdef CURL_DISABLE_BEARER_AUTH
"OFF"
#else
"ON"
#endif
,
"digest-auth: "
#ifdef CURL_DISABLE_DIGEST_AUTH
"OFF"
#else
"ON"
#endif
,
"negotiate-auth: "
#ifdef CURL_DISABLE_NEGOTIATE_AUTH
"OFF"
#else
"ON"
#endif
,
"aws: "
#ifdef CURL_DISABLE_AWS
"OFF"
#else
"ON"
#endif
,
"DoH: "
#ifdef CURL_DISABLE_DOH
"OFF"
#else
"ON"
#endif
,
"HTTP-auth: "
#ifdef CURL_DISABLE_HTTP_AUTH
"OFF"
#else
"ON"
#endif
,
"Mime: "
#ifdef CURL_DISABLE_MIME
"OFF"
#else
"ON"
#endif
,
"netrc: "
#ifdef CURL_DISABLE_NETRC
"OFF"
#else
"ON"
#endif
,
"parsedate: "
#ifdef CURL_DISABLE_PARSEDATE
"OFF"
#else
"ON"
#endif
,
"proxy: "
#ifdef CURL_DISABLE_PROXY
"OFF"
#else
"ON"
#endif
,
"shuffle-dns: "
#ifdef CURL_DISABLE_SHUFFLE_DNS
"OFF"
#else
"ON"
#endif
,
"typecheck: "
#ifdef CURL_DISABLE_TYPECHECK
"OFF"
#else
"ON"
#endif
,
"verbose-strings: "
#ifdef CURL_DISABLE_VERBOSE_STRINGS
"OFF"
#else
"ON"
#endif
,
"wakeup: "
#ifndef ENABLE_WAKEUP
"OFF"
#else
"ON"
#endif
,
"headers-api: "
#ifdef CURL_DISABLE_HEADERS_API
"OFF"
#else
"ON"
#endif
,
"xattr: "
#ifndef USE_XATTR
"OFF"
#else
"ON"
#endif
,
"form-api: "
#ifdef CURL_DISABLE_FORM_API
"OFF"
#else
"ON"
#endif
,
"large-time: "
#if (SIZEOF_TIME_T < 5)
"OFF"
#else
"ON"
#endif
,
"large-size: "
#if (SIZEOF_SIZE_T < 5)
"OFF"
#else
"ON"
#endif
,
"sha512-256: "
#ifndef CURL_HAVE_SHA512_256
"OFF"
#else
"ON"
#endif
,
"win32-ca-searchpath: "
#if !defined(_WIN32) || \
(defined(CURL_WINDOWS_UWP) || \
defined(CURL_DISABLE_CA_SEARCH) || defined(CURL_CA_SEARCH_SAFE))
"OFF"
#else
"ON"
#endif
,
"win32-ca-search-safe: "
#if !defined(_WIN32) || !defined(CURL_CA_SEARCH_SAFE)
"OFF"
#else
"ON"
#endif
,
"--libcurl: "
#ifdef CURL_DISABLE_LIBCURL_OPTION
"OFF"
#else
"ON"
#endif
,
NULL
};
int main(int argc, char **argv)
{
int i;
(void) argc;
(void) argv;
for(i = 0; disabled[i]; i++)
printf("%s\n", disabled[i]);
return 0;
}