diff mbox series

[meta-swupdate,v2] swupdate: Set build flags

Message ID 20200728165208.17677-1-JPEWhacker@gmail.com
State Accepted
Headers show
Series [meta-swupdate,v2] swupdate: Set build flags | expand

Commit Message

Joshua Watt July 28, 2020, 4:52 p.m. UTC
Sets the recipe build flags in the default configuration file. This
ensures that swupdate is correctly compiled with the flags that are set
by build, for example ensuring that debug symbols are present.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 recipes-support/swupdate/swupdate.inc       | 7 ++++++-
 recipes-support/swupdate/swupdate/defconfig | 2 --
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Stefano Babic July 29, 2020, 1:45 p.m. UTC | #1
Hi Joshua,

On 28.07.20 18:52, Joshua Watt wrote:
> Sets the recipe build flags in the default configuration file. This
> ensures that swupdate is correctly compiled with the flags that are set
> by build, for example ensuring that debug symbols are present.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  recipes-support/swupdate/swupdate.inc       | 7 ++++++-
>  recipes-support/swupdate/swupdate/defconfig | 2 --
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
> index b65fb86..94da375 100644
> --- a/recipes-support/swupdate/swupdate.inc
> +++ b/recipes-support/swupdate/swupdate.inc
> @@ -191,7 +191,12 @@ python () {
>  }
>  
>  do_configure () {
> -    cp ${WORKDIR}/defconfig ${WORKDIR}/.config
> +    cat > ${WORKDIR}/.config <<HEREDOC
> +CONFIG_EXTRA_CFLAGS="${CFLAGS}"
> +CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
> +HEREDOC
> +    cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
> +
>      merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))}
>      (cd ${S} && cml1_do_configure)
>  }
> diff --git a/recipes-support/swupdate/swupdate/defconfig b/recipes-support/swupdate/swupdate/defconfig
> index b9b1b7a..ca4afa8 100644
> --- a/recipes-support/swupdate/swupdate/defconfig
> +++ b/recipes-support/swupdate/swupdate/defconfig
> @@ -36,8 +36,6 @@ CONFIG_LUAPKG="lua"
>  #
>  CONFIG_CROSS_COMPILE=""
>  CONFIG_SYSROOT=""
> -CONFIG_EXTRA_CFLAGS=""
> -CONFIG_EXTRA_LDFLAGS=""
>  CONFIG_EXTRA_LDLIBS=""
>  
>  #

I do not see issues doing this.

Reviewed-by : Stefano Babic <sbabic@denx.de>

Regards,
Stefano Babic
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index b65fb86..94da375 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -191,7 +191,12 @@  python () {
 }
 
 do_configure () {
-    cp ${WORKDIR}/defconfig ${WORKDIR}/.config
+    cat > ${WORKDIR}/.config <<HEREDOC
+CONFIG_EXTRA_CFLAGS="${CFLAGS}"
+CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
+HEREDOC
+    cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
+
     merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))}
     (cd ${S} && cml1_do_configure)
 }
diff --git a/recipes-support/swupdate/swupdate/defconfig b/recipes-support/swupdate/swupdate/defconfig
index b9b1b7a..ca4afa8 100644
--- a/recipes-support/swupdate/swupdate/defconfig
+++ b/recipes-support/swupdate/swupdate/defconfig
@@ -36,8 +36,6 @@  CONFIG_LUAPKG="lua"
 #
 CONFIG_CROSS_COMPILE=""
 CONFIG_SYSROOT=""
-CONFIG_EXTRA_CFLAGS=""
-CONFIG_EXTRA_LDFLAGS=""
 CONFIG_EXTRA_LDLIBS=""
 
 #