selftest-hardlink.bb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
  2. LICENSE = "MIT"
  3. SRC_URI = "file://hello.c \
  4. file://gdb.sh \
  5. "
  6. S = "${UNPACKDIR}"
  7. do_compile () {
  8. ${CC} hello.c -o hello1 ${CFLAGS} ${LDFLAGS}
  9. ${CC} hello.c -c -o hello.o ${CFLAGS}
  10. ${AR} rcs libhello.a hello.o
  11. }
  12. do_install () {
  13. install -d ${D}${bindir}
  14. install -m 755 ${S}/gdb.sh ${D}${bindir}/
  15. install -m 755 hello1 ${D}${bindir}/hello1
  16. ln ${D}${bindir}/hello1 ${D}${bindir}/hello2
  17. install -d ${D}${libexecdir}
  18. ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello3
  19. ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello4
  20. # We need so many hardlink copies to look for specific race conditions
  21. install -d ${D}${libdir}
  22. install -m 0644 libhello.a ${D}${libdir}
  23. for num in `seq 1 100` ; do
  24. ln ${D}${libdir}/libhello.a ${D}${libdir}/libhello-${num}.a
  25. done
  26. dd if=/dev/zero of=${D}${bindir}/sparsetest bs=1 count=0 seek=1M
  27. }
  28. RDEPENDS:${PN}-gdb += "gdb"
  29. PACKAGES =+ "${PN}-gdb"
  30. FILES:${PN}-gdb = "${bindir}/gdb.sh"
  31. PACKAGE_STRIP_STATIC = "1"
  32. PACKAGE_DEBUG_STATIC_SPLIT = "1"