#!/bin/bash
rm -f warnings
+if test -d "$1"; then
+ PREFIX=$1
+ shift
+else
+ PREFIX=`dirname $(dirname $(which php-config))`
+fi
+
+echo "Using prefix '$PREFIX' for phpize and php-config!"
+
echo -n "executing phpize... "
-phpize 2>&1 >/dev/null
+${PREFIX}/bin/phpize 2>&1 >/dev/null
if test $? -ne 0 ; then
echo "FAILED!"
exit 1
echo "DONE"
echo -n "configuring... "
-CFLAGS="-W -Wchar-subscripts -Wformat=2 -Wno-format-y2k -Wimplicit -Wmissing-braces -Wunused-variable -Wbad-function-cast -Wpointer-arith -Wsign-compare -Winline" \
- ./configure >/dev/null
+CFLAGS="-Wall -Wextra -Wno-unused-parameter -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wbad-function-cast -Wcast-align -Wmissing-field-initializers -Wnested-externs" \
+ ./configure --with-php-config=${PREFIX}/bin/php-config $@ >/dev/null
if test $? -ne 0 ; then
echo "FAILED!"
exit 1
echo "DONE"
echo -n "building... "
-make clean install 2>warnings >/dev/null
+make clean all 2>warnings >/dev/null
if test $? -ne 0 ; then
echo "FAILED!"
else
fi
if test -s warnings; then
- cat warnings
+ grep -E "^/.+http" warnings
fi