BashSpark
Loading...
Searching...
No Matches
Library installation

The CMake file defines the following targets:

  • doc: Generates documentation.
  • deb: Generate .deb file of the library.
  • rpm: Generate .rpm file of the library (currently unavailable).
  • headers: Generates a zip file containing the library headers.
  • abashspark: Generates a static library.
  • fbashspark: Generates a static library with position-independent code.
  • sbashspark: Generates a dynamic library.
  • tbashspark: Generates the test executable.

Exposed targets include:

  • BashSpark::ABashSpark: static library.
  • BashSpark::FBashSpark: static library with position-independent code.
  • BashSpark::SBashSpark: dynamic library.
  • BashSpark::BashSpark: default dynamic library.
  • Property BASH_SPARK_HEADER_DIR with the include path.

Installation Steps

The installation process consists of the following steps:

  1. Configure CMake.
  2. Unpack the headers.
  3. Build the library.
  4. Copy the library.

Configure CMake

Set the project directory with:

BASH_SPARK="$(realpath .)"

Then configure CMake:

mkdir -p ${BASH_SPARK}/cmake-build && cd ${BASH_SPARK}/cmake-build && cmake ..

Unpacking the Headers

On POSIX systems, the library headers are stored at /usr/include. Execute the following commands:

cd ${BASH_SPARK}/cmake-build && make headers
tar -xzf ${BASH_SPARK}/build/BashSpark.tar.gz -C ${BASH_SPARK}/build --strip-components=1 "./BashSpark"
sudo mv ${BASH_SPARK}/build/BashSpark /usr/include/BashSpark

Windows users: Extract the file ${BASH_SPARK}/build/BashSpark.tar.gz in the appropriate location.

Building the Library

Choose a library version to build:

  • abashspark: Static library.
  • fbashspark: Static library with position-independent code.
  • sbashspark: Dynamic library.
  • If you are not sure use the dynamic library.

Execute the appropriate command:

cd ${BASH_SPARK}/cmake-build && make <library_target>

Copying the Library

On POSIX systems, copy the library to /usr/lib:

sudo mkdir -p /usr/lib/BashSpark

Then move the libraries:

sudo mv ${BASH_SPARK}/build/libabashspark.a /usr/lib/BashSpark/libabashspark.a
sudo mv ${BASH_SPARK}/build/libfbashspark.a /usr/lib/BashSpark/libfbashspark.a
sudo mv ${BASH_SPARK}/build/libsbashspark.so /usr/lib/BashSpark/libsbashspark.so

After these steps, the BashSpark library will be properly integrated into your system.

Additional Notes

If the command debuild is missing, install the necessary tools with:

sudo apt install devscripts

Install CMake

Use the following commands based on your Linux distribution to install CMake:

Linux Distribution Command
Debian-based sudo apt install -y cmake
Red Hat-based sudo yum install -y cmake
Fedora sudo dnf install -y cmake
Arch Linux sudo pacman -S --noconfirm cmake
Windows Download CMake
MAC OS X brew install cmake