summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorriastradh <riastradh@pkgsrc.org>2022-04-10 19:54:02 +0000
committerriastradh <riastradh@pkgsrc.org>2022-04-10 19:54:02 +0000
commite5478902b33a7de6e8e7b0207efc59fff30b0f9e (patch)
treedcbc6531367d3a2bfb25dd89ecd99fcb5ba9b6f7 /mk
parent6692e9187e3f640da3e0479e3f61edc880730cb4 (diff)
downloadpkgsrc-e5478902b33a7de6e8e7b0207efc59fff30b0f9e.tar.gz
mk: Use CWRAPPERS_PREPEND for --sysroot.
Looks like maybe the -Wl,-rpath-link business isn't necessary after all -- will leave this as is until I find evidence otherwise. (joerg says it was a workaround for NetBSD toolchain parts that weren't properly adapted to use sysroot.) With this, revert cwrappers version dependency to what it was before. But keep it as TOOL_DEPENDS, not BUILD_DEPENDS.
Diffstat (limited to 'mk')
-rw-r--r--mk/compiler.mk11
-rw-r--r--mk/cwrappers.mk7
2 files changed, 12 insertions, 6 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index d7bf7297d87..9f9c29af6d8 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.96 2021/12/03 07:40:26 wiz Exp $
+# $NetBSD: compiler.mk,v 1.97 2022/04/10 19:54:02 riastradh Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -220,6 +220,15 @@ _WRAP_EXTRA_ARGS.CC+= ${_CTF_CFLAGS}
CWRAPPERS_APPEND.cc+= ${_CTF_CFLAGS}
.endif
+# Add sysroot if using cross-compilation tools.
+#
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
+CWRAPPERS_PREPEND.cc+= --sysroot=${TOOLS_CROSS_DESTDIR:Q}
+CWRAPPERS_PREPEND.cxx+= --sysroot=${TOOLS_CROSS_DESTDIR:Q}
+CWRAPPERS_PREPEND.ld+= --sysroot=${TOOLS_CROSS_DESTDIR:Q}
+# XXX cross fortran
+.endif
+
# If the languages are not requested, force them not to be available
# in the generated wrappers.
#
diff --git a/mk/cwrappers.mk b/mk/cwrappers.mk
index 390b33eecf9..18b74c80741 100644
--- a/mk/cwrappers.mk
+++ b/mk/cwrappers.mk
@@ -1,11 +1,11 @@
-# $NetBSD: cwrappers.mk,v 1.35 2022/04/04 11:23:06 riastradh Exp $
+# $NetBSD: cwrappers.mk,v 1.36 2022/04/10 19:54:02 riastradh Exp $
#
# This Makefile fragment implements integration of pkgtools/cwrappers.
.include "../../mk/wrapper/wrapper-defs.mk"
.include "../../mk/buildlink3/bsd.buildlink3.mk"
-TOOL_DEPENDS+= cwrappers>=20220403:../../pkgtools/cwrappers
+TOOL_DEPENDS+= cwrappers>=20150314:../../pkgtools/cwrappers
# XXX This should be PREFIX, but USE_CROSSBASE overrides it.
CWRAPPERS_SRC_DIR= ${LOCALBASE}/libexec/cwrappers
@@ -101,9 +101,6 @@ generate-cwrappers:
. endfor
. endif
. endif
-. if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
- ${RUN}echo sysroot=${TOOLS_CROSS_DESTDIR:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}}
-. endif
.endfor
PREPEND_PATH+= ${WRAPPER_BINDIR}