#!/bin/bash srcdir=. while [ $# -gt 0 ] do if [[ "$1" =~ --srcdir=.* ]] then srcdir=${1#*=} break fi shift done function waf { pkg="$1" shift mkdir -p ${pkg} pushd >/dev/null ${pkg} for f in "../${srcdir}/${pkg}"/* do if [ ! -e "${f##*/}" ] then ln -s "${f}" fi done $(which python python2 | tail -1) waf --prefix="." --include="." $@ configure || exit 1 popd >/dev/null if [ "${pkg}" == "lv2" ] then eval $(sed -e "/^VERSION/!d;s/ //g;s/.*VERSION/version/" ${pkg}/wscript) major="" else eval $(sed -e "/^[A-Z]*_VERSION/!d;s/ //g;s/.*VERSION/version/" ${pkg}/wscript) major="-${version%%.*}" fi cat <${pkg}/build/${pkg}${major}.pc prefix=$(pwd)/${pkg} exec_prefix=\${prefix} libdir=\${exec_prefix}/lib includedir=. Name: ${pkg} Version: ${version} Description: Temporary fake config file Libs: -L\${libdir} -l${pkg}${major} -ldl Cflags: -I\${includedir}/${pkg}${major} EOF export PKG_CONFIG_PATH="$(pwd)/${pkg}/build:${PKG_CONFIG_PATH}" export CFLAGS="-I$(pwd)/${pkg} ${CFLAGS}" export LDFLAGS="-L$(pwd)/${pkg} -l${pkg}-${major} ${LDFLAGS}" ln -s ../${pkg}/${pkg} include } rm -rf include mkdir -p include [ ! -e Makefile ] && ln -s "${srcdir}/Makefile" [ ! -e build ] && ln -s "${srcdir}/build" echo >srcdir.mk "srcdir = ${srcdir}" waf lv2 --no-plugins waf serd --no-utils --static --no-shared waf sord --no-utils --static --no-shared waf sratom --static --no-shared waf lilv --no-utils --static --no-shared exit 0