pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/compiler Allow bsd.compiler.mk to be included by bo...
details: https://anonhg.NetBSD.org/pkgsrc/rev/fb2631d50d21
branches: trunk
changeset: 467678:fb2631d50d21
user: jlam <jlam%pkgsrc.org@localhost>
date: Thu Feb 05 03:35:20 2004 +0000
description:
Allow bsd.compiler.mk to be included by both bsd.prefs.mk and bsd.pkg.mk.
Any additions to DEPENDS/BUILD_DEPENDS or inclusions of buildlink[23].mk
files are deferred till bsd.compiler.mk is included by bsd.pkg.mk. We
allow bsd.compiler.mk to be included by bsd.prefs.mk solely for the purpose
of setting CC_VERSION properly for use by package Makefiles.
There is the surprising behaviour that CC_VERSION won't necessarily have
the correct value at all times until after "make extract" has been
completed (dependencies are installed before "make extract"), so package
Makefile writers should keep that in mind. Just to note that this is
_existing_ behaviour that's preserved by these changes.
diffstat:
mk/compiler/bsd.compiler.mk | 31 ++--
mk/compiler/ccache.mk | 73 +++++++-----
mk/compiler/distcc.mk | 71 +++++++-----
mk/compiler/gcc.mk | 252 +++++++++++++++++++++++--------------------
mk/compiler/mipspro.mk | 44 ++++--
mk/compiler/sunpro.mk | 40 ++++--
6 files changed, 283 insertions(+), 228 deletions(-)
diffs (truncated from 831 to 300 lines):
diff -r 696843619f9d -r fb2631d50d21 mk/compiler/bsd.compiler.mk
--- a/mk/compiler/bsd.compiler.mk Thu Feb 05 02:25:36 2004 +0000
+++ b/mk/compiler/bsd.compiler.mk Thu Feb 05 03:35:20 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.compiler.mk,v 1.6 2004/02/02 10:53:08 jlam Exp $
+# $NetBSD: bsd.compiler.mk,v 1.7 2004/02/05 03:35:20 jlam Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -71,9 +71,9 @@
# XXX "c c++"). This is here for now so that ~85 packages won't
# XXX suddenly break.
#
-.if defined(USE_GCC_SHLIB)
+. if defined(USE_GCC_SHLIB)
USE_LANGUAGES?= c c++
-.endif
+. endif
# By default, assume that the package requires a C compiler.
USE_LANGUAGES?= c
@@ -81,32 +81,31 @@
# Support some deprecated variables for a while. They'll be removed
# after the pkgsrc-2004Q1 branch is cut.
#
-.if defined(USE_GCC2)
+. if defined(USE_GCC2)
GCC_REQD?= 2.8.0
PKGSRC_COMPILER?= gcc
-.elif defined(USE_GCC3)
+. elif defined(USE_GCC3)
GCC_REQD?= 3.0
PKGSRC_COMPILER?= gcc
-.elif defined(USE_PKGSRC_GCC)
+. elif defined(USE_PKGSRC_GCC)
_USE_PKGSRC_GCC= yes
PKGSRC_COMPILER?= gcc
-.elif defined(USE_SUNPRO)
+. elif defined(USE_SUNPRO)
PKGSRC_COMPILER?= sunpro
-.elif defined(USE_MIPSPRO)
+. elif defined(USE_MIPSPRO)
PKGSRC_COMPILER?= mipspro
-.else
+. else
PKGSRC_COMPILER?= gcc
-.endif
+. endif
_PKGSRC_COMPILER= # empty
-.for _compiler_ in ${PKGSRC_COMPILER}
-. if empty(_PKGSRC_COMPILER:M${_compiler_})
+. for _compiler_ in ${PKGSRC_COMPILER}
+. if empty(_PKGSRC_COMPILER:M${_compiler_})
_PKGSRC_COMPILER:= ${_compiler_} ${_PKGSRC_COMPILER}
-. endif
-.endfor
+. endif
+. endfor
+.endif # BSD_COMPILER_MK
.for _compiler_ in ${_PKGSRC_COMPILER}
. include "../../mk/compiler/${_compiler_}.mk"
.endfor
-
-.endif # BSD_COMPILER_MK
diff -r 696843619f9d -r fb2631d50d21 mk/compiler/ccache.mk
--- a/mk/compiler/ccache.mk Thu Feb 05 02:25:36 2004 +0000
+++ b/mk/compiler/ccache.mk Thu Feb 05 03:35:20 2004 +0000
@@ -1,16 +1,16 @@
-# $NetBSD: ccache.mk,v 1.6 2004/02/03 20:38:39 jlam Exp $
+# $NetBSD: ccache.mk,v 1.7 2004/02/05 03:35:20 jlam Exp $
.if !defined(COMPILER_CCACHE_MK)
-COMPILER_CCACHE_MK= defined
+COMPILER_CCACHE_MK= one
-.if !empty(PKGPATH:Mdevel/ccache)
+. if !empty(PKGPATH:Mdevel/ccache)
IGNORE_CCACHE= yes
MAKEFLAGS+= IGNORE_CCACHE=yes
-.endif
+. endif
-.if defined(IGNORE_CCACHE)
+. if defined(IGNORE_CCACHE)
_USE_CCACHE= NO
-.endif
+. endif
# LANGUAGES.<compiler> is the list of supported languages by the compiler.
# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones
@@ -18,49 +18,60 @@
#
LANGUAGES.ccache= c c++
_LANGUAGES.ccache= # empty
-.for _lang_ in ${USE_LANGUAGES}
+. for _lang_ in ${USE_LANGUAGES}
_LANGUAGES.ccache+= ${LANGUAGES.ccache:M${_lang_}}
-.endfor
-.if empty(_LANGUAGES.ccache)
+. endfor
+. if empty(_LANGUAGES.ccache)
_USE_CCACHE= NO
-.endif
+. endif
-.if !defined(_USE_CCACHE)
+. if !defined(_USE_CCACHE)
_USE_CCACHE= YES
-.endif
+. endif
-.if !empty(_USE_CCACHE:M[yY][eE][sS])
-#
-# Add the dependency on ccache.
-BUILD_DEPENDS+= ccache-[0-9]*:../../devel/ccache
-.endif
-
-EVAL_PREFIX+= _CCACHEBASE=ccache
+. if !empty(_USE_CCACHE:M[yY][eE][sS])
+EVAL_PREFIX+= _CCACHEBASE=ccache
_CCACHEBASE_DEFAULT= ${LOCALBASE}
_CCACHEBASE?= ${LOCALBASE}
-.if exists(${_CCACHEBASE}/bin/ccache)
+. if exists(${_CCACHEBASE}/bin/ccache)
_CCACHE_DIR= ${WRKDIR}/.ccache
_CCACHE_LINKS= # empty
-. if !empty(_LANGUAGES.ccache)
-PATH:= ${_CCACHE_DIR}/bin:${PATH}
-. endif
-. if !empty(_LANGUAGES.ccache:Mc)
+. if !empty(_LANGUAGES.ccache:Mc)
CC:= ${_CCACHE_DIR}/bin/${CC:T}
_CCACHE_LINKS+= CC
-. endif
-. if !empty(_LANGUAGES.ccache:Mc++)
+. endif
+. if !empty(_LANGUAGES.ccache:Mc++)
CXX:= ${_CCACHE_DIR}/bin/${CXX:T}
_CCACHE_LINKS+= CXX
+. endif
+. endif
. endif
+.endif # COMPILER_CCACHE_MK
-. for _target_ in ${_CCACHE_LINKS}
+# The following section is included only if we're not being included by
+# bsd.prefs.mk.
+#
+.if empty(BSD_PREFS_MK:M+*)
+. if empty(COMPILER_CCACHE_MK:Mtwo)
+COMPILER_CCACHE_MK+= two
+
+. if !empty(_USE_CCACHE:M[yY][eE][sS])
+. if !empty(_LANGUAGES.ccache)
+PATH:= ${_CCACHE_DIR}/bin:${PATH}
+. endif
+
+BUILD_DEPENDS+= ccache-[0-9]*:../../devel/ccache
+
+. if exists(${_CCACHEBASE}/bin/ccache)
+. for _target_ in ${_CCACHE_LINKS}
override-tools: ${${_target_}}
${${_target_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG} \
${LN} -fs ${_CCACHEBASE}/bin/ccache ${.TARGET}
-. endfor
-.endif
-
-.endif # COMPILER_CCACHE_MK
+. endfor
+. endif
+. endif
+. endif # COMPILER_CCACHE_MK
+.endif # BSD_PREFS_MK
diff -r 696843619f9d -r fb2631d50d21 mk/compiler/distcc.mk
--- a/mk/compiler/distcc.mk Thu Feb 05 02:25:36 2004 +0000
+++ b/mk/compiler/distcc.mk Thu Feb 05 03:35:20 2004 +0000
@@ -1,16 +1,16 @@
-# $NetBSD: distcc.mk,v 1.9 2004/02/03 20:38:39 jlam Exp $
+# $NetBSD: distcc.mk,v 1.10 2004/02/05 03:35:20 jlam Exp $
.if !defined(COMPILER_DISTCC_MK)
-COMPILER_DISTCC_MK= defined
+COMPILER_DISTCC_MK= one
-.if !empty(PKGPATH:Mdevel/distcc)
+. if !empty(PKGPATH:Mdevel/distcc)
IGNORE_DISTCC= yes
MAKEFLAGS+= IGNORE_DISTCC=yes
-.endif
+. endif
-.if defined(IGNORE_DISTCC)
+. if defined(IGNORE_DISTCC)
_USE_DISTCC= NO
-.endif
+. endif
# LANGUAGES.<compiler> is the list of supported languages by the compiler.
# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones
@@ -18,49 +18,60 @@
#
LANGUAGES.distcc= c c++
_LANGUAGES.distcc= # empty
-.for _lang_ in ${USE_LANGUAGES}
+. for _lang_ in ${USE_LANGUAGES}
_LANGUAGES.distcc+= ${LANGUAGES.distcc:M${_lang_}}
-.endfor
-.if empty(_LANGUAGES.distcc)
+. endfor
+. if empty(_LANGUAGES.distcc)
_USE_DISTCC= NO
-.endif
+. endif
-.if !defined(_USE_DISTCC)
+. if !defined(_USE_DISTCC)
_USE_DISTCC= YES
-.endif
+. endif
-.if !empty(_USE_DISTCC:M[yY][eE][sS])
-#
-# Add the dependency on distcc.
-BUILD_DEPENDS+= distcc-[0-9]*:../../devel/distcc
-.endif
-
+. if !empty(_USE_DISTCC:M[yY][eE][sS])
EVAL_PREFIX+= _DISTCCBASE=distcc
_DISTCCBASE_DEFAULT= ${LOCALBASE}
_DISTCCBASE?= ${LOCALBASE}
-.if exists(${_DISTCCBASE}/bin/distcc)
+. if exists(${_DISTCCBASE}/bin/distcc)
_DISTCC_DIR= ${WRKDIR}/.distcc
_DISTCC_LINKS= # empty
-. if !empty(_LANGUAGES.distcc)
-PATH:= ${_DISTCC_DIR}/bin:${PATH}
-. endif
-. if !empty(_LANGUAGES.distcc:Mc)
+. if !empty(_LANGUAGES.distcc:Mc)
CC:= ${_DISTCC_DIR}/bin/${CC:T}
_DISTCC_LINKS+= CC
-. endif
-. if !empty(_LANGUAGES.distcc:Mc++)
+. endif
+. if !empty(_LANGUAGES.distcc:Mc++)
CXX:= ${_DISTCC_DIR}/bin/${CXX:T}
_DISTCC_LINKS+= CXX
+. endif
+. endif
. endif
+.endif # COMPILER_DISTCC_MK
-. for _target_ in ${_DISTCC_LINKS}
+# The following section is included only if we're not being included by
+# bsd.prefs.mk.
+#
+.if empty(BSD_PREFS_MK:M+*)
+. if empty(COMPILER_DISTCC_MK:Mtwo)
+COMPILER_DISTCC_MK+= two
+
+. if !empty(_USE_DISTCC:M[yY][eE][sS])
+. if !empty(_LANGUAGES.distcc)
+PATH:= ${_DISTCC_DIR}/bin:${PATH}
+. endif
+
+BUILD_DEPENDS+= distcc-[0-9]*:../../devel/distcc
+
+. if exists(${_DISTCCBASE}/bin/distcc)
+. for _target_ in ${_DISTCC_LINKS}
override-tools: ${${_target_}}
${${_target_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG} \
${LN} -fs ${_DISTCCBASE}/bin/distcc ${.TARGET}
-. endfor
-.endif
-
-.endif # COMPILER_DISTCC_MK
+. endfor
+. endif
+. endif
+. endif # COMPILER_DISTCC_MK
+.endif # BSD_PREFS_MK
diff -r 696843619f9d -r fb2631d50d21 mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk Thu Feb 05 02:25:36 2004 +0000
+++ b/mk/compiler/gcc.mk Thu Feb 05 03:35:20 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: gcc.mk,v 1.35 2004/02/05 01:57:38 jlam Exp $
+# $NetBSD: gcc.mk,v 1.36 2004/02/05 03:35:20 jlam Exp $
.if !defined(COMPILER_GCC_MK)
-COMPILER_GCC_MK= defined
+COMPILER_GCC_MK= one
Home |
Main Index |
Thread Index |
Old Index