#! /bin/bash
lib_path=$(cd `dirname $0`; pwd)
if [ ! -d "${lib_path}/lib/" ];then
mkdir ${lib_path}/lib
echo "Please copy libxml2.so to the folder ${lib_path}/lib."
exit 1
fi
if [ ! -f "${lib_path}/lib/libxml2.so" ];then
echo "Please copy libxml2.so to the folder ${lib_path}/lib."
exit 1
fi
cd ${lib_path}/libxml_c
if [ -f "Makefile" ];then
make clean
fi
./configure
make
cd ${lib_path}/
echo start build xml_ffi
cjpm build -V
cp ${lib_path}/lib/*.so ${lib_path}/target/release/xml_ffi/
echo end build xml_ffi