[9744] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | function catch_errors() {
|
---|
| 4 | echo "Script aborted, because an unexpected error occured.";
|
---|
| 5 | exit 1;
|
---|
| 6 | }
|
---|
| 7 |
|
---|
| 8 | if [ ! `which wget` ]; then
|
---|
| 9 | echo "You need wget for this script. Please install it first, e.g., sudo apt-get install wget. Aborted."
|
---|
| 10 | exit 1
|
---|
| 11 | fi
|
---|
| 12 |
|
---|
[3738] | 13 | mkdir build
|
---|
| 14 |
|
---|
| 15 | # setup
|
---|
[5317] | 16 | export PREFIX=`cd ./build; pwd`
|
---|
[3738] | 17 | mkdir libs
|
---|
| 18 | cd libs
|
---|
| 19 |
|
---|
[9744] | 20 | # now set the error trap so that re-running the script doesn't fail
|
---|
| 21 | # on previous directory commands...
|
---|
| 22 | # this will trap any subsequent errors or commands with non-zero exit status
|
---|
| 23 | # by calling function catch_errors()
|
---|
| 24 | trap catch_errors ERR;
|
---|
| 25 |
|
---|
| 26 |
|
---|
[3738] | 27 | # apache runtime
|
---|
[9737] | 28 | #wget http://apache.linux-mirror.org/apr/apr-1.4.2.tar.gz
|
---|
| 29 | #tar xvvzf apr-1.4.2.tar.gz
|
---|
| 30 | #cd apr-1.4.2
|
---|
| 31 | #./configure --prefix=$PREFIX
|
---|
| 32 | #make && make install
|
---|
| 33 | #cd ..
|
---|
[3738] | 34 |
|
---|
| 35 | # apache runtime utilities
|
---|
[9737] | 36 | #wget http://apache.linux-mirror.org/apr/apr-util-1.3.10.tar.gz
|
---|
| 37 | #tar xvvzf apr-util-1.3.10.tar.gz
|
---|
| 38 | #cd apr-util-1.3.10
|
---|
| 39 | #./configure --prefix=$PREFIX --with-apr=$PREFIX
|
---|
| 40 | #make && make install
|
---|
| 41 | #cd ..
|
---|
[3738] | 42 |
|
---|
| 43 | # log4cxx
|
---|
[9737] | 44 | #wget http://ftp.uni-erlangen.de/pub/mirrors/apache/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
|
---|
| 45 | #cp ../etc/patch/apache-log4cxx-0.10.0.diff ./
|
---|
| 46 | #tar xvvzf apache-log4cxx-0.10.0.tar.gz
|
---|
| 47 | #patch -p0 <apache-log4cxx-0.10.0.diff
|
---|
| 48 | #cd apache-log4cxx-0.10.0
|
---|
| 49 | #./configure --prefix=$PREFIX --with-apr=$PREFIX --with-apr-util=$PREFIX
|
---|
| 50 | #make && make install
|
---|
| 51 | #cd ..
|
---|
[3738] | 52 |
|
---|
| 53 | # boost 1.39.0
|
---|
[9744] | 54 | boostpkg=boost_1_39_0
|
---|
| 55 | wget http://downloads.sourceforge.net/sourceforge/boost/${boostpkg}.tar.gz || { echo "** Failed to retrieve ${boostpkg}. Please check network connectivity or availability of the package on the server. Stop."; exit 1; }
|
---|
| 56 | echo -n "Unpacking ${boostpkg}... " && tar xzf ${boostpkg}.tar.gz && echo " done."
|
---|
| 57 | cd ${boostpkg}
|
---|
| 58 | echo -n "Calling bootstrap.sh ... " && ./bootstrap.sh --libdir=$PREFIX/lib --prefix=$PREFIX --with-libraries="date_time,system,thread,test,regex" >/dev/null && echo " done."
|
---|
| 59 | echo "Calling bjam. This may take a while..."
|
---|
[3738] | 60 | ./bjam install
|
---|
| 61 | cd ..
|
---|
| 62 |
|
---|
| 63 | # gnu multiprecision library
|
---|
[9744] | 64 | gmppkg=gmp-4.3.1
|
---|
| 65 | wget ftp://ftp.gmplib.org/pub/${gmppkg}/${gmppkg}.tar.gz || { echo "** Failed to retrieve ${gmppkg}. Please check network connectivity or availability of the package on the server. Stop."; exit 1; }
|
---|
| 66 | echo -n "Unpacking ${gmppkg}... " && tar xzf ${gmppkg}.tar.gz && echo " done."
|
---|
| 67 | cd ${gmppkg}
|
---|
[3738] | 68 | ./configure --prefix=$PREFIX
|
---|
| 69 | make && make install
|
---|
| 70 | cd ..
|
---|
| 71 |
|
---|
| 72 | cd ..
|
---|
[9662] | 73 | ./configure --prefix=$PREFIX --with-boost=$PREFIX CPPFLAGS=-I$PREFIX/include LDFLAGS=-L$PREFIX/lib
|
---|
[3738] | 74 | make && make install
|
---|
| 75 |
|
---|
[9744] | 76 | echo "Done."
|
---|
| 77 |
|
---|
[3747] | 78 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/lib
|
---|
[9744] | 79 |
|
---|
| 80 | # end of script
|
---|