#!/bin/bash
set -e
source $1

BUILDDIR=${BUILDDIR:=/LLXXAMP}
DEFAULT_PORT=${DEFAULT_PORT:=8080}
TAG=${TAG:=$BUILDDIR/123456789123456789123456789123456789123456789}
PREFIX=$TAG/httpd
PROCS=$(nproc)

echo Compiling Apache2

out=/dev/null
if [ -n "$DEBUG" ];then
    out=/dev/stdout
fi

cd $DECOMPRESSED_DIR/httpd

./buildconf > $out 2>&1
./configure --prefix=$PREFIX --enable-mods-shared=all --enable-so --with-included-apr --with-port=$DEFAULT_PORT > $out 2>&1
make clean > $out 2>&1
make -j$PROCS > $out 2>&1
make install > $out 2>&1
make clean > $out 2>&1


