PlainOsBuilder/test.sh

42 lines
555 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)
2024-01-20 16:27:56 +00:00
echo -e "#include <stdio.h>\nint main(void){return 0;}" > test.c
2024-01-12 08:36:21 +00:00
$CC test.c -o $out_name
2024-01-12 08:54:12 +00:00
chmod +x $out_name
2024-01-21 11:16:34 +00:00
rm test.c
2024-01-12 08:36:21 +00:00
if ! ./$out_name; then
echo "[FAILED] Fix c compiler or headers..."
2024-01-21 11:16:34 +00:00
rm $out_name
2024-01-12 08:36:21 +00:00
exit 1
2024-01-21 11:16:34 +00:00
rm $out_name
2024-01-12 08:36:21 +00:00
fi
exit 0