Compare commits

...

2 Commits

Author SHA1 Message Date
paring 8d23b76738
fix: build error 2023-05-04 19:32:30 +09:00
paring 8e08ae7e76 fix: build issue 2023-05-04 17:48:53 +09:00
7 changed files with 19 additions and 9 deletions

2
build-current.sh Normal file → Executable file
View File

@ -1,3 +1,3 @@
export OPENH264_OS=$(uname | tr A-Z a-z | tr -d \\-0-9. | sed -E 's/^(net|open|free)bsd/bsd/')
CC=gcc CXX=g++ AR=ar bash build.sh
CC=gcc CXX=g++ AR=ar bash build.sh $@

0
build-docker.sh Normal file
View File

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

5
build-win.sh Executable file
View File

@ -0,0 +1,5 @@
set -x
export TOOLCHAIN=x86_64-w64-mingw32
OPENH264_OS=mingw_nt OPENH264_ARCH=x86_64 CC=$TOOLCHAIN-gcc CXX=$TOOLCHAIN-g++ AR=$TOOLCHAIN-ar bash build.sh

View File

@ -2,6 +2,10 @@ export ARCH=$(uname -m)
# do not use all cpus because my computer dies
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
case $1 in
--arch)

View File

@ -12,19 +12,15 @@ cp -r $amfPath/amf/public/include $PREFIX/include/AMF
make distclean
flags="--cc=$CC --cxx=$CXX"
if [[ -z $FFMPEG_MSVC ]]; then
if [[ $FFMPEG_MSVC == 1 ]]; then
flags="--toolchain=msvc"
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 \
--enable-libopenh264 \
--enable-libopenh264 --cc="${CC:-clang -arch $ARCH}" --cxx="${CXX:-g++ -arch $ARCH}" \
--prefix=$PREFIX --enable-cross-compile --arch=$ARCH \
--pkg-config-flags="--static" --target-os=$FFMPEG_OS \
--extra-ldflags="-libpath:$PREFIX/lib" \
--extra-cflags="-I$PREFIX/include/mfx" \
${flags} ${FFBUILD_FLAGS}
make -j$JOBS

View File

@ -16,7 +16,7 @@ git clone https://github.com/cisco/openh264 $projectDir -b v$OPENH264_VERSION --
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