feat(3psw): Add cross-compilation script of library.
1. Add 3 part software packages and its build script . 2. Add toolchain.
This commit is contained in:
87
packages/build_packages.sh
Normal file
87
packages/build_packages.sh
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
|
||||
##CROSS_COMPILE=/opt/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
|
||||
TOOLCHAIN_DIR="/opt/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin"
|
||||
CROSS_PREFIX="arm-none-linux-gnueabihf"
|
||||
|
||||
readonly PKG_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
tar -zxvf cJSON-v1.7.18.tar.gz
|
||||
tar -zxvf freetype-2.13.2.tar.gz
|
||||
tar -zxvf glew-2.1.0.tgz
|
||||
tar -zxvf jpegsrc.v9c.tar.gz
|
||||
tar -zxvf libpng-1.6.34.tar.gz
|
||||
tar -zxvf zlib-1.2.11.tar.gz
|
||||
|
||||
mkdir -p install
|
||||
|
||||
export CC=${TOOLCHAIN_DIR}/${CROSS_PREFIX}-gcc
|
||||
export CXX=${TOOLCHAIN_DIR}/${CROSS_PREFIX}-g++
|
||||
export LD=${TOOLCHAIN_DIR}/${CROSS_PREFIX}-ld
|
||||
export AR=${TOOLCHAIN_DIR}/${CROSS_PREFIX}-ar
|
||||
export RANLIB=${TOOLCHAIN_DIR}/${CROSS_PREFIX}-ranlib
|
||||
|
||||
export CFLAGS="-I${PKG_DIR}/install/include"
|
||||
export CPPFLAGS="-I${PKG_DIR}/install/include"
|
||||
export LDFLAGS="-L${PKG_DIR}/install/lib"
|
||||
|
||||
# 1. zlib
|
||||
cd zlib-1.2.11
|
||||
./configure \
|
||||
--prefix=${PKG_DIR}/install \
|
||||
--host=${CROSS_PREFIX} \
|
||||
--enable-shared \
|
||||
--enable-static
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
# 2. libpng
|
||||
cd libpng-1.6.34
|
||||
./configure \
|
||||
--prefix=${PKG_DIR}/install \
|
||||
--host=${CROSS_PREFIX} \
|
||||
--enable-shared \
|
||||
--enable-static
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
# 3. JPEG
|
||||
cd jpeg-9c
|
||||
./configure \
|
||||
--prefix=${PKG_DIR}/install \
|
||||
--host=${CROSS_PREFIX} \
|
||||
--enable-shared \
|
||||
--enable-static
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
#4.Freetype
|
||||
cd freetype-2.13.2
|
||||
./configure \
|
||||
--prefix=${PKG_DIR}/install \
|
||||
--host=${CROSS_PREFIX} \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--without-brotli
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
# 5. GLEW(DRM)
|
||||
cd glew-2.1.0
|
||||
make
|
||||
make install GLEW_DEST=${PKG_DIR}/install
|
||||
cd ..
|
||||
|
||||
#6. CJson
|
||||
cd cJSON-v1.7.18
|
||||
mkdir -P build
|
||||
cd build
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=${PKG_DIR}/install -DBUILD_SHARED_LIBS=OFF #static complie
|
||||
make
|
||||
make install
|
||||
cd ../../
|
||||
|
||||
BIN
packages/cJSON-v1.7.18.tar.gz
Normal file
BIN
packages/cJSON-v1.7.18.tar.gz
Normal file
Binary file not shown.
BIN
packages/freetype-2.13.2.tar.gz
Normal file
BIN
packages/freetype-2.13.2.tar.gz
Normal file
Binary file not shown.
BIN
packages/glew-2.1.0.tgz
Normal file
BIN
packages/glew-2.1.0.tgz
Normal file
Binary file not shown.
BIN
packages/jpegsrc.v9c.tar.gz
Normal file
BIN
packages/jpegsrc.v9c.tar.gz
Normal file
Binary file not shown.
BIN
packages/libpng-1.6.34.tar.gz
Normal file
BIN
packages/libpng-1.6.34.tar.gz
Normal file
Binary file not shown.
BIN
packages/zlib-1.2.11.tar.gz
Normal file
BIN
packages/zlib-1.2.11.tar.gz
Normal file
Binary file not shown.
1
toolchain/README.txt
Normal file
1
toolchain/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
Suggest: please decompress this toolchain to "/opt/" on your Ubuntu.
|
||||
Binary file not shown.
Reference in New Issue
Block a user