Ok sthen@

--
 Sent from a phone, apologies for poor formatting.

On 22 February 2022 08:02:08 Brad Smith <b...@comstyle.com> wrote:

On Tue, Feb 22, 2022 at 12:11:19AM +0000, Klemens Nanni wrote:
On Tue, Feb 22, 2022 at 12:02:08AM +0000, Klemens Nanni wrote:
> On Mon, Feb 21, 2022 at 11:27:37PM +0000, Stuart Henderson wrote:
> > On 2022/02/21 22:12, Klemens Nanni wrote:
> > > 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.
> >
> > it _ought_ to use $(CXX) to try and link rather than $(CC), but I don't
> > know if that's viable with this autoconf check.
>
> Good point, I missed that.
>
> >
> > >  .for i in ${COMPILER_LIBCXX}
> > > -CXXLIB+= -l$i
> > > +CXXLIB+= -l${i:C/[<>=]+[0-9.]+$//}
> > >  .endfor
> >
> > I am okay with this with a comment to explain the regex, e.g.
> >
> > # strip off the library-specs(5) version number check
> >
> > the libcdada port itself should have the same change
> >
>
> Like that?  Thanks, I'll go with in a few days unless we come up with
> something better.

Better this, also with correct manual section.

My eyes are bleeding looking at this. It's using the wrong variable to try to
discover something and then adding more hacks on top.

Update libcdada to 0.3.5 and disable the examples.
For pmacct link with the C++ compiler driver.


Index: devel/libcdada/Makefile
===================================================================
RCS file: /home/cvs/ports/devel/libcdada/Makefile,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 Makefile
--- devel/libcdada/Makefile     2 Nov 2021 00:00:24 -0000       1.4
+++ devel/libcdada/Makefile     22 Feb 2022 06:57:21 -0000
@@ -4,8 +4,7 @@ COMMENT=        basic data structures in C (lib

GH_ACCOUNT=     msune
GH_PROJECT=     libcdada
-GH_TAGNAME=    v0.3.4
-REVISION=      1
+GH_TAGNAME=    v0.3.5

SHARED_LIBS +=  cdada                     0.0 # 0.0

@@ -27,13 +26,8 @@ AUTORECONF=          ${WRKSRC}/autogen.sh
AUTOCONF_VERSION=       2.69
AUTOMAKE_VERSION=       1.16

-CONFIGURE_ARGS=                --disable-valgrind
+CONFIGURE_ARGS=                --disable-valgrind \
+                       --without-examples
SEPARATE_BUILD=         Yes

-post-patch:
-       sed -i 's,-lstdc++,${CXXLIB},' ${WRKSRC}/examples/Makefile.am
-
.include <bsd.port.mk>
-.for i in ${COMPILER_LIBCXX}
-CXXLIB+= -l$i
-.endfor
Index: devel/libcdada/distinfo
===================================================================
RCS file: /home/cvs/ports/devel/libcdada/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 distinfo
--- devel/libcdada/distinfo     18 Feb 2021 13:23:22 -0000      1.1.1.1
+++ devel/libcdada/distinfo     22 Feb 2022 06:57:28 -0000
@@ -1,2 +1,2 @@
-SHA256 (libcdada-0.3.4.tar.gz) = yqIpwT/zjVeSpMmeHrefjM4TeCzk9xz3q/rE93abbos=
-SIZE (libcdada-0.3.4.tar.gz) = 1772957
+SHA256 (libcdada-0.3.5.tar.gz) = hkF/mtWvnZYdHiF4nuBNRgnsmhF3rg2EsItg72UJqjA=
+SIZE (libcdada-0.3.5.tar.gz) = 1776937
Index: net/pmacct/Makefile
===================================================================
RCS file: /home/cvs/ports/net/pmacct/Makefile,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 Makefile
--- net/pmacct/Makefile 18 Feb 2021 13:24:04 -0000      1.34
+++ net/pmacct/Makefile 22 Feb 2022 02:21:46 -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/
@@ -30,8 +31,7 @@ AUTOCONF_VERSION= 2.69
AUTOMAKE_VERSION= 1.16

CONFIGURE_ENV=  CPPFLAGS="-I${LOCALBASE}/include" \
-               LDFLAGS="-L${LOCALBASE}/lib" \
-               CXXLIB="${CXXLIB}"
+               LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --enable-geoipv2 \
                --enable-jansson \
                --enable-sqlite3 \
@@ -75,6 +75,3 @@ post-install:
.endif

.include <bsd.port.mk>
-.for i in ${COMPILER_LIBCXX}
-CXXLIB+= -l$i
-.endfor
Index: net/pmacct/patches/patch-configure_ac
===================================================================
RCS file: /home/cvs/ports/net/pmacct/patches/patch-configure_ac,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-configure_ac
--- net/pmacct/patches/patch-configure_ac       18 Feb 2021 13:24:04 -0000      
1.3
+++ net/pmacct/patches/patch-configure_ac       22 Feb 2022 06:21:20 -0000
@@ -1,9 +1,8 @@
$OpenBSD: patch-configure_ac,v 1.3 2021/02/18 13:24:04 sthen Exp $

-drop forced -O2
-handle libcdada dependency on C++ standard library
-only linux requires libnuma for mysql
-
+- Drop forced -O2
+- Only Linux requires libnuma for MySQL
+- Use C++ compiler for linking test

Index: configure.ac
--- configure.ac.orig
@@ -32,12 +31,15 @@ Index: configure.ac
     ;;
   no)
     AC_MSG_RESULT(no)
-@@ -1138,7 +1128,7 @@ AC_LANG_PUSH([C++])
+@@ -1138,10 +1128,9 @@ AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[AC_MSG_RESULT(yes)],[AC_MSG_ERROR([No C++ compiler found])])
 AC_LANG_POP([C++])

