30 lines
817 B
Bash
Executable File
30 lines
817 B
Bash
Executable File
#!/bin/bash
|
|
#compile libconfig to a library
|
|
platform=$1
|
|
CROSS_COMPILER_PATH=$2
|
|
CROSS_COMPILER=$3
|
|
echo "Compile libconfig, platform = $platform."
|
|
echo "CROSS_COMPILER = $CROSS_COMPILER"
|
|
echo "Start to compile libconfig."
|
|
export ROOT_PATH=$PWD
|
|
if [ ! -d "./libconfig-1.7.3" ];then
|
|
echo "tar zxvf libconfig-1.7.3.tar.gz"
|
|
tar zxvf libconfig-1.7.3.tar.gz
|
|
fi
|
|
if [ ! -f "./libconfig-1.7.3/lib/.libs/libconfig++.a" ] || [ ! -f "./libconfig-1.7.3/lib/.libs/libconfig.a" ];then
|
|
echo "make libconfig++.a"
|
|
cd ./libconfig-1.7.3
|
|
case $platform in
|
|
"linux")
|
|
echo "==Compile linux."
|
|
./configure --disable-cxx --enable-static=yes
|
|
make
|
|
;;
|
|
*)
|
|
echo "==Compile cross compile."
|
|
./configure --host=$CROSS_COMPILER --disable-cxx --enable-static=yes
|
|
make
|
|
;;
|
|
esac
|
|
fi
|
|
cd $ROOT_PATH |