-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from yangweijie/patch-2
添加 mac 安装xlswriter扩展脚本
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
dlDir=$1 | ||
phpDir=$2 | ||
extVersion=$3 | ||
|
||
cd $dlDir | ||
echo 'Downloading...' | ||
curl -C - -O -s https://pecl.php.net/get/xlswriter-$extVersion.tgz | ||
echo 'Downloaded' | ||
if [ -d "xlswriter-$extVersion" ]; then | ||
rm -rf "xlswriter-$extVersion" | ||
fi | ||
if [ -f "xlswriter-$extVersion.tgz" ]; then | ||
tar -zxf xlswriter-$extVersion.tgz | ||
else | ||
exit 1 | ||
fi | ||
|
||
export HOMEBREW_NO_AUTO_UPDATE=1 | ||
brew install pkg-config autoconf automake libtool | ||
|
||
x86_64_brewPath=/usr/local/homebrew/bin/brew | ||
|
||
prefix=$(arch -x86_64 $x86_64_brewPath --prefix) | ||
export CFLAGS=-I$prefix/include | ||
|
||
cd "xlswriter-$extVersion" | ||
$phpDir/bin/phpize | ||
./configure --with-php-config=$phpDir/bin/php-config --enable-reader --with-zlib-dir=/Applications/EServer/Library/zlib | ||
arch -x86_64 make -j4 | ||
make install |