Compare commits

...

2 Commits

Author SHA1 Message Date
paring 96da216d55 feat: win32 build support 2023-05-03 18:43:41 +09:00
paring 0cfb7b5ffa feat: windows build script 2023-05-03 18:06:33 +09:00
5 changed files with 18 additions and 5 deletions

3
build-current.sh Normal file
View File

@ -0,0 +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

3
build-win32.sh Normal file
View File

@ -0,0 +1,3 @@
TOOLCHAIN=i686-w64-mingw32
FFMPEG_OS=win32 FFMPEG_MSBUILD=1 OPENH264_ARCH=i686 OPENH264_OS=msvc CC=cl CXX=cl AR=lib bash build.sh --arch i686

View File

@ -1,3 +1,3 @@
TOOLCHAIN=x86_64-w64-mingw32
FFMPEG_OS=win64 OPENH264_ARCH=x86_64 OPENH264_OS=mingw_nt CC=$TOOLCHAIN-gcc CXX=$TOOLCHAIN-g++ AR=$TOOLCHAIN-ar bash build.sh --arch x86_64
FFMPEG_OS=win64 FFMPEG_MSBUILD=1 OPENH264_ARCH=x86_64 OPENH264_OS=msvc CC=cl CXX=cl AR=lib bash build.sh --arch x86_64

View File

@ -1,5 +1,6 @@
export ARCH=$(uname -m)
export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count / 2 ) ) }')
# do not use all cpus because my computer dies
export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count - 1 ) ) }')
while [[ $# -gt 0 ]]; do
case $1 in

View File

@ -1,17 +1,23 @@
export ffmpegPath=$workDir/ffmpeg
git clone https://github.com/FFmpeg/FFmpeg $ffmpegPath --depth 1
git clone https://github.com/FFmpeg/FFmpeg -b release/6.0 $ffmpegPath --depth 1
cd $ffmpegPath
make distclean
flags="--cc=$CC --cxx=$CXX"
if [[ -z $FFMPEG_MSVC ]]; then
flags="--toolchain=msvc"
fi
./configure --disable-gpl --disable-nonfree --disable-doc --disable-network \
--disable-ffprobe --disable-ffplay --enable-static --disable-shared \
--enable-libopenh264 \
--prefix=$PREFIX --enable-cross-compile --arch=$ARCH \
--cc="$CC" --cxx="$CXX" \
--pkg-config-flags="--static" --target-os=$FFMPEG_OS
--pkg-config-flags="--static" --target-os=$FFMPEG_OS \
${flags}
make -j$JOBS