blob: 03b3721ca8095ca2f05218400de0e586044f5977 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "Tools for performance analysis"
2HOMEPAGE = "http://lmbench.sourceforge.net/"
3SECTION = "console/utils"
4LICENSE = "GPLv2 & GPL-2.0-with-lmbench-restriction"
5LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
6 file://COPYING-2;md5=8e9aee2ccc75d61d107e43794a25cdf9"
7
8inherit autotools-brokensep
9
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010DEPENDS_append_libc-musl = " libtirpc"
11CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
12LDLIBS_append_libc-musl = " -ltirpc "
13
Patrick Williamsb48b7b42016-08-17 15:04:38 -050014PR = "r2"
15
16SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
17 file://lmbench-run \
18 file://rename-line-binary.patch \
19 file://update-results-script.patch \
20 file://obey-ranlib.patch \
21 file://update-config-script.patch \
22 file://use-base_libdir-instead-of-hardcoded-lib.patch \
23 file://lmbench_result_html_report.patch \
24 file://fix-lmbench-memory-check-failure.patch \
25 file://0001-avoid-gcc-optimize-away-the-loops.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050026 file://0001-lat_http.c-Add-printf-format.patch \
27 file://0001-Check-for-musl-define-guard-before-redefining-sockle.patch \
28 file://0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch \
29 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050030SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
31SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
32
33EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050034 LDFLAGS="${LDFLAGS}" LDLIBS="${LDLIBS}" LD="${LD}" OS="${TARGET_SYS}" \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050035 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
36
37do_configure() {
38 :
39}
40
41do_compile () {
Patrick Williamsddad1a12017-02-23 20:36:32 -060042 for CONFIG_SITE_ITEM in $CONFIG_SITE; do
43 . $CONFIG_SITE_ITEM
44 done
Patrick Williamsb48b7b42016-08-17 15:04:38 -050045 if [ X"$ac_cv_uint" = X"yes" ]; then
46 CFLAGS="${CFLAGS} -DHAVE_uint"
47 fi
48 install -d ${S}/bin/${TARGET_SYS}
49 oe_runmake -C src
50}
51
52do_install () {
53 install -d ${D}${sysconfdir}/default/volatiles \
54 ${D}${bindir} ${D}${mandir} ${D}${libdir}/lmbench \
55 ${D}${datadir}/lmbench/scripts
56
57 echo "d root root 0755 ${localstatedir}/run/${BPN} none" \
58 > ${D}${sysconfdir}/default/volatiles/99_lmbench
59 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
60 install -d ${D}${sysconfdir}/tmpfiles.d
61 echo "d /run/${BPN} - - - -" \
62 > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf
63 fi
64
65 oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \
66 -C src install
67 mv ${D}${bindir}/line ${D}${bindir}/lm_line
68 install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
69 sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \
70 -e 's,^BINDIR=.*$,BINDIR=${libdir}/${BPN},;' \
71 -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \
72 ${D}${bindir}/lmbench-run
73 install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
74 install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
75}
76
77pkg_postinst_${PN} () {
78 if [ -z "$D" ]; then
79 if command -v systemd-tmpfiles >/dev/null; then
80 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf
81 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
82 ${sysconfdir}/init.d/populate-volatile.sh update
83 fi
84 fi
85}
86
87RDEPENDS_${PN} = "perl"
88FILES_${PN} += "${datadir}/lmbench ${libdir}/lmbench"