Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/dev/lib/libpci Avoid '.' in variable names which ar...



details:   https://anonhg.NetBSD.org/src/rev/3198b056119c
branches:  trunk
changeset: 815299:3198b056119c
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue May 10 19:38:29 2016 +0000

description:
Avoid '.' in variable names which are expected to be passed to
this Makefile via the env.

That character is strictly speaking not allowed by POSIX in an exported
variable name, and at least dash >= 0.58 refuses to export such variables.

Furthermore, since the individual CFLAGS/CPPFLAGS/etc. variables
are not comprehensive enough for all cases (e.g. HURD), just
support the .includable version from now on, i.e.
RUMPCOMP_MAKEFILEINC_rumpdev_pci.

curious failure mode debugged by Martin Lucina

diffstat:

 sys/rump/dev/lib/libpci/Makefile |  31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)

diffs (54 lines):

diff -r 04e531642bec -r 3198b056119c sys/rump/dev/lib/libpci/Makefile
--- a/sys/rump/dev/lib/libpci/Makefile  Tue May 10 19:35:08 2016 +0000
+++ b/sys/rump/dev/lib/libpci/Makefile  Tue May 10 19:38:29 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2016/01/26 23:12:15 pooka Exp $
+#      $NetBSD: Makefile,v 1.11 2016/05/10 19:38:29 pooka Exp $
 #
 
 RUMPTOP= ${TOPRUMP}
@@ -28,23 +28,36 @@
 .error RUMP_PCI_IOSPACE defined in Makefile.  Use userfeatures.h instead.
 .endif
 
+RUMPCOMP_USER_CPPFLAGS:=-I${.PARSEDIR}
+
+# current state-of-the-art interface (remains to be seen if it's "good enuf")
+.ifdef RUMPCOMP_MAKEFILEINC_rumpdev_pci
+.include "${RUMPCOMP_MAKEFILEINC_rumpdev_pci}"
+.endif
+
+# old-style ("compat") interfaces.  will go away some day or year.
+# why?  the "protocol" requires passing variables via the env, and
+# the names include dots which POSIX does not, strictly speaking,
+# allow in env names.  There is at least one shell (dash >= 0.58)
+# which refuses to pass variables with dots.
+.if defined(RUMPCOMP_USER_SRCS.rumpdev_pci) \
+    || defined(RUMPCOMP_MAKEFILEINC.rumpdev_pci)
+.warning Use new style RUMPCOMP_MAKEFILEINC_rumpdev_pci
+.endif
+.ifdef RUMPCOMP_USER_PATH.rumpdev_pci
 .PATH:                 ${RUMPCOMP_USER_PATH.rumpdev_pci}
 RUMPCOMP_USER_SRCS=    ${RUMPCOMP_USER_SRCS.rumpdev_pci}
-MYDIR:=                        ${.PARSEDIR}
-RUMPCOMP_USER_CPPFLAGS=        -I${MYDIR}
 RUMPCOMP_USER_CPPFLAGS+=${RUMPCOMP_USER_CPPFLAGS.rumpdev_pci}
 RUMPCOMP_USER_CFLAGS=  ${RUMPCOMP_USER_CFLAGS.rumpdev_pci}
-
 CPPFLAGS+=             ${RUMPCOMP_CPPFLAGS.rumpdev_pci}
+.endif
+.ifdef RUMPCOMP_MAKEFILEINC.rumpdev_pci
+.include "${RUMPCOMP_MAKEFILEINC.rumpdev_pci}"
+.endif
 
 # XXX: messy
 .undef RUMPKERN_ONLY
 
-.ifdef RUMPCOMP_MAKEFILEINC.rumpdev_pci
-.warning RUMPCOMP_MAKEFILEINC interface is unstable and may change
-.include "${RUMPCOMP_MAKEFILEINC.rumpdev_pci}"
-.endif
-
 .include "${RUMPTOP}/Makefile.rump"
 .include <bsd.lib.mk>
 .include <bsd.klinks.mk>



Home | Main Index | Thread Index | Old Index