fix: build error

main
paring 2023-05-04 19:32:30 +09:00
parent 8e08ae7e76
commit 8d23b76738
Signed by: pikokr
GPG Key ID: 8C7ABCEF704FD728
4 changed files with 12 additions and 5 deletions

5
build-mac-arm64.sh Executable file
View File

@ -0,0 +1,5 @@
export OPENH264_ARCH=arm64
export OPENH264_OS=darwin
export FFMPEG_ARCH=arm64
bash build.sh --arch arm64

View File

@ -2,6 +2,10 @@ export ARCH=$(uname -m)
# do not use all cpus because my computer dies # do not use all cpus because my computer dies
export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count - 1 ) ) }') export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count - 1 ) ) }')
if [[ "$(uname)" == "Darwin" ]]; then
export JOBS=$(awk -v count=$(sysctl -n hw.ncpu) 'BEGIN { print ( int ( count - 1 ) ) }')
fi
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--arch) --arch)

View File

@ -12,15 +12,13 @@ cp -r $amfPath/amf/public/include $PREFIX/include/AMF
make distclean make distclean
flags="--cc=$CC --cxx=$CXX"
if [[ $FFMPEG_MSVC == 1 ]]; then if [[ $FFMPEG_MSVC == 1 ]]; then
flags="--toolchain=msvc" flags="--toolchain=msvc"
fi fi
./configure --disable-gpl --disable-nonfree --disable-doc --disable-network \ LDFLAGS="-arch $ARCH" ./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 --cc="${CC:-clang -arch $ARCH}" --cxx="${CXX:-g++ -arch $ARCH}" \
--prefix=$PREFIX --enable-cross-compile --arch=$ARCH \ --prefix=$PREFIX --enable-cross-compile --arch=$ARCH \
--pkg-config-flags="--static" --target-os=$FFMPEG_OS \ --pkg-config-flags="--static" --target-os=$FFMPEG_OS \
${flags} ${FFBUILD_FLAGS} ${flags} ${FFBUILD_FLAGS}

View File

@ -16,7 +16,7 @@ git clone https://github.com/cisco/openh264 $projectDir -b v$OPENH264_VERSION --
cd $projectDir cd $projectDir
args="PREFIX=$PREFIX OS=$OPENH264_OS ARCH=$OPENH264_ARCH CC=$CC CXX=$CXX AR=$AR" args="PREFIX=$PREFIX OS=$OPENH264_OS ARCH=$OPENH264_ARCH CC=\"${CC:-clang}\" CXX=\"${CXX:-g++}\" AR=\"${AR:-ar}\""
make clean make clean