]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
buildinfo: move from tests/server/ to src/, rename to curlinfo
authorDaniel Stenberg <daniel@haxx.se>
Sun, 27 Apr 2025 15:35:20 +0000 (17:35 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 28 Apr 2025 20:40:10 +0000 (22:40 +0200)
Since a16485a42ea5dabe6c, 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

src/CMakeLists.txt
src/Makefile.am
src/curlinfo.c [moved from tests/server/buildinfo.c with 98% similarity]
tests/CMakeLists.txt
tests/globalconfig.pm
tests/runtests.pl
tests/server/Makefile.inc
tests/test1165.pl

index e8f2815dc1b7130519dacec13397a5c0381040b5..19f525abed44642fe9eba16a6c733d0975786d5b 100644 (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
index f6df54ef768fc8ed56975276fa83da283013be1e..af69d6ecf2e6247416a109119b23df0285b38a01 100644 (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@
similarity index 98%
rename from tests/server/buildinfo.c
rename to src/curlinfo.c
index 9f5af562874af94d5a38562d6bb7f195e50417cc..3c8aa62df216451930051d2d85896726f3389230 100644 (file)
@@ -24,7 +24,7 @@
 
 /*
  * The purpose of this tool is to figure out which, if any, features that are
- * disabled which should otherwise exist and work. These aren't visible in
+ * 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
index 5fb7b764b014919259e06e6f21a3150839ce1e6d..11736d1cd60d67b0fa3d9fc9963853246c0f5e74 100644 (file)
@@ -30,6 +30,10 @@ mark_as_advanced(TEST_NGHTTPX)
 configure_file("config.in" "${CMAKE_CURRENT_BINARY_DIR}/config" @ONLY)
 
 add_custom_target(testdeps)
+if(BUILD_CURL_EXE)
+  add_dependencies(testdeps curlinfo)
+endif()
+
 add_subdirectory(http)
 add_subdirectory(http/clients)
 add_subdirectory(server)
index 3b77406fa064a203fa39f856d48bf142dac94a20..5f7f413637d7a4cdd305c66ee2d334e80dde95e2 100644 (file)
@@ -37,6 +37,7 @@ BEGIN {
         $anyway
         $automakestyle
         $CURL
+        $CURLINFO
         $CURLVERSION
         $CURLVERNUM
         $DATE
@@ -114,7 +115,11 @@ our $UNITDIR=dirsepadd("./unit/" . ($ENV{'CURL_DIRSUFFIX'} || ''));
 our $TUNITDIR=dirsepadd("./tunit/" . ($ENV{'CURL_DIRSUFFIX'} || ''));
 our $SRVDIR=dirsepadd("./server/" . ($ENV{'CURL_DIRSUFFIX'} || ''));
 our $TESTDIR="$srcdir/data";
-our $CURL=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) . "curl".exe_ext('TOOL'); # what curl binary to run on the tests
+our $CURL=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) .
+    "curl".exe_ext('TOOL'); # what curl binary to run on the tests
+our $CURLINFO=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) .
+    "curlinfo".exe_ext('TOOL'); # what curlinfo binary to run on the tests
+
 our $VCURL=$CURL;  # what curl binary to use to verify the servers with
                    # VCURL is handy to set to the system one when the one you
                    # just built hangs or crashes and thus prevent verification
index 6aa0b54973c6e036c4b0b5c26258202db42d0bfe..4e92f03d41acff0f653de5c218888d409d0dd0e2 100755 (executable)
@@ -518,7 +518,7 @@ sub checksystemfeatures {
     @version = <$versout>;
     close($versout);
 
-    open(my $disabledh, "-|", server_exe('buildinfo', 'TOOL'));
+    open(my $disabledh, "-|", exerunner() . shell_quote($CURLINFO));
     while(<$disabledh>) {
         if($_ =~ /([^:]*): ([ONF]*)/) {
             my ($val, $toggle) = ($1, $2);
index 17a7816db10b04b9f5325e1d664df92832b99e31..8a22e483b74e1b4d561ca0b1d907f9e02519c439 100644 (file)
@@ -22,7 +22,7 @@
 #
 ###########################################################################
 
-SERVERPROGS = resolve rtspd sockfilt sws tftpd socksd buildinfo mqttd dnsd
+SERVERPROGS = resolve rtspd sockfilt sws tftpd socksd mqttd dnsd
 
 MEMDEBUG = \
   ../../lib/memdebug.c \
@@ -122,5 +122,3 @@ dnsd_SOURCES = $(MEMDEBUG) $(CURLX_SRCS) $(CURLX_HDRS) $(UTIL) \
   dnsd.c
 dnsd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@
 dnsd_CFLAGS = $(AM_CFLAGS)
-
-buildinfo_SOURCES = buildinfo.c
index 621a93537ea3a8db54a7e8e592a9621da1fbcf43..61fe5c184d3825a48293dd260f095f77f64ae770 100755 (executable)
@@ -87,13 +87,18 @@ sub scan_cmake_config_h {
     scanconf_cmake(\%disable_cmake_config_h, "$root/lib/curl_config.h.cmake");
 }
 
+my %whitelisted = ("CURL_DISABLE_TYPECHECK" => 1);
+
 sub scan_file {
     my ($source)=@_;
     open F, "<$source";
     while(<F>) {
         while(s/(CURL_DISABLE_[A-Z0-9_]+)//) {
             my ($sym)=($1);
-            $file{$sym} = $source;
+
+            if(!$whitelisted{$sym}) {
+                $file{$sym} = $source;
+            }
         }
     }
     close F;