-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·37 lines (33 loc) · 998 Bytes
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
DIR=$PWD
NO_RECOMPILE=1
CMAKE=cmake
echo "" > config.mk
echo '#!/bin/bash' > ./cp_json-c.sh
chmod +x ./cp_json-c.sh
for arg in $@; do
echo $( echo "$arg" | cut -d '=' -f 1)
if [ "--compile-json-c" = $arg ]; then
git clone https://github.com/json-c/json-c.git
mkdir json-c-build
cd json-c-build
cmake3 --help >> /dev/null 2>&1
if [ $? == 0 ]; then
CMAKE=cmake3
fi
$CMAKE ../json-c/
make
cd -
NO_RECOMPILE=0
echo 'JSON_C_CFLAGS=-I./json-c -I./json-c-build' >> config.mk
echo 'JSON_C_LDFLAGS="-L./json-c-build"' >> config.mk
echo "cp json-c-build/libjson-c.so* json-search.AppDir/usr/lib/" >> ./cp_json-c.sh
fi
if [ "--help" = $arg ]; then
echo "--compile-json-c: clone and compile json-c"
fi
done
if [ $NO_RECOMPILE -eq 1 ]; then
echo JSON_C_CFLAGS=$(pkg-config --cflags json-c) >> config.mk
echo "cp \$(ldd json-search | grep json | cut -d ' ' -f 3) json-search.AppDir/usr/lib/" >> ./cp_json-c.sh
fi