forked from fpw/avitab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_dependencies.sh
executable file
·109 lines (95 loc) · 3.62 KB
/
build_dependencies.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
OUTDIR=`pwd`/build-third/
mkdir -p $OUTDIR
mkdir -p $OUTDIR/lib
mkdir -p $OUTDIR/include
cd lib
echo "Building json..."
if [ ! -f $OUTDIR/include/nlohmann/json.hpp ]; then
cp -a json/include/* $OUTDIR/include/
fi
if [ ! -f $OUTDIR/include/nlohmann/json.hpp ]; then echo "Failed"; exit; fi
echo "Building stb..."
if [ ! -f $OUTDIR/include/stb/stb.h ]; then
mkdir -p $OUTDIR/include/stb
cp stb/*.h $OUTDIR/include/stb/
fi
if [ ! -f $OUTDIR/include/stb/stb.h ]; then echo "Failed"; exit; fi
echo "Building XPLM..."
if [ ! -f $OUTDIR/include/XPLM/XPLMPlugin.h ]; then
cp -a XSDK/CHeaders/XPLM $OUTDIR/include
cp XSDK/Libraries/Win/* $OUTDIR/lib
cp -a XSDK/Libraries/Mac/* $OUTDIR/lib
fi
if [ ! -f $OUTDIR/include/XPLM/XPLMPlugin.h ]; then echo "Failed"; exit; fi
echo "Building detex..."
if [ ! -f $OUTDIR/lib/libdetex.a ]; then
cd detex
OPTCFLAGS=-fPIC make library
make HEADER_FILE_INSTALL_DIR=$OUTDIR/include STATIC_LIB_DIR=$OUTDIR/lib install
cd ..
fi
if [ ! -f $OUTDIR/lib/libdetex.a ]; then echo "Failed"; exit; fi
echo "Building mupdf..."
if [ ! -f $OUTDIR/lib/libmupdf-third.a ]; then
cd mupdf
patch -p1 -s -N < ../mupdf.diff
XCFLAGS=-fPIC HAVE_X11=no HAVE_GLUT=no make prefix=$OUTDIR -j10 install
cd thirdparty/libjpeg
./configure
cd ../../../
fi
if [ ! -f $OUTDIR/lib/libmupdf-third.a ]; then echo "Failed"; exit; fi
echo "Building mbedtls..."
if [ ! -f $OUTDIR/lib/libmbedtls.a ]; then
cd mbedtls
mkdir -p build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fPIC -DCMAKE_INSTALL_PREFIX="" -DCMAKE_HOST_UNIX=ON ..
make -j10 DESTDIR=$OUTDIR install
cd ../../
fi
if [ ! -f $OUTDIR/lib/libmbedtls.a ]; then echo "Failed"; exit; fi
echo "Building curl..."
if [ ! -f $OUTDIR/lib/libcurl.a ]; then
cd curl
./buildconf
./configure --prefix=$OUTDIR --without-ssl --without-nghttp2 --with-mbedtls=$OUTDIR --with-zlib="`pwd`/../mupdf/thirdparty/zlib/" --without-libpsl --disable-ldap --without-brotli --without-winidn --without-libidn2 --disable-shared --disable-crypto-auth --disable-ftp --disable-telnet --disable-gopher --disable-dict --disable-imap --disable-pop3 --disable-rtsp --disable-smtp --disable-tftp
CFLAGS=-fPIC make -j10 install
cd ..
fi
if [ ! -f $OUTDIR/lib/libcurl.a ]; then echo "Failed"; exit; fi
echo "Building libtiff..."
if [ ! -f $OUTDIR/lib/libtiff.a ]; then
cd libtiff
./autogen.sh
CFLAGS=-fPIC ./configure --prefix=$OUTDIR --build=x86_64 --disable-jbig --disable-lzma --without-x
make -j10 install
cd ..
fi
if [ ! -f $OUTDIR/lib/libtiff.a ]; then echo "Failed"; exit; fi
echo "Building libproj..."
if [ ! -f $OUTDIR/lib/libproj_5_2.a ] || [ ! -f $OUTDIR/lib/libproj.a ]; then
cd proj
mkdir -p build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DPROJ_TESTS=OFF -DBUILD_LIBPROJ_SHARED=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_INSTALL_PREFIX=$OUTDIR -DLIBDIR=$OUTDIR/lib -DINCLUDEDIR=$OUTDIR/include -DBINDIR=$OUTDIR/bin ..
cd src
make -j10 install
cp $OUTDIR/lib/libproj.a $OUTDIR/lib/libproj_5_2.a
cp $OUTDIR/lib/libproj_5_2.a $OUTDIR/lib/libproj.a
cd ../../..
fi
if [ ! -f $OUTDIR/lib/libproj_5_2.a ]; then echo "Failed"; exit; fi
echo "Building libgeotiff..."
if [ ! -f $OUTDIR/lib/libgeotiff.a ]; then
cd libgeotiff
mkdir -p build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$OUTDIR -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fPIC -DCMAKE_PREFIX_PATH="`pwd`/../../" ..
make -j10 install
cp lib/libxtiff.a $OUTDIR/lib
cd ../..
fi
if [ ! -f $OUTDIR/lib/libgeotiff.a ]; then echo "Failed"; exit; fi
cd ..