#!/bin/bash . ./scripts/colors.sh . ./scripts/funcs.sh . ./scripts/config.sh libnl() { pkgname=libnl pkgver=3.10.0 printf "$GREEN** Building and installing ${pkgname}\n$RESET" [ ! -d $build/${pkgname} ] && mkdir $build/${pkgname} cd $build/${pkgname} tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz check $? "Extract ${pkgname}" cd ${pkgname}-${pkgver} ./configure \ --host=${CROSS_COMPILE} \ --disable-debug \ --disable-static \ --disable-cli \ --build=x86_64-pc-linux-gnu \ --prefix=/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr check $? "Configure ${pkgname}" make $makeflags check $? "Build ${pkgname}" make DESTDIR=$(pwd)/bin install rm -rv $(pwd)/bin/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib/{pkgconfig,*.la} ${CROSS_COMPILE}-strip $(pwd)/bin/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib/* cd $(pwd)/bin/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib tar -czvf /tmp/${pkgname}.tar.gz . check $? "Archived libs" cd - cd $rootfspath/usr/lib tar -xvf /tmp/${pkgname}.tar.gz check $? "Unrchived libs" cd - }