-LIBS="-lcdada -lstdc++ ${LIBS}"
-+LIBS="-lcdada ${CXXLIB} ${LIBS}"
 AS_CASE(["$WITH_EXTERNAL_DEPS"],
   [yes], [],
- [no], [AC_CHECK_LIB([cdada], [cdada_get_ver], [], [AC_MSG_ERROR([Could not find libcdada])])], +- [no], [AC_CHECK_LIB([cdada], [cdada_get_ver], [], [AC_MSG_ERROR([Could not find libcdada])])], ++ [no], [AC_LANG_PUSH([C++]) AC_CHECK_LIB([cdada], [cdada_get_ver], [], [AC_MSG_ERROR([Could not find libcdada])]) AC_LANG_POP([C++])],
+   [])
+
+ dnl set debug level
Index: net/pmacct/patches/patch-examples_lg_Makefile_am
===================================================================
RCS file: net/pmacct/patches/patch-examples_lg_Makefile_am
diff -N net/pmacct/patches/patch-examples_lg_Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/pmacct/patches/patch-examples_lg_Makefile_am    22 Feb 2022 06:21:01 
-0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Use C++ compiler when linking
+
+Index: examples/lg/Makefile.am
+--- examples/lg/Makefile.am.orig
++++ examples/lg/Makefile.am
+@@ -1,3 +1,5 @@
++CCLD = $(CXX)
++
+ AM_CFLAGS = $(PMACCT_CFLAGS)
+
+ if USING_BGP_BINS
Index: net/pmacct/patches/patch-src_Makefile_am
===================================================================
RCS file: net/pmacct/patches/patch-src_Makefile_am
diff -N net/pmacct/patches/patch-src_Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/pmacct/patches/patch-src_Makefile_am    22 Feb 2022 06:21:14 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Use C++ compiler when linking
+
+Index: src/Makefile.am
+--- src/Makefile.am.orig
++++ src/Makefile.am
+@@ -9,6 +9,8 @@ sbin_PROGRAMS =
+ bin_PROGRAMS =
+ EXTRA_PROGRAMS =
+
++CCLD = $(CXX)
++
+ AM_LDFLAGS = @GEOIP_LIBS@ @GEOIPV2_LIBS@
+ if WITH_JANSSON
+ AM_LDFLAGS += @JANSSON_LIBS@

Reply via email to