Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # this build system is mostly shared by attr and acl |
| 2 | |
| 3 | SRC_URI += "file://relative-libdir.patch;striplevel=0 \ |
| 4 | " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | # This patch should be applied after '(attr\|acl)-Missing-configure.ac.patch' |
| 6 | SRC_URI_append = " file://0001-Added-configure-option-to-enable-disable-static-libr.patch" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | |
| 8 | inherit autotools-brokensep gettext |
| 9 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 10 | # When upstream is using automake properly, this can be removed |
| 11 | CLEANBROKEN = "1" |
| 12 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | # the package comes with a custom config.h.in, it cannot be |
| 14 | # overwritten by autoheader |
| 15 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 16 | EXTRA_OECONF = "INSTALL_USER=root INSTALL_GROUP=root" |
| 17 | EXTRA_OECONF_append_class-native = " --enable-gettext=no" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | EXTRA_OECONF_append_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS') == 'no')]}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
| 20 | EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}" |
| 21 | |
| 22 | do_install () { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 23 | oe_runmake install install-lib install-dev DIST_ROOT="${D}" ZIP="gzip -n" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | } |
| 25 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 26 | do_install_append_class-native () { |
| 27 | if test "${libdir}" = "${base_libdir}" ; then |
| 28 | return |
| 29 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 30 | librelpath=${@os.path.relpath(d.getVar('libdir'), d.getVar('base_libdir'))} |
| 31 | baselibrelpath=${@os.path.relpath(d.getVar('base_libdir'), d.getVar('libdir'))} |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 32 | |
| 33 | # Remove bad symlinks & create the correct symlinks |
| 34 | if test -L ${D}${libdir}/lib${BPN}.so ; then |
| 35 | rm -rf ${D}${libdir}/lib${BPN}.so |
| 36 | ln -sf $baselibrelpath/lib${BPN}.so ${D}${libdir}/lib${BPN}.so |
| 37 | fi |
| 38 | if test -L ${D}${base_libdir}/lib${BPN}.a ; then |
| 39 | rm -rf ${D}${base_libdir}/lib${BPN}.a |
| 40 | ln -sf $librelpath/lib${BPN}.a ${D}${base_libdir}/lib${BPN}.a |
| 41 | fi |
| 42 | if test -L ${D}${base_libdir}/lib${BPN}.la ; then |
| 43 | rm -rf ${D}${base_libdir}/lib${BPN}.la |
| 44 | ln -sf $librelpath/lib${BPN}.la ${D}${base_libdir}/lib${BPN}.la |
| 45 | fi |
| 46 | } |
| 47 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | PACKAGES =+ "lib${BPN}" |
| 49 | |
| 50 | FILES_lib${BPN} = "${base_libdir}/lib*${SOLIBS}" |
| 51 | |
| 52 | BBCLASSEXTEND = "native" |