most Linux distros have preinstalled toolchains if not ->
install build-essential package (Ubuntu, Debian) or separately gcc, g++, make packages
install Git CLI: https://github.com/cli/cli#installation
or use package 'git' of your Linux distro
install CMake: https://cmake.org/download/
or use package 'cmake' of your Linux distro
to install Poco libraries and Scripal you may call the bash script buildLinux.sh
download script from: https://scripal.org/downloads/linux/buildLinux.sh
copy buildLinux.sh into the directory where Scripal and Poco libraries should be installed (recommendation: '/opt') and execute
static and dynamic versions are needed
The Poco team strongly recommends to build the libraries as needed and avoid prebuilding packages
in console/terminal:
git clone -b main https://github.com/pocoproject/poco.git
Notice for special use cases (skip for default builds and continue with building Poco):
To link statically against Scripal libraries and for easier distribution on many AMD_X64 systems, you may build position independent code.
In file poco/CMakeLists.txt add settings to build position independent code (-fPIC or -fpic)
line to insert at begin of file is: set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(PROJECT_VERSION${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) set(RELEASE_NAME "Unstable-trunk") set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Scripal targets scripal, a_scripal and so_scripal are built with position independent code.
Scripal targets scripal_d, a_scripal_d and so_scripal_d are used for standard automated builds.
now build Poco libraries:
cd poco rm -rf build # build Poco dynamic cmake -H./ -B./build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF -DENABLE_SEVENZIP=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_NET=OFF -DENABLE_DATA=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_SQLITE=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_MONGODB=OFF -DENABLE_REDIS=OFF -DENABLE_APACHECONNECTOR=OFF -DENABLE_ENCODINGS=ON -DENABLE_JSON=ON -DENABLE_ZIP=ON -DENABLE_XML=ON cmake --build ./build sudo cmake --install ./build sudo ldconfig # build Poco static cmake -H./ -B./build -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=OFF -DENABLE_SEVENZIP=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_NET=OFF -DENABLE_DATA=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_SQLITE=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_MONGODB=OFF -DENABLE_REDIS=OFF -DENABLE_APACHECONNECTOR=OFF -DENABLE_ENCODINGS=ON -DENABLE_JSON=ON -DENABLE_ZIP=ON -DENABLE_XML=ON cmake --build ./build sudo cmake --install ./build sudo ldconfig
git clone -b main https://github.com/scripal/scripal.git
switch into scripal build directory cmake-build
cd scripal/cmake-build
then call
cmake . cmake --build . --target scripal_d a_scripal_d so_scripal_d sudo cmake --install . sudo ldconfig
to build with position independent code (needs special position independent Poco build)
cmake --build . --target scripal a_scripal so_scripal
to switch between release and debug configs, instead of standard configure with 'cmake .' use
cmake -S . -B ./ -D CMAKE_BUILD_TYPE=Debug
or
cmake -S . -B ./ -D CMAKE_BUILD_TYPE=Release
clean entire project build
cd scripal/cmake-build cmake --build . --target clean
Files are stored in:
headers : /usr/include/scripal
binary : ./scripal
shared library : /usr/lib/scripal or /usr/lib64/scripal
static library : /usr/local/lib/ or /usr/local/lib64