On Sat, Feb 19, 2022 at 02:40:24AM -0700, Kurt Mosiejczuk wrote:
> http://build-failures.rhaalovely.net/sparc64/2022-02-16/net/pmacct,postgresql.log

> checking for cdada_get_ver in -lcdada... no
> configure: error: Could not find libcdada

The dependency is correctly handled, but AC_CHECK_LIB chokes on how
ports-clang arches handle c++ libs.

COMPILER_LIBCXX has "stdc++" and "estdc++>=17" for base-clang and
ports-gcc, respectively.

This ends up in configure.ac's libcdada AC_CHECK_LIB check as can be
seen in the hackish diff below.

${WRKBUILD}/config.log shows the actual error:

> configure:20504: checking for cdada_get_ver in -lcdada
> configure:20529: cc -o conftest -O2 -pipe -I/usr/local/include 
> -L/usr/local/lib conftest.c -lcdada  -lcdada -lestdc++>=17 -lpthread -lpcap  
> -lm -lpthread >&5
> /usr/bin/ld: cannot find -lestdc++>=17
> collect2: error: ld returned 1 exit status

Removing the version spec makes configure work thus fixes the build,
but this hackish attempt doesn't look like a solution.

Leaving this here for others to chime in.

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/net/pmacct/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- Makefile    18 Feb 2021 13:24:04 -0000      1.34
+++ Makefile    21 Feb 2022 21:51:38 -0000
@@ -3,6 +3,7 @@
 COMMENT=       passive IP network monitoring tools: traffic accounting, etc
 
 DISTNAME=      pmacct-1.7.6
+REVISION=      0
 CATEGORIES=    net
 
 HOMEPAGE=      http://www.pmacct.net/
@@ -75,6 +76,7 @@ post-install:
 .endif
 
 .include <bsd.port.mk>
+
 .for i in ${COMPILER_LIBCXX}
-CXXLIB+= -l$i
+CXXLIB+= -l${i:C/[<>=]+[0-9.]+$//}
 .endfor

Reply via email to