#编译脚本 build.sh
#!/bin/bash
gcc_prefix=$1
install_dir=$2
cache_dir=$3
host_name=" "
if test -z ${gcc_prefix} ;then
gcc_prefix=/usr/bin/
else
host_name=arm-linux
fi
if test -z ${install_dir} ;then
install_dir=$(pwd)/install
fi
if test -z ${cache_dir} ;then
cache_dir=$(pwd)/out
fi
echo "gcc_prefix=${gcc_prefix}"
echo "install_dir=${install_dir}"
echo "cache_dir=${cache_dir}"
echo "host_name=${host_name}"
cd ./libjpeg;
./configure --prefix=${cache_dir} --exec-prefix=${cache_dir} --enable-shared --enable-static --host=${host_name} CC=${gcc_prefix}gcc LD=${gcc_prefix}ld
make -s &&make install
rm -rf ${install_dir}
mkdir -p ${install_dir}
mkdir -p ${install_dir}/lib
cp -r ${cache_dir}/include ${install_dir}
cp -r ${cache_dir}/lib/libjpeg.a ${install_dir}/lib
#rm ${cache_dir} -rf
#测试文件 main.cpp
#include <setjmp.h>
#include<cstdio>
#include "jp
LIBJPEG交叉编译并用其将ARGB32转JPEG
最新推荐文章于 2024-04-30 18:08:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)