1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
#!/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}
if [ ! -e "waflib" ]
then
cp -a "../${srcdir}/${pkg}"/waflib .
fi
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=""
lib=""
else
eval $(sed -e '/^[A-Z]*_VERSION/!d;s/ //g;s/.*VERSION/version/' ${pkg}/wscript)
major="-${version%%.*}"
lib="-l${pkg}${major}"
fi
cat <<EOF >${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} ${lib} -ldl -lm
Cflags: -I\${includedir}/${pkg}${major}
EOF
export PKG_CONFIG_PATH="$(pwd)/${pkg}/build:${PKG_CONFIG_PATH}"
export CFLAGS="-I$(pwd)/${pkg} -I$(pwd)/${pkg}/build ${CFLAGS}"
export LDFLAGS="-L$(pwd)/${pkg}/build ${lib} ${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 --static --no-shared --no-utils
waf sord --static --no-shared --no-utils
waf sratom --static --no-shared
waf lilv --static --no-shared --no-utils
waf suil --static --no-shared --no-qt
sed -i'' -e "s@suil/lib/suil-0@suil/build@" suil/build/suil_config.h
cat >.buildvars <<EOF
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
export CFLAGS="${CFLAGS}"
export LDFLAGS="${LDFLAGS}"
EOF
exit 0
|