Subject: Re: Forcing unavailability of unrequested LANGUAGES
To: None <tech-pkg@netbsd.org>
From: Todd Vierling <tv@duh.org>
List: tech-pkg
Date: 04/18/2006 14:22:10
On Tue, 18 Apr 2006, Todd Vierling wrote:

> 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).

Here's a slight update.  The Libtool config bits, which are interpolated
into configure scripts (something I still find to be rather inane and
counter to the possibility of having libtool external to a package), require
a working C++ preprocessor -- even if there is no C++ on the system.  To
make these configure scripts happy, I've added an extra setting for ALL_ENV
that provides an override CXXCPP value (falling back to the C preprocessor).

Index: compiler.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler.mk,v
retrieving revision 1.47
diff -u -r1.47 compiler.mk
--- compiler.mk	16 Oct 2005 19:44:44 -0000	1.47
+++ compiler.mk	18 Apr 2006 18:21:33 -0000
@@ -147,4 +147,15 @@
 _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}
+ALL_ENV+=		CXXCPP=${CPP:Q} # to make some Autoconf scripts happy
+.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>