# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have a recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
	${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "riscv-layer"
BBFILE_PATTERN_riscv-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_riscv-layer = "6"

BBFILES_DYNAMIC += " \
    virtualization-layer:${LAYERDIR}/dynamic-layers/virt-layer/*/*/*.bb \
    virtualization-layer:${LAYERDIR}/dynamic-layers/virt-layer/*/*/*.bbappend \
    openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bb \
    openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bbappend \
    gnome-layer:${LAYERDIR}/dynamic-layers/gnome-layer/*/*/*.bb \
    gnome-layer:${LAYERDIR}/dynamic-layers/gnome-layer/*/*/*.bbappend \
    multimedia-layer:${LAYERDIR}/dynamic-layers/multimedia-layer/*/*/*.bb \
    multimedia-layer:${LAYERDIR}/dynamic-layers/multimedia-layer/*/*/*.bbappend \
    \
"

LAYERSERIES_COMPAT_riscv-layer = "gatesgarth hardknott"

INSANE_SKIP_append_pn-cmocka_riscv64 = " textrel"
INSANE_SKIP_append_pn-eudev_riscv64 = " textrel"
INSANE_SKIP_append_pn-gdb_riscv64 = " textrel"
INSANE_SKIP_append_pn-perf_riscv64 = " textrel"
INSANE_SKIP_append_pn-qtbase_riscv64 = " textrel"
INSANE_SKIP_append_pn-qtbase-tools_riscv64 = " textrel"
INSANE_SKIP_append_pn-dracut_riscv64 = " textrel"
INSANE_SKIP_append_pn-qemu_riscv64 = " textrel"
INSANE_SKIP_append_pn-qemu-ptest_riscv64 = " textrel"
INSANE_SKIP_append_pn-rt-tests_riscv64 = " textrel"
INSANE_SKIP_append_pn-tvheadend_riscv64 = " textrel"
INSANE_SKIP_append_pn-tipcutils_riscv64 = " textrel"
INSANE_SKIP_append_pn-zabbix_riscv64 = " textrel"
INSANE_SKIP_append_pn-xfsdump_riscv64 = " textrel"
INSANE_SKIP_append_pn-capnproto_riscv64 = " textrel"
INSANE_SKIP_append_pn-monkey_riscv64 = " textrel"
INSANE_SKIP_append_pn-netdata_riscv64 = " textrel"
INSANE_SKIP_append_pn-ltp_riscv64 = " textrel"
INSANE_SKIP_append_pn-opensaf_riscv64 = " textrel"
INSANE_SKIP_append_pn-rdma-core_riscv64 = " textrel"
INSANE_SKIP_append_pn-util-linux_riscv64 = " textrel"
INSANE_SKIP_append_pn-doxygen_riscv64 = " textrel"
INSANE_SKIP_append_pn-poppler_riscv64 = " textrel"

INSANE_SKIP_append_pn-cmocka_riscv32 = " textrel"
INSANE_SKIP_append_pn-xfsdump_riscv32 = " textrel"
INSANE_SKIP_append_pn-zabbix_riscv32 = " textrel"
INSANE_SKIP_append_pn-netdata_riscv32 = " textrel"
INSANE_SKIP_append_pn-tipcutils_riscv32 = " textrel"
INSANE_SKIP_append_pn-tvheadend_riscv32 = " textrel"
INSANE_SKIP_append_pn-monkey_riscv32 = " textrel"
INSANE_SKIP_append_pn-eudev_riscv32 = " textrel"
INSANE_SKIP_append_pn-dracut_riscv32 = " textrel"
INSANE_SKIP_append_pn-rt-tests_riscv32 = " textrel"
INSANE_SKIP_append_pn-gdb_riscv32 = " textrel"
INSANE_SKIP_append_pn-capnproto_riscv32 = " textrel"
INSANE_SKIP_append_pn-rdma-core_riscv32 = " textrel"
INSANE_SKIP_append_pn-util-linux_riscv32 = " textrel"
INSANE_SKIP_append_pn-ltp_riscv32 = " textrel"
INSANE_SKIP_append_pn-poppler_riscv32 = " textrel"
INSANE_SKIP_append_pn-qtbase_riscv32 = " textrel"
INSANE_SKIP_append_pn-gerbera_riscv32 = " textrel"
INSANE_SKIP_append_pn-opensaf_riscv32 = " textrel"
INSANE_SKIP_append_pn-doxygen_riscv32 = " textrel"
INSANE_SKIP_append_pn-opengl-es-cts_riscv32 = " textrel"
INSANE_SKIP_append_pn-perf_riscv32 = " textrel"

# These recipe dont _yet_ build for rv32
COMPATIBLE_HOST_pn-openh264_riscv32 = "null"
# Need to port - tcf/cpudefs-mdep.h
COMPATIBLE_HOST_pn-tcf-agent_riscv32 = "null"
# needs SYS_ppoll and SYS_pselect6
COMPATIBLE_HOST_pn-lttng-tools_riscv32 = "null"
# LTTng-modules requires CONFIG_KPROBES on kernels >= 5.7.0
COMPATIBLE_HOST_pn-lttng-modules_riscv32 = "null"
# Needs porting to rv32
COMPATIBLE_HOST_pn-android-tools_riscv32 = "null"
# Needs porting to rv32
COMPATIBLE_HOST_pn-strace_riscv32 = "null"
COMPATIBLE_HOST_pn-ostree_riscv32 = "null"
# Klibc needs porting in usr/klibc/arch/riscv32
COMPATIBLE_HOST_pn-klibc_riscv32 = "null"
COMPATIBLE_HOST_pn-klibc-static-utils_riscv32 = "null"
COMPATIBLE_HOST_pn-klibc-utils_riscv32 = "null"
COMPATIBLE_HOST_pn-klcc-cross_riscv32 = "null"
COMPATIBLE_HOST_pn-kexecboot-klibc_riscv32 = "null"
COMPATIBLE_HOST_pn-ubi-utils-klibc_riscv32 = "null"

# needs syscalls addressed for rv32
COMPATIBLE_HOST_pn-qemu_riscv32 = "null"
# Fails to configure
COMPATIBLE_HOST_pn-samba_riscv32 = "null"
COMPATIBLE_HOST_pn-smbnetfs_riscv32 = "null"
COMPATIBLE_HOST_pn-gnome-control-center_riscv32 = "null"
COMPATIBLE_HOST_pn-thunar-shares-plugin_riscv32 = "null"

# sipe-mime.c:129:30: error: cast from 'GTypeInstance *' (aka 'struct _GTypeInstance *') to 'GMimeStreamFilter *' (aka 'struct _GMimeStreamFilter *') increases required al ignment from 4 to 8 [-Werror,-Wcast-align]
COMPATIBLE_HOST_pn-pidgin-sipe_riscv32 = "null"

COMPATIBLE_HOST_pn-libacpi = '(x86_64|i.86|riscv32|riscv64).*-(linux|freebsd.*)'
COMPATIBLE_HOST_pn-efivar = "(i.86|x86_64|arm|aarch64|riscv64|riscv32).*-linux"
COMPATIBLE_HOST_pn-efibootmgr = "(i.86|x86_64|arm|aarch64|riscv64|riscv32).*-linux"
COMPATIBLE_HOST_pn-dmidecode = "(i.86|x86_64|aarch64|arm|powerpc|powerpc64|riscv32|riscv64).*-linux"
COMPATIBLE_HOST_pn-acpica = "(i.86|x86_64|arm|aarch64|riscv64|riscv32).*-linux"
COMPATIBLE_HOST_pn-systemd = "(x86_64.*|i.86.*|riscv.*)-linux"
