2018-09-26 11:30:25 +08:00
|
|
|
#!/bin/bash
|
2018-04-26 00:48:39 +08:00
|
|
|
|
2018-02-09 00:25:58 +08:00
|
|
|
# fail on any errors
|
|
|
|
set -e
|
|
|
|
|
2018-09-26 11:30:25 +08:00
|
|
|
# parse the args
|
|
|
|
for args in $@
|
|
|
|
do
|
|
|
|
if [[ "$args" == "-l" ]]
|
|
|
|
then
|
|
|
|
BUILD_LOCAL=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2018-02-09 00:25:58 +08:00
|
|
|
# run autogen.sh
|
|
|
|
./autogen.sh
|
|
|
|
|
|
|
|
pwd=`pwd`
|
|
|
|
|
|
|
|
# Build library for host platform architecture
|
2018-09-26 11:30:25 +08:00
|
|
|
if [[ "x$BUILD_LOCAL" == "x" ]]
|
|
|
|
then
|
|
|
|
./configure --with-arch=host --enable-library=yes --host=x86_64-unknown-linux-gnu
|
|
|
|
else
|
|
|
|
# make sure host lib is build in local folder
|
|
|
|
echo "BUILD in local folder!"
|
|
|
|
rm -rf $pwd/local/
|
|
|
|
./configure --with-arch=host --enable-library=yes --host=x86_64-unknown-linux-gnu --prefix=$pwd/host-lib
|
|
|
|
fi
|
|
|
|
|
2018-02-09 00:25:58 +08:00
|
|
|
make
|
|
|
|
make install
|