pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Fix a gleaming illustration of why using YES/NO var...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/92accff8e752
branches:  trunk
changeset: 490716:92accff8e752
user:      tv <tv%pkgsrc.org@localhost>
date:      Fri Mar 18 18:16:34 2005 +0000

description:
Fix a gleaming illustration of why using YES/NO variables everywhere
possible, just for the sake of doing so, is not a good thing to do:

The platform files define _STRIPFLAG_* to determine whether to strip things.
But since this is included in bsd.prefs.mk, ".if ..." checks cannot take
things set in the Makefile into account.  So convert INSTALL_UNSTRIPPED=YES
to a defined/undefined variable check in bsd.pkg.mk, and use the :D:U idiom
in the _STRIPFLAG_* variables.

This should fix PR pkg/28772 and PR pkg/29031.

diffstat:

 mk/bsd.pkg.mk            |  6 +++++-
 mk/platform/AIX.mk       |  8 +++-----
 mk/platform/BSDOS.mk     |  8 +++-----
 mk/platform/Darwin.mk    |  8 +++-----
 mk/platform/DragonFly.mk |  8 +++-----
 mk/platform/FreeBSD.mk   |  8 +++-----
 mk/platform/IRIX.mk      |  8 +++-----
 mk/platform/Interix.mk   |  8 +++-----
 mk/platform/Linux.mk     |  8 +++-----
 mk/platform/NetBSD.mk    |  8 +++-----
 mk/platform/OSF1.mk      |  4 +++-
 mk/platform/OpenBSD.mk   |  8 +++-----
 mk/platform/SunOS.mk     |  8 +++-----
 mk/platform/UnixWare.mk  |  9 +++------
 14 files changed, 44 insertions(+), 63 deletions(-)

diffs (300 lines):

diff -r c7b66bb97ba6 -r 92accff8e752 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/bsd.pkg.mk     Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1599 2005/03/16 02:09:54 dmcmahill Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1600 2005/03/18 18:16:34 tv Exp $
 #
 # This file is in the public domain.
 #
@@ -155,6 +155,10 @@
 USE_GNU_TOOLS?=                # empty
 WRKSRC?=               ${WRKDIR}/${DISTNAME}
 
+.if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS)
+_INSTALL_UNSTRIPPED=   # set (flag used by platform/*.mk)
+.endif
+
 ##### Non-overridable constants
 
 # Latest versions of tools required for correct pkgsrc operation.
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/AIX.mk
--- a/mk/platform/AIX.mk        Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/AIX.mk        Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: AIX.mk,v 1.11 2005/03/12 20:03:38 garbled Exp $
+# $NetBSD: AIX.mk,v 1.12 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the AIX operating system.
 
@@ -169,10 +169,8 @@
 LINK_ALL_LIBGCC_HACK=  -Wl,--whole-archive -lgcc -Wl,--no-whole-archive
 .endif
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 DEFAULT_SERIAL_DEVICE?=        /dev/tty0
 SERIAL_DEVICES?=       /dev/tty0 \
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/BSDOS.mk
--- a/mk/platform/BSDOS.mk      Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/BSDOS.mk      Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: BSDOS.mk,v 1.7 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: BSDOS.mk,v 1.8 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the BSD/OS operating system.
 
@@ -148,10 +148,8 @@
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 DEFAULT_SERIAL_DEVICE?=        /dev/null
 SERIAL_DEVICES?=       /dev/null
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/Darwin.mk
--- a/mk/platform/Darwin.mk     Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/Darwin.mk     Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Darwin.mk,v 1.7 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: Darwin.mk,v 1.8 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the Darwin operating system.
 
@@ -143,10 +143,8 @@
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -Wl,-x  # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-Wl,-x} # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 LOCALBASE?=            ${DESTDIR}/usr/pkg
 
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/DragonFly.mk
--- a/mk/platform/DragonFly.mk  Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/DragonFly.mk  Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: DragonFly.mk,v 1.9 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: DragonFly.mk,v 1.10 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the DragonFly operating system.
 
@@ -142,10 +142,8 @@
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 DEFAULT_SERIAL_DEVICE?=        /dev/cuaa0
 SERIAL_DEVICES?=       /dev/cuaa0
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/FreeBSD.mk
--- a/mk/platform/FreeBSD.mk    Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/FreeBSD.mk    Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: FreeBSD.mk,v 1.7 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: FreeBSD.mk,v 1.8 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the FreeBSD operating system.
 
