summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
blob: be547543dd1033f034f0af09bc50322b293e89f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Let makefile find libz and zlib.h by CFLAGS and LDFLAGS.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Upstream-Status: Pending
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0f2ac72..f9099a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,7 +62,7 @@ AC_CHECK_PROG([RPM],   rpm,   rpm,   [], [$PATH])
 AC_CHECK_PROG([SED],   sed,   sed,   [], [$PATH])
 AC_CHECK_PROG([FIND],  find,  find,  [], [$PATH])
 
-AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS -lz"]))
+AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS $LDFLAGS -lz"]))
 
 dnl Find the default programs
 if test "with_default" != no ; then
@@ -176,7 +176,7 @@ fi
 dnl ---Output variables...
 
 CFLAGS="${CFLAGS:--O2} -Wall \$(CPPFLAGS)"
-HOST_CFLAGS="${HOST_CFLAGS:--O2} -Wall \$(HOST_CPPFLAGS)"
+HOST_CFLAGS="${HOST_CFLAGS:--O2} -Wall \$(HOST_CPPFLAGS) $CFLAGS"
 
 dnl TODO: figure out how to set these appropriately for compilers other than gcc
 I386_CFLAGS="$I386_CFLAGS -Os -ffreestanding -Wall -W -Wno-format \$(I386_CPPFLAGS)"
-- 
2.7.4