From cea6d648991c605893ca84bddefa771667bb1837 Mon Sep 17 00:00:00 2001 From: Whale Date: Wed, 28 Apr 2021 01:32:52 +0800 Subject: [PATCH] Create multi-version-build.sh --- multi-version-build.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 multi-version-build.sh diff --git a/multi-version-build.sh b/multi-version-build.sh new file mode 100644 index 00000000..33069756 --- /dev/null +++ b/multi-version-build.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +_main_dir="$(pwd)/" + +_build_dir="$_main_dir/build" + +mkdir "$_build_dir" > /dev/null 2>&1 + +for loop in "7.4.16" "8.0.3" +do + sed -i 's/_php_ver=.*/_php_ver="'$loop'"/g' "$_main_dir""static-compile-php.sh" && \ + rm -rf "$_main_dir""source/php.tar.gz" "$_main_dir""source/php-*" "$_main_dir""php-dist" && \ + "$_main_dir""static-compile-php.sh" && \ + cp "$_main_dir""php-dist/bin/php" "$_build_dir/" && \ + cd "$_build_dir/" && \ + tar -zcvf "php-$loop-static-bin.tar.gz" "./php" && \ + mv "./php" "./php-$loop" && \ + cd "$_main_dir" + if [ $? -ne 0 ]; then + echo "Compile static php-$loop failed!" + exit 1 + fi +done