@@ -141,10 +141,8 @@
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 DEFAULT_SERIAL_DEVICE?=        /dev/cuaa0
 SERIAL_DEVICES?=       /dev/cuaa0
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/IRIX.mk
--- a/mk/platform/IRIX.mk       Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/IRIX.mk       Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: IRIX.mk,v 1.9 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: IRIX.mk,v 1.10 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the IRIX operating system.
 
@@ -151,10 +151,8 @@
 # incompatible.
 _INCOMPAT_ICONV=       IRIX-*-*
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 LOCALBASE?=            ${DESTDIR}/usr/pkg
 PKG_TOOLS_BIN?=                ${LOCALBASE}/sbin
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/Interix.mk
--- a/mk/platform/Interix.mk    Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/Interix.mk    Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Interix.mk,v 1.24 2005/02/04 09:19:41 jlam Exp $
+# $NetBSD: Interix.mk,v 1.25 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the Interix operating system.
 
@@ -179,10 +179,8 @@
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 DEFAULT_SERIAL_DEVICE?=        /dev/tty00
 SERIAL_DEVICES?=       /dev/tty00 /dev/tty01 /dev/tty02 /dev/tty03
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/Linux.mk
--- a/mk/platform/Linux.mk      Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/Linux.mk      Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Linux.mk,v 1.9 2005/02/17 20:03:26 reed Exp $
+# $NetBSD: Linux.mk,v 1.10 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the Linux operating system.
 
@@ -188,10 +188,8 @@
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 LOCALBASE?=            ${DESTDIR}/usr/pkg
 
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/NetBSD.mk
--- a/mk/platform/NetBSD.mk     Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/NetBSD.mk     Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.mk,v 1.7 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: NetBSD.mk,v 1.8 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the NetBSD operating system.
 
@@ -155,10 +155,8 @@
 LINK_ALL_LIBGCC_HACK=  -Wl,--whole-archive -lgcc -Wl,--no-whole-archive
 .endif
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 .if (${MACHINE_ARCH} == alpha)
 DEFAULT_SERIAL_DEVICE?=        /dev/ttyC0
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/OSF1.mk
--- a/mk/platform/OSF1.mk       Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/OSF1.mk       Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: OSF1.mk,v 1.2 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: OSF1.mk,v 1.3 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the OSF1 operating system.
 
@@ -143,3 +143,5 @@
 
 _INCOMPAT_ICONV=   OSF1-*-*
 
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U}      # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U}      # install(1) option to strip
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/OpenBSD.mk
--- a/mk/platform/OpenBSD.mk    Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/OpenBSD.mk    Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: OpenBSD.mk,v 1.11 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: OpenBSD.mk,v 1.12 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the OpenBSD operating system.
 
@@ -138,10 +138,8 @@
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 .if (${MACHINE_ARCH} == alpha)
 DEFAULT_SERIAL_DEVICE?=        /dev/ttyC0
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/SunOS.mk
--- a/mk/platform/SunOS.mk      Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/SunOS.mk      Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: SunOS.mk,v 1.9 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: SunOS.mk,v 1.10 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the SunOS/Solaris operating system.
 
@@ -144,10 +144,8 @@
 # incompatible.
 _INCOMPAT_ICONV=       SunOS-*-*
 
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                -s      # cc(1) option to strip
-_STRIPFLAG_INSTALL?=   -s      # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 
 # Migration aid for old /usr/local LOCALBASE
 .if !defined(LOCALBASE) && exists(${DESTDIR}/usr/local/libexec/cgi-bin) && \
diff -r c7b66bb97ba6 -r 92accff8e752 mk/platform/UnixWare.mk
--- a/mk/platform/UnixWare.mk   Fri Mar 18 17:56:10 2005 +0000
+++ b/mk/platform/UnixWare.mk   Fri Mar 18 18:16:34 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: UnixWare.mk,v 1.7 2005/01/28 21:05:59 jlam Exp $
+# $NetBSD: UnixWare.mk,v 1.8 2005/03/18 18:16:35 tv Exp $
 #
 # Variable definitions for the UnixWare 7 operating system.
 
@@ -146,11 +146,8 @@
 # incompatible.
 _INCOMPAT_ICONV=       UnixWare-*-*
 
-# XXX Where are those variables used?
-.if (!defined(INSTALL_UNSTRIPPED) || empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) && !defined(DEBUG_FLAGS)
-_STRIPFLAG_CC?=                        # cc(1) option to strip
-_STRIPFLAG_INSTALL?=           # install(1) option to strip
-.endif
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U}      # cc(1) option to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U}      # install(1) option to strip
 
 LOCALBASE?=            ${DESTDIR}/usr/pkg
 



Home | Main Index | Thread Index | Old Index