Skip to content

Instantly share code, notes, and snippets.

@Frago9876543210
Last active February 14, 2021 12:10
Show Gist options
  • Save Frago9876543210/0055e655b57d8fe5561fad798c2bfa12 to your computer and use it in GitHub Desktop.
Save Frago9876543210/0055e655b57d8fe5561fad798c2bfa12 to your computer and use it in GitHub Desktop.
diff --git a/compile.sh b/compile.sh
index e660c98..baf7a7b 100755
--- a/compile.sh
+++ b/compile.sh
@@ -14,6 +14,7 @@ LIBZIP_VERSION="1.7.3"
SQLITE3_YEAR="2021"
SQLITE3_VERSION="3340100" #3.34.1
LIBDEFLATE_VERSION="448e3f3b042219bccb0080e393ba3eb68c2091d5" #1.7
+LIBFFI_VERSION="3.3"
EXT_PTHREADS_VERSION="acc6e52b2144c61c434b62a3cb680d537e06828e"
EXT_YAML_VERSION="2.2.1"
@@ -735,6 +736,22 @@ function build_libdeflate {
echo " done!"
}
+function build_libffi {
+ echo -n "[libffi] downloading $LIBFFI_VERSION..."
+ download_file "https://github.com/libffi/libffi/releases/download/v$LIBFFI_VERSION/libffi-$LIBFFI_VERSION.tar.gz" | tar -zx >> "$DIR/install.log" 2>&1
+ mv libffi-$LIBFFI_VERSION libffi >> "$DIR/install.log" 2>&1
+ echo -n " checking..."
+ cd libffi
+ RANLIB=$RANLIB ./configure --prefix="$DIR/bin/php7" \
+ $EXTRA_FLAGS >> "$DIR/install.log" 2>&1
+ echo -n " compiling..."
+ make -j $THREADS >> "$DIR/install.log" 2>&1
+ echo -n " installing..."
+ make install >> "$DIR/install.log" 2>&1
+ cd ..
+ echo " done!"
+}
+
build_zlib
build_gmp
build_openssl
@@ -755,6 +772,7 @@ build_libxml2
build_libzip
build_sqlite3
build_libdeflate
+build_libffi
# PECL libraries
@@ -913,6 +931,7 @@ RANLIB=$RANLIB CFLAGS="$CFLAGS $FLAGS_LTO" CXXFLAGS="$CXXFLAGS $FLAGS_LTO" LDFLA
--with-openssl \
--with-zip \
--with-libdeflate="$DIR/bin/php7" \
+--with-ffi \
$HAS_LIBJPEG \
$HAS_GD \
--with-leveldb="$DIR/bin/php7" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment