#!/bin/sh optimisation=3 warnings="-Wunused-label -Wunused-value -Wunused-variable" gcc_options="-Wfatal-errors $warnings -std=c11 -O$optimisation -lguile-2.2 -lgc" dir=temp file="$dir/libguile-sph-lib.so" source=extension/c-precompiled/main.c compile_libguile_sph_lib() { gcc -Wl,--version-script=extension/export -shared -fpic "$source" -o "$file" $gcc_options } mkdir -p "$dir" && compile_libguile_sph_lib $* && chmod 755 "$dir" && chmod 644 "$file"