Bug 3547

Summary: mkelfimage-native: do_compile failed if host does not install libz
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Hongxu Jia <hongxu.jia>
Component: devtools / tool chainAssignee: Hongxu Jia <hongxu.jia>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bogdan.a.marinescu, kai.kang, liang.li2, liezhi.yang, meta.mr.watcher, meta.watcher, Qi.Chen, sgw, yi.zhao, zhenfeng.zhao
Version: 1.4   
Target Milestone: 1.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Hongxu Jia 2012-12-06 11:37:36 UTC
OS:Fedora 17
tree/branch: poky/master
commit 381c4b69c7e8b452f4d3de2f8214e6e5f6a9abe7

*problem
Compile mkelfimage-native failed if host does not 
install libz.
>>log<<
...
fatal error: zlib.h: No such file or directory
/usr/bin/ld: cannot find -lz
...

*analysis
If the host does not install libz, bitbake mkelfimage 
works well but mkelfimage-native failed, because
mkelfimage-native find libz from host dir, not from 
the staging directories.

*solution
1.Config LDFLAGS and LDFALGS_class-native in bb 
file to let mkelfimage and mkelfimage-native 
find libz and zlib.h from the staging directories.

2.Modify confiugre.ac to let makefile find libz 
and zlib.h by CFLAGS and LDFLAGS. Because the 
original Makefile don't make use of them.
Comment 2 liang li 2013-01-11 09:25:35 UTC
verified on git commit 66f4c8a674d9f8db958b13866af4d63ab8cbcd44