On Mon, 31 May 2021, Quentin Schulz wrote: > Hi Robert, > > On Fri, May 28, 2021 at 05:02:13PM -0400, Robert P. J. Day wrote: > > On Fri, 28 May 2021, Quentin Schulz wrote: > > > > ... big snip ... > > > > > ${B} = ${S} by default, so that might explain why it works without > > > externalsrc being inherited. > > > > > > You can see in the makefile that this is assumed. Only the install tasks > > > are installing somewhere else (DESTDIR), c.f. > > > https://git.savannah.nongnu.org/cgit/dmidecode.git/tree/Makefile > > > > > > So yes, except if you patch the Makefile to support out-of-tree build, > > > you would need both EXTERNALSRC and EXTERNALSRC_BUILD set to the same > > > value. > > > > > > Maybe a Cmake example would suit better since B is set to > > > "${WORKDIR}/build" > > > by default? > > > > > > Otherwise, write a proper Makefile that allows out-of-tree builds for > > > the example :) > > > > in the end, i suspect i was overthinking it, thinking somehow there > > was some magic to "externalsrc", only to finally realize it was > > totally inappropriate for source that had to be built in-tree. so i > > just switched over to using SRC_URI and, for various recipes like > > dmidecode, i created a recipe that started with some variation of: > > > > LICENSE = "CLOSED" > > LIC_FILES_CHKSUM = "" > > FILESEXTRAPATHS_prepend := "${THISDIR}:" > > SRC_URI := "file://src" > > No need for := here, a simple = should suffice?
yup, i already simplified that, even though it doesn't hurt anything. > > S = "${WORKDIR}/src" > > > > Why not put the sources in: > meta-mylayer/recipes-test/test/my-test-0.1/src/ > meta-mylayer/recipes-test/test/my-test_0.1.bb > > and have SRC_URI = "file://src/" without needing to add > FILESEXTRAPATHS_prepend := "${THISDIR}:" so that it follows what > almost every recipe does? > > S will be as you wrote above. i know it looks goofy, but these recipes are just meant to be templates to show other developers what a normal Makefile-based recipe will look like, and if they have their source elsewhere, they'll have to set FILESEXTRAPATHS anyway. i was grappling with how to do this, but this is not meant to be production-level, it's just for people to see how to structure their code so it follows the OE model. i might re-do it. > I thought you were trying to find an example with externalsrc for > our docs, but it seems you have a different thing in mind, can you > tell us so we are able to help you with your actual issue/question > :) ? externalsrc turned out to have the fatal flaw that it doesn't scale well for source that can't be built out-of-tree. rday
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#152462): https://lists.openembedded.org/g/openembedded-core/message/152462 Mute This Topic: https://lists.openembedded.org/mt/83147632/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-