6 from helpers
import parse_configfile
, run_command
7 from subprocess
import check_call
11 os
.mkdir('ffmpeg_build')
15 extra_args
= parse_configfile('common_options')
16 for arg
in parse_configfile('ffmpeg_options'):
17 if arg
== 'librtmp_magic':
19 check_call('pkg-config --exists librtmp'.split())
21 sys
.exit('You have specified "librtmp_magic" in ffmpeg_options,'
22 'but running "pkg-config --exists librtmp" failed - '
23 "can't enable librtmp! Aborting.")
24 extra_args
.append('--enable-librtmp')
25 cflags
= run_command('pkg-config --cflags librtmp').strip()
26 libs
= run_command('pkg-config --libs librtmp').strip()
27 extra_args
.append('--extra-cflags=%s' % cflags
)
28 extra_args
.append('--extra-libs=%s' % libs
)
30 extra_args
.append(arg
)
32 args
= ['--prefix=%s/build_libs' % mydir
,
37 '--disable-shared', '--enable-static',
39 '--disable-devices', '--disable-ffmpeg',
40 '--disable-ffplay', '--disable-ffserver','--disable-ffprobe',
43 if os
.path
.exists('ffmpeg-mt-enabled'):
44 ffmpeg_dir
= 'ffmpeg-mt'
47 executable
= path
.join(mydir
, ffmpeg_dir
, 'configure')
49 os
.chdir('ffmpeg_build')
50 check_call([executable
] + args
+ extra_args
)