summaryrefslogtreecommitdiff
path: root/devel/binutils
diff options
context:
space:
mode:
authortnn <tnn>2008-03-24 23:40:37 +0000
committertnn <tnn>2008-03-24 23:40:37 +0000
commit87e0260d248fed76bdd5dc72251842cdeff93433 (patch)
treeb6b79ef2b3558c7bee25e2d5f6ceaca8627bed96 /devel/binutils
parentc3bd3333567d61a75155db79e963083a1ac8bc35 (diff)
downloadpkgsrc-87e0260d248fed76bdd5dc72251842cdeff93433.tar.gz
- Split out the code for overriding as(1) into it's own file.
- In override-as.mk, fabricate a "specs" file and use it to force gcc into execvp'ing the correct as(1). Apparently having it in $PATH is not enough. This only affects multimedia/mplayer and perhaps sysutils/memtest86. (The latter probably doesn't need binutils at all, at least on modern NetBSD, and should be revisited.)
Diffstat (limited to 'devel/binutils')
-rw-r--r--devel/binutils/buildlink3.mk9
-rw-r--r--devel/binutils/override-as.mk27
2 files changed, 28 insertions, 8 deletions
diff --git a/devel/binutils/buildlink3.mk b/devel/binutils/buildlink3.mk
index e8edd4a9681..f75eb266995 100644
--- a/devel/binutils/buildlink3.mk
+++ b/devel/binutils/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.21 2008/03/24 19:53:01 tnn Exp $
+# $NetBSD: buildlink3.mk,v 1.22 2008/03/24 23:40:37 tnn Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
BINUTILS_BUILDLINK3_MK:= ${BINUTILS_BUILDLINK3_MK}+
@@ -17,11 +17,4 @@ BUILDLINK_PKGSRCDIR.binutils?= ../../devel/binutils
BUILDLINK_DEPMETHOD.binutils?= build
.endif # BINUTILS_BUILDLINK3_MK
-GNU_PREFIX_CMD= \
- ${PKG_INFO} -Q GNU_PROGRAM_PREFIX binutils 2>/dev/null \
- || { cd ${BUILDLINK_PKGSRCDIR.binutils} \
- && ${MAKE} ${MAKEFLAGS} show-var VARNAME=GNU_PROGRAM_PREFIX; }
-
-PKG_AS= ${PREFIX}/bin/${:!${GNU_PREFIX_CMD}!}as
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/binutils/override-as.mk b/devel/binutils/override-as.mk
new file mode 100644
index 00000000000..2502d8941f1
--- /dev/null
+++ b/devel/binutils/override-as.mk
@@ -0,0 +1,27 @@
+# $NetBSD: override-as.mk,v 1.1 2008/03/24 23:40:37 tnn Exp $
+
+# This Makefile fragment can be included by packages that wish to
+# override the default selection of as(1) and use the one from devel/binutils
+# instead.
+
+GNU_PREFIX_CMD= ${PKG_INFO} -Q GNU_PROGRAM_PREFIX binutils 2>/dev/null \
+ || { cd ${BUILDLINK_PKGSRCDIR.binutils} \
+ && ${MAKE} ${MAKEFLAGS} show-var VARNAME=GNU_PROGRAM_PREFIX; }
+
+PKG_AS= ${PREFIX}/bin/${:!${GNU_PREFIX_CMD}!}as
+
+.include "../../mk/compiler.mk"
+
+.if !empty(PKGSRC_COMPILER:Mgcc)
+
+SPECS_AS= ${WRAPPER_DIR}/specs.as
+WRAPPER_TARGETS+= ${SPECS_AS}
+
+${SPECS_AS}:
+ @${ECHO} "*invoke_as:" > ${SPECS_AS}
+ @${ECHO} "%{!S:-o %|.s |" >> ${SPECS_AS}
+ @${ECHO} "${PKG_AS} %(asm_options) %m.s %A }" >> ${SPECS_AS}
+
+_WRAP_EXTRA_ARGS.CC+= -specs ${SPECS_AS}
+_WRAP_EXTRA_ARGS.CXX+= -specs ${SPECS_AS}
+.endif