-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.ffmpeg-cross
140 lines (120 loc) · 4.24 KB
/
Makefile.ffmpeg-cross
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
##################################################################
#
# Build ffmpeg from web cross compile for win32 and win64.
#
# Dennis Zierahn
#
all:
echo "pupsi....."
#####################################################################
#
# Local setup
#
ffmpeg-win32-doit:
if ! [ -d "../ffmpeg-win32" ]; then \
if ! [ -d "./ffmpeg-win32" ]; then \
mkdir ffmpeg-win32; \
ln -s ../Makefile.ffmpeg-cross ffmpeg-win32/Makefile; \
fi; \
cd ./ffmpeg-win32; make ffmpeg-win32-work; \
fi; \
ffmpeg-win64-doit:
if ! [ -d "../ffmpeg-win64" ]; then \
if ! [ -d "./ffmpeg-win64" ]; then \
mkdir ffmpeg-win64; \
ln -s ../Makefile.ffmpeg-cross ffmpeg-win64/Makefile; \
fi; \
cd ./ffmpeg-win64; make ffmpeg-win64-work; \
fi; \
#####################################################################
#
# ffmpeg
#
patches:
mkdir patches
cp ../patches/uname patches
chmod a+x patches/uname
dezi.build32.done: patches sandbox/mingw-w64-build-3.5.8
if ! [ -f "dezi.build32.done" ]; then \
cd sandbox; ./mingw-w64-build-3.5.8 \
--cpu-count=4 --build-type=win32 \
--mingw-w64-ver=svn \
--disable-shared --default-configure \
--clean-build --threads=pthreads-w32 || exit 1; \
cd ..; tar -cvzf dezi.build32.tar.gz sandbox; \
fi
touch dezi.build32.done
dezi.build64.done: patches sandbox/mingw-w64-build-3.5.8
if ! [ -f "dezi.build64.done" ]; then \
cd sandbox; ./mingw-w64-build-3.5.8 \
--cpu-count=4 --build-type=win64 \
--mingw-w64-ver=svn \
--disable-shared --default-configure \
--clean-build --threads=pthreads-w32 || exit 1; \
cd ..; tar -cvzf dezi.build64.tar.gz sandbox; \
fi
touch dezi.build64.done
dezi.ffmpeg32.done: cross_compile_ffmpeg_dezi.sh
export PATH="$$PWD/patches:$$PATH"; \
./cross_compile_ffmpeg_dezi.sh --sandbox-ok=y || exit 1
touch dezi.ffmpeg32.done
dezi.ffmpeg64.done: cross_compile_ffmpeg_dezi.sh
export PATH="$$PWD/patches:$$PATH"; \
./cross_compile_ffmpeg_dezi.sh --sandbox-ok=y || exit 1
touch dezi.ffmpeg64.done
ffmpeg-win32-work: dezi.build32.done dezi.ffmpeg32.done
ffmpeg-win64-work: dezi.build64.done dezi.ffmpeg64.done
#####################################################################
#
# mingw => get the original build compile script from web.
#
sandbox:
mkdir sandbox
sandbox/mingw-w64-build-3.5.8: sandbox
cd sandbox; \
curl http://zeranoe.com/scripts/mingw_w64_build/mingw-w64-build-3.5.8 -O || exit 1; \
chmod a+x mingw-w64-build-3.5.8; \
sed -i 's/grep -c processor \/proc\/cpuinfo/echo 4/g' mingw-w64-build-3.5.8 ;\
#sed -i 's/grep -c processor \/proc\/cpuinfo/grep -s -c processor \/proc\/cpuinfo || echo 2/g' mingw-w64-build-3.5.8
#####################################################################
#
# ffmpeg => get the original cross compile script from web.
#
cross_compile_ffmpeg.sh:
wget https://raw.github.com/rdp/ffmpeg-windows-build-helpers/master/cross_compile_ffmpeg.sh
chmod a+x cross_compile_ffmpeg.sh
sed -i 's/grep -c processor \/proc\/cpuinfo/echo 4/g' cross_compile_ffmpeg.sh
sed -i 's/generic_configure # unfortunately/generic_configure "--cross-prefix=$$cross_prefix" # unfortunately/g' cross_compile_ffmpeg.sh
#####################################################################
#
# ffmpeg => add gpac stuff for MP4Box to script.
# also add vf_logo.c filter stuff.
#
cross_compile_ffmpeg_dezi.sh: cross_compile_ffmpeg.sh
cp -p cross_compile_ffmpeg.sh cross_compile_ffmpeg_dezi.sh
sed -i '/unset user_input/ a\user_input=y; return' cross_compile_ffmpeg_dezi.sh
sed -i 's/install_cross_compiler #/#install_cross_compiler #/g' cross_compile_ffmpeg_dezi.sh
sed -i 's/build_ffmpeg shared/#build_ffmpeg shared/g' cross_compile_ffmpeg_dezi.sh
sed -i \
-e '/build_ffmpeg()/{' \
-e 'h' \
-e 'r ../patches/ffmpeg-cross-gpac.txt' \
-e 'g' \
-e 'N' \
-e '}' cross_compile_ffmpeg_dezi.sh
sed -i '/build_dependencies$$/ a\ build_gpac' cross_compile_ffmpeg_dezi.sh
sed -i \
-e '/build_ffmpeg()/{' \
-e 'h' \
-e 'r ../patches/ffmpeg-cross-libmxf.txt' \
-e 'g' \
-e 'N' \
-e '}' cross_compile_ffmpeg_dezi.sh
sed -i '/build_dependencies$$/ a\ build_libMXF' cross_compile_ffmpeg_dezi.sh
sed -i \
-e '/config_options=\"--arch/{' \
-e 'h' \
-e 'r ../patches/ffmpeg-cross-vf_logo.txt' \
-e 'g' \
-e 'N' \
-e '}' cross_compile_ffmpeg_dezi.sh