feat: support build of different architecture

main
paring 2023-05-02 21:03:21 +09:00
parent aa6b3b09bc
commit d35d933b8e
Signed by: pikokr
GPG Key ID: 8C7ABCEF704FD728
3 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,18 @@
export ARCH=$(uname -m)
while [[ $# -gt 0 ]]; do
case $1 in
--arch)
export ARCH=$2
shift 2
;;
*)
echo "Usage: $0 --arch [arch]"
exit 1
;;
esac
done
export workDir=$(pwd)/work export workDir=$(pwd)/work
export outDir=$(pwd)/out export outDir=$(pwd)/out
export PREFIX=$workDir/prefix export PREFIX=$workDir/prefix
@ -5,8 +20,10 @@ export PREFIX=$workDir/prefix
export PKG_CONFIG_DIR=$PREFIX/lib/pkgconfig export PKG_CONFIG_DIR=$PREFIX/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_DIR export PKG_CONFIG_PATH=$PKG_CONFIG_DIR
rm -rf $PREFIX
mkdir -p $PREFIX
mkdir -p $workDir mkdir -p $workDir
mkdir -p $prefix
mkdir -p $outDir mkdir -p $outDir
bash scripts/build-openh264.sh bash scripts/build-openh264.sh

View File

@ -9,7 +9,7 @@ make distclean
./configure --disable-gpl --disable-nonfree --disable-doc --disable-network \ ./configure --disable-gpl --disable-nonfree --disable-doc --disable-network \
--disable-ffprobe --disable-ffplay --enable-static --disable-shared \ --disable-ffprobe --disable-ffplay --enable-static --disable-shared \
--enable-libopenh264 \ --enable-libopenh264 \
--prefix=$PREFIX --prefix=$PREFIX --enable-cross-compile --arch=$ARCH --cc="clang -arch $ARCH"
make -j make -j

View File

@ -18,7 +18,9 @@ cd $projectDir
git checkout tags/v$OPENH264_VERSION -b v$OPENH264_VERSION git checkout tags/v$OPENH264_VERSION -b v$OPENH264_VERSION
args="PREFIX=$PREFIX" args="PREFIX=$PREFIX ARCH=$ARCH"
make clean
make -j $args make -j $args