2015-01-26 14:32:10 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
case "$AM_SRCDIR" in
|
|
|
|
"")
|
|
|
|
AM_SRCDIR="."
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
fix=n
|
|
|
|
status=0
|
|
|
|
case "$1" in
|
|
|
|
"-fix")
|
|
|
|
fix=y
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
for inc in src/*.h; do
|
|
|
|
package=xcb-`basename $inc .h`
|
|
|
|
pcin="$AM_SRCDIR"/$package.pc.in
|
|
|
|
if [ -f $pcin ]; then
|
|
|
|
included=`grep '# *include' $inc |
|
|
|
|
sed -e 's/[^<"]*[<"]//' -e 's/[>"]//' |
|
|
|
|
grep -v 'xcb.h\|xproto.h'`
|
2016-09-02 04:09:43 -06:00
|
|
|
requires=`grep '^Requires.private:' $pcin`
|
2015-01-26 14:32:10 -07:00
|
|
|
missing=""
|
|
|
|
for i in $included; do
|
|
|
|
ibase=`basename $i .h`
|
|
|
|
r="xcb-$ibase"
|
|
|
|
rpcin="$AM_SRCDIR"/$r.pc.in
|
|
|
|
if [ -f $rpcin ]; then
|
|
|
|
m="$r"
|
|
|
|
for has in $requires; do
|
|
|
|
if [ $has = $r ]; then
|
|
|
|
m=""
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
case "$m" in
|
|
|
|
"")
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
case "$missing" in
|
|
|
|
"")
|
|
|
|
missing=$m
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
missing="$missing $m"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
case "$missing" in
|
|
|
|
"")
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if [ "$fix" = "y" ]; then
|
|
|
|
echo $package adding dependency on $missing
|
2016-09-02 04:09:43 -06:00
|
|
|
sed -i '/^Requires.private:/s/$/ '"$missing"'/' $pcin
|
2015-01-26 14:32:10 -07:00
|
|
|
else
|
|
|
|
echo $package missing $missing
|
|
|
|
status=1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
exit $status
|