blob: b3ca65e688402e1ba3bf1b61e9bb2e40eef5c78c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# this build system is mostly shared by attr and acl
2
3SRC_URI += "file://relative-libdir.patch;striplevel=0 \
4 "
5
6inherit autotools-brokensep gettext
7
8# the package comes with a custom config.h.in, it cannot be
9# overwritten by autoheader
10EXTRA_AUTORECONF += "--exclude=autoheader"
11EXTRA_OECONF = "INSTALL_USER=root INSTALL_GROUP=root"
12EXTRA_OECONF_append_class-native = " --enable-gettext=no"
Brad Bishop37a0e4d2017-12-04 01:01:44 -050013EXTRA_OECONF_append_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014
15EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}"
16
17do_install () {
18 oe_runmake install install-lib install-dev DIST_ROOT="${D}"
19}
20
Brad Bishop37a0e4d2017-12-04 01:01:44 -050021do_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 Williamsc124f4f2015-09-15 14:41:29 -050043PACKAGES =+ "lib${BPN}"
44
45FILES_lib${BPN} = "${base_libdir}/lib*${SOLIBS}"
46
47BBCLASSEXTEND = "native"
48# Only append ldflags for target recipe and if USE_NLS is enabled
49LDFLAGS_append_libc-uclibc_class-target = "${@['', ' -lintl '][(d.getVar('USE_NLS', True) == 'yes')]}"
50EXTRA_OECONF_append_libc-uclibc_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}"