blob: e9217031375a0dd9075a2542ed37074af10e352b [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001SUMMARY = "Zlib Compression Library"
2DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
3library which is used by many different programs."
4HOMEPAGE = "http://zlib.net/"
5SECTION = "libs"
6LICENSE = "Zlib"
7LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
8
Patrick Williams03907ee2022-05-01 06:28:52 -05009SRC_URI = "https://zlib.net/${BP}.tar.xz \
10 file://cc.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011 file://ldflags-tests.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000012 file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013 file://run-ptest \
Patrick Williams03907ee2022-05-01 06:28:52 -050014 file://0001-Correct-incorrect-inputs-provided-to-the-CRC-functio.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015 "
16UPSTREAM_CHECK_URI = "http://zlib.net/"
17
Patrick Williams03907ee2022-05-01 06:28:52 -050018SRC_URI[sha256sum] = "7db46b8d7726232a621befaab4a1c870f00a90805511c0e0090441dac57def18"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019
20CFLAGS += "-D_REENTRANT"
21
Patrick Williams213cb262021-08-07 19:21:33 -050022RDEPENDS:${PN}-ptest += "make"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023
24inherit ptest
25
26do_configure() {
Brad Bishop19323692019-04-05 15:28:33 -040027 LDCONFIG=true ./configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU
Brad Bishop6e60e8b2018-02-01 10:27:11 -050028}
29
30do_compile() {
31 oe_runmake shared
32}
33
Brad Bishop6e60e8b2018-02-01 10:27:11 -050034do_install() {
35 oe_runmake DESTDIR=${D} install
36}
37
38do_install_ptest() {
Brad Bishop19323692019-04-05 15:28:33 -040039 install ${B}/examplesh ${D}${PTEST_PATH}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040}
41
42# Move zlib shared libraries for target builds to $base_libdir so the library
43# can be used in early boot before $prefix is mounted.
Patrick Williams213cb262021-08-07 19:21:33 -050044do_install:append:class-target() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045 if [ ${base_libdir} != ${libdir} ]
46 then
47 mkdir -p ${D}/${base_libdir}
48 mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
49 libname=`readlink ${D}/${libdir}/libz.so`
50 ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
51 fi
52}
53
54BBCLASSEXTEND = "native nativesdk"