pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/devel/meson
Module Name: pkgsrc
Committed By: riastradh
Date: Sun Apr 3 23:49:19 UTC 2022
Modified Files:
pkgsrc/devel/meson: build.mk
Log Message:
meson: Add support for cross-compilation.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 pkgsrc/devel/meson/build.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/devel/meson/build.mk
diff -u pkgsrc/devel/meson/build.mk:1.13 pkgsrc/devel/meson/build.mk:1.14
--- pkgsrc/devel/meson/build.mk:1.13 Sun Aug 15 11:50:03 2021
+++ pkgsrc/devel/meson/build.mk Sun Apr 3 23:49:19 2022
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.13 2021/08/15 11:50:03 rillig Exp $
+# $NetBSD: build.mk,v 1.14 2022/04/03 23:49:19 riastradh Exp $
MESON_REQD?= 0
.for version in ${MESON_REQD}
@@ -21,6 +21,96 @@ MAKE_ENV+= LLVM_CONFIG_PATH=${LLVM_CONFI
MAKE_ENV+= CMAKE=${TOOLS_PATH.false}
.endif
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+
+MESON_CPU_FAMILY.amd64= x86_64
+MESON_CPU_FAMILY.arm26?= arm
+MESON_CPU_FAMILY.arm32?= arm
+MESON_CPU_FAMILY.earm?= arm
+MESON_CPU_FAMILY.earmeb?= arm
+MESON_CPU_FAMILY.earmhf?= arm
+MESON_CPU_FAMILY.earmhfeb?= arm
+MESON_CPU_FAMILY.earmv4?= arm
+MESON_CPU_FAMILY.earmv4eb?= arm
+MESON_CPU_FAMILY.earmv5?= arm
+MESON_CPU_FAMILY.earmv5eb?= arm
+MESON_CPU_FAMILY.earmv6?= arm
+MESON_CPU_FAMILY.earmv6eb?= arm
+MESON_CPU_FAMILY.earmv6hf?= arm
+MESON_CPU_FAMILY.earmv6hfeb?= arm
+MESON_CPU_FAMILY.earmv7?= arm
+MESON_CPU_FAMILY.earmv7eb?= arm
+MESON_CPU_FAMILY.earmv7hf?= arm
+MESON_CPU_FAMILY.earmv7hfeb?= arm
+MESON_CPU_FAMILY.i386= x86
+MESON_CPU_FAMILY.i486= x86
+MESON_CPU_FAMILY.i586= x86
+MESON_CPU_FAMILY.i686= x86
+MESON_CPU_FAMILY.hppa= parisc
+MESON_CPU_FAMILY.m68000= m68k
+MESON_CPU_FAMILY.mips64eb= mips
+MESON_CPU_FAMILY.mips64el= mips
+MESON_CPU_FAMILY.mipseb= mips
+MESON_CPU_FAMILY.mipsel= mips
+MESON_CPU_FAMILY.powerpc64= ppc64
+MESON_CPU_FAMILY.powerpc= ppc
+MESON_CPU_FAMILY.sh3eb= sh3
+MESON_CPU_FAMILY.sh3el= sh3
+
+MESON_CPU_ENDIAN.earmeb?= big
+MESON_CPU_ENDIAN.earmhfeb?= big
+MESON_CPU_ENDIAN.earmv4eb?= big
+MESON_CPU_ENDIAN.earmv5eb?= big
+MESON_CPU_ENDIAN.earmv6eb?= big
+MESON_CPU_ENDIAN.earmv6hfeb?= big
+MESON_CPU_ENDIAN.earmv7eb?= big
+MESON_CPU_ENDIAN.earmv7hfeb?= big
+MESON_CPU_ENDIAN.mips64eb= big
+MESON_CPU_ENDIAN.mipseb= big
+MESON_CPU_ENDIAN.powerpc64= big
+MESON_CPU_ENDIAN.powerpc= big
+MESON_CPU_ENDIAN.sh3eb= big
+MESON_CPU_ENDIAN.sparc64= big
+MESON_CPU_ENDIAN.sparc= big
+
+MESON_CPU_FAMILY= ${MESON_CPU_FAMILY.${MACHINE_ARCH}:U${MACHINE_ARCH}}
+MESON_CPU= ${MACHINE_ARCH}
+MESON_CPU_ENDIAN= ${MESON_CPU_ENDIAN.${MACHINE_ARCH}:Ulittle}
+
+MESON_CROSS_VARS+= sys_root
+MESON_CROSS.sys_root= '${_CROSS_DESTDIR}'
+
+MESON_CROSS_FILE= ${WRKDIR}/.meson_cross
+meson-configure: ${MESON_CROSS_FILE}
+${MESON_CROSS_FILE}:
+ ${RUN}${ECHO} '[properties]' >$@.tmp
+.for _v_ in ${MESON_CROSS_VARS}
+.if defined(MESON_CROSS.${_v_})
+ ${RUN}${ECHO} ${_v_} = ${MESON_CROSS.${_v_}:Q} >>$@.tmp
+.endif
+.endfor
+.for _v_ in ${MESON_CROSS_OPSYS_VARS}
+.if defined(MESON_CROSS.${OPSYS}.${_v_})
+ ${RUN}${ECHO} ${_v_} = ${MESON_CROSS.${OPSYS}.${_v_}:Q} >>$@.tmp
+.endif
+.endfor
+.for _v_ in ${MESON_CROSS_ARCH_VARS}
+.if defined(MESON_CROSS.${MACHINE_ARCH}.${_v_})
+ ${RUN}${ECHO} ${_v_} = ${MESON_CROSS.${MACHINE_ARCH}.${_v_}:Q} >>$@.tmp
+.endif
+.endfor
+ ${RUN}${ECHO} '[host_machine]' >>$@.tmp
+ ${RUN}${ECHO} "system = '${LOWER_OPSYS}'" >>$@.tmp
+ ${RUN}${ECHO} "cpu_family = '${MESON_CPU_FAMILY}'" >>$@.tmp
+ ${RUN}${ECHO} "cpu = '${MESON_CPU}'" >>$@.tmp
+ ${RUN}${ECHO} "endian = '${MESON_CPU_ENDIAN}'" >>$@.tmp
+ ${RUN}${MV} -f $@.tmp $@
+MESON_CROSS_ARGS+= --cross-file ${MESON_CROSS_FILE:Q}
+
+.endif
+
do-configure: meson-configure
meson-configure:
.for d in ${CONFIGURE_DIRS}
@@ -30,6 +120,7 @@ meson-configure:
--libexecdir libexec \
--mandir ${PKGMANDIR} \
--sysconfdir ${PKG_SYSCONFDIR} \
+ ${MESON_CROSS_ARGS} \
--buildtype=plain ${MESON_ARGS} . output
.endfor
Home |
Main Index |
Thread Index |
Old Index