#!/bin/sh

echo "Running environment script for device neo with QTMOKO_PKG_CONFIG_PATH=$QTMOKO_PKG_CONFIG_PATH"

# Guess QTMOKO_PKG_CONFIG_PATH if not already exported (e.g. by dpkg-builpackage).
# It should point to directory where .pc files are see:
# http://radekp.github.com/qtmoko/api/buildsystem/over-device-profiles-1.html#pkg-config

# Cross compiling
QTMOKO_PKG_CONFIG_PATH=${QTMOKO_PKG_CONFIG_PATH:-/usr/arm-linux-gnueabi/lib/pkgconfig}

# Native toolchain on squeeze/armel
if [ ! -d "$QTMOKO_PKG_CONFIG_PATH" ]; then
    QTMOKO_PKG_CONFIG_PATH=/usr/lib/pkgconfig
fi

if [ -d "$QTMOKO_PKG_CONFIG_PATH" ]; then
    echo "Variable QTMOKO_PKG_CONFIG_PATH is now set to: $QTMOKO_PKG_CONFIG_PATH"
else
    echo "Warning: QTMOKO_PKG_CONFIG_PATH directory $QTMOKO_PKG_CONFIG_PATH does not exist!!"
fi

# src/build/bin/configure insists on using PKG_CONFIG_PATH only
# PKG_CONFIG_LIBDIR won't be handled correctly when switching between
# host and target configuration
PKG_CONFIG_PATH=$QTMOKO_PKG_CONFIG_PATH
export PKG_CONFIG_PATH
