PlainOsBuilder/test.sh

42 lines
556 B
Bash
Raw Normal View History

2024-01-12 08:36:21 +00:00
#!/bin/sh
2024-01-12 08:54:12 +00:00
#Make
2024-01-12 08:36:21 +00:00
if ! make -h > /dev/null; then
echo "[FAILED] Make is not installed..."
exit 1
fi
2024-01-12 08:54:12 +00:00
#Git
2024-01-12 08:36:21 +00:00
if git > /dev/null; then
echo "[FAILED] Git is not installed..."
exit 1
fi
2024-01-12 08:54:12 +00:00
#Texinfo
2024-01-12 08:36:21 +00:00
if ! makeinfo -h > /dev/null; then
echo "[FAILED] Texinfo is not installed..."
exit 1
fi
2024-01-12 08:54:12 +00:00
#C
2024-01-12 08:36:21 +00:00
out_name=$(mktemp XXXXXX)
echo "#include <stdio.h>" >> test.c
echo "int main(void){return 0;}" >> test.c
$CC test.c -o $out_name
2024-01-12 08:54:12 +00:00
chmod +x $out_name
2024-01-12 08:36:21 +00:00
rm test.c
if ! ./$out_name; then
echo "[FAILED] Fix c compiler or headers..."
rm $out_name
exit 1
fi
exit 0