pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk mk/djbware.mk: make the errno.h hack configurable



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bef8032869a3
branches:  trunk
changeset: 413559:bef8032869a3
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Mar 20 19:40:39 2020 +0000

description:
mk/djbware.mk: make the errno.h hack configurable

This hack is mostly needed for older software like sysutils/daemontools
that was created when errno was still a global variable. Newer packages
like devel/bglibs don't need that hack anymore. Therefore make it
configurable, to avoid build failures when subst.mk does not find any
error.h to patch.

diffstat:

 mk/djbware.mk |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (34 lines):

diff -r f7cefef6fa75 -r bef8032869a3 mk/djbware.mk
--- a/mk/djbware.mk     Fri Mar 20 18:00:48 2020 +0000
+++ b/mk/djbware.mk     Fri Mar 20 19:40:39 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: djbware.mk,v 1.26 2017/09/28 16:15:49 schmonz Exp $
+# $NetBSD: djbware.mk,v 1.27 2020/03/20 19:40:39 rillig Exp $
 #
 # Makefile fragment for packages with djb-style build machinery
 #
@@ -29,6 +29,7 @@
 DJB_MAKE_TARGETS?=     YES
 DJB_BUILD_TARGETS?=    # empty
 DJB_INSTALL_TARGETS?=  # empty
+DJB_ERRNO_HACK?=       YES
 DJB_SLASHPACKAGE?=     NO
 .if !empty(DJB_SLASHPACKAGE:M[yY][eE][sS])
 DJB_CONFIG_DIR?=       ${WRKSRC}/src
@@ -82,6 +83,7 @@
        cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} package/compile ${DJB_BUILD_ARGS}
 .endif
 
+.if !empty(DJB_ERRNO_HACK:M[yY][eE][sS])
 PKG_SUPPORTED_OPTIONS+=        djbware-errno-hack
 PKG_SUGGESTED_OPTIONS+=        djbware-errno-hack
 
@@ -103,5 +105,8 @@
 SUBST_SED.djbware=     -e 's|^extern\ int\ errno\;|\#include \<errno.h\>|'
 SUBST_MESSAGE.djbware= Correcting definition of errno.
 .endif
+.else
+.sinclude "${PKGDIR}/options.mk"
+.endif
 
 .endif # DJBWARE_MK



Home | Main Index | Thread Index | Old Index