Skip to content
Permalink
Browse files

config/functions: factor out pkg-config setup into functions

Signed-off-by: Matthias Reichl <hias@horus.com>
  • Loading branch information...
HiassofT authored and adamg88 committed Apr 2, 2019
1 parent bcd6369 commit c67dce63afda804759e2c05c0e33fcb16be21560
Showing with 20 additions and 12 deletions.
  1. +20 −12 config/functions
@@ -161,6 +161,24 @@ flag_enabled() {
fi
}

setup_pkg_config_target() {
export PKG_CONFIG="$TOOLCHAIN/bin/pkg-config"
export PKG_CONFIG_PATH=""
export PKG_CONFIG_LIBDIR="$SYSROOT_PREFIX/usr/lib/pkgconfig:$SYSROOT_PREFIX/usr/share/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="$SYSROOT_PREFIX"
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
}

setup_pkg_config_host() {
export PKG_CONFIG="$TOOLCHAIN/bin/pkg-config"
export PKG_CONFIG_PATH=""
export PKG_CONFIG_LIBDIR="$TOOLCHAIN/lib/pkgconfig:$TOOLCHAIN/share/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR=""
unset PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
unset PKG_CONFIG_ALLOW_SYSTEM_LIBS
}

setup_toolchain() {
if [ "$LTO_SUPPORT" = "yes" ]; then
if flag_enabled "lto-parallel" "no"; then
@@ -242,12 +260,7 @@ setup_toolchain() {
export CFLAGS="$TARGET_CFLAGS"
export CXXFLAGS="$TARGET_CXXFLAGS"
export LDFLAGS="$TARGET_LDFLAGS"
export PKG_CONFIG="$TOOLCHAIN/bin/pkg-config"
export PKG_CONFIG_PATH=""
export PKG_CONFIG_LIBDIR="$SYSROOT_PREFIX/usr/lib/pkgconfig:$SYSROOT_PREFIX/usr/share/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="$SYSROOT_PREFIX"
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
setup_pkg_config_target
export CMAKE_CONF=$TOOLCHAIN/etc/cmake-$TARGET_NAME.conf
export CMAKE="cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF -DCMAKE_INSTALL_PREFIX=/usr"
if [ ! -f $CMAKE_CONF ] ; then
@@ -294,12 +307,7 @@ setup_toolchain() {
export CFLAGS="$HOST_CFLAGS"
export CXXFLAGS="$HOST_CXXFLAGS"
export LDFLAGS="$HOST_LDFLAGS"
export PKG_CONFIG="$TOOLCHAIN/bin/pkg-config"
export PKG_CONFIG_PATH=""
export PKG_CONFIG_LIBDIR="$TOOLCHAIN/lib/pkgconfig:$TOOLCHAIN/share/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR=""
unset PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
unset PKG_CONFIG_ALLOW_SYSTEM_LIBS
setup_pkg_config_host
export CMAKE_CONF=$TOOLCHAIN/etc/cmake-$HOST_NAME.conf
export CMAKE="cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF -DCMAKE_INSTALL_PREFIX=$TOOLCHAIN"
if [ ! -f $CMAKE_CONF ] ; then

0 comments on commit c67dce6

Please sign in to comment.
You can’t perform that action at this time.