<commit_before># http://downloads.php.net/stas/php-5.4.0beta1.tar.bz2

PHP_VERSION=5.4.0beta1
DISTNAME=php-$PHP_VERSION
TARNAME=$DISTNAME.tar.bz2
curl -O http://downloads.php.net/stas/$TARNAME
tar xvf $TARNAME
cd $DISTNAME

# export CFLAGS=" -march=prescott -O3 -msse -mmmx -funroll-loops -mfpmath=sse "
# export CXXFLAGS="${CFLAGS}"

export CFLAGS=" -O3 -msse -mmmx -funroll-loops -mfpmath=sse "
export CXXFLAGS="${CFLAGS}"

#     --with-config-file-path=/opt/local/etc/php5 \
#     --with-config-file-scan-dir=/opt/local/var/db/php5 \
#     --mandir=/opt/local/share/man \
#     --infodir=/opt/local/share/info \
#     --datadir= ..

export PREFIX=$HOME/local
./configure --prefix=$PREFIX \
    --with-config-file-path=$PREFIX/etc/php5 \
    --with-config-file-scan-dir=$PREFIX/var/db/php5 \
    --with-pear=$PREFIX/lib/php \
    --disable-all  \
    --enable-bcmath \
    --enable-zip \
    --enable-ctype \
    --enable-dom  \
    --enable-fileinfo \
    --enable-filter \
    --enable-hash \
    --enable-json \
    --enable-libxml \
    --enable-pdo \
    --enable-phar \
    --enable-session \
    --enable-simplexml \
    --enable-tokenizer \
    --enable-xml \
    --enable-xmlreader \
    --enable-xmlwriter \
    --enable-cli \
    --enable-intl \
    --enable-mbstring \
    --enable-mbregex \
    --enable-sockets \
    --enable-exif \
    --enable-short-tags \
    --with-curl=/opt/local \
    --with-bz2=/opt/local \
    --with-mhash=/opt/local \
    --with-pcre-regex=/opt/local \
    --with-readline=/opt/local \
    --with-libxml-dir=/opt/local \
    --with-zlib=/opt/local \
    --with-mysql \
    --with-gettext=/opt/local \
    --with-mysqli \
    --disable-cgi \
    --with-apxs2=/opt/local/apache2/bin/apxs \
    --enable-shmop \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-sysvmsg

echo "Building php ... "
echo ""
echo "   tail -f build.log to see the log"
echo ""
$? || make 2&>1 > build.log
$? make test 2&>1 test.log 
$? sudo make install

# failed:
#    --with-gd=/opt/local \<commit_msg>Fix condition code.<commit_after>#!/bin/bash
# http://downloads.php.net/stas/php-5.4.0beta1.tar.bz2

PHP_VERSION=5.4.0beta1
DISTNAME=php-$PHP_VERSION
TARNAME=$DISTNAME.tar.bz2
curl -O http://downloads.php.net/stas/$TARNAME
tar xvf $TARNAME
cd $DISTNAME

# export CFLAGS=" -march=prescott -O3 -msse -mmmx -funroll-loops -mfpmath=sse "
# export CXXFLAGS="${CFLAGS}"

export CFLAGS=" -O3 -msse -mmmx -funroll-loops -mfpmath=sse "
export CXXFLAGS="${CFLAGS}"

#     --with-config-file-path=/opt/local/etc/php5 \
#     --with-config-file-scan-dir=/opt/local/var/db/php5 \
#     --mandir=/opt/local/share/man \
#     --infodir=/opt/local/share/info \
#     --datadir= ..

export PREFIX=$HOME/local
./configure --prefix=$PREFIX \
    --with-config-file-path=$PREFIX/etc/php5 \
    --with-config-file-scan-dir=$PREFIX/var/db/php5 \
    --with-pear=$PREFIX/lib/php \
    --disable-all  \
    --enable-bcmath \
    --enable-zip \
    --enable-ctype \
    --enable-dom  \
    --enable-fileinfo \
    --enable-filter \
    --enable-hash \
    --enable-json \
    --enable-libxml \
    --enable-pdo \
    --enable-phar \
    --enable-session \
    --enable-simplexml \
    --enable-tokenizer \
    --enable-xml \
    --enable-xmlreader \
    --enable-xmlwriter \
    --enable-cli \
    --enable-intl \
    --enable-mbstring \
    --enable-mbregex \
    --enable-sockets \
    --enable-exif \
    --enable-short-tags \
    --with-curl=/opt/local \
    --with-bz2=/opt/local \
    --with-mhash=/opt/local \
    --with-pcre-regex=/opt/local \
    --with-readline=/opt/local \
    --with-libxml-dir=/opt/local \
    --with-zlib=/opt/local \
    --with-mysql \
    --with-gettext=/opt/local \
    --with-mysqli \
    --disable-cgi \
    --with-apxs2=/opt/local/apache2/bin/apxs \
    --enable-shmop \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-sysvmsg

echo "Building php ... "
echo ""
echo "   tail -f build.log to see the log"
echo ""
[[ $? ]] || make 2&>1 > build.log
[[ $? ]] || make test 2&>1 test.log 
[[ $? ]] || sudo make install

# failed:
#    --with-gd=/opt/local \
{'fraction_non_alphanumeric': 0.1984900146127618, 'fraction_numerical': 0.011203117389186557, 'mean_word_length': 1.914833215046132, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5466366', 'n_tokens_mistral': 1668, 'n_tokens_neox': 1604, 'n_words': 222}