diff options
author | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
commit | d0b4c54eb698e718080690cf98ab5b8bbb4001e0 (patch) | |
tree | 1226d07b8f66083168895189decc88848b70903f /devel/binutils | |
parent | 9d61fef8537aed11013bf556e319b2d8e398a11b (diff) | |
download | pkgsrc-d0b4c54eb698e718080690cf98ab5b8bbb4001e0.tar.gz |
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal
checking for built-in software is much simpler to deal with in pkgsrc.
The buildlink3.mk file for a package will be of the usual format
regardless of the package, which makes it simpler for packagers to
update a package.
The builtin.mk file for a package must define a single yes/no variable
USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether
to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'devel/binutils')
-rw-r--r-- | devel/binutils/buildlink3.mk | 82 | ||||
-rw-r--r-- | devel/binutils/builtin.mk | 44 |
2 files changed, 51 insertions, 75 deletions
diff --git a/devel/binutils/buildlink3.mk b/devel/binutils/buildlink3.mk index e240ae1c192..ab6ed1cfa74 100644 --- a/devel/binutils/buildlink3.mk +++ b/devel/binutils/buildlink3.mk @@ -1,87 +1,19 @@ -# $NetBSD: buildlink3.mk,v 1.13 2004/02/18 16:35:27 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.14 2004/03/10 17:57:14 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ BINUTILS_BUILDLINK3_MK:= ${BINUTILS_BUILDLINK3_MK}+ -.include "../../mk/bsd.prefs.mk" +.if !empty(BUILDLINK_DEPTH:M+) +BUILDLINK_DEPENDS+= binutils +.endif + +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nbinutils} +BUILDLINK_PACKAGES+= binutils .if !empty(BINUTILS_BUILDLINK3_MK:M+) -BUILDLINK_PACKAGES+= binutils BUILDLINK_DEPENDS.binutils+= binutils>=2.14.0 BUILDLINK_PKGSRCDIR.binutils?= ../../devel/binutils BUILDLINK_DEPMETHOD.binutils?= build .endif # BINUTILS_BUILDLINK3_MK -BUILDLINK_CHECK_BUILTIN.binutils?= NO - -.if !defined(BUILDLINK_IS_BUILTIN.binutils) -BUILDLINK_IS_BUILTIN.binutils= YES -. if !empty(BUILDLINK_CHECK_BUILTIN.binutils:M[nN][oO]) -# -# These versions of NetBSD didn't have a toolchain that was capable of -# replacing binutils. -# -_INCOMPAT_BINUTILS= NetBSD-0.*-* NetBSD-1.[01234]*-* -_INCOMPAT_BINUTILS+= NetBSD-1.5.*-* NetBSD-1.5[A-X]-* -# -# XXX: _INCOMPAT_BINUTILS settings for other operating systems possibly -# XXX: needed here -# -INCOMPAT_BINUTILS?= # empty -. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) -BUILDLINK_IS_BUILTIN.binutils= NO -. endif -. endfor -. endif -MAKEFLAGS+= BUILDLINK_IS_BUILTIN.binutils=${BUILDLINK_IS_BUILTIN.binutils} -.endif - -.if !empty(BUILDLINK_CHECK_BUILTIN.binutils:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.binutils= YES -.endif - -.if !defined(BUILDLINK_USE_BUILTIN.binutils) -. if !empty(BUILDLINK_IS_BUILTIN.binutils:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.binutils= YES -. else -BUILDLINK_USE_BUILTIN.binutils= NO -. endif - -. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \ - !empty(BUILDLINK_IS_BUILTIN.binutils:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.binutils= YES -. endif -. if !empty(PREFER_PKGSRC:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.binutils= NO -. endif -. if !empty(PREFER_NATIVE:Mbinutils) && \ - !empty(BUILDLINK_IS_BUILTIN.binutils:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.binutils= YES -. endif -. if !empty(PREFER_PKGSRC:Mbinutils) -BUILDLINK_USE_BUILTIN.binutils= NO -. endif - -. if defined(USE_BINUTILS) -BUILDLINK_USE_BUILTIN.binutils= NO -. endif -.endif - -.if !empty(BUILDLINK_USE_BUILTIN.binutils:M[nN][oO]) -. if !empty(BUILDLINK_DEPTH:M+) -BUILDLINK_DEPENDS+= binutils -. endif -.endif - -.if !empty(BINUTILS_BUILDLINK3_MK:M+) -. if !empty(BUILDLINK_USE_BUILTIN.binutils:M[nN][oO]) -AR= ${BUILDLINK_PREFIX.binutils}/bin/ar -AS= ${BUILDLINK_PREFIX.binutils}/bin/as -LD= ${BUILDLINK_PREFIX.binutils}/bin/ld -NM= ${BUILDLINK_PREFIX.binutils}/bin/nm -RANLIB= ${BUILDLINK_PREFIX.binutils}/bin/ranlib -. endif -.endif # BINUTILS_BUILDLINK3_MK - BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/devel/binutils/builtin.mk b/devel/binutils/builtin.mk new file mode 100644 index 00000000000..e3869b1fe13 --- /dev/null +++ b/devel/binutils/builtin.mk @@ -0,0 +1,44 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $ + +# XXX Assume that the base OS provides a built-in binutils. +IS_BUILTIN.binutils?= yes + +CHECK_BUILTIN.binutils?= no +.if !empty(CHECK_BUILTIN.binutils:M[yY][eE][sS]) +USE_BUILTIN.binutils= yes +.endif + +.if !defined(USE_BUILTIN.binutils) +USE_BUILTIN.binutils?= ${IS_BUILTIN.binutils} +PREFER.binutils?= pkgsrc + +. if defined(USE_BINUTILS) +. if !empty(IS_BUILTIN.binutils:M[nN][oO]) || \ + (${PREFER.binutils} == "pkgsrc") +USE_BUILTIN.binutils= no +. endif +. endif + +# These versions of NetBSD didn't have a toolchain that was capable of +# replacing binutils. +# +_INCOMPAT_BINUTILS= NetBSD-0.*-* NetBSD-1.[01234]*-* +_INCOMPAT_BINUTILS+= NetBSD-1.5.*-* NetBSD-1.5[A-X]-* +# +# XXX _INCOMPAT_BINUTILS settings for other operating systems possibly +# XXX needed here +# +. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +USE_BUILTIN.binutils= no +. endif +. endfor +.endif # USE_BUILTIN.binutils + +.if !empty(USE_BUILTIN.binutils:M[nN][oO]) +AR= ${BUILDLINK_PREFIX.binutils}/bin/ar +AS= ${BUILDLINK_PREFIX.binutils}/bin/as +LD= ${BUILDLINK_PREFIX.binutils}/bin/ld +NM= ${BUILDLINK_PREFIX.binutils}/bin/nm +RANLIB= ${BUILDLINK_PREFIX.binutils}/bin/ranlib +.endif |