#!/usr/bin/env bash set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" third_party="$root/native/third-party" mkdir -p "$third_party" runtime_api="$(php -i | sed -n 's/^PHP API => //p' | head -n 1)" config_api="$(php-config --phpapi)" phpize_api="$(phpize --version | sed -n 's/^PHP Api Version:[[:space:]]*//p' | head -n 1)" if [[ -z "$runtime_api" || -z "$config_api" || -z "$phpize_api" \ || "$runtime_api" != "$config_api" || "$runtime_api" != "$phpize_api" ]]; then cat >&2 <&2 exit 1 fi LIBOQS_ROOT="$third_party/liboqs" bash build.sh ) if [[ ! -d "$third_party/php-skein/.git" ]]; then git clone --depth 1 https://github.com/jedisct1/PHP-Skein-Hash.git \ "$third_party/php-skein" fi ( cd "$third_party/php-skein" phpize --clean >/dev/null 2>&1 || true phpize ./configure make ) cat <