pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/graphics/netpbm



Module Name:    pkgsrc
Committed By:   nia
Date:           Sun Jun 14 19:01:56 UTC 2026

Modified Files:
        pkgsrc/graphics/netpbm: Makefile

Log Message:
netpbm: Various build fixes.

Firstly, this fails to build with a compiler that defaults to C23,
due to "old-style function definitions" in getopt.c. So force it to
build with the gnu89 standard.

Secondly, we want to force all function definitions to be visible.

They hardcore XOPEN_SOURCE all over the codebase, so we need to
override their decision. This eliminates the need to compile with
-Wno-implicit-function-declaration.

Why do we want to avoid doing that? Because older GCC versions error
when they encounter a warning flag that they don't support, and that
is one of them that GCC 4.x does not support.


To generate a diff of this commit:
cvs rdiff -u -r1.260 -r1.261 pkgsrc/graphics/netpbm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/graphics/netpbm/Makefile
diff -u pkgsrc/graphics/netpbm/Makefile:1.260 pkgsrc/graphics/netpbm/Makefile:1.261
--- pkgsrc/graphics/netpbm/Makefile:1.260       Wed Jan  7 08:47:24 2026
+++ pkgsrc/graphics/netpbm/Makefile     Sun Jun 14 19:01:56 2026
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.260 2026/01/07 08:47:24 wiz Exp $
+# $NetBSD: Makefile,v 1.261 2026/06/14 19:01:56 nia Exp $
 
 DISTNAME=      netpbm-11.02.09
 PKGREVISION=   8
@@ -66,12 +66,17 @@ MAKE_FLAGS.SunOS+=  LDSHLIB=-shared
 MAKE_FLAGS.SunOS+=     NEED_RUNTIME_PATH=Y
 MAKE_FLAGS.SunOS+=     NETWORKLD="-lsocket -lnsl"
 
+# Uses "old-style function definitions" in getopt.c.
+FORCE_C_STD=           gnu89
+
+# Fix implicit function declarations.
+CFLAGS.NetBSD+=                -D_NETBSD_SOURCE
+CFLAGS.SunOS+=         -D__EXTENSIONS__
+
 .if ${OS_VARIANT} == "SCOOSR5"
 MAKE_FLAGS+=   NETWORKLD="-lsocket -lresolv"
 .endif
 
-.include "../../mk/compiler.mk"
-
 # Ridiculous but they hardcode it in every file so we have no choice.
 SUBST_CLASSES+=                xopen
 SUBST_STAGE.xopen=     pre-configure
@@ -83,11 +88,6 @@ SUBST_SED.xopen+=    -e '/_XOPEN_SOURCE[^0-
 SUBST_SED.xopen+=      -e '/_XOPEN_SOURCE$$/s/E$$/E 600/'
 SUBST_SED.xopen+=      -e '/_POSIX_SOURCE.*fdopen/s/_POSIX_SOURCE/_XOPEN_SOURCE 600/'
 
-# Fixing this properly would require patching far too many files.
-.if ${PKGSRC_COMPILER:Mgcc}
-CFLAGS+=       -Wno-error=implicit-function-declaration
-.endif
-
 INSTALLATION_DIRS=     ${PKGMANDIR}/man1 ${PKGMANDIR}/man3 ${PKGMANDIR}/man5 share/netpbm
 
 .include "options.mk"



Home | Main Index | Thread Index | Old Index