Skip to content
Snippets Groups Projects
Commit 58fd44b2 authored by Dominik Fuhrmann's avatar Dominik Fuhrmann
Browse files

updated wolfssl installation script

parent a837e47a
No related branches found
No related tags found
No related merge requests found
set -e # Abort on error
set -u # Treat unset variables as an error
set -o pipefail # Propagate errors in pipelines
# Update package list # Update package list
echo "Updating package list..." echo "Updating package list..."
sudo apt update sudo apt update || { echo "Error: Failed to update package list." >&2; exit 1; }
# Install dependencies # Install dependencies
echo "Installing dependencies..." echo "Installing dependencies..."
sudo apt install -y build-essential cmake git sudo apt install -y build-essential cmake git || { echo "Error: Failed to install dependencies." >&2; exit 1; }
# Check if cmake and make are installed # Install cmake and make, if not yet installed
echo "Checking for cmake and make..." echo "Checking for cmake and make..."
which cmake || { echo "cmake not found, installing..."; sudo apt install -y cmake; } which cmake >/dev/null || { echo "cmake not found, installing..."; sudo apt install -y cmake || { echo "Error: Failed to install cmake." >&2; exit 1; }; }
which make || { echo "make not found, installing..."; sudo apt install -y make; } which make >/dev/null || { echo "make not found, installing..."; sudo apt install -y make || { echo "Error: Failed to install make." >&2; exit 1; }; }
# Clone the WolfSSL repository # Clone the WolfSSL repository
echo "Cloning WolfSSL repository..." echo "Cloning WolfSSL repository..."
git clone https://github.com/wolfSSL/wolfssl.git mkdir -p ../../wolfssl
cd ../../wolfssl
git clone https://github.com/wolfSSL/wolfssl.git || { echo "Error: Failed to clone WolfSSL repository." >&2; exit 1; }
# Change to the wolfssl directory # Change to the wolfssl directory
cd wolfssl cd wolfssl
# Create and change to the build directory # Create and change to the build directory
echo "Creating build directory..." echo "Creating build directory..."
mkdir build mkdir -p build
cd build cd build
# Configure the build # Configure the build
echo "Configuring build with cmake..." echo "Configuring build with cmake..."
cmake .. cmake .. || { echo "Error: CMake configuration failed." >&2; exit 1; }
# Compile the source code # Compile the source code
echo "Compiling the code..." echo "Compiling the code..."
make make || { echo "Error: Compilation failed." >&2; exit 1; }
# Install the compiled binaries # Install the compiled binaries
echo "Installing WolfSSL..." echo "Installing WolfSSL..."
sudo make install sudo make install || { echo "Error: Installation failed." >&2; exit 1; }
# Update library cache # Update library cache
echo "Updating library cache..." echo "Updating library cache..."
sudo ldconfig sudo ldconfig || { echo "Error: Failed to update library cache." >&2; exit 1; }
echo "WolfSSL installation completed" echo "WolfSSL installation completed successfully."
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment