diff mbox series

[meta-oe,mickledore,15/36] libmad: Add a patch to pass cflags to build

Message ID 20230531111309.2454603-15-akuster808@gmail.com
State New
Headers show
Series [meta-oe,mickledore,01/36] libencode-perl: Remove buildpaths from generated .exh files | expand

Commit Message

akuster808 May 31, 2023, 11:12 a.m. UTC
From: Khem Raj <raj.khem@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 0474e0b8705ee2048e92ed5874b83b2535dc9cd2)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 ...-Respect-the-cflags-from-environment.patch | 47 +++++++++++++++++++
 .../libmad/libmad_0.15.1b.bb                  |  1 +
 2 files changed, 48 insertions(+)
 create mode 100644 meta-oe/recipes-multimedia/libmad/libmad/0001-configure-Respect-the-cflags-from-environment.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-multimedia/libmad/libmad/0001-configure-Respect-the-cflags-from-environment.patch b/meta-oe/recipes-multimedia/libmad/libmad/0001-configure-Respect-the-cflags-from-environment.patch
new file mode 100644
index 0000000000..586782a348
--- /dev/null
+++ b/meta-oe/recipes-multimedia/libmad/libmad/0001-configure-Respect-the-cflags-from-environment.patch
@@ -0,0 +1,47 @@ 
+From 26342d1c775205f661f5cf005b7e054a04f5d32e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 16 May 2023 10:14:57 -0700
+Subject: [PATCH] configure: Respect the cflags from environment
+
+This is needed with OE like cross-build envs where certain important
+flags maybe passed as global policy to aid cross compiling or
+reproducibility etc.
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,12 +73,9 @@ debug=""
+ optimize=""
+ profile=""
+ 
+-set -- $CFLAGS
+-CFLAGS=""
+-
+ if test "$GCC" = yes
+ then
+-    CFLAGS="-Wall"
++    CFLAGS="$CFLAGS -Wall"
+ fi
+ 
+ while test $# -gt 0
+@@ -115,10 +112,13 @@ do
+ 	    optimize="$optimize $1"
+ 	    shift
+ 	    ;;
+-	*)
++	-*)
+ 	    CFLAGS="$CFLAGS $1"
+ 	    shift
+ 	    ;;
++	*)
++	    shift
++	    ;;
+     esac
+ done
+ 
diff --git a/meta-oe/recipes-multimedia/libmad/libmad_0.15.1b.bb b/meta-oe/recipes-multimedia/libmad/libmad_0.15.1b.bb
index d3ac85ee0b..5b089a0b33 100644
--- a/meta-oe/recipes-multimedia/libmad/libmad_0.15.1b.bb
+++ b/meta-oe/recipes-multimedia/libmad/libmad_0.15.1b.bb
@@ -16,6 +16,7 @@  SRC_URI = "ftp://ftp.mars.org/pub/mpeg/libmad-${PV}.tar.gz \
     file://fix_for_mips_with_gcc-4.5.0.patch \
     file://obsolete_automake_macros.patch \
     file://automake-foreign.patch \
+    file://0001-configure-Respect-the-cflags-from-environment.patch \
 "
 SRC_URI:append:toolchain-clang = " file://0004-Remove-clang-unsupported-compiler-flags.patch "