diff --git a/README.md b/README.md index e313975..988f597 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,15 @@ The build process works currently only on **x86-based Linux** systems. The follo * Netwide Assembler (NASM) * GNU Make, GNU Binutils, cmake * Tools and libraries to build *linux*, *binutils* and *gcc* (e.g. flex, bison, MPFR library, GMP library, MPC library) -* texinfo +* Rust On Debian-based systems the packets can be installed by executing: ``` - sudo apt-get install cmake nasm texinfo libmpfr-dev libmpc-dev libgmp-dev flex bison + sudo apt-get install cmake nasm libmpfr-dev libmpc-dev libgmp-dev flex bison ``` +Note: If issues arise during the build, try using requirements.sh to check the versions of the necessary packets and the configuration of the LD_LIBRARY_PATH (it should contain the MPFR library, GMP library and MPC library). + ## Building the HermitCore's toolchain To build the toolchain just call the script as follow: diff --git a/requirements.sh b/requirements.sh new file mode 100755 index 0000000..a58267e --- /dev/null +++ b/requirements.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if echo "$LD_LIBRARY_PATH" | grep -q libgmp && echo "$LD_LIBRARY_PATH" | grep -q libmpc && echo "$LD_LIBRARY_PATH" | grep -q libmpfr; then + echo "LD_LIBRARY_PATH contains MPFR library, GMP library and MPC library" +elif ! echo "$LD_LIBRARY_PATH" | grep -q libgmp; then + echo "LD_LIBRARY_PATH missing GMP library" +elif ! echo "$LD_LIBRARY_PATH" | grep -q libmpc; then + echo "LD_LIBRARY_PATH missing MPC library" +elif ! echo "$LD_LIBRARY_PATH" | grep -q libmpfr; then + echo "LD_LIBRARY_PATH missing MPFR library" +fi + +check_version() { + package=$1 + version_command=$2 + + echo -n "Checking $package... " + if $version_command &> /dev/null; then + version=$($version_command | head -n 1) + echo "Installed ($version)" + else + echo "Not installed" + fi +} + +# Check versions of packages +check_version "CMake" "cmake --version" +check_version "NASM" "nasm -v" +check_version "Flex" "flex --version" +check_version "Bison" "bison --version" \ No newline at end of file