@@ -152,10 +152,76 @@ function setup {
152152 echo Installing Dependencies
153153 brew install flex autoconf automake libtool re2c bison openssl curl enchant gd freetype mhash libiconv libsodium libjpeg pcre libxml2 argon2 tidy-html5 libzip
154154 # Export Packages to the $PATH so They can be Found by the System
155- sudo echo ' export PATH="/usr/local/opt/openssl/bin:$PATH"' | sudo tee ~ /.bash_profile
156- source ~ /.bash_profile
157- echo Installed all Dependencies
155+ SHELL=$( echo ${SHELL} )
156+ if [ " $SHELL " = /bin/bash ]; then
158157
158+ echo exporting PATH variables, compiler flags, and pkg-config variables for dependencies
159+ sudo echo ' export PATH="/usr/local/opt/openssl/bin:$PATH"' | sudo tee ~ /.bash_profile
160+ export LDFLAGS=" -L/usr/local/opt/openssl@1.1/lib"
161+ export CPPFLAGS=" -I/usr/local/opt/openssl@1.1/include"
162+ export PKG_CONFIG_PATH=" /usr/local/opt/openssl@1.1/lib/pkgconfig"
163+
164+ echo ' export PATH="/usr/local/opt/curl/bin:$PATH"' | sudo tee ~ /.bash_profile
165+ export LDFLAGS=" -L/usr/local/opt/curl/lib"
166+ export CPPFLAGS=" -I/usr/local/opt/curl/include"
167+ export PKG_CONFIG_PATH=" /usr/local/opt/curl/lib/pkgconfig"
168+
169+ echo ' export PATH="/usr/local/opt/flex/bin:$PATH"' | sudo tee ~ /.bash_profile
170+ export LDFLAGS=" -L/usr/local/opt/flex/lib"
171+ export CPPFLAGS=" -I/usr/local/opt/flex/include"
172+
173+ echo ' export PATH="/usr/local/opt/libiconv/bin:$PATH"' | sudo tee ~ /.bash_profile
174+ export LDFLAGS=" -L/usr/local/opt/libiconv/lib"
175+ export CPPFLAGS=" -I/usr/local/opt/libiconv/include"
176+
177+ echo ' export PATH="/usr/local/opt/libxml2/bin:$PATH"' | sudo tee ~ /.bash_profile
178+ export LDFLAGS=" -L/usr/local/opt/libxml2/lib"
179+ export CPPFLAGS=" -I/usr/local/opt/libxml2/include"
180+
181+ echo ' export PATH="/usr/local/opt/bison/bin:$PATH"' | sudo tee ~ /.bash_profile
182+ export LDFLAGS=" -L/usr/local/opt/bison/lib"
183+ echo exported PATH variables, compiler flags, and pkg-config variables for dependencies
184+
185+ echo linking dependencies
186+ brew link autoconf automake libtool re2c enchant gd freetype mhash libsodium libjpeg pcre argon2 tidy-html5 libzip
187+ echo linked dependencies
188+
189+ source ~ /.bash_profile
190+ echo Installed all Dependencies
191+
192+ elif [ " $SHELL " = /bin/zsh ]; then
193+
194+ sudo echo ' export PATH="/usr/local/opt/openssl/bin:$PATH"' | sudo tee ~ /.profile
195+ export LDFLAGS=" -L/usr/local/opt/openssl@1.1/lib"
196+ export CPPFLAGS=" -I/usr/local/opt/openssl@1.1/include"
197+ export PKG_CONFIG_PATH=" /usr/local/opt/openssl@1.1/lib/pkgconfig"
198+
199+ echo ' export PATH="/usr/local/opt/curl/bin:$PATH"' | sudo tee ~ /.profile
200+ export LDFLAGS=" -L/usr/local/opt/curl/lib"
201+ export CPPFLAGS=" -I/usr/local/opt/curl/include"
202+ export PKG_CONFIG_PATH=" /usr/local/opt/curl/lib/pkgconfig"
203+
204+ echo ' export PATH="/usr/local/opt/flex/bin:$PATH"' | sudo tee ~ /.profile
205+ export LDFLAGS=" -L/usr/local/opt/flex/lib"
206+ export CPPFLAGS=" -I/usr/local/opt/flex/include"
207+
208+ echo ' export PATH="/usr/local/opt/libiconv/bin:$PATH"' | sudo tee ~ /.profile
209+ export LDFLAGS=" -L/usr/local/opt/libiconv/lib"
210+ export CPPFLAGS=" -I/usr/local/opt/libiconv/include"
211+
212+ echo ' export PATH="/usr/local/opt/libxml2/bin:$PATH"' | sudo tee ~ /.profile
213+ export LDFLAGS=" -L/usr/local/opt/libxml2/lib"
214+ export CPPFLAGS=" -I/usr/local/opt/libxml2/include"
215+
216+ echo ' export PATH="/usr/local/opt/bison/bin:$PATH"' | sudo tee ~ /.profile
217+ export LDFLAGS=" -L/usr/local/opt/bison/lib"
218+
219+ echo linking dependencies
220+ brew link autoconf automake libtool re2c enchant gd freetype2 mhash libsodium libjpeg pcre argon2 tidy-html5 libzip
221+ echo linked dependencies
222+ source ~ /.profile
223+ echo Installed all Dependencies
224+ fi
159225 # Go into the right directory depending on PHP installation version
160226 if [ " $PHPINSTALLVERSION " = latest-7.1 ]; then
161227 cd php-src-php-7.1.32/ || exit
0 commit comments