Created
September 11, 2017 11:34
-
-
Save FireBurn/00bff4931a53e4380575707ac0f20fc8 to your computer and use it in GitHub Desktop.
Compile_OpenAM_WebAgent
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
#!/bin/sh | |
BASE_DIR=`pwd` | |
HTTPD24_VERSION=2.4.27 | |
HTTPD22_VERSION=2.2.34 | |
APR_VERSION=1.6.2 | |
APR_UTIL_VERSION=1.6.0 | |
# Download source files | |
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/httpd/httpd-${HTTPD24_VERSION}.tar.bz2 | |
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/httpd/httpd-${HTTPD22_VERSION}.tar.bz2 | |
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/apr/apr-${APR_VERSION}.tar.bz2 | |
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/apr/apr-util-${APR_UTIL_VERSION}.tar.bz2 | |
# Extract the code and move apr and apr-util into place | |
tar xvfj httpd-${HTTPD24_VERSION}.tar.bz2 | |
tar xvfj httpd-${HTTPD22_VERSION}.tar.bz2 | |
tar xvfj apr-${APR_VERSION}.tar.bz2 -C httpd-${HTTPD24_VERSION}/srclib/ | |
tar xvfj apr-${APR_VERSION}.tar.bz2 -C httpd-${HTTPD22_VERSION}/srclib/ | |
tar xvfj apr-util-${APR_UTIL_VERSION}.tar.bz2 -C httpd-${HTTPD24_VERSION}/srclib/ | |
tar xvfj apr-util-${APR_UTIL_VERSION}.tar.bz2 -C httpd-${HTTPD22_VERSION}/srclib/ | |
mv httpd-${HTTPD24_VERSION}/srclib/apr-${APR_VERSION}/ httpd-${HTTPD24_VERSION}/srclib/apr/ | |
mv httpd-${HTTPD22_VERSION}/srclib/apr-${APR_VERSION}/ httpd-${HTTPD22_VERSION}/srclib/apr/ | |
mv httpd-${HTTPD24_VERSION}/srclib/apr-util-${APR_UTIL_VERSION}/ httpd-${HTTPD24_VERSION}/srclib/apr-util/ | |
mv httpd-${HTTPD22_VERSION}/srclib/apr-util-${APR_UTIL_VERSION}/ httpd-${HTTPD22_VERSION}/srclib/apr-util/ | |
# Configure HTTPD with APR and APR Util | |
cd ${BASE_DIR}/httpd-${HTTPD24_VERSION} | |
./configure --with-included-apr | |
cd ${BASE_DIR}/httpd-${HTTPD22_VERSION} | |
./configure --with-included-apr | |
# Clone WebAgents Code | |
cd .. | |
git clone https://github.com/FireBurn/web-agents-public.git | |
# Build WebAgents for Apache 2.2 and Apache 2.4 | |
cd web-agents-public | |
# This allows any version of GCC to compile the WebAgent | |
sed -i 's#gcc44#gcc#g' Makefile.linux.mk | |
# This adds in -march=corei7-avx | |
sed -i "s#-g -O2#-O2 -march=corei7-avx#g" Makefile.linux.mk | |
# The next two lines hardens the build | |
sed -i 's#-fstack-protector#-fstack-protector-all#g' Makefile.linux.mk | |
sed -i 's#-Wl,--no-as-needed#-Wl,--no-as-needed -Wl,-z,now -Wl,-z,relro #g' Makefile.linux.mk | |
# These fix up the includes with our new apache and apr builds | |
sed -i 's#Iextlib/$(OS_ARCH)_$(OS_MARCH)/apache24/include#I'"${BASE_DIR}"'/httpd-'"${HTTPD24_VERSION}"'/include $(COMPILEFLAG)I'"${BASE_DIR}"'/httpd-'"${HTTPD24_VERSION}"'/srclib/apr/include $(COMPILEFLAG)I'"${BASE_DIR}"'/httpd-'"${HTTPD24_VERSION}"'/srclib/apr-util/include $(COMPILEFLAG)I'"${BASE_DIR}"'/httpd-'"${HTTPD24_VERSION}"'/os/unix#g' Makefile | |
sed -i 's#Iextlib/$(OS_ARCH)_$(OS_MARCH)/apache22/include#I'"${BASE_DIR}"'/httpd-'"${HTTPD22_VERSION}"'/include $(COMPILEFLAG)I'"${BASE_DIR}"'/httpd-'"${HTTPD22_VERSION}"'/srclib/apr/include $(COMPILEFLAG)I'"${BASE_DIR}"'/httpd-'"${HTTPD22_VERSION}"'/srclib/apr-util/include $(COMPILEFLAG)I'"${BASE_DIR}"'/httpd-'"${HTTPD22_VERSION}"'/os/unix#g' Makefile | |
make apachezip | |
# File here build/Apache_v24_Linux_64bit_4.1.0.zip | |
make apache22zip | |
# File here build/Apache_v22_Linux_64bit_4.1.0.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment