blob: d74c28f3f677d592c97097501a5a41cbf8448285 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "Tools for performance analysis"
2HOMEPAGE = "http://lmbench.sourceforge.net/"
3SECTION = "console/utils"
Andrew Geissler9aee5002022-03-30 16:27:02 +00004LICENSE = "GPL-2.0-only & GPL-2.0-with-lmbench-restriction"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05005LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
6 file://COPYING-2;md5=8e9aee2ccc75d61d107e43794a25cdf9"
7
Andrew Geisslerd688a012020-09-18 13:36:00 -05008inherit autotools-brokensep update-alternatives
Patrick Williamsb48b7b42016-08-17 15:04:38 -05009
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010DEPENDS += "libtirpc"
11CFLAGS += "-I${STAGING_INCDIR}/tirpc"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012
Patrick Williamsb48b7b42016-08-17 15:04:38 -050013PR = "r2"
14
15SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
16 file://lmbench-run \
17 file://rename-line-binary.patch \
18 file://update-results-script.patch \
19 file://obey-ranlib.patch \
20 file://update-config-script.patch \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050021 file://lmbench_result_html_report.patch \
22 file://fix-lmbench-memory-check-failure.patch \
23 file://0001-avoid-gcc-optimize-away-the-loops.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024 file://0001-lat_http.c-Add-printf-format.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050025 file://0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080026 file://0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch \
Andrew Geisslereef63862021-01-29 15:58:13 -060027 file://0001-lmbench-Point-webpage-lm-to-target-directory.patch \
28 file://0001-doc-Fix-typos-in-manual-pages.patch \
29 file://0001-lat_fifo-Fix-cleanup-sequence.patch \
Andrew Geissler97771a32021-03-05 15:23:11 -060030 file://0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050031 file://0001-bench.h-Fix-typo-in-specifying-string.h.patch \
32 file://0001-scripts-build-Fix-the-tests-to-build-with-clang15.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050033 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050034SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
35SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
36
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/lmbench/files/development/"
38UPSTREAM_CHECK_REGEX = "lmbench-(?P<pver>\d+(\.\d+)+-[a-z]+\d+)"
39
Andrew Geissler87f5cff2022-09-30 13:13:31 -050040export OS = "${TARGET_SYS}"
41export TARGET = "${TARGET_OS}"
42
Patrick Williamsb48b7b42016-08-17 15:04:38 -050043EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050044 LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050045 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
46
47do_configure() {
48 :
49}
50
51do_compile () {
Patrick Williamsddad1a12017-02-23 20:36:32 -060052 for CONFIG_SITE_ITEM in $CONFIG_SITE; do
53 . $CONFIG_SITE_ITEM
54 done
Patrick Williamsb48b7b42016-08-17 15:04:38 -050055 if [ X"$ac_cv_uint" = X"yes" ]; then
56 CFLAGS="${CFLAGS} -DHAVE_uint"
57 fi
58 install -d ${S}/bin/${TARGET_SYS}
Andrew Geissler87f5cff2022-09-30 13:13:31 -050059 ${S}/scripts/build
Patrick Williamsb48b7b42016-08-17 15:04:38 -050060}
61
62do_install () {
63 install -d ${D}${sysconfdir}/default/volatiles \
Brad Bishopc1d34332019-09-09 14:56:00 -040064 ${D}${bindir} ${D}${mandir} \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050065 ${D}${datadir}/lmbench/scripts
66
67 echo "d root root 0755 ${localstatedir}/run/${BPN} none" \
68 > ${D}${sysconfdir}/default/volatiles/99_lmbench
69 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
70 install -d ${D}${sysconfdir}/tmpfiles.d
71 echo "d /run/${BPN} - - - -" \
72 > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf
73 fi
74
75 oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080076 DESTDIR="${D}" \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050077 -C src install
78 mv ${D}${bindir}/line ${D}${bindir}/lm_line
79 install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
Andrew Geissler97771a32021-03-05 15:23:11 -060080 install -m 0755 ${S}/bin/${TARGET_SYS}/cache ${D}${bindir}/
Patrick Williamsb48b7b42016-08-17 15:04:38 -050081 sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050082 -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \
83 ${D}${bindir}/lmbench-run
84 install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
85 install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
Andrew Geisslereef63862021-01-29 15:58:13 -060086 install -m 0644 ${S}/src/webpage-lm.tar ${D}${datadir}/lmbench
Patrick Williamsb48b7b42016-08-17 15:04:38 -050087}
88
Patrick Williams213cb262021-08-07 19:21:33 -050089pkg_postinst:${PN} () {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050090 if [ -z "$D" ]; then
91 if command -v systemd-tmpfiles >/dev/null; then
92 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf
93 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
94 ${sysconfdir}/init.d/populate-volatile.sh update
95 fi
96 fi
97}
98
Patrick Williams213cb262021-08-07 19:21:33 -050099RDEPENDS:${PN} = "perl"
100FILES:${PN} += "${datadir}/lmbench"
Andrew Geisslerd688a012020-09-18 13:36:00 -0500101
Patrick Williams213cb262021-08-07 19:21:33 -0500102ALTERNATIVE:${PN} = "stream"
Andrew Geisslerd688a012020-09-18 13:36:00 -0500103ALTERNATIVE_LINK_NAME[stream] = "${bindir}/stream"
104