You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5777 lines
179KB

  1. #!/bin/sh
  2. #
  3. # FFmpeg configure script
  4. #
  5. # Copyright (c) 2000-2002 Fabrice Bellard
  6. # Copyright (c) 2005-2008 Diego Biurrun
  7. # Copyright (c) 2005-2008 Mans Rullgard
  8. #
  9. # Prevent locale nonsense from breaking basic text processing.
  10. LC_ALL=C
  11. export LC_ALL
  12. # make sure we are running under a compatible shell
  13. # try to make this part work with most shells
  14. try_exec(){
  15. echo "Trying shell $1"
  16. type "$1" > /dev/null 2>&1 && exec "$@"
  17. }
  18. unset foo
  19. (: ${foo%%bar}) 2> /dev/null
  20. E1="$?"
  21. (: ${foo?}) 2> /dev/null
  22. E2="$?"
  23. if test "$E1" != 0 || test "$E2" = 0; then
  24. echo "Broken shell detected. Trying alternatives."
  25. export FF_CONF_EXEC
  26. if test "0$FF_CONF_EXEC" -lt 1; then
  27. FF_CONF_EXEC=1
  28. try_exec bash "$0" "$@"
  29. fi
  30. if test "0$FF_CONF_EXEC" -lt 2; then
  31. FF_CONF_EXEC=2
  32. try_exec ksh "$0" "$@"
  33. fi
  34. if test "0$FF_CONF_EXEC" -lt 3; then
  35. FF_CONF_EXEC=3
  36. try_exec /usr/xpg4/bin/sh "$0" "$@"
  37. fi
  38. echo "No compatible shell script interpreter found."
  39. echo "This configure script requires a POSIX-compatible shell"
  40. echo "such as bash or ksh."
  41. echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH."
  42. echo "Instead, install a working POSIX-compatible shell."
  43. echo "Disabling this configure test will create a broken FFmpeg."
  44. if test "$BASH_VERSION" = '2.04.0(1)-release'; then
  45. echo "This bash version ($BASH_VERSION) is broken on your platform."
  46. echo "Upgrade to a later version if available."
  47. fi
  48. exit 1
  49. fi
  50. test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
  51. show_help(){
  52. cat <<EOF
  53. Usage: configure [options]
  54. Options: [defaults in brackets after descriptions]
  55. Help options:
  56. --help print this message
  57. --list-decoders show all available decoders
  58. --list-encoders show all available encoders
  59. --list-hwaccels show all available hardware accelerators
  60. --list-demuxers show all available demuxers
  61. --list-muxers show all available muxers
  62. --list-parsers show all available parsers
  63. --list-protocols show all available protocols
  64. --list-bsfs show all available bitstream filters
  65. --list-indevs show all available input devices
  66. --list-outdevs show all available output devices
  67. --list-filters show all available filters
  68. Standard options:
  69. --logfile=FILE log tests and output to FILE [config.log]
  70. --disable-logging do not log configure debug information
  71. --fatal-warnings fail if any configure warning is generated
  72. --prefix=PREFIX install in PREFIX [$prefix]
  73. --bindir=DIR install binaries in DIR [PREFIX/bin]
  74. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  75. --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
  76. --libdir=DIR install libs in DIR [PREFIX/lib]
  77. --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
  78. --incdir=DIR install includes in DIR [PREFIX/include]
  79. --mandir=DIR install man page in DIR [PREFIX/share/man]
  80. --enable-rpath use rpath to allow installing libraries in paths
  81. not part of the dynamic linker search path
  82. use rpath when linking programs [USE WITH CARE]
  83. Licensing options:
  84. --enable-gpl allow use of GPL code, the resulting libs
  85. and binaries will be under GPL [no]
  86. --enable-version3 upgrade (L)GPL to version 3 [no]
  87. --enable-nonfree allow use of nonfree code, the resulting libs
  88. and binaries will be unredistributable [no]
  89. Configuration options:
  90. --disable-static do not build static libraries [no]
  91. --enable-shared build shared libraries [no]
  92. --enable-small optimize for size instead of speed
  93. --disable-runtime-cpudetect disable detecting cpu capabilities at runtime (smaller binary)
  94. --enable-gray enable full grayscale support (slower color)
  95. --disable-swscale-alpha disable alpha channel support in swscale
  96. --disable-all disable building components, libraries and programs
  97. --enable-incompatible-libav-abi enable incompatible Libav fork ABI [no]
  98. --enable-raise-major increase major version numbers in sonames [no]
  99. Program options:
  100. --disable-programs do not build command line programs
  101. --disable-ffmpeg disable ffmpeg build
  102. --disable-ffplay disable ffplay build
  103. --disable-ffprobe disable ffprobe build
  104. --disable-ffserver disable ffserver build
  105. Documentation options:
  106. --disable-doc do not build documentation
  107. --disable-htmlpages do not build HTML documentation pages
  108. --disable-manpages do not build man documentation pages
  109. --disable-podpages do not build POD documentation pages
  110. --disable-txtpages do not build text documentation pages
  111. Component options:
  112. --disable-avdevice disable libavdevice build
  113. --disable-avcodec disable libavcodec build
  114. --disable-avformat disable libavformat build
  115. --disable-avutil disable libavutil build
  116. --disable-swresample disable libswresample build
  117. --disable-swscale disable libswscale build
  118. --disable-postproc disable libpostproc build
  119. --disable-avfilter disable libavfilter build
  120. --enable-avresample enable libavresample build [no]
  121. --disable-pthreads disable pthreads [auto]
  122. --disable-w32threads disable Win32 threads [auto]
  123. --disable-os2threads disable OS/2 threads [auto]
  124. --disable-network disable network support [no]
  125. --disable-dct disable DCT code
  126. --disable-dwt disable DWT code
  127. --disable-error-resilience disable error resilience code
  128. --disable-lsp disable LSP code
  129. --disable-lzo disable LZO decoder code
  130. --disable-mdct disable MDCT code
  131. --disable-rdft disable RDFT code
  132. --disable-fft disable FFT code
  133. --disable-faan disable floating point AAN (I)DCT code
  134. --disable-pixelutils disable pixel utils in libavutil
  135. Hardware accelerators:
  136. --disable-dxva2 disable DXVA2 code [autodetect]
  137. --disable-vaapi disable VAAPI code [autodetect]
  138. --disable-vda disable VDA code [autodetect]
  139. --disable-vdpau disable VDPAU code [autodetect]
  140. Individual component options:
  141. --disable-everything disable all components listed below
  142. --disable-encoder=NAME disable encoder NAME
  143. --enable-encoder=NAME enable encoder NAME
  144. --disable-encoders disable all encoders
  145. --disable-decoder=NAME disable decoder NAME
  146. --enable-decoder=NAME enable decoder NAME
  147. --disable-decoders disable all decoders
  148. --disable-hwaccel=NAME disable hwaccel NAME
  149. --enable-hwaccel=NAME enable hwaccel NAME
  150. --disable-hwaccels disable all hwaccels
  151. --disable-muxer=NAME disable muxer NAME
  152. --enable-muxer=NAME enable muxer NAME
  153. --disable-muxers disable all muxers
  154. --disable-demuxer=NAME disable demuxer NAME
  155. --enable-demuxer=NAME enable demuxer NAME
  156. --disable-demuxers disable all demuxers
  157. --enable-parser=NAME enable parser NAME
  158. --disable-parser=NAME disable parser NAME
  159. --disable-parsers disable all parsers
  160. --enable-bsf=NAME enable bitstream filter NAME
  161. --disable-bsf=NAME disable bitstream filter NAME
  162. --disable-bsfs disable all bitstream filters
  163. --enable-protocol=NAME enable protocol NAME
  164. --disable-protocol=NAME disable protocol NAME
  165. --disable-protocols disable all protocols
  166. --enable-indev=NAME enable input device NAME
  167. --disable-indev=NAME disable input device NAME
  168. --disable-indevs disable input devices
  169. --enable-outdev=NAME enable output device NAME
  170. --disable-outdev=NAME disable output device NAME
  171. --disable-outdevs disable output devices
  172. --disable-devices disable all devices
  173. --enable-filter=NAME enable filter NAME
  174. --disable-filter=NAME disable filter NAME
  175. --disable-filters disable all filters
  176. External library support:
  177. --enable-avisynth enable reading of AviSynth script files [no]
  178. --disable-bzlib disable bzlib [autodetect]
  179. --enable-fontconfig enable fontconfig
  180. --enable-frei0r enable frei0r video filtering
  181. --enable-gnutls enable gnutls [no]
  182. --disable-iconv disable iconv [autodetect]
  183. --enable-ladspa enable LADSPA audio filtering
  184. --enable-libaacplus enable AAC+ encoding via libaacplus [no]
  185. --enable-libass enable libass subtitles rendering [no]
  186. --enable-libbluray enable BluRay reading using libbluray [no]
  187. --enable-libbs2b enable bs2b DSP library [no]
  188. --enable-libcaca enable textual display using libcaca
  189. --enable-libcelt enable CELT decoding via libcelt [no]
  190. --enable-libcdio enable audio CD grabbing with libcdio
  191. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  192. and libraw1394 [no]
  193. --enable-libfaac enable AAC encoding via libfaac [no]
  194. --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  195. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  196. --enable-libfreetype enable libfreetype [no]
  197. --enable-libfribidi enable libfribidi [no]
  198. --enable-libgme enable Game Music Emu via libgme [no]
  199. --enable-libgsm enable GSM de/encoding via libgsm [no]
  200. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  201. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  202. --enable-libmodplug enable ModPlug via libmodplug [no]
  203. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  204. --enable-libnut enable NUT (de)muxing via libnut,
  205. native (de)muxer exists [no]
  206. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  207. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  208. --enable-libopencv enable video filtering via libopencv [no]
  209. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  210. --enable-libopus enable Opus de/encoding via libopus [no]
  211. --enable-libpulse enable Pulseaudio input via libpulse [no]
  212. --enable-libquvi enable quvi input via libquvi [no]
  213. --enable-librtmp enable RTMP[E] support via librtmp [no]
  214. --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
  215. --enable-libshine enable fixed-point MP3 encoding via libshine [no]
  216. --enable-libsmbclient enable Samba protocol via libsmbclient [no]
  217. --enable-libsoxr enable Include libsoxr resampling [no]
  218. --enable-libspeex enable Speex de/encoding via libspeex [no]
  219. --enable-libssh enable SFTP protocol via libssh [no]
  220. --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
  221. --enable-libtheora enable Theora encoding via libtheora [no]
  222. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  223. --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
  224. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  225. --enable-libvidstab enable video stabilization using vid.stab [no]
  226. --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
  227. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  228. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  229. native implementation exists [no]
  230. --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
  231. --enable-libwavpack enable wavpack encoding via libwavpack [no]
  232. --enable-libwebp enable WebP encoding via libwebp [no]
  233. --enable-libx264 enable H.264 encoding via x264 [no]
  234. --enable-libx265 enable HEVC encoding via x265 [no]
  235. --enable-libxavs enable AVS encoding via xavs [no]
  236. --enable-libxcb enable X11 grabbing using XCB [no]
  237. --enable-libxcb-shm enable X11 grabbing shm communication [auto]
  238. --enable-libxcb-xfixes enable X11 grabbing mouse rendering [auto]
  239. --enable-libxvid enable Xvid encoding via xvidcore,
  240. native MPEG-4/Xvid encoder exists [no]
  241. --enable-libzmq enable message passing via libzmq [no]
  242. --enable-libzvbi enable teletext support via libzvbi [no]
  243. --disable-lzma disable lzma [autodetect]
  244. --enable-decklink enable Blackmagick DeckLink I/O support [no]
  245. --enable-openal enable OpenAL 1.1 capture support [no]
  246. --enable-opencl enable OpenCL code
  247. --enable-opengl enable OpenGL rendering [no]
  248. --enable-openssl enable openssl [no]
  249. --disable-sdl disable sdl [autodetect]
  250. --enable-x11grab enable X11 grabbing (legacy) [no]
  251. --disable-xlib disable xlib [autodetect]
  252. --disable-zlib disable zlib [autodetect]
  253. Toolchain options:
  254. --arch=ARCH select architecture [$arch]
  255. --cpu=CPU select the minimum required CPU (affects
  256. instruction selection, may crash on older CPUs)
  257. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  258. --progs-suffix=SUFFIX program name suffix []
  259. --enable-cross-compile assume a cross-compiler is used
  260. --sysroot=PATH root of cross-build tree
  261. --sysinclude=PATH location of cross-build system headers
  262. --target-os=OS compiler targets OS [$target_os]
  263. --target-exec=CMD command to run executables on target
  264. --target-path=DIR path to view of build directory on target
  265. --target-samples=DIR path to samples directory on target
  266. --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
  267. --toolchain=NAME set tool defaults according to NAME
  268. --nm=NM use nm tool NM [$nm_default]
  269. --ar=AR use archive tool AR [$ar_default]
  270. --as=AS use assembler AS [$as_default]
  271. --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
  272. --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
  273. --cc=CC use C compiler CC [$cc_default]
  274. --cxx=CXX use C compiler CXX [$cxx_default]
  275. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  276. --ld=LD use linker LD [$ld_default]
  277. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  278. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  279. --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
  280. --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
  281. --host-cc=HOSTCC use host C compiler HOSTCC
  282. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  283. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  284. --host-ld=HOSTLD use host linker HOSTLD
  285. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  286. --host-libs=HLIBS use libs HLIBS when linking for host
  287. --host-os=OS compiler host OS [$target_os]
  288. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  289. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  290. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  291. --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
  292. --extra-libs=ELIBS add ELIBS [$ELIBS]
  293. --extra-version=STRING version string suffix []
  294. --optflags=OPTFLAGS override optimization-related compiler flags
  295. --build-suffix=SUFFIX library name suffix []
  296. --enable-pic build position-independent code
  297. --enable-thumb compile for Thumb instruction set
  298. --enable-lto use link-time optimization
  299. Advanced options (experts only):
  300. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  301. --disable-symver disable symbol versioning
  302. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  303. --disable-safe-bitstream-reader
  304. disable buffer boundary checking in bitreaders
  305. (faster, but may crash)
  306. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  307. --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
  308. Optimization options (experts only):
  309. --disable-asm disable all assembly optimizations
  310. --disable-altivec disable AltiVec optimizations
  311. --disable-amd3dnow disable 3DNow! optimizations
  312. --disable-amd3dnowext disable 3DNow! extended optimizations
  313. --disable-mmx disable MMX optimizations
  314. --disable-mmxext disable MMXEXT optimizations
  315. --disable-sse disable SSE optimizations
  316. --disable-sse2 disable SSE2 optimizations
  317. --disable-sse3 disable SSE3 optimizations
  318. --disable-ssse3 disable SSSE3 optimizations
  319. --disable-sse4 disable SSE4 optimizations
  320. --disable-sse42 disable SSE4.2 optimizations
  321. --disable-avx disable AVX optimizations
  322. --disable-xop disable XOP optimizations
  323. --disable-fma3 disable FMA3 optimizations
  324. --disable-fma4 disable FMA4 optimizations
  325. --disable-avx2 disable AVX2 optimizations
  326. --disable-armv5te disable armv5te optimizations
  327. --disable-armv6 disable armv6 optimizations
  328. --disable-armv6t2 disable armv6t2 optimizations
  329. --disable-vfp disable VFP optimizations
  330. --disable-neon disable NEON optimizations
  331. --disable-inline-asm disable use of inline assembly
  332. --disable-yasm disable use of nasm/yasm assembly
  333. --disable-mips32r2 disable MIPS32R2 optimizations
  334. --disable-mipsdspr1 disable MIPS DSP ASE R1 optimizations
  335. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  336. --disable-mipsfpu disable floating point MIPS optimizations
  337. --disable-fast-unaligned consider unaligned accesses slow
  338. Developer options (useful when working on FFmpeg itself):
  339. --disable-debug disable debugging symbols
  340. --enable-debug=LEVEL set the debug level [$debuglevel]
  341. --disable-optimizations disable compiler optimizations
  342. --enable-extra-warnings enable more compiler warnings
  343. --disable-stripping disable stripping of executables and shared libraries
  344. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  345. 2 causes a slowdown at runtime.
  346. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  347. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  348. leaks and errors, using the specified valgrind binary.
  349. Cannot be combined with --target-exec
  350. --enable-ftrapv Trap arithmetic overflows
  351. --samples=PATH location of test samples for FATE, if not set use
  352. \$FATE_SAMPLES at make invocation time.
  353. --enable-neon-clobber-test check NEON registers for clobbering (should be
  354. used only for debugging purposes)
  355. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  356. should be used only for debugging purposes)
  357. --enable-random randomly enable/disable components
  358. --disable-random
  359. --enable-random=LIST randomly enable/disable specific components or
  360. --disable-random=LIST component groups. LIST is a comma-separated list
  361. of NAME[:PROB] entries where NAME is a component
  362. (group) and PROB the probability associated with
  363. NAME (default 0.5).
  364. --random-seed=VALUE seed value for --enable/disable-random
  365. NOTE: Object files are built at the place where configure is launched.
  366. EOF
  367. exit 0
  368. }
  369. quotes='""'
  370. log(){
  371. echo "$@" >> $logfile
  372. }
  373. log_file(){
  374. log BEGIN $1
  375. pr -n -t $1 >> $logfile
  376. log END $1
  377. }
  378. echolog(){
  379. log "$@"
  380. echo "$@"
  381. }
  382. warn(){
  383. log "WARNING: $*"
  384. WARNINGS="${WARNINGS}WARNING: $*\n"
  385. }
  386. die(){
  387. echolog "$@"
  388. cat <<EOF
  389. If you think configure made a mistake, make sure you are using the latest
  390. version from Git. If the latest version fails, report the problem to the
  391. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  392. EOF
  393. if disabled logging; then
  394. cat <<EOF
  395. Rerun configure with logging enabled (do not use --disable-logging), and
  396. include the log this produces with your report.
  397. EOF
  398. else
  399. cat <<EOF
  400. Include the log file "$logfile" produced by configure as this will help
  401. solve the problem.
  402. EOF
  403. fi
  404. exit 1
  405. }
  406. # Avoid locale weirdness, besides we really just want to translate ASCII.
  407. toupper(){
  408. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  409. }
  410. tolower(){
  411. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  412. }
  413. c_escape(){
  414. echo "$*" | sed 's/["\\]/\\\0/g'
  415. }
  416. sh_quote(){
  417. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  418. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  419. echo "$v"
  420. }
  421. cleanws(){
  422. echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//;s/\\r//g'
  423. }
  424. filter(){
  425. pat=$1
  426. shift
  427. for v; do
  428. eval "case $v in $pat) echo $v ;; esac"
  429. done
  430. }
  431. filter_out(){
  432. pat=$1
  433. shift
  434. for v; do
  435. eval "case $v in $pat) ;; *) echo $v ;; esac"
  436. done
  437. }
  438. map(){
  439. m=$1
  440. shift
  441. for v; do eval $m; done
  442. }
  443. add_suffix(){
  444. suffix=$1
  445. shift
  446. for v; do echo ${v}${suffix}; done
  447. }
  448. set_all(){
  449. value=$1
  450. shift
  451. for var in $*; do
  452. eval $var=$value
  453. done
  454. }
  455. set_weak(){
  456. value=$1
  457. shift
  458. for var; do
  459. eval : \${$var:=$value}
  460. done
  461. }
  462. sanitize_var_name(){
  463. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  464. }
  465. set_safe(){
  466. var=$1
  467. shift
  468. eval $(sanitize_var_name "$var")='$*'
  469. }
  470. get_safe(){
  471. eval echo \$$(sanitize_var_name "$1")
  472. }
  473. pushvar(){
  474. for pvar in $*; do
  475. eval level=\${${pvar}_level:=0}
  476. eval ${pvar}_${level}="\$$pvar"
  477. eval ${pvar}_level=$(($level+1))
  478. done
  479. }
  480. popvar(){
  481. for pvar in $*; do
  482. eval level=\${${pvar}_level:-0}
  483. test $level = 0 && continue
  484. eval level=$(($level-1))
  485. eval $pvar="\${${pvar}_${level}}"
  486. eval ${pvar}_level=$level
  487. eval unset ${pvar}_${level}
  488. done
  489. }
  490. enable(){
  491. set_all yes $*
  492. }
  493. disable(){
  494. set_all no $*
  495. }
  496. enable_weak(){
  497. set_weak yes $*
  498. }
  499. disable_weak(){
  500. set_weak no $*
  501. }
  502. enable_safe(){
  503. for var; do
  504. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  505. done
  506. }
  507. disable_safe(){
  508. for var; do
  509. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  510. done
  511. }
  512. do_enable_deep(){
  513. for var; do
  514. enabled $var && continue
  515. eval sel="\$${var}_select"
  516. eval sgs="\$${var}_suggest"
  517. pushvar var sgs
  518. enable_deep $sel
  519. popvar sgs
  520. enable_deep_weak $sgs
  521. popvar var
  522. done
  523. }
  524. enable_deep(){
  525. do_enable_deep $*
  526. enable $*
  527. }
  528. enable_deep_weak(){
  529. for var; do
  530. disabled $var && continue
  531. pushvar var
  532. do_enable_deep $var
  533. popvar var
  534. enable_weak $var
  535. done
  536. }
  537. enabled(){
  538. test "${1#!}" = "$1" && op== || op=!=
  539. eval test "x\$${1#!}" $op "xyes"
  540. }
  541. disabled(){
  542. test "${1#!}" = "$1" && op== || op=!=
  543. eval test "x\$${1#!}" $op "xno"
  544. }
  545. enabled_all(){
  546. for opt; do
  547. enabled $opt || return 1
  548. done
  549. }
  550. disabled_all(){
  551. for opt; do
  552. disabled $opt || return 1
  553. done
  554. }
  555. enabled_any(){
  556. for opt; do
  557. enabled $opt && return 0
  558. done
  559. }
  560. disabled_any(){
  561. for opt; do
  562. disabled $opt && return 0
  563. done
  564. return 1
  565. }
  566. set_default(){
  567. for opt; do
  568. eval : \${$opt:=\$${opt}_default}
  569. done
  570. }
  571. is_in(){
  572. value=$1
  573. shift
  574. for var in $*; do
  575. [ $var = $value ] && return 0
  576. done
  577. return 1
  578. }
  579. do_check_deps(){
  580. for cfg; do
  581. cfg="${cfg#!}"
  582. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  583. disabled ${cfg}_checking && continue
  584. enable ${cfg}_checking
  585. append allopts $cfg
  586. eval dep_all="\$${cfg}_deps"
  587. eval dep_any="\$${cfg}_deps_any"
  588. eval dep_sel="\$${cfg}_select"
  589. eval dep_sgs="\$${cfg}_suggest"
  590. eval dep_ifa="\$${cfg}_if"
  591. eval dep_ifn="\$${cfg}_if_any"
  592. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  593. do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  594. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  595. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  596. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  597. enabled_all $dep_all || disable $cfg
  598. enabled_any $dep_any || disable $cfg
  599. disabled_any $dep_sel && disable $cfg
  600. if enabled $cfg; then
  601. enable_deep $dep_sel
  602. enable_deep_weak $dep_sgs
  603. fi
  604. disable ${cfg}_checking
  605. done
  606. }
  607. check_deps(){
  608. unset allopts
  609. do_check_deps "$@"
  610. for cfg in $allopts; do
  611. enabled $cfg || continue
  612. eval dep_extralibs="\$${cfg}_extralibs"
  613. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  614. done
  615. }
  616. print_config(){
  617. pfx=$1
  618. files=$2
  619. shift 2
  620. map 'eval echo "$v \${$v:-no}"' "$@" |
  621. awk "BEGIN { split(\"$files\", files) }
  622. {
  623. c = \"$pfx\" toupper(\$1);
  624. v = \$2;
  625. sub(/yes/, 1, v);
  626. sub(/no/, 0, v);
  627. for (f in files) {
  628. file = files[f];
  629. if (file ~ /\\.h\$/) {
  630. printf(\"#define %s %d\\n\", c, v) >>file;
  631. } else if (file ~ /\\.asm\$/) {
  632. printf(\"%%define %s %d\\n\", c, v) >>file;
  633. } else if (file ~ /\\.mak\$/) {
  634. n = -v ? \"\" : \"!\";
  635. printf(\"%s%s=yes\\n\", n, c) >>file;
  636. } else if (file ~ /\\.texi\$/) {
  637. pre = -v ? \"\" : \"@c \";
  638. yesno = \$2;
  639. c2 = tolower(c);
  640. gsub(/_/, \"-\", c2);
  641. printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
  642. }
  643. }
  644. }"
  645. }
  646. print_enabled(){
  647. suf=$1
  648. shift
  649. for v; do
  650. enabled $v && printf "%s\n" ${v%$suf};
  651. done
  652. }
  653. append(){
  654. var=$1
  655. shift
  656. eval "$var=\"\$$var $*\""
  657. }
  658. prepend(){
  659. var=$1
  660. shift
  661. eval "$var=\"$* \$$var\""
  662. }
  663. unique(){
  664. var=$1
  665. uniq_list=""
  666. for tok in $(eval echo \$$var); do
  667. uniq_list="$(filter_out $tok $uniq_list) $tok"
  668. done
  669. eval "$var=\"${uniq_list}\""
  670. }
  671. add_cppflags(){
  672. append CPPFLAGS "$@"
  673. }
  674. add_cflags(){
  675. append CFLAGS $($cflags_filter "$@")
  676. }
  677. add_cxxflags(){
  678. append CXXFLAGS $($cflags_filter "$@")
  679. }
  680. add_asflags(){
  681. append ASFLAGS $($asflags_filter "$@")
  682. }
  683. add_ldflags(){
  684. append LDFLAGS $($ldflags_filter "$@")
  685. }
  686. add_ldexeflags(){
  687. append LDEXEFLAGS $($ldflags_filter "$@")
  688. }
  689. add_stripflags(){
  690. append ASMSTRIPFLAGS "$@"
  691. }
  692. add_extralibs(){
  693. prepend extralibs $($ldflags_filter "$@")
  694. }
  695. add_host_cppflags(){
  696. append host_cppflags "$@"
  697. }
  698. add_host_cflags(){
  699. append host_cflags $($host_cflags_filter "$@")
  700. }
  701. add_host_ldflags(){
  702. append host_ldflags $($host_ldflags_filter "$@")
  703. }
  704. add_compat(){
  705. append compat_objs $1
  706. shift
  707. map 'add_cppflags -D$v' "$@"
  708. }
  709. check_cmd(){
  710. log "$@"
  711. "$@" >> $logfile 2>&1
  712. }
  713. check_stat(){
  714. log check_stat "$@"
  715. stat "$1" >> $logfile 2>&1
  716. }
  717. cc_o(){
  718. eval printf '%s\\n' $CC_O
  719. }
  720. cc_e(){
  721. eval printf '%s\\n' $CC_E
  722. }
  723. check_cc(){
  724. log check_cc "$@"
  725. cat > $TMPC
  726. log_file $TMPC
  727. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  728. }
  729. check_cxx(){
  730. log check_cxx "$@"
  731. cat > $TMPCPP
  732. log_file $TMPCPP
  733. check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  734. }
  735. check_oc(){
  736. log check_oc "$@"
  737. cat > $TMPM
  738. log_file $TMPM
  739. check_cmd $cc -Werror=missing-prototypes $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPM
  740. }
  741. check_cpp(){
  742. log check_cpp "$@"
  743. cat > $TMPC
  744. log_file $TMPC
  745. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  746. }
  747. as_o(){
  748. eval printf '%s\\n' $AS_O
  749. }
  750. check_as(){
  751. log check_as "$@"
  752. cat > $TMPS
  753. log_file $TMPS
  754. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  755. }
  756. check_inline_asm(){
  757. log check_inline_asm "$@"
  758. name="$1"
  759. code="$2"
  760. shift 2
  761. disable $name
  762. check_cc "$@" <<EOF && enable $name
  763. void foo(void){ __asm__ volatile($code); }
  764. EOF
  765. }
  766. check_insn(){
  767. log check_insn "$@"
  768. check_inline_asm ${1}_inline "\"$2\""
  769. echo "$2" | check_as && enable ${1}_external || disable ${1}_external
  770. }
  771. check_yasm(){
  772. log check_yasm "$@"
  773. echo "$1" > $TMPS
  774. log_file $TMPS
  775. shift 1
  776. check_cmd $yasmexe $YASMFLAGS -Werror "$@" -o $TMPO $TMPS
  777. }
  778. ld_o(){
  779. eval printf '%s\\n' $LD_O
  780. }
  781. check_ld(){
  782. log check_ld "$@"
  783. type=$1
  784. shift 1
  785. flags=$(filter_out '-l*|*.so' $@)
  786. libs=$(filter '-l*|*.so' $@)
  787. check_$type $($cflags_filter $flags) || return
  788. flags=$($ldflags_filter $flags)
  789. libs=$($ldflags_filter $libs)
  790. check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  791. }
  792. print_include(){
  793. hdr=$1
  794. test "${hdr%.h}" = "${hdr}" &&
  795. echo "#include $hdr" ||
  796. echo "#include <$hdr>"
  797. }
  798. check_code(){
  799. log check_code "$@"
  800. check=$1
  801. headers=$2
  802. code=$3
  803. shift 3
  804. {
  805. for hdr in $headers; do
  806. print_include $hdr
  807. done
  808. echo "int main(void) { $code; return 0; }"
  809. } | check_$check "$@"
  810. }
  811. check_cppflags(){
  812. log check_cppflags "$@"
  813. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  814. int x;
  815. EOF
  816. }
  817. test_cflags(){
  818. log test_cflags "$@"
  819. set -- $($cflags_filter "$@")
  820. check_cc "$@" <<EOF
  821. int x;
  822. EOF
  823. }
  824. check_cflags(){
  825. log check_cflags "$@"
  826. test_cflags "$@" && add_cflags "$@"
  827. }
  828. check_cxxflags(){
  829. log check_cxxflags "$@"
  830. set -- $($cflags_filter "$@")
  831. check_cxx "$@" <<EOF && append CXXFLAGS "$@"
  832. int x;
  833. EOF
  834. }
  835. test_ldflags(){
  836. log test_ldflags "$@"
  837. check_ld "cc" "$@" <<EOF
  838. int main(void){ return 0; }
  839. EOF
  840. }
  841. check_ldflags(){
  842. log check_ldflags "$@"
  843. test_ldflags "$@" && add_ldflags "$@"
  844. }
  845. test_stripflags(){
  846. log test_stripflags "$@"
  847. # call check_cc to get a fresh TMPO
  848. check_cc <<EOF
  849. int main(void) { return 0; }
  850. EOF
  851. check_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
  852. }
  853. check_stripflags(){
  854. log check_stripflags "$@"
  855. test_stripflags "$@" && add_stripflags "$@"
  856. }
  857. check_header(){
  858. log check_header "$@"
  859. header=$1
  860. shift
  861. disable_safe $header
  862. check_cpp "$@" <<EOF && enable_safe $header
  863. #include <$header>
  864. int x;
  865. EOF
  866. }
  867. check_header_oc(){
  868. log check_header_oc "$@"
  869. rm -f -- "$TMPO"
  870. header=$1
  871. shift
  872. disable_safe $header
  873. {
  874. echo "#include <$header>"
  875. echo "int main(void) { return 0; }"
  876. } | check_oc && check_stat "$TMPO" && enable_safe $headers
  877. }
  878. check_func(){
  879. log check_func "$@"
  880. func=$1
  881. shift
  882. disable $func
  883. check_ld "cc" "$@" <<EOF && enable $func
  884. extern int $func();
  885. int main(void){ $func(); }
  886. EOF
  887. }
  888. check_mathfunc(){
  889. log check_mathfunc "$@"
  890. func=$1
  891. narg=$2
  892. shift 2
  893. test $narg = 2 && args="f, g" || args="f"
  894. disable $func
  895. check_ld "cc" "$@" <<EOF && enable $func
  896. #include <math.h>
  897. float foo(float f, float g) { return $func($args); }
  898. int main(void){ return (int) foo; }
  899. EOF
  900. }
  901. check_func_headers(){
  902. log check_func_headers "$@"
  903. headers=$1
  904. funcs=$2
  905. shift 2
  906. {
  907. for hdr in $headers; do
  908. print_include $hdr
  909. done
  910. for func in $funcs; do
  911. echo "long check_$func(void) { return (long) $func; }"
  912. done
  913. echo "int main(void) { return 0; }"
  914. } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
  915. }
  916. check_class_headers_cpp(){
  917. log check_class_headers_cpp "$@"
  918. headers=$1
  919. classes=$2
  920. shift 2
  921. {
  922. for hdr in $headers; do
  923. echo "#include <$hdr>"
  924. done
  925. echo "int main(void) { "
  926. i=1
  927. for class in $classes; do
  928. echo "$class obj$i;"
  929. i=$(expr $i + 1)
  930. done
  931. echo "return 0; }"
  932. } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers
  933. }
  934. check_cpp_condition(){
  935. log check_cpp_condition "$@"
  936. header=$1
  937. condition=$2
  938. shift 2
  939. check_cpp "$@" <<EOF
  940. #include <$header>
  941. #if !($condition)
  942. #error "unsatisfied condition: $condition"
  943. #endif
  944. EOF
  945. }
  946. check_lib(){
  947. log check_lib "$@"
  948. header="$1"
  949. func="$2"
  950. shift 2
  951. check_header $header && check_func $func "$@" && add_extralibs "$@"
  952. }
  953. check_lib2(){
  954. log check_lib2 "$@"
  955. headers="$1"
  956. funcs="$2"
  957. shift 2
  958. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  959. }
  960. check_lib_cpp(){
  961. log check_lib_cpp "$@"
  962. headers="$1"
  963. classes="$2"
  964. shift 2
  965. check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@"
  966. }
  967. check_pkg_config(){
  968. log check_pkg_config "$@"
  969. pkgandversion="$1"
  970. pkg="${1%% *}"
  971. headers="$2"
  972. funcs="$3"
  973. shift 3
  974. check_cmd $pkg_config --exists --print-errors $pkgandversion || return
  975. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  976. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  977. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  978. set_safe ${pkg}_cflags $pkg_cflags &&
  979. set_safe ${pkg}_libs $pkg_libs
  980. }
  981. check_exec(){
  982. check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  983. }
  984. check_exec_crash(){
  985. code=$(cat)
  986. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  987. # are safe but may not be available everywhere. Thus we use
  988. # raise(SIGTERM) instead. The check is run in a subshell so we
  989. # can redirect the "Terminated" message from the shell. SIGBUS
  990. # is not defined by standard C so it is used conditionally.
  991. (check_exec "$@") >> $logfile 2>&1 <<EOF
  992. #include <signal.h>
  993. static void sighandler(int sig){
  994. raise(SIGTERM);
  995. }
  996. int foo(void){
  997. $code
  998. }
  999. int (*func_ptr)(void) = foo;
  1000. int main(void){
  1001. signal(SIGILL, sighandler);
  1002. signal(SIGFPE, sighandler);
  1003. signal(SIGSEGV, sighandler);
  1004. #ifdef SIGBUS
  1005. signal(SIGBUS, sighandler);
  1006. #endif
  1007. return func_ptr();
  1008. }
  1009. EOF
  1010. }
  1011. check_type(){
  1012. log check_type "$@"
  1013. headers=$1
  1014. type=$2
  1015. shift 2
  1016. disable_safe "$type"
  1017. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  1018. }
  1019. check_struct(){
  1020. log check_struct "$@"
  1021. headers=$1
  1022. struct=$2
  1023. member=$3
  1024. shift 3
  1025. disable_safe "${struct}_${member}"
  1026. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  1027. enable_safe "${struct}_${member}"
  1028. }
  1029. check_builtin(){
  1030. log check_builtin "$@"
  1031. name=$1
  1032. headers=$2
  1033. builtin=$3
  1034. shift 3
  1035. disable "$name"
  1036. check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
  1037. }
  1038. check_compile_assert(){
  1039. log check_compile_assert "$@"
  1040. name=$1
  1041. headers=$2
  1042. condition=$3
  1043. shift 3
  1044. disable "$name"
  1045. check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  1046. }
  1047. require(){
  1048. name="$1"
  1049. header="$2"
  1050. func="$3"
  1051. shift 3
  1052. check_lib $header $func "$@" || die "ERROR: $name not found"
  1053. }
  1054. require2(){
  1055. name="$1"
  1056. headers="$2"
  1057. func="$3"
  1058. shift 3
  1059. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  1060. }
  1061. require_cpp(){
  1062. name="$1"
  1063. headers="$2"
  1064. classes="$3"
  1065. shift 3
  1066. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  1067. }
  1068. require_pkg_config(){
  1069. pkg="$1"
  1070. check_pkg_config "$@" || die "ERROR: $pkg not found"
  1071. add_cflags $(get_safe ${pkg}_cflags)
  1072. add_extralibs $(get_safe ${pkg}_libs)
  1073. }
  1074. require_libfreetype(){
  1075. log require_libfreetype "$@"
  1076. pkg="freetype2"
  1077. check_cmd $pkg_config --exists --print-errors $pkg \
  1078. || die "ERROR: $pkg not found"
  1079. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1080. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1081. {
  1082. echo "#include <ft2build.h>"
  1083. echo "#include FT_FREETYPE_H"
  1084. echo "long check_func(void) { return (long) FT_Init_FreeType; }"
  1085. echo "int main(void) { return 0; }"
  1086. } | check_ld "cc" $pkg_cflags $pkg_libs \
  1087. && set_safe ${pkg}_cflags $pkg_cflags \
  1088. && set_safe ${pkg}_libs $pkg_libs \
  1089. || die "ERROR: $pkg not found"
  1090. add_cflags $(get_safe ${pkg}_cflags)
  1091. add_extralibs $(get_safe ${pkg}_libs)
  1092. }
  1093. hostcc_e(){
  1094. eval printf '%s\\n' $HOSTCC_E
  1095. }
  1096. hostcc_o(){
  1097. eval printf '%s\\n' $HOSTCC_O
  1098. }
  1099. check_host_cc(){
  1100. log check_host_cc "$@"
  1101. cat > $TMPC
  1102. log_file $TMPC
  1103. check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  1104. }
  1105. check_host_cpp(){
  1106. log check_host_cpp "$@"
  1107. cat > $TMPC
  1108. log_file $TMPC
  1109. check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
  1110. }
  1111. check_host_cppflags(){
  1112. log check_host_cppflags "$@"
  1113. check_host_cc "$@" <<EOF && append host_cppflags "$@"
  1114. int x;
  1115. EOF
  1116. }
  1117. check_host_cflags(){
  1118. log check_host_cflags "$@"
  1119. set -- $($host_cflags_filter "$@")
  1120. check_host_cc "$@" <<EOF && append host_cflags "$@"
  1121. int x;
  1122. EOF
  1123. }
  1124. check_host_cpp_condition(){
  1125. log check_host_cpp_condition "$@"
  1126. header=$1
  1127. condition=$2
  1128. shift 2
  1129. check_host_cpp "$@" <<EOF
  1130. #include <$header>
  1131. #if !($condition)
  1132. #error "unsatisfied condition: $condition"
  1133. #endif
  1134. EOF
  1135. }
  1136. apply(){
  1137. file=$1
  1138. shift
  1139. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  1140. }
  1141. cp_if_changed(){
  1142. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  1143. mkdir -p "$(dirname $2)"
  1144. $cp_f "$1" "$2"
  1145. }
  1146. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  1147. # system-dependent things.
  1148. COMPONENT_LIST="
  1149. bsfs
  1150. decoders
  1151. demuxers
  1152. encoders
  1153. filters
  1154. hwaccels
  1155. indevs
  1156. muxers
  1157. outdevs
  1158. parsers
  1159. protocols
  1160. "
  1161. EXAMPLE_LIST="
  1162. avio_reading_example
  1163. decoding_encoding_example
  1164. demuxing_decoding_example
  1165. extract_mvs_example
  1166. filter_audio_example
  1167. filtering_audio_example
  1168. filtering_video_example
  1169. metadata_example
  1170. muxing_example
  1171. remuxing_example
  1172. resampling_audio_example
  1173. scaling_video_example
  1174. transcode_aac_example
  1175. transcoding_example
  1176. "
  1177. EXTERNAL_LIBRARY_LIST="
  1178. avisynth
  1179. bzlib
  1180. crystalhd
  1181. decklink
  1182. frei0r
  1183. gnutls
  1184. iconv
  1185. ladspa
  1186. libaacplus
  1187. libass
  1188. libbluray
  1189. libbs2b
  1190. libcaca
  1191. libcdio
  1192. libcelt
  1193. libdc1394
  1194. libfaac
  1195. libfdk_aac
  1196. libflite
  1197. libfontconfig
  1198. libfreetype
  1199. libfribidi
  1200. libgme
  1201. libgsm
  1202. libiec61883
  1203. libilbc
  1204. libmodplug
  1205. libmp3lame
  1206. libnut
  1207. libopencore_amrnb
  1208. libopencore_amrwb
  1209. libopencv
  1210. libopenjpeg
  1211. libopus
  1212. libpulse
  1213. libquvi
  1214. librtmp
  1215. libschroedinger
  1216. libshine
  1217. libsmbclient
  1218. libsoxr
  1219. libspeex
  1220. libssh
  1221. libstagefright_h264
  1222. libtheora
  1223. libtwolame
  1224. libutvideo
  1225. libv4l2
  1226. libvidstab
  1227. libvo_aacenc
  1228. libvo_amrwbenc
  1229. libvorbis
  1230. libvpx
  1231. libwavpack
  1232. libwebp
  1233. libx264
  1234. libx265
  1235. libxavs
  1236. libxcb
  1237. libxcb_shm
  1238. libxcb_xfixes
  1239. libxvid
  1240. libzmq
  1241. libzvbi
  1242. lzma
  1243. openal
  1244. opencl
  1245. opengl
  1246. openssl
  1247. sdl
  1248. x11grab
  1249. xlib
  1250. zlib
  1251. "
  1252. DOCUMENT_LIST="
  1253. doc
  1254. htmlpages
  1255. manpages
  1256. podpages
  1257. txtpages
  1258. "
  1259. FEATURE_LIST="
  1260. ftrapv
  1261. gray
  1262. hardcoded_tables
  1263. runtime_cpudetect
  1264. safe_bitstream_reader
  1265. shared
  1266. small
  1267. static
  1268. swscale_alpha
  1269. "
  1270. HWACCEL_LIST="
  1271. dxva2
  1272. vaapi
  1273. vda
  1274. vdpau
  1275. xvmc
  1276. "
  1277. LIBRARY_LIST="
  1278. avcodec
  1279. avdevice
  1280. avfilter
  1281. avformat
  1282. avresample
  1283. avutil
  1284. postproc
  1285. swresample
  1286. swscale
  1287. "
  1288. LICENSE_LIST="
  1289. gpl
  1290. nonfree
  1291. version3
  1292. "
  1293. PROGRAM_LIST="
  1294. ffplay
  1295. ffprobe
  1296. ffserver
  1297. ffmpeg
  1298. "
  1299. SUBSYSTEM_LIST="
  1300. dct
  1301. dwt
  1302. error_resilience
  1303. faan
  1304. fast_unaligned
  1305. fft
  1306. lsp
  1307. lzo
  1308. mdct
  1309. pixelutils
  1310. network
  1311. rdft
  1312. "
  1313. CONFIG_LIST="
  1314. $COMPONENT_LIST
  1315. $DOCUMENT_LIST
  1316. $EXAMPLE_LIST
  1317. $EXTERNAL_LIBRARY_LIST
  1318. $FEATURE_LIST
  1319. $HWACCEL_LIST
  1320. $LICENSE_LIST
  1321. $LIBRARY_LIST
  1322. $PROGRAM_LIST
  1323. $SUBSYSTEM_LIST
  1324. fontconfig
  1325. incompatible_libav_abi
  1326. memalign_hack
  1327. memory_poisoning
  1328. neon_clobber_test
  1329. pic
  1330. pod2man
  1331. raise_major
  1332. thumb
  1333. xmm_clobber_test
  1334. "
  1335. THREADS_LIST="
  1336. pthreads
  1337. os2threads
  1338. w32threads
  1339. "
  1340. ATOMICS_LIST="
  1341. atomics_gcc
  1342. atomics_suncc
  1343. atomics_win32
  1344. "
  1345. ARCH_LIST="
  1346. aarch64
  1347. alpha
  1348. arm
  1349. avr32
  1350. avr32_ap
  1351. avr32_uc
  1352. bfin
  1353. ia64
  1354. m68k
  1355. mips
  1356. mips64
  1357. parisc
  1358. ppc
  1359. ppc64
  1360. s390
  1361. sh4
  1362. sparc
  1363. sparc64
  1364. tilegx
  1365. tilepro
  1366. tomi
  1367. x86
  1368. x86_32
  1369. x86_64
  1370. "
  1371. ARCH_EXT_LIST_ARM="
  1372. armv5te
  1373. armv6
  1374. armv6t2
  1375. armv8
  1376. neon
  1377. vfp
  1378. vfpv3
  1379. setend
  1380. "
  1381. ARCH_EXT_LIST_MIPS="
  1382. mipsfpu
  1383. mips32r2
  1384. mipsdspr1
  1385. mipsdspr2
  1386. "
  1387. ARCH_EXT_LIST_X86_SIMD="
  1388. amd3dnow
  1389. amd3dnowext
  1390. avx
  1391. avx2
  1392. fma3
  1393. fma4
  1394. mmx
  1395. mmxext
  1396. sse
  1397. sse2
  1398. sse3
  1399. sse4
  1400. sse42
  1401. ssse3
  1402. xop
  1403. "
  1404. ARCH_EXT_LIST_PPC="
  1405. altivec
  1406. dcbzl
  1407. ldbrx
  1408. ppc4xx
  1409. vsx
  1410. "
  1411. ARCH_EXT_LIST_X86="
  1412. $ARCH_EXT_LIST_X86_SIMD
  1413. cpunop
  1414. i686
  1415. "
  1416. ARCH_EXT_LIST="
  1417. $ARCH_EXT_LIST_ARM
  1418. $ARCH_EXT_LIST_PPC
  1419. $ARCH_EXT_LIST_X86
  1420. $ARCH_EXT_LIST_MIPS
  1421. loongson
  1422. "
  1423. ARCH_FEATURES="
  1424. aligned_stack
  1425. fast_64bit
  1426. fast_clz
  1427. fast_cmov
  1428. local_aligned_8
  1429. local_aligned_16
  1430. local_aligned_32
  1431. simd_align_16
  1432. "
  1433. BUILTIN_LIST="
  1434. atomic_cas_ptr
  1435. machine_rw_barrier
  1436. MemoryBarrier
  1437. mm_empty
  1438. rdtsc
  1439. sarestart
  1440. sync_val_compare_and_swap
  1441. "
  1442. HAVE_LIST_CMDLINE="
  1443. inline_asm
  1444. symver
  1445. yasm
  1446. "
  1447. HAVE_LIST_PUB="
  1448. bigendian
  1449. fast_unaligned
  1450. incompatible_libav_abi
  1451. "
  1452. HEADERS_LIST="
  1453. alsa_asoundlib_h
  1454. altivec_h
  1455. arpa_inet_h
  1456. asm_types_h
  1457. cdio_paranoia_h
  1458. cdio_paranoia_paranoia_h
  1459. CL_cl_h
  1460. dev_bktr_ioctl_bt848_h
  1461. dev_bktr_ioctl_meteor_h
  1462. dev_ic_bt8xx_h
  1463. dev_video_bktr_ioctl_bt848_h
  1464. dev_video_meteor_ioctl_meteor_h
  1465. direct_h
  1466. dlfcn_h
  1467. dxva_h
  1468. ES2_gl_h
  1469. gsm_h
  1470. io_h
  1471. mach_mach_time_h
  1472. machine_ioctl_bt848_h
  1473. machine_ioctl_meteor_h
  1474. malloc_h
  1475. openjpeg_1_5_openjpeg_h
  1476. OpenGL_gl3_h
  1477. poll_h
  1478. sndio_h
  1479. soundcard_h
  1480. sys_mman_h
  1481. sys_param_h
  1482. sys_resource_h
  1483. sys_select_h
  1484. sys_soundcard_h
  1485. sys_time_h
  1486. sys_un_h
  1487. sys_videoio_h
  1488. termios_h
  1489. unistd_h
  1490. windows_h
  1491. winsock2_h
  1492. "
  1493. INTRINSICS_LIST="
  1494. intrinsics_neon
  1495. "
  1496. MATH_FUNCS="
  1497. atanf
  1498. atan2f
  1499. cbrt
  1500. cbrtf
  1501. cosf
  1502. exp2
  1503. exp2f
  1504. expf
  1505. fminf
  1506. isinf
  1507. isnan
  1508. ldexpf
  1509. llrint
  1510. llrintf
  1511. log2
  1512. log2f
  1513. log10f
  1514. lrint
  1515. lrintf
  1516. powf
  1517. rint
  1518. round
  1519. roundf
  1520. sinf
  1521. trunc
  1522. truncf
  1523. "
  1524. SYSTEM_FUNCS="
  1525. access
  1526. aligned_malloc
  1527. clock_gettime
  1528. closesocket
  1529. CommandLineToArgvW
  1530. CoTaskMemFree
  1531. CryptGenRandom
  1532. dlopen
  1533. fcntl
  1534. flt_lim
  1535. fork
  1536. getaddrinfo
  1537. gethrtime
  1538. getopt
  1539. GetProcessAffinityMask
  1540. GetProcessMemoryInfo
  1541. GetProcessTimes
  1542. getrusage
  1543. getservbyport
  1544. GetSystemTimeAsFileTime
  1545. gettimeofday
  1546. glob
  1547. glXGetProcAddress
  1548. gmtime_r
  1549. inet_aton
  1550. isatty
  1551. jack_port_get_latency_range
  1552. kbhit
  1553. localtime_r
  1554. lzo1x_999_compress
  1555. mach_absolute_time
  1556. MapViewOfFile
  1557. memalign
  1558. mkstemp
  1559. mmap
  1560. mprotect
  1561. nanosleep
  1562. PeekNamedPipe
  1563. posix_memalign
  1564. pthread_cancel
  1565. sched_getaffinity
  1566. SetConsoleTextAttribute
  1567. setmode
  1568. setrlimit
  1569. Sleep
  1570. strerror_r
  1571. sysconf
  1572. sysctl
  1573. usleep
  1574. VirtualAlloc
  1575. wglGetProcAddress
  1576. "
  1577. TOOLCHAIN_FEATURES="
  1578. as_dn_directive
  1579. as_func
  1580. asm_mod_q
  1581. attribute_may_alias
  1582. attribute_packed
  1583. ebp_available
  1584. ebx_available
  1585. gnu_as
  1586. gnu_windres
  1587. ibm_asm
  1588. inline_asm_labels
  1589. inline_asm_nonlocal_labels
  1590. inline_asm_direct_symbol_refs
  1591. pragma_deprecated
  1592. rsync_contimeout
  1593. symver_asm_label
  1594. symver_gnu_asm
  1595. vfp_args
  1596. xform_asm
  1597. xmm_clobbers
  1598. "
  1599. TYPES_LIST="
  1600. CONDITION_VARIABLE_Ptr
  1601. socklen_t
  1602. struct_addrinfo
  1603. struct_group_source_req
  1604. struct_ip_mreq_source
  1605. struct_ipv6_mreq
  1606. struct_pollfd
  1607. struct_rusage_ru_maxrss
  1608. struct_sctp_event_subscribe
  1609. struct_sockaddr_in6
  1610. struct_sockaddr_sa_len
  1611. struct_sockaddr_storage
  1612. struct_stat_st_mtim_tv_nsec
  1613. struct_v4l2_frmivalenum_discrete
  1614. "
  1615. HAVE_LIST="
  1616. $ARCH_EXT_LIST
  1617. $(add_suffix _external $ARCH_EXT_LIST)
  1618. $(add_suffix _inline $ARCH_EXT_LIST)
  1619. $ARCH_FEATURES
  1620. $ATOMICS_LIST
  1621. $BUILTIN_LIST
  1622. $HAVE_LIST_CMDLINE
  1623. $HAVE_LIST_PUB
  1624. $HEADERS_LIST
  1625. $INTRINSICS_LIST
  1626. $MATH_FUNCS
  1627. $SYSTEM_FUNCS
  1628. $THREADS_LIST
  1629. $TOOLCHAIN_FEATURES
  1630. $TYPES_LIST
  1631. atomics_native
  1632. dos_paths
  1633. dxva2api_cobj
  1634. dxva2_lib
  1635. libc_msvcrt
  1636. libdc1394_1
  1637. libdc1394_2
  1638. makeinfo
  1639. makeinfo_html
  1640. perl
  1641. pod2man
  1642. sdl
  1643. texi2html
  1644. threads
  1645. vdpau_x11
  1646. xlib
  1647. "
  1648. # options emitted with CONFIG_ prefix but not available on the command line
  1649. CONFIG_EXTRA="
  1650. aandcttables
  1651. ac3dsp
  1652. audio_frame_queue
  1653. audiodsp
  1654. blockdsp
  1655. bswapdsp
  1656. cabac
  1657. dvprofile
  1658. exif
  1659. faandct
  1660. faanidct
  1661. fdctdsp
  1662. frame_thread_encoder
  1663. gcrypt
  1664. golomb
  1665. gplv3
  1666. h263dsp
  1667. h264chroma
  1668. h264dsp
  1669. h264pred
  1670. h264qpel
  1671. hpeldsp
  1672. huffman
  1673. huffyuvdsp
  1674. huffyuvencdsp
  1675. idctdsp
  1676. iirfilter
  1677. intrax8
  1678. lgplv3
  1679. llauddsp
  1680. llviddsp
  1681. lpc
  1682. me_cmp
  1683. mpeg_er
  1684. mpegaudio
  1685. mpegaudiodsp
  1686. mpegvideo
  1687. mpegvideoenc
  1688. nettle
  1689. pixblockdsp
  1690. qpeldsp
  1691. rangecoder
  1692. riffdec
  1693. riffenc
  1694. rtpdec
  1695. rtpenc_chain
  1696. sinewin
  1697. startcode
  1698. tpeldsp
  1699. videodsp
  1700. vp3dsp
  1701. wma_freqs
  1702. "
  1703. CMDLINE_SELECT="
  1704. $ARCH_EXT_LIST
  1705. $CONFIG_LIST
  1706. $HAVE_LIST_CMDLINE
  1707. $THREADS_LIST
  1708. asm
  1709. cross_compile
  1710. debug
  1711. extra_warnings
  1712. logging
  1713. lto
  1714. optimizations
  1715. rpath
  1716. stripping
  1717. "
  1718. PATHS_LIST="
  1719. bindir
  1720. datadir
  1721. docdir
  1722. incdir
  1723. libdir
  1724. mandir
  1725. prefix
  1726. shlibdir
  1727. "
  1728. CMDLINE_SET="
  1729. $PATHS_LIST
  1730. ar
  1731. arch
  1732. as
  1733. assert_level
  1734. build_suffix
  1735. cc
  1736. cpu
  1737. cross_prefix
  1738. cxx
  1739. dep_cc
  1740. doxygen
  1741. extra_version
  1742. gas
  1743. host_cc
  1744. host_cflags
  1745. host_ld
  1746. host_ldflags
  1747. host_libs
  1748. host_os
  1749. install
  1750. ld
  1751. logfile
  1752. malloc_prefix
  1753. nm
  1754. optflags
  1755. pkg_config
  1756. pkg_config_flags
  1757. progs_suffix
  1758. random_seed
  1759. ranlib
  1760. samples
  1761. strip
  1762. sws_max_filter_size
  1763. sysinclude
  1764. sysroot
  1765. target_exec
  1766. target_os
  1767. target_path
  1768. target_samples
  1769. tempprefix
  1770. toolchain
  1771. valgrind
  1772. yasmexe
  1773. "
  1774. CMDLINE_APPEND="
  1775. extra_cflags
  1776. extra_cxxflags
  1777. host_cppflags
  1778. "
  1779. # code dependency declarations
  1780. # architecture extensions
  1781. armv5te_deps="arm"
  1782. armv6_deps="arm"
  1783. armv6t2_deps="arm"
  1784. armv8_deps="aarch64"
  1785. neon_deps_any="aarch64 arm"
  1786. intrinsics_neon_deps="neon"
  1787. vfp_deps_any="aarch64 arm"
  1788. vfpv3_deps="vfp"
  1789. setend_deps="arm"
  1790. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  1791. mipsfpu_deps="mips"
  1792. mips32r2_deps="mips"
  1793. mipsdspr1_deps="mips"
  1794. mipsdspr2_deps="mips"
  1795. altivec_deps="ppc"
  1796. ppc4xx_deps="ppc"
  1797. vsx_deps="ppc"
  1798. cpunop_deps="i686"
  1799. x86_64_select="i686"
  1800. x86_64_suggest="fast_cmov"
  1801. amd3dnow_deps="mmx"
  1802. amd3dnowext_deps="amd3dnow"
  1803. i686_deps="x86"
  1804. mmx_deps="x86"
  1805. mmxext_deps="mmx"
  1806. sse_deps="mmxext"
  1807. sse2_deps="sse"
  1808. sse3_deps="sse2"
  1809. ssse3_deps="sse3"
  1810. sse4_deps="ssse3"
  1811. sse42_deps="sse4"
  1812. avx_deps="sse42"
  1813. xop_deps="avx"
  1814. fma3_deps="avx"
  1815. fma4_deps="avx"
  1816. avx2_deps="avx"
  1817. mmx_external_deps="yasm"
  1818. mmx_inline_deps="inline_asm"
  1819. mmx_suggest="mmx_external mmx_inline"
  1820. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  1821. eval dep=\$${ext}_deps
  1822. eval ${ext}_external_deps='"${dep}_external"'
  1823. eval ${ext}_inline_deps='"${dep}_inline"'
  1824. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  1825. done
  1826. aligned_stack_if_any="aarch64 ppc x86"
  1827. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1828. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  1829. fast_unaligned_if_any="aarch64 ppc x86"
  1830. simd_align_16_if_any="altivec neon sse"
  1831. # system capabilities
  1832. symver_if_any="symver_asm_label symver_gnu_asm"
  1833. # threading support
  1834. atomics_gcc_if="sync_val_compare_and_swap"
  1835. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  1836. atomics_win32_if="MemoryBarrier"
  1837. atomics_native_if_any="$ATOMICS_LIST"
  1838. w32threads_deps="atomics_native"
  1839. threads_if_any="$THREADS_LIST"
  1840. # subsystems
  1841. dct_select="rdft"
  1842. error_resilience_select="me_cmp"
  1843. faandct_deps="faan fdctdsp"
  1844. faanidct_deps="faan idctdsp"
  1845. frame_thread_encoder_deps="encoders threads"
  1846. intrax8_select="error_resilience"
  1847. mdct_select="fft"
  1848. rdft_select="fft"
  1849. me_cmp_select="fdctdsp idctdsp pixblockdsp"
  1850. mpeg_er_select="error_resilience"
  1851. mpegaudio_select="mpegaudiodsp"
  1852. mpegaudiodsp_select="dct"
  1853. mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp videodsp"
  1854. mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
  1855. # decoders / encoders
  1856. aac_decoder_select="mdct sinewin"
  1857. aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
  1858. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1859. ac3_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
  1860. ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
  1861. ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
  1862. ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
  1863. aic_decoder_select="golomb idctdsp"
  1864. alac_encoder_select="lpc"
  1865. als_decoder_select="bswapdsp"
  1866. amrnb_decoder_select="lsp"
  1867. amrwb_decoder_select="lsp"
  1868. amv_decoder_select="sp5x_decoder exif"
  1869. amv_encoder_select="aandcttables mpegvideoenc"
  1870. ape_decoder_select="bswapdsp llauddsp"
  1871. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  1872. asv1_encoder_select="bswapdsp fdctdsp pixblockdsp"
  1873. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  1874. asv2_encoder_select="bswapdsp fdctdsp pixblockdsp"
  1875. atrac1_decoder_select="mdct sinewin"
  1876. atrac3_decoder_select="mdct"
  1877. atrac3p_decoder_select="mdct sinewin"
  1878. avrn_decoder_select="exif"
  1879. bink_decoder_select="blockdsp hpeldsp"
  1880. binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
  1881. binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
  1882. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  1883. cllc_decoder_select="bswapdsp"
  1884. comfortnoise_encoder_select="lpc"
  1885. cook_decoder_select="audiodsp mdct sinewin"
  1886. cscd_decoder_select="lzo"
  1887. cscd_decoder_suggest="zlib"
  1888. dca_decoder_select="mdct"
  1889. dirac_decoder_select="dwt golomb videodsp mpegvideoenc"
  1890. dnxhd_decoder_select="blockdsp idctdsp"
  1891. dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
  1892. dvvideo_decoder_select="dvprofile idctdsp"
  1893. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  1894. dxa_decoder_select="zlib"
  1895. eac3_decoder_select="ac3_decoder"
  1896. eac3_encoder_select="ac3_encoder"
  1897. eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
  1898. eatgq_decoder_select="aandcttables"
  1899. eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpeg1video_decoder"
  1900. exr_decoder_select="zlib"
  1901. ffv1_decoder_select="golomb rangecoder"
  1902. ffv1_encoder_select="rangecoder"
  1903. ffvhuff_decoder_select="huffyuv_decoder"
  1904. ffvhuff_encoder_select="huffyuv_encoder"
  1905. fic_decoder_select="golomb"
  1906. flac_decoder_select="golomb"
  1907. flac_encoder_select="bswapdsp golomb lpc"
  1908. flashsv_decoder_select="zlib"
  1909. flashsv_encoder_select="zlib"
  1910. flashsv2_encoder_select="zlib"
  1911. flashsv2_decoder_select="zlib"
  1912. flv_decoder_select="h263_decoder"
  1913. flv_encoder_select="h263_encoder"
  1914. fourxm_decoder_select="blockdsp bswapdsp"
  1915. fraps_decoder_select="bswapdsp huffman"
  1916. g2m_decoder_select="blockdsp idctdsp zlib"
  1917. g729_decoder_select="audiodsp"
  1918. h261_decoder_select="mpeg_er mpegvideo"
  1919. h261_encoder_select="aandcttables mpegvideoenc"
  1920. h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp"
  1921. h263_encoder_select="aandcttables h263dsp mpegvideoenc"
  1922. h263i_decoder_select="h263_decoder"
  1923. h263p_encoder_select="h263_encoder"
  1924. h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
  1925. h264_decoder_suggest="error_resilience"
  1926. hevc_decoder_select="bswapdsp cabac golomb videodsp"
  1927. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  1928. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llviddsp"
  1929. iac_decoder_select="imc_decoder"
  1930. imc_decoder_select="bswapdsp fft mdct sinewin"
  1931. indeo3_decoder_select="hpeldsp"
  1932. interplay_video_decoder_select="hpeldsp"
  1933. jpegls_decoder_select="golomb mjpeg_decoder"
  1934. jpegls_encoder_select="golomb"
  1935. jv_decoder_select="blockdsp"
  1936. lagarith_decoder_select="huffyuvdsp"
  1937. ljpeg_encoder_select="aandcttables idctdsp"
  1938. loco_decoder_select="golomb"
  1939. mdec_decoder_select="blockdsp idctdsp mpegvideo"
  1940. metasound_decoder_select="lsp mdct sinewin"
  1941. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  1942. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp"
  1943. mjpeg_encoder_select="aandcttables mpegvideoenc"
  1944. mjpegb_decoder_select="mjpeg_decoder"
  1945. mlp_decoder_select="mlp_parser"
  1946. motionpixels_decoder_select="bswapdsp"
  1947. mp1_decoder_select="mpegaudio"
  1948. mp1float_decoder_select="mpegaudio"
  1949. mp2_decoder_select="mpegaudio"
  1950. mp2float_decoder_select="mpegaudio"
  1951. mp3_decoder_select="mpegaudio"
  1952. mp3adu_decoder_select="mpegaudio"
  1953. mp3adufloat_decoder_select="mpegaudio"
  1954. mp3float_decoder_select="mpegaudio"
  1955. mp3on4_decoder_select="mpegaudio"
  1956. mp3on4float_decoder_select="mpegaudio"
  1957. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  1958. mpc8_decoder_select="mpegaudiodsp"
  1959. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1960. mpeg_xvmc_decoder_select="mpeg2video_decoder"
  1961. mpegvideo_decoder_select="error_resilience mpeg_er mpegvideo"
  1962. mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
  1963. mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
  1964. mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
  1965. mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp"
  1966. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1967. mpeg4_encoder_select="h263_encoder"
  1968. msmpeg4v1_decoder_select="h263_decoder"
  1969. msmpeg4v2_decoder_select="h263_decoder"
  1970. msmpeg4v2_encoder_select="h263_encoder"
  1971. msmpeg4v3_decoder_select="h263_decoder"
  1972. msmpeg4v3_encoder_select="h263_encoder"
  1973. mss2_decoder_select="error_resilience mpeg_er qpeldsp vc1_decoder"
  1974. mxpeg_decoder_select="mjpeg_decoder"
  1975. nellymoser_decoder_select="mdct sinewin"
  1976. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  1977. nuv_decoder_select="idctdsp lzo"
  1978. on2avc_decoder_select="mdct"
  1979. opus_decoder_deps="swresample"
  1980. png_decoder_select="zlib"
  1981. png_encoder_select="huffyuvencdsp zlib"
  1982. prores_decoder_select="blockdsp idctdsp"
  1983. prores_encoder_select="fdctdsp"
  1984. qcelp_decoder_select="lsp"
  1985. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1986. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  1987. ra_144_decoder_select="audiodsp"
  1988. ralf_decoder_select="golomb"
  1989. rawvideo_decoder_select="bswapdsp"
  1990. rtjpeg_decoder_select="me_cmp"
  1991. rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  1992. rv10_encoder_select="h263_encoder"
  1993. rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  1994. rv20_encoder_select="h263_encoder"
  1995. rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
  1996. rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
  1997. shorten_decoder_select="golomb"
  1998. sipr_decoder_select="lsp"
  1999. snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
  2000. snow_encoder_select="aandcttables dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder"
  2001. sonic_decoder_select="golomb rangecoder"
  2002. sonic_encoder_select="golomb rangecoder"
  2003. sonic_ls_encoder_select="golomb rangecoder"
  2004. sp5x_decoder_select="mjpeg_decoder"
  2005. svq1_decoder_select="hpeldsp"
  2006. svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
  2007. svq3_decoder_select="h264_decoder hpeldsp tpeldsp"
  2008. svq3_decoder_suggest="zlib"
  2009. tak_decoder_select="audiodsp"
  2010. theora_decoder_select="vp3_decoder"
  2011. thp_decoder_select="mjpeg_decoder"
  2012. tiff_decoder_suggest="zlib lzma"
  2013. tiff_encoder_suggest="zlib"
  2014. truehd_decoder_select="mlp_parser"
  2015. truemotion2_decoder_select="bswapdsp"
  2016. truespeech_decoder_select="bswapdsp"
  2017. tscc_decoder_select="zlib"
  2018. twinvq_decoder_select="mdct lsp sinewin"
  2019. utvideo_decoder_select="bswapdsp"
  2020. utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
  2021. vble_decoder_select="huffyuvdsp"
  2022. vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode"
  2023. vc1image_decoder_select="vc1_decoder"
  2024. vorbis_decoder_select="mdct"
  2025. vorbis_encoder_select="mdct"
  2026. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2027. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
  2028. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
  2029. vp6a_decoder_select="vp6_decoder"
  2030. vp6f_decoder_select="vp6_decoder"
  2031. vp7_decoder_select="h264pred videodsp"
  2032. vp8_decoder_select="h264pred videodsp"
  2033. vp9_decoder_select="videodsp vp9_parser"
  2034. webp_decoder_select="vp8_decoder"
  2035. wmalossless_decoder_select="llauddsp"
  2036. wmapro_decoder_select="mdct sinewin wma_freqs"
  2037. wmav1_decoder_select="mdct sinewin wma_freqs"
  2038. wmav1_encoder_select="mdct sinewin wma_freqs"
  2039. wmav2_decoder_select="mdct sinewin wma_freqs"
  2040. wmav2_encoder_select="mdct sinewin wma_freqs"
  2041. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  2042. wmv1_decoder_select="h263_decoder"
  2043. wmv1_encoder_select="h263_encoder"
  2044. wmv2_decoder_select="blockdsp h263_decoder idctdsp intrax8 videodsp"
  2045. wmv2_encoder_select="h263_encoder"
  2046. wmv3_decoder_select="vc1_decoder"
  2047. wmv3image_decoder_select="wmv3_decoder"
  2048. zerocodec_decoder_select="zlib"
  2049. zlib_decoder_select="zlib"
  2050. zlib_encoder_select="zlib"
  2051. zmbv_decoder_select="zlib"
  2052. zmbv_encoder_select="zlib"
  2053. # hardware accelerators
  2054. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2055. dxva2_deps="dxva2api_h"
  2056. vaapi_deps="va_va_h"
  2057. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  2058. vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
  2059. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  2060. xvmc_deps="X11_extensions_XvMClib_h"
  2061. h263_vaapi_hwaccel_deps="vaapi"
  2062. h263_vaapi_hwaccel_select="h263_decoder"
  2063. h263_vdpau_hwaccel_deps="vdpau"
  2064. h263_vdpau_hwaccel_select="h263_decoder"
  2065. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2066. h264_dxva2_hwaccel_deps="dxva2"
  2067. h264_dxva2_hwaccel_select="h264_decoder"
  2068. h264_vaapi_hwaccel_deps="vaapi"
  2069. h264_vaapi_hwaccel_select="h264_decoder"
  2070. h264_vda_decoder_deps="vda"
  2071. h264_vda_decoder_select="h264_decoder"
  2072. h264_vda_hwaccel_deps="vda"
  2073. h264_vda_hwaccel_select="h264_decoder"
  2074. h264_vda_old_hwaccel_deps="vda"
  2075. h264_vda_old_hwaccel_select="h264_decoder"
  2076. h264_vdpau_decoder_deps="vdpau"
  2077. h264_vdpau_decoder_select="h264_decoder"
  2078. h264_vdpau_hwaccel_deps="vdpau"
  2079. h264_vdpau_hwaccel_select="h264_decoder"
  2080. mpeg_vdpau_decoder_deps="vdpau"
  2081. mpeg_vdpau_decoder_select="mpeg2video_decoder"
  2082. mpeg_xvmc_hwaccel_deps="xvmc"
  2083. mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
  2084. mpeg1_vdpau_decoder_deps="vdpau"
  2085. mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  2086. mpeg1_vdpau_hwaccel_deps="vdpau"
  2087. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2088. mpeg1_xvmc_hwaccel_deps="xvmc"
  2089. mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
  2090. mpeg2_crystalhd_decoder_select="crystalhd"
  2091. mpeg2_dxva2_hwaccel_deps="dxva2"
  2092. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2093. mpeg2_vaapi_hwaccel_deps="vaapi"
  2094. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2095. mpeg2_vdpau_hwaccel_deps="vdpau"
  2096. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2097. mpeg2_xvmc_hwaccel_deps="xvmc"
  2098. mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
  2099. mpeg4_crystalhd_decoder_select="crystalhd"
  2100. mpeg4_vaapi_hwaccel_deps="vaapi"
  2101. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2102. mpeg4_vdpau_decoder_deps="vdpau"
  2103. mpeg4_vdpau_decoder_select="mpeg4_decoder"
  2104. mpeg4_vdpau_hwaccel_deps="vdpau"
  2105. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2106. msmpeg4_crystalhd_decoder_select="crystalhd"
  2107. vc1_crystalhd_decoder_select="crystalhd"
  2108. vc1_dxva2_hwaccel_deps="dxva2"
  2109. vc1_dxva2_hwaccel_select="vc1_decoder"
  2110. vc1_vaapi_hwaccel_deps="vaapi"
  2111. vc1_vaapi_hwaccel_select="vc1_decoder"
  2112. vc1_vdpau_decoder_deps="vdpau"
  2113. vc1_vdpau_decoder_select="vc1_decoder"
  2114. vc1_vdpau_hwaccel_deps="vdpau"
  2115. vc1_vdpau_hwaccel_select="vc1_decoder"
  2116. wmv3_crystalhd_decoder_select="crystalhd"
  2117. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2118. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2119. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  2120. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2121. # parsers
  2122. h264_parser_select="h264_decoder"
  2123. hevc_parser_select="hevc_decoder"
  2124. mpegvideo_parser_select="mpegvideo"
  2125. mpeg4video_parser_select="error_resilience h263dsp mpeg_er mpegvideo qpeldsp"
  2126. vc1_parser_select="mpegvideo startcode vc1_decoder"
  2127. # external libraries
  2128. libaacplus_encoder_deps="libaacplus"
  2129. libcelt_decoder_deps="libcelt"
  2130. libfaac_encoder_deps="libfaac"
  2131. libfaac_encoder_select="audio_frame_queue"
  2132. libfdk_aac_decoder_deps="libfdk_aac"
  2133. libfdk_aac_encoder_deps="libfdk_aac"
  2134. libfdk_aac_encoder_select="audio_frame_queue"
  2135. libgme_demuxer_deps="libgme"
  2136. libgsm_decoder_deps="libgsm"
  2137. libgsm_encoder_deps="libgsm"
  2138. libgsm_ms_decoder_deps="libgsm"
  2139. libgsm_ms_encoder_deps="libgsm"
  2140. libilbc_decoder_deps="libilbc"
  2141. libilbc_encoder_deps="libilbc"
  2142. libmodplug_demuxer_deps="libmodplug"
  2143. libmp3lame_encoder_deps="libmp3lame"
  2144. libmp3lame_encoder_select="audio_frame_queue"
  2145. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2146. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2147. libopencore_amrnb_encoder_select="audio_frame_queue"
  2148. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2149. libopenjpeg_decoder_deps="libopenjpeg"
  2150. libopenjpeg_encoder_deps="libopenjpeg"
  2151. libopus_decoder_deps="libopus"
  2152. libopus_encoder_deps="libopus"
  2153. libopus_encoder_select="audio_frame_queue"
  2154. libquvi_demuxer_deps="libquvi"
  2155. libschroedinger_decoder_deps="libschroedinger"
  2156. libschroedinger_encoder_deps="libschroedinger"
  2157. libshine_encoder_deps="libshine"
  2158. libshine_encoder_select="audio_frame_queue"
  2159. libspeex_decoder_deps="libspeex"
  2160. libspeex_encoder_deps="libspeex"
  2161. libspeex_encoder_select="audio_frame_queue"
  2162. libstagefright_h264_decoder_deps="libstagefright_h264"
  2163. libtheora_encoder_deps="libtheora"
  2164. libtwolame_encoder_deps="libtwolame"
  2165. libvo_aacenc_encoder_deps="libvo_aacenc"
  2166. libvo_aacenc_encoder_select="audio_frame_queue"
  2167. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2168. libvorbis_decoder_deps="libvorbis"
  2169. libvorbis_encoder_deps="libvorbis"
  2170. libvorbis_encoder_select="audio_frame_queue"
  2171. libvpx_vp8_decoder_deps="libvpx"
  2172. libvpx_vp8_encoder_deps="libvpx"
  2173. libvpx_vp9_decoder_deps="libvpx"
  2174. libvpx_vp9_encoder_deps="libvpx"
  2175. libwavpack_encoder_deps="libwavpack"
  2176. libwebp_encoder_deps="libwebp"
  2177. libx264_encoder_deps="libx264"
  2178. libx264rgb_encoder_deps="libx264"
  2179. libx265_encoder_deps="libx265"
  2180. libxavs_encoder_deps="libxavs"
  2181. libxvid_encoder_deps="libxvid"
  2182. libutvideo_decoder_deps="libutvideo"
  2183. libutvideo_encoder_deps="libutvideo"
  2184. libzvbi_teletext_decoder_deps="libzvbi"
  2185. # demuxers / muxers
  2186. ac3_demuxer_select="ac3_parser"
  2187. asf_demuxer_select="riffdec"
  2188. asf_muxer_select="riffenc"
  2189. asf_stream_muxer_select="asf_muxer"
  2190. avi_demuxer_select="riffdec exif"
  2191. avi_muxer_select="riffenc"
  2192. avisynth_demuxer_deps="avisynth"
  2193. avisynth_demuxer_select="riffdec"
  2194. caf_demuxer_select="riffdec"
  2195. dirac_demuxer_select="dirac_parser"
  2196. dts_demuxer_select="dca_parser"
  2197. dtshd_demuxer_select="dca_parser"
  2198. dv_demuxer_select="dvprofile"
  2199. dv_muxer_select="dvprofile"
  2200. dxa_demuxer_select="riffdec"
  2201. eac3_demuxer_select="ac3_parser"
  2202. f4v_muxer_select="mov_muxer"
  2203. flac_demuxer_select="flac_parser"
  2204. hds_muxer_select="flv_muxer"
  2205. hls_muxer_select="mpegts_muxer"
  2206. image2_alias_pix_demuxer_select="image2_demuxer"
  2207. image2_brender_pix_demuxer_select="image2_demuxer"
  2208. ipod_muxer_select="mov_muxer"
  2209. ismv_muxer_select="mov_muxer"
  2210. libnut_demuxer_deps="libnut"
  2211. libnut_muxer_deps="libnut"
  2212. matroska_audio_muxer_select="matroska_muxer"
  2213. matroska_demuxer_select="riffdec"
  2214. matroska_demuxer_suggest="bzlib lzo zlib"
  2215. matroska_muxer_select="riffenc"
  2216. mmf_muxer_select="riffenc"
  2217. mov_demuxer_select="riffdec"
  2218. mov_demuxer_suggest="zlib"
  2219. mov_muxer_select="riffenc rtpenc_chain ac3_parser"
  2220. mp3_demuxer_select="mpegaudio_parser"
  2221. mp4_muxer_select="mov_muxer"
  2222. mpegts_muxer_select="adts_muxer latm_muxer"
  2223. mpegtsraw_demuxer_select="mpegts_demuxer"
  2224. mxf_d10_muxer_select="mxf_muxer"
  2225. nut_muxer_select="riffenc"
  2226. nuv_demuxer_select="riffdec"
  2227. oga_muxer_select="ogg_muxer"
  2228. ogg_demuxer_select="golomb"
  2229. opus_muxer_select="ogg_muxer"
  2230. psp_muxer_select="mov_muxer"
  2231. rtp_demuxer_select="sdp_demuxer"
  2232. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  2233. rtsp_demuxer_select="http_protocol rtpdec"
  2234. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  2235. sap_demuxer_select="sdp_demuxer"
  2236. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  2237. sdp_demuxer_select="rtpdec"
  2238. smoothstreaming_muxer_select="ismv_muxer"
  2239. spdif_muxer_select="aac_parser"
  2240. spx_muxer_select="ogg_muxer"
  2241. tak_demuxer_select="tak_parser"
  2242. tg2_muxer_select="mov_muxer"
  2243. tgp_muxer_select="mov_muxer"
  2244. vobsub_demuxer_select="mpegps_demuxer"
  2245. w64_demuxer_select="wav_demuxer"
  2246. w64_muxer_select="wav_muxer"
  2247. wav_demuxer_select="riffdec"
  2248. wav_muxer_select="riffenc"
  2249. webm_muxer_select="riffenc"
  2250. wtv_demuxer_select="riffdec"
  2251. wtv_muxer_select="riffenc"
  2252. xmv_demuxer_select="riffdec"
  2253. xwma_demuxer_select="riffdec"
  2254. # indevs / outdevs
  2255. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  2256. alsa_outdev_deps="alsa_asoundlib_h"
  2257. avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia -framework CoreGraphics"
  2258. avfoundation_indev_select="avfoundation"
  2259. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  2260. caca_outdev_deps="libcaca"
  2261. decklink_outdev_deps="decklink pthreads"
  2262. decklink_outdev_extralibs="-lstdc++"
  2263. decklink_indev_deps="decklink pthreads"
  2264. decklink_indev_extralibs="-lstdc++"
  2265. dshow_indev_deps="IBaseFilter"
  2266. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
  2267. dv1394_indev_deps="dv1394"
  2268. dv1394_indev_select="dv_demuxer"
  2269. fbdev_indev_deps="linux_fb_h"
  2270. fbdev_outdev_deps="linux_fb_h"
  2271. gdigrab_indev_deps="CreateDIBSection"
  2272. gdigrab_indev_extralibs="-lgdi32"
  2273. gdigrab_indev_select="bmp_decoder"
  2274. iec61883_indev_deps="libiec61883"
  2275. jack_indev_deps="jack_jack_h sem_timedwait"
  2276. lavfi_indev_deps="avfilter"
  2277. libcdio_indev_deps="libcdio"
  2278. libdc1394_indev_deps="libdc1394"
  2279. libv4l2_indev_deps="libv4l2"
  2280. openal_indev_deps="openal"
  2281. opengl_outdev_deps="opengl"
  2282. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  2283. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  2284. pulse_indev_deps="libpulse"
  2285. pulse_outdev_deps="libpulse"
  2286. qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
  2287. qtkit_indev_select="qtkit"
  2288. sdl_outdev_deps="sdl"
  2289. sndio_indev_deps="sndio_h"
  2290. sndio_outdev_deps="sndio_h"
  2291. v4l_indev_deps="linux_videodev_h"
  2292. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  2293. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  2294. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  2295. vfwcap_indev_extralibs="-lavicap32"
  2296. xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
  2297. xv_outdev_extralibs="-lXv -lX11 -lXext"
  2298. x11grab_indev_deps="x11grab"
  2299. x11grab_xcb_indev_deps="libxcb"
  2300. # protocols
  2301. bluray_protocol_deps="libbluray"
  2302. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  2303. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  2304. ffrtmpcrypt_protocol_select="tcp_protocol"
  2305. ffrtmphttp_protocol_deps="!librtmp_protocol"
  2306. ffrtmphttp_protocol_select="http_protocol"
  2307. ftp_protocol_select="tcp_protocol"
  2308. gopher_protocol_select="network"
  2309. http_protocol_select="tcp_protocol"
  2310. httpproxy_protocol_select="tcp_protocol"
  2311. https_protocol_select="tls_protocol"
  2312. icecast_protocol_select="http_protocol"
  2313. librtmp_protocol_deps="librtmp"
  2314. librtmpe_protocol_deps="librtmp"
  2315. librtmps_protocol_deps="librtmp"
  2316. librtmpt_protocol_deps="librtmp"
  2317. librtmpte_protocol_deps="librtmp"
  2318. libsmbclient_protocol_deps="libsmbclient gplv3"
  2319. libssh_protocol_deps="libssh"
  2320. mmsh_protocol_select="http_protocol"
  2321. mmst_protocol_select="network"
  2322. rtmp_protocol_deps="!librtmp_protocol"
  2323. rtmp_protocol_select="tcp_protocol"
  2324. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  2325. rtmps_protocol_deps="!librtmp_protocol"
  2326. rtmps_protocol_select="tls_protocol"
  2327. rtmpt_protocol_select="ffrtmphttp_protocol"
  2328. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  2329. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  2330. rtp_protocol_select="udp_protocol"
  2331. sctp_protocol_deps="struct_sctp_event_subscribe"
  2332. sctp_protocol_select="network"
  2333. srtp_protocol_select="rtp_protocol"
  2334. tcp_protocol_select="network"
  2335. tls_protocol_deps_any="openssl gnutls"
  2336. tls_protocol_select="tcp_protocol"
  2337. udp_protocol_select="network"
  2338. unix_protocol_deps="sys_un_h"
  2339. unix_protocol_select="network"
  2340. # filters
  2341. amovie_filter_deps="avcodec avformat"
  2342. aresample_filter_deps="swresample"
  2343. ass_filter_deps="libass"
  2344. asyncts_filter_deps="avresample"
  2345. atempo_filter_deps="avcodec"
  2346. atempo_filter_select="rdft"
  2347. azmq_filter_deps="libzmq"
  2348. blackframe_filter_deps="gpl"
  2349. boxblur_filter_deps="gpl"
  2350. bs2b_filter_deps="libbs2b"
  2351. colormatrix_filter_deps="gpl"
  2352. cropdetect_filter_deps="gpl"
  2353. delogo_filter_deps="gpl"
  2354. deshake_filter_select="pixelutils"
  2355. drawtext_filter_deps="libfreetype"
  2356. ebur128_filter_deps="gpl"
  2357. flite_filter_deps="libflite"
  2358. frei0r_filter_deps="frei0r dlopen"
  2359. frei0r_filter_extralibs='$ldl'
  2360. frei0r_src_filter_deps="frei0r dlopen"
  2361. frei0r_src_filter_extralibs='$ldl'
  2362. geq_filter_deps="gpl"
  2363. histeq_filter_deps="gpl"
  2364. hqdn3d_filter_deps="gpl"
  2365. interlace_filter_deps="gpl"
  2366. kerndeint_filter_deps="gpl"
  2367. ladspa_filter_deps="ladspa dlopen"
  2368. ladspa_filter_extralibs='$ldl'
  2369. mcdeint_filter_deps="avcodec gpl"
  2370. movie_filter_deps="avcodec avformat"
  2371. mp_filter_deps="gpl avcodec swscale inline_asm"
  2372. mpdecimate_filter_deps="gpl"
  2373. mpdecimate_filter_select="pixelutils"
  2374. mptestsrc_filter_deps="gpl"
  2375. negate_filter_deps="lut_filter"
  2376. perspective_filter_deps="gpl"
  2377. ocv_filter_deps="libopencv"
  2378. owdenoise_filter_deps="gpl"
  2379. pan_filter_deps="swresample"
  2380. phase_filter_deps="gpl"
  2381. pp_filter_deps="gpl postproc"
  2382. pullup_filter_deps="gpl"
  2383. removelogo_filter_deps="avcodec avformat swscale"
  2384. resample_filter_deps="avresample"
  2385. sab_filter_deps="gpl swscale"
  2386. scale_filter_deps="swscale"
  2387. select_filter_select="pixelutils"
  2388. smartblur_filter_deps="gpl swscale"
  2389. showspectrum_filter_deps="avcodec"
  2390. showspectrum_filter_select="rdft"
  2391. spp_filter_deps="gpl avcodec"
  2392. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  2393. stereo3d_filter_deps="gpl"
  2394. subtitles_filter_deps="avformat avcodec libass"
  2395. super2xsai_filter_deps="gpl"
  2396. tinterlace_filter_deps="gpl"
  2397. vidstabdetect_filter_deps="libvidstab"
  2398. vidstabtransform_filter_deps="libvidstab"
  2399. pixfmts_super2xsai_test_deps="super2xsai_filter"
  2400. tinterlace_merge_test_deps="tinterlace_filter"
  2401. tinterlace_pad_test_deps="tinterlace_filter"
  2402. zmq_filter_deps="libzmq"
  2403. zoompan_filter_deps="swscale"
  2404. # examples
  2405. avio_reading="avformat avcodec avutil"
  2406. avcodec_example_deps="avcodec avutil"
  2407. decoding_encoding_example_deps="avcodec avformat avutil"
  2408. demuxing_decoding_example_deps="avcodec avformat avutil"
  2409. extract_mvs_example_deps="avcodec avformat avutil"
  2410. filter_audio_example_deps="avfilter avutil"
  2411. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  2412. filtering_video_example_deps="avfilter avcodec avformat avutil"
  2413. metadata_example_deps="avformat avutil"
  2414. muxing_example_deps="avcodec avformat avutil swscale"
  2415. remuxing_example_deps="avcodec avformat avutil"
  2416. resampling_audio_example_deps="avutil swresample"
  2417. scaling_video_example_deps="avutil swscale"
  2418. transcode_aac_example_deps="avcodec avformat swresample"
  2419. transcoding_example_deps="avfilter avcodec avformat avutil"
  2420. # libraries, in linking order
  2421. avcodec_deps="avutil"
  2422. avdevice_deps="avformat avcodec avutil"
  2423. avfilter_deps="avutil"
  2424. avformat_deps="avcodec avutil"
  2425. avresample_deps="avutil"
  2426. postproc_deps="avutil gpl"
  2427. swresample_deps="avutil"
  2428. swscale_deps="avutil"
  2429. # programs
  2430. ffmpeg_deps="avcodec avfilter avformat swresample"
  2431. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  2432. null_filter
  2433. setpts_filter trim_filter"
  2434. ffplay_deps="avcodec avformat swscale swresample sdl"
  2435. ffplay_libs='$sdl_libs'
  2436. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  2437. ffprobe_deps="avcodec avformat"
  2438. ffserver_deps="avformat fork sarestart"
  2439. ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  2440. # documentation
  2441. podpages_deps="perl"
  2442. manpages_deps="perl pod2man"
  2443. htmlpages_deps="perl"
  2444. htmlpages_deps_any="makeinfo_html texi2html"
  2445. txtpages_deps="perl makeinfo"
  2446. doc_deps_any="manpages htmlpages podpages txtpages"
  2447. # default parameters
  2448. logfile="config.log"
  2449. # installation paths
  2450. prefix_default="/usr/local"
  2451. bindir_default='${prefix}/bin'
  2452. datadir_default='${prefix}/share/ffmpeg'
  2453. docdir_default='${prefix}/share/doc/ffmpeg'
  2454. incdir_default='${prefix}/include'
  2455. libdir_default='${prefix}/lib'
  2456. mandir_default='${prefix}/share/man'
  2457. shlibdir_default="$libdir_default"
  2458. # toolchain
  2459. ar_default="ar"
  2460. cc_default="gcc"
  2461. cxx_default="g++"
  2462. host_cc_default="gcc"
  2463. cp_f="cp -f"
  2464. doxygen_default="doxygen"
  2465. install="install"
  2466. ln_s="ln -s -f"
  2467. nm_default="nm -g"
  2468. objformat="elf"
  2469. pkg_config_default=pkg-config
  2470. ranlib_default="ranlib"
  2471. strip_default="strip"
  2472. yasmexe_default="yasm"
  2473. windres_default="windres"
  2474. # OS
  2475. target_os_default=$(tolower $(uname -s))
  2476. host_os=$target_os_default
  2477. # machine
  2478. if test "$target_os_default" = aix; then
  2479. arch_default=$(uname -p)
  2480. strip_default="strip -X32_64"
  2481. else
  2482. arch_default=$(uname -m)
  2483. fi
  2484. cpu="generic"
  2485. intrinsics="none"
  2486. # configurable options
  2487. enable $PROGRAM_LIST
  2488. enable $DOCUMENT_LIST
  2489. enable $EXAMPLE_LIST
  2490. enable $(filter_out avresample $LIBRARY_LIST)
  2491. enable stripping
  2492. enable asm
  2493. enable debug
  2494. enable doc
  2495. enable faan faandct faanidct
  2496. enable optimizations
  2497. enable runtime_cpudetect
  2498. enable safe_bitstream_reader
  2499. enable static
  2500. enable swscale_alpha
  2501. sws_max_filter_size_default=256
  2502. set_default sws_max_filter_size
  2503. # Enable hwaccels by default.
  2504. enable dxva2 vaapi vda vdpau xvmc
  2505. enable xlib
  2506. # build settings
  2507. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  2508. LIBPREF="lib"
  2509. LIBSUF=".a"
  2510. FULLNAME='$(NAME)$(BUILDSUF)'
  2511. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  2512. SLIBPREF="lib"
  2513. SLIBSUF=".so"
  2514. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  2515. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  2516. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  2517. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  2518. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  2519. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  2520. asflags_filter=echo
  2521. cflags_filter=echo
  2522. ldflags_filter=echo
  2523. AS_C='-c'
  2524. AS_O='-o $@'
  2525. CC_C='-c'
  2526. CC_E='-E -o $@'
  2527. CC_O='-o $@'
  2528. CXX_C='-c'
  2529. CXX_O='-o $@'
  2530. LD_O='-o $@'
  2531. LD_LIB='-l%'
  2532. LD_PATH='-L'
  2533. HOSTCC_C='-c'
  2534. HOSTCC_E='-E -o $@'
  2535. HOSTCC_O='-o $@'
  2536. HOSTLD_O='-o $@'
  2537. host_libs='-lm'
  2538. host_cflags_filter=echo
  2539. host_ldflags_filter=echo
  2540. target_path='$(CURDIR)'
  2541. # since the object filename is not given with the -MM flag, the compiler
  2542. # is only able to print the basename, and we must add the path ourselves
  2543. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  2544. DEPFLAGS='-MM'
  2545. # find source path
  2546. if test -f configure; then
  2547. source_path=.
  2548. else
  2549. source_path=$(cd $(dirname "$0"); pwd)
  2550. echo "$source_path" | grep -q '[[:blank:]]' &&
  2551. die "Out of tree builds are impossible with whitespace in source path."
  2552. test -e "$source_path/config.h" &&
  2553. die "Out of tree builds are impossible with config.h in source dir."
  2554. fi
  2555. for v in "$@"; do
  2556. r=${v#*=}
  2557. l=${v%"$r"}
  2558. r=$(sh_quote "$r")
  2559. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  2560. done
  2561. find_things(){
  2562. thing=$1
  2563. pattern=$2
  2564. file=$source_path/$3
  2565. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2566. }
  2567. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2568. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2569. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2570. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2571. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  2572. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2573. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2574. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  2575. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2576. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  2577. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2578. ALL_COMPONENTS="
  2579. $BSF_LIST
  2580. $DECODER_LIST
  2581. $DEMUXER_LIST
  2582. $ENCODER_LIST
  2583. $FILTER_LIST
  2584. $HWACCEL_LIST
  2585. $INDEV_LIST
  2586. $MUXER_LIST
  2587. $OUTDEV_LIST
  2588. $PARSER_LIST
  2589. $PROTOCOL_LIST
  2590. "
  2591. for n in $COMPONENT_LIST; do
  2592. v=$(toupper ${n%s})_LIST
  2593. eval enable \$$v
  2594. eval ${n}_if_any="\$$v"
  2595. done
  2596. enable $ARCH_EXT_LIST
  2597. die_unknown(){
  2598. echo "Unknown option \"$1\"."
  2599. echo "See $0 --help for available options."
  2600. exit 1
  2601. }
  2602. print_3_columns() {
  2603. cat | tr ' ' '\n' | sort | pr -r -3 -t
  2604. }
  2605. show_list() {
  2606. suffix=_$1
  2607. shift
  2608. echo $* | sed s/$suffix//g | print_3_columns
  2609. exit 0
  2610. }
  2611. rand_list(){
  2612. IFS=', '
  2613. set -- $*
  2614. unset IFS
  2615. for thing; do
  2616. comp=${thing%:*}
  2617. prob=${thing#$comp}
  2618. prob=${prob#:}
  2619. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  2620. echo "prob ${prob:-0.5}"
  2621. printf '%s\n' $comp
  2622. done
  2623. }
  2624. do_random(){
  2625. action=$1
  2626. shift
  2627. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  2628. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  2629. }
  2630. for opt do
  2631. optval="${opt#*=}"
  2632. case "$opt" in
  2633. --extra-ldflags=*)
  2634. add_ldflags $optval
  2635. ;;
  2636. --extra-ldexeflags=*)
  2637. add_ldexeflags $optval
  2638. ;;
  2639. --extra-libs=*)
  2640. add_extralibs $optval
  2641. ;;
  2642. --disable-devices)
  2643. disable $INDEV_LIST $OUTDEV_LIST
  2644. ;;
  2645. --enable-debug=*)
  2646. debuglevel="$optval"
  2647. ;;
  2648. --disable-programs)
  2649. disable $PROGRAM_LIST
  2650. ;;
  2651. --disable-everything)
  2652. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2653. ;;
  2654. --disable-all)
  2655. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2656. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2657. ;;
  2658. --enable-random|--disable-random)
  2659. action=${opt%%-random}
  2660. do_random ${action#--} $COMPONENT_LIST
  2661. ;;
  2662. --enable-random=*|--disable-random=*)
  2663. action=${opt%%-random=*}
  2664. do_random ${action#--} $optval
  2665. ;;
  2666. --enable-*=*|--disable-*=*)
  2667. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2668. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2669. eval list=\$$(toupper $thing)_LIST
  2670. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2671. list=$(filter "$name" $list)
  2672. [ "$list" = "" ] && warn "Option $opt did not match anything"
  2673. $action $list
  2674. ;;
  2675. --enable-?*|--disable-?*)
  2676. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2677. if is_in $option $COMPONENT_LIST; then
  2678. test $action = disable && action=unset
  2679. eval $action \$$(toupper ${option%s})_LIST
  2680. elif is_in $option $CMDLINE_SELECT; then
  2681. $action $option
  2682. else
  2683. die_unknown $opt
  2684. fi
  2685. ;;
  2686. --list-*)
  2687. NAME="${opt#--list-}"
  2688. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2689. NAME=${NAME%s}
  2690. eval show_list $NAME \$$(toupper $NAME)_LIST
  2691. ;;
  2692. --help|-h) show_help
  2693. ;;
  2694. --fatal-warnings) enable fatal_warnings
  2695. ;;
  2696. *)
  2697. optname="${opt%%=*}"
  2698. optname="${optname#--}"
  2699. optname=$(echo "$optname" | sed 's/-/_/g')
  2700. if is_in $optname $CMDLINE_SET; then
  2701. eval $optname='$optval'
  2702. elif is_in $optname $CMDLINE_APPEND; then
  2703. append $optname "$optval"
  2704. else
  2705. die_unknown $opt
  2706. fi
  2707. ;;
  2708. esac
  2709. done
  2710. disabled logging && logfile=/dev/null
  2711. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  2712. set >> $logfile
  2713. test -n "$cross_prefix" && enable cross_compile
  2714. if enabled cross_compile; then
  2715. test -n "$arch" && test -n "$target_os" ||
  2716. die "Must specify target arch and OS when cross-compiling"
  2717. fi
  2718. ar_default="${cross_prefix}${ar_default}"
  2719. cc_default="${cross_prefix}${cc_default}"
  2720. cxx_default="${cross_prefix}${cxx_default}"
  2721. nm_default="${cross_prefix}${nm_default}"
  2722. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2723. ranlib_default="${cross_prefix}${ranlib_default}"
  2724. strip_default="${cross_prefix}${strip_default}"
  2725. windres_default="${cross_prefix}${windres_default}"
  2726. sysinclude_default="${sysroot}/usr/include"
  2727. test -n "$valgrind" && toolchain="valgrind-memcheck"
  2728. case "$toolchain" in
  2729. clang-asan)
  2730. cc_default="clang"
  2731. add_cflags -fsanitize=address
  2732. add_ldflags -fsanitize=address
  2733. ;;
  2734. clang-tsan)
  2735. cc_default="clang"
  2736. add_cflags -fsanitize=thread -pie
  2737. add_ldflags -fsanitize=thread -pie
  2738. ;;
  2739. clang-usan)
  2740. cc_default="clang"
  2741. add_cflags -fsanitize=undefined
  2742. add_ldflags -fsanitize=undefined
  2743. ;;
  2744. gcc-asan)
  2745. cc_default="gcc"
  2746. add_cflags -fsanitize=address
  2747. add_ldflags -fsanitize=address
  2748. ;;
  2749. gcc-tsan)
  2750. cc_default="gcc"
  2751. add_cflags -fsanitize=thread -pie -fPIC
  2752. add_ldflags -fsanitize=thread -pie -fPIC
  2753. ;;
  2754. gcc-usan)
  2755. cc_default="gcc"
  2756. add_cflags -fsanitize=undefined
  2757. add_ldflags -fsanitize=undefined
  2758. ;;
  2759. valgrind-massif)
  2760. target_exec_default=${valgrind:-"valgrind"}
  2761. target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
  2762. ;;
  2763. valgrind-memcheck)
  2764. target_exec_default=${valgrind:-"valgrind"}
  2765. target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
  2766. ;;
  2767. msvc)
  2768. # Check whether the current MSVC version needs the C99 converter.
  2769. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  2770. # support enough of C99 to build ffmpeg. Default to the new
  2771. # behaviour if the regexp was unable to match anything, since this
  2772. # successfully parses the version number of existing supported
  2773. # versions that require the converter (MSVC 2010 and 2012).
  2774. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  2775. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  2776. cc_default="cl"
  2777. else
  2778. cc_default="c99wrap cl"
  2779. fi
  2780. ld_default="link"
  2781. nm_default="dumpbin -symbols"
  2782. ar_default="lib"
  2783. target_os_default="win32"
  2784. # Use a relative path for TMPDIR. This makes sure all the
  2785. # ffconf temp files are written with a relative path, avoiding
  2786. # issues with msys/win32 path conversion for MSVC parameters
  2787. # such as -Fo<file> or -out:<file>.
  2788. TMPDIR=.
  2789. ;;
  2790. icl)
  2791. cc_default="icl"
  2792. ld_default="xilink"
  2793. nm_default="dumpbin -symbols"
  2794. ar_default="xilib"
  2795. target_os_default="win32"
  2796. TMPDIR=.
  2797. ;;
  2798. gcov)
  2799. add_cflags -fprofile-arcs -ftest-coverage
  2800. add_ldflags -fprofile-arcs -ftest-coverage
  2801. ;;
  2802. hardened)
  2803. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  2804. add_cflags -fno-strict-overflow -fstack-protector-all
  2805. add_ldflags -Wl,-z,relro -Wl,-z,now
  2806. ;;
  2807. ?*)
  2808. die "Unknown toolchain $toolchain"
  2809. ;;
  2810. esac
  2811. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  2812. target_exec target_os yasmexe
  2813. enabled cross_compile || host_cc_default=$cc
  2814. set_default host_cc
  2815. if ! $pkg_config --version >/dev/null 2>&1; then
  2816. warn "$pkg_config not found, library detection may fail."
  2817. pkg_config=false
  2818. fi
  2819. if test $doxygen != $doxygen_default && \
  2820. ! $doxygen --version >/dev/null 2>&1; then
  2821. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  2822. fi
  2823. exesuf() {
  2824. case $1 in
  2825. mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2826. esac
  2827. }
  2828. EXESUF=$(exesuf $target_os)
  2829. HOSTEXESUF=$(exesuf $host_os)
  2830. # set temporary file name
  2831. : ${TMPDIR:=$TEMPDIR}
  2832. : ${TMPDIR:=$TMP}
  2833. : ${TMPDIR:=/tmp}
  2834. if [ -n "$tempprefix" ] ; then
  2835. mktemp(){
  2836. echo $tempprefix.${HOSTNAME}.${UID}
  2837. }
  2838. elif ! check_cmd mktemp -u XXXXXX; then
  2839. # simple replacement for missing mktemp
  2840. # NOT SAFE FOR GENERAL USE
  2841. mktemp(){
  2842. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2843. }
  2844. fi
  2845. tmpfile(){
  2846. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2847. (set -C; exec > $tmp) 2>/dev/null ||
  2848. die "Unable to create temporary file in $TMPDIR."
  2849. append TMPFILES $tmp
  2850. eval $1=$tmp
  2851. }
  2852. trap 'rm -f -- $TMPFILES' EXIT
  2853. tmpfile TMPASM .asm
  2854. tmpfile TMPC .c
  2855. tmpfile TMPCPP .cpp
  2856. tmpfile TMPE $EXESUF
  2857. tmpfile TMPH .h
  2858. tmpfile TMPM .m
  2859. tmpfile TMPO .o
  2860. tmpfile TMPS .S
  2861. tmpfile TMPSH .sh
  2862. tmpfile TMPV .ver
  2863. unset -f mktemp
  2864. chmod +x $TMPE
  2865. # make sure we can execute files in $TMPDIR
  2866. cat > $TMPSH 2>> $logfile <<EOF
  2867. #! /bin/sh
  2868. EOF
  2869. chmod +x $TMPSH >> $logfile 2>&1
  2870. if ! $TMPSH >> $logfile 2>&1; then
  2871. cat <<EOF
  2872. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2873. variable to another directory and make sure that it is not mounted noexec.
  2874. EOF
  2875. die "Sanity test failed."
  2876. fi
  2877. armasm_flags(){
  2878. for flag; do
  2879. case $flag in
  2880. # Filter out MSVC cl.exe options from cflags that shouldn't
  2881. # be passed to gas-preprocessor
  2882. -M[TD]*) ;;
  2883. *) echo $flag ;;
  2884. esac
  2885. done
  2886. }
  2887. ccc_flags(){
  2888. for flag; do
  2889. case $flag in
  2890. -std=c99) echo -c99 ;;
  2891. -mcpu=*) echo -arch ${flag#*=} ;;
  2892. -mieee) echo -ieee ;;
  2893. -O*|-fast) echo $flag ;;
  2894. -fno-math-errno) echo -assume nomath_errno ;;
  2895. -g) echo -g3 ;;
  2896. -Wall) echo -msg_enable level2 ;;
  2897. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  2898. -Wl,*) echo $flag ;;
  2899. -f*|-W*) ;;
  2900. *) echo $flag ;;
  2901. esac
  2902. done
  2903. }
  2904. cparser_flags(){
  2905. for flag; do
  2906. case $flag in
  2907. -Wno-switch) echo -Wno-switch-enum ;;
  2908. -Wno-format-zero-length) ;;
  2909. -Wdisabled-optimization) ;;
  2910. -Wno-pointer-sign) echo -Wno-other ;;
  2911. *) echo $flag ;;
  2912. esac
  2913. done
  2914. }
  2915. msvc_common_flags(){
  2916. for flag; do
  2917. case $flag in
  2918. # In addition to specifying certain flags under the compiler
  2919. # specific filters, they must be specified here as well or else the
  2920. # generic catch all at the bottom will print the original flag.
  2921. -Wall) ;;
  2922. -std=c99) ;;
  2923. # Common flags
  2924. -fomit-frame-pointer) ;;
  2925. -g) echo -Z7 ;;
  2926. -fno-math-errno) ;;
  2927. -fno-common) ;;
  2928. -fno-signed-zeros) ;;
  2929. -fPIC) ;;
  2930. -mthumb) ;;
  2931. -march=*) ;;
  2932. -lz) echo zlib.lib ;;
  2933. -lavifil32) echo vfw32.lib ;;
  2934. -lavicap32) echo vfw32.lib user32.lib ;;
  2935. -l*) echo ${flag#-l}.lib ;;
  2936. *) echo $flag ;;
  2937. esac
  2938. done
  2939. }
  2940. msvc_flags(){
  2941. msvc_common_flags "$@"
  2942. for flag; do
  2943. case $flag in
  2944. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  2945. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  2946. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  2947. -wd4554 \
  2948. -wd4273 -wd4701 ;;
  2949. esac
  2950. done
  2951. }
  2952. icl_flags(){
  2953. msvc_common_flags "$@"
  2954. for flag; do
  2955. case $flag in
  2956. # Despite what Intel's documentation says -Wall, which is supported
  2957. # on Windows, does enable remarks so disable them here.
  2958. -Wall) echo $flag -Qdiag-disable:remark ;;
  2959. -std=c99) echo -Qstd=c99 ;;
  2960. -flto) echo -ipo ;;
  2961. esac
  2962. done
  2963. }
  2964. icc_flags(){
  2965. for flag; do
  2966. case $flag in
  2967. -flto) echo -ipo ;;
  2968. *) echo $flag ;;
  2969. esac
  2970. done
  2971. }
  2972. pgi_flags(){
  2973. for flag; do
  2974. case $flag in
  2975. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  2976. -fomit-frame-pointer) echo -Mnoframe ;;
  2977. -g) echo -gopt ;;
  2978. *) echo $flag ;;
  2979. esac
  2980. done
  2981. }
  2982. suncc_flags(){
  2983. for flag; do
  2984. case $flag in
  2985. -march=*|-mcpu=*)
  2986. case "${flag#*=}" in
  2987. native) echo -xtarget=native ;;
  2988. v9|niagara) echo -xarch=sparc ;;
  2989. ultrasparc) echo -xarch=sparcvis ;;
  2990. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2991. i586|pentium) echo -xchip=pentium ;;
  2992. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2993. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2994. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2995. pentium4*) echo -xtarget=pentium4 ;;
  2996. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2997. *-sse3) echo -xarch=sse3 ;;
  2998. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2999. bonnell) echo -xarch=ssse3 ;;
  3000. corei7|nehalem) echo -xtarget=nehalem ;;
  3001. westmere) echo -xtarget=westmere ;;
  3002. silvermont) echo -xarch=sse4_2 ;;
  3003. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  3004. core-avx*|ivybridge|haswell|broadwell)
  3005. echo -xarch=avx ;;
  3006. amdfam10|barcelona) echo -xtarget=barcelona ;;
  3007. btver1) echo -xarch=amdsse4a ;;
  3008. btver2|bdver*) echo -xarch=avx ;;
  3009. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  3010. k8|opteron|athlon64|athlon-fx)
  3011. echo -xarch=sse2a ;;
  3012. athlon*) echo -xarch=pentium_proa ;;
  3013. esac
  3014. ;;
  3015. -std=c99) echo -xc99 ;;
  3016. -fomit-frame-pointer) echo -xregs=frameptr ;;
  3017. -fPIC) echo -KPIC -xcode=pic32 ;;
  3018. -W*,*) echo $flag ;;
  3019. -f*-*|-W*|-mimpure-text) ;;
  3020. -shared) echo -G ;;
  3021. *) echo $flag ;;
  3022. esac
  3023. done
  3024. }
  3025. tms470_flags(){
  3026. for flag; do
  3027. case $flag in
  3028. -march=*|-mcpu=*)
  3029. case "${flag#*=}" in
  3030. armv7-a|cortex-a*) echo -mv=7a8 ;;
  3031. armv7-r|cortex-r*) echo -mv=7r4 ;;
  3032. armv7-m|cortex-m*) echo -mv=7m3 ;;
  3033. armv6*|arm11*) echo -mv=6 ;;
  3034. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  3035. echo -mv=5e ;;
  3036. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  3037. esac
  3038. ;;
  3039. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  3040. -mfpu=vfp) echo --float_support=vfpv2 ;;
  3041. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  3042. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  3043. -msoft-float) echo --float_support=vfplib ;;
  3044. -O[0-3]|-mf=*) echo $flag ;;
  3045. -g) echo -g -mn ;;
  3046. -pds=*) echo $flag ;;
  3047. -D*|-I*) echo $flag ;;
  3048. --gcc|--abi=*) echo $flag ;;
  3049. -me) echo $flag ;;
  3050. esac
  3051. done
  3052. }
  3053. probe_cc(){
  3054. pfx=$1
  3055. _cc=$2
  3056. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  3057. unset _ld_o _ldflags _ld_lib _ld_path
  3058. unset _depflags _DEPCMD _DEPFLAGS
  3059. _flags_filter=echo
  3060. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  3061. true # no-op to avoid reading stdin in following checks
  3062. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  3063. _type=llvm_gcc
  3064. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  3065. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  3066. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3067. _cflags_speed='-O3'
  3068. _cflags_size='-Os'
  3069. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  3070. _type=gcc
  3071. gcc_version=$($_cc --version | head -n1)
  3072. gcc_basever=$($_cc -dumpversion)
  3073. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  3074. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  3075. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  3076. if ! $_cc -dumpversion | grep -q '^2\.'; then
  3077. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3078. fi
  3079. _cflags_speed='-O3'
  3080. _cflags_size='-Os'
  3081. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  3082. _type=icc
  3083. _ident=$($_cc --version | head -n1)
  3084. _depflags='-MMD'
  3085. _cflags_speed='-O3'
  3086. _cflags_size='-Os'
  3087. _cflags_noopt='-O1'
  3088. _flags_filter=icc_flags
  3089. elif $_cc -v 2>&1 | grep -q xlc; then
  3090. _type=xlc
  3091. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  3092. _cflags_speed='-O5'
  3093. _cflags_size='-O5 -qcompact'
  3094. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  3095. _type=ccc
  3096. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  3097. _DEPFLAGS='-M'
  3098. _cflags_speed='-fast'
  3099. _cflags_size='-O1'
  3100. _flags_filter=ccc_flags
  3101. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  3102. test -d "$sysroot" || die "No valid sysroot specified."
  3103. _type=armcc
  3104. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  3105. armcc_conf="$PWD/armcc.conf"
  3106. $_cc --arm_linux_configure \
  3107. --arm_linux_config_file="$armcc_conf" \
  3108. --configure_sysroot="$sysroot" \
  3109. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  3110. die "Error creating armcc configuration file."
  3111. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  3112. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  3113. as_default="${cross_prefix}gcc"
  3114. _depflags='-MMD'
  3115. _cflags_speed='-O3'
  3116. _cflags_size='-Os'
  3117. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  3118. _type=tms470
  3119. _ident=$($_cc -version | head -n1 | tr -s ' ')
  3120. _flags='--gcc --abi=eabi -me'
  3121. _cc_e='-ppl -fe=$@'
  3122. _cc_o='-fe=$@'
  3123. _depflags='-ppa -ppd=$(@:.o=.d)'
  3124. _cflags_speed='-O3 -mf=5'
  3125. _cflags_size='-O3 -mf=2'
  3126. _flags_filter=tms470_flags
  3127. elif $_cc -v 2>&1 | grep -q clang; then
  3128. _type=clang
  3129. _ident=$($_cc --version | head -n1)
  3130. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3131. _cflags_speed='-O3'
  3132. _cflags_size='-Os'
  3133. elif $_cc -V 2>&1 | grep -q Sun; then
  3134. _type=suncc
  3135. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  3136. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  3137. _DEPFLAGS='-xM1 -xc99'
  3138. _ldflags='-std=c99'
  3139. _cflags_speed='-O5'
  3140. _cflags_size='-O5 -xspace'
  3141. _flags_filter=suncc_flags
  3142. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  3143. _type=pathscale
  3144. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3145. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3146. _cflags_speed='-O2'
  3147. _cflags_size='-Os'
  3148. _flags_filter='filter_out -Wdisabled-optimization'
  3149. elif $_cc -v 2>&1 | grep -q Open64; then
  3150. _type=open64
  3151. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3152. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3153. _cflags_speed='-O2'
  3154. _cflags_size='-Os'
  3155. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  3156. elif $_cc -V 2>&1 | grep -q Portland; then
  3157. _type=pgi
  3158. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  3159. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  3160. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  3161. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  3162. _cflags_noopt="-O"
  3163. _flags_filter=pgi_flags
  3164. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  3165. _type=armasm
  3166. _ident=$($_cc | head -n1)
  3167. # 4509: "This form of conditional instruction is deprecated"
  3168. _flags="-nologo -ignore 4509"
  3169. _flags_filter=armasm_flags
  3170. elif $_cc 2>&1 | grep -q Microsoft; then
  3171. _type=msvc
  3172. _ident=$($cc 2>&1 | head -n1)
  3173. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  3174. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  3175. _cflags_speed="-O2"
  3176. _cflags_size="-O1"
  3177. if $_cc 2>&1 | grep -q Linker; then
  3178. _ld_o='-out:$@'
  3179. else
  3180. _ld_o='-Fe$@'
  3181. fi
  3182. _cc_o='-Fo$@'
  3183. _cc_e='-P -Fi$@'
  3184. _flags_filter=msvc_flags
  3185. _ld_lib='lib%.a'
  3186. _ld_path='-libpath:'
  3187. _flags='-nologo'
  3188. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
  3189. if [ $pfx = hostcc ]; then
  3190. append _cflags -Dsnprintf=_snprintf
  3191. fi
  3192. disable stripping
  3193. elif $_cc 2>&1 | grep -q Intel; then
  3194. _type=icl
  3195. _ident=$($cc 2>&1 | head -n1)
  3196. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  3197. # Not only is O3 broken on 13.x+ but it is slower on all previous
  3198. # versions (tested) as well.
  3199. _cflags_speed="-O2"
  3200. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  3201. if $_cc 2>&1 | grep -q Linker; then
  3202. _ld_o='-out:$@'
  3203. else
  3204. _ld_o='-Fe$@'
  3205. fi
  3206. _cc_o='-Fo$@'
  3207. _cc_e='-P'
  3208. _flags_filter=icl_flags
  3209. _ld_lib='lib%.a'
  3210. _ld_path='-libpath:'
  3211. # -Qdiag-error to make icl error when seeing certain unknown arguments
  3212. _flags='-nologo -Qdiag-error:4044,10157'
  3213. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  3214. # with MSVC which enables it by default.
  3215. _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  3216. if [ $pfx = hostcc ]; then
  3217. append _cflags -Dsnprintf=_snprintf
  3218. fi
  3219. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  3220. _type=cparser
  3221. _ident=$($_cc --version | head -n1)
  3222. _depflags='-MMD'
  3223. _cflags_speed='-O4'
  3224. _cflags_size='-O2'
  3225. _flags_filter=cparser_flags
  3226. fi
  3227. eval ${pfx}_type=\$_type
  3228. eval ${pfx}_ident=\$_ident
  3229. }
  3230. set_ccvars(){
  3231. eval ${1}_C=\${_cc_c-\${${1}_C}}
  3232. eval ${1}_E=\${_cc_e-\${${1}_E}}
  3233. eval ${1}_O=\${_cc_o-\${${1}_O}}
  3234. if [ -n "$_depflags" ]; then
  3235. eval ${1}_DEPFLAGS=\$_depflags
  3236. else
  3237. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  3238. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  3239. eval DEP${1}FLAGS=\$_flags
  3240. fi
  3241. }
  3242. probe_cc cc "$cc"
  3243. cflags_filter=$_flags_filter
  3244. cflags_speed=$_cflags_speed
  3245. cflags_size=$_cflags_size
  3246. cflags_noopt=$_cflags_noopt
  3247. add_cflags $_flags $_cflags
  3248. cc_ldflags=$_ldflags
  3249. set_ccvars CC
  3250. probe_cc hostcc "$host_cc"
  3251. host_cflags_filter=$_flags_filter
  3252. add_host_cflags $_flags $_cflags
  3253. set_ccvars HOSTCC
  3254. test -n "$cc_type" && enable $cc_type ||
  3255. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  3256. : ${as_default:=$cc}
  3257. : ${dep_cc_default:=$cc}
  3258. : ${ld_default:=$cc}
  3259. : ${host_ld_default:=$host_cc}
  3260. set_default ar as dep_cc ld host_ld windres
  3261. probe_cc as "$as"
  3262. asflags_filter=$_flags_filter
  3263. add_asflags $_flags $_cflags
  3264. set_ccvars AS
  3265. probe_cc ld "$ld"
  3266. ldflags_filter=$_flags_filter
  3267. add_ldflags $_flags $_ldflags
  3268. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  3269. LD_O=${_ld_o-$LD_O}
  3270. LD_LIB=${_ld_lib-$LD_LIB}
  3271. LD_PATH=${_ld_path-$LD_PATH}
  3272. probe_cc hostld "$host_ld"
  3273. host_ldflags_filter=$_flags_filter
  3274. add_host_ldflags $_flags $_ldflags
  3275. HOSTLD_O=${_ld_o-$HOSTLD_O}
  3276. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  3277. probe_cc depcc "$dep_cc"
  3278. CCDEP=${_DEPCMD:-$DEPCMD}
  3279. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  3280. DEPCCFLAGS=$_flags
  3281. fi
  3282. if $ar 2>&1 | grep -q Microsoft; then
  3283. arflags="-nologo"
  3284. ar_o='-out:$@'
  3285. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  3286. arflags="rq"
  3287. ar_o='$@'
  3288. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  3289. arflags='-Xany -r -c'
  3290. ar_o='$@'
  3291. else
  3292. arflags="rc"
  3293. ar_o='$@'
  3294. fi
  3295. add_cflags $extra_cflags
  3296. add_cxxflags $extra_cxxflags
  3297. add_asflags $extra_cflags
  3298. if test -n "$sysroot"; then
  3299. case "$cc_type" in
  3300. gcc|llvm_gcc|clang)
  3301. add_cppflags --sysroot="$sysroot"
  3302. add_ldflags --sysroot="$sysroot"
  3303. # On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
  3304. add_cppflags -isysroot "$sysroot"
  3305. add_ldflags -isysroot "$sysroot"
  3306. ;;
  3307. tms470)
  3308. add_cppflags -I"$sysinclude"
  3309. add_ldflags --sysroot="$sysroot"
  3310. ;;
  3311. esac
  3312. fi
  3313. if test "$cpu" = host; then
  3314. enabled cross_compile &&
  3315. die "--cpu=host makes no sense when cross-compiling."
  3316. case "$cc_type" in
  3317. gcc|llvm_gcc)
  3318. check_native(){
  3319. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  3320. sed -n "/cc1.*$1=/{
  3321. s/.*$1=\\([^ ]*\\).*/\\1/
  3322. p
  3323. q
  3324. }" $TMPE
  3325. }
  3326. cpu=$(check_native -march || check_native -mcpu)
  3327. ;;
  3328. esac
  3329. test "${cpu:-host}" = host &&
  3330. die "--cpu=host not supported with compiler $cc"
  3331. fi
  3332. # Deal with common $arch aliases
  3333. case "$arch" in
  3334. aarch64|arm64)
  3335. arch="aarch64"
  3336. ;;
  3337. arm*|iPad*|iPhone*)
  3338. arch="arm"
  3339. ;;
  3340. mips*|IP*)
  3341. arch="mips"
  3342. ;;
  3343. parisc*|hppa*)
  3344. arch="parisc"
  3345. ;;
  3346. "Power Macintosh"|ppc*|powerpc*)
  3347. arch="ppc"
  3348. ;;
  3349. s390|s390x)
  3350. arch="s390"
  3351. ;;
  3352. sh4|sh)
  3353. arch="sh4"
  3354. ;;
  3355. sun4u|sparc*)
  3356. arch="sparc"
  3357. ;;
  3358. tilegx|tile-gx)
  3359. arch="tilegx"
  3360. ;;
  3361. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  3362. arch="x86"
  3363. ;;
  3364. esac
  3365. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  3366. enable $arch
  3367. # Add processor-specific flags
  3368. if enabled aarch64; then
  3369. case $cpu in
  3370. armv*)
  3371. cpuflags="-march=$cpu"
  3372. ;;
  3373. *)
  3374. cpuflags="-mcpu=$cpu"
  3375. ;;
  3376. esac
  3377. elif enabled alpha; then
  3378. cpuflags="-mcpu=$cpu"
  3379. elif enabled arm; then
  3380. check_arm_arch() {
  3381. check_cpp_condition stddef.h \
  3382. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  3383. $cpuflags
  3384. }
  3385. probe_arm_arch() {
  3386. if check_arm_arch 4; then echo armv4;
  3387. elif check_arm_arch 4T; then echo armv4t;
  3388. elif check_arm_arch 5; then echo armv5;
  3389. elif check_arm_arch 5E; then echo armv5e;
  3390. elif check_arm_arch 5T; then echo armv5t;
  3391. elif check_arm_arch 5TE; then echo armv5te;
  3392. elif check_arm_arch 5TEJ; then echo armv5te;
  3393. elif check_arm_arch 6; then echo armv6;
  3394. elif check_arm_arch 6J; then echo armv6j;
  3395. elif check_arm_arch 6K; then echo armv6k;
  3396. elif check_arm_arch 6Z; then echo armv6z;
  3397. elif check_arm_arch 6ZK; then echo armv6zk;
  3398. elif check_arm_arch 6T2; then echo armv6t2;
  3399. elif check_arm_arch 7; then echo armv7;
  3400. elif check_arm_arch 7A 7_A; then echo armv7-a;
  3401. elif check_arm_arch 7R 7_R; then echo armv7-r;
  3402. elif check_arm_arch 7M 7_M; then echo armv7-m;
  3403. elif check_arm_arch 7EM 7E_M; then echo armv7-m;
  3404. elif check_arm_arch 8A 8_A; then echo armv8-a;
  3405. fi
  3406. }
  3407. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  3408. case $cpu in
  3409. armv*)
  3410. cpuflags="-march=$cpu"
  3411. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  3412. ;;
  3413. *)
  3414. cpuflags="-mcpu=$cpu"
  3415. case $cpu in
  3416. cortex-a*) subarch=armv7a ;;
  3417. cortex-r*) subarch=armv7r ;;
  3418. cortex-m*) enable thumb; subarch=armv7m ;;
  3419. arm11*) subarch=armv6 ;;
  3420. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  3421. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  3422. *) subarch=$(probe_arm_arch) ;;
  3423. esac
  3424. ;;
  3425. esac
  3426. case "$subarch" in
  3427. armv5t*) enable fast_clz ;;
  3428. armv[6-8]*)
  3429. enable fast_clz
  3430. disabled fast_unaligned || enable fast_unaligned
  3431. ;;
  3432. esac
  3433. elif enabled avr32; then
  3434. case $cpu in
  3435. ap7[02]0[0-2])
  3436. subarch="avr32_ap"
  3437. cpuflags="-mpart=$cpu"
  3438. ;;
  3439. ap)
  3440. subarch="avr32_ap"
  3441. cpuflags="-march=$cpu"
  3442. ;;
  3443. uc3[ab]*)
  3444. subarch="avr32_uc"
  3445. cpuflags="-mcpu=$cpu"
  3446. ;;
  3447. uc)
  3448. subarch="avr32_uc"
  3449. cpuflags="-march=$cpu"
  3450. ;;
  3451. esac
  3452. elif enabled bfin; then
  3453. cpuflags="-mcpu=$cpu"
  3454. elif enabled mips; then
  3455. cpuflags="-march=$cpu"
  3456. case $cpu in
  3457. 24kc)
  3458. disable mipsfpu
  3459. disable mipsdspr1
  3460. disable mipsdspr2
  3461. ;;
  3462. 24kf*)
  3463. disable mipsdspr1
  3464. disable mipsdspr2
  3465. ;;
  3466. 24kec|34kc|1004kc)
  3467. disable mipsfpu
  3468. disable mipsdspr2
  3469. ;;
  3470. 24kef*|34kf*|1004kf*)
  3471. disable mipsdspr2
  3472. ;;
  3473. 74kc)
  3474. disable mipsfpu
  3475. ;;
  3476. esac
  3477. elif enabled ppc; then
  3478. disable ldbrx
  3479. disable vsx
  3480. case $(tolower $cpu) in
  3481. 601|ppc601|powerpc601)
  3482. cpuflags="-mcpu=601"
  3483. disable altivec
  3484. ;;
  3485. 603*|ppc603*|powerpc603*)
  3486. cpuflags="-mcpu=603"
  3487. disable altivec
  3488. ;;
  3489. 604*|ppc604*|powerpc604*)
  3490. cpuflags="-mcpu=604"
  3491. disable altivec
  3492. ;;
  3493. g3|75*|ppc75*|powerpc75*)
  3494. cpuflags="-mcpu=750"
  3495. disable altivec
  3496. ;;
  3497. g4|745*|ppc745*|powerpc745*)
  3498. cpuflags="-mcpu=7450"
  3499. ;;
  3500. 74*|ppc74*|powerpc74*)
  3501. cpuflags="-mcpu=7400"
  3502. ;;
  3503. g5|970|ppc970|powerpc970)
  3504. cpuflags="-mcpu=970"
  3505. ;;
  3506. power[3-8]*)
  3507. cpuflags="-mcpu=$cpu"
  3508. ;;
  3509. cell)
  3510. cpuflags="-mcpu=cell"
  3511. enable ldbrx
  3512. ;;
  3513. e500mc)
  3514. cpuflags="-mcpu=e500mc"
  3515. disable altivec
  3516. ;;
  3517. e500v2)
  3518. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3519. disable altivec
  3520. disable dcbzl
  3521. ;;
  3522. e500)
  3523. cpuflags="-mcpu=8540 -mhard-float"
  3524. disable altivec
  3525. disable dcbzl
  3526. ;;
  3527. esac
  3528. elif enabled sparc; then
  3529. case $cpu in
  3530. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  3531. cpuflags="-mcpu=$cpu"
  3532. ;;
  3533. ultrasparc*|niagara[234])
  3534. cpuflags="-mcpu=$cpu"
  3535. ;;
  3536. esac
  3537. elif enabled x86; then
  3538. case $cpu in
  3539. i[345]86|pentium)
  3540. cpuflags="-march=$cpu"
  3541. disable i686
  3542. disable mmx
  3543. ;;
  3544. # targets that do NOT support nopl and conditional mov (cmov)
  3545. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  3546. cpuflags="-march=$cpu"
  3547. disable i686
  3548. ;;
  3549. # targets that do support nopl and conditional mov (cmov)
  3550. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  3551. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
  3552. cpuflags="-march=$cpu"
  3553. enable i686
  3554. enable fast_cmov
  3555. ;;
  3556. # targets that do support conditional mov but on which it's slow
  3557. pentium4|pentium4m|prescott|nocona)
  3558. cpuflags="-march=$cpu"
  3559. enable i686
  3560. disable fast_cmov
  3561. ;;
  3562. esac
  3563. fi
  3564. if [ "$cpu" != generic ]; then
  3565. add_cflags $cpuflags
  3566. add_asflags $cpuflags
  3567. fi
  3568. # compiler sanity check
  3569. check_exec <<EOF
  3570. int main(void){ return 0; }
  3571. EOF
  3572. if test "$?" != 0; then
  3573. echo "$cc is unable to create an executable file."
  3574. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  3575. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  3576. echo "Only do this if you know what cross compiling means."
  3577. fi
  3578. die "C compiler test failed."
  3579. fi
  3580. add_cppflags -D_ISOC99_SOURCE
  3581. add_cxxflags -D__STDC_CONSTANT_MACROS
  3582. check_cflags -std=c99
  3583. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  3584. #include <stdlib.h>
  3585. EOF
  3586. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  3587. #include <stdlib.h>
  3588. EOF
  3589. add_host_cppflags -D_ISOC99_SOURCE
  3590. check_host_cflags -std=c99
  3591. check_host_cflags -Wall
  3592. check_host_cflags -O3
  3593. check_64bit(){
  3594. arch32=$1
  3595. arch64=$2
  3596. expr=$3
  3597. check_code cc "" "int test[2*($expr) - 1]" &&
  3598. subarch=$arch64 || subarch=$arch32
  3599. }
  3600. case "$arch" in
  3601. aarch64|alpha|ia64)
  3602. spic=$shared
  3603. ;;
  3604. mips)
  3605. check_64bit mips mips64 '_MIPS_SIM > 1'
  3606. spic=$shared
  3607. ;;
  3608. parisc)
  3609. check_64bit parisc parisc64 'sizeof(void *) > 4'
  3610. spic=$shared
  3611. ;;
  3612. ppc)
  3613. check_64bit ppc ppc64 'sizeof(void *) > 4'
  3614. spic=$shared
  3615. ;;
  3616. s390)
  3617. check_64bit s390 s390x 'sizeof(void *) > 4'
  3618. spic=$shared
  3619. ;;
  3620. sparc)
  3621. check_64bit sparc sparc64 'sizeof(void *) > 4'
  3622. spic=$shared
  3623. ;;
  3624. x86)
  3625. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3626. if test "$subarch" = "x86_64"; then
  3627. spic=$shared
  3628. fi
  3629. ;;
  3630. ppc)
  3631. check_cc <<EOF && subarch="ppc64"
  3632. int test[(int)sizeof(char*) - 7];
  3633. EOF
  3634. ;;
  3635. esac
  3636. enable $subarch
  3637. enabled spic && enable_weak pic
  3638. # OS specific
  3639. case $target_os in
  3640. aix)
  3641. SHFLAGS=-shared
  3642. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3643. enabled shared && add_ldflags -Wl,-brtl
  3644. ;;
  3645. android)
  3646. disable symver
  3647. SLIB_INSTALL_NAME='$(SLIBNAME)'
  3648. SLIB_INSTALL_LINKS=
  3649. # soname not set on purpose
  3650. SHFLAGS=-shared
  3651. ;;
  3652. haiku)
  3653. prefix_default="/boot/common"
  3654. network_extralibs="-lnetwork"
  3655. host_libs=
  3656. ;;
  3657. sunos)
  3658. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3659. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3660. network_extralibs="-lsocket -lnsl"
  3661. # When using suncc to build, the Solaris linker will mark
  3662. # an executable with each instruction set encountered by
  3663. # the Solaris assembler. As our libraries contain their own
  3664. # guards for processor-specific code, instead suppress
  3665. # generation of the HWCAPS ELF section on Solaris x86 only.
  3666. enabled_all suncc x86 &&
  3667. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3668. add_ldflags -Wl,-M,mapfile
  3669. nm_default='nm -P -g'
  3670. ;;
  3671. netbsd)
  3672. disable symver
  3673. oss_indev_extralibs="-lossaudio"
  3674. oss_outdev_extralibs="-lossaudio"
  3675. enabled gcc || check_ldflags -Wl,-zmuldefs
  3676. ;;
  3677. openbsd|bitrig)
  3678. disable symver
  3679. SHFLAGS='-shared'
  3680. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3681. SLIB_INSTALL_LINKS=
  3682. oss_indev_extralibs="-lossaudio"
  3683. oss_outdev_extralibs="-lossaudio"
  3684. ;;
  3685. dragonfly)
  3686. disable symver
  3687. ;;
  3688. freebsd)
  3689. ;;
  3690. bsd/os)
  3691. add_extralibs -lpoll -lgnugetopt
  3692. strip="strip -d"
  3693. ;;
  3694. darwin)
  3695. enabled ppc && add_asflags -force_cpusubtype_ALL
  3696. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3697. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3698. strip="${strip} -x"
  3699. add_ldflags -Wl,-dynamic,-search_paths_first
  3700. SLIBSUF=".dylib"
  3701. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  3702. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  3703. objformat="macho"
  3704. enabled x86_64 && objformat="macho64"
  3705. enabled_any pic shared ||
  3706. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3707. ;;
  3708. mingw32*)
  3709. if test $target_os = "mingw32ce"; then
  3710. disable network
  3711. else
  3712. target_os=mingw32
  3713. fi
  3714. LIBTARGET=i386
  3715. if enabled x86_64; then
  3716. LIBTARGET="i386:x86-64"
  3717. elif enabled arm; then
  3718. LIBTARGET=arm-wince
  3719. fi
  3720. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3721. check_ldflags -Wl,--nxcompat
  3722. check_ldflags -Wl,--dynamicbase
  3723. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  3724. shlibdir_default="$bindir_default"
  3725. SLIBPREF=""
  3726. SLIBSUF=".dll"
  3727. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3728. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3729. dlltool="${cross_prefix}dlltool"
  3730. if check_cmd lib.exe -list; then
  3731. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3732. if enabled x86_64; then
  3733. LIBTARGET=x64
  3734. fi
  3735. elif check_cmd $dlltool --version; then
  3736. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  3737. fi
  3738. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3739. SLIB_INSTALL_LINKS=
  3740. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3741. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3742. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  3743. objformat="win32"
  3744. ranlib=:
  3745. enable dos_paths
  3746. ;;
  3747. win32|win64)
  3748. disable symver
  3749. if enabled shared; then
  3750. # Link to the import library instead of the normal static library
  3751. # for shared libs.
  3752. LD_LIB='%.lib'
  3753. # Cannot build both shared and static libs with MSVC or icl.
  3754. disable static
  3755. fi
  3756. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  3757. shlibdir_default="$bindir_default"
  3758. SLIBPREF=""
  3759. SLIBSUF=".dll"
  3760. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3761. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3762. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3763. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3764. SLIB_INSTALL_LINKS=
  3765. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3766. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3767. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3768. objformat="win32"
  3769. ranlib=:
  3770. enable dos_paths
  3771. ;;
  3772. cygwin*)
  3773. target_os=cygwin
  3774. shlibdir_default="$bindir_default"
  3775. SLIBPREF="cyg"
  3776. SLIBSUF=".dll"
  3777. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3778. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3779. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3780. SLIB_INSTALL_LINKS=
  3781. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  3782. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  3783. objformat="win32"
  3784. enable dos_paths
  3785. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3786. ;;
  3787. *-dos|freedos|opendos)
  3788. network_extralibs="-lsocket"
  3789. objformat="coff"
  3790. enable dos_paths
  3791. add_cppflags -U__STRICT_ANSI__
  3792. ;;
  3793. linux)
  3794. enable dv1394
  3795. ;;
  3796. irix*)
  3797. target_os=irix
  3798. ranlib="echo ignoring ranlib"
  3799. ;;
  3800. os/2*)
  3801. strip="lxlite -CS"
  3802. ln_s="cp -f"
  3803. objformat="aout"
  3804. add_cppflags -D_GNU_SOURCE
  3805. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  3806. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  3807. LIBSUF="_s.a"
  3808. SLIBPREF=""
  3809. SLIBSUF=".dll"
  3810. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3811. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  3812. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  3813. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  3814. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  3815. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  3816. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  3817. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  3818. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  3819. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  3820. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  3821. enable dos_paths
  3822. enable_weak os2threads
  3823. ;;
  3824. gnu/kfreebsd)
  3825. add_cppflags -D_BSD_SOURCE
  3826. ;;
  3827. gnu)
  3828. ;;
  3829. qnx)
  3830. add_cppflags -D_QNX_SOURCE
  3831. network_extralibs="-lsocket"
  3832. ;;
  3833. symbian)
  3834. SLIBSUF=".dll"
  3835. enable dos_paths
  3836. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  3837. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  3838. add_ldflags -Wl,--target1-abs,--no-undefined \
  3839. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  3840. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  3841. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  3842. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  3843. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  3844. ;;
  3845. osf1)
  3846. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  3847. ;;
  3848. minix)
  3849. ;;
  3850. plan9)
  3851. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  3852. -D_REENTRANT_SOURCE \
  3853. -D_RESEARCH_SOURCE \
  3854. -DFD_SETSIZE=96 \
  3855. -DHAVE_SOCK_OPTS
  3856. add_compat strtod.o strtod=avpriv_strtod
  3857. network_extralibs='-lbsd'
  3858. exeobjs=compat/plan9/main.o
  3859. disable ffserver
  3860. cp_f='cp'
  3861. ;;
  3862. none)
  3863. ;;
  3864. *)
  3865. die "Unknown OS '$target_os'."
  3866. ;;
  3867. esac
  3868. # determine libc flavour
  3869. probe_libc(){
  3870. pfx=$1
  3871. pfx_no_=${pfx%_}
  3872. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  3873. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  3874. eval ${pfx}libc_type=uclibc
  3875. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3876. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  3877. eval ${pfx}libc_type=glibc
  3878. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3879. # MinGW headers can be installed on Cygwin, so check for newlib first.
  3880. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  3881. eval ${pfx}libc_type=newlib
  3882. add_${pfx}cppflags -U__STRICT_ANSI__
  3883. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  3884. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  3885. eval ${pfx}libc_type=mingw64
  3886. if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  3887. add_compat msvcrt/snprintf.o
  3888. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  3889. fi
  3890. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3891. eval test \$${pfx_no_}cc_type = "gcc" &&
  3892. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3893. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  3894. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  3895. eval ${pfx}libc_type=mingw32
  3896. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  3897. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  3898. die "ERROR: MinGW32 runtime version must be >= 3.15."
  3899. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3900. eval test \$${pfx_no_}cc_type = "gcc" &&
  3901. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3902. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  3903. eval ${pfx}libc_type=msvcrt
  3904. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  3905. # 0x601 by default unless something else is set by the user.
  3906. # This can easily lead to us detecting functions only present
  3907. # in such new versions and producing binaries requiring windows 7.0.
  3908. # Therefore explicitly set the default to XP unless the user has
  3909. # set something else on the command line.
  3910. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  3911. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  3912. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  3913. eval ${pfx}libc_type=klibc
  3914. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  3915. eval ${pfx}libc_type=bionic
  3916. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  3917. eval ${pfx}libc_type=solaris
  3918. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  3919. fi
  3920. check_${pfx}cc <<EOF
  3921. #include <time.h>
  3922. void *v = localtime_r;
  3923. EOF
  3924. test "$?" != 0 && check_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3925. #include <time.h>
  3926. void *v = localtime_r;
  3927. EOF
  3928. }
  3929. probe_libc
  3930. test -n "$libc_type" && enable libc_$libc_type
  3931. probe_libc host_
  3932. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  3933. case $libc_type in
  3934. bionic)
  3935. add_compat strtod.o strtod=avpriv_strtod
  3936. ;;
  3937. msvcrt)
  3938. add_compat strtod.o strtod=avpriv_strtod
  3939. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  3940. _snprintf=avpriv_snprintf \
  3941. vsnprintf=avpriv_vsnprintf
  3942. ;;
  3943. esac
  3944. # hacks for compiler/libc/os combinations
  3945. if enabled_all tms470 libc_glibc; then
  3946. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  3947. add_cppflags -D__USER_LABEL_PREFIX__=
  3948. add_cppflags -D__builtin_memset=memset
  3949. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  3950. add_cflags -pds=48 # incompatible redefinition of macro
  3951. fi
  3952. if enabled_all ccc libc_glibc; then
  3953. add_ldflags -Wl,-z,now # calls to libots crash without this
  3954. fi
  3955. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  3956. add_cppflags '-I\$(SRC_PATH)/compat/float'
  3957. esc(){
  3958. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  3959. }
  3960. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  3961. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  3962. set_default $PATHS_LIST
  3963. set_default nm
  3964. # we need to build at least one lib type
  3965. if ! enabled_any static shared; then
  3966. cat <<EOF
  3967. At least one library type must be built.
  3968. Specify --enable-static to build the static libraries or --enable-shared to
  3969. build the shared libraries as well. To only build the shared libraries specify
  3970. --disable-static in addition to --enable-shared.
  3971. EOF
  3972. exit 1;
  3973. fi
  3974. die_license_disabled() {
  3975. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  3976. }
  3977. die_license_disabled_gpl() {
  3978. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  3979. }
  3980. die_license_disabled gpl frei0r
  3981. die_license_disabled gpl libcdio
  3982. die_license_disabled gpl libsmbclient
  3983. die_license_disabled gpl libutvideo
  3984. die_license_disabled gpl libvidstab
  3985. die_license_disabled gpl libx264
  3986. die_license_disabled gpl libx265
  3987. die_license_disabled gpl libxavs
  3988. die_license_disabled gpl libxvid
  3989. die_license_disabled gpl libzvbi
  3990. die_license_disabled gpl x11grab
  3991. die_license_disabled nonfree libaacplus
  3992. die_license_disabled nonfree libfaac
  3993. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  3994. enabled gpl && die_license_disabled_gpl nonfree openssl
  3995. die_license_disabled version3 libopencore_amrnb
  3996. die_license_disabled version3 libopencore_amrwb
  3997. die_license_disabled version3 libsmbclient
  3998. die_license_disabled version3 libvo_aacenc
  3999. die_license_disabled version3 libvo_amrwbenc
  4000. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4001. disabled optimizations || check_cflags -fomit-frame-pointer
  4002. enable_weak_pic() {
  4003. disabled pic && return
  4004. enable pic
  4005. add_cppflags -DPIC
  4006. case "$target_os" in
  4007. mingw*|cygwin*)
  4008. ;;
  4009. *)
  4010. add_cflags -fPIC
  4011. ;;
  4012. esac
  4013. add_asflags -fPIC
  4014. }
  4015. enabled pic && enable_weak_pic
  4016. check_cc <<EOF || die "Symbol mangling check failed."
  4017. int ff_extern;
  4018. EOF
  4019. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  4020. extern_prefix=${sym%%ff_extern*}
  4021. check_cc <<EOF && enable_weak inline_asm
  4022. void foo(void) { __asm__ volatile ("" ::); }
  4023. EOF
  4024. _restrict=
  4025. for restrict_keyword in restrict __restrict__ __restrict; do
  4026. check_cc <<EOF && _restrict=$restrict_keyword && break
  4027. void foo(char * $restrict_keyword p);
  4028. EOF
  4029. done
  4030. check_cc <<EOF && enable pragma_deprecated
  4031. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  4032. EOF
  4033. check_cc <<EOF && enable attribute_packed
  4034. struct { int x; } __attribute__((packed)) x;
  4035. EOF
  4036. check_cc <<EOF && enable attribute_may_alias
  4037. union { int x; } __attribute__((may_alias)) x;
  4038. EOF
  4039. check_cc <<EOF || die "endian test failed"
  4040. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  4041. EOF
  4042. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  4043. if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] ;then
  4044. if ! enabled bigendian && enabled altivec ;then
  4045. enable vsx
  4046. fi
  4047. fi
  4048. check_gas() {
  4049. log "check_gas using '$as' as AS"
  4050. # :vararg is used on aarch64, arm and ppc altivec
  4051. check_as <<EOF || return 1
  4052. .macro m n, y:vararg=0
  4053. \n: .int \y
  4054. .endm
  4055. m x
  4056. EOF
  4057. # .altmacro is only used in arm asm
  4058. ! enabled arm || check_as <<EOF || return 1
  4059. .altmacro
  4060. EOF
  4061. enable gnu_as
  4062. return 0
  4063. }
  4064. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  4065. nogas=:
  4066. enabled_any arm aarch64 && nogas=die
  4067. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  4068. as_noop=-v
  4069. case $as_type in
  4070. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  4071. gcc) gaspp_as_type=gas ;;
  4072. *) gaspp_as_type=$as_type ;;
  4073. esac
  4074. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  4075. test "${as#*gas-preprocessor.pl}" != "$as" ||
  4076. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  4077. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  4078. if ! check_gas ; then
  4079. as=${gas:=$as}
  4080. check_gas || \
  4081. $nogas "GNU assembler not found, install/update gas-preprocessor"
  4082. fi
  4083. check_as <<EOF && enable as_func
  4084. .func test
  4085. .endfunc
  4086. EOF
  4087. fi
  4088. check_inline_asm inline_asm_labels '"1:\n"'
  4089. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  4090. if enabled aarch64; then
  4091. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  4092. # internal assembler in clang 3.3 does not support this instruction
  4093. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  4094. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  4095. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  4096. elif enabled alpha; then
  4097. check_cflags -mieee
  4098. elif enabled arm; then
  4099. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  4100. float func(float a, float b){ return a+b; }
  4101. EOF
  4102. enabled thumb && check_cflags -mthumb || check_cflags -marm
  4103. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  4104. enable vfp_args
  4105. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  4106. case "${cross_prefix:-$cc}" in
  4107. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  4108. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  4109. __asm__ (".eabi_attribute 28, 1");
  4110. int main(void) { return 0; }
  4111. EOF
  4112. esac
  4113. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  4114. fi
  4115. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  4116. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  4117. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  4118. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  4119. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  4120. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  4121. enabled setend && check_insn setend 'setend be'
  4122. [ $target_os = linux ] || [ $target_os = android ] ||
  4123. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  4124. $ARCH_EXT_LIST_ARM
  4125. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  4126. check_as <<EOF && enable as_dn_directive
  4127. ra .dn d0.i16
  4128. .unreq ra
  4129. EOF
  4130. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  4131. elif enabled mips; then
  4132. check_inline_asm loongson '"dmult.g $1, $2, $3"'
  4133. enabled mips32r2 && add_cflags "-mips32r2" && add_asflags "-mips32r2" &&
  4134. check_inline_asm mips32r2 '"rotr $t0, $t1, 1"'
  4135. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  4136. check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  4137. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  4138. check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  4139. enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
  4140. check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  4141. elif enabled parisc; then
  4142. if enabled gcc; then
  4143. case $($cc -dumpversion) in
  4144. 4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
  4145. esac
  4146. fi
  4147. elif enabled ppc; then
  4148. enable local_aligned_8 local_aligned_16 local_aligned_32
  4149. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  4150. check_inline_asm ibm_asm '"add 0, 0, 0"'
  4151. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  4152. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  4153. # AltiVec flags: The FSF version of GCC differs from the Apple version
  4154. if enabled altivec; then
  4155. check_cflags -maltivec -mabi=altivec &&
  4156. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  4157. check_cflags -faltivec
  4158. # check if our compiler supports Motorola AltiVec C API
  4159. check_cc <<EOF || disable altivec
  4160. $inc_altivec_h
  4161. int main(void) {
  4162. vector signed int v1 = (vector signed int) { 0 };
  4163. vector signed int v2 = (vector signed int) { 1 };
  4164. v1 = vec_add(v1, v2);
  4165. return 0;
  4166. }
  4167. EOF
  4168. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  4169. fi
  4170. if enabled vsx; then
  4171. check_cflags -mvsx
  4172. fi
  4173. elif enabled x86; then
  4174. check_builtin rdtsc intrin.h "__rdtsc()"
  4175. check_builtin mm_empty mmintrin.h "_mm_empty()"
  4176. enable local_aligned_8 local_aligned_16 local_aligned_32
  4177. # check whether EBP is available on x86
  4178. # As 'i' is stored on the stack, this program will crash
  4179. # if the base pointer is used to access it because the
  4180. # base pointer is cleared in the inline assembly code.
  4181. check_exec_crash <<EOF && enable ebp_available
  4182. volatile int i=0;
  4183. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  4184. return i;
  4185. EOF
  4186. # check whether EBX is available on x86
  4187. check_inline_asm ebx_available '""::"b"(0)' &&
  4188. check_inline_asm ebx_available '"":::"%ebx"'
  4189. # check whether xmm clobbers are supported
  4190. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  4191. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  4192. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  4193. # check whether binutils is new enough to compile SSSE3/MMXEXT
  4194. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  4195. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  4196. if ! disabled_any asm mmx yasm; then
  4197. if check_cmd $yasmexe --version; then
  4198. enabled x86_64 && yasm_extra="-m amd64"
  4199. yasm_debug="-g dwarf2"
  4200. elif check_cmd nasm -v; then
  4201. yasmexe=nasm
  4202. yasm_debug="-g -F dwarf"
  4203. if enabled x86_64; then
  4204. case "$objformat" in
  4205. elf) objformat=elf64 ;;
  4206. win32) objformat=win64 ;;
  4207. esac
  4208. fi
  4209. fi
  4210. YASMFLAGS="-f $objformat $yasm_extra"
  4211. enabled pic && append YASMFLAGS "-DPIC"
  4212. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  4213. case "$objformat" in
  4214. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  4215. esac
  4216. check_yasm "movbe ecx, [5]" && enable yasm ||
  4217. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  4218. check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  4219. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  4220. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  4221. check_yasm "CPU amdnop" || disable cpunop
  4222. fi
  4223. case "$cpu" in
  4224. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  4225. disable fast_clz
  4226. ;;
  4227. esac
  4228. fi
  4229. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  4230. check_ldflags -Wl,--as-needed
  4231. check_ldflags -Wl,-z,noexecstack
  4232. if check_func dlopen; then
  4233. ldl=
  4234. elif check_func dlopen -ldl; then
  4235. ldl=-ldl
  4236. fi
  4237. if ! disabled network; then
  4238. check_func getaddrinfo $network_extralibs
  4239. check_func getservbyport $network_extralibs
  4240. check_func inet_aton $network_extralibs
  4241. check_type netdb.h "struct addrinfo"
  4242. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  4243. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  4244. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  4245. check_type poll.h "struct pollfd"
  4246. check_type netinet/sctp.h "struct sctp_event_subscribe"
  4247. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  4248. check_type netinet/in.h "struct sockaddr_in6"
  4249. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  4250. check_type "sys/types.h sys/socket.h" socklen_t
  4251. # Prefer arpa/inet.h over winsock2
  4252. if check_header arpa/inet.h ; then
  4253. check_func closesocket
  4254. elif check_header winsock2.h ; then
  4255. check_func_headers winsock2.h closesocket -lws2 &&
  4256. network_extralibs="-lws2" ||
  4257. { check_func_headers winsock2.h closesocket -lws2_32 &&
  4258. network_extralibs="-lws2_32"; } || disable winsock2_h network
  4259. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  4260. check_type ws2tcpip.h socklen_t
  4261. check_type ws2tcpip.h "struct addrinfo"
  4262. check_type ws2tcpip.h "struct group_source_req"
  4263. check_type ws2tcpip.h "struct ip_mreq_source"
  4264. check_type ws2tcpip.h "struct ipv6_mreq"
  4265. check_type winsock2.h "struct pollfd"
  4266. check_struct winsock2.h "struct sockaddr" sa_len
  4267. check_type ws2tcpip.h "struct sockaddr_in6"
  4268. check_type ws2tcpip.h "struct sockaddr_storage"
  4269. else
  4270. disable network
  4271. fi
  4272. fi
  4273. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  4274. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  4275. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  4276. check_builtin sarestart signal.h "SA_RESTART"
  4277. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  4278. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  4279. check_func ${malloc_prefix}memalign && enable memalign
  4280. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  4281. check_func access
  4282. check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4283. check_func fcntl
  4284. check_func fork
  4285. check_func gethrtime
  4286. check_func getopt
  4287. check_func getrusage
  4288. check_func gettimeofday
  4289. check_func gmtime_r
  4290. check_func isatty
  4291. check_func localtime_r
  4292. check_func mach_absolute_time
  4293. check_func mkstemp
  4294. check_func mmap
  4295. check_func mprotect
  4296. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  4297. check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4298. check_func sched_getaffinity
  4299. check_func setrlimit
  4300. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  4301. check_func strerror_r
  4302. check_func sysconf
  4303. check_func sysctl
  4304. check_func usleep
  4305. check_func_headers conio.h kbhit
  4306. check_func_headers io.h setmode
  4307. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  4308. check_func_headers stdlib.h getenv
  4309. check_func_headers windows.h CoTaskMemFree -lole32
  4310. check_func_headers windows.h GetProcessAffinityMask
  4311. check_func_headers windows.h GetProcessTimes
  4312. check_func_headers windows.h GetSystemTimeAsFileTime
  4313. check_func_headers windows.h MapViewOfFile
  4314. check_func_headers windows.h PeekNamedPipe
  4315. check_func_headers windows.h SetConsoleTextAttribute
  4316. check_func_headers windows.h Sleep
  4317. check_func_headers windows.h VirtualAlloc
  4318. check_struct windows.h "CONDITION_VARIABLE" Ptr
  4319. check_func_headers glob.h glob
  4320. enabled xlib &&
  4321. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  4322. check_header cl/cl.h
  4323. check_header direct.h
  4324. check_header dlfcn.h
  4325. check_header dxva.h
  4326. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  4327. check_header io.h
  4328. check_header libcrystalhd/libcrystalhd_if.h
  4329. check_header mach/mach_time.h
  4330. check_header malloc.h
  4331. check_header poll.h
  4332. check_header sys/mman.h
  4333. check_header sys/param.h
  4334. check_header sys/resource.h
  4335. check_header sys/select.h
  4336. check_header sys/time.h
  4337. check_header sys/un.h
  4338. check_header termios.h
  4339. check_header unistd.h
  4340. check_header vdpau/vdpau.h
  4341. check_header vdpau/vdpau_x11.h
  4342. check_header VideoDecodeAcceleration/VDADecoder.h
  4343. check_header windows.h
  4344. check_header X11/extensions/XvMClib.h
  4345. check_header asm/types.h
  4346. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  4347. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  4348. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  4349. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  4350. if ! disabled w32threads && ! enabled pthreads; then
  4351. check_func_headers "windows.h process.h" _beginthreadex &&
  4352. enable w32threads || disable w32threads
  4353. fi
  4354. # check for some common methods of building with pthread support
  4355. # do this before the optional library checks as some of them require pthreads
  4356. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  4357. enable pthreads
  4358. if check_func pthread_join -pthread && check_func pthread_create -pthread; then
  4359. add_cflags -pthread
  4360. add_extralibs -pthread
  4361. elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
  4362. add_cflags -pthreads
  4363. add_extralibs -pthreads
  4364. elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
  4365. add_cflags -ldl -pthread
  4366. add_extralibs -ldl -pthread
  4367. elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
  4368. add_extralibs -lpthreadGC2
  4369. elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
  4370. :
  4371. elif ! check_func pthread_join && ! check_func pthread_create; then
  4372. disable pthreads
  4373. fi
  4374. check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
  4375. fi
  4376. if enabled pthreads; then
  4377. check_func pthread_cancel
  4378. fi
  4379. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  4380. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  4381. disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
  4382. check_lib math.h sin -lm && LIBM="-lm"
  4383. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  4384. atan2f_args=2
  4385. ldexpf_args=2
  4386. powf_args=2
  4387. fminf_args=2
  4388. for func in $MATH_FUNCS; do
  4389. eval check_mathfunc $func \${${func}_args:-1}
  4390. done
  4391. # these are off by default, so fail if requested and not available
  4392. enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
  4393. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  4394. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  4395. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  4396. enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
  4397. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  4398. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  4399. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  4400. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  4401. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  4402. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  4403. enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
  4404. enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
  4405. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  4406. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  4407. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  4408. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  4409. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  4410. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  4411. flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
  4412. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  4413. enabled fontconfig && enable libfontconfig
  4414. enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  4415. enabled libfreetype && require_libfreetype
  4416. enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
  4417. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  4418. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  4419. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  4420. done || die "ERROR: libgsm not found"; }
  4421. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  4422. enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
  4423. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  4424. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  4425. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  4426. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  4427. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  4428. enabled libopenjpeg && { check_lib openjpeg.h opj_version -lopenmj2 -DOPJ_STATIC ||
  4429. check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4430. check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4431. die "ERROR: libopenjpeg not found"; }
  4432. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  4433. enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  4434. enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
  4435. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  4436. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  4437. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  4438. enabled libsmbclient && { { check_pkg_config smbclient libsmbclient.h smbc_init &&
  4439. require_pkg_config smbclient libsmbclient.h smbc_init; } ||
  4440. require smbclient libsmbclient.h smbc_init -lsmbclient; }
  4441. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  4442. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  4443. enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
  4444. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  4445. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  4446. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  4447. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  4448. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  4449. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  4450. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  4451. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  4452. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  4453. enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  4454. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  4455. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  4456. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  4457. enabled libvpx && {
  4458. enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  4459. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  4460. enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  4461. die "ERROR: libvpx encoder version must be >=0.9.7"; }
  4462. enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
  4463. enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
  4464. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  4465. enabled libwebp && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  4466. enabled libx264 && { { check_pkg_config x264 "stdint.h x264.h" x264_encoder_encode &&
  4467. require_pkg_config x264 "stdint.h x264.h" x264_encoder_encode; } ||
  4468. { require libx264 x264.h x264_encoder_encode -lx264 &&
  4469. warn "using libx264 without pkg-config"; } } &&
  4470. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  4471. die "ERROR: libx264 must be installed and version must be >= 0.118."; }
  4472. enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
  4473. { check_cpp_condition x265.h "X265_BUILD >= 17" ||
  4474. die "ERROR: libx265 version must be >= 17."; }
  4475. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  4476. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  4477. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  4478. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
  4479. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  4480. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  4481. die "ERROR: openal not found"; } &&
  4482. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  4483. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  4484. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  4485. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  4486. die "ERROR: opencl not found"; } &&
  4487. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  4488. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  4489. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  4490. enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
  4491. check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  4492. check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  4493. check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  4494. die "ERROR: opengl not found."
  4495. }
  4496. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  4497. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  4498. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  4499. die "ERROR: openssl not found"; }
  4500. enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
  4501. if enabled gnutls; then
  4502. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  4503. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  4504. fi
  4505. # libdc1394 check
  4506. if enabled libdc1394; then
  4507. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  4508. enable libdc1394_2; } ||
  4509. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  4510. enable libdc1394_1; } ||
  4511. die "ERROR: No version of libdc1394 found "
  4512. fi
  4513. if ! disabled sdl; then
  4514. SDL_CONFIG="${cross_prefix}sdl-config"
  4515. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  4516. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4517. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4518. enable sdl
  4519. else
  4520. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  4521. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  4522. sdl_libs=$("${SDL_CONFIG}" --libs)
  4523. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  4524. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4525. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4526. enable sdl
  4527. elif enabled sdl ; then
  4528. die "ERROR: SDL not found"
  4529. else
  4530. disable sdl
  4531. fi
  4532. fi
  4533. fi
  4534. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  4535. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  4536. enabled makeinfo && (makeinfo --version | \
  4537. grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
  4538. && enable makeinfo_html || disable makeinfo_html
  4539. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  4540. perl -v > /dev/null 2>&1 && enable perl || disable perl
  4541. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  4542. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  4543. check_header linux/fb.h
  4544. check_header linux/videodev.h
  4545. check_header linux/videodev2.h
  4546. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4547. check_header sys/videoio.h
  4548. check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4549. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  4550. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  4551. # w32api 3.12 had it defined wrong
  4552. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  4553. check_type "dshow.h" IBaseFilter
  4554. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  4555. { check_header dev/bktr/ioctl_meteor.h &&
  4556. check_header dev/bktr/ioctl_bt848.h; } ||
  4557. { check_header machine/ioctl_meteor.h &&
  4558. check_header machine/ioctl_bt848.h; } ||
  4559. { check_header dev/video/meteor/ioctl_meteor.h &&
  4560. check_header dev/video/bktr/ioctl_bt848.h; } ||
  4561. check_header dev/ic/bt8xx.h
  4562. check_header sndio.h
  4563. if check_struct sys/soundcard.h audio_buf_info bytes; then
  4564. enable_safe sys/soundcard.h
  4565. else
  4566. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  4567. #include <sys/soundcard.h>
  4568. audio_buf_info abc;
  4569. EOF
  4570. fi
  4571. check_header soundcard.h
  4572. enabled_any alsa_indev alsa_outdev &&
  4573. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  4574. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  4575. check_func jack_port_get_latency_range -ljack
  4576. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  4577. if enabled libcdio; then
  4578. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4579. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4580. die "ERROR: libcdio-paranoia not found"
  4581. fi
  4582. enabled xlib &&
  4583. check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
  4584. if enabled libxcb || enabled x11grab && ! disabled libxcb; then
  4585. check_pkg_config xcb-event xcb/xcb.h xcb_connect || {
  4586. enabled libxcb && die "ERROR: libxcb not found";
  4587. } && disable x11grab && enable libxcb
  4588. disabled libxcb_shm ||
  4589. check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
  4590. enabled libxcb_shm && die "ERROR: libxcb_shm not found";
  4591. } && check_header sys/shm.h && enable libxcb_shm
  4592. disabled libxcb_xfixes ||
  4593. check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
  4594. enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
  4595. } && enable libxcb_xfixes
  4596. add_cflags "$xcb_event_cflags $xcb_shm_cflags $xcb_xfixes_cflags"
  4597. add_extralibs "$xcb_event_libs $xcb_shm_libs $xcb_xfixes_libs"
  4598. fi
  4599. if enabled x11grab; then
  4600. enabled xlib || die "ERROR: Xlib not found"
  4601. require Xext X11/extensions/XShm.h XShmCreateImage -lXext
  4602. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  4603. fi
  4604. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  4605. enabled dxva2api_h &&
  4606. check_cc <<EOF && enable dxva2api_cobj
  4607. #define _WIN32_WINNT 0x0600
  4608. #define COBJMACROS
  4609. #include <windows.h>
  4610. #include <d3d9.h>
  4611. #include <dxva2api.h>
  4612. int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
  4613. EOF
  4614. enabled vaapi &&
  4615. check_lib va/va.h vaInitialize -lva ||
  4616. disable vaapi
  4617. enabled vdpau &&
  4618. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  4619. disable vdpau
  4620. enabled vdpau && enabled xlib &&
  4621. check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  4622. prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
  4623. enable vdpau_x11
  4624. # Funny iconv installations are not unusual, so check it after all flags have been set
  4625. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  4626. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  4627. # add some useful compiler flags if supported
  4628. check_cflags -Wdeclaration-after-statement
  4629. check_cflags -Wall
  4630. check_cflags -Wdisabled-optimization
  4631. check_cflags -Wpointer-arith
  4632. check_cflags -Wredundant-decls
  4633. check_cflags -Wwrite-strings
  4634. check_cflags -Wtype-limits
  4635. check_cflags -Wundef
  4636. check_cflags -Wmissing-prototypes
  4637. check_cflags -Wno-pointer-to-int-cast
  4638. check_cflags -Wstrict-prototypes
  4639. check_cflags -Wempty-body
  4640. enabled extra_warnings && check_cflags -Winline
  4641. check_disable_warning(){
  4642. warning_flag=-W${1#-Wno-}
  4643. test_cflags $warning_flag && add_cflags $1
  4644. }
  4645. check_disable_warning -Wno-parentheses
  4646. check_disable_warning -Wno-switch
  4647. check_disable_warning -Wno-format-zero-length
  4648. check_disable_warning -Wno-pointer-sign
  4649. # add some linker flags
  4650. check_ldflags -Wl,--warn-common
  4651. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  4652. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
  4653. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  4654. # add some strip flags
  4655. # -wN '..@*' is more selective than -x, but not available everywhere.
  4656. check_stripflags -wN \'..@*\' || check_stripflags -x
  4657. enabled neon_clobber_test &&
  4658. check_ldflags -Wl,--wrap,avcodec_open2 \
  4659. -Wl,--wrap,avcodec_decode_audio4 \
  4660. -Wl,--wrap,avcodec_decode_video2 \
  4661. -Wl,--wrap,avcodec_decode_subtitle2 \
  4662. -Wl,--wrap,avcodec_encode_audio2 \
  4663. -Wl,--wrap,avcodec_encode_video2 \
  4664. -Wl,--wrap,avcodec_encode_subtitle \
  4665. -Wl,--wrap,swr_convert \
  4666. -Wl,--wrap,avresample_convert ||
  4667. disable neon_clobber_test
  4668. enabled xmm_clobber_test &&
  4669. check_ldflags -Wl,--wrap,avcodec_open2 \
  4670. -Wl,--wrap,avcodec_decode_audio4 \
  4671. -Wl,--wrap,avcodec_decode_video2 \
  4672. -Wl,--wrap,avcodec_decode_subtitle2 \
  4673. -Wl,--wrap,avcodec_encode_audio2 \
  4674. -Wl,--wrap,avcodec_encode_video \
  4675. -Wl,--wrap,avcodec_encode_video2 \
  4676. -Wl,--wrap,avcodec_encode_subtitle \
  4677. -Wl,--wrap,swr_convert \
  4678. -Wl,--wrap,avresample_convert \
  4679. -Wl,--wrap,sws_scale ||
  4680. disable xmm_clobber_test
  4681. echo "X{};" > $TMPV
  4682. if test_ldflags -Wl,--version-script,$TMPV; then
  4683. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  4684. check_cc <<EOF && enable symver_asm_label
  4685. void ff_foo(void) __asm__ ("av_foo@VERSION");
  4686. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  4687. EOF
  4688. check_cc <<EOF && enable symver_gnu_asm
  4689. __asm__(".symver ff_foo,av_foo@VERSION");
  4690. void ff_foo(void) {}
  4691. EOF
  4692. fi
  4693. if [ -z "$optflags" ]; then
  4694. if enabled small; then
  4695. optflags=$cflags_size
  4696. elif enabled optimizations; then
  4697. optflags=$cflags_speed
  4698. else
  4699. optflags=$cflags_noopt
  4700. fi
  4701. fi
  4702. check_optflags(){
  4703. check_cflags "$@"
  4704. enabled lto && check_ldflags "$@"
  4705. }
  4706. if enabled lto; then
  4707. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  4708. check_cflags -flto
  4709. check_ldflags -flto $cpuflags
  4710. disable inline_asm_direct_symbol_refs
  4711. fi
  4712. check_optflags $optflags
  4713. check_optflags -fno-math-errno
  4714. check_optflags -fno-signed-zeros
  4715. enabled ftrapv && check_cflags -ftrapv
  4716. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  4717. int x;
  4718. EOF
  4719. if enabled icc; then
  4720. # Just warnings, no remarks
  4721. check_cflags -w1
  4722. # -wd: Disable following warnings
  4723. # 144, 167, 556: -Wno-pointer-sign
  4724. # 188: enumerated type mixed with another type
  4725. # 1292: attribute "foo" ignored
  4726. # 1419: external declaration in primary source file
  4727. # 10006: ignoring unknown option -fno-signed-zeros
  4728. # 10148: ignoring unknown option -Wno-parentheses
  4729. # 10156: ignoring option '-W'; no argument required
  4730. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156
  4731. # 11030: Warning unknown option --as-needed
  4732. # 10156: ignoring option '-export'; no argument required
  4733. check_ldflags -wd10156,11030
  4734. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  4735. enable ebp_available
  4736. # The test above does not test linking
  4737. enabled lto && disable symver_asm_label
  4738. if enabled x86_32; then
  4739. icc_version=$($cc -dumpversion)
  4740. test ${icc_version%%.*} -ge 11 &&
  4741. check_cflags -falign-stack=maintain-16-byte ||
  4742. disable aligned_stack
  4743. fi
  4744. elif enabled ccc; then
  4745. # disable some annoying warnings
  4746. add_cflags -msg_disable bitnotint
  4747. add_cflags -msg_disable mixfuncvoid
  4748. add_cflags -msg_disable nonstandcast
  4749. add_cflags -msg_disable unsupieee
  4750. elif enabled gcc; then
  4751. check_optflags -fno-tree-vectorize
  4752. check_cflags -Werror=format-security
  4753. check_cflags -Werror=implicit-function-declaration
  4754. check_cflags -Werror=missing-prototypes
  4755. check_cflags -Werror=return-type
  4756. check_cflags -Werror=vla
  4757. check_cflags -Wformat
  4758. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  4759. elif enabled llvm_gcc; then
  4760. check_cflags -mllvm -stack-alignment=16
  4761. elif enabled clang; then
  4762. check_cflags -mllvm -stack-alignment=16
  4763. check_cflags -Qunused-arguments
  4764. check_cflags -Werror=implicit-function-declaration
  4765. check_cflags -Werror=missing-prototypes
  4766. check_cflags -Werror=return-type
  4767. elif enabled cparser; then
  4768. add_cflags -Wno-missing-variable-declarations
  4769. add_cflags -Wno-empty-statement
  4770. elif enabled armcc; then
  4771. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  4772. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  4773. # 2523: use of inline assembly is deprecated
  4774. add_cflags -W${armcc_opt},--diag_suppress=2523
  4775. add_cflags -W${armcc_opt},--diag_suppress=1207
  4776. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  4777. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  4778. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  4779. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  4780. elif enabled tms470; then
  4781. add_cflags -pds=824 -pds=837
  4782. disable inline_asm
  4783. elif enabled pathscale; then
  4784. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  4785. elif enabled_any msvc icl; then
  4786. enabled x86_32 && disable aligned_stack
  4787. enabled_all x86_32 debug && add_cflags -Oy-
  4788. enabled debug && add_ldflags -debug
  4789. enable pragma_deprecated
  4790. if enabled icl; then
  4791. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  4792. # (correctly) on icl 13.x.
  4793. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  4794. add_cflags -Qansi-alias
  4795. # Some inline asm is not compilable in debug
  4796. if enabled debug; then
  4797. disable ebp_available
  4798. disable ebx_available
  4799. fi
  4800. fi
  4801. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 onwards actually has log2.
  4802. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  4803. fi
  4804. case $as_type in
  4805. clang)
  4806. add_asflags -Qunused-arguments
  4807. ;;
  4808. esac
  4809. case $ld_type in
  4810. clang)
  4811. check_ldflags -Qunused-arguments
  4812. ;;
  4813. esac
  4814. case $target_os in
  4815. osf1)
  4816. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  4817. ;;
  4818. plan9)
  4819. add_cppflags -Dmain=plan9_main
  4820. ;;
  4821. esac
  4822. enable frame_thread_encoder
  4823. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  4824. check_deps $CONFIG_LIST \
  4825. $CONFIG_EXTRA \
  4826. $HAVE_LIST \
  4827. $ALL_COMPONENTS \
  4828. enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86"
  4829. if test $target_os = "haiku"; then
  4830. disable memalign
  4831. disable posix_memalign
  4832. fi
  4833. enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
  4834. prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
  4835. enable dxva2_lib
  4836. ! enabled_any memalign posix_memalign aligned_malloc &&
  4837. enabled simd_align_16 && enable memalign_hack
  4838. # add_dep lib dep
  4839. # -> enable ${lib}_deps_${dep}
  4840. # -> add $dep to ${lib}_deps only once
  4841. add_dep() {
  4842. lib=$1
  4843. dep=$2
  4844. enabled "${lib}_deps_${dep}" && return 0
  4845. enable "${lib}_deps_${dep}"
  4846. prepend "${lib}_deps" $dep
  4847. }
  4848. # merge deps lib components
  4849. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  4850. merge_deps() {
  4851. lib=$1
  4852. shift
  4853. for comp in $*; do
  4854. enabled $comp || continue
  4855. eval "dep=\"\$${comp}_deps\""
  4856. for d in $dep; do
  4857. add_dep $lib $d
  4858. done
  4859. done
  4860. }
  4861. merge_deps libavfilter $FILTER_LIST
  4862. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  4863. for thread in $THREADS_LIST; do
  4864. if enabled $thread; then
  4865. test -n "$thread_type" &&
  4866. die "ERROR: Only one thread type must be selected." ||
  4867. thread_type="$thread"
  4868. fi
  4869. done
  4870. enabled zlib && add_cppflags -DZLIB_CONST
  4871. # conditional library dependencies, in linking order
  4872. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  4873. enabled aresample_filter && prepend avfilter_deps "swresample"
  4874. enabled asyncts_filter && prepend avfilter_deps "avresample"
  4875. enabled atempo_filter && prepend avfilter_deps "avcodec"
  4876. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  4877. enabled elbg_filter && prepend avfilter_deps "avcodec"
  4878. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  4879. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  4880. enabled mp_filter && prepend avfilter_deps "avcodec"
  4881. enabled pan_filter && prepend avfilter_deps "swresample"
  4882. enabled pp_filter && prepend avfilter_deps "postproc"
  4883. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  4884. enabled resample_filter && prepend avfilter_deps "avresample"
  4885. enabled sab_filter && prepend avfilter_deps "swscale"
  4886. enabled scale_filter && prepend avfilter_deps "swscale"
  4887. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  4888. enabled smartblur_filter && prepend avfilter_deps "swscale"
  4889. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  4890. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  4891. enabled opus_decoder && prepend avcodec_deps "swresample"
  4892. expand_deps(){
  4893. lib_deps=${1}_deps
  4894. eval "deps=\$$lib_deps"
  4895. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  4896. unique $lib_deps
  4897. }
  4898. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  4899. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  4900. map 'expand_deps $v' $LIBRARY_LIST
  4901. echo "install prefix $prefix"
  4902. echo "source path $source_path"
  4903. echo "C compiler $cc"
  4904. echo "C library $libc_type"
  4905. if test "$host_cc" != "$cc"; then
  4906. echo "host C compiler $host_cc"
  4907. echo "host C library $host_libc_type"
  4908. fi
  4909. echo "ARCH $arch ($cpu)"
  4910. if test "$build_suffix" != ""; then
  4911. echo "build suffix $build_suffix"
  4912. fi
  4913. if test "$progs_suffix" != ""; then
  4914. echo "progs suffix $progs_suffix"
  4915. fi
  4916. if test "$extra_version" != ""; then
  4917. echo "version string suffix $extra_version"
  4918. fi
  4919. echo "big-endian ${bigendian-no}"
  4920. echo "runtime cpu detection ${runtime_cpudetect-no}"
  4921. if enabled x86; then
  4922. echo "${yasmexe} ${yasm-no}"
  4923. echo "MMX enabled ${mmx-no}"
  4924. echo "MMXEXT enabled ${mmxext-no}"
  4925. echo "3DNow! enabled ${amd3dnow-no}"
  4926. echo "3DNow! extended enabled ${amd3dnowext-no}"
  4927. echo "SSE enabled ${sse-no}"
  4928. echo "SSSE3 enabled ${ssse3-no}"
  4929. echo "AVX enabled ${avx-no}"
  4930. echo "XOP enabled ${xop-no}"
  4931. echo "FMA3 enabled ${fma3-no}"
  4932. echo "FMA4 enabled ${fma4-no}"
  4933. echo "i686 features enabled ${i686-no}"
  4934. echo "CMOV is fast ${fast_cmov-no}"
  4935. echo "EBX available ${ebx_available-no}"
  4936. echo "EBP available ${ebp_available-no}"
  4937. fi
  4938. if enabled aarch64; then
  4939. echo "NEON enabled ${neon-no}"
  4940. echo "VFP enabled ${vfp-no}"
  4941. fi
  4942. if enabled arm; then
  4943. echo "ARMv5TE enabled ${armv5te-no}"
  4944. echo "ARMv6 enabled ${armv6-no}"
  4945. echo "ARMv6T2 enabled ${armv6t2-no}"
  4946. echo "VFP enabled ${vfp-no}"
  4947. echo "NEON enabled ${neon-no}"
  4948. echo "THUMB enabled ${thumb-no}"
  4949. fi
  4950. if enabled mips; then
  4951. echo "MIPS FPU enabled ${mipsfpu-no}"
  4952. echo "MIPS32R2 enabled ${mips32r2-no}"
  4953. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  4954. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  4955. fi
  4956. if enabled ppc; then
  4957. echo "AltiVec enabled ${altivec-no}"
  4958. echo "PPC 4xx optimizations ${ppc4xx-no}"
  4959. echo "PPC VSX optimizations ${vsx-no}"
  4960. echo "dcbzl available ${dcbzl-no}"
  4961. fi
  4962. echo "debug symbols ${debug-no}"
  4963. echo "strip symbols ${stripping-no}"
  4964. echo "optimize for size ${small-no}"
  4965. echo "optimizations ${optimizations-no}"
  4966. echo "static ${static-no}"
  4967. echo "shared ${shared-no}"
  4968. echo "postprocessing support ${postproc-no}"
  4969. echo "new filter support ${avfilter-no}"
  4970. echo "network support ${network-no}"
  4971. echo "threading support ${thread_type-no}"
  4972. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  4973. echo "SDL support ${sdl-no}"
  4974. echo "opencl enabled ${opencl-no}"
  4975. echo "texi2html enabled ${texi2html-no}"
  4976. echo "perl enabled ${perl-no}"
  4977. echo "pod2man enabled ${pod2man-no}"
  4978. echo "makeinfo enabled ${makeinfo-no}"
  4979. echo "makeinfo supports HTML ${makeinfo_html-no}"
  4980. test -n "$random_seed" &&
  4981. echo "random seed ${random_seed}"
  4982. echo
  4983. echo "External libraries:"
  4984. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  4985. echo
  4986. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  4987. echo "Enabled ${type}s:"
  4988. eval list=\$$(toupper $type)_LIST
  4989. print_enabled '_*' $list | print_3_columns
  4990. echo
  4991. done
  4992. license="LGPL version 2.1 or later"
  4993. if enabled nonfree; then
  4994. license="nonfree and unredistributable"
  4995. elif enabled gplv3; then
  4996. license="GPL version 3 or later"
  4997. elif enabled lgplv3; then
  4998. license="LGPL version 3 or later"
  4999. elif enabled gpl; then
  5000. license="GPL version 2 or later"
  5001. fi
  5002. echo "License: $license"
  5003. echo "Creating config.mak, config.h, and doc/config.texi..."
  5004. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  5005. enabled stripping || strip="echo skipping strip"
  5006. config_files="$TMPH config.mak doc/config.texi"
  5007. cat > config.mak <<EOF
  5008. # Automatically generated by configure - do not modify!
  5009. ifndef FFMPEG_CONFIG_MAK
  5010. FFMPEG_CONFIG_MAK=1
  5011. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  5012. prefix=$prefix
  5013. LIBDIR=\$(DESTDIR)$libdir
  5014. SHLIBDIR=\$(DESTDIR)$shlibdir
  5015. INCDIR=\$(DESTDIR)$incdir
  5016. BINDIR=\$(DESTDIR)$bindir
  5017. DATADIR=\$(DESTDIR)$datadir
  5018. DOCDIR=\$(DESTDIR)$docdir
  5019. MANDIR=\$(DESTDIR)$mandir
  5020. SRC_PATH=$source_path
  5021. ifndef MAIN_MAKEFILE
  5022. SRC_PATH:=\$(SRC_PATH:.%=..%)
  5023. endif
  5024. CC_IDENT=$cc_ident
  5025. ARCH=$arch
  5026. INTRINSICS=$intrinsics
  5027. CC=$cc
  5028. CXX=$cxx
  5029. AS=$as
  5030. LD=$ld
  5031. DEPCC=$dep_cc
  5032. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  5033. DEPAS=$as
  5034. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  5035. YASM=$yasmexe
  5036. DEPYASM=$yasmexe
  5037. AR=$ar
  5038. ARFLAGS=$arflags
  5039. AR_O=$ar_o
  5040. RANLIB=$ranlib
  5041. STRIP=$strip
  5042. CP=cp -p
  5043. LN_S=$ln_s
  5044. CPPFLAGS=$CPPFLAGS
  5045. CFLAGS=$CFLAGS
  5046. CXXFLAGS=$CXXFLAGS
  5047. ASFLAGS=$ASFLAGS
  5048. AS_C=$AS_C
  5049. AS_O=$AS_O
  5050. CC_C=$CC_C
  5051. CC_E=$CC_E
  5052. CC_O=$CC_O
  5053. CXX_C=$CXX_C
  5054. CXX_O=$CXX_O
  5055. LD_O=$LD_O
  5056. LD_LIB=$LD_LIB
  5057. LD_PATH=$LD_PATH
  5058. DLLTOOL=$dlltool
  5059. WINDRES=$windres
  5060. DEPWINDRES=$dep_cc
  5061. DOXYGEN=$doxygen
  5062. LDFLAGS=$LDFLAGS
  5063. LDEXEFLAGS=$LDEXEFLAGS
  5064. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  5065. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  5066. YASMFLAGS=$YASMFLAGS
  5067. BUILDSUF=$build_suffix
  5068. PROGSSUF=$progs_suffix
  5069. FULLNAME=$FULLNAME
  5070. LIBPREF=$LIBPREF
  5071. LIBSUF=$LIBSUF
  5072. LIBNAME=$LIBNAME
  5073. SLIBPREF=$SLIBPREF
  5074. SLIBSUF=$SLIBSUF
  5075. EXESUF=$EXESUF
  5076. EXTRA_VERSION=$extra_version
  5077. CCDEP=$CCDEP
  5078. CXXDEP=$CXXDEP
  5079. CCDEP_FLAGS=$CCDEP_FLAGS
  5080. ASDEP=$ASDEP
  5081. ASDEP_FLAGS=$ASDEP_FLAGS
  5082. CC_DEPFLAGS=$CC_DEPFLAGS
  5083. AS_DEPFLAGS=$AS_DEPFLAGS
  5084. HOSTCC=$host_cc
  5085. HOSTLD=$host_ld
  5086. HOSTCFLAGS=$host_cflags
  5087. HOSTCPPFLAGS=$host_cppflags
  5088. HOSTEXESUF=$HOSTEXESUF
  5089. HOSTLDFLAGS=$host_ldflags
  5090. HOSTLIBS=$host_libs
  5091. DEPHOSTCC=$host_cc
  5092. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  5093. HOSTCCDEP=$HOSTCCDEP
  5094. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  5095. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  5096. HOSTCC_C=$HOSTCC_C
  5097. HOSTCC_O=$HOSTCC_O
  5098. HOSTLD_O=$HOSTLD_O
  5099. TARGET_EXEC=$target_exec $target_exec_args
  5100. TARGET_PATH=$target_path
  5101. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  5102. CFLAGS-ffplay=$sdl_cflags
  5103. ZLIB=$($ldflags_filter -lz)
  5104. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  5105. EXTRALIBS=$extralibs
  5106. COMPAT_OBJS=$compat_objs
  5107. EXEOBJS=$exeobjs
  5108. INSTALL=$install
  5109. LIBTARGET=${LIBTARGET}
  5110. SLIBNAME=${SLIBNAME}
  5111. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  5112. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  5113. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  5114. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  5115. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  5116. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  5117. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  5118. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  5119. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  5120. NOREDZONE_FLAGS=$noredzone_flags
  5121. EOF
  5122. get_version(){
  5123. lcname=lib${1}
  5124. name=$(toupper $lcname)
  5125. file=$source_path/$lcname/version.h
  5126. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  5127. enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
  5128. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  5129. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  5130. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  5131. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  5132. }
  5133. map 'get_version $v' $LIBRARY_LIST
  5134. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
  5135. print_program_libs(){
  5136. eval "program_libs=\$${1}_libs"
  5137. eval echo "LIBS-${1}=${program_libs}" >> config.mak
  5138. }
  5139. map 'print_program_libs $v' $PROGRAM_LIST
  5140. cat > $TMPH <<EOF
  5141. /* Automatically generated by configure - do not modify! */
  5142. #ifndef FFMPEG_CONFIG_H
  5143. #define FFMPEG_CONFIG_H
  5144. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  5145. #define FFMPEG_LICENSE "$(c_escape $license)"
  5146. #define CONFIG_THIS_YEAR 2014
  5147. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  5148. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  5149. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  5150. #define av_restrict $_restrict
  5151. #define EXTERN_PREFIX "${extern_prefix}"
  5152. #define EXTERN_ASM ${extern_prefix}
  5153. #define BUILDSUF "$build_suffix"
  5154. #define SLIBSUF "$SLIBSUF"
  5155. #define HAVE_MMX2 HAVE_MMXEXT
  5156. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  5157. EOF
  5158. test -n "$assert_level" &&
  5159. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  5160. test -n "$malloc_prefix" &&
  5161. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  5162. if enabled yasm; then
  5163. append config_files $TMPASM
  5164. printf '' >$TMPASM
  5165. fi
  5166. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  5167. mkdir -p doc
  5168. echo "@c auto-generated by configure" > doc/config.texi
  5169. print_config ARCH_ "$config_files" $ARCH_LIST
  5170. print_config HAVE_ "$config_files" $HAVE_LIST
  5171. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  5172. $CONFIG_EXTRA \
  5173. $ALL_COMPONENTS \
  5174. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  5175. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  5176. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  5177. cp_if_changed $TMPH config.h
  5178. touch .config
  5179. enabled yasm && cp_if_changed $TMPASM config.asm
  5180. cat > $TMPH <<EOF
  5181. /* Generated by ffconf */
  5182. #ifndef AVUTIL_AVCONFIG_H
  5183. #define AVUTIL_AVCONFIG_H
  5184. EOF
  5185. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  5186. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  5187. cp_if_changed $TMPH libavutil/avconfig.h
  5188. if test -n "$WARNINGS"; then
  5189. printf "\n$WARNINGS"
  5190. enabled fatal_warnings && exit 1
  5191. fi
  5192. # build pkg-config files
  5193. lib_version(){
  5194. eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
  5195. }
  5196. pkgconfig_generate(){
  5197. name=$1
  5198. shortname=${name#lib}${build_suffix}
  5199. comment=$2
  5200. version=$3
  5201. libs=$4
  5202. requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
  5203. requires=${requires%, }
  5204. enabled ${name#lib} || return 0
  5205. mkdir -p $name
  5206. cat <<EOF > $name/$name${build_suffix}.pc
  5207. prefix=$prefix
  5208. exec_prefix=\${prefix}
  5209. libdir=$libdir
  5210. includedir=$incdir
  5211. Name: $name
  5212. Description: $comment
  5213. Version: $version
  5214. Requires: $(enabled shared || echo $requires)
  5215. Requires.private: $(enabled shared && echo $requires)
  5216. Conflicts:
  5217. Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
  5218. Libs.private: $(enabled shared && echo $libs)
  5219. Cflags: -I\${includedir}
  5220. EOF
  5221. mkdir -p doc/examples/pc-uninstalled
  5222. includedir=${source_path}
  5223. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  5224. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  5225. prefix=
  5226. exec_prefix=
  5227. libdir=\${pcfiledir}/../../../$name
  5228. includedir=${includedir}
  5229. Name: $name
  5230. Description: $comment
  5231. Version: $version
  5232. Requires: $requires
  5233. Conflicts:
  5234. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  5235. Cflags: -I\${includedir}
  5236. EOF
  5237. }
  5238. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
  5239. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
  5240. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
  5241. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
  5242. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
  5243. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
  5244. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
  5245. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
  5246. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"