mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Toolchain: Check whether required tools and libraries are available
Rather than having the toolchain build fail half-way through we should check whether the user has installed all the required tools and libraries early on.
This commit is contained in:
parent
2deffeb74d
commit
259822493f
Notes:
sideshowbarker
2024-07-18 17:10:38 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/259822493f8 Pull-request: https://github.com/SerenityOS/serenity/pull/7582 Reviewed-by: https://github.com/linusg
1 changed files with 42 additions and 0 deletions
|
@ -91,6 +91,48 @@ buildstep() {
|
|||
"$@" 2>&1 | sed $'s|^|\x1b[34m['"${NAME}"$']\x1b[39m |'
|
||||
}
|
||||
|
||||
# === DEPENDENCIES ===
|
||||
buildstep dependencies echo "Checking whether 'make' is available..."
|
||||
if ! command -v ${MAKE:-make} >/dev/null; then
|
||||
buildstep dependencies echo "Please make sure to install GNU Make (for the '${MAKE:-make}' tool)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
buildstep dependencies echo "Checking whether 'patch' is available..."
|
||||
if ! command -v patch >/dev/null; then
|
||||
buildstep dependencies echo "Please make sure to install GNU patch (for the 'patch' tool)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
buildstep dependencies echo "Checking whether 'makeinfo' is available..."
|
||||
if ! command -v makeinfo >/dev/null; then
|
||||
buildstep dependencies echo "Please make sure to install GNU Texinfo (for the 'makeinfo' tool)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
buildstep dependencies echo "Checking whether your C compiler works..."
|
||||
if ! ${CC:-cc} -o /dev/null -xc - >/dev/null <<'PROGRAM'
|
||||
int main() {}
|
||||
PROGRAM
|
||||
then
|
||||
buildstep dependencies echo "Please make sure to install a working C compiler."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$SYSTEM_NAME" != "Darwin" ]; then
|
||||
for lib in gmp mpc mpfr; do
|
||||
buildstep dependencies echo "Checking whether the $lib library and headers are available..."
|
||||
if ! ${CC:-cc} -I /usr/local/include -L /usr/local/lib -l$lib -o /dev/null -xc - >/dev/null <<PROGRAM
|
||||
#include <$lib.h>
|
||||
int main() {}
|
||||
PROGRAM
|
||||
then
|
||||
echo "Please make sure to install the $lib library and headers."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# === CHECK CACHE AND REUSE ===
|
||||
|
||||
pushd "$DIR"
|
||||
|
|
Loading…
Reference in a new issue