On 2021/06/09 03:06, Otto Moerbeek wrote:
> CVSROOT:      /cvs
> Module name:  ports
> Changes by:   o...@cvs.openbsd.org    2021/06/09 03:06:22
> 
> Modified files:
>       net/powerdns_recursor: Makefile distinfo 
> Removed files:
>       net/powerdns_recursor/patches: patch-Makefile_in 
> 
> Log message:
> Update to PowerDNS Recursor 4.5.2 and remove unneeded Makefile_in
> patch as configure does the right thing and adds -O2
> 

CFLAGS/CXXFLAGS ought to be under control of ports infrastructure
rather than use any specific opt level. Minimal fix for CXXFLAGS
would be

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/powerdns_recursor/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile    9 Jun 2021 09:06:22 -0000       1.20
+++ Makefile    9 Jun 2021 14:03:04 -0000
@@ -3,6 +3,7 @@
 COMMENT=               recursive nameserver
 
 V=                     4.5.2
+REVISION=              0
 DISTNAME=              pdns-recursor-${V}
 EXTRACT_SUFX =         .tar.bz2
 PKGNAME=               powerdns-recursor-${V}
@@ -49,7 +50,7 @@ CONFIGURE_ARGS+=      --disable-botan \
                        --without-systemd
 
 CONFIGURE_ENV+=                CPPFLAGS="-I${LOCALBASE}/include" \
-                       CXXFLAGS="-Wno-deprecated-copy 
-Wno-deprecated-declarations" \
+                       CXXFLAGS="-Wno-deprecated-copy 
-Wno-deprecated-declarations ${CXXFLAGS}" \
                        LDFLAGS="-L${LOCALBASE}/lib"
 
 EXAMPLE_DIR=            ${PREFIX}/share/examples/pdns/

though it might be better to also handle the case where someone
explicitly wants CFLAGS/CXXFLAGS with no -O, in which case the -O2/-O3
from the build need patching away, e.g.

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/powerdns_recursor/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile    9 Jun 2021 09:06:22 -0000       1.20
+++ Makefile    9 Jun 2021 13:50:06 -0000
@@ -3,6 +3,7 @@
 COMMENT=               recursive nameserver
 
 V=                     4.5.2
+REVISION=              0
 DISTNAME=              pdns-recursor-${V}
 EXTRACT_SUFX =         .tar.bz2
 PKGNAME=               powerdns-recursor-${V}
@@ -38,7 +39,9 @@ WANTLIB+=             ${MODLUA_WANTLIB}
 
 SYSCONFDIR=            ${BASESYSCONFDIR}/pdns
 
-CONFIGURE_STYLE=       gnu
+CONFIGURE_STYLE=       autoreconf
+AUTOCONF_VERSION=      2.69
+AUTOMAKE_VERSION=      1.16
 USE_GMAKE=             Yes
 
 CONFIGURE_ARGS+=       --disable-botan \
@@ -49,7 +52,7 @@ CONFIGURE_ARGS+=      --disable-botan \
                        --without-systemd
 
 CONFIGURE_ENV+=                CPPFLAGS="-I${LOCALBASE}/include" \
-                       CXXFLAGS="-Wno-deprecated-copy 
-Wno-deprecated-declarations" \
+                       CXXFLAGS="-Wno-deprecated-copy 
-Wno-deprecated-declarations ${CXXFLAGS}" \
                        LDFLAGS="-L${LOCALBASE}/lib"
 
 EXAMPLE_DIR=            ${PREFIX}/share/examples/pdns/
Index: patches/patch-Makefile_am
===================================================================
RCS file: patches/patch-Makefile_am
diff -N patches/patch-Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile_am   9 Jun 2021 13:50:06 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: Makefile.am
+--- Makefile.am.orig
++++ Makefile.am
+@@ -1,7 +1,7 @@
+ JSON11_LIBS = $(top_srcdir)/ext/json11/libjson11.la
+ PROBDS_LIBS = $(top_srcdir)/ext/probds/libprobds.la
+ 
+-AM_CPPFLAGS = $(LUA_CFLAGS) $(YAHTTP_CFLAGS) $(BOOST_CPPFLAGS) 
$(LIBSODIUM_CFLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) $(SANITIZER_FLAGS) -O3 
-Wall -pthread -DSYSCONFDIR=\"${sysconfdir}\" $(SYSTEMD_CFLAGS)
++AM_CPPFLAGS = $(LUA_CFLAGS) $(YAHTTP_CFLAGS) $(BOOST_CPPFLAGS) 
$(LIBSODIUM_CFLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) $(SANITIZER_FLAGS) 
-Wall -pthread -DSYSCONFDIR=\"${sysconfdir}\" $(SYSTEMD_CFLAGS)
+ 
+ AM_CPPFLAGS += \
+       -I$(top_srcdir)/ext/json11 \
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac  9 Jun 2021 13:50:06 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -12,8 +12,8 @@ AC_CONFIG_HEADERS([config.h])
+ 
+ AC_CANONICAL_HOST
+ # Add some default CFLAGS and CXXFLAGS, can be appended to using the 
environment variables
+-CFLAGS="-Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations 
-Wredundant-decls -g -O2 $CFLAGS"
+-CXXFLAGS="-Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations 
-Wredundant-decls -g -O2 $CXXFLAGS"
++CFLAGS="-Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations 
-Wredundant-decls -g $CFLAGS"
++CXXFLAGS="-Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations 
-Wredundant-decls -g $CXXFLAGS"
+ 
+ AC_SUBST([pdns_configure_args],["$ac_configure_args"])
+ AC_DEFINE_UNQUOTED([PDNS_CONFIG_ARGS],

Reply via email to