-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathbuild_dependencies.sh
executable file
·140 lines (122 loc) · 4.63 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
OUTDIR=`pwd`/build-third/
mkdir -p $OUTDIR
mkdir -p $OUTDIR/lib
mkdir -p $OUTDIR/include
cd lib
echo "Building sqlite3..."
if [ ! -f $OUTDIR/include/sqlite3/sqlite3.hpp ]; then
mkdir -p $OUTDIR/include/sqlite3
cp sqlite3/sqlite3.h $OUTDIR/include/sqlite3
fi
if [ ! -f $OUTDIR/include/sqlite3/sqlite3.h ]; then echo "Failed"; exit; fi
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 gulrak/filesystem..."
if [ ! -f $OUTDIR/include/ghc/filesystem.hpp ]; then
mkdir -p $OUTDIR/include/ghc
cp filesystem/include/ghc/*.hpp $OUTDIR/include/ghc/
fi
if [ ! -f $OUTDIR/include/ghc/filesystem.hpp ]; then echo "Failed"; exit; fi
echo "Building stb..."
if [ ! -f $OUTDIR/include/stb/stb_image.h ]; then
mkdir -p $OUTDIR/include/stb
cp stb/*.h $OUTDIR/include/stb/
fi
if [ ! -f $OUTDIR/include/stb/stb_image.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
patch -p1 -s -N < ../patches/detex.patch
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 < ../patches/mupdf.patch
XCFLAGS=-fPIC make HAVE_X11=no HAVE_GLUT=no 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
git clean -f -d -x
autoreconf -fi
./configure --prefix=$OUTDIR \
--with-mbedtls=$OUTDIR --with-zlib="`pwd`/../mupdf/thirdparty/zlib/" \
--without-openssl --without-nghttp2 --without-libpsl --without-brotli --without-winidn --without-libidn2 --without-zstd \
--disable-shared --disable-crypto-auth --disable-ftp --disable-ldap --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/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
echo "Building QuickJS..."
if [ ! -f $OUTDIR/lib/libquickjs.a ]; then
cd QuickJS
if [ -f VERSION-QuickJS ]; then mv VERSION-QuickJS VERSION ; fi
make CC="gcc -fPIC" -j10 libquickjs.a
if [ -f VERSION ]; then mv VERSION VERSION-QuickJS ; fi
cp libquickjs.a $OUTDIR/lib
cd ..
fi
if [ ! -f $OUTDIR/lib/libquickjs.a ]; then echo "Failed"; exit; fi
cd ..