pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Replace inline definitions of errno with "#include ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/14b1b757380b
branches:  trunk
changeset: 491326:14b1b757380b
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Wed Mar 23 01:45:34 2005 +0000

description:
Replace inline definitions of errno with "#include <errno.h>" to
fix compilation on systems with glibc 2.3.1 or newer.

diffstat:

 mk/djbware.mk |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r d5d924fcf127 -r 14b1b757380b mk/djbware.mk
--- a/mk/djbware.mk     Wed Mar 23 01:18:28 2005 +0000
+++ b/mk/djbware.mk     Wed Mar 23 01:45:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: djbware.mk,v 1.1 2005/03/23 00:50:06 schmonz Exp $
+# $NetBSD: djbware.mk,v 1.2 2005/03/23 01:45:34 schmonz Exp $
 #
 # Makefile fragment for packages with djb-style build machinery
 #
@@ -6,16 +6,18 @@
 # * a boilerplate RESTRICTED clause
 # * typical defaults for BUILD_TARGET and INSTALL_TARGET
 # * typical values for conf-* files
+# * replace inline definitions of errno with "#include <errno.h>"
 #
 # TODO:
 # * set RESTRICTED automatically iff patches or other mods are applied
-# * on recent glibc, subst.mk inline errno defn into #include <errno.h>
+# * do the <errno.h> dance only where needed (glibc>=2.3)
 #
 
 .if !defined(DJBWARE_MK)
 DJBWARE_MK=            # defined
 
 DJB_RESTRICTED?=       YES
+DJB_ERRNO_HACK?=       YES
 DJB_BUILD_TARGETS?=    # empty
 DJB_INSTALL_TARGETS?=  # empty
 DJB_CONFIG_DIR?=       ${WRKSRC}
@@ -24,6 +26,8 @@
 DJB_CONFIG_CMDS?=      ${DO_NADA}
 BGWARE_INSTALLER?=     NO
 
+BUILD_DEFS+=           DJB_ERRNO_HACK
+
 .if !empty(DJB_RESTRICTED:M[yY][eE][sS])
 RESTRICTED=            "modified source and binaries may not be distributed"
 NO_BIN_ON_CDROM=       ${RESTRICTED}
@@ -33,6 +37,14 @@
 BUILD_TARGET?=         it ${DJB_BUILD_TARGETS}
 INSTALL_TARGET?=       setup check ${DJB_INSTALL_TARGETS}
 
+.if !empty(DJB_ERRNO_HACK:M[yY][eE][sS])
+SUBST_CLASSES+=                djbware
+SUBST_STAGE.djbware=   do-configure
+SUBST_FILES.djbware=   error.h
+SUBST_SED.djbware=     -e 's|^extern\ int\ errno\;|\#include \<errno.h\>|'
+SUBST_MESSAGE.djbware= "Correcting definition of errno."
+.endif
+
 .if !target(do-configure)
 do-configure:
        ${_PKG_SILENT}${_PKG_DEBUG}cd ${DJB_CONFIG_DIR};                \



Home | Main Index | Thread Index | Old Index