configure 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800
  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. show_help(){
  51. echo "Usage: configure [options]"
  52. echo "Options: [defaults in brackets after descriptions]"
  53. echo
  54. echo "Standard options:"
  55. echo " --help print this message"
  56. echo " --logfile=FILE log tests and output to FILE [config.err]"
  57. echo " --disable-logging do not log configure debug information"
  58. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  59. echo " --bindir=DIR install binaries in DIR [PREFIX/bin]"
  60. echo " --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]"
  61. echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
  62. echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
  63. echo " --incdir=DIR install includes in DIR [PREFIX/include]"
  64. echo " --mandir=DIR install man page in DIR [PREFIX/share/man]"
  65. echo
  66. echo "Configuration options:"
  67. echo " --disable-static do not build static libraries [no]"
  68. echo " --enable-shared build shared libraries [no]"
  69. echo " --enable-gpl allow use of GPL code, the resulting libs"
  70. echo " and binaries will be under GPL [no]"
  71. echo " --enable-version3 upgrade (L)GPL to version 3 [no]"
  72. echo " --enable-nonfree allow use of nonfree code, the resulting libs"
  73. echo " and binaries will be unredistributable [no]"
  74. echo " --disable-ffmpeg disable ffmpeg build"
  75. echo " --disable-ffplay disable ffplay build"
  76. echo " --disable-ffserver disable ffserver build"
  77. echo " --enable-postproc enable GPLed postprocessing support [no]"
  78. echo " --enable-avfilter video filter support [no]"
  79. echo " --enable-avfilter-lavf video filters dependent on avformat [no]"
  80. echo " --enable-beosthreads use BeOS threads [no]"
  81. echo " --enable-os2threads use OS/2 threads [no]"
  82. echo " --enable-pthreads use pthreads [no]"
  83. echo " --enable-w32threads use Win32 threads [no]"
  84. echo " --enable-x11grab enable X11 grabbing [no]"
  85. echo " --disable-network disable network support [no]"
  86. echo " --disable-ipv6 disable IPv6 support [no]"
  87. echo " --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]"
  88. echo " --enable-gray enable full grayscale support (slower color)"
  89. echo " --disable-swscale-alpha disable alpha channel support in swscale"
  90. echo " --disable-fastdiv disable table-based division"
  91. echo " --enable-small optimize for size instead of speed"
  92. echo " --disable-aandct disable AAN DCT code"
  93. echo " --disable-fft disable FFT code"
  94. echo " --disable-golomb disable Golomb code"
  95. echo " --disable-mdct disable MDCT code"
  96. echo " --disable-rdft disable RDFT code"
  97. echo " --disable-vaapi disable VAAPI code"
  98. echo " --disable-vdpau disable VDPAU code"
  99. echo " --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)"
  100. echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation"
  101. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  102. echo " --enable-beos-netserver enable BeOS netserver"
  103. echo " --disable-encoder=NAME disable encoder NAME"
  104. echo " --enable-encoder=NAME enable encoder NAME"
  105. echo " --disable-encoders disable all encoders"
  106. echo " --disable-decoder=NAME disable decoder NAME"
  107. echo " --enable-decoder=NAME enable decoder NAME"
  108. echo " --disable-decoders disable all decoders"
  109. echo " --disable-hwaccel=NAME disable hwaccel NAME"
  110. echo " --enable-hwaccel=NAME enable hwaccel NAME"
  111. echo " --disable-hwaccels disable all hwaccels"
  112. echo " --disable-muxer=NAME disable muxer NAME"
  113. echo " --enable-muxer=NAME enable muxer NAME"
  114. echo " --disable-muxers disable all muxers"
  115. echo " --disable-demuxer=NAME disable demuxer NAME"
  116. echo " --enable-demuxer=NAME enable demuxer NAME"
  117. echo " --disable-demuxers disable all demuxers"
  118. echo " --enable-parser=NAME enable parser NAME"
  119. echo " --disable-parser=NAME disable parser NAME"
  120. echo " --disable-parsers disable all parsers"
  121. echo " --enable-bsf=NAME enable bitstream filter NAME"
  122. echo " --disable-bsf=NAME disable bitstream filter NAME"
  123. echo " --disable-bsfs disable all bitstream filters"
  124. echo " --enable-protocol=NAME enable protocol NAME"
  125. echo " --disable-protocol=NAME disable protocol NAME"
  126. echo " --disable-protocols disable all protocols"
  127. echo " --disable-indev=NAME disable input device NAME"
  128. echo " --disable-outdev=NAME disable output device NAME"
  129. echo " --disable-indevs disable input devices"
  130. echo " --disable-outdevs disable output devices"
  131. echo " --disable-devices disable all devices"
  132. echo " --enable-filter=NAME enable filter NAME"
  133. echo " --disable-filter=NAME disable filter NAME"
  134. echo " --disable-filters disable all filters"
  135. echo " --list-decoders show all available decoders"
  136. echo " --list-encoders show all available encoders"
  137. echo " --list-hwaccels show all available hardware accelerators"
  138. echo " --list-muxers show all available muxers"
  139. echo " --list-demuxers show all available demuxers"
  140. echo " --list-parsers show all available parsers"
  141. echo " --list-protocols show all available protocols"
  142. echo " --list-bsfs show all available bitstream filters"
  143. echo " --list-indevs show all available input devices"
  144. echo " --list-outdevs show all available output devices"
  145. echo " --list-filters show all available filters"
  146. echo
  147. echo "External library support:"
  148. echo " --enable-avisynth enable reading of AVISynth script files [no]"
  149. echo " --enable-bzlib enable bzlib [autodetect]"
  150. echo " --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]"
  151. echo " --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]"
  152. echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394"
  153. echo " and libraw1394 [no]"
  154. echo " --enable-libdirac enable Dirac support via libdirac [no]"
  155. echo " --enable-libfaac enable FAAC support via libfaac [no]"
  156. echo " --enable-libfaad enable FAAD support via libfaad [no]"
  157. echo " --enable-libfaadbin open libfaad.so.0 at runtime [no]"
  158. echo " --enable-libgsm enable GSM support via libgsm [no]"
  159. echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [no]"
  160. echo " --enable-libnut enable NUT (de)muxing via libnut,"
  161. echo " native (de)muxer exists [no]"
  162. echo " --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]"
  163. echo " --enable-libschroedinger enable Dirac support via libschroedinger [no]"
  164. echo " --enable-libspeex enable Speex decoding via libspeex [no]"
  165. echo " --enable-libtheora enable Theora encoding via libtheora [no]"
  166. echo " --enable-libvorbis enable Vorbis encoding via libvorbis,"
  167. echo " native implementation exists [no]"
  168. echo " --enable-libx264 enable H.264 encoding via x264 [no]"
  169. echo " --enable-libxvid enable Xvid encoding via xvidcore,"
  170. echo " native MPEG-4/Xvid encoder exists [no]"
  171. echo " --enable-mlib enable Sun medialib [no]"
  172. echo " --enable-zlib enable zlib [autodetect]"
  173. echo ""
  174. echo "Advanced options (experts only):"
  175. echo " --source-path=PATH path to source code [$source_path]"
  176. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  177. echo " --enable-cross-compile assume a cross-compiler is used"
  178. echo " --sysroot=PATH root of cross-build tree"
  179. echo " --sysinclude=PATH location of cross-build system headers"
  180. echo " --target-os=OS compiler targets OS [$target_os]"
  181. echo " --target-exec=CMD command to run executables on target"
  182. echo " --target-path=DIR path to view of build directory on target"
  183. echo " --nm=NM use nm tool"
  184. echo " --as=AS use assembler AS [$as_default]"
  185. echo " --cc=CC use C compiler CC [$cc_default]"
  186. echo " --ld=LD use linker LD"
  187. echo " --host-cc=HOSTCC use host C compiler HOSTCC"
  188. echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host"
  189. echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host"
  190. echo " --host-libs=HLIBS use libs HLIBS when linking for host"
  191. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  192. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  193. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  194. echo " --extra-version=STRING version string suffix []"
  195. echo " --build-suffix=SUFFIX library name suffix []"
  196. echo " --arch=ARCH select architecture [$arch]"
  197. echo " --cpu=CPU select the minimum required CPU (affects"
  198. echo " instruction selection, may crash on older CPUs)"
  199. echo " --enable-powerpc-perf enable performance report on PPC"
  200. echo " (requires enabling PMC)"
  201. echo " --disable-altivec disable AltiVec optimizations"
  202. echo " --disable-amd3dnow disable 3DNow! optimizations"
  203. echo " --disable-amd3dnowext disable 3DNow! extended optimizations"
  204. echo " --disable-mmx disable MMX optimizations"
  205. echo " --disable-mmx2 disable MMX2 optimizations"
  206. echo " --disable-sse disable SSE optimizations"
  207. echo " --disable-ssse3 disable SSSE3 optimizations"
  208. echo " --disable-armv5te disable armv5te optimizations"
  209. echo " --disable-armv6 disable armv6 optimizations"
  210. echo " --disable-armv6t2 disable armv6t2 optimizations"
  211. echo " --disable-armvfp disable ARM VFP optimizations"
  212. echo " --disable-iwmmxt disable iwmmxt optimizations"
  213. echo " --disable-mmi disable MMI optimizations"
  214. echo " --disable-neon disable neon optimizations"
  215. echo " --disable-vis disable VIS optimizations"
  216. echo " --disable-yasm disable use of yasm assembler"
  217. echo
  218. echo "Developer options (useful when working on FFmpeg itself):"
  219. echo " --disable-debug disable debugging symbols"
  220. echo " --enable-debug=LEVEL set the debug level [$debuglevel]"
  221. echo " --enable-gprof enable profiling with gprof [$gprof]"
  222. echo " --disable-optimizations disable compiler optimizations"
  223. echo " --enable-extra-warnings enable more compiler warnings"
  224. echo " --disable-stripping disable stripping of executables and shared libraries"
  225. echo ""
  226. echo "NOTE: Object files are built at the place where configure is launched."
  227. exit 0
  228. }
  229. log(){
  230. echo "$@" >> $logfile
  231. }
  232. log_file(){
  233. log BEGIN $1
  234. pr -n -t $1 >> $logfile
  235. log END $1
  236. }
  237. echolog(){
  238. log "$@"
  239. echo "$@"
  240. }
  241. die(){
  242. echolog "$@"
  243. cat <<EOF
  244. If you think configure made a mistake, make sure you are using the latest
  245. version from SVN. If the latest version fails, report the problem to the
  246. ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
  247. EOF
  248. if disabled logging; then
  249. cat <<EOF
  250. Rerun configure with logging enabled (do not use --disable-logging), and
  251. include the log this produces with your report.
  252. EOF
  253. else
  254. cat <<EOF
  255. Include the log file "$logfile" produced by configure as this will help
  256. solving the problem.
  257. EOF
  258. fi
  259. exit 1
  260. }
  261. # Avoid locale weirdness, besides we really just want to translate ASCII.
  262. toupper(){
  263. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  264. }
  265. tolower(){
  266. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  267. }
  268. c_escape(){
  269. echo "$*" | sed 's/["\\]/\\\0/g'
  270. }
  271. sh_quote(){
  272. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  273. test "$v" = "${v#*[ |&;<>()$\`\\\"\'*?\[\]#~=%]}" || v="'$v'"
  274. echo "$v"
  275. }
  276. filter(){
  277. pat=$1
  278. shift
  279. for v; do
  280. case "$v" in $pat) echo "$v" ;; esac
  281. done
  282. }
  283. set_all(){
  284. value=$1
  285. shift
  286. for var in $*; do
  287. eval $var=$value
  288. done
  289. }
  290. set_weak(){
  291. value=$1
  292. shift
  293. for var; do
  294. eval : \${$var:=$value}
  295. done
  296. }
  297. pushvar(){
  298. for var in $*; do
  299. eval level=\${${var}_level:=0}
  300. eval ${var}_${level}="\$$var"
  301. eval ${var}_level=$(($level+1))
  302. done
  303. }
  304. popvar(){
  305. for var in $*; do
  306. eval level=\${${var}_level:-0}
  307. test $level = 0 && continue
  308. eval level=$(($level-1))
  309. eval $var="\${${var}_${level}}"
  310. eval ${var}_level=$level
  311. eval unset ${var}_${level}
  312. done
  313. }
  314. enable(){
  315. set_all yes $*
  316. }
  317. disable(){
  318. set_all no $*
  319. }
  320. enable_weak(){
  321. set_weak yes $*
  322. }
  323. disable_weak(){
  324. set_weak no $*
  325. }
  326. enable_safe(){
  327. enable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
  328. }
  329. disable_safe(){
  330. disable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
  331. }
  332. do_enable_deep(){
  333. for var; do
  334. enabled $var && continue
  335. eval sel="\$${var}_select"
  336. eval sgs="\$${var}_suggest"
  337. pushvar var sgs
  338. enable_deep $sel
  339. popvar sgs
  340. enable_deep_weak $sgs
  341. popvar var
  342. done
  343. }
  344. enable_deep(){
  345. do_enable_deep $*
  346. enable $*
  347. }
  348. enable_deep_weak(){
  349. do_enable_deep $*
  350. enable_weak $*
  351. }
  352. enabled(){
  353. test "${1#!}" = "$1" && op== || op=!=
  354. eval test "x\$${1#!}" $op "xyes"
  355. }
  356. disabled(){
  357. test "${1#!}" = "$1" && op== || op=!=
  358. eval test "x\$${1#!}" $op "xno"
  359. }
  360. enabled_all(){
  361. for opt; do
  362. enabled $opt || return 1
  363. done
  364. }
  365. disabled_all(){
  366. for opt; do
  367. disabled $opt || return 1
  368. done
  369. }
  370. enabled_any(){
  371. for opt; do
  372. enabled $opt && return 0
  373. done
  374. }
  375. disabled_any(){
  376. for opt; do
  377. disabled $opt && return 0
  378. done
  379. return 1
  380. }
  381. set_default(){
  382. for opt; do
  383. eval : \${$opt:=\$${opt}_default}
  384. done
  385. }
  386. is_in(){
  387. value=$1
  388. shift
  389. for var in $*; do
  390. [ $var = $value ] && return 0
  391. done
  392. return 1
  393. }
  394. check_deps(){
  395. for cfg; do
  396. cfg="${cfg#!}"
  397. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  398. disabled ${cfg}_checking && continue
  399. enable ${cfg}_checking
  400. eval dep_all="\$${cfg}_deps"
  401. eval dep_any="\$${cfg}_deps_any"
  402. eval dep_sel="\$${cfg}_select"
  403. eval dep_sgs="\$${cfg}_suggest"
  404. pushvar cfg dep_all dep_any dep_sel dep_sgs
  405. check_deps $dep_all $dep_any $dep_sel $dep_sgs
  406. popvar cfg dep_all dep_any dep_sel dep_sgs
  407. enabled_all $dep_all || disable $cfg
  408. enabled_any $dep_any || disable $cfg
  409. disabled_any $dep_sel && disable $cfg
  410. if enabled $cfg; then
  411. eval dep_extralibs="\$${cfg}_extralibs"
  412. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  413. enable_deep $dep_sel
  414. enable_deep_weak $dep_sgs
  415. fi
  416. disable ${cfg}_checking
  417. done
  418. }
  419. print_config(){
  420. pfx=$1
  421. header=$2
  422. makefile=$3
  423. shift 3
  424. for cfg; do
  425. ucname="$(toupper $cfg)"
  426. if enabled $cfg; then
  427. echo "#define ${pfx}${ucname} 1" >> $header
  428. echo "${pfx}${ucname}=yes" >> $makefile
  429. else
  430. echo "#define ${pfx}${ucname} 0" >> $header
  431. fi
  432. done
  433. }
  434. flags_saved(){
  435. (: ${SAVE_CFLAGS?}) 2> /dev/null
  436. }
  437. save_flags(){
  438. flags_saved && return
  439. SAVE_CFLAGS="$CFLAGS"
  440. SAVE_LDFLAGS="$LDFLAGS"
  441. SAVE_extralibs="$extralibs"
  442. }
  443. restore_flags(){
  444. flags_saved || return
  445. CFLAGS="$SAVE_CFLAGS"
  446. LDFLAGS="$SAVE_LDFLAGS"
  447. extralibs="$SAVE_extralibs"
  448. unset SAVE_CFLAGS
  449. unset SAVE_LDFLAGS
  450. unset SAVE_extralibs
  451. }
  452. temp_cflags(){
  453. save_flags
  454. CFLAGS="$CFLAGS $*"
  455. }
  456. temp_ldflags(){
  457. save_flags
  458. LDFLAGS="$LDFLAGS $*"
  459. }
  460. temp_extralibs(){
  461. save_flags
  462. extralibs="$extralibs $*"
  463. }
  464. append(){
  465. var=$1
  466. shift
  467. flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
  468. eval "$var=\"\$$var $*\""
  469. }
  470. add_cppflags(){
  471. append CPPFLAGS $($filter_cppflags "$@")
  472. }
  473. add_cflags(){
  474. append CFLAGS $($filter_cflags "$@")
  475. }
  476. add_asflags(){
  477. append ASFLAGS $($filter_asflags "$@")
  478. }
  479. add_ldflags(){
  480. append LDFLAGS "$@"
  481. }
  482. add_extralibs(){
  483. append extralibs "$@"
  484. }
  485. check_cmd(){
  486. log "$@"
  487. "$@" >> $logfile 2>&1
  488. }
  489. check_cc(){
  490. log check_cc "$@"
  491. cat > $TMPC
  492. log_file $TMPC
  493. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
  494. }
  495. check_cpp(){
  496. log check_cpp "$@"
  497. cat > $TMPC
  498. log_file $TMPC
  499. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
  500. }
  501. check_as(){
  502. log check_as "$@"
  503. cat > $TMPC
  504. log_file $TMPC
  505. check_cmd $as $CPPFLAGS $ASFLAGS "$@" -c -o $TMPO $TMPC
  506. }
  507. check_asm(){
  508. log check_asm "$@"
  509. name="$1"
  510. asm="$2"
  511. shift 2
  512. check_as "$@" <<EOF && enable $name || disable $name
  513. void foo(void){ __asm__ volatile($asm); }
  514. EOF
  515. }
  516. check_yasm(){
  517. log check_yasm "$@"
  518. echo "$1" > $TMPS
  519. log_file $TMPS
  520. shift 1
  521. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  522. }
  523. check_ld(){
  524. log check_ld "$@"
  525. check_cc || return
  526. flags=''
  527. libs=''
  528. for f; do
  529. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  530. done
  531. check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
  532. }
  533. check_cppflags(){
  534. log check_cppflags "$@"
  535. set -- $($filter_cppflags "$@")
  536. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  537. int x;
  538. EOF
  539. }
  540. check_cflags(){
  541. log check_cflags "$@"
  542. set -- $($filter_cflags "$@")
  543. check_cc "$@" <<EOF && append CFLAGS "$@"
  544. int x;
  545. EOF
  546. }
  547. check_ldflags(){
  548. log check_ldflags "$@"
  549. check_ld "$@" <<EOF && add_ldflags "$@"
  550. int main(void){ return 0; }
  551. EOF
  552. }
  553. check_header(){
  554. log check_header "$@"
  555. header=$1
  556. shift
  557. disable_safe $header
  558. check_cpp "$@" <<EOF && enable_safe $header
  559. #include <$header>
  560. int x;
  561. EOF
  562. }
  563. check_func(){
  564. log check_func "$@"
  565. func=$1
  566. shift
  567. disable $func
  568. check_ld "$@" <<EOF && enable $func
  569. extern int $func();
  570. int main(void){ $func(); }
  571. EOF
  572. }
  573. check_func_headers(){
  574. log check_func_headers "$@"
  575. headers=$1
  576. func=$2
  577. shift 2
  578. disable $func
  579. incs=""
  580. for hdr in $headers; do
  581. incs="$incs
  582. #include <$hdr>"
  583. done
  584. check_ld "$@" <<EOF && enable $func && enable_safe $headers
  585. $incs
  586. int main(int argc, char **argv){
  587. return (long) $func;
  588. }
  589. EOF
  590. }
  591. check_cpp_condition(){
  592. log check_cpp_condition "$@"
  593. header=$1
  594. condition=$2
  595. check_cpp <<EOF
  596. #include <$header>
  597. #if !($condition)
  598. #error "unsatisfied condition: $condition"
  599. #endif
  600. EOF
  601. }
  602. check_lib(){
  603. log check_lib "$@"
  604. header="$1"
  605. func="$2"
  606. shift 2
  607. temp_extralibs "$@"
  608. check_header $header && check_func $func && add_extralibs "$@"
  609. err=$?
  610. restore_flags
  611. return $err
  612. }
  613. check_lib2(){
  614. log check_lib2 "$@"
  615. headers="$1"
  616. func="$2"
  617. shift 2
  618. temp_extralibs "$@"
  619. check_func_headers "$headers" $func && add_extralibs "$@"
  620. err=$?
  621. restore_flags
  622. return $err
  623. }
  624. check_exec(){
  625. check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  626. }
  627. check_exec_crash(){
  628. code=$(cat)
  629. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  630. # are safe but may not be available everywhere. Thus we use
  631. # raise(SIGTERM) instead. The check is run in a subshell so we
  632. # can redirect the "Terminated" message from the shell. SIGBUS
  633. # is not defined by standard C so it is used conditionally.
  634. (check_exec "$@") >> $logfile 2>&1 <<EOF
  635. #include <signal.h>
  636. static void sighandler(int sig){
  637. raise(SIGTERM);
  638. }
  639. int main(void){
  640. signal(SIGILL, sighandler);
  641. signal(SIGFPE, sighandler);
  642. signal(SIGSEGV, sighandler);
  643. #ifdef SIGBUS
  644. signal(SIGBUS, sighandler);
  645. #endif
  646. { $code }
  647. }
  648. EOF
  649. }
  650. check_type(){
  651. log check_type "$@"
  652. headers=$1
  653. type=$2
  654. shift 2
  655. disable $type
  656. incs=""
  657. for hdr in $headers; do
  658. incs="$incs
  659. #include <$hdr>"
  660. done
  661. check_cc "$@" <<EOF && enable $type
  662. $incs
  663. $type v;
  664. EOF
  665. }
  666. require(){
  667. name="$1"
  668. header="$2"
  669. func="$3"
  670. shift 3
  671. check_lib $header $func "$@" || die "ERROR: $name not found"
  672. }
  673. require2(){
  674. name="$1"
  675. headers="$2"
  676. func="$3"
  677. shift 3
  678. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  679. }
  680. check_foo_config(){
  681. cfg=$1
  682. pkg=$2
  683. header=$3
  684. func=$4
  685. shift 4
  686. disable $cfg
  687. check_cmd ${pkg}-config --version
  688. err=$?
  689. if test "$err" = 0; then
  690. temp_cflags $(${pkg}-config --cflags)
  691. temp_extralibs $(${pkg}-config --libs)
  692. check_lib "$@" $header $func && enable $cfg
  693. fi
  694. return $err
  695. }
  696. apply(){
  697. file=$1
  698. shift
  699. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  700. }
  701. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  702. # system-dependent things.
  703. COMPONENT_LIST="
  704. bsfs
  705. decoders
  706. demuxers
  707. encoders
  708. filters
  709. hwaccels
  710. indevs
  711. muxers
  712. outdevs
  713. parsers
  714. protocols
  715. "
  716. CONFIG_LIST="
  717. $COMPONENT_LIST
  718. aandct
  719. avfilter
  720. avfilter_lavf
  721. avisynth
  722. beos_netserver
  723. bzlib
  724. fastdiv
  725. ffmpeg
  726. ffplay
  727. ffserver
  728. fft
  729. golomb
  730. gpl
  731. gprof
  732. gray
  733. hardcoded_tables
  734. ipv6
  735. libdc1394
  736. libdirac
  737. libfaac
  738. libfaad
  739. libfaadbin
  740. libgsm
  741. libmp3lame
  742. libnut
  743. libopencore_amrnb
  744. libopencore_amrwb
  745. libopenjpeg
  746. libschroedinger
  747. libspeex
  748. libtheora
  749. libvorbis
  750. libx264
  751. libxvid
  752. mdct
  753. memalign_hack
  754. mlib
  755. mpegaudio_hp
  756. network
  757. nonfree
  758. postproc
  759. powerpc_perf
  760. rdft
  761. runtime_cpudetect
  762. shared
  763. small
  764. static
  765. swscale_alpha
  766. vaapi
  767. vdpau
  768. version3
  769. x11grab
  770. zlib
  771. "
  772. THREADS_LIST='
  773. beosthreads
  774. os2threads
  775. pthreads
  776. w32threads
  777. '
  778. ARCH_LIST='
  779. alpha
  780. arm
  781. bfin
  782. ia64
  783. m68k
  784. mips
  785. mips64
  786. parisc
  787. ppc
  788. ppc64
  789. s390
  790. sh4
  791. sparc
  792. sparc64
  793. x86
  794. x86_32
  795. x86_64
  796. '
  797. ARCH_EXT_LIST='
  798. altivec
  799. amd3dnow
  800. amd3dnowext
  801. armv5te
  802. armv6
  803. armv6t2
  804. armvfp
  805. iwmmxt
  806. mmi
  807. mmx
  808. mmx2
  809. neon
  810. ppc4xx
  811. sse
  812. ssse3
  813. vis
  814. '
  815. HAVE_LIST="
  816. $ARCH_EXT_LIST
  817. $THREADS_LIST
  818. alsa_asoundlib_h
  819. altivec_h
  820. arpa_inet_h
  821. attribute_packed
  822. bigendian
  823. bswap
  824. closesocket
  825. cmov
  826. conio_h
  827. dcbzl
  828. dev_bktr_ioctl_bt848_h
  829. dev_bktr_ioctl_meteor_h
  830. dev_ic_bt8xx_h
  831. dev_video_meteor_ioctl_meteor_h
  832. dev_video_bktr_ioctl_bt848_h
  833. dlfcn_h
  834. dlopen
  835. dos_paths
  836. ebp_available
  837. ebx_available
  838. fast_64bit
  839. fast_cmov
  840. fast_unaligned
  841. fork
  842. gethrtime
  843. GetProcessTimes
  844. getrusage
  845. inet_aton
  846. inline_asm
  847. isatty
  848. ldbrx
  849. libdc1394_1
  850. libdc1394_2
  851. llrint
  852. log2
  853. loongson
  854. lrint
  855. lrintf
  856. lzo1x_999_compress
  857. machine_ioctl_bt848_h
  858. machine_ioctl_meteor_h
  859. malloc_h
  860. memalign
  861. mkstemp
  862. pld
  863. posix_memalign
  864. round
  865. roundf
  866. sdl
  867. sdl_video_size
  868. setmode
  869. socklen_t
  870. soundcard_h
  871. poll_h
  872. sys_mman_h
  873. sys_resource_h
  874. sys_select_h
  875. sys_soundcard_h
  876. sys_videoio_h
  877. ten_operands
  878. termios_h
  879. threads
  880. truncf
  881. vfp_args
  882. VirtualAlloc
  883. winsock2_h
  884. xform_asm
  885. yasm
  886. "
  887. # options emitted with CONFIG_ prefix but not available on command line
  888. CONFIG_EXTRA="
  889. gplv3
  890. lgplv3
  891. "
  892. CMDLINE_SELECT="
  893. $ARCH_EXT_LIST
  894. $CONFIG_LIST
  895. $THREADS_LIST
  896. cross_compile
  897. debug
  898. extra_warnings
  899. logging
  900. optimizations
  901. stripping
  902. yasm
  903. "
  904. PATHS_LIST='
  905. bindir
  906. datadir
  907. incdir
  908. libdir
  909. mandir
  910. prefix
  911. shlibdir
  912. '
  913. CMDLINE_SET="
  914. $PATHS_LIST
  915. arch
  916. as
  917. build_suffix
  918. cc
  919. cpu
  920. cross_prefix
  921. dep_cc
  922. extra_version
  923. host_cc
  924. host_cflags
  925. host_ldflags
  926. host_libs
  927. host_os
  928. ld
  929. logfile
  930. nm
  931. source_path
  932. sysinclude
  933. sysroot
  934. target_exec
  935. target_os
  936. target_path
  937. "
  938. CMDLINE_APPEND="
  939. extra_cflags
  940. "
  941. # code dependency declarations
  942. # architecture extensions
  943. altivec_deps="ppc"
  944. amd3dnow_deps="mmx"
  945. amd3dnowext_deps="amd3dnow"
  946. armv5te_deps="arm"
  947. armv6_deps="arm"
  948. armv6t2_deps="arm"
  949. armvfp_deps="arm"
  950. iwmmxt_deps="arm"
  951. mmi_deps="mips"
  952. mmx_deps="x86"
  953. mmx2_deps="mmx"
  954. neon_deps="arm"
  955. ppc4xx_deps="ppc"
  956. sse_deps="mmx"
  957. ssse3_deps="sse"
  958. vis_deps="sparc"
  959. need_memalign="altivec neon sse"
  960. inline_asm_deps="!tms470"
  961. # decoders / encoders / hardware accelerators
  962. aac_decoder_select="fft mdct"
  963. aac_encoder_select="fft mdct"
  964. ac3_decoder_select="fft mdct"
  965. atrac3_decoder_select="fft mdct"
  966. cavs_decoder_select="golomb"
  967. cook_decoder_select="fft mdct"
  968. cscd_decoder_suggest="zlib"
  969. dca_decoder_select="fft mdct"
  970. dnxhd_encoder_select="aandct"
  971. dxa_decoder_select="zlib"
  972. eac3_decoder_select="ac3_decoder"
  973. eamad_decoder_select="aandct"
  974. eatgq_decoder_select="aandct"
  975. eatqi_decoder_select="aandct"
  976. ffv1_decoder_select="golomb"
  977. flac_decoder_select="golomb"
  978. flac_encoder_select="golomb"
  979. flashsv_decoder_select="zlib"
  980. flashsv_encoder_select="zlib"
  981. flv_encoder_select="h263_encoder"
  982. h261_encoder_select="aandct"
  983. h263_encoder_select="aandct"
  984. h263_vaapi_hwaccel_deps="va_va_h"
  985. h263_vaapi_hwaccel_select="vaapi h263_decoder"
  986. h263p_encoder_select="h263_encoder"
  987. h264_decoder_select="golomb"
  988. h264_vaapi_hwaccel_deps="va_va_h"
  989. h264_vaapi_hwaccel_select="vaapi"
  990. h264_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  991. h264_vdpau_decoder_select="vdpau h264_decoder"
  992. imc_decoder_select="fft mdct"
  993. jpegls_decoder_select="golomb"
  994. jpegls_encoder_select="golomb"
  995. ljpeg_encoder_select="aandct"
  996. loco_decoder_select="golomb"
  997. mjpeg_encoder_select="aandct"
  998. mpeg1video_encoder_select="aandct"
  999. mpeg2video_encoder_select="aandct"
  1000. mpeg4_encoder_select="h263_encoder"
  1001. mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1002. mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
  1003. mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1004. mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
  1005. mpeg2_vaapi_hwaccel_deps="va_va_h"
  1006. mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
  1007. mpeg4_vaapi_hwaccel_deps="va_va_h"
  1008. mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
  1009. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1010. mpeg_xvmc_decoder_select="mpegvideo_decoder"
  1011. msmpeg4v1_encoder_select="h263_encoder"
  1012. msmpeg4v2_encoder_select="h263_encoder"
  1013. msmpeg4v3_encoder_select="h263_encoder"
  1014. nellymoser_decoder_select="fft mdct"
  1015. nellymoser_encoder_select="fft mdct"
  1016. png_decoder_select="zlib"
  1017. png_encoder_select="zlib"
  1018. qdm2_decoder_select="fft mdct rdft"
  1019. rv10_encoder_select="h263_encoder"
  1020. rv20_encoder_select="h263_encoder"
  1021. rv30_decoder_select="golomb"
  1022. rv40_decoder_select="golomb"
  1023. shorten_decoder_select="golomb"
  1024. sonic_decoder_select="golomb"
  1025. sonic_encoder_select="golomb"
  1026. sonic_ls_encoder_select="golomb"
  1027. svq3_decoder_select="golomb"
  1028. svq3_decoder_suggest="zlib"
  1029. theora_decoder_select="vp3_decoder"
  1030. tiff_decoder_suggest="zlib"
  1031. tiff_encoder_suggest="zlib"
  1032. tscc_decoder_select="zlib"
  1033. vc1_vaapi_hwaccel_deps="va_va_h"
  1034. vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
  1035. vc1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1036. vc1_vdpau_decoder_select="vdpau vc1_decoder"
  1037. vorbis_decoder_select="fft mdct"
  1038. vorbis_encoder_select="fft mdct"
  1039. vp6a_decoder_select="vp6_decoder"
  1040. vp6f_decoder_select="vp6_decoder"
  1041. wmav1_decoder_select="fft mdct"
  1042. wmav1_encoder_select="fft mdct"
  1043. wmav2_decoder_select="fft mdct"
  1044. wmav2_encoder_select="fft mdct"
  1045. wmv1_encoder_select="h263_encoder"
  1046. wmv2_encoder_select="h263_encoder"
  1047. wmv3_decoder_select="vc1_decoder"
  1048. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1049. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1050. zlib_decoder_select="zlib"
  1051. zlib_encoder_select="zlib"
  1052. zmbv_decoder_select="zlib"
  1053. zmbv_encoder_select="zlib"
  1054. # parsers
  1055. h264_parser_select="golomb"
  1056. # external libraries
  1057. libdirac_decoder_deps="libdirac !libschroedinger"
  1058. libdirac_encoder_deps="libdirac"
  1059. libfaac_encoder_deps="libfaac"
  1060. libfaad_decoder_deps="libfaad"
  1061. libfaadbin_decoder_extralibs='$ldl'
  1062. libgsm_decoder_deps="libgsm"
  1063. libgsm_encoder_deps="libgsm"
  1064. libgsm_ms_decoder_deps="libgsm"
  1065. libgsm_ms_encoder_deps="libgsm"
  1066. libmp3lame_encoder_deps="libmp3lame"
  1067. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1068. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1069. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1070. libopenjpeg_decoder_deps="libopenjpeg"
  1071. libschroedinger_decoder_deps="libschroedinger"
  1072. libschroedinger_encoder_deps="libschroedinger"
  1073. libspeex_decoder_deps="libspeex"
  1074. libtheora_encoder_deps="libtheora"
  1075. libvorbis_encoder_deps="libvorbis"
  1076. libx264_encoder_deps="libx264"
  1077. libxvid_encoder_deps="libxvid"
  1078. # demuxers / muxers
  1079. ac3_demuxer_deps="ac3_parser"
  1080. asf_stream_muxer_select="asf_muxer"
  1081. avisynth_demuxer_deps="avisynth"
  1082. dirac_demuxer_deps="dirac_parser"
  1083. ipod_muxer_select="mov_muxer"
  1084. libnut_demuxer_deps="libnut"
  1085. libnut_muxer_deps="libnut"
  1086. matroska_audio_muxer_select="matroska_muxer"
  1087. matroska_demuxer_suggest="zlib bzlib"
  1088. mov_demuxer_suggest="zlib"
  1089. mp3_demuxer_deps="mpegaudio_parser"
  1090. mp4_muxer_select="mov_muxer"
  1091. mpegtsraw_demuxer_select="mpegts_demuxer"
  1092. mxf_d10_muxer_select="mxf_muxer"
  1093. psp_muxer_select="mov_muxer"
  1094. redir_demuxer_deps="network"
  1095. rtp_muxer_deps="network rtp_protocol"
  1096. rtsp_demuxer_deps="sdp_demuxer"
  1097. sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
  1098. tg2_muxer_select="mov_muxer"
  1099. tgp_muxer_select="mov_muxer"
  1100. # indevs / outdevs
  1101. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1102. alsa_indev_extralibs="-lasound"
  1103. alsa_outdev_deps="alsa_asoundlib_h"
  1104. alsa_outdev_extralibs="-lasound"
  1105. audio_beos_indev_deps="audio_beos"
  1106. audio_beos_indev_extralibs="-lmedia -lbe"
  1107. audio_beos_outdev_deps="audio_beos"
  1108. audio_beos_outdev_extralibs="-lmedia -lbe"
  1109. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1110. dv1394_indev_deps="dv1394 dv_demuxer"
  1111. jack_indev_deps="jack_jack_h"
  1112. jack_indev_extralibs="-ljack"
  1113. libdc1394_indev_deps="libdc1394"
  1114. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1115. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1116. v4l_indev_deps="linux_videodev_h"
  1117. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1118. vfwcap_indev_deps="capCreateCaptureWindow"
  1119. vfwcap_indev_extralibs="-lvfw32"
  1120. x11_grab_device_indev_deps="x11grab XShmCreateImage"
  1121. x11_grab_device_indev_extralibs="-lX11 -lXext"
  1122. # protocols
  1123. gopher_protocol_deps="network"
  1124. http_protocol_deps="network"
  1125. rtmp_protocol_deps="tcp_protocol"
  1126. rtp_protocol_deps="udp_protocol"
  1127. tcp_protocol_deps="network"
  1128. udp_protocol_deps="network"
  1129. # filters
  1130. movie_filter_deps="avfilter_lavf"
  1131. # programs
  1132. ffplay_deps="sdl"
  1133. ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
  1134. ffserver_extralibs='$ldl'
  1135. # default parameters
  1136. logfile="config.err"
  1137. # installation paths
  1138. prefix_default="/usr/local"
  1139. bindir_default='${prefix}/bin'
  1140. datadir_default='${prefix}/share/ffmpeg'
  1141. incdir_default='${prefix}/include'
  1142. libdir_default='${prefix}/lib'
  1143. mandir_default='${prefix}/share/man'
  1144. shlibdir_default="$libdir_default"
  1145. # toolchain
  1146. ar="ar"
  1147. cc_default="gcc"
  1148. host_cc_default="gcc"
  1149. ln_s="ln -sf"
  1150. nm_default="nm"
  1151. objformat="elf"
  1152. ranlib="ranlib"
  1153. strip="strip"
  1154. yasmexe="yasm"
  1155. # machine
  1156. arch=$(uname -m)
  1157. cpu="generic"
  1158. # OS
  1159. target_os=$(tolower $(uname -s))
  1160. host_os=$target_os
  1161. # configurable options
  1162. enable debug
  1163. enable fastdiv
  1164. enable ffmpeg
  1165. enable ffplay
  1166. enable ffserver
  1167. enable ipv6
  1168. enable mpegaudio_hp
  1169. enable network
  1170. enable optimizations
  1171. enable protocols
  1172. enable static
  1173. enable stripping
  1174. enable swscale_alpha
  1175. # build settings
  1176. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1177. FFSERVERLDFLAGS=-Wl,-E
  1178. LIBPREF="lib"
  1179. LIBSUF=".a"
  1180. FULLNAME='$(NAME)$(BUILDSUF)'
  1181. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1182. SLIBPREF="lib"
  1183. SLIBSUF=".so"
  1184. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1185. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1186. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1187. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1188. CC_O='-o $@'
  1189. host_cflags='-O3 -g -Wall'
  1190. host_libs='-lm'
  1191. target_path='.'
  1192. # gcc stupidly only outputs the basename of targets with -MM, but we need the
  1193. # full relative path for objects in subdirectories for non-recursive Make.
  1194. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $@'
  1195. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
  1196. # find source path
  1197. source_path="$(dirname "$0")"
  1198. enable source_path_used
  1199. if test -f configure; then
  1200. source_path="$(pwd)"
  1201. disable source_path_used
  1202. else
  1203. source_path="$(cd "$source_path"; pwd)"
  1204. echo "$source_path" | grep -q '[[:blank:]]' &&
  1205. die "Out of tree builds are impossible with whitespace in source path."
  1206. test -e "$source_path/config.h" &&
  1207. die "Out of tree builds are impossible with config.h in source dir."
  1208. fi
  1209. for v in "$@"; do
  1210. r=${v#*=}
  1211. l=${v%"$r"}
  1212. r=$(sh_quote "$r")
  1213. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1214. done
  1215. find_things(){
  1216. thing=$1
  1217. pattern=$2
  1218. file=$source_path/$3
  1219. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1220. }
  1221. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1222. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1223. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1224. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1225. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1226. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1227. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1228. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1229. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1230. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1231. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1232. enable $ARCH_EXT_LIST \
  1233. $DECODER_LIST \
  1234. $ENCODER_LIST \
  1235. $HWACCEL_LIST \
  1236. $PARSER_LIST \
  1237. $BSF_LIST \
  1238. $DEMUXER_LIST \
  1239. $MUXER_LIST \
  1240. $FILTER_LIST \
  1241. $PROTOCOL_LIST \
  1242. $INDEV_LIST \
  1243. $OUTDEV_LIST \
  1244. die_unknown(){
  1245. echo "Unknown option \"$1\"."
  1246. echo "See $0 --help for available options."
  1247. exit 1
  1248. }
  1249. show_list() {
  1250. suffix=_$1
  1251. shift
  1252. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort
  1253. exit 0
  1254. }
  1255. for opt do
  1256. optval="${opt#*=}"
  1257. case "$opt" in
  1258. --extra-ldflags=*) add_ldflags $optval
  1259. ;;
  1260. --extra-libs=*) add_extralibs $optval
  1261. ;;
  1262. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1263. ;;
  1264. --enable-debug=*) debuglevel="$optval"
  1265. ;;
  1266. --enable-*=*|--disable-*=*)
  1267. eval $(echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/')
  1268. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  1269. eval list=\$$(toupper $thing)_LIST
  1270. $action $(filter "${optval}_${thing}" $list)
  1271. ;;
  1272. --enable-?*|--disable-?*)
  1273. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  1274. if is_in $option $COMPONENT_LIST; then
  1275. test $action = disable && action=unset
  1276. eval $action \$$(toupper ${option%s})_LIST
  1277. elif is_in $option $CMDLINE_SELECT; then
  1278. $action $option
  1279. else
  1280. die_unknown $opt
  1281. fi
  1282. ;;
  1283. --list-*)
  1284. NAME="${opt#--list-}"
  1285. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1286. NAME=${NAME%s}
  1287. eval show_list $NAME \$$(toupper $NAME)_LIST
  1288. ;;
  1289. --help|-h) show_help
  1290. ;;
  1291. *)
  1292. optname="${opt%%=*}"
  1293. optname="${optname#--}"
  1294. optname=$(echo "$optname" | sed 's/-/_/g')
  1295. if is_in $optname $CMDLINE_SET; then
  1296. eval $optname='$optval'
  1297. elif is_in $optname $CMDLINE_APPEND; then
  1298. append $optname "$optval"
  1299. else
  1300. die_unknown $opt
  1301. fi
  1302. ;;
  1303. esac
  1304. done
  1305. disabled logging && logfile=/dev/null
  1306. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  1307. set >> $logfile
  1308. test -n "$cross_prefix" && enable cross_compile
  1309. ar="${cross_prefix}${ar}"
  1310. cc_default="${cross_prefix}${cc_default}"
  1311. nm_default="${cross_prefix}${nm_default}"
  1312. ranlib="${cross_prefix}${ranlib}"
  1313. strip="${cross_prefix}${strip}"
  1314. sysinclude_default="${sysroot}/usr/include"
  1315. set_default cc nm sysinclude
  1316. enabled cross_compile || host_cc_default=$cc
  1317. set_default host_cc
  1318. exesuf() {
  1319. case $1 in
  1320. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
  1321. esac
  1322. }
  1323. EXESUF=$(exesuf $target_os)
  1324. HOSTEXESUF=$(exesuf $host_os)
  1325. # set temporary file name
  1326. : ${TMPDIR:=$TEMPDIR}
  1327. : ${TMPDIR:=$TMP}
  1328. : ${TMPDIR:=/tmp}
  1329. if ! check_cmd type mktemp; then
  1330. # simple replacement for missing mktemp
  1331. # NOT SAFE FOR GENERAL USE
  1332. mktemp(){
  1333. echo "${2%XXX*}.${HOSTNAME}.${UID}.$$"
  1334. }
  1335. fi
  1336. tmpfile(){
  1337. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  1338. (set -C; exec > $tmp) 2>/dev/null ||
  1339. die "Unable to create temoporary file in $TMPDIR."
  1340. append TMPFILES $tmp
  1341. eval $1=$tmp
  1342. }
  1343. trap 'rm -f -- $TMPFILES' EXIT
  1344. trap exit HUP INT TERM
  1345. tmpfile TMPC .c
  1346. tmpfile TMPE $EXESUF
  1347. tmpfile TMPH .h
  1348. tmpfile TMPO .o
  1349. tmpfile TMPS .S
  1350. tmpfile TMPSH .sh
  1351. unset -f mktemp
  1352. # make sure we can execute files in $TMPDIR
  1353. cat > $TMPSH 2>> $logfile <<EOF
  1354. #! /bin/sh
  1355. EOF
  1356. chmod +x $TMPSH >> $logfile 2>&1
  1357. if ! $TMPSH >> $logfile 2>&1; then
  1358. cat <<EOF
  1359. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  1360. variable to another directory and make sure that it is not mounted noexec.
  1361. EOF
  1362. die "Sanity test failed."
  1363. fi
  1364. filter_cflags=echo
  1365. filter_cppflags=echo
  1366. filter_asflags=echo
  1367. if $cc --version 2>/dev/null | grep -qi gcc; then
  1368. cc_type=gcc
  1369. elif $cc --version 2>/dev/null | grep -q Intel; then
  1370. cc_type=icc
  1371. elif $cc -v 2>&1 | grep -q xlc; then
  1372. cc_type=xlc
  1373. elif $cc -V 2>/dev/null | grep -q Compaq; then
  1374. cc_type=ccc
  1375. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
  1376. debuglevel=3
  1377. add_ldflags -Wl,-z,now # calls to libots crash without this
  1378. elif $cc --vsn 2>/dev/null | grep -q RVCT; then
  1379. test -d "$sysroot" || die "No valid sysroot specified."
  1380. cc_type=armcc
  1381. armcc_conf="$PWD/armcc.conf"
  1382. $cc --arm_linux_configure \
  1383. --arm_linux_config_file="$armcc_conf" \
  1384. --configure_sysroot="$sysroot" \
  1385. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  1386. die "Error creating armcc configuration file."
  1387. cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
  1388. as_default="${cross_prefix}gcc"
  1389. elif $cc -version 2>/dev/null | grep -q TMS470; then
  1390. cc_type=tms470
  1391. cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
  1392. CC_O='-fr=$(@D)'
  1393. as_default="${cross_prefix}gcc"
  1394. ld_default="${cross_prefix}gcc"
  1395. dep_cc_default="${cross_prefix}gcc"
  1396. TMPO=$(basename $TMPC .c).o
  1397. append TMPFILES $TMPO
  1398. add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
  1399. DEPFLAGS='$(CPPFLAGS) -MM'
  1400. filter_cflags=tms470_flags
  1401. tms470_flags(){
  1402. for flag; do
  1403. case $flag in
  1404. -march=*|-mcpu=*)
  1405. case "${flag#*=}" in
  1406. armv7-a|cortex-a*) echo -mv=7a8 ;;
  1407. armv7-r|cortex-r*) echo -mv=7r4 ;;
  1408. armv7-m|cortex-m*) echo -mv=7m3 ;;
  1409. armv6*|arm11*) echo -mv=6 ;;
  1410. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  1411. echo -mv=5e ;;
  1412. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  1413. esac
  1414. ;;
  1415. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  1416. -mfpu=vfp) echo --float_support=vfpv2 ;;
  1417. -mfpu=softvfp) echo --float_support=vfplib ;;
  1418. -Os) echo -O3 -mf=2 ;;
  1419. -O[0-3]) echo $flag -mf=5 ;;
  1420. -g) echo -g -mn ;;
  1421. esac
  1422. done
  1423. }
  1424. fi
  1425. test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
  1426. : ${as_default:=$cc}
  1427. : ${dep_cc_default:=$cc}
  1428. : ${ld_default:=$cc}
  1429. set_default as dep_cc ld
  1430. add_cflags $extra_cflags
  1431. add_asflags $extra_cflags
  1432. if test -n "$sysroot"; then
  1433. case "$cc_type" in
  1434. gcc)
  1435. add_cppflags --sysroot="$sysroot"
  1436. add_ldflags --sysroot="$sysroot"
  1437. ;;
  1438. tms470)
  1439. add_cppflags -I"$sysinclude"
  1440. add_ldflags --sysroot="$sysroot"
  1441. ;;
  1442. esac
  1443. fi
  1444. if test "$cpu" = host; then
  1445. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  1446. case "$cc_type" in
  1447. gcc)
  1448. check_native(){
  1449. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  1450. awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
  1451. }
  1452. cpu=$(check_native -march || check_native -mcpu)
  1453. ;;
  1454. esac
  1455. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  1456. fi
  1457. # Add processor-specific flags
  1458. case $cpu in
  1459. 601|ppc601|PowerPC601)
  1460. cpuflags="-mcpu=601"
  1461. ;;
  1462. 603*|ppc603*|PowerPC603*)
  1463. cpuflags="-mcpu=603"
  1464. ;;
  1465. 604*|ppc604*|PowerPC604*)
  1466. cpuflags="-mcpu=604"
  1467. ;;
  1468. G3|g3|75*|ppc75*|PowerPC75*)
  1469. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  1470. ;;
  1471. G4|g4|745*|ppc745*|PowerPC745*)
  1472. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  1473. ;;
  1474. 74*|ppc74*|PowerPC74*)
  1475. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  1476. ;;
  1477. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  1478. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  1479. ;;
  1480. Cell|CELL|cell)
  1481. cpuflags="-mcpu=cell"
  1482. enable ldbrx
  1483. ;;
  1484. # targets that do NOT support conditional mov (cmov)
  1485. i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  1486. cpuflags="-march=$cpu"
  1487. disable cmov
  1488. ;;
  1489. # targets that do support conditional mov (cmov)
  1490. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
  1491. cpuflags="-march=$cpu"
  1492. enable cmov
  1493. enable fast_cmov
  1494. ;;
  1495. # targets that do support conditional mov but on which it's slow
  1496. pentium4|pentium4m|prescott|nocona)
  1497. cpuflags="-march=$cpu"
  1498. enable cmov
  1499. disable fast_cmov
  1500. ;;
  1501. sparc64)
  1502. cpuflags="-mcpu=v9"
  1503. ;;
  1504. arm11*|cortex*)
  1505. cpuflags="-mcpu=$cpu"
  1506. enable fast_unaligned
  1507. ;;
  1508. armv[67]*)
  1509. cpuflags="-march=$cpu"
  1510. enable fast_unaligned
  1511. ;;
  1512. armv*)
  1513. cpuflags="-march=$cpu"
  1514. ;;
  1515. arm*)
  1516. cpuflags="-mcpu=$cpu"
  1517. ;;
  1518. ev4|ev45|ev5|ev56|pca56|ev6|ev67)
  1519. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  1520. ;;
  1521. bf*)
  1522. cpuflags="-mcpu=$cpu"
  1523. ;;
  1524. mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef])
  1525. cpuflags="-march=$cpu"
  1526. ;;
  1527. generic)
  1528. ;;
  1529. *)
  1530. echo "WARNING: Unknown CPU \"$cpu\", ignored."
  1531. ;;
  1532. esac
  1533. add_cflags $cpuflags
  1534. add_asflags $cpuflags
  1535. # compiler sanity check
  1536. check_exec <<EOF
  1537. int main(void){ return 0; }
  1538. EOF
  1539. if test "$?" != 0; then
  1540. echo "$cc is unable to create an executable file."
  1541. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  1542. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  1543. echo "Only do this if you know what cross compiling means."
  1544. fi
  1545. die "C compiler test failed."
  1546. fi
  1547. add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
  1548. check_cflags -std=c99
  1549. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  1550. #include <stdlib.h>
  1551. EOF
  1552. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  1553. #include <stdlib.h>
  1554. EOF
  1555. case "$arch" in
  1556. alpha)
  1557. arch="alpha"
  1558. enable fast_64bit
  1559. check_cflags -mieee
  1560. pic=$shared
  1561. ;;
  1562. arm|armv[4567]*l)
  1563. arch="arm"
  1564. ;;
  1565. avr32)
  1566. ;;
  1567. bfin)
  1568. arch="bfin"
  1569. ;;
  1570. ia64)
  1571. arch="ia64"
  1572. enable fast_64bit
  1573. pic=$shared
  1574. ;;
  1575. m68k)
  1576. arch="m68k"
  1577. ;;
  1578. mips|mipsel|IP*)
  1579. arch="mips"
  1580. pic=$shared
  1581. ;;
  1582. mips64)
  1583. arch="mips"
  1584. subarch="mips64"
  1585. enable fast_64bit
  1586. pic=$shared
  1587. ;;
  1588. parisc|hppa)
  1589. arch="parisc"
  1590. pic=$shared
  1591. ;;
  1592. parisc64|hppa64)
  1593. arch="parisc"
  1594. enable fast_64bit
  1595. pic=$shared
  1596. ;;
  1597. "Power Macintosh"|ppc|powerpc)
  1598. arch="ppc"
  1599. enable fast_unaligned
  1600. ;;
  1601. ppc64)
  1602. arch="ppc"
  1603. subarch="ppc64"
  1604. enable fast_64bit
  1605. enable fast_unaligned
  1606. ;;
  1607. s390|s390x)
  1608. arch="s390"
  1609. ;;
  1610. sh4|sh)
  1611. arch="sh4"
  1612. ;;
  1613. sparc)
  1614. arch="sparc"
  1615. pic=$shared
  1616. ;;
  1617. sun4u|sparc64)
  1618. arch="sparc"
  1619. subarch="sparc64"
  1620. enable fast_64bit
  1621. pic=$shared
  1622. ;;
  1623. i386|i486|i586|i686|i86pc|BePC)
  1624. arch="x86"
  1625. subarch="x86_32"
  1626. enable fast_unaligned
  1627. ;;
  1628. x86_64|amd64)
  1629. arch="x86"
  1630. subarch="x86_32"
  1631. enable cmov
  1632. enable fast_cmov
  1633. enable fast_unaligned
  1634. check_cc <<EOF && enable fast_64bit && subarch="x86_64" && pic=$shared
  1635. int test[sizeof(char*) - 7];
  1636. EOF
  1637. ;;
  1638. *)
  1639. arch="unknown"
  1640. ;;
  1641. esac
  1642. enable $arch $subarch
  1643. # OS specific
  1644. case $target_os in
  1645. beos|haiku|zeta)
  1646. prefix_default="$HOME/config"
  1647. # helps building libavcodec
  1648. add_cppflags -DPIC
  1649. add_cflags -fomit-frame-pointer
  1650. # 3 gcc releases known for BeOS, each with ugly bugs
  1651. gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
  1652. case "$gcc_version" in
  1653. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  1654. disable mmx
  1655. ;;
  1656. *20010315*) echo "BeBits gcc"
  1657. add_cflags -fno-expensive-optimizations
  1658. ;;
  1659. esac
  1660. SHFLAGS=-nostart
  1661. # enable BeOS things
  1662. enable audio_beos
  1663. # no need for libm, but the inet stuff
  1664. # Check for BONE
  1665. # XXX: actually should check for NOT net_server
  1666. if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
  1667. network_extralibs="-lbind -lsocket"
  1668. else
  1669. enable beos_netserver
  1670. network_extralibs="-lnet"
  1671. fi ;;
  1672. sunos)
  1673. FFSERVERLDFLAGS=""
  1674. SHFLAGS='-shared -Wl,-h,$$(@F)'
  1675. network_extralibs="-lsocket -lnsl"
  1676. add_cppflags -D__EXTENSIONS__
  1677. ;;
  1678. netbsd)
  1679. oss_indev_extralibs="-lossaudio"
  1680. oss_outdev_extralibs="-lossaudio"
  1681. ;;
  1682. openbsd)
  1683. enable malloc_aligned
  1684. enable pic
  1685. SHFLAGS='-shared'
  1686. oss_indev_extralibs="-lossaudio"
  1687. oss_outdev_extralibs="-lossaudio"
  1688. ;;
  1689. freebsd|dragonfly)
  1690. enable malloc_aligned
  1691. ;;
  1692. bsd/os)
  1693. osextralibs="-lpoll -lgnugetopt"
  1694. strip="strip -d"
  1695. ;;
  1696. darwin)
  1697. enable malloc_aligned
  1698. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
  1699. strip="strip -x"
  1700. FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
  1701. SLIBSUF=".dylib"
  1702. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  1703. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  1704. FFSERVERLDFLAGS=-Wl,-bind_at_load
  1705. objformat="macho"
  1706. enabled x86_64 && objformat="macho64"
  1707. enabled shared || check_cflags -mdynamic-no-pic
  1708. ;;
  1709. mingw32*)
  1710. if test $target_os = "mingw32ce"; then
  1711. disable network
  1712. else
  1713. target_os=mingw32
  1714. fi
  1715. LIBTARGET=i386
  1716. if enabled x86_64; then
  1717. enable malloc_aligned
  1718. LIBTARGET=x64
  1719. elif enabled arm; then
  1720. LIBTARGET=arm
  1721. fi
  1722. shlibdir_default="$bindir_default"
  1723. disable ffserver
  1724. SLIBPREF=""
  1725. SLIBSUF=".dll"
  1726. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1727. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1728. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
  1729. SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
  1730. install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
  1731. install -d "$(LIBDIR)"; \
  1732. install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
  1733. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
  1734. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  1735. objformat="win32"
  1736. enable dos_paths
  1737. check_cflags -fno-common
  1738. if ! enabled x86_64; then
  1739. check_cpp_condition _mingw.h "(__MINGW32_MAJOR_VERSION > 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  1740. die "ERROR: MinGW runtime version must be >= 3.15."
  1741. enabled_any avisynth vfwcap_indev &&
  1742. { check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" ||
  1743. die "ERROR: avisynth and vfwcap_indev require w32api version 3.13 or later."; }
  1744. fi
  1745. ;;
  1746. cygwin*)
  1747. target_os=cygwin
  1748. shlibdir_default="$bindir_default"
  1749. SLIBPREF="cyg"
  1750. SLIBSUF=".dll"
  1751. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1752. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1753. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  1754. objformat="win32"
  1755. enable dos_paths
  1756. check_cflags -fno-common
  1757. ;;
  1758. *-dos|freedos|opendos)
  1759. disable ffplay ffserver
  1760. disable $INDEV_LIST $OUTDEV_LIST
  1761. network_extralibs="-lsocket"
  1762. objformat="coff"
  1763. enable dos_paths
  1764. ;;
  1765. linux)
  1766. enable dv1394
  1767. ;;
  1768. irix*)
  1769. target_os=irix
  1770. ranlib="echo ignoring ranlib"
  1771. ;;
  1772. os/2*)
  1773. strip="lxlite"
  1774. ln_s="cp -f"
  1775. FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
  1776. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  1777. FFSERVERLDFLAGS=""
  1778. LIBSUF="_s.a"
  1779. SLIBPREF=""
  1780. SLIBSUF=".dll"
  1781. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  1782. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  1783. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  1784. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  1785. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  1786. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  1787. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  1788. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  1789. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  1790. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  1791. SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
  1792. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
  1793. enable dos_paths
  1794. ;;
  1795. gnu/kfreebsd)
  1796. ;;
  1797. gnu)
  1798. ;;
  1799. *)
  1800. die "Unknown OS '$target_os'."
  1801. ;;
  1802. esac
  1803. set_default $PATHS_LIST
  1804. add_extralibs $osextralibs
  1805. # Combine FFLDFLAGS and the LDFLAGS environment variable.
  1806. LDFLAGS="$FFLDFLAGS $LDFLAGS"
  1807. # we need to build at least one lib type
  1808. if ! enabled_any static shared; then
  1809. cat <<EOF
  1810. At least one library type must be built.
  1811. Specify --enable-static to build the static libraries or --enable-shared to
  1812. build the shared libraries as well. To only build the shared libraries specify
  1813. --disable-static in addition to --enable-shared.
  1814. EOF
  1815. exit 1;
  1816. fi
  1817. disabled static && LIBNAME=""
  1818. if enabled_any libfaad libfaadbin ; then
  1819. if check_header faad.h; then
  1820. check_cc <<EOF
  1821. #include <faad.h>
  1822. #ifndef FAAD2_VERSION
  1823. ok faad1
  1824. #endif
  1825. int main(void) { return 0; }
  1826. EOF
  1827. test $? = 0 && enable libfaad2
  1828. else
  1829. die "FAAD test failed."
  1830. fi
  1831. fi
  1832. die_license_disabled() {
  1833. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  1834. }
  1835. die_license_disabled gpl libfaad2
  1836. die_license_disabled gpl libx264
  1837. die_license_disabled gpl libxvid
  1838. die_license_disabled gpl postproc
  1839. die_license_disabled gpl x11grab
  1840. die_license_disabled nonfree libfaac
  1841. die_license_disabled version3 libopencore_amrnb
  1842. die_license_disabled version3 libopencore_amrwb
  1843. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  1844. check_deps $ARCH_EXT_LIST
  1845. disabled optimizations || check_cflags -fomit-frame-pointer
  1846. check_cc <<EOF || die "Symbol mangling check failed."
  1847. int ff_extern;
  1848. EOF
  1849. sym=$($nm -P -g $TMPO | grep ff_extern)
  1850. extern_prefix=${sym%%ff_extern*}
  1851. check_cc <<EOF && enable inline_asm
  1852. void foo(void) { __asm__ volatile ("" ::); }
  1853. EOF
  1854. _restrict=
  1855. for restrict_keyword in restrict __restrict__ __restrict; do
  1856. check_cc <<EOF && _restrict=$restrict_keyword && break
  1857. void foo(char * $restrict_keyword p);
  1858. EOF
  1859. done
  1860. check_cc <<EOF && enable attribute_packed
  1861. struct { int x; } __attribute__((packed)) x;
  1862. EOF
  1863. check_cc <<EOF || die "endian test failed"
  1864. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  1865. EOF
  1866. od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  1867. if enabled arm; then
  1868. check_ld <<EOF && enable vfp_args
  1869. __asm__ (".eabi_attribute 28, 1");
  1870. int main(void) { return 0; }
  1871. EOF
  1872. # We have to check if pld is a nop and disable it.
  1873. check_asm pld '"pld [r0]"'
  1874. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  1875. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  1876. enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
  1877. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  1878. enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
  1879. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  1880. elif enabled mips; then
  1881. check_asm loongson '"dmult.g $1, $2, $3"'
  1882. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  1883. elif enabled ppc; then
  1884. check_asm dcbzl '"dcbzl 0, 1"'
  1885. check_asm ppc4xx '"maclhw r10, r11, r12"'
  1886. check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)'
  1887. # AltiVec flags: The FSF version of GCC differs from the Apple version
  1888. if enabled altivec; then
  1889. check_cflags -maltivec -mabi=altivec &&
  1890. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  1891. check_cflags -faltivec
  1892. # check if our compiler supports Motorola AltiVec C API
  1893. check_cc <<EOF || disable altivec
  1894. $inc_altivec_h
  1895. int main(void) {
  1896. vector signed int v1, v2, v3;
  1897. v1 = vec_add(v2,v3);
  1898. return 0;
  1899. }
  1900. EOF
  1901. # check if our compiler supports braces for vector declarations
  1902. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  1903. $inc_altivec_h
  1904. int main (void) { (vector int) {1}; return 0; }
  1905. EOF
  1906. fi
  1907. elif enabled sparc; then
  1908. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  1909. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  1910. elif enabled x86; then
  1911. # check whether EBP is available on x86
  1912. # As 'i' is stored on the stack, this program will crash
  1913. # if the base pointer is used to access it because the
  1914. # base pointer is cleared in the inline assembly code.
  1915. check_exec_crash <<EOF && enable ebp_available
  1916. volatile int i=0;
  1917. __asm__ volatile (
  1918. "xorl %%ebp, %%ebp"
  1919. ::: "%ebp");
  1920. return i;
  1921. EOF
  1922. # check wether EBX is available on x86
  1923. check_asm ebx_available '"":::"%ebx"'
  1924. # check whether more than 10 operands are supported
  1925. check_cc <<EOF && enable ten_operands
  1926. int main(void) {
  1927. int x=0;
  1928. __asm__ volatile(
  1929. ""
  1930. :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
  1931. );
  1932. return 0;
  1933. }
  1934. EOF
  1935. # check whether binutils is new enough to compile SSSE3/MMX2
  1936. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  1937. enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
  1938. check_asm bswap '"bswap %%eax" ::: "%eax"'
  1939. YASMFLAGS="-f $objformat -DARCH_$(toupper $subarch)"
  1940. enabled x86_64 && append YASMFLAGS "-m amd64"
  1941. enabled_all x86_64 shared && append YASMFLAGS "-DPIC"
  1942. case "$objformat" in
  1943. elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
  1944. macho64) append YASMFLAGS "-DPIC -DPREFIX" ;;
  1945. *) append YASMFLAGS "-DPREFIX" ;;
  1946. esac
  1947. disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; }
  1948. fi
  1949. if check_func dlopen; then
  1950. ldl=
  1951. elif check_func dlopen -ldl; then
  1952. ldl=-ldl
  1953. fi
  1954. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  1955. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  1956. check_func fork
  1957. check_func gethrtime
  1958. check_func getrusage
  1959. check_func inet_aton $network_extralibs
  1960. check_func isatty
  1961. check_func memalign
  1962. check_func mkstemp
  1963. check_func posix_memalign
  1964. check_func_headers io.h setmode
  1965. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  1966. check_func_headers windows.h GetProcessTimes
  1967. check_func_headers windows.h VirtualAlloc
  1968. check_header conio.h
  1969. check_header dlfcn.h
  1970. check_header malloc.h
  1971. check_header poll.h
  1972. check_header sys/mman.h
  1973. check_header sys/resource.h
  1974. check_header sys/select.h
  1975. check_header termios.h
  1976. check_header vdpau/vdpau.h
  1977. check_header vdpau/vdpau_x11.h
  1978. check_header X11/extensions/XvMClib.h
  1979. if ! enabled_any memalign memalign_hack posix_memalign malloc_aligned &&
  1980. enabled_any $need_memalign ; then
  1981. die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack."
  1982. fi
  1983. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  1984. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  1985. # check for some common methods of building with pthread support
  1986. # do this before the optional library checks as some of them require pthreads
  1987. if enabled pthreads; then
  1988. if check_func pthread_create; then
  1989. :
  1990. elif check_func pthread_create -pthread; then
  1991. add_cflags -pthread
  1992. add_extralibs -pthread
  1993. elif check_func pthread_create -pthreads; then
  1994. add_cflags -pthreads
  1995. add_extralibs -pthreads
  1996. elif check_func pthread_create -lpthreadGC2; then
  1997. add_extralibs -lpthreadGC2
  1998. elif ! check_lib pthread.h pthread_create -lpthread; then
  1999. die "ERROR: can't find pthreads library"
  2000. fi
  2001. fi
  2002. for thread in $THREADS_LIST; do
  2003. if enabled $thread; then
  2004. test -n "$thread_type" &&
  2005. die "ERROR: Only one thread type must be selected." ||
  2006. thread_type="$thread"
  2007. fi
  2008. done
  2009. check_lib math.h sin -lm
  2010. check_lib va/va.h vaInitialize -lva
  2011. check_func llrint
  2012. check_func log2
  2013. check_func lrint
  2014. check_func lrintf
  2015. check_func round
  2016. check_func roundf
  2017. check_func truncf
  2018. # these are off by default, so fail if requested and not available
  2019. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
  2020. enabled libdirac && add_cflags $(pkg-config --cflags dirac) &&
  2021. require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init -ldirac_decoder &&
  2022. require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init -ldirac_encoder
  2023. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  2024. enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
  2025. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  2026. enabled libmp3lame && require libmp3lame lame/lame.h lame_init -lmp3lame -lm
  2027. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  2028. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb -lm
  2029. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -lm
  2030. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  2031. enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
  2032. require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
  2033. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  2034. enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
  2035. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  2036. enabled libx264 && require libx264 x264.h x264_encoder_open -lx264 -lm &&
  2037. { check_cpp_condition x264.h "X264_BUILD >= 65" ||
  2038. die "ERROR: libx264 version must be >= 0.65."; }
  2039. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  2040. enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
  2041. # libdc1394 check
  2042. if enabled libdc1394; then
  2043. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  2044. enable libdc1394_2; } ||
  2045. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  2046. enable libdc1394_1; } ||
  2047. die "ERROR: No version of libdc1394 found "
  2048. fi
  2049. disable sdl_too_old
  2050. disable sdl
  2051. SDL_CONFIG="${cross_prefix}sdl-config"
  2052. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  2053. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  2054. temp_cflags $sdl_cflags
  2055. temp_extralibs $("${SDL_CONFIG}" --libs)
  2056. if check_lib2 SDL.h SDL_Init; then
  2057. _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g')
  2058. if test "$_sdlversion" -lt 121 ; then
  2059. enable sdl_too_old
  2060. else
  2061. enable sdl
  2062. check_cc $sdl_cflags <<EOF && enable sdl_video_size
  2063. #include <SDL.h>
  2064. int main(int argc, char **argv){
  2065. const SDL_VideoInfo *vi = SDL_GetVideoInfo();
  2066. int w = vi->current_w;
  2067. return 0;
  2068. }
  2069. EOF
  2070. fi
  2071. fi
  2072. restore_flags
  2073. fi
  2074. texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
  2075. if enabled network; then
  2076. check_type "sys/types.h sys/socket.h" socklen_t
  2077. # Prefer arpa/inet.h over winsock2
  2078. if check_header arpa/inet.h ; then
  2079. check_func closesocket
  2080. elif check_header winsock2.h ; then
  2081. check_func_headers winsock2.h closesocket -lws2 && \
  2082. network_extralibs="-lws2" || \
  2083. { check_func_headers winsock2.h closesocket -lws2_32 && \
  2084. network_extralibs="-lws2_32"; }
  2085. check_type ws2tcpip.h socklen_t
  2086. else
  2087. disable network
  2088. fi
  2089. fi
  2090. enabled_all network ipv6 && check_ld <<EOF || disable ipv6
  2091. #include <sys/types.h>
  2092. #include <sys/socket.h>
  2093. #include <netinet/in.h>
  2094. #include <netdb.h>
  2095. int main(void) {
  2096. struct sockaddr_storage saddr;
  2097. struct ipv6_mreq mreq6;
  2098. getaddrinfo(0,0,0,0);
  2099. getnameinfo(0,0,0,0,0,0,0);
  2100. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  2101. }
  2102. EOF
  2103. check_header linux/videodev.h
  2104. check_header linux/videodev2.h
  2105. check_header sys/videoio.h
  2106. check_func_headers "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  2107. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  2108. { check_header dev/bktr/ioctl_meteor.h &&
  2109. check_header dev/bktr/ioctl_bt848.h; } ||
  2110. { check_header machine/ioctl_meteor.h &&
  2111. check_header machine/ioctl_bt848.h; } ||
  2112. { check_header dev/video/meteor/ioctl_meteor.h &&
  2113. check_header dev/video/bktr/ioctl_bt848.h; } ||
  2114. check_header dev/ic/bt8xx.h
  2115. check_header sys/soundcard.h
  2116. check_header soundcard.h
  2117. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  2118. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack
  2119. enabled x11grab &&
  2120. check_header X11/Xlib.h &&
  2121. check_header X11/extensions/XShm.h &&
  2122. check_func XOpenDisplay -lX11 &&
  2123. check_func XShmCreateImage -lX11 -lXext
  2124. enabled debug && add_cflags -g"$debuglevel"
  2125. # add some useful compiler flags if supported
  2126. check_cflags -Wdeclaration-after-statement
  2127. check_cflags -Wall
  2128. check_cflags -Wno-switch
  2129. check_cflags -Wdisabled-optimization
  2130. check_cflags -Wpointer-arith
  2131. check_cflags -Wredundant-decls
  2132. check_cflags -Wno-pointer-sign
  2133. check_cflags -Wcast-qual
  2134. check_cflags -Wwrite-strings
  2135. check_cflags -Wtype-limits
  2136. check_cflags -Wundef
  2137. enabled extra_warnings && check_cflags -Winline
  2138. # add some linker flags
  2139. check_ldflags -Wl,--warn-common
  2140. check_ldflags -Wl,--as-needed
  2141. check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
  2142. check_ldflags -Wl,-Bsymbolic
  2143. if enabled small; then
  2144. check_cflags -Os # not all compilers support -Os
  2145. optimizations="small"
  2146. elif enabled optimizations; then
  2147. if enabled xlc; then
  2148. add_cflags -O5
  2149. add_ldflags -O5
  2150. elif enabled ccc; then
  2151. add_cflags -fast
  2152. else
  2153. add_cflags -O3
  2154. fi
  2155. fi
  2156. check_cflags -fno-math-errno
  2157. check_cflags -fno-signed-zeros
  2158. if enabled icc; then
  2159. # Just warnings, no remarks
  2160. check_cflags -w1
  2161. # -wd: Disable following warnings
  2162. # 144, 167, 556: -Wno-pointer-sign
  2163. # 10006: ignoring unknown option -fno-signed-zeros
  2164. # 10156: ignoring option '-W'; no argument required
  2165. check_cflags -wd144,167,556,10006,10156
  2166. # 11030: Warning unknown option --as-needed
  2167. # 10156: ignoring option '-export'; no argument required
  2168. check_ldflags -wd10156,11030
  2169. # Allow to compile with optimizations
  2170. check_ldflags -march=$cpu
  2171. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  2172. enable ebp_available
  2173. elif enabled ccc; then
  2174. # disable some annoying warnings
  2175. add_cflags -msg_disable cvtu32to64
  2176. add_cflags -msg_disable embedcomment
  2177. add_cflags -msg_disable needconstext
  2178. add_cflags -msg_disable nomainieee
  2179. add_cflags -msg_disable ptrmismatch1
  2180. add_cflags -msg_disable unreachcode
  2181. elif enabled gcc; then
  2182. check_cflags -fno-tree-vectorize
  2183. fi
  2184. enabled pic && LIBOBJFLAGS='$(PIC)'
  2185. if enabled gprof; then
  2186. add_cflags -p
  2187. add_ldflags -p
  2188. fi
  2189. # Find out if the .align argument is a power of two or not.
  2190. check_asm asmalign_pot '".align 3"'
  2191. enabled_any $DECODER_LIST && enable decoders
  2192. enabled_any $ENCODER_LIST && enable encoders
  2193. enabled_any $HWACCEL_LIST && enable hwaccels
  2194. enabled_any $BSF_LIST && enable bsfs
  2195. enabled_any $DEMUXER_LIST && enable demuxers
  2196. enabled_any $MUXER_LIST && enable muxers
  2197. enabled_any $FILTER_LIST && enable filters
  2198. enabled_any $INDEV_LIST && enable indevs
  2199. enabled_any $OUTDEV_LIST && enable outdevs
  2200. enabled_any $PROTOCOL_LIST && enable protocols
  2201. enabled_any $THREADS_LIST && enable threads
  2202. check_deps $CONFIG_LIST \
  2203. $CONFIG_EXTRA \
  2204. $HAVE_LIST \
  2205. $DECODER_LIST \
  2206. $ENCODER_LIST \
  2207. $HWACCEL_LIST \
  2208. $PARSER_LIST \
  2209. $BSF_LIST \
  2210. $DEMUXER_LIST \
  2211. $MUXER_LIST \
  2212. $FILTER_LIST \
  2213. $INDEV_LIST \
  2214. $OUTDEV_LIST \
  2215. $PROTOCOL_LIST \
  2216. echo "install prefix $prefix"
  2217. echo "source path $source_path"
  2218. echo "C compiler $cc"
  2219. echo ".align is power-of-two $asmalign_pot"
  2220. echo "ARCH $arch ($cpu)"
  2221. if test "$build_suffix" != ""; then
  2222. echo "build suffix $build_suffix"
  2223. fi
  2224. if test "$extra_version" != ""; then
  2225. echo "version string suffix $extra_version"
  2226. fi
  2227. echo "big-endian ${bigendian-no}"
  2228. echo "runtime cpu detection ${runtime_cpudetect-no}"
  2229. if enabled x86; then
  2230. echo "yasm ${yasm-no}"
  2231. echo "MMX enabled ${mmx-no}"
  2232. echo "MMX2 enabled ${mmx2-no}"
  2233. echo "3DNow! enabled ${amd3dnow-no}"
  2234. echo "3DNow! extended enabled ${amd3dnowext-no}"
  2235. echo "SSE enabled ${sse-no}"
  2236. echo "SSSE3 enabled ${ssse3-no}"
  2237. echo "CMOV enabled ${cmov-no}"
  2238. echo "CMOV is fast ${fast_cmov-no}"
  2239. echo "EBX available ${ebx_available-no}"
  2240. echo "EBP available ${ebp_available-no}"
  2241. echo "10 operands supported ${ten_operands-no}"
  2242. fi
  2243. if enabled arm; then
  2244. echo "ARMv5TE enabled ${armv5te-no}"
  2245. echo "ARMv6 enabled ${armv6-no}"
  2246. echo "ARMv6T2 enabled ${armv6t2-no}"
  2247. echo "ARM VFP enabled ${armvfp-no}"
  2248. echo "IWMMXT enabled ${iwmmxt-no}"
  2249. echo "NEON enabled ${neon-no}"
  2250. fi
  2251. if enabled mips; then
  2252. echo "MMI enabled ${mmi-no}"
  2253. fi
  2254. if enabled ppc; then
  2255. echo "AltiVec enabled ${altivec-no}"
  2256. echo "PPC 4xx optimizations ${ppc4xx-no}"
  2257. echo "dcbzl available ${dcbzl-no}"
  2258. echo "performance report ${powerpc_perf-no}"
  2259. fi
  2260. if enabled sparc; then
  2261. echo "VIS enabled ${vis-no}"
  2262. fi
  2263. echo "gprof enabled ${gprof-no}"
  2264. echo "debug symbols ${debug-no}"
  2265. echo "strip symbols ${stripping-no}"
  2266. echo "optimizations ${optimizations-no}"
  2267. echo "static ${static-no}"
  2268. echo "shared ${shared-no}"
  2269. echo "postprocessing support ${postproc-no}"
  2270. echo "new filter support ${avfilter-no}"
  2271. echo "filters using lavformat ${avfilter_lavf-no}"
  2272. echo "network support ${network-no}"
  2273. if enabled network; then
  2274. echo "IPv6 support ${ipv6-no}"
  2275. fi
  2276. echo "threading support ${thread_type-no}"
  2277. echo "SDL support ${sdl-no}"
  2278. if enabled sdl_too_old; then
  2279. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  2280. fi
  2281. echo "Sun medialib support ${mlib-no}"
  2282. echo "AVISynth enabled ${avisynth-no}"
  2283. echo "libdc1394 support ${libdc1394-no}"
  2284. echo "libdirac enabled ${libdirac-no}"
  2285. echo "libfaac enabled ${libfaac-no}"
  2286. echo "libfaad enabled ${libfaad-no}"
  2287. echo "libfaad dlopened ${libfaadbin-no}"
  2288. echo "libgsm enabled ${libgsm-no}"
  2289. echo "libmp3lame enabled ${libmp3lame-no}"
  2290. echo "libnut enabled ${libnut-no}"
  2291. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  2292. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  2293. echo "libopenjpeg enabled ${libopenjpeg-no}"
  2294. echo "libschroedinger enabled ${libschroedinger-no}"
  2295. echo "libspeex enabled ${libspeex-no}"
  2296. echo "libtheora enabled ${libtheora-no}"
  2297. echo "libvorbis enabled ${libvorbis-no}"
  2298. echo "libx264 enabled ${libx264-no}"
  2299. echo "libxvid enabled ${libxvid-no}"
  2300. echo "zlib enabled ${zlib-no}"
  2301. echo "bzlib enabled ${bzlib-no}"
  2302. echo
  2303. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  2304. echo "Enabled ${type}s:"
  2305. eval list=\$$(toupper $type)_LIST
  2306. for part in $list; do
  2307. enabled $part && echo ${part%_*}
  2308. done | sort | pr -3 -t
  2309. echo
  2310. done
  2311. license="LGPL version 2.1 or later"
  2312. if enabled nonfree; then
  2313. license="nonfree and unredistributable"
  2314. elif enabled gplv3; then
  2315. license="GPL version 3 or later"
  2316. elif enabled lgplv3; then
  2317. license="LGPL version 3 or later"
  2318. elif enabled gpl; then
  2319. license="GPL version 2 or later"
  2320. fi
  2321. echo "License: $license"
  2322. echo "Creating config.mak and config.h..."
  2323. echo "# Automatically generated by configure - do not modify!" > config.mak
  2324. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  2325. echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
  2326. echo "#define FFMPEG_CONFIG_H" >> $TMPH
  2327. echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH
  2328. echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH
  2329. echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak
  2330. echo "FFMPEG_CONFIG_MAK=1" >> config.mak
  2331. echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
  2332. echo "prefix=$prefix" >> config.mak
  2333. echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
  2334. echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
  2335. echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
  2336. echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
  2337. echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak
  2338. echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
  2339. echo "SRC_PATH=\"$source_path\"" >> config.mak
  2340. echo "SRC_PATH_BARE=$source_path" >> config.mak
  2341. echo "BUILD_ROOT=\"$PWD\"" >> config.mak
  2342. echo "CC=$cc" >> config.mak
  2343. echo "AS=$as" >> config.mak
  2344. echo "LD=$ld" >> config.mak
  2345. echo "DEPCC=$dep_cc" >> config.mak
  2346. echo "YASM=$yasmexe" >> config.mak
  2347. echo "AR=$ar" >> config.mak
  2348. echo "RANLIB=$ranlib" >> config.mak
  2349. echo "LN_S=$ln_s" >> config.mak
  2350. enabled stripping &&
  2351. echo "STRIP=$strip" >> config.mak ||
  2352. echo "STRIP=echo ignoring strip" >> config.mak
  2353. echo "CPPFLAGS=$CPPFLAGS" >> config.mak
  2354. echo "CFLAGS=$CFLAGS" >> config.mak
  2355. echo "ASFLAGS=$ASFLAGS" >> config.mak
  2356. echo "CC_O=$CC_O" >> config.mak
  2357. echo "LDFLAGS=$LDFLAGS" >> config.mak
  2358. echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
  2359. echo "SHFLAGS=$SHFLAGS" >> config.mak
  2360. echo "YASMFLAGS=$YASMFLAGS" >> config.mak
  2361. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  2362. echo "PIC=-fPIC -DPIC" >> config.mak
  2363. echo "BUILDSUF=$build_suffix" >> config.mak
  2364. echo "FULLNAME=$FULLNAME" >> config.mak
  2365. echo "LIBPREF=$LIBPREF" >> config.mak
  2366. echo "LIBSUF=$LIBSUF" >> config.mak
  2367. echo "LIBNAME=$LIBNAME" >> config.mak
  2368. echo "SLIBPREF=$SLIBPREF" >> config.mak
  2369. echo "SLIBSUF=$SLIBSUF" >> config.mak
  2370. echo "EXESUF=$EXESUF" >> config.mak
  2371. echo "EXTRA_VERSION=$extra_version" >> config.mak
  2372. echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
  2373. echo "DEPFLAGS=$DEPFLAGS" >> config.mak
  2374. echo "HOSTCC=$host_cc" >> config.mak
  2375. echo "HOSTCFLAGS=$host_cflags" >> config.mak
  2376. echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak
  2377. echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
  2378. echo "HOSTLIBS=$host_libs" >> config.mak
  2379. echo "TARGET_EXEC=$target_exec" >> config.mak
  2380. echo "TARGET_PATH=$target_path" >> config.mak
  2381. if enabled sdl; then
  2382. echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
  2383. echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak
  2384. fi
  2385. if enabled texi2html; then
  2386. echo "BUILD_DOC=yes" >> config.mak
  2387. fi
  2388. get_version(){
  2389. name=$1
  2390. file=$source_path/$2
  2391. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  2392. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  2393. lcname=$(tolower $name)
  2394. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  2395. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  2396. }
  2397. get_version LIBSWSCALE libswscale/swscale.h
  2398. get_version LIBPOSTPROC libpostproc/postprocess.h
  2399. get_version LIBAVCODEC libavcodec/avcodec.h
  2400. get_version LIBAVDEVICE libavdevice/avdevice.h
  2401. get_version LIBAVFORMAT libavformat/avformat.h
  2402. get_version LIBAVUTIL libavutil/avutil.h
  2403. get_version LIBAVFILTER libavfilter/avfilter.h
  2404. if enabled shared; then
  2405. echo "LIBTARGET=${LIBTARGET}" >> config.mak
  2406. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  2407. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  2408. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  2409. echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
  2410. echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
  2411. echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
  2412. echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
  2413. fi
  2414. echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
  2415. echo "EXTRALIBS=$extralibs" >> config.mak
  2416. echo "ARCH=$arch" >> config.mak
  2417. print_config ARCH_ $TMPH config.mak $ARCH_LIST
  2418. print_config HAVE_ $TMPH config.mak $HAVE_LIST
  2419. print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
  2420. $CONFIG_EXTRA \
  2421. $DECODER_LIST \
  2422. $ENCODER_LIST \
  2423. $HWACCEL_LIST \
  2424. $PARSER_LIST \
  2425. $BSF_LIST \
  2426. $DEMUXER_LIST \
  2427. $MUXER_LIST \
  2428. $FILTER_LIST \
  2429. $PROTOCOL_LIST \
  2430. $INDEV_LIST \
  2431. $OUTDEV_LIST \
  2432. echo "#define restrict $_restrict" >> $TMPH
  2433. if enabled small || disabled optimizations; then
  2434. echo "#define av_always_inline" >> $TMPH
  2435. fi
  2436. # Apparently it's not possible to portably echo a backslash.
  2437. enabled asmalign_pot &&
  2438. printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
  2439. printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH
  2440. echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
  2441. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  2442. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  2443. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  2444. cmp -s $TMPH config.h &&
  2445. echo "config.h is unchanged" ||
  2446. mv -f $TMPH config.h
  2447. # build tree in object directory if source path is different from current one
  2448. if enabled source_path_used; then
  2449. DIRS="\
  2450. doc \
  2451. libavcodec \
  2452. libavcodec/alpha \
  2453. libavcodec/arm \
  2454. libavcodec/bfin \
  2455. libavcodec/mlib \
  2456. libavcodec/ppc \
  2457. libavcodec/sh4 \
  2458. libavcodec/sparc \
  2459. libavcodec/x86 \
  2460. libavdevice \
  2461. libavfilter \
  2462. libavformat \
  2463. libavutil \
  2464. libpostproc \
  2465. libswscale \
  2466. libswscale/bfin \
  2467. libswscale/mlib \
  2468. libswscale/ppc \
  2469. libswscale/sparc \
  2470. libswscale/x86 \
  2471. tests \
  2472. tools \
  2473. "
  2474. FILES="\
  2475. Makefile \
  2476. common.mak \
  2477. subdir.mak \
  2478. doc/texi2pod.pl \
  2479. libavcodec/Makefile \
  2480. libavdevice/Makefile \
  2481. libavfilter/Makefile \
  2482. libavformat/Makefile \
  2483. libavutil/Makefile \
  2484. libpostproc/Makefile \
  2485. libswscale/Makefile \
  2486. "
  2487. for dir in $DIRS ; do
  2488. mkdir -p $dir
  2489. done
  2490. for f in $FILES ; do
  2491. $ln_s "$source_path/$f" $f
  2492. done
  2493. fi
  2494. # build pkg-config files
  2495. pkgconfig_generate(){
  2496. name=$1
  2497. shortname=${name#lib}${build_suffix}
  2498. comment=$2
  2499. version=$3
  2500. libs=$4
  2501. requires=$5
  2502. cat <<EOF > $name/$name.pc
  2503. prefix=$prefix
  2504. exec_prefix=\${prefix}
  2505. libdir=$libdir
  2506. includedir=$incdir
  2507. Name: $name
  2508. Description: $comment
  2509. Version: $version
  2510. Requires: $(disabled shared && echo $requires)
  2511. Requires.private: $(enabled shared && echo $requires)
  2512. Conflicts:
  2513. Libs: -L\${libdir} -l${shortname} $(disabled shared && echo $libs)
  2514. Libs.private: $(enabled shared && echo $libs)
  2515. Cflags: -I\${includedir}
  2516. EOF
  2517. cat <<EOF > $name/$name-uninstalled.pc
  2518. prefix=
  2519. exec_prefix=
  2520. libdir=\${pcfiledir}
  2521. includedir=${source_path}
  2522. Name: $name
  2523. Description: $comment
  2524. Version: $version
  2525. Requires: $requires
  2526. Conflicts:
  2527. Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
  2528. Cflags: -I\${includedir}
  2529. EOF
  2530. }
  2531. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
  2532. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  2533. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  2534. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
  2535. enabled avfilter &&
  2536. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  2537. enabled postproc &&
  2538. pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
  2539. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"