2023-05-23 23:36:06 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
. ./sdk.sh
|
2023-08-01 02:02:59 +03:00
|
|
|
JPEG_VERSION=3.0.0
|
2023-05-23 23:36:06 +02:00
|
|
|
|
|
|
|
if [ ! -d libjpeg-src ]; then
|
|
|
|
wget https://download.sourceforge.net/libjpeg-turbo/libjpeg-turbo-$JPEG_VERSION.tar.gz
|
2023-08-01 02:02:59 +03:00
|
|
|
tar -xzf libjpeg-turbo-$JPEG_VERSION.tar.gz
|
2023-05-23 23:36:06 +02:00
|
|
|
mv libjpeg-turbo-$JPEG_VERSION libjpeg-src
|
|
|
|
rm libjpeg-turbo-$JPEG_VERSION.tar.gz
|
|
|
|
mkdir libjpeg-src/build
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd libjpeg-src/build
|
|
|
|
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DENABLE_SHARED=OFF \
|
|
|
|
-DCMAKE_C_FLAGS_RELEASE="$CFLAGS"
|
|
|
|
|
2023-08-01 02:02:59 +03:00
|
|
|
cmake --build . -j${NPROC}
|
2023-05-23 23:36:06 +02:00
|
|
|
|
|
|
|
# update `include` folder
|
|
|
|
rm -rf ../../libjpeg/include
|
|
|
|
mkdir -p ../../libjpeg/include
|
|
|
|
cp -a ../*.h ../../libjpeg/include
|
|
|
|
cp -a *.h ../../libjpeg/include
|
|
|
|
# update lib
|
|
|
|
rm -rf ../../libjpeg/lib
|
|
|
|
mkdir -p ../../libjpeg/lib
|
|
|
|
cp libjpeg.a ../../libjpeg/lib
|
|
|
|
|
|
|
|
echo "libjpeg build successful"
|