diff --git a/build-win64.sh b/build-win64.sh new file mode 100755 index 0000000..d235199 --- /dev/null +++ b/build-win64.sh @@ -0,0 +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 \ No newline at end of file diff --git a/build.sh b/build.sh index 9132c4d..3e21969 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,5 @@ export ARCH=$(uname -m) +export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count / 2 ) ) }') while [[ $# -gt 0 ]]; do case $1 in diff --git a/scripts/build-ffmpeg.sh b/scripts/build-ffmpeg.sh index 30c418b..092ecab 100644 --- a/scripts/build-ffmpeg.sh +++ b/scripts/build-ffmpeg.sh @@ -9,9 +9,10 @@ make distclean ./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="clang -arch $ARCH" \ - --pkg-config-flags="--static" + --prefix=$PREFIX --enable-cross-compile --arch=$ARCH \ + --cc="$CC" --cxx="$CXX" \ + --pkg-config-flags="--static" --target-os=$FFMPEG_OS -make -j +make -j$JOBS -cp ffmpeg $outDir +cp ffmpeg* $outDir diff --git a/scripts/build-openh264.sh b/scripts/build-openh264.sh index 36b340b..baf231d 100644 --- a/scripts/build-openh264.sh +++ b/scripts/build-openh264.sh @@ -16,11 +16,11 @@ git clone https://github.com/cisco/openh264 $projectDir -b v$OPENH264_VERSION -- cd $projectDir -args="PREFIX=$PREFIX ARCH=$ARCH" +args="PREFIX=$PREFIX OS=$OPENH264_OS ARCH=$OPENH264_ARCH CC=$CC CXX=$CXX AR=$AR" make clean -make -j $args +make -j$JOBS $args make install-static $args