Subject: Forcing unavailability of unrequested LANGUAGES
To: None <tech-pkg@netbsd.org>
From: Todd Vierling <tv@duh.org>
List: tech-pkg
Date: 04/18/2006 10:44:23
Georg Schwarz gave me an idea this morning while we were discussing some
things regarding USE_LANGUAGES -- he has a local mk.conf blurb to catch when
USE_LANGUAGES is missing "c++" where it is needed.

I thought it would be a good idea to generalize this, and forcibly break
packages that don't specify languages they need.  Happily, I found that this
was trivial to implement.  Unless there are reasonable objections, I'd like
to commit the following diff on Friday Apr 21.

This is very likely to break packages in the bulk build -- and rightly so.
I would recommend that any package fixed by modifying USE_LANGUAGES to obey
this constraint should bump its PKGREVISION (because the package may now
depend on a C++ or Fortran runtime library from pkgsrc by default, in some
environments).

Index: mk/compiler.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler.mk,v
retrieving revision 1.47
diff -u -r1.47 compiler.mk
--- mk/compiler.mk	16 Oct 2005 19:44:44 -0000	1.47
+++ mk/compiler.mk	18 Apr 2006 14:39:04 -0000
@@ -147,4 +147,14 @@
 _WRAP_EXTRA_ARGS.LD+=	${_LINKER_ABI_FLAG.${ABI}}
 .endif

+# If the languages are not requested, force them not to be available
+# in the generated wrappers.
+#
+.if empty(USE_LANGUAGES:Mc++)
+PKG_CXX:=		${FALSE}
+.endif
+.if empty(USE_LANGUAGES:Mfortran)
+PKG_FC:=		${FALSE}
+.endif
+
 .endif	# BSD_COMPILER_MK

-- 
-- Todd Vierling <tv@duh.org> <tv@pobox.com> <todd@vierling.name>