2019-12-18 22:45:55 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-02-28 17:08:21 +00:00
|
|
|
# https://stackoverflow.com/a/246128
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
|
2019-12-18 22:45:55 +00:00
|
|
|
verbose_flag=""
|
|
|
|
while getopts vx arg; do
|
|
|
|
case "$arg" in
|
|
|
|
v) verbose_flag="--verbose";;
|
|
|
|
x) set -x;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $((OPTIND-1))
|
|
|
|
|
2020-02-28 17:08:21 +00:00
|
|
|
export PKG_CONFIG="${DIR}/scripts/pkg-config.sh"
|
2019-12-18 22:45:55 +00:00
|
|
|
|
|
|
|
# If this script is being executed, it will be executed under bash
|
|
|
|
# so the bash source variable should be present. If the variable
|
|
|
|
# matches the current script, then we are being executed and the
|
|
|
|
# default argument should be to print the environment.
|
|
|
|
if [ $# -eq 0 ] && [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
|
|
set -- env
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $# -gt 0 ]; then exec "$@"; fi
|