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 | " |
| 5 | |
| 6 | inherit autotools-brokensep gettext |
| 7 | |
| 8 | # the package comes with a custom config.h.in, it cannot be |
| 9 | # overwritten by autoheader |
| 10 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 11 | EXTRA_OECONF = "INSTALL_USER=root INSTALL_GROUP=root" |
| 12 | EXTRA_OECONF_append_class-native = " --enable-gettext=no" |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 13 | EXTRA_OECONF_append_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
| 15 | EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}" |
| 16 | |
| 17 | do_install () { |
| 18 | oe_runmake install install-lib install-dev DIST_ROOT="${D}" |
| 19 | } |
| 20 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 21 | do_install_append_class-native () { |
| 22 | if test "${libdir}" = "${base_libdir}" ; then |
| 23 | return |
| 24 | fi |
| 25 | librelpath=${@os.path.relpath(d.getVar('libdir',True), d.getVar('base_libdir', True))} |
| 26 | baselibrelpath=${@os.path.relpath(d.getVar('base_libdir',True), d.getVar('libdir', True))} |
| 27 | |
| 28 | # Remove bad symlinks & create the correct symlinks |
| 29 | if test -L ${D}${libdir}/lib${BPN}.so ; then |
| 30 | rm -rf ${D}${libdir}/lib${BPN}.so |
| 31 | ln -sf $baselibrelpath/lib${BPN}.so ${D}${libdir}/lib${BPN}.so |
| 32 | fi |
| 33 | if test -L ${D}${base_libdir}/lib${BPN}.a ; then |
| 34 | rm -rf ${D}${base_libdir}/lib${BPN}.a |
| 35 | ln -sf $librelpath/lib${BPN}.a ${D}${base_libdir}/lib${BPN}.a |
| 36 | fi |
| 37 | if test -L ${D}${base_libdir}/lib${BPN}.la ; then |
| 38 | rm -rf ${D}${base_libdir}/lib${BPN}.la |
| 39 | ln -sf $librelpath/lib${BPN}.la ${D}${base_libdir}/lib${BPN}.la |
| 40 | fi |
| 41 | } |
| 42 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | PACKAGES =+ "lib${BPN}" |
| 44 | |
| 45 | FILES_lib${BPN} = "${base_libdir}/lib*${SOLIBS}" |
| 46 | |
| 47 | BBCLASSEXTEND = "native" |
| 48 | # Only append ldflags for target recipe and if USE_NLS is enabled |
| 49 | LDFLAGS_append_libc-uclibc_class-target = "${@['', ' -lintl '][(d.getVar('USE_NLS', True) == 'yes')]}" |
| 50 | EXTRA_OECONF_append_libc-uclibc_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}" |