summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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