add libtalloc and its dependency waf-samba.bbclass

This also adds libtalloc-dev to the SDK, which is a first step to
upgrading libosmocore to a 'post external talloc' version.
This commit is contained in:
Harald Welte 2016-02-23 12:22:19 +01:00
parent e274f00fa9
commit aa458a136e
4 changed files with 116 additions and 0 deletions

54
classes/waf-samba.bbclass Normal file
View File

@ -0,0 +1,54 @@
# waf is a build system which is used by samba related project.
# Obtain details from https://wiki.samba.org/index.php/Waf
#
inherit qemu pythonnative
DEPENDS += "qemu-native python"
CONFIGUREOPTS = " --prefix=${prefix} \
--bindir=${bindir} \
--sbindir=${sbindir} \
--libexecdir=${libexecdir} \
--datadir=${datadir} \
--sysconfdir=${sysconfdir} \
--sharedstatedir=${sharedstatedir} \
--localstatedir=${localstatedir} \
--libdir=${libdir} \
--includedir=${includedir} \
--oldincludedir=${oldincludedir} \
--infodir=${infodir} \
--mandir=${mandir} \
"
do_configure() {
qemu_binary="${@qemu_target_binary(d)}"
if [ "${qemu_binary}" = "qemu-allarch" ]; then
qemu_binary="qemuwrapper"
fi
libdir_qemu="${STAGING_DIR_HOST}/${libdir}"
base_libdir_qemu="${STAGING_DIR_HOST}/${base_libdir}"
CROSS_EXEC="${qemu_binary} \
${QEMU_OPTIONS} \
-L ${STAGING_DIR_HOST} \
-E LD_LIBRARY_PATH=${libdir_qemu}:${base_libdir_qemu}"
export BUILD_SYS=${BUILD_SYS}
export HOST_SYS=${HOST_SYS}
export BUILD_ARCH=${BUILD_ARCH}
export HOST_ARCH=${HOST_ARCH}
export STAGING_LIBDIR=${STAGING_LIBDIR}
export STAGING_INCDIR=${STAGING_INCDIR}
export PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
./configure ${CONFIGUREOPTS} ${EXTRA_OECONF} --cross-compile --cross-execute="${CROSS_EXEC}"
}
do_compile () {
python ./buildtools/bin/waf ${PARALLEL_MAKE}
}
do_install() {
oe_runmake install DESTDIR=${D}
}

View File

@ -1,4 +1,5 @@
SDK-OSMO = " \
libtalloc-dev \
libosmocore-dev \
libosmo-sccp-staticdev \
libosmo-abis-dev \

View File

@ -0,0 +1,20 @@
--- a/lib/replace/wscript 2015-11-13 16:04:04.000000000 +0100
+++ b/lib/replace/wscript 2015-11-13 16:23:20.000000000 +0100
@@ -636,8 +636,6 @@
if not bld.CONFIG_SET('HAVE_INET_ATON'): REPLACE_SOURCE += ' inet_aton.c'
if not bld.CONFIG_SET('HAVE_INET_NTOP'): REPLACE_SOURCE += ' inet_ntop.c'
if not bld.CONFIG_SET('HAVE_INET_PTON'): REPLACE_SOURCE += ' inet_pton.c'
- if not bld.CONFIG_SET('HAVE_GETXATTR') or bld.CONFIG_SET('XATTR_ADDITIONAL_OPTIONS'):
- REPLACE_SOURCE += ' xattr.c'
bld.SAMBA_LIBRARY('replace',
source=REPLACE_SOURCE,
@@ -648,7 +646,7 @@
# at the moment:
# hide_symbols=bld.BUILTIN_LIBRARY('replace'),
private_library=True,
- deps='crypt dl nsl socket rt attr' + extra_libs)
+ deps='crypt dl nsl socket rt ' + extra_libs)
bld.SAMBA_SUBSYSTEM('replace-test',
source='''test/testsuite.c test/strptime.c

View File

@ -0,0 +1,41 @@
SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
HOMEPAGE = "http://talloc.samba.org"
SECTION = "libs"
LICENSE = "LGPL-3.0+ & GPL-3.0+"
DEPENDS += "libbsd"
SRC_URI = "http://samba.org/ftp/talloc/talloc-${PV}.tar.gz"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
file://${COREBASE}/meta/files/common-licenses/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"
SRC_URI[md5sum] = "3e285de2228ae67ff0a0f5cec658f627"
SRC_URI[sha256sum] = "7aa5f75b22d4ef9c737b25515f2a2837ddc13014ff4ac6e58dd9e311f41f2cb0"
inherit waf-samba
PACKAGECONFIG[attr] = ",,attr"
SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}"
S = "${WORKDIR}/talloc-${PV}"
EXTRA_OECONF += "--disable-rpath \
--disable-rpath-install \
--bundled-libraries=NONE \
--builtin-libraries=replace \
--disable-silent-rules \
--with-libiconv=${STAGING_DIR_HOST}${prefix}\
"
DISABLE_STATIC = ""
PACKAGES += "pytalloc pytalloc-dbg pytalloc-dev"
FILES_pytalloc = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
${libdir}/libpytalloc-util.so.2 \
${libdir}/libpytalloc-util.so.2.1.1 \
"
FILES_pytalloc-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
${libdir}/.debug/libpytalloc-util.so.2.1.1"
FILES_pytalloc-dev = "${libdir}/libpytalloc-util.so"
RDEPENDS_pytalloc = "python"