From e473b9341d8a27e8bf6555852e485af8363c3399 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 14 Mar 2023 10:57:26 +0100 Subject: [PATCH] ti-calibrator-wl18xx: Add support for normal libnl Make the recipe buildable using either libnl or libnl-tiny, depending on packageconfig, so that each distro can choose. id:376256 (cherry picked from commit 098d75b21fb8a6d1bdf2be381073db34573d1f91) --- ...1-Makefile-Make-buildable-from-yocto.patch | 31 ++++++++++++++++ .../ti-calibrator-wl18xx_git.bb | 35 ++++++++----------- 2 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx/0001-Makefile-Make-buildable-from-yocto.patch diff --git a/recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx/0001-Makefile-Make-buildable-from-yocto.patch b/recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx/0001-Makefile-Make-buildable-from-yocto.patch new file mode 100644 index 0000000..5af48a0 --- /dev/null +++ b/recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx/0001-Makefile-Make-buildable-from-yocto.patch @@ -0,0 +1,31 @@ +From 8b599149801f6f45c1c406f594bba594bacd7b79 Mon Sep 17 00:00:00 2001 +From: Alexandre Bard +Date: Tue, 14 Mar 2023 10:30:02 +0100 +Subject: [PATCH] Makefile: Make buildable from yocto + +We want to use CC and CFLAGS given by yocto + +NFSROOT is undefined and uneeded +--- + Makefile | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 3439637..570434a 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,12 +1,10 @@ +-CC = $(CROSS_COMPILE)gcc +-CFLAGS = -O2 -Wall +-CFLAGS += -I$(NFSROOT)/usr/include -I$(NFSROOT)/include ++CC ?= $(CROSS_COMPILE)gcc ++CFLAGS ?= -O2 -Wall + + ifdef NLROOT + CFLAGS += -I${NLROOT} + endif + +-LDFLAGS += -L$(NFSROOT)/lib + LIBS += -lm + + ifeq ($(NLVER),3) diff --git a/recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx_git.bb b/recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx_git.bb index f0f43fd..e0918b5 100644 --- a/recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx_git.bb +++ b/recipes-testing/ti-calibrator-wl18xx/ti-calibrator-wl18xx_git.bb @@ -7,38 +7,31 @@ SRC_URI = "git://git.ti.com/git/wilink8-wlan/18xx-ti-utils.git;protocol=http \ file://wgod-ng \ file://btgod-ng \ file://0001-FIX-port-to-OE.patch \ + file://0001-Makefile-Make-buildable-from-yocto.patch \ " PV = "1.0+git${SRCPV}" SRCREV = "87af888fe6f7b8fa5926a38a752f65451afe5f24" -inherit pkgconfig - S = "${WORKDIR}/git" -DEPENDS = "libnl-tiny" +PACKAGECONFIG ?= "libnl-tiny" -LDFLAGS += " -Wl,--gc-sections -flto" +PACKAGECONFIG[libnl] = ",,libnl,," +PACKAGECONFIG[libnl-tiny] = ",,libnl-tiny,," -export CROSS_COMPILE = "${TARGET_PREFIX}" +# Special handling for libnl-tiny +OVERRIDES_append = ":${@bb.utils.contains("PACKAGECONFIG", "libnl-tiny", "libnl-tiny", "", d)}" -EXTRA_OEMAKE = " \ - CFLAGS="${CFLAGS} -I${STAGING_DIR_TARGET}/usr/include/libnl-tiny -DCONFIG_LIBNL20 -D_GNU_SOURCE -DCONFIG_LIBNL_TINY -ffunction-sections -fdata-sections" \ - LDFLAGS="${LDFLAGS} -L${STAGING_LIBDIR} -Wl,--gc-sections -flto" \ - LIBS="${LIBS} -lnl-tiny" \ - CC="${CC}" \ - NLVER=2" \ - NL1FOUND="" NL2FOUND=Y \ - NLLIBNAME="libnl-tiny" +EXTRA_OEMAKE = "NLVER=3" +EXTRA_OEMAKE_libnl-tiny = "NLVER=2 LIBS="-lnl-tiny"" -#export EXTRA_OEMAKE = " \ -# ${CFLAGS} \ -# -I${STAGING_DIR_TARGET}/usr/include/libnl-tiny \ -# -lnl-tiny \ -# -DCONFIG_LIBNL20 \ -# -DCONFIG_LIBNL_TINY \ -# -D_GNU_SOURCE \ -#" +LIBNL_INCDIR = "libnl3" +LIBNL_INCDIR_libnl-tiny = "libnl-tiny" + +CFLAGS += "-I${STAGING_INCDIR}/${LIBNL_INCDIR} \ + -D_GNU_SOURCE \ +" do_install () { install -d ${D}${bindir}