Skip to content

Commit 7dcdf1b

Browse files
committed
update script, get working again
1 parent 064ef84 commit 7dcdf1b

File tree

1 file changed

+38
-19
lines changed

1 file changed

+38
-19
lines changed

cross_compile_ffmpeg.sh

+38-19
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ ffmbcver="FFmbc-0.7-rc8"
5353
fflight=false
5454
# Ask me questions and show the intro or run only with options configured above! (default: true)
5555
askmequestions=true
56-
56+
###
57+
if ${ffmbc}
58+
then
59+
ffvanilla=true
60+
ffnonfree=false
61+
askmequestions=false
62+
ffmpeg=false
63+
fflight=false
64+
fi
5765
################################################################################
5866

5967
type -p lib.exe >/dev/null 2>&1 && libexeok=true || libexeok=false
@@ -194,7 +202,7 @@ install_cross_compiler() {
194202

195203
wget http://zeranoe.com/scripts/mingw_w64_build/mingw-w64-build-3.1.0 -O mingw-w64-build-3.1.0
196204
chmod u+x mingw-w64-build-3.1.0
197-
./mingw-w64-build-3.1.0 --mingw-w64-ver=2.0.7 --disable-nls --disable-shared --default-configure --clean-build || exit 1
205+
./mingw-w64-build-3.1.0 --mingw-w64-ver=2.0.7 --disable-nls --disable-shared --default-configure --clean-build --threads=pthreads-w32 || exit 1
198206
if [ -d mingw-w64-x86_64 ]
199207
then
200208
touch mingw-w64-x86_64/compiler.done
@@ -331,11 +339,13 @@ do_make_install() {
331339
download_and_unpack_file() {
332340
url="$1"
333341
output_name=$(basename $url)
342+
echo $output_name
334343
output_dir="$2"
335344
if [ ! -f "$output_dir/unpacked.successfully" ]
336345
then
337-
if [ ! -f "$output_name" ]
346+
if [ ! -s "$output_name" ]
338347
then
348+
rm $output_name
339349
wget "$url" -O "$output_name" || exit 1
340350
fi
341351
tar -xf "$output_name" || unzip $output_name || exit 1
@@ -370,12 +380,14 @@ build_librtmp() {
370380
local localdir="rtmpdump_git"
371381
do_git_checkout "http://repo.or.cz/r/rtmpdump.git" ${localdir}
372382
cd ${archdir}/${localdir}/librtmp
373-
if [ ! -f "already_gnutls" ]
374-
then
375-
make install CRYPTO=GNUTLS OPT='-O2 -g' "CROSS_COMPILE=$cross_prefix" SHARED=no "prefix=$mingwprefix" && touch already_gnutls || exit 1
376-
fi
377-
touch already_ran_make_install
378-
echo -e "${PASS}Successfully did make and install librtmp ${RST}\n"
383+
if [ ! -f "already_ran_make_install" ]
384+
then
385+
#do_make_install "CRYPTO=GNUTLS OPT=-O2 CROSS_COMPILE=$cross_prefix SHARED=no prefix=$mingwprefix"
386+
make install CRYPTO=GNUTLS OPT='-O2 -g' "CROSS_COMPILE=$cross_prefix" SHARED=no "prefix=$mingwprefix" || exit 1
387+
#sed -i 's/-lrtmp -lz/-lrtmp -lwinmm -lz/' "$PKG_CONFIG_PATH/librtmp.pc"
388+
fi
389+
touch already_ran_make_install
390+
echo -e "${PASS}Successfully did make and install librtmp ${RST}\n"
379391
cd ${archdir}
380392
}
381393

@@ -499,8 +511,10 @@ build_libfribidi() {
499511
cd ${archdir}/${localdir}
500512
if [[ ! -f already_ran_make ]]
501513
then
502-
sed -i -e '/(defined(_WIN32_WCE))/,+2d' lib/fribidi-common.h
503-
sed -i -e '/!WIN32/,d' lib/fribidi-common.h
514+
# sed -i -e '/(defined(_WIN32_WCE))/,+2d' lib/fribidi-common.h
515+
# sed -i -e '/!WIN32/,d' lib/fribidi-common.h
516+
sed -i -e '/#ifndef\sFRIBIDI_ENTRY/,+3d' lib/fribidi-common.h
517+
sed -i -e '/!WIN32/,+1d' lib/fribidi-common.h
504518
fi
505519
generic_configure
506520
do_make_install
@@ -624,15 +638,15 @@ build_fdk_aac() {
624638
}
625639

626640
build_libexpat() {
627-
generic_download_and_install http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download expat-2.1.0 --with-gnu-ld
641+
generic_download_and_install http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz expat-2.1.0 --with-gnu-ld
628642
}
629643

630644
build_freetype() {
631645
generic_download_and_install http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz freetype-2.4.10
632646
}
633647

634648
build_vo_aacenc() {
635-
generic_download_and_install http://sourceforge.net/projects/opencore-amr/files/vo-aacenc/vo-aacenc-0.1.2.tar.gz/download vo-aacenc-0.1.2
649+
generic_download_and_install http://sourceforge.net/projects/opencore-amr/files/vo-aacenc/vo-aacenc-0.1.2.tar.gz vo-aacenc-0.1.2
636650
}
637651

638652
build_sdl() {
@@ -667,7 +681,7 @@ build_faac() {
667681
}
668682

669683
build_lame() {
670-
generic_download_and_install http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz/download lame-3.99.5
684+
generic_download_and_install http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz lame-3.99.5
671685
}
672686

673687
build_bz2() {
@@ -747,23 +761,23 @@ build_ffmbc() {
747761
echo -e "${PASS}Already patched ${file2patch} ${RST}"
748762
else
749763
echo -e "${INFO}Patching ${file2patch} ${RST}"
750-
sed -i '28 i#include \"dxva.h\"' $file2patch
764+
#sed -i '28 i#include \"dxva.h\"' $file2patch
751765
fi
752766
file2patch="libavdevice/dshow_filter.c"
753767
if grep -Fxq "#define NO_DSHOW_STRSAFE" $file2patch
754768
then
755769
echo -e "${PASS}Already patched ${file2patch} ${RST}"
756770
else
757771
echo -e "${INFO}Patching ${file2patch} ${RST}"
758-
sed -i '22 i#define NO_DSHOW_STRSAFE' $file2patch
772+
#sed -i '22 i#define NO_DSHOW_STRSAFE' $file2patch
759773
fi
760774
local file2patch="libavdevice/dshow_pin.c"
761775
if grep -Fxq "#define NO_DSHOW_STRSAFE" $file2patch
762776
then
763777
echo -e "${PASS}Already patched ${file2patch} ${RST}"
764778
else
765779
echo -e "${INFO}Patching ${file2patch} ${RST}"
766-
sed -i '22 i#define NO_DSHOW_STRSAFE' $file2patch
780+
#sed -i '22 i#define NO_DSHOW_STRSAFE' $file2patch
767781
fi
768782

769783
if [[ "$1" = "shared" ]]
@@ -794,7 +808,12 @@ build_ffmbc() {
794808
fi
795809

796810
config_options="--prefix=$ffinstallpath --enable-memalign-hack --arch=$arch --enable-gpl --enable-avisynth --target-os=mingw32 --cross-prefix=$cross_prefix"
797-
config_options="$config_options --pkg-config=pkg-config --enable-runtime-cpudetect --enable-cross-compile --disable-w32threads --extra-cflags=-DPTW32_STATIC_LIB"
811+
config_options="$config_options --pkg-config=pkg-config --enable-runtime-cpudetect --enable-cross-compile --enable-pthreads --extra-cflags=-DPTW32_STATIC_LIB"
812+
### nothing -> won't build (pthread linker error)
813+
### --disable-w32threads --extra-cflags=-DPTW32_STATIC_LIB" -> only 1 CPU used
814+
### --disable-pthreads -> only 1 CPU used
815+
### --disable-pthreads --enable-w32threads -> The requested thread algorithm is not supported with this thread library. only one CPU used
816+
### --enable-pthreads --disable-w32threads -> won't build (pthreads linker error)
798817
if ! $ffvanilla
799818
then
800819
config_options="$config_options --enable-zlib --enable-bzlib --enable-libx264 --enable-libmp3lame --enable-libvpx --extra-libs=-lws2_32 --extra-libs=-lpthread"
@@ -1083,7 +1102,7 @@ fi
10831102

10841103
export PATH="${original_path}"
10851104
cd ${basedir}
1086-
echo -e "${PASS}\n All complete. Ending ffmpeg cross compiler script.\n${PASS} Bye. ;-) ${RST}\n "
1105+
echo -e "${PASS}\n All complete. Ending ffmpeg cross compiler script.\n${PASS} Bye.${RST}\n "
10871106

10881107
exit 0
10891108

0 commit comments

Comments
 (0)