pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Up to now, the language "c" has always been enabled...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/68cc0349d6f1
branches:  trunk
changeset: 516401:68cc0349d6f1
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Jul 20 16:44:01 2006 +0000

description:
Up to now, the language "c" has always been enabled, no matter if the
package said USE_LANGUAGES=#none or USE_LANGUAGES=fortran. Added a
c-fail-wrapper that works like the other fail-wrappers. The default
value for USE_LANGUAGES is still "c". Some problems are expected with
packages that say USE_LANGUAGES+=c++ or with packages containing GNU
configure scripts and setting USE_LANGUAGES=c++, as those scripts always
need a working C compiler.

diffstat:

 mk/compiler.mk |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 204bd6085d27 -r 68cc0349d6f1 mk/compiler.mk
--- a/mk/compiler.mk    Thu Jul 20 16:32:46 2006 +0000
+++ b/mk/compiler.mk    Thu Jul 20 16:44:01 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.52 2006/07/02 23:09:19 rillig Exp $
+# $NetBSD: compiler.mk,v 1.53 2006/07/20 16:44:01 rillig Exp $
 #
 # This Makefile fragment implements handling for supported C/C++/Fortran
 # compilers.
@@ -70,11 +70,8 @@
 
 .include "../../mk/bsd.prefs.mk"
 
-# Always require a C compiler for proper compiler detection.
+# Since most packages need a C compiler, this is the default value.
 USE_LANGUAGES?=        c
-.if empty(USE_LANGUAGES:Mc)
-USE_LANGUAGES:=        c ${USE_LANGUAGES}
-.endif
 
 # For environments where there is an external gcc too, but pkgsrc
 # should use the pkgsrc one for consistency.
@@ -150,9 +147,11 @@
 # If the languages are not requested, force them not to be available
 # in the generated wrappers.
 #
+_FAIL_WRAPPER.CC=      ${WRKDIR}/.compiler/bin/c-fail-wrapper
 _FAIL_WRAPPER.CXX=     ${WRKDIR}/.compiler/bin/c++-fail-wrapper
 _FAIL_WRAPPER.FC=      ${WRKDIR}/.compiler/bin/fortran-fail-wrapper
 
+${_FAIL_WRAPPER.CC}: fail-wrapper
 ${_FAIL_WRAPPER.CXX}: fail-wrapper
 ${_FAIL_WRAPPER.FC}: fail-wrapper
 
@@ -168,6 +167,11 @@
        ${ECHO} 'exit 1'
        ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
 
+.if empty(USE_LANGUAGES:Mc)
+PKG_CC:=               ${_FAIL_WRAPPER.CC}
+ALL_ENV+=              CPP=${CPP:Q}
+override-tools: ${_FAIL_WRAPPER.CC}
+.endif
 .if empty(USE_LANGUAGES:Mc++)
 PKG_CXX:=              ${_FAIL_WRAPPER.CXX}
 ALL_ENV+=              CXXCPP=${CPP:Q} # to make some Autoconf scripts happy



Home | Main Index | Thread Index | Old Index