svn commit: r1927624 - subversion/trunk/build/ac-macros

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <175444740168.2667787.4020574001237360399@svn02-us-east.apache.org>
Author: brane
Date: Wed Aug  6 02:30:01 2025
New Revision: 1927624

Log:
Follow up to r1908543: The prefix-based search for Serf was broken with
this change. This was probably hidden by the successful pkg-config-based
search on most platforms.

* build/ac-macros/serf.m4
  (SVN_SERF_PREFIX_CONFIG): Fix the AC_COMPILE_IFELSE for the Serf version
   by merging the first two arguments into one AC_LANG_SOURCE. While there,
   add some configure-time messaging and print the actual version, similarly
   to what the pkg-config search does.

Modified:
   subversion/trunk/build/ac-macros/serf.m4

Modified: subversion/trunk/build/ac-macros/serf.m4
==============================================================================
--- subversion/trunk/build/ac-macros/serf.m4	Tue Aug  5 20:10:02 2025	(r1927623)
+++ subversion/trunk/build/ac-macros/serf.m4	Wed Aug  6 02:30:01 2025	(r1927624)
@@ -108,16 +108,29 @@ AC_DEFUN(SVN_SERF_PREFIX_CONFIG,
       save_ldflags="$LDFLAGS"
       LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS(-L$serf_prefix/lib)`"
       AC_CHECK_LIB($serf_major, serf_context_create,[
+        AC_MSG_CHECKING([serf library version])
+        serf_h="$serf_prefix/include/$serf_major/serf.h"
+        serf_M=`$SED -n '/define *SERF_MAJOR_VERSION/p' "$serf_h" | $SED 's/[[^0-9]]*//'`
+        serf_m=`$SED -n '/define *SERF_MINOR_VERSION/p' "$serf_h" | $SED 's/[[^0-9]]*//'`
+        serf_p=`$SED -n '/define *SERF_PATCH_VERSION/p' "$serf_h" | $SED 's/[[^0-9]]*//'`
+        SERF_VERSION=$serf_M.$serf_m.$serf_p
+        AC_MSG_RESULT([$SERF_VERSION])
+        AC_MSG_CHECKING([serf version is suitable])
         AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #include <stdlib.h>
 #include "serf.h"
-]])],[
 #if ! SERF_VERSION_AT_LEAST($serf_check_major, $serf_check_minor, $serf_check_patch)
 #error Serf version too old: need $serf_check_version
 #endif
-], [serf_found=yes], [AC_MSG_WARN([Serf version too old: need $serf_check_version])
-      serf_found=no])], ,
-    $SVN_APRUTIL_LIBS $SVN_APR_LIBS -lz)
+]])],[
+AC_MSG_RESULT([yes])
+serf_found=yes
+],[
+AC_MSG_RESULT([no])
+AC_MSG_WARN([Serf version too old: need $serf_check_version])
+serf_found=no
+])], ,
+    $SVN_APRUTIL_LIBS $SVN_APR_LIBS)
     LDFLAGS="$save_ldflags"])
     CPPFLAGS="$save_cppflags"
     test $serf_found = yes && break
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.