You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rtpengine/utils/build_test_wrapper

21 lines
520 B

#!/bin/sh
TARGET=$1
ROOT=$(echo "$TARGET" | sed 's/\.h$//')
if test "$MAKE" = ""; then
# shellcheck disable=SC2209
MAKE=make
fi
echo "Looking for usable alternative for $TARGET"
rm -f "$ROOT"-test "$ROOT"-test.c
ln -s ../lib/"$ROOT"-test.c .
for x in ../lib/"$ROOT"*.h; do
echo "Trying build with $x"
rm -f "$TARGET"
(echo '/******** GENERATED FILE ********/'; cat "$x") > "$TARGET"
$MAKE "$ROOT"-test && break
echo "Failed build with $x"
rm -f "$TARGET"
done
rm -f "$ROOT"-test "$ROOT"-test.c
test -f "$TARGET"