configure 129 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272
  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. cat <<EOF
  52. Usage: configure [options]
  53. Options: [defaults in brackets after descriptions]
  54. Help options:
  55. --help print this message
  56. --list-decoders show all available decoders
  57. --list-encoders show all available encoders
  58. --list-hwaccels show all available hardware accelerators
  59. --list-demuxers show all available demuxers
  60. --list-muxers show all available muxers
  61. --list-parsers show all available parsers
  62. --list-protocols show all available protocols
  63. --list-bsfs show all available bitstream filters
  64. --list-indevs show all available input devices
  65. --list-outdevs show all available output devices
  66. --list-filters show all available filters
  67. Standard options:
  68. --logfile=FILE log tests and output to FILE [config.log]
  69. --disable-logging do not log configure debug information
  70. --prefix=PREFIX install in PREFIX [$prefix]
  71. --bindir=DIR install binaries in DIR [PREFIX/bin]
  72. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  73. --libdir=DIR install libs in DIR [PREFIX/lib]
  74. --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
  75. --incdir=DIR install includes in DIR [PREFIX/include]
  76. --mandir=DIR install man page in DIR [PREFIX/share/man]
  77. Licensing options:
  78. --enable-gpl allow use of GPL code, the resulting libs
  79. and binaries will be under GPL [no]
  80. --enable-version3 upgrade (L)GPL to version 3 [no]
  81. --enable-nonfree allow use of nonfree code, the resulting libs
  82. and binaries will be unredistributable [no]
  83. Configuration options:
  84. --disable-static do not build static libraries [no]
  85. --enable-shared build shared libraries [no]
  86. --enable-small optimize for size instead of speed
  87. --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
  88. --enable-gray enable full grayscale support (slower color)
  89. --disable-swscale-alpha disable alpha channel support in swscale
  90. Documentation options:
  91. --disable-doc do not build documentation
  92. --disable-htmlpages do not build HTML documentation pages
  93. --disable-manpages do not build man documentation pages
  94. --disable-podpages do not build POD documentation pages
  95. --disable-txtpages do not build text documentation pages
  96. Component options:
  97. --disable-ffmpeg disable ffmpeg build
  98. --disable-ffplay disable ffplay build
  99. --disable-ffprobe disable ffprobe build
  100. --disable-ffserver disable ffserver build
  101. --disable-avdevice disable libavdevice build
  102. --disable-avcodec disable libavcodec build
  103. --disable-avformat disable libavformat build
  104. --disable-swresample disable libswresample build
  105. --disable-swscale disable libswscale build
  106. --disable-postproc disable libpostproc build
  107. --disable-avfilter disable libavfilter build
  108. --enable-avresample enable libavresample build [no]
  109. --disable-pthreads disable pthreads [auto]
  110. --disable-w32threads disable Win32 threads [auto]
  111. --disable-os2threads disable OS/2 threads [auto]
  112. --enable-x11grab enable X11 grabbing [no]
  113. --disable-network disable network support [no]
  114. --disable-dct disable DCT code
  115. --disable-dwt disable DWT code
  116. --disable-lsp disable LSP code
  117. --disable-mdct disable MDCT code
  118. --disable-rdft disable RDFT code
  119. --disable-fft disable FFT code
  120. --enable-dxva2 enable DXVA2 code
  121. --enable-vaapi enable VAAPI code [autodetect]
  122. --enable-vda enable VDA code [autodetect]
  123. --enable-vdpau enable VDPAU code [autodetect]
  124. Individual component options:
  125. --disable-everything disable all components listed below
  126. --disable-encoder=NAME disable encoder NAME
  127. --enable-encoder=NAME enable encoder NAME
  128. --disable-encoders disable all encoders
  129. --disable-decoder=NAME disable decoder NAME
  130. --enable-decoder=NAME enable decoder NAME
  131. --disable-decoders disable all decoders
  132. --disable-hwaccel=NAME disable hwaccel NAME
  133. --enable-hwaccel=NAME enable hwaccel NAME
  134. --disable-hwaccels disable all hwaccels
  135. --disable-muxer=NAME disable muxer NAME
  136. --enable-muxer=NAME enable muxer NAME
  137. --disable-muxers disable all muxers
  138. --disable-demuxer=NAME disable demuxer NAME
  139. --enable-demuxer=NAME enable demuxer NAME
  140. --disable-demuxers disable all demuxers
  141. --enable-parser=NAME enable parser NAME
  142. --disable-parser=NAME disable parser NAME
  143. --disable-parsers disable all parsers
  144. --enable-bsf=NAME enable bitstream filter NAME
  145. --disable-bsf=NAME disable bitstream filter NAME
  146. --disable-bsfs disable all bitstream filters
  147. --enable-protocol=NAME enable protocol NAME
  148. --disable-protocol=NAME disable protocol NAME
  149. --disable-protocols disable all protocols
  150. --enable-indev=NAME enable input device NAME
  151. --disable-indev=NAME disable input device NAME
  152. --disable-indevs disable input devices
  153. --enable-outdev=NAME enable output device NAME
  154. --disable-outdev=NAME disable output device NAME
  155. --disable-outdevs disable output devices
  156. --disable-devices disable all devices
  157. --enable-filter=NAME enable filter NAME
  158. --disable-filter=NAME disable filter NAME
  159. --disable-filters disable all filters
  160. External library support:
  161. --enable-avisynth enable reading of AVISynth script files [no]
  162. --enable-bzlib enable bzlib [autodetect]
  163. --enable-fontconfig enable fontconfig
  164. --enable-frei0r enable frei0r video filtering
  165. --enable-gnutls enable gnutls [no]
  166. --enable-libaacplus enable AAC+ encoding via libaacplus [no]
  167. --enable-libass enable libass subtitles rendering [no]
  168. --enable-libbluray enable BluRay reading using libbluray [no]
  169. --enable-libcaca enable textual display using libcaca
  170. --enable-libcelt enable CELT decoding via libcelt [no]
  171. --enable-libcdio enable audio CD grabbing with libcdio
  172. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  173. and libraw1394 [no]
  174. --enable-libfaac enable AAC encoding via libfaac [no]
  175. --enable-libfdk-aac enable AAC encoding via libfdk-aac [no]
  176. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  177. --enable-libfreetype enable libfreetype [no]
  178. --enable-libgsm enable GSM de/encoding via libgsm [no]
  179. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  180. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  181. --enable-libmodplug enable ModPlug via libmodplug [no]
  182. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  183. --enable-libnut enable NUT (de)muxing via libnut,
  184. native (de)muxer exists [no]
  185. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  186. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  187. --enable-libopencv enable video filtering via libopencv [no]
  188. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  189. --enable-libopus enable Opus decoding via libopus [no]
  190. --enable-libpulse enable Pulseaudio input via libpulse [no]
  191. --enable-librtmp enable RTMP[E] support via librtmp [no]
  192. --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
  193. --enable-libspeex enable Speex de/encoding via libspeex [no]
  194. --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
  195. --enable-libtheora enable Theora encoding via libtheora [no]
  196. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  197. --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
  198. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  199. --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
  200. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  201. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  202. native implementation exists [no]
  203. --enable-libvpx enable VP8 de/encoding via libvpx [no]
  204. --enable-libx264 enable H.264 encoding via x264 [no]
  205. --enable-libxavs enable AVS encoding via xavs [no]
  206. --enable-libxvid enable Xvid encoding via xvidcore,
  207. native MPEG-4/Xvid encoder exists [no]
  208. --enable-openal enable OpenAL 1.1 capture support [no]
  209. --enable-openssl enable openssl [no]
  210. --enable-zlib enable zlib [autodetect]
  211. Advanced options (experts only):
  212. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  213. --enable-cross-compile assume a cross-compiler is used
  214. --sysroot=PATH root of cross-build tree
  215. --sysinclude=PATH location of cross-build system headers
  216. --target-os=OS compiler targets OS [$target_os]
  217. --target-exec=CMD command to run executables on target
  218. --target-path=DIR path to view of build directory on target
  219. --nm=NM use nm tool NM [$nm_default]
  220. --ar=AR use archive tool AR [$ar_default]
  221. --as=AS use assembler AS [$as_default]
  222. --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
  223. --cc=CC use C compiler CC [$cc_default]
  224. --cxx=CXX use C compiler CXX [$cxx_default]
  225. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  226. --ld=LD use linker LD [$ld_default]
  227. --host-cc=HOSTCC use host C compiler HOSTCC
  228. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  229. --host-ld=HOSTLD use host linker HOSTLD
  230. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  231. --host-libs=HLIBS use libs HLIBS when linking for host
  232. --host-os=OS compiler host OS [$target_os]
  233. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  234. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  235. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  236. --extra-libs=ELIBS add ELIBS [$ELIBS]
  237. --extra-version=STRING version string suffix []
  238. --optflags=OPTFLAGS override optimization-related compiler flags
  239. --build-suffix=SUFFIX library name suffix []
  240. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  241. --progs-suffix=SUFFIX program name suffix []
  242. --arch=ARCH select architecture [$arch]
  243. --cpu=CPU select the minimum required CPU (affects
  244. instruction selection, may crash on older CPUs)
  245. --enable-pic build position-independent code
  246. --enable-sram allow use of on-chip SRAM
  247. --enable-thumb compile for Thumb instruction set
  248. --disable-symver disable symbol versioning
  249. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  250. --disable-safe-bitstream-reader
  251. disable buffer boundary checking in bitreaders
  252. (faster, but may crash)
  253. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  254. Optimization options (experts only):
  255. --disable-asm disable all assembler optimizations
  256. --disable-altivec disable AltiVec optimizations
  257. --disable-amd3dnow disable 3DNow! optimizations
  258. --disable-amd3dnowext disable 3DNow! extended optimizations
  259. --disable-mmx disable MMX optimizations
  260. --disable-mmxext disable MMXEXT optimizations
  261. --disable-sse disable SSE optimizations
  262. --disable-sse2 disable SSE2 optimizations
  263. --disable-sse3 disable SSE3 optimizations
  264. --disable-ssse3 disable SSSE3 optimizations
  265. --disable-sse4 disable SSE4 optimizations
  266. --disable-sse42 disable SSE4.2 optimizations
  267. --disable-avx disable AVX optimizations
  268. --disable-fma4 disable FMA4 optimizations
  269. --disable-armv5te disable armv5te optimizations
  270. --disable-armv6 disable armv6 optimizations
  271. --disable-armv6t2 disable armv6t2 optimizations
  272. --disable-armvfp disable ARM VFP optimizations
  273. --disable-mmi disable MMI optimizations
  274. --disable-neon disable NEON optimizations
  275. --disable-vis disable VIS optimizations
  276. --disable-yasm disable use of yasm assembler
  277. --disable-mips32r2 disable MIPS32R2 optimizations
  278. --disable-mipsdspr1 disable MIPS DSP ASE R1 optimizations
  279. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  280. --disable-mipsfpu disable floating point MIPS optimizations
  281. --disable-fast-unaligned consider unaligned accesses slow
  282. --postproc-version=V build libpostproc version V.
  283. Where V can be '$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO' or 'current'. [$postproc_version_default]
  284. Developer options (useful when working on FFmpeg itself):
  285. --enable-coverage build with test coverage instrumentation
  286. --disable-debug disable debugging symbols
  287. --enable-debug=LEVEL set the debug level [$debuglevel]
  288. --disable-optimizations disable compiler optimizations
  289. --enable-extra-warnings enable more compiler warnings
  290. --disable-stripping disable stripping of executables and shared libraries
  291. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  292. 2 causes a slowdown at runtime.
  293. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  294. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  295. leaks and errors, using the specified valgrind binary.
  296. Cannot be combined with --target-exec
  297. --samples=PATH location of test samples for FATE, if not set use
  298. \$FATE_SAMPLES at make invocation time.
  299. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  300. should be used only for debugging purposes)
  301. --enable-random randomly enable/disable components
  302. --disable-random
  303. --enable-random=LIST randomly enable/disable specific components or
  304. --disable-random=LIST component groups. LIST is a comma-separated list
  305. of NAME[:PROB] entries where NAME is a component
  306. (group) and PROB the probability associated with
  307. NAME (default 0.5).
  308. --random-seed=VALUE seed value for --enable/disable-random
  309. NOTE: Object files are built at the place where configure is launched.
  310. EOF
  311. exit 0
  312. }
  313. quotes='""'
  314. log(){
  315. echo "$@" >> $logfile
  316. }
  317. log_file(){
  318. log BEGIN $1
  319. pr -n -t $1 >> $logfile
  320. log END $1
  321. }
  322. echolog(){
  323. log "$@"
  324. echo "$@"
  325. }
  326. warn(){
  327. log "WARNING: $*"
  328. WARNINGS="${WARNINGS}WARNING: $*\n"
  329. }
  330. die(){
  331. echolog "$@"
  332. cat <<EOF
  333. If you think configure made a mistake, make sure you are using the latest
  334. version from Git. If the latest version fails, report the problem to the
  335. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  336. EOF
  337. if disabled logging; then
  338. cat <<EOF
  339. Rerun configure with logging enabled (do not use --disable-logging), and
  340. include the log this produces with your report.
  341. EOF
  342. else
  343. cat <<EOF
  344. Include the log file "$logfile" produced by configure as this will help
  345. solving the problem.
  346. EOF
  347. fi
  348. exit 1
  349. }
  350. # Avoid locale weirdness, besides we really just want to translate ASCII.
  351. toupper(){
  352. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  353. }
  354. tolower(){
  355. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  356. }
  357. c_escape(){
  358. echo "$*" | sed 's/["\\]/\\\0/g'
  359. }
  360. sh_quote(){
  361. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  362. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  363. echo "$v"
  364. }
  365. cleanws(){
  366. echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
  367. }
  368. filter(){
  369. pat=$1
  370. shift
  371. for v; do
  372. eval "case $v in $pat) echo $v ;; esac"
  373. done
  374. }
  375. filter_out(){
  376. pat=$1
  377. shift
  378. for v; do
  379. eval "case $v in $pat) ;; *) echo $v ;; esac"
  380. done
  381. }
  382. map(){
  383. m=$1
  384. shift
  385. for v; do eval $m; done
  386. }
  387. set_all(){
  388. value=$1
  389. shift
  390. for var in $*; do
  391. eval $var=$value
  392. done
  393. }
  394. set_weak(){
  395. value=$1
  396. shift
  397. for var; do
  398. eval : \${$var:=$value}
  399. done
  400. }
  401. set_safe(){
  402. var=$1
  403. shift
  404. eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
  405. }
  406. get_safe(){
  407. eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
  408. }
  409. pushvar(){
  410. for var in $*; do
  411. eval level=\${${var}_level:=0}
  412. eval ${var}_${level}="\$$var"
  413. eval ${var}_level=$(($level+1))
  414. done
  415. }
  416. popvar(){
  417. for var in $*; do
  418. eval level=\${${var}_level:-0}
  419. test $level = 0 && continue
  420. eval level=$(($level-1))
  421. eval $var="\${${var}_${level}}"
  422. eval ${var}_level=$level
  423. eval unset ${var}_${level}
  424. done
  425. }
  426. enable(){
  427. set_all yes $*
  428. }
  429. disable(){
  430. set_all no $*
  431. }
  432. enable_weak(){
  433. set_weak yes $*
  434. }
  435. disable_weak(){
  436. set_weak no $*
  437. }
  438. enable_safe(){
  439. for var; do
  440. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  441. done
  442. }
  443. disable_safe(){
  444. for var; do
  445. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  446. done
  447. }
  448. do_enable_deep(){
  449. for var; do
  450. enabled $var && continue
  451. eval sel="\$${var}_select"
  452. eval sgs="\$${var}_suggest"
  453. pushvar var sgs
  454. enable_deep $sel
  455. popvar sgs
  456. enable_deep_weak $sgs
  457. popvar var
  458. done
  459. }
  460. enable_deep(){
  461. do_enable_deep $*
  462. enable $*
  463. }
  464. enable_deep_weak(){
  465. do_enable_deep $*
  466. enable_weak $*
  467. }
  468. enabled(){
  469. test "${1#!}" = "$1" && op== || op=!=
  470. eval test "x\$${1#!}" $op "xyes"
  471. }
  472. disabled(){
  473. test "${1#!}" = "$1" && op== || op=!=
  474. eval test "x\$${1#!}" $op "xno"
  475. }
  476. enabled_all(){
  477. for opt; do
  478. enabled $opt || return 1
  479. done
  480. }
  481. disabled_all(){
  482. for opt; do
  483. disabled $opt || return 1
  484. done
  485. }
  486. enabled_any(){
  487. for opt; do
  488. enabled $opt && return 0
  489. done
  490. }
  491. disabled_any(){
  492. for opt; do
  493. disabled $opt && return 0
  494. done
  495. return 1
  496. }
  497. set_default(){
  498. for opt; do
  499. eval : \${$opt:=\$${opt}_default}
  500. done
  501. }
  502. is_in(){
  503. value=$1
  504. shift
  505. for var in $*; do
  506. [ $var = $value ] && return 0
  507. done
  508. return 1
  509. }
  510. check_deps(){
  511. for cfg; do
  512. cfg="${cfg#!}"
  513. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  514. disabled ${cfg}_checking && continue
  515. enable ${cfg}_checking
  516. eval dep_all="\$${cfg}_deps"
  517. eval dep_any="\$${cfg}_deps_any"
  518. eval dep_sel="\$${cfg}_select"
  519. eval dep_sgs="\$${cfg}_suggest"
  520. eval dep_ifa="\$${cfg}_if"
  521. eval dep_ifn="\$${cfg}_if_any"
  522. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  523. check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  524. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  525. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  526. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  527. enabled_all $dep_all || disable $cfg
  528. enabled_any $dep_any || disable $cfg
  529. disabled_any $dep_sel && disable $cfg
  530. if enabled $cfg; then
  531. eval dep_extralibs="\$${cfg}_extralibs"
  532. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  533. enable_deep $dep_sel
  534. enable_deep_weak $dep_sgs
  535. fi
  536. disable ${cfg}_checking
  537. done
  538. }
  539. print_config_h(){
  540. enabled $1 && v=1 || v=0
  541. echo "#define $2 $v"
  542. }
  543. print_config_mak(){
  544. enabled $1 && v= || v=!
  545. echo "$v$2=yes"
  546. }
  547. print_config_asm(){
  548. enabled $1 && v=1 || v=0
  549. echo "%define $2 $v"
  550. }
  551. print_config(){
  552. pfx=$1
  553. files=$2
  554. shift 2
  555. for cfg; do
  556. ucname="$(toupper $cfg)"
  557. for f in $files; do
  558. "print_config_${f##*.}" $cfg ${pfx}${ucname} >>$f
  559. done
  560. done
  561. }
  562. print_enabled(){
  563. test "$1" = -n && end=" " && shift || end="\n"
  564. suf=$1
  565. shift
  566. for v; do
  567. enabled $v && printf "%s$end" ${v%$suf};
  568. done
  569. }
  570. append(){
  571. var=$1
  572. shift
  573. eval "$var=\"\$$var $*\""
  574. }
  575. prepend(){
  576. var=$1
  577. shift
  578. eval "$var=\"$* \$$var\""
  579. }
  580. add_cppflags(){
  581. append CPPFLAGS "$@"
  582. }
  583. add_cflags(){
  584. append CFLAGS $($cflags_filter "$@")
  585. }
  586. add_cxxflags(){
  587. append CXXFLAGS $($cflags_filter "$@")
  588. }
  589. add_asflags(){
  590. append ASFLAGS $($asflags_filter "$@")
  591. }
  592. add_ldflags(){
  593. append LDFLAGS $($ldflags_filter "$@")
  594. }
  595. add_extralibs(){
  596. prepend extralibs $($ldflags_filter "$@")
  597. }
  598. add_host_cflags(){
  599. append host_cflags $($host_cflags_filter "$@")
  600. }
  601. add_host_ldflags(){
  602. append host_ldflags $($host_ldflags_filter "$@")
  603. }
  604. check_cmd(){
  605. log "$@"
  606. "$@" >> $logfile 2>&1
  607. }
  608. cc_o(){
  609. eval printf '%s\\n' $CC_O
  610. }
  611. cc_e(){
  612. eval printf '%s\\n' $CC_E
  613. }
  614. check_cc(){
  615. log check_cc "$@"
  616. cat > $TMPC
  617. log_file $TMPC
  618. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  619. }
  620. check_cxx(){
  621. log check_cxx "$@"
  622. cat > $TMPCPP
  623. log_file $TMPCPP
  624. check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  625. }
  626. check_cpp(){
  627. log check_cpp "$@"
  628. cat > $TMPC
  629. log_file $TMPC
  630. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  631. }
  632. as_o(){
  633. eval printf '%s\\n' $AS_O
  634. }
  635. check_as(){
  636. log check_as "$@"
  637. cat > $TMPC
  638. log_file $TMPC
  639. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPC
  640. }
  641. check_inline_asm(){
  642. log check_inline_asm "$@"
  643. name="$1"
  644. code="$2"
  645. shift 2
  646. disable $name
  647. check_as "$@" <<EOF && enable $name
  648. void foo(void){ __asm__ volatile($code); }
  649. EOF
  650. }
  651. check_yasm(){
  652. log check_yasm "$@"
  653. echo "$1" > $TMPS
  654. log_file $TMPS
  655. shift 1
  656. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  657. }
  658. ld_o(){
  659. eval printf '%s\\n' $LD_O
  660. }
  661. check_ld(){
  662. log check_ld "$@"
  663. type=$1
  664. shift 1
  665. flags=''
  666. libs=''
  667. for f; do
  668. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  669. done
  670. check_$type $($cflags_filter $flags) || return
  671. flags=$($ldflags_filter $flags)
  672. libs=$($ldflags_filter $libs)
  673. check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  674. }
  675. check_code(){
  676. log check_code "$@"
  677. check=$1
  678. headers=$2
  679. code=$3
  680. shift 3
  681. {
  682. for hdr in $headers; do
  683. echo "#include <$hdr>"
  684. done
  685. echo "int main(void) { $code; return 0; }"
  686. } | check_$check "$@"
  687. }
  688. check_cppflags(){
  689. log check_cppflags "$@"
  690. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  691. int x;
  692. EOF
  693. }
  694. check_cflags(){
  695. log check_cflags "$@"
  696. set -- $($cflags_filter "$@")
  697. check_cc "$@" <<EOF && append CFLAGS "$@"
  698. int x;
  699. EOF
  700. }
  701. check_cxxflags(){
  702. log check_cxxflags "$@"
  703. set -- $($cflags_filter "$@")
  704. check_cxx "$@" <<EOF && append CXXFLAGS "$@"
  705. int x;
  706. EOF
  707. }
  708. test_ldflags(){
  709. log test_ldflags "$@"
  710. check_ld "cc" "$@" <<EOF
  711. int main(void){ return 0; }
  712. EOF
  713. }
  714. check_ldflags(){
  715. log check_ldflags "$@"
  716. test_ldflags "$@" && add_ldflags "$@"
  717. }
  718. check_header(){
  719. log check_header "$@"
  720. header=$1
  721. shift
  722. disable_safe $header
  723. check_cpp "$@" <<EOF && enable_safe $header
  724. #include <$header>
  725. int x;
  726. EOF
  727. }
  728. check_func(){
  729. log check_func "$@"
  730. func=$1
  731. shift
  732. disable $func
  733. check_ld "cc" "$@" <<EOF && enable $func
  734. extern int $func();
  735. int main(void){ $func(); }
  736. EOF
  737. }
  738. check_mathfunc(){
  739. log check_mathfunc "$@"
  740. func=$1
  741. shift
  742. disable $func
  743. check_ld "cc" "$@" <<EOF && enable $func
  744. #include <math.h>
  745. float foo(float f) { return $func(f); }
  746. int main(void){ return (int) foo; }
  747. EOF
  748. }
  749. check_func_headers(){
  750. log check_func_headers "$@"
  751. headers=$1
  752. funcs=$2
  753. shift 2
  754. {
  755. for hdr in $headers; do
  756. echo "#include <$hdr>"
  757. done
  758. for func in $funcs; do
  759. echo "long check_$func(void) { return (long) $func; }"
  760. done
  761. echo "int main(void) { return 0; }"
  762. } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
  763. }
  764. check_class_headers_cpp(){
  765. log check_class_headers_cpp "$@"
  766. headers=$1
  767. classes=$2
  768. shift 2
  769. {
  770. for hdr in $headers; do
  771. echo "#include <$hdr>"
  772. done
  773. echo "int main(void) { "
  774. i=1
  775. for class in $classes; do
  776. echo "$class obj$i;"
  777. i=$(expr $i + 1)
  778. done
  779. echo "return 0; }"
  780. } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers
  781. }
  782. check_cpp_condition(){
  783. log check_cpp_condition "$@"
  784. header=$1
  785. condition=$2
  786. shift 2
  787. check_cpp "$@" <<EOF
  788. #include <$header>
  789. #if !($condition)
  790. #error "unsatisfied condition: $condition"
  791. #endif
  792. EOF
  793. }
  794. check_lib(){
  795. log check_lib "$@"
  796. header="$1"
  797. func="$2"
  798. shift 2
  799. check_header $header && check_func $func "$@" && add_extralibs "$@"
  800. }
  801. check_lib2(){
  802. log check_lib2 "$@"
  803. headers="$1"
  804. funcs="$2"
  805. shift 2
  806. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  807. }
  808. check_lib_cpp(){
  809. log check_lib_cpp "$@"
  810. headers="$1"
  811. classes="$2"
  812. shift 2
  813. check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@"
  814. }
  815. check_pkg_config(){
  816. log check_pkg_config "$@"
  817. pkg="$1"
  818. headers="$2"
  819. funcs="$3"
  820. shift 3
  821. $pkg_config --exists $pkg 2>/dev/null || return
  822. pkg_cflags=$($pkg_config --cflags $pkg)
  823. pkg_libs=$($pkg_config --libs $pkg)
  824. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  825. set_safe ${pkg}_cflags $pkg_cflags &&
  826. set_safe ${pkg}_libs $pkg_libs
  827. }
  828. check_exec(){
  829. check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  830. }
  831. check_exec_crash(){
  832. code=$(cat)
  833. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  834. # are safe but may not be available everywhere. Thus we use
  835. # raise(SIGTERM) instead. The check is run in a subshell so we
  836. # can redirect the "Terminated" message from the shell. SIGBUS
  837. # is not defined by standard C so it is used conditionally.
  838. (check_exec "$@") >> $logfile 2>&1 <<EOF
  839. #include <signal.h>
  840. static void sighandler(int sig){
  841. raise(SIGTERM);
  842. }
  843. int func(void){
  844. $code
  845. }
  846. int (*func_ptr)(void) = func;
  847. int main(void){
  848. signal(SIGILL, sighandler);
  849. signal(SIGFPE, sighandler);
  850. signal(SIGSEGV, sighandler);
  851. #ifdef SIGBUS
  852. signal(SIGBUS, sighandler);
  853. #endif
  854. return func_ptr();
  855. }
  856. EOF
  857. }
  858. check_type(){
  859. log check_type "$@"
  860. headers=$1
  861. type=$2
  862. shift 2
  863. disable_safe "$type"
  864. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  865. }
  866. check_struct(){
  867. log check_type "$@"
  868. headers=$1
  869. struct=$2
  870. member=$3
  871. shift 3
  872. disable_safe "${struct}_${member}"
  873. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  874. enable_safe "${struct}_${member}"
  875. }
  876. require(){
  877. name="$1"
  878. header="$2"
  879. func="$3"
  880. shift 3
  881. check_lib $header $func "$@" || die "ERROR: $name not found"
  882. }
  883. require2(){
  884. name="$1"
  885. headers="$2"
  886. func="$3"
  887. shift 3
  888. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  889. }
  890. require_cpp(){
  891. name="$1"
  892. headers="$2"
  893. classes="$3"
  894. shift 3
  895. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  896. }
  897. require_pkg_config(){
  898. pkg="$1"
  899. check_pkg_config "$@" || die "ERROR: $pkg not found"
  900. add_cflags $(get_safe ${pkg}_cflags)
  901. add_extralibs $(get_safe ${pkg}_libs)
  902. }
  903. hostcc_o(){
  904. eval printf '%s\\n' $HOSTCC_O
  905. }
  906. check_host_cc(){
  907. log check_host_cc "$@"
  908. cat > $TMPC
  909. log_file $TMPC
  910. check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  911. }
  912. check_host_cflags(){
  913. log check_host_cflags "$@"
  914. set -- $($host_cflags_filter "$@")
  915. check_host_cc "$@" <<EOF && append host_cflags "$@"
  916. int x;
  917. EOF
  918. }
  919. apply(){
  920. file=$1
  921. shift
  922. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  923. }
  924. cp_if_changed(){
  925. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  926. mkdir -p "$(dirname $2)"
  927. cp -f "$1" "$2"
  928. }
  929. force_include(){
  930. flag=$(eval printf '%s%s\\n' '$FORCE_INC' $1)
  931. append CFLAGS "$flag"
  932. }
  933. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  934. # system-dependent things.
  935. COMPONENT_LIST="
  936. bsfs
  937. decoders
  938. demuxers
  939. encoders
  940. filters
  941. hwaccels
  942. indevs
  943. muxers
  944. outdevs
  945. parsers
  946. protocols
  947. "
  948. DOCUMENT_LIST="
  949. doc
  950. htmlpages
  951. manpages
  952. podpages
  953. txtpages
  954. "
  955. PROGRAM_LIST="
  956. ffplay
  957. ffprobe
  958. ffserver
  959. ffmpeg
  960. "
  961. CONFIG_LIST="
  962. $COMPONENT_LIST
  963. $DOCUMENT_LIST
  964. $PROGRAM_LIST
  965. avcodec
  966. avdevice
  967. avfilter
  968. avformat
  969. avresample
  970. avisynth
  971. bzlib
  972. crystalhd
  973. dct
  974. dwt
  975. dxva2
  976. fast_unaligned
  977. fft
  978. fontconfig
  979. frei0r
  980. gnutls
  981. gpl
  982. gray
  983. hardcoded_tables
  984. libaacplus
  985. libass
  986. libbluray
  987. libcaca
  988. libcdio
  989. libcelt
  990. libdc1394
  991. libfaac
  992. libfdk_aac
  993. libflite
  994. libfreetype
  995. libgsm
  996. libiec61883
  997. libilbc
  998. libmodplug
  999. libmp3lame
  1000. libnut
  1001. libopencore_amrnb
  1002. libopencore_amrwb
  1003. libopencv
  1004. libopenjpeg
  1005. libopus
  1006. libpulse
  1007. librtmp
  1008. libschroedinger
  1009. libspeex
  1010. libstagefright_h264
  1011. libtheora
  1012. libtwolame
  1013. libutvideo
  1014. libv4l2
  1015. libvo_aacenc
  1016. libvo_amrwbenc
  1017. libvorbis
  1018. libvpx
  1019. libx264
  1020. libxavs
  1021. libxvid
  1022. lsp
  1023. mdct
  1024. memalign_hack
  1025. memory_poisoning
  1026. network
  1027. nonfree
  1028. openal
  1029. openssl
  1030. pic
  1031. postproc
  1032. rdft
  1033. runtime_cpudetect
  1034. safe_bitstream_reader
  1035. shared
  1036. small
  1037. sram
  1038. static
  1039. swresample
  1040. swscale
  1041. swscale_alpha
  1042. thumb
  1043. vaapi
  1044. vda
  1045. vdpau
  1046. version3
  1047. xmm_clobber_test
  1048. x11grab
  1049. zlib
  1050. "
  1051. THREADS_LIST='
  1052. pthreads
  1053. w32threads
  1054. os2threads
  1055. '
  1056. ARCH_LIST='
  1057. alpha
  1058. arm
  1059. avr32
  1060. avr32_ap
  1061. avr32_uc
  1062. bfin
  1063. ia64
  1064. m68k
  1065. mips
  1066. mips64
  1067. parisc
  1068. ppc
  1069. ppc64
  1070. s390
  1071. sh4
  1072. sparc
  1073. sparc64
  1074. tomi
  1075. x86
  1076. x86_32
  1077. x86_64
  1078. '
  1079. ARCH_EXT_LIST_X86='
  1080. amd3dnow
  1081. amd3dnowext
  1082. avx
  1083. fma4
  1084. mmx
  1085. mmxext
  1086. sse
  1087. sse2
  1088. sse3
  1089. sse4
  1090. sse42
  1091. ssse3
  1092. '
  1093. ARCH_EXT_LIST="
  1094. $ARCH_EXT_LIST_X86
  1095. altivec
  1096. armv5te
  1097. armv6
  1098. armv6t2
  1099. armvfp
  1100. mmi
  1101. neon
  1102. ppc4xx
  1103. vfpv3
  1104. vis
  1105. mipsfpu
  1106. mips32r2
  1107. mipsdspr1
  1108. mipsdspr2
  1109. "
  1110. HAVE_LIST_PUB='
  1111. bigendian
  1112. fast_unaligned
  1113. '
  1114. HAVE_LIST="
  1115. $ARCH_EXT_LIST
  1116. $HAVE_LIST_PUB
  1117. $THREADS_LIST
  1118. aligned_malloc
  1119. aligned_stack
  1120. alsa_asoundlib_h
  1121. altivec_h
  1122. arpa_inet_h
  1123. asm_mod_q
  1124. asm_mod_y
  1125. asm_types_h
  1126. attribute_may_alias
  1127. attribute_packed
  1128. broken_strtod
  1129. cbrtf
  1130. clock_gettime
  1131. closesocket
  1132. cmov
  1133. cpuid
  1134. cpunop
  1135. dcbzl
  1136. dev_bktr_ioctl_bt848_h
  1137. dev_bktr_ioctl_meteor_h
  1138. dev_ic_bt8xx_h
  1139. dev_video_bktr_ioctl_bt848_h
  1140. dev_video_meteor_ioctl_meteor_h
  1141. dlfcn_h
  1142. dlopen
  1143. dos_paths
  1144. dxva_h
  1145. ebp_available
  1146. ebx_available
  1147. exp2
  1148. exp2f
  1149. fast_64bit
  1150. fast_clz
  1151. fast_cmov
  1152. fcntl
  1153. fork
  1154. getaddrinfo
  1155. gethrtime
  1156. getopt
  1157. GetProcessAffinityMask
  1158. GetProcessMemoryInfo
  1159. GetProcessTimes
  1160. GetSystemTimeAsFileTime
  1161. getrusage
  1162. gettimeofday
  1163. glob
  1164. gnu_as
  1165. ibm_asm
  1166. inet_aton
  1167. inline_asm
  1168. isatty
  1169. isinf
  1170. isnan
  1171. jack_port_get_latency_range
  1172. kbhit
  1173. ldbrx
  1174. libdc1394_1
  1175. libdc1394_2
  1176. llrint
  1177. llrintf
  1178. local_aligned_16
  1179. local_aligned_8
  1180. localtime_r
  1181. log2
  1182. log2f
  1183. loongson
  1184. lrint
  1185. lrintf
  1186. lzo1x_999_compress
  1187. machine_ioctl_bt848_h
  1188. machine_ioctl_meteor_h
  1189. makeinfo
  1190. malloc_h
  1191. MapViewOfFile
  1192. memalign
  1193. mkstemp
  1194. mm_empty
  1195. mmap
  1196. nanosleep
  1197. PeekNamedPipe
  1198. perl
  1199. pod2man
  1200. poll_h
  1201. posix_memalign
  1202. pthread_cancel
  1203. rdtsc
  1204. rint
  1205. round
  1206. roundf
  1207. rweflags
  1208. sched_getaffinity
  1209. sdl
  1210. sdl_video_size
  1211. setmode
  1212. setrlimit
  1213. Sleep
  1214. sndio_h
  1215. snprintf
  1216. socklen_t
  1217. soundcard_h
  1218. strerror_r
  1219. strptime
  1220. struct_addrinfo
  1221. struct_group_source_req
  1222. struct_ip_mreq_source
  1223. struct_ipv6_mreq
  1224. struct_pollfd
  1225. struct_rusage_ru_maxrss
  1226. struct_sctp_event_subscribe
  1227. struct_sockaddr_in6
  1228. struct_sockaddr_sa_len
  1229. struct_sockaddr_storage
  1230. struct_v4l2_frmivalenum_discrete
  1231. symver
  1232. symver_asm_label
  1233. symver_gnu_asm
  1234. sysconf
  1235. sysctl
  1236. sys_mman_h
  1237. sys_param_h
  1238. sys_resource_h
  1239. sys_select_h
  1240. sys_soundcard_h
  1241. sys_time_h
  1242. sys_videoio_h
  1243. termios_h
  1244. texi2html
  1245. threads
  1246. trunc
  1247. truncf
  1248. unistd_h
  1249. usleep
  1250. vfp_args
  1251. VirtualAlloc
  1252. windows_h
  1253. winsock2_h
  1254. xform_asm
  1255. xgetbv
  1256. xmm_clobbers
  1257. yasm
  1258. "
  1259. # options emitted with CONFIG_ prefix but not available on command line
  1260. CONFIG_EXTRA="
  1261. aandcttables
  1262. ac3dsp
  1263. avutil
  1264. error_resilience
  1265. gcrypt
  1266. golomb
  1267. gplv3
  1268. h264chroma
  1269. h264dsp
  1270. h264pred
  1271. h264qpel
  1272. huffman
  1273. lgplv3
  1274. lpc
  1275. mpegaudiodsp
  1276. mpegvideo
  1277. mpegvideoenc
  1278. nettle
  1279. rangecoder
  1280. rtpdec
  1281. sinewin
  1282. vp3dsp
  1283. "
  1284. CMDLINE_SELECT="
  1285. $ARCH_EXT_LIST
  1286. $CONFIG_LIST
  1287. $THREADS_LIST
  1288. asm
  1289. coverage
  1290. cross_compile
  1291. debug
  1292. extra_warnings
  1293. logging
  1294. optimizations
  1295. stripping
  1296. symver
  1297. yasm
  1298. "
  1299. PATHS_LIST='
  1300. bindir
  1301. datadir
  1302. incdir
  1303. libdir
  1304. mandir
  1305. prefix
  1306. shlibdir
  1307. '
  1308. CMDLINE_SET="
  1309. $PATHS_LIST
  1310. ar
  1311. arch
  1312. as
  1313. assert_level
  1314. build_suffix
  1315. cc
  1316. cpu
  1317. cross_prefix
  1318. cxx
  1319. dep_cc
  1320. extra_version
  1321. host_cc
  1322. host_cflags
  1323. host_ld
  1324. host_ldflags
  1325. host_libs
  1326. host_os
  1327. install
  1328. ld
  1329. logfile
  1330. malloc_prefix
  1331. nm
  1332. optflags
  1333. pkg_config
  1334. postproc_version
  1335. progs_suffix
  1336. random_seed
  1337. samples
  1338. strip
  1339. sysinclude
  1340. sysroot
  1341. target_exec
  1342. target_os
  1343. target_path
  1344. valgrind
  1345. yasmexe
  1346. "
  1347. CMDLINE_APPEND="
  1348. extra_cflags
  1349. extra_cxxflags
  1350. "
  1351. # code dependency declarations
  1352. # architecture extensions
  1353. armv5te_deps="arm"
  1354. armv6_deps="arm"
  1355. armv6t2_deps="arm"
  1356. armvfp_deps="arm"
  1357. neon_deps="arm"
  1358. vfpv3_deps="armvfp"
  1359. mipsfpu_deps="mips"
  1360. mips32r2_deps="mips"
  1361. mipsdspr1_deps="mips"
  1362. mipsdspr2_deps="mips"
  1363. mmi_deps="mips"
  1364. altivec_deps="ppc"
  1365. ppc4xx_deps="ppc"
  1366. vis_deps="sparc"
  1367. x86_64_suggest="cmov fast_cmov"
  1368. amd3dnow_deps="mmx"
  1369. amd3dnowext_deps="amd3dnow"
  1370. mmx_deps="x86"
  1371. mmxext_deps="mmx"
  1372. sse_deps="mmxext"
  1373. sse2_deps="sse"
  1374. sse3_deps="sse2"
  1375. ssse3_deps="sse3"
  1376. sse4_deps="ssse3"
  1377. sse42_deps="sse4"
  1378. avx_deps="sse42"
  1379. fma4_deps="avx"
  1380. aligned_stack_if_any="ppc x86"
  1381. fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1382. fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
  1383. fast_unaligned_if_any="armv6 ppc x86"
  1384. inline_asm_deps="!tms470"
  1385. need_memalign="altivec neon sse"
  1386. symver_if_any="symver_asm_label symver_gnu_asm"
  1387. # subsystems
  1388. dct_select="rdft"
  1389. mdct_select="fft"
  1390. rdft_select="fft"
  1391. mpegaudiodsp_select="dct"
  1392. mpegvideoenc_select="mpegvideo"
  1393. # decoders / encoders / hardware accelerators
  1394. aac_decoder_select="mdct sinewin"
  1395. aac_encoder_select="mdct sinewin"
  1396. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1397. ac3_decoder_select="mdct ac3dsp ac3_parser"
  1398. ac3_encoder_select="mdct ac3dsp"
  1399. ac3_fixed_encoder_select="mdct ac3dsp"
  1400. alac_encoder_select="lpc"
  1401. amrnb_decoder_select="lsp"
  1402. amrwb_decoder_select="lsp"
  1403. amv_encoder_select="aandcttables"
  1404. atrac1_decoder_select="mdct sinewin"
  1405. atrac3_decoder_select="mdct"
  1406. binkaudio_dct_decoder_select="mdct rdft dct sinewin"
  1407. binkaudio_rdft_decoder_select="mdct rdft sinewin"
  1408. cavs_decoder_select="golomb mpegvideo"
  1409. cook_decoder_select="mdct sinewin"
  1410. cscd_decoder_suggest="zlib"
  1411. dca_decoder_select="mdct"
  1412. dirac_decoder_select="dwt golomb"
  1413. dnxhd_encoder_select="aandcttables mpegvideoenc"
  1414. dxa_decoder_select="zlib"
  1415. eac3_decoder_select="ac3_decoder"
  1416. eac3_encoder_select="ac3_encoder"
  1417. eamad_decoder_select="aandcttables error_resilience"
  1418. eatgq_decoder_select="aandcttables"
  1419. eatqi_decoder_select="aandcttables error_resilience mpegvideo"
  1420. exr_decoder_select="zlib"
  1421. ffv1_decoder_select="golomb rangecoder"
  1422. ffv1_encoder_select="rangecoder"
  1423. ffvhuff_encoder_select="huffman"
  1424. flac_decoder_select="golomb"
  1425. flac_encoder_select="golomb lpc"
  1426. flashsv_decoder_select="zlib"
  1427. flashsv_encoder_select="zlib"
  1428. flashsv2_encoder_select="zlib"
  1429. flashsv2_decoder_select="zlib"
  1430. flv_decoder_select="h263_decoder"
  1431. flv_encoder_select="h263_encoder"
  1432. fraps_decoder_select="huffman"
  1433. h261_decoder_select="error_resilience mpegvideo"
  1434. h261_encoder_select="aandcttables mpegvideoenc"
  1435. h263_decoder_select="error_resilience h263_parser mpegvideo"
  1436. h263_encoder_select="aandcttables error_resilience mpegvideoenc"
  1437. h263_vaapi_hwaccel_select="vaapi h263_decoder"
  1438. h263i_decoder_select="h263_decoder"
  1439. h263p_encoder_select="h263_encoder"
  1440. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  1441. h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
  1442. h264_dxva2_hwaccel_deps="dxva2api_h"
  1443. h264_dxva2_hwaccel_select="dxva2 h264_decoder"
  1444. h264_vaapi_hwaccel_select="vaapi h264_decoder"
  1445. h264_vda_decoder_select="vda h264_parser h264_decoder"
  1446. h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1447. h264_vda_hwaccel_select="vda h264_decoder"
  1448. h264_vdpau_decoder_select="vdpau h264_decoder"
  1449. huffyuv_encoder_select="huffman"
  1450. iac_decoder_select="fft mdct sinewin"
  1451. imc_decoder_select="fft mdct sinewin"
  1452. jpegls_decoder_select="golomb"
  1453. jpegls_encoder_select="golomb"
  1454. ljpeg_encoder_select="aandcttables mpegvideoenc"
  1455. loco_decoder_select="golomb"
  1456. mdec_decoder_select="error_resilience mpegvideo"
  1457. mjpeg_encoder_select="aandcttables mpegvideoenc"
  1458. mlp_decoder_select="mlp_parser"
  1459. mp1_decoder_select="mpegaudiodsp"
  1460. mp1float_decoder_select="mpegaudiodsp"
  1461. mp2_decoder_select="mpegaudiodsp"
  1462. mp2float_decoder_select="mpegaudiodsp"
  1463. mp3_decoder_select="mpegaudiodsp"
  1464. mp3adu_decoder_select="mpegaudiodsp"
  1465. mp3adufloat_decoder_select="mpegaudiodsp"
  1466. mp3float_decoder_select="mpegaudiodsp"
  1467. mp3on4_decoder_select="mpegaudiodsp"
  1468. mp3on4float_decoder_select="mpegaudiodsp"
  1469. mpc7_decoder_select="mpegaudiodsp"
  1470. mpc8_decoder_select="mpegaudiodsp"
  1471. mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
  1472. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1473. mpeg_xvmc_decoder_select="mpegvideo_decoder"
  1474. mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
  1475. mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
  1476. mpeg1video_decoder_select="error_resilience mpegvideo"
  1477. mpeg1video_encoder_select="aandcttables error_resilience mpegvideoenc"
  1478. mpeg2_crystalhd_decoder_select="crystalhd"
  1479. mpeg2_dxva2_hwaccel_deps="dxva2api_h"
  1480. mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
  1481. mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
  1482. mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
  1483. mpeg2video_decoder_select="error_resilience mpegvideo"
  1484. mpeg2video_encoder_select="aandcttables error_resilience mpegvideoenc"
  1485. mpeg4_crystalhd_decoder_select="crystalhd"
  1486. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1487. mpeg4_encoder_select="h263_encoder"
  1488. mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
  1489. mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
  1490. msmpeg4_crystalhd_decoder_select="crystalhd"
  1491. msmpeg4v1_decoder_select="h263_decoder"
  1492. msmpeg4v1_encoder_select="h263_encoder"
  1493. msmpeg4v2_decoder_select="h263_decoder"
  1494. msmpeg4v2_encoder_select="h263_encoder"
  1495. msmpeg4v3_decoder_select="h263_decoder"
  1496. msmpeg4v3_encoder_select="h263_encoder"
  1497. nellymoser_decoder_select="mdct sinewin"
  1498. nellymoser_encoder_select="mdct sinewin"
  1499. png_decoder_select="zlib"
  1500. png_encoder_select="zlib"
  1501. qcelp_decoder_select="lsp"
  1502. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1503. ra_144_encoder_select="lpc"
  1504. ralf_decoder_select="golomb"
  1505. rv10_decoder_select="h263_decoder"
  1506. rv10_encoder_select="h263_encoder"
  1507. rv20_decoder_select="h263_decoder"
  1508. rv20_encoder_select="h263_encoder"
  1509. rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
  1510. rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
  1511. shorten_decoder_select="golomb"
  1512. sipr_decoder_select="lsp"
  1513. snow_decoder_select="dwt rangecoder"
  1514. snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
  1515. sonic_decoder_select="golomb"
  1516. sonic_encoder_select="golomb"
  1517. sonic_ls_encoder_select="golomb"
  1518. svq1_decoder_select="error_resilience mpegvideo"
  1519. svq1_encoder_select="aandcttables error_resilience mpegvideoenc"
  1520. svq3_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
  1521. svq3_decoder_suggest="zlib"
  1522. theora_decoder_select="vp3_decoder"
  1523. tiff_decoder_suggest="zlib"
  1524. tiff_encoder_suggest="zlib"
  1525. tscc_decoder_select="zlib"
  1526. twinvq_decoder_select="mdct lsp sinewin"
  1527. vc1_crystalhd_decoder_select="crystalhd"
  1528. vc1_decoder_select="h263_decoder h264chroma h264qpel"
  1529. vc1_dxva2_hwaccel_deps="dxva2api_h"
  1530. vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
  1531. vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
  1532. vc1_vdpau_decoder_select="vdpau vc1_decoder"
  1533. vc1image_decoder_select="vc1_decoder"
  1534. vorbis_decoder_select="mdct"
  1535. vorbis_encoder_select="mdct"
  1536. vp3_decoder_select="vp3dsp"
  1537. vp5_decoder_select="vp3dsp"
  1538. vp6_decoder_select="huffman vp3dsp"
  1539. vp6a_decoder_select="vp6_decoder"
  1540. vp6f_decoder_select="vp6_decoder"
  1541. vp8_decoder_select="h264pred h264qpel"
  1542. wmapro_decoder_select="mdct sinewin"
  1543. wmav1_decoder_select="mdct sinewin"
  1544. wmav1_encoder_select="mdct sinewin"
  1545. wmav2_decoder_select="mdct sinewin"
  1546. wmav2_encoder_select="mdct sinewin"
  1547. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  1548. wmv1_decoder_select="h263_decoder"
  1549. wmv1_encoder_select="h263_encoder"
  1550. wmv2_decoder_select="h263_decoder"
  1551. wmv2_encoder_select="h263_encoder"
  1552. wmv3_decoder_select="vc1_decoder"
  1553. wmv3_crystalhd_decoder_select="crystalhd"
  1554. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  1555. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1556. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1557. wmv3image_decoder_select="wmv3_decoder"
  1558. zerocodec_decoder_select="zlib"
  1559. zlib_decoder_select="zlib"
  1560. zlib_encoder_select="zlib"
  1561. zmbv_decoder_select="zlib"
  1562. zmbv_encoder_select="zlib"
  1563. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  1564. vaapi_deps="va_va_h"
  1565. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1566. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1567. # parsers
  1568. h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo"
  1569. mpeg4video_parser_select="error_resilience mpegvideo"
  1570. mpegvideo_parser_select="error_resilience mpegvideo"
  1571. vc1_parser_select="error_resilience mpegvideo"
  1572. # external libraries
  1573. libaacplus_encoder_deps="libaacplus"
  1574. libcelt_decoder_deps="libcelt"
  1575. libfaac_encoder_deps="libfaac"
  1576. libfdk_aac_encoder_deps="libfdk_aac"
  1577. libgsm_decoder_deps="libgsm"
  1578. libgsm_encoder_deps="libgsm"
  1579. libgsm_ms_decoder_deps="libgsm"
  1580. libgsm_ms_encoder_deps="libgsm"
  1581. libilbc_decoder_deps="libilbc"
  1582. libilbc_encoder_deps="libilbc"
  1583. libmodplug_demuxer_deps="libmodplug"
  1584. libmp3lame_encoder_deps="libmp3lame"
  1585. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1586. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1587. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1588. libopenjpeg_decoder_deps="libopenjpeg"
  1589. libopenjpeg_encoder_deps="libopenjpeg"
  1590. libopus_decoder_deps="libopus"
  1591. libschroedinger_decoder_deps="libschroedinger"
  1592. libschroedinger_encoder_deps="libschroedinger"
  1593. libspeex_decoder_deps="libspeex"
  1594. libspeex_encoder_deps="libspeex"
  1595. libstagefright_h264_decoder_deps="libstagefright_h264"
  1596. libtheora_encoder_deps="libtheora"
  1597. libtwolame_encoder_deps="libtwolame"
  1598. libvo_aacenc_encoder_deps="libvo_aacenc"
  1599. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  1600. libvorbis_decoder_deps="libvorbis"
  1601. libvorbis_encoder_deps="libvorbis"
  1602. libvpx_decoder_deps="libvpx"
  1603. libvpx_encoder_deps="libvpx"
  1604. libx264_encoder_deps="libx264"
  1605. libx264rgb_encoder_deps="libx264"
  1606. libxavs_encoder_deps="libxavs"
  1607. libxvid_encoder_deps="libxvid"
  1608. libutvideo_decoder_deps="libutvideo"
  1609. libutvideo_encoder_deps="libutvideo"
  1610. # demuxers / muxers
  1611. ac3_demuxer_select="ac3_parser"
  1612. asf_stream_muxer_select="asf_muxer"
  1613. avisynth_demuxer_deps="avisynth"
  1614. dirac_demuxer_select="dirac_parser"
  1615. eac3_demuxer_select="ac3_parser"
  1616. flac_demuxer_select="flac_parser"
  1617. ipod_muxer_select="mov_muxer"
  1618. libnut_demuxer_deps="libnut"
  1619. libnut_muxer_deps="libnut"
  1620. matroska_audio_muxer_select="matroska_muxer"
  1621. matroska_demuxer_suggest="zlib bzlib"
  1622. mov_demuxer_suggest="zlib"
  1623. mp3_demuxer_select="mpegaudio_parser"
  1624. mp4_muxer_select="mov_muxer"
  1625. mpegts_muxer_select="adts_muxer latm_muxer mpegvideo"
  1626. mpegtsraw_demuxer_select="mpegts_demuxer"
  1627. mxf_d10_muxer_select="mxf_muxer"
  1628. ogg_demuxer_select="golomb"
  1629. psp_muxer_select="mov_muxer"
  1630. rtp_demuxer_select="sdp_demuxer"
  1631. rtp_muxer_select="mpegvideo"
  1632. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  1633. rtsp_demuxer_select="http_protocol rtpdec"
  1634. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol"
  1635. sap_demuxer_select="sdp_demuxer"
  1636. sap_muxer_select="rtp_muxer rtp_protocol"
  1637. sdp_demuxer_select="rtpdec"
  1638. spdif_muxer_select="aac_parser"
  1639. tg2_muxer_select="mov_muxer"
  1640. tgp_muxer_select="mov_muxer"
  1641. w64_demuxer_deps="wav_demuxer"
  1642. # indevs / outdevs
  1643. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1644. alsa_outdev_deps="alsa_asoundlib_h"
  1645. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1646. caca_outdev_deps="libcaca"
  1647. dshow_indev_deps="IBaseFilter"
  1648. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
  1649. dv1394_indev_deps="dv1394 dv_demuxer"
  1650. fbdev_indev_deps="linux_fb_h"
  1651. iec61883_indev_deps="libiec61883"
  1652. jack_indev_deps="jack_jack_h sem_timedwait"
  1653. lavfi_indev_deps="avfilter"
  1654. libcdio_indev_deps="libcdio"
  1655. libdc1394_indev_deps="libdc1394"
  1656. libv4l2_indev_deps="libv4l2"
  1657. openal_indev_deps="openal"
  1658. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1659. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1660. pulse_indev_deps="libpulse"
  1661. sdl_outdev_deps="sdl"
  1662. sndio_indev_deps="sndio_h"
  1663. sndio_outdev_deps="sndio_h"
  1664. v4l_indev_deps="linux_videodev_h"
  1665. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1666. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  1667. vfwcap_indev_extralibs="-lavicap32"
  1668. x11grab_indev_deps="x11grab"
  1669. # protocols
  1670. bluray_protocol_deps="libbluray"
  1671. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  1672. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  1673. ffrtmpcrypt_protocol_select="tcp_protocol"
  1674. ffrtmphttp_protocol_deps="!librtmp_protocol"
  1675. ffrtmphttp_protocol_select="http_protocol"
  1676. gopher_protocol_deps="network"
  1677. httpproxy_protocol_deps="network"
  1678. httpproxy_protocol_select="tcp_protocol"
  1679. http_protocol_deps="network"
  1680. http_protocol_select="tcp_protocol"
  1681. https_protocol_select="tls_protocol"
  1682. librtmp_protocol_deps="librtmp"
  1683. librtmpe_protocol_deps="librtmp"
  1684. librtmps_protocol_deps="librtmp"
  1685. librtmpt_protocol_deps="librtmp"
  1686. librtmpte_protocol_deps="librtmp"
  1687. mmsh_protocol_select="http_protocol"
  1688. mmst_protocol_deps="network"
  1689. rtmp_protocol_deps="!librtmp_protocol"
  1690. rtmp_protocol_select="tcp_protocol"
  1691. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  1692. rtmps_protocol_deps="!librtmp_protocol"
  1693. rtmps_protocol_select="tls_protocol"
  1694. rtmpt_protocol_select="ffrtmphttp_protocol"
  1695. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  1696. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  1697. rtp_protocol_select="udp_protocol"
  1698. sctp_protocol_deps="network struct_sctp_event_subscribe"
  1699. tcp_protocol_deps="network"
  1700. tls_protocol_deps_any="openssl gnutls"
  1701. tls_protocol_select="tcp_protocol"
  1702. udp_protocol_deps="network"
  1703. # filters
  1704. aconvert_filter_deps="swresample"
  1705. amovie_filter_deps="avcodec avformat"
  1706. aresample_filter_deps="swresample"
  1707. ass_filter_deps="libass"
  1708. asyncts_filter_deps="avresample"
  1709. atempo_filter_deps="avcodec rdft"
  1710. blackframe_filter_deps="gpl"
  1711. boxblur_filter_deps="gpl"
  1712. colormatrix_filter_deps="gpl"
  1713. cropdetect_filter_deps="gpl"
  1714. delogo_filter_deps="gpl"
  1715. deshake_filter_deps="avcodec"
  1716. drawtext_filter_deps="libfreetype"
  1717. flite_filter_deps="libflite"
  1718. frei0r_filter_deps="frei0r dlopen"
  1719. frei0r_filter_extralibs='$ldl'
  1720. frei0r_src_filter_deps="frei0r dlopen"
  1721. frei0r_src_filter_extralibs='$ldl'
  1722. hqdn3d_filter_deps="gpl"
  1723. movie_filter_deps="avcodec avformat"
  1724. mp_filter_deps="gpl avcodec swscale postproc"
  1725. mptestsrc_filter_deps="gpl"
  1726. negate_filter_deps="lut_filter"
  1727. resample_filter_deps="avresample"
  1728. ocv_filter_deps="libopencv"
  1729. pan_filter_deps="swresample"
  1730. removelogo_filter_deps="avcodec avformat swscale"
  1731. scale_filter_deps="swscale"
  1732. smartblur_filter_deps="gpl swscale"
  1733. select_filter_deps="avcodec"
  1734. showspectrum_filter_deps="avcodec"
  1735. super2xsai_filter_deps="gpl"
  1736. tinterlace_filter_deps="gpl"
  1737. yadif_filter_deps="gpl"
  1738. # libraries
  1739. avdevice_deps="avcodec avformat"
  1740. avformat_deps="avcodec"
  1741. postproc_deps="gpl"
  1742. # programs
  1743. ffmpeg_deps="avcodec avfilter avformat swscale swresample"
  1744. ffmpeg_select="buffersink_filter format_filter aformat_filter
  1745. setpts_filter null_filter anull_filter abuffersink_filter"
  1746. ffplay_deps="avcodec avformat swscale swresample sdl"
  1747. ffplay_select="buffersink_filter rdft"
  1748. ffprobe_deps="avcodec avformat"
  1749. ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
  1750. ffserver_extralibs='$ldl'
  1751. # documentation
  1752. podpages_deps="perl"
  1753. manpages_deps="perl pod2man"
  1754. htmlpages_deps="texi2html"
  1755. txtpages_deps="makeinfo"
  1756. doc_deps_any="manpages htmlpages podpages txtpages"
  1757. # tests
  1758. colormatrix1_test_deps="colormatrix_filter"
  1759. colormatrix2_test_deps="colormatrix_filter"
  1760. flashsv2_test_deps="zlib"
  1761. mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
  1762. mpng_test_deps="zlib"
  1763. pp_test_deps="mp_filter"
  1764. pp2_test_deps="mp_filter"
  1765. pp3_test_deps="mp_filter"
  1766. pp4_test_deps="mp_filter"
  1767. pp5_test_deps="mp_filter"
  1768. pp6_test_deps="mp_filter"
  1769. seek_lavf_mxf_d10_test_deps="mxf_d10_test"
  1770. zlib_test_deps="zlib"
  1771. zmbv_test_deps="zlib"
  1772. test_deps(){
  1773. suf1=$1
  1774. suf2=$2
  1775. shift 2
  1776. for v; do
  1777. dep=${v%=*}
  1778. tests=${v#*=}
  1779. for name in ${tests}; do
  1780. append ${name}_test_deps ${dep}$suf1 ${dep}$suf2
  1781. done
  1782. done
  1783. }
  1784. test_deps _muxer _demuxer \
  1785. aiff \
  1786. pcm_alaw=alaw \
  1787. asf \
  1788. au \
  1789. avi \
  1790. dv=dv_fmt \
  1791. ffm \
  1792. flv=flv_fmt \
  1793. gxf \
  1794. matroska=mkv \
  1795. mmf \
  1796. mov="mov ismv" \
  1797. pcm_mulaw=mulaw \
  1798. mxf="mxf mxf_d10" \
  1799. nut \
  1800. ogg="ogg ogg_vp3" \
  1801. rawvideo=pixfmt \
  1802. rm \
  1803. swf \
  1804. mpegts=ts \
  1805. voc \
  1806. wav \
  1807. yuv4mpegpipe=yuv4mpeg \
  1808. # default parameters
  1809. logfile="config.log"
  1810. # installation paths
  1811. prefix_default="/usr/local"
  1812. bindir_default='${prefix}/bin'
  1813. datadir_default='${prefix}/share/ffmpeg'
  1814. incdir_default='${prefix}/include'
  1815. libdir_default='${prefix}/lib'
  1816. mandir_default='${prefix}/share/man'
  1817. shlibdir_default="$libdir_default"
  1818. postproc_version_default="current"
  1819. # toolchain
  1820. ar_default="ar"
  1821. cc_default="gcc"
  1822. cxx_default="g++"
  1823. host_cc_default="gcc"
  1824. install="install"
  1825. ln_s="ln -sf"
  1826. nm_default="nm"
  1827. objformat="elf"
  1828. pkg_config_default=pkg-config
  1829. ranlib="ranlib"
  1830. strip_default="strip"
  1831. yasmexe_default="yasm"
  1832. nm_opts='-g'
  1833. nogas=":"
  1834. # machine
  1835. arch_default=$(uname -m)
  1836. cpu="generic"
  1837. # OS
  1838. target_os_default=$(tolower $(uname -s))
  1839. host_os=$target_os_default
  1840. # alternative libpostproc version
  1841. ALT_PP_VER_MAJOR=51
  1842. ALT_PP_VER_MINOR=2
  1843. ALT_PP_VER_MICRO=101
  1844. ALT_PP_VER=$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO
  1845. # configurable options
  1846. enable $PROGRAM_LIST
  1847. enable $DOCUMENT_LIST
  1848. enable avcodec
  1849. enable avdevice
  1850. enable avfilter
  1851. enable avformat
  1852. enable avutil
  1853. enable postproc
  1854. enable stripping
  1855. enable swresample
  1856. enable swscale
  1857. enable asm
  1858. enable debug
  1859. enable doc
  1860. enable network
  1861. enable optimizations
  1862. enable safe_bitstream_reader
  1863. enable static
  1864. enable swscale_alpha
  1865. # build settings
  1866. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1867. FFSERVERLDFLAGS=-Wl,-E
  1868. LIBPREF="lib"
  1869. LIBSUF=".a"
  1870. FULLNAME='$(NAME)$(BUILDSUF)'
  1871. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1872. SLIBPREF="lib"
  1873. SLIBSUF=".so"
  1874. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1875. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1876. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1877. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1878. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  1879. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  1880. asflags_filter=echo
  1881. cflags_filter=echo
  1882. ldflags_filter=echo
  1883. AS_C='-c'
  1884. AS_O='-o $@'
  1885. CC_C='-c'
  1886. CC_E='-E -o $@'
  1887. CC_O='-o $@'
  1888. CXX_C='-c'
  1889. CXX_O='-o $@'
  1890. LD_O='-o $@'
  1891. FORCE_INC="-include"
  1892. LD_LIB='-l%'
  1893. LD_PATH='-L'
  1894. HOSTCC_C='-c'
  1895. HOSTCC_O='-o $@'
  1896. HOSTLD_O='-o $@'
  1897. host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
  1898. host_libs='-lm'
  1899. host_cflags_filter=echo
  1900. host_ldflags_filter=echo
  1901. target_path='$(CURDIR)'
  1902. # since the object filename is not given with the -MM flag, the compiler
  1903. # is only able to print the basename, and we must add the path ourselves
  1904. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  1905. DEPFLAGS='-MM'
  1906. # find source path
  1907. if test -f configure; then
  1908. source_path=.
  1909. else
  1910. source_path=$(cd $(dirname "$0"); pwd)
  1911. echo "$source_path" | grep -q '[[:blank:]]' &&
  1912. die "Out of tree builds are impossible with whitespace in source path."
  1913. test -e "$source_path/config.h" &&
  1914. die "Out of tree builds are impossible with config.h in source dir."
  1915. fi
  1916. for v in "$@"; do
  1917. r=${v#*=}
  1918. l=${v%"$r"}
  1919. r=$(sh_quote "$r")
  1920. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1921. done
  1922. find_things(){
  1923. thing=$1
  1924. pattern=$2
  1925. file=$source_path/$3
  1926. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1927. }
  1928. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1929. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1930. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1931. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1932. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1933. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1934. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1935. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1936. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1937. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1938. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1939. ALL_COMPONENTS="
  1940. $BSF_LIST
  1941. $DECODER_LIST
  1942. $DEMUXER_LIST
  1943. $ENCODER_LIST
  1944. $FILTER_LIST
  1945. $HWACCEL_LIST
  1946. $INDEV_LIST
  1947. $MUXER_LIST
  1948. $OUTDEV_LIST
  1949. $PARSER_LIST
  1950. $PROTOCOL_LIST
  1951. "
  1952. find_tests(){
  1953. map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
  1954. }
  1955. LAVF_FATE_TESTS=$(find_tests lavf-fate)
  1956. LAVF_TESTS=$(find_tests lavf)
  1957. LAVFI_TESTS=$(find_tests lavfi)
  1958. SEEK_TESTS=$(find_tests seek seek_)
  1959. ALL_TESTS="$LAVF_FATE_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS"
  1960. for n in $COMPONENT_LIST; do
  1961. v=$(toupper ${n%s})_LIST
  1962. eval enable \$$v
  1963. eval ${n}_if_any="\$$v"
  1964. done
  1965. enable $ARCH_EXT_LIST $ALL_TESTS
  1966. die_unknown(){
  1967. echo "Unknown option \"$1\"."
  1968. echo "See $0 --help for available options."
  1969. exit 1
  1970. }
  1971. show_list() {
  1972. suffix=_$1
  1973. shift
  1974. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
  1975. exit 0
  1976. }
  1977. rand_list(){
  1978. IFS=', '
  1979. set -- $*
  1980. unset IFS
  1981. for thing; do
  1982. comp=${thing%:*}
  1983. prob=${thing#$comp}
  1984. prob=${prob#:}
  1985. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  1986. echo "prob ${prob:-0.5}"
  1987. printf '%s\n' $comp
  1988. done
  1989. }
  1990. do_random(){
  1991. action=$1
  1992. shift
  1993. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  1994. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  1995. }
  1996. for opt do
  1997. optval="${opt#*=}"
  1998. case "$opt" in
  1999. --extra-ldflags=*) add_ldflags $optval
  2000. ;;
  2001. --extra-libs=*) add_extralibs $optval
  2002. ;;
  2003. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  2004. ;;
  2005. --enable-debug=*) debuglevel="$optval"
  2006. ;;
  2007. --disable-everything)
  2008. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2009. ;;
  2010. --enable-random|--disable-random)
  2011. action=${opt%%-random}
  2012. do_random ${action#--} $COMPONENT_LIST
  2013. ;;
  2014. --enable-random=*|--disable-random=*)
  2015. action=${opt%%-random=*}
  2016. do_random ${action#--} $optval
  2017. ;;
  2018. --enable-*=*|--disable-*=*)
  2019. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2020. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2021. eval list=\$$(toupper $thing)_LIST
  2022. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2023. $action $(filter "$name" $list)
  2024. ;;
  2025. --enable-?*|--disable-?*)
  2026. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2027. if is_in $option $COMPONENT_LIST; then
  2028. test $action = disable && action=unset
  2029. eval $action \$$(toupper ${option%s})_LIST
  2030. elif is_in $option $CMDLINE_SELECT; then
  2031. $action $option
  2032. else
  2033. die_unknown $opt
  2034. fi
  2035. ;;
  2036. --list-*)
  2037. NAME="${opt#--list-}"
  2038. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2039. NAME=${NAME%s}
  2040. eval show_list $NAME \$$(toupper $NAME)_LIST
  2041. ;;
  2042. --help|-h) show_help
  2043. ;;
  2044. *)
  2045. optname="${opt%%=*}"
  2046. optname="${optname#--}"
  2047. optname=$(echo "$optname" | sed 's/-/_/g')
  2048. if is_in $optname $CMDLINE_SET; then
  2049. eval $optname='$optval'
  2050. elif is_in $optname $CMDLINE_APPEND; then
  2051. append $optname "$optval"
  2052. else
  2053. die_unknown $opt
  2054. fi
  2055. ;;
  2056. esac
  2057. done
  2058. disabled logging && logfile=/dev/null
  2059. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  2060. set >> $logfile
  2061. test -n "$cross_prefix" && enable cross_compile
  2062. if enabled cross_compile; then
  2063. test -n "$arch" && test -n "$target_os" ||
  2064. die "Must specify target arch and OS when cross-compiling"
  2065. fi
  2066. set_default arch target_os postproc_version
  2067. # Check if we should build alternative libpostproc version instead of current
  2068. if test "$postproc_version" = $ALT_PP_VER; then
  2069. LIBPOSTPROC_VERSION=$ALT_PP_VER
  2070. LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR
  2071. LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR
  2072. LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO
  2073. elif test "$postproc_version" != current; then
  2074. die "Invalid argument to --postproc-version. See --help output."
  2075. fi
  2076. ar_default="${cross_prefix}${ar_default}"
  2077. cc_default="${cross_prefix}${cc_default}"
  2078. cxx_default="${cross_prefix}${cxx_default}"
  2079. nm_default="${cross_prefix}${nm_default}"
  2080. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2081. ranlib="${cross_prefix}${ranlib}"
  2082. strip_default="${cross_prefix}${strip_default}"
  2083. sysinclude_default="${sysroot}/usr/include"
  2084. set_default cc cxx nm pkg_config strip sysinclude yasmexe
  2085. enabled cross_compile || host_cc_default=$cc
  2086. set_default host_cc
  2087. if ! $pkg_config --version >/dev/null 2>&1; then
  2088. warn "$pkg_config not found, library detection may fail."
  2089. pkg_config=false
  2090. fi
  2091. exesuf() {
  2092. case $1 in
  2093. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2094. esac
  2095. }
  2096. EXESUF=$(exesuf $target_os)
  2097. HOSTEXESUF=$(exesuf $host_os)
  2098. # set temporary file name
  2099. : ${TMPDIR:=$TEMPDIR}
  2100. : ${TMPDIR:=$TMP}
  2101. : ${TMPDIR:=/tmp}
  2102. if ! check_cmd mktemp -u XXXXXX; then
  2103. # simple replacement for missing mktemp
  2104. # NOT SAFE FOR GENERAL USE
  2105. mktemp(){
  2106. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2107. }
  2108. fi
  2109. tmpfile(){
  2110. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2111. (set -C; exec > $tmp) 2>/dev/null ||
  2112. die "Unable to create temporary file in $TMPDIR."
  2113. append TMPFILES $tmp
  2114. eval $1=$tmp
  2115. }
  2116. trap 'rm -f -- $TMPFILES' EXIT
  2117. tmpfile TMPASM .asm
  2118. tmpfile TMPC .c
  2119. tmpfile TMPCPP .cpp
  2120. tmpfile TMPE $EXESUF
  2121. tmpfile TMPH .h
  2122. tmpfile TMPO .o
  2123. tmpfile TMPS .S
  2124. tmpfile TMPSH .sh
  2125. tmpfile TMPV .ver
  2126. unset -f mktemp
  2127. chmod +x $TMPE
  2128. # make sure we can execute files in $TMPDIR
  2129. cat > $TMPSH 2>> $logfile <<EOF
  2130. #! /bin/sh
  2131. EOF
  2132. chmod +x $TMPSH >> $logfile 2>&1
  2133. if ! $TMPSH >> $logfile 2>&1; then
  2134. cat <<EOF
  2135. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2136. variable to another directory and make sure that it is not mounted noexec.
  2137. EOF
  2138. die "Sanity test failed."
  2139. fi
  2140. pgi_flags(){
  2141. for flag; do
  2142. case $flag in
  2143. -fomit-frame-pointer) echo -Mnoframe ;;
  2144. -g) echo -gopt ;;
  2145. *) echo $flag ;;
  2146. esac
  2147. done
  2148. }
  2149. suncc_flags(){
  2150. for flag; do
  2151. case $flag in
  2152. -march=*|-mcpu=*)
  2153. case "${flag#*=}" in
  2154. native) echo -xtarget=native ;;
  2155. v9|niagara) echo -xarch=sparc ;;
  2156. ultrasparc) echo -xarch=sparcvis ;;
  2157. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2158. i586|pentium) echo -xchip=pentium ;;
  2159. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2160. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2161. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2162. pentium4*) echo -xtarget=pentium4 ;;
  2163. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2164. *-sse3) echo -xarch=sse3 ;;
  2165. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2166. amdfam10|barcelona) echo -xarch=sse4_1 ;;
  2167. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2168. k8|opteron|athlon64|athlon-fx)
  2169. echo -xarch=sse2a ;;
  2170. athlon*) echo -xarch=pentium_proa ;;
  2171. esac
  2172. ;;
  2173. -std=c99) echo -xc99 ;;
  2174. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2175. -fPIC) echo -KPIC -xcode=pic32 ;;
  2176. -W*,*) echo $flag ;;
  2177. -f*-*|-W*) ;;
  2178. *) echo $flag ;;
  2179. esac
  2180. done
  2181. }
  2182. tms470_flags(){
  2183. for flag; do
  2184. case $flag in
  2185. -march=*|-mcpu=*)
  2186. case "${flag#*=}" in
  2187. armv7-a|cortex-a*) echo -mv=7a8 ;;
  2188. armv7-r|cortex-r*) echo -mv=7r4 ;;
  2189. armv7-m|cortex-m*) echo -mv=7m3 ;;
  2190. armv6*|arm11*) echo -mv=6 ;;
  2191. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  2192. echo -mv=5e ;;
  2193. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  2194. esac
  2195. ;;
  2196. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  2197. -mfpu=vfp) echo --float_support=vfpv2 ;;
  2198. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  2199. -msoft-float) echo --float_support=vfplib ;;
  2200. -O[0-3]|-mf=*) echo $flag ;;
  2201. -g) echo -g -mn ;;
  2202. -pds=*) echo $flag ;;
  2203. -D*|-I*) echo $flag ;;
  2204. --gcc|--abi=*) echo $flag ;;
  2205. -me) echo $flag ;;
  2206. esac
  2207. done
  2208. }
  2209. probe_cc(){
  2210. pfx=$1
  2211. _cc=$2
  2212. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  2213. unset _ld_o _ldflags _ld_lib _ld_path
  2214. unset _depflags _DEPCMD _DEPFLAGS
  2215. _flags_filter=echo
  2216. if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2217. _type=llvm_gcc
  2218. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  2219. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  2220. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2221. _cflags_speed='-O3'
  2222. _cflags_size='-Os'
  2223. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  2224. _type=gcc
  2225. gcc_version=$($_cc --version | head -n1)
  2226. gcc_basever=$($_cc -dumpversion)
  2227. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2228. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2229. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2230. if ! $_cc -dumpversion | grep -q '^2\.'; then
  2231. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2232. fi
  2233. _cflags_speed='-O3'
  2234. _cflags_size='-Os'
  2235. elif $_cc --version 2>/dev/null | grep -q Intel; then
  2236. _type=icc
  2237. _ident=$($_cc --version | head -n1)
  2238. _depflags='-MMD'
  2239. _cflags_speed='-O3'
  2240. _cflags_size='-Os'
  2241. _cflags_noopt='-O1'
  2242. elif $_cc -v 2>&1 | grep -q xlc; then
  2243. _type=xlc
  2244. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  2245. _cflags_speed='-O5'
  2246. _cflags_size='-O5 -qcompact'
  2247. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  2248. _type=ccc
  2249. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  2250. _DEPFLAGS='-M'
  2251. debuglevel=3
  2252. _ldflags='-Wl,-z,now' # calls to libots crash without this
  2253. _cflags_speed='-fast'
  2254. _cflags_size='-O1'
  2255. elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  2256. test -d "$sysroot" || die "No valid sysroot specified."
  2257. _type=armcc
  2258. _ident=$($_cc --vsn | head -n1)
  2259. armcc_conf="$PWD/armcc.conf"
  2260. $_cc --arm_linux_configure \
  2261. --arm_linux_config_file="$armcc_conf" \
  2262. --configure_sysroot="$sysroot" \
  2263. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2264. die "Error creating armcc configuration file."
  2265. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2266. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  2267. as_default="${cross_prefix}gcc"
  2268. _depflags='-MMD'
  2269. _cflags_speed='-O3'
  2270. _cflags_size='-Os'
  2271. elif $_cc -version 2>/dev/null | grep -q TMS470; then
  2272. _type=tms470
  2273. _ident=$($_cc -version | head -n1 | tr -s ' ')
  2274. _flags='--gcc --abi=eabi -me'
  2275. _cflags='-D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__='
  2276. _cc_e='-ppl -fe=$@'
  2277. _cc_o='-fe=$@'
  2278. as_default="${cross_prefix}gcc"
  2279. ld_default="${cross_prefix}gcc"
  2280. _depflags='-ppa -ppd=$(@:.o=.d)'
  2281. _cflags_speed='-O3 -mf=5'
  2282. _cflags_size='-O3 -mf=2'
  2283. _flags_filter=tms470_flags
  2284. elif $_cc -v 2>&1 | grep -q clang; then
  2285. _type=clang
  2286. _ident=$($_cc --version | head -n1)
  2287. _depflags='-MMD'
  2288. _cflags_speed='-O3'
  2289. _cflags_size='-Os'
  2290. elif $_cc -V 2>&1 | grep -q Sun; then
  2291. _type=suncc
  2292. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2293. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2294. _DEPFLAGS='-xM1 -xc99'
  2295. _ldflags='-std=c99'
  2296. _cflags_speed='-O5'
  2297. _cflags_size='-O5 -xspace'
  2298. _flags_filter=suncc_flags
  2299. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2300. _type=pathscale
  2301. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2302. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2303. _cflags_speed='-O2'
  2304. _cflags_size='-Os'
  2305. _flags_filter='filter_out -Wdisabled-optimization'
  2306. elif $_cc -v 2>&1 | grep -q Open64; then
  2307. _type=open64
  2308. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2309. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2310. _cflags_speed='-O2'
  2311. _cflags_size='-Os'
  2312. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2313. elif $_cc -V 2>&1 | grep -q Portland; then
  2314. _type=pgi
  2315. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  2316. opt_common='-alias=ansi -Mlre -Mpre'
  2317. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  2318. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  2319. _cflags_noopt="-O1"
  2320. _flags_filter=pgi_flags
  2321. fi
  2322. eval ${pfx}_type=\$_type
  2323. eval ${pfx}_ident=\$_ident
  2324. }
  2325. set_ccvars(){
  2326. eval ${1}_C=\${_cc_c-\${${1}_C}}
  2327. eval ${1}_E=\${_cc_e-\${${1}_E}}
  2328. eval ${1}_O=\${_cc_o-\${${1}_O}}
  2329. if [ -n "$_depflags" ]; then
  2330. eval ${1}_DEPFLAGS=\$_depflags
  2331. else
  2332. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  2333. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  2334. eval DEP${1}FLAGS=\$_flags
  2335. fi
  2336. }
  2337. probe_cc cc "$cc"
  2338. cflags_filter=$_flags_filter
  2339. cflags_speed=$_cflags_speed
  2340. cflags_size=$_cflags_size
  2341. cflags_noopt=$_cflags_noopt
  2342. add_cflags $_flags $_cflags
  2343. cc_ldflags=$_ldflags
  2344. set_ccvars CC
  2345. probe_cc hostcc "$host_cc"
  2346. host_cflags_filter=$_flags_filter
  2347. add_host_cflags $_flags $_cflags
  2348. set_ccvars HOSTCC
  2349. test -n "$cc_type" && enable $cc_type ||
  2350. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  2351. : ${as_default:=$cc}
  2352. : ${dep_cc_default:=$cc}
  2353. : ${ld_default:=$cc}
  2354. : ${host_ld_default:=$host_cc}
  2355. set_default ar as dep_cc ld host_ld
  2356. probe_cc as "$as"
  2357. asflags_filter=$_flags_filter
  2358. add_asflags $_flags $_cflags
  2359. set_ccvars AS
  2360. probe_cc ld "$ld"
  2361. ldflags_filter=$_flags_filter
  2362. add_ldflags $_flags $_ldflags
  2363. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  2364. LD_O=${_ld_o-$LD_O}
  2365. LD_LIB=${_ld_lib-$LD_LIB}
  2366. LD_PATH=${_ld_path-$LD_PATH}
  2367. probe_cc hostld "$host_ld"
  2368. host_ldflags_filter=$_flags_filter
  2369. add_host_ldflags $_flags $_ldflags
  2370. HOSTLD_O=${_ld_o-$HOSTLD_O}
  2371. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  2372. probe_cc depcc "$dep_cc"
  2373. CCDEP=${_DEPCMD:-$DEPCMD}
  2374. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  2375. DEPCCFLAGS=$_flags
  2376. fi
  2377. add_cflags $extra_cflags
  2378. add_cxxflags $extra_cxxflags
  2379. add_asflags $extra_cflags
  2380. if test -n "$sysroot"; then
  2381. case "$cc_type" in
  2382. gcc|llvm_gcc|clang)
  2383. add_cppflags --sysroot="$sysroot"
  2384. add_ldflags --sysroot="$sysroot"
  2385. ;;
  2386. tms470)
  2387. add_cppflags -I"$sysinclude"
  2388. add_ldflags --sysroot="$sysroot"
  2389. ;;
  2390. esac
  2391. fi
  2392. if test "$cpu" = host; then
  2393. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  2394. case "$cc_type" in
  2395. gcc|llvm_gcc)
  2396. check_native(){
  2397. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  2398. sed -n "/cc1.*$1=/{
  2399. s/.*$1=\\([^ ]*\\).*/\\1/
  2400. p
  2401. q
  2402. }" $TMPE
  2403. }
  2404. cpu=$(check_native -march || check_native -mcpu)
  2405. ;;
  2406. esac
  2407. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  2408. fi
  2409. # Deal with common $arch aliases
  2410. case "$arch" in
  2411. arm*|iPad*)
  2412. arch="arm"
  2413. ;;
  2414. mips|mipsel|IP*)
  2415. arch="mips"
  2416. ;;
  2417. mips64*)
  2418. arch="mips"
  2419. subarch="mips64"
  2420. ;;
  2421. parisc|hppa)
  2422. arch="parisc"
  2423. ;;
  2424. parisc64|hppa64)
  2425. arch="parisc"
  2426. subarch="parisc64"
  2427. ;;
  2428. "Power Macintosh"|ppc|powerpc|ppc64|powerpc64)
  2429. arch="ppc"
  2430. ;;
  2431. s390|s390x)
  2432. arch="s390"
  2433. ;;
  2434. sh4|sh)
  2435. arch="sh4"
  2436. ;;
  2437. sun4u|sparc64)
  2438. arch="sparc"
  2439. subarch="sparc64"
  2440. ;;
  2441. i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  2442. arch="x86"
  2443. ;;
  2444. esac
  2445. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  2446. enable $arch
  2447. # Add processor-specific flags
  2448. if test "$cpu" = generic; then
  2449. : do nothing
  2450. elif enabled ppc; then
  2451. case $(tolower $cpu) in
  2452. 601|ppc601|powerpc601)
  2453. cpuflags="-mcpu=601"
  2454. disable altivec
  2455. ;;
  2456. 603*|ppc603*|powerpc603*)
  2457. cpuflags="-mcpu=603"
  2458. disable altivec
  2459. ;;
  2460. 604*|ppc604*|powerpc604*)
  2461. cpuflags="-mcpu=604"
  2462. disable altivec
  2463. ;;
  2464. g3|75*|ppc75*|powerpc75*)
  2465. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  2466. disable altivec
  2467. ;;
  2468. g4|745*|ppc745*|powerpc745*)
  2469. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  2470. ;;
  2471. 74*|ppc74*|powerpc74*)
  2472. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  2473. ;;
  2474. g5|970|ppc970|powerpc970)
  2475. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  2476. ;;
  2477. power[3-7]*)
  2478. cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64"
  2479. ;;
  2480. cell)
  2481. cpuflags="-mcpu=cell"
  2482. enable ldbrx
  2483. ;;
  2484. e500mc)
  2485. cpuflags="-mcpu=e500mc"
  2486. disable altivec
  2487. ;;
  2488. e500v2)
  2489. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  2490. disable altivec
  2491. ;;
  2492. e500)
  2493. cpuflags="-mcpu=8540 -mhard-float"
  2494. disable altivec
  2495. ;;
  2496. esac
  2497. elif enabled x86; then
  2498. case $cpu in
  2499. i[345]86|pentium)
  2500. cpuflags="-march=$cpu"
  2501. disable mmx
  2502. ;;
  2503. # targets that do NOT support conditional mov (cmov)
  2504. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  2505. cpuflags="-march=$cpu"
  2506. disable cmov
  2507. ;;
  2508. # targets that do support conditional mov (cmov)
  2509. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom)
  2510. cpuflags="-march=$cpu"
  2511. enable cmov
  2512. enable fast_cmov
  2513. ;;
  2514. # targets that do support conditional mov but on which it's slow
  2515. pentium4|pentium4m|prescott|nocona)
  2516. cpuflags="-march=$cpu"
  2517. enable cmov
  2518. disable fast_cmov
  2519. ;;
  2520. esac
  2521. elif enabled sparc; then
  2522. case $cpu in
  2523. niagara)
  2524. cpuflags="-mcpu=$cpu"
  2525. disable vis
  2526. ;;
  2527. sparc64)
  2528. cpuflags="-mcpu=v9"
  2529. ;;
  2530. esac
  2531. elif enabled arm; then
  2532. case $cpu in
  2533. armv*)
  2534. cpuflags="-march=$cpu"
  2535. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  2536. ;;
  2537. *)
  2538. cpuflags="-mcpu=$cpu"
  2539. case $cpu in
  2540. cortex-a*) subarch=armv7a ;;
  2541. cortex-r*) subarch=armv7r ;;
  2542. cortex-m*) enable thumb; subarch=armv7m ;;
  2543. arm11*) subarch=armv6 ;;
  2544. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  2545. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  2546. esac
  2547. ;;
  2548. esac
  2549. elif enabled alpha; then
  2550. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  2551. elif enabled bfin; then
  2552. cpuflags="-mcpu=$cpu"
  2553. elif enabled mips; then
  2554. cpuflags="-march=$cpu"
  2555. case $cpu in
  2556. 24kc)
  2557. disable mipsfpu
  2558. disable mipsdspr1
  2559. disable mipsdspr2
  2560. ;;
  2561. 24kf*)
  2562. disable mipsdspr1
  2563. disable mipsdspr2
  2564. ;;
  2565. 24kec|34kc|1004kc)
  2566. disable mipsfpu
  2567. disable mipsdspr2
  2568. ;;
  2569. 24kef*|34kf*|1004kf*)
  2570. disable mipsdspr2
  2571. ;;
  2572. 74kc)
  2573. disable mipsfpu
  2574. ;;
  2575. esac
  2576. elif enabled avr32; then
  2577. case $cpu in
  2578. ap7[02]0[0-2])
  2579. subarch="avr32_ap"
  2580. cpuflags="-mpart=$cpu"
  2581. ;;
  2582. ap)
  2583. subarch="avr32_ap"
  2584. cpuflags="-march=$cpu"
  2585. ;;
  2586. uc3[ab]*)
  2587. subarch="avr32_uc"
  2588. cpuflags="-mcpu=$cpu"
  2589. ;;
  2590. uc)
  2591. subarch="avr32_uc"
  2592. cpuflags="-march=$cpu"
  2593. ;;
  2594. esac
  2595. fi
  2596. add_cflags $cpuflags
  2597. add_asflags $cpuflags
  2598. # compiler sanity check
  2599. check_exec <<EOF
  2600. int main(void){ return 0; }
  2601. EOF
  2602. if test "$?" != 0; then
  2603. echo "$cc is unable to create an executable file."
  2604. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  2605. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  2606. echo "Only do this if you know what cross compiling means."
  2607. fi
  2608. die "C compiler test failed."
  2609. fi
  2610. add_cppflags -D_ISOC99_SOURCE
  2611. add_cxxflags -D__STDC_CONSTANT_MACROS
  2612. check_cflags -std=c99
  2613. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  2614. #include <stdlib.h>
  2615. EOF
  2616. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  2617. #include <stdlib.h>
  2618. EOF
  2619. check_host_cflags -std=c99
  2620. check_host_cflags -Wall
  2621. case "$arch" in
  2622. alpha|ia64|mips|parisc|sparc)
  2623. spic=$shared
  2624. ;;
  2625. x86)
  2626. subarch="x86_32"
  2627. check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
  2628. if test "$subarch" = "x86_64"; then
  2629. spic=$shared
  2630. fi
  2631. ;;
  2632. ppc)
  2633. check_cc <<EOF && subarch="ppc64"
  2634. int test[(int)sizeof(char*) - 7];
  2635. EOF
  2636. ;;
  2637. esac
  2638. enable $subarch
  2639. enabled spic && enable pic
  2640. # OS specific
  2641. case $target_os in
  2642. haiku)
  2643. prefix_default="/boot/common"
  2644. network_extralibs="-lnetwork"
  2645. host_libs=
  2646. ;;
  2647. sunos)
  2648. FFSERVERLDFLAGS=""
  2649. SHFLAGS='-shared -Wl,-h,$$(@F)'
  2650. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  2651. network_extralibs="-lsocket -lnsl"
  2652. add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  2653. # When using suncc to build, the Solaris linker will mark
  2654. # an executable with each instruction set encountered by
  2655. # the Solaris assembler. As our libraries contain their own
  2656. # guards for processor-specific code, instead suppress
  2657. # generation of the HWCAPS ELF section on Solaris x86 only.
  2658. enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile
  2659. nm_opts='-P -g'
  2660. ;;
  2661. netbsd)
  2662. disable symver
  2663. oss_indev_extralibs="-lossaudio"
  2664. oss_outdev_extralibs="-lossaudio"
  2665. ;;
  2666. openbsd|bitrig)
  2667. # On OpenBSD 4.5. the compiler does not use PIC unless
  2668. # explicitly using -fPIC. FFmpeg builds fine without PIC,
  2669. # however the generated executable will not do anything
  2670. # (simply quits with exit-code 1, no crash, no output).
  2671. # Thus explicitly enable PIC here.
  2672. enable pic
  2673. disable symver
  2674. SHFLAGS='-shared'
  2675. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
  2676. SLIB_INSTALL_LINKS=
  2677. oss_indev_extralibs="-lossaudio"
  2678. oss_outdev_extralibs="-lossaudio"
  2679. ;;
  2680. dragonfly)
  2681. disable symver
  2682. ;;
  2683. freebsd)
  2684. ;;
  2685. bsd/os)
  2686. add_extralibs -lpoll -lgnugetopt
  2687. strip="strip -d"
  2688. ;;
  2689. darwin)
  2690. gas="gas-preprocessor.pl $cc"
  2691. enabled ppc && add_asflags -force_cpusubtype_ALL
  2692. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  2693. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  2694. strip="${strip} -x"
  2695. add_ldflags -Wl,-dynamic,-search_paths_first
  2696. SLIBSUF=".dylib"
  2697. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  2698. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  2699. FFSERVERLDFLAGS=-Wl,-bind_at_load
  2700. objformat="macho"
  2701. enabled x86_64 && objformat="macho64"
  2702. enabled_any pic shared ||
  2703. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  2704. ;;
  2705. mingw32*)
  2706. if test $target_os = "mingw32ce"; then
  2707. disable network
  2708. else
  2709. target_os=mingw32
  2710. fi
  2711. LIBTARGET=i386
  2712. if enabled x86_64; then
  2713. LIBTARGET="i386:x86-64"
  2714. elif enabled arm; then
  2715. LIBTARGET=arm-wince
  2716. fi
  2717. shlibdir_default="$bindir_default"
  2718. SLIBPREF=""
  2719. SLIBSUF=".dll"
  2720. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2721. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2722. dlltool="${cross_prefix}dlltool"
  2723. if check_cmd lib.exe -list; then
  2724. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  2725. if enabled x86_64; then
  2726. LIBTARGET=x64
  2727. fi
  2728. elif check_cmd $dlltool --version; then
  2729. SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  2730. fi
  2731. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  2732. SLIB_INSTALL_LINKS=
  2733. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  2734. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  2735. 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'
  2736. objformat="win32"
  2737. enable dos_paths
  2738. check_cflags -fno-common
  2739. check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
  2740. || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  2741. die "ERROR: MinGW runtime version must be >= 3.15."
  2742. add_cppflags -U__STRICT_ANSI__
  2743. ;;
  2744. cygwin*)
  2745. target_os=cygwin
  2746. shlibdir_default="$bindir_default"
  2747. SLIBPREF="cyg"
  2748. SLIBSUF=".dll"
  2749. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2750. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2751. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  2752. SLIB_INSTALL_LINKS=
  2753. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  2754. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  2755. objformat="win32"
  2756. enable dos_paths
  2757. check_cflags -fno-common
  2758. add_cppflags -U__STRICT_ANSI__
  2759. ;;
  2760. *-dos|freedos|opendos)
  2761. network_extralibs="-lsocket"
  2762. objformat="coff"
  2763. enable dos_paths
  2764. add_cppflags -U__STRICT_ANSI__
  2765. ;;
  2766. linux)
  2767. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2768. enable dv1394
  2769. ;;
  2770. irix*)
  2771. target_os=irix
  2772. ranlib="echo ignoring ranlib"
  2773. ;;
  2774. os/2*)
  2775. strip="lxlite -CS"
  2776. ln_s="cp -f"
  2777. objformat="aout"
  2778. add_cppflags -D_GNU_SOURCE
  2779. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  2780. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  2781. FFSERVERLDFLAGS=""
  2782. LIBSUF="_s.a"
  2783. SLIBPREF=""
  2784. SLIBSUF=".dll"
  2785. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  2786. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  2787. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  2788. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  2789. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  2790. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  2791. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  2792. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  2793. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  2794. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  2795. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  2796. enable dos_paths
  2797. enable_weak os2threads
  2798. ;;
  2799. gnu/kfreebsd)
  2800. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
  2801. ;;
  2802. gnu)
  2803. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2804. ;;
  2805. qnx)
  2806. add_cppflags -D_QNX_SOURCE
  2807. network_extralibs="-lsocket"
  2808. ;;
  2809. symbian)
  2810. SLIBSUF=".dll"
  2811. enable dos_paths
  2812. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  2813. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  2814. add_ldflags -Wl,--target1-abs,--no-undefined \
  2815. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  2816. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  2817. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  2818. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  2819. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  2820. ;;
  2821. none)
  2822. ;;
  2823. *)
  2824. die "Unknown OS '$target_os'."
  2825. ;;
  2826. esac
  2827. esc(){
  2828. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  2829. }
  2830. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  2831. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
  2832. set_default $PATHS_LIST
  2833. # we need to build at least one lib type
  2834. if ! enabled_any static shared; then
  2835. cat <<EOF
  2836. At least one library type must be built.
  2837. Specify --enable-static to build the static libraries or --enable-shared to
  2838. build the shared libraries as well. To only build the shared libraries specify
  2839. --disable-static in addition to --enable-shared.
  2840. EOF
  2841. exit 1;
  2842. fi
  2843. die_license_disabled() {
  2844. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  2845. }
  2846. die_license_disabled_gpl() {
  2847. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  2848. }
  2849. die_license_disabled gpl libcdio
  2850. die_license_disabled gpl libutvideo
  2851. die_license_disabled gpl libx264
  2852. die_license_disabled gpl libxavs
  2853. die_license_disabled gpl libxvid
  2854. die_license_disabled gpl x11grab
  2855. die_license_disabled nonfree libaacplus
  2856. die_license_disabled nonfree libfaac
  2857. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  2858. enabled gpl && die_license_disabled_gpl nonfree openssl
  2859. die_license_disabled version3 libopencore_amrnb
  2860. die_license_disabled version3 libopencore_amrwb
  2861. die_license_disabled version3 libvo_aacenc
  2862. die_license_disabled version3 libvo_amrwbenc
  2863. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  2864. disabled optimizations || check_cflags -fomit-frame-pointer
  2865. enable_pic() {
  2866. enable pic
  2867. add_cppflags -DPIC
  2868. add_cflags -fPIC
  2869. add_asflags -fPIC
  2870. }
  2871. enabled pic && enable_pic
  2872. check_cc <<EOF || die "Symbol mangling check failed."
  2873. int ff_extern;
  2874. EOF
  2875. sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  2876. extern_prefix=${sym%%ff_extern*}
  2877. check_cc <<EOF && enable inline_asm
  2878. void foo(void) { __asm__ volatile ("" ::); }
  2879. EOF
  2880. _restrict=
  2881. for restrict_keyword in restrict __restrict__ __restrict; do
  2882. check_cc <<EOF && _restrict=$restrict_keyword && break
  2883. void foo(char * $restrict_keyword p);
  2884. EOF
  2885. done
  2886. check_cc <<EOF && enable attribute_packed
  2887. struct { int x; } __attribute__((packed)) x;
  2888. EOF
  2889. check_cc <<EOF && enable attribute_may_alias
  2890. union { int x; } __attribute__((may_alias)) x;
  2891. EOF
  2892. check_cc <<EOF || die "endian test failed"
  2893. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  2894. EOF
  2895. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  2896. if enabled alpha; then
  2897. check_cflags -mieee
  2898. elif enabled arm; then
  2899. enabled thumb && check_cflags -mthumb || check_cflags -marm
  2900. nogas=die
  2901. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  2902. enable vfp_args
  2903. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  2904. case "${cross_prefix:-$cc}" in
  2905. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  2906. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  2907. __asm__ (".eabi_attribute 28, 1");
  2908. int main(void) { return 0; }
  2909. EOF
  2910. esac
  2911. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  2912. fi
  2913. enabled armv5te && check_inline_asm armv5te '"qadd r0, r0, r0"'
  2914. enabled armv6 && check_inline_asm armv6 '"sadd16 r0, r0, r0"'
  2915. enabled armv6t2 && check_inline_asm armv6t2 '"movt r0, #0"'
  2916. enabled armvfp && check_inline_asm armvfp '"fadds s0, s0, s0"'
  2917. enabled neon && check_inline_asm neon '"vadd.i16 q0, q0, q0"'
  2918. enabled vfpv3 && check_inline_asm vfpv3 '"vmov.f32 s0, #1.0"'
  2919. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  2920. check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
  2921. enabled_all armv6t2 shared !pic && enable_pic
  2922. elif enabled mips; then
  2923. check_inline_asm loongson '"dmult.g $1, $2, $3"'
  2924. enabled mmi && check_inline_asm mmi '"lq $2, 0($2)"'
  2925. enabled mips32r2 && add_cflags "-mips32r2" && add_asflags "-mips32r2" &&
  2926. check_inline_asm mips32r2 '"rotr $t0, $t1, 1"'
  2927. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  2928. check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  2929. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  2930. check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  2931. enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
  2932. check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  2933. elif enabled ppc; then
  2934. enable local_aligned_8 local_aligned_16
  2935. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  2936. check_inline_asm ibm_asm '"add 0, 0, 0"'
  2937. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  2938. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  2939. # AltiVec flags: The FSF version of GCC differs from the Apple version
  2940. if enabled altivec; then
  2941. nogas=warn
  2942. check_cflags -maltivec -mabi=altivec &&
  2943. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  2944. check_cflags -faltivec
  2945. # check if our compiler supports Motorola AltiVec C API
  2946. check_cc <<EOF || disable altivec
  2947. $inc_altivec_h
  2948. int main(void) {
  2949. vector signed int v1 = (vector signed int) { 0 };
  2950. vector signed int v2 = (vector signed int) { 1 };
  2951. v1 = vec_add(v1, v2);
  2952. return 0;
  2953. }
  2954. EOF
  2955. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  2956. fi
  2957. elif enabled sparc; then
  2958. enabled vis &&
  2959. check_inline_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  2960. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  2961. elif enabled x86; then
  2962. check_code ld immintrin.h "__xgetbv(0)" "cc" && enable xgetbv
  2963. check_code ld intrin.h "int info[4]; __cpuid(info, 0)" "cc" && enable cpuid
  2964. check_code ld intrin.h "__rdtsc()" "cc" && enable rdtsc
  2965. check_code ld intrin.h "unsigned int x = __readeflags()" "cc" && enable rweflags
  2966. check_code ld mmintrin.h "_mm_empty()" "cc" && enable mm_empty
  2967. enable local_aligned_8 local_aligned_16
  2968. # check whether EBP is available on x86
  2969. # As 'i' is stored on the stack, this program will crash
  2970. # if the base pointer is used to access it because the
  2971. # base pointer is cleared in the inline assembly code.
  2972. check_exec_crash <<EOF && enable ebp_available
  2973. volatile int i=0;
  2974. __asm__ volatile (
  2975. "xorl %%ebp, %%ebp"
  2976. ::: "%ebp");
  2977. return i;
  2978. EOF
  2979. # check whether EBX is available on x86
  2980. check_inline_asm ebx_available '""::"b"(0)' &&
  2981. check_inline_asm ebx_available '"":::"%ebx"'
  2982. # check whether xmm clobbers are supported
  2983. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  2984. # check whether binutils is new enough to compile SSSE3/MMXEXT
  2985. enabled ssse3 && check_inline_asm ssse3 '"pabsw %xmm0, %xmm0"'
  2986. enabled mmxext && check_inline_asm mmxext '"pmaxub %mm0, %mm1"'
  2987. if ! disabled_any asm mmx yasm; then
  2988. if check_cmd $yasmexe --version; then
  2989. enabled x86_64 && yasm_extra="-m amd64"
  2990. yasm_debug="-g dwarf2"
  2991. elif check_cmd nasm -v; then
  2992. yasmexe=nasm
  2993. yasm_debug="-g -F dwarf"
  2994. enabled x86_64 && test "$objformat" = elf && objformat=elf64
  2995. fi
  2996. YASMFLAGS="-f $objformat $yasm_extra"
  2997. enabled pic && append YASMFLAGS "-DPIC"
  2998. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  2999. case "$objformat" in
  3000. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  3001. esac
  3002. check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
  3003. die "yasm not found, use --disable-yasm for a crippled build"
  3004. check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
  3005. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4
  3006. check_yasm "CPU amdnop" && enable cpunop
  3007. fi
  3008. case "$cpu" in
  3009. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  3010. disable fast_clz
  3011. ;;
  3012. esac
  3013. fi
  3014. if enabled asm; then
  3015. as=${gas:=$as}
  3016. check_inline_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
  3017. $nogas "GNU assembler not found, install gas-preprocessor"
  3018. fi
  3019. check_ldflags -Wl,--as-needed
  3020. if check_func dlopen; then
  3021. ldl=
  3022. elif check_func dlopen -ldl; then
  3023. ldl=-ldl
  3024. fi
  3025. if enabled network; then
  3026. check_type "sys/types.h sys/socket.h" socklen_t
  3027. check_type netdb.h "struct addrinfo"
  3028. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  3029. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  3030. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  3031. check_type netinet/in.h "struct sockaddr_in6"
  3032. check_type poll.h "struct pollfd"
  3033. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  3034. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  3035. check_type netinet/sctp.h "struct sctp_event_subscribe"
  3036. check_func getaddrinfo $network_extralibs
  3037. # Prefer arpa/inet.h over winsock2
  3038. if check_header arpa/inet.h ; then
  3039. check_func closesocket
  3040. elif check_header winsock2.h ; then
  3041. check_func_headers winsock2.h closesocket -lws2 &&
  3042. network_extralibs="-lws2" ||
  3043. { check_func_headers winsock2.h closesocket -lws2_32 &&
  3044. network_extralibs="-lws2_32"; }
  3045. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  3046. check_type ws2tcpip.h socklen_t
  3047. check_type ws2tcpip.h "struct addrinfo"
  3048. check_type ws2tcpip.h "struct group_source_req"
  3049. check_type ws2tcpip.h "struct ip_mreq_source"
  3050. check_type ws2tcpip.h "struct ipv6_mreq"
  3051. check_type winsock2.h "struct pollfd"
  3052. check_type ws2tcpip.h "struct sockaddr_in6"
  3053. check_type ws2tcpip.h "struct sockaddr_storage"
  3054. check_struct winsock2.h "struct sockaddr" sa_len
  3055. else
  3056. disable network
  3057. fi
  3058. fi
  3059. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  3060. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  3061. check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
  3062. check_func fcntl
  3063. check_func fork
  3064. check_func gethrtime
  3065. check_func getopt
  3066. check_func getrusage
  3067. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  3068. check_func gettimeofday
  3069. check_func inet_aton $network_extralibs
  3070. check_func isatty
  3071. check_func localtime_r
  3072. check_func ${malloc_prefix}memalign && enable memalign
  3073. check_func mkstemp
  3074. check_func mmap
  3075. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  3076. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  3077. check_func setrlimit
  3078. check_func snprintf
  3079. check_func strerror_r
  3080. check_func strptime
  3081. check_func sched_getaffinity
  3082. check_func sysconf
  3083. check_func sysctl
  3084. check_func usleep
  3085. check_func_headers conio.h kbhit
  3086. check_func_headers windows.h PeekNamedPipe
  3087. check_func_headers io.h setmode
  3088. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  3089. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  3090. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  3091. check_func_headers windows.h GetProcessAffinityMask
  3092. check_func_headers windows.h GetProcessTimes
  3093. check_func_headers windows.h GetSystemTimeAsFileTime
  3094. check_func_headers windows.h MapViewOfFile
  3095. check_func_headers windows.h Sleep
  3096. check_func_headers windows.h VirtualAlloc
  3097. check_func_headers glob.h glob
  3098. # Check for MSVCRT; it has a broken strtod() that can't parse some input.
  3099. # Use old dos symbol to detect it. If we are on mingw, it already provides
  3100. # its own replacement and we don't need to redo that.
  3101. if check_func _get_doserrno; then
  3102. if test $target_os != mingw32; then
  3103. enable broken_strtod
  3104. fi
  3105. fi
  3106. check_header dlfcn.h
  3107. check_header dxva.h
  3108. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  3109. check_header libcrystalhd/libcrystalhd_if.h
  3110. check_header malloc.h
  3111. check_header poll.h
  3112. check_header sys/mman.h
  3113. check_header sys/param.h
  3114. check_header sys/resource.h
  3115. check_header sys/select.h
  3116. check_header sys/time.h
  3117. check_header termios.h
  3118. check_header unistd.h
  3119. check_header vdpau/vdpau.h
  3120. check_header vdpau/vdpau_x11.h
  3121. check_header windows.h
  3122. check_header X11/extensions/XvMClib.h
  3123. check_header asm/types.h
  3124. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  3125. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  3126. # check for VDA header
  3127. if ! disabled vda; then
  3128. if check_header VideoDecodeAcceleration/VDADecoder.h; then
  3129. enable vda
  3130. add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
  3131. fi
  3132. fi
  3133. if ! disabled w32threads && ! enabled pthreads; then
  3134. check_func _beginthreadex && enable w32threads
  3135. fi
  3136. # check for some common methods of building with pthread support
  3137. # do this before the optional library checks as some of them require pthreads
  3138. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  3139. enable pthreads
  3140. if check_func pthread_create; then
  3141. :
  3142. elif check_func pthread_create -pthread; then
  3143. add_cflags -pthread
  3144. add_extralibs -pthread
  3145. elif check_func pthread_create -pthreads; then
  3146. add_cflags -pthreads
  3147. add_extralibs -pthreads
  3148. elif check_func pthread_create -lpthreadGC2; then
  3149. add_extralibs -lpthreadGC2
  3150. elif ! check_lib pthread.h pthread_create -lpthread; then
  3151. disable pthreads
  3152. fi
  3153. fi
  3154. for thread in $THREADS_LIST; do
  3155. if enabled $thread; then
  3156. test -n "$thread_type" &&
  3157. die "ERROR: Only one thread type must be selected." ||
  3158. thread_type="$thread"
  3159. fi
  3160. done
  3161. if enabled pthreads; then
  3162. check_func pthread_cancel
  3163. fi
  3164. check_lib math.h sin -lm && LIBM="-lm"
  3165. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  3166. enabled vaapi && require vaapi va/va.h vaInitialize -lva
  3167. check_mathfunc cbrtf
  3168. check_mathfunc exp2
  3169. check_mathfunc exp2f
  3170. check_mathfunc isinf
  3171. check_mathfunc isnan
  3172. check_mathfunc llrint
  3173. check_mathfunc llrintf
  3174. check_mathfunc log2
  3175. check_mathfunc log2f
  3176. check_mathfunc lrint
  3177. check_mathfunc lrintf
  3178. check_mathfunc rint
  3179. check_mathfunc round
  3180. check_mathfunc roundf
  3181. check_mathfunc trunc
  3182. check_mathfunc truncf
  3183. # these are off by default, so fail if requested and not available
  3184. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
  3185. enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  3186. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  3187. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  3188. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  3189. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  3190. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  3191. enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
  3192. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  3193. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  3194. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  3195. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  3196. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  3197. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  3198. flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
  3199. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  3200. enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
  3201. enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
  3202. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  3203. enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
  3204. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  3205. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  3206. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  3207. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  3208. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  3209. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  3210. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  3211. enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
  3212. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  3213. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  3214. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  3215. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  3216. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  3217. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  3218. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  3219. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  3220. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  3221. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  3222. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  3223. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  3224. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  3225. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  3226. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  3227. enabled libvpx && {
  3228. enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  3229. die "ERROR: libvpx decoder must be installed and version must be >=0.9.1"; }
  3230. enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  3231. die "ERROR: libvpx encoder version must be >=0.9.7"; } }
  3232. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
  3233. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  3234. die "ERROR: libx264 must be installed and version must be >= 0.118."; }
  3235. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  3236. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  3237. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  3238. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  3239. die "ERROR: openal not found"; } &&
  3240. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  3241. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  3242. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  3243. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  3244. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  3245. die "ERROR: openssl not found"; }
  3246. if enabled gnutls; then
  3247. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  3248. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  3249. fi
  3250. # libdc1394 check
  3251. if enabled libdc1394; then
  3252. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  3253. enable libdc1394_2; } ||
  3254. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  3255. enable libdc1394_1; } ||
  3256. die "ERROR: No version of libdc1394 found "
  3257. fi
  3258. SDL_CONFIG="${cross_prefix}sdl-config"
  3259. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  3260. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3261. enable sdl &&
  3262. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3263. else
  3264. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  3265. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  3266. sdl_libs=$("${SDL_CONFIG}" --libs)
  3267. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  3268. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3269. enable sdl &&
  3270. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3271. fi
  3272. fi
  3273. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  3274. texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  3275. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  3276. perl --version > /dev/null 2>&1 && enable perl || disable perl
  3277. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  3278. check_header linux/fb.h
  3279. check_header linux/videodev.h
  3280. check_header linux/videodev2.h
  3281. check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
  3282. check_header sys/videoio.h
  3283. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  3284. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  3285. # w32api 3.12 had it defined wrong
  3286. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  3287. check_type "dshow.h" IBaseFilter
  3288. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  3289. { check_header dev/bktr/ioctl_meteor.h &&
  3290. check_header dev/bktr/ioctl_bt848.h; } ||
  3291. { check_header machine/ioctl_meteor.h &&
  3292. check_header machine/ioctl_bt848.h; } ||
  3293. { check_header dev/video/meteor/ioctl_meteor.h &&
  3294. check_header dev/video/bktr/ioctl_bt848.h; } ||
  3295. check_header dev/ic/bt8xx.h
  3296. check_header sndio.h
  3297. if check_struct sys/soundcard.h audio_buf_info bytes; then
  3298. enable_safe sys/soundcard.h
  3299. else
  3300. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  3301. #include <sys/soundcard.h>
  3302. audio_buf_info abc;
  3303. EOF
  3304. fi
  3305. check_header soundcard.h
  3306. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  3307. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  3308. check_func jack_port_get_latency_range -ljack
  3309. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  3310. enabled libcdio &&
  3311. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio"
  3312. enabled x11grab &&
  3313. require X11 X11/Xlib.h XOpenDisplay -lX11 &&
  3314. require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
  3315. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  3316. if ! disabled vaapi; then
  3317. check_lib va/va.h vaInitialize -lva && {
  3318. check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
  3319. warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
  3320. } || disable vaapi
  3321. fi
  3322. if ! disabled vdpau && enabled vdpau_vdpau_h; then
  3323. check_cpp_condition \
  3324. vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  3325. { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
  3326. disable vdpau; }
  3327. fi
  3328. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  3329. enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
  3330. test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
  3331. # add some useful compiler flags if supported
  3332. check_cflags -Wdeclaration-after-statement
  3333. check_cflags -Wall
  3334. check_cflags -Wno-parentheses
  3335. check_cflags -Wno-switch
  3336. check_cflags -Wno-format-zero-length
  3337. check_cflags -Wdisabled-optimization
  3338. check_cflags -Wpointer-arith
  3339. check_cflags -Wredundant-decls
  3340. check_cflags -Wno-pointer-sign
  3341. check_cflags -Wwrite-strings
  3342. check_cflags -Wtype-limits
  3343. check_cflags -Wundef
  3344. check_cflags -Wmissing-prototypes
  3345. check_cflags -Wno-pointer-to-int-cast
  3346. check_cflags -Wstrict-prototypes
  3347. enabled extra_warnings && check_cflags -Winline
  3348. # add some linker flags
  3349. check_ldflags -Wl,--warn-common
  3350. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  3351. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  3352. enabled xmm_clobber_test &&
  3353. check_ldflags -Wl,--wrap,avcodec_open2 \
  3354. -Wl,--wrap,avcodec_decode_audio4 \
  3355. -Wl,--wrap,avcodec_decode_video2 \
  3356. -Wl,--wrap,avcodec_decode_subtitle2 \
  3357. -Wl,--wrap,avcodec_encode_audio2 \
  3358. -Wl,--wrap,avcodec_encode_video \
  3359. -Wl,--wrap,avcodec_encode_subtitle \
  3360. -Wl,--wrap,sws_scale ||
  3361. disable xmm_clobber_test
  3362. echo "X{};" > $TMPV
  3363. if test_ldflags -Wl,--version-script,$TMPV; then
  3364. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  3365. check_cc <<EOF && enable symver_asm_label
  3366. void ff_foo(void) __asm__ ("av_foo@VERSION");
  3367. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  3368. EOF
  3369. check_cc <<EOF && enable symver_gnu_asm
  3370. __asm__(".symver ff_foo,av_foo@VERSION");
  3371. void ff_foo(void) {}
  3372. EOF
  3373. fi
  3374. if [ -n "$optflags" ]; then
  3375. add_cflags $optflags
  3376. elif enabled small; then
  3377. add_cflags $cflags_size
  3378. elif enabled optimizations; then
  3379. add_cflags $cflags_speed
  3380. else
  3381. add_cflags $cflags_noopt
  3382. fi
  3383. check_cflags -fno-math-errno
  3384. check_cflags -fno-signed-zeros
  3385. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  3386. int x;
  3387. EOF
  3388. if enabled icc; then
  3389. # Just warnings, no remarks
  3390. check_cflags -w1
  3391. # -wd: Disable following warnings
  3392. # 144, 167, 556: -Wno-pointer-sign
  3393. # 1292: attribute "foo" ignored
  3394. # 1419: external declaration in primary source file
  3395. # 10006: ignoring unknown option -fno-signed-zeros
  3396. # 10148: ignoring unknown option -Wno-parentheses
  3397. # 10156: ignoring option '-W'; no argument required
  3398. check_cflags -wd144,167,556,1292,1419,10006,10148,10156
  3399. # 11030: Warning unknown option --as-needed
  3400. # 10156: ignoring option '-export'; no argument required
  3401. check_ldflags -wd10156,11030
  3402. # Allow to compile with optimizations
  3403. check_ldflags -march=$cpu
  3404. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  3405. enable ebp_available
  3406. if enabled x86_32; then
  3407. icc_version=$($cc -dumpversion)
  3408. test ${icc_version%%.*} -ge 11 &&
  3409. check_cflags -falign-stack=maintain-16-byte ||
  3410. disable aligned_stack
  3411. fi
  3412. elif enabled ccc; then
  3413. # disable some annoying warnings
  3414. add_cflags -msg_disable cvtu32to64
  3415. add_cflags -msg_disable embedcomment
  3416. add_cflags -msg_disable needconstext
  3417. add_cflags -msg_disable nomainieee
  3418. add_cflags -msg_disable ptrmismatch1
  3419. add_cflags -msg_disable unreachcode
  3420. elif enabled gcc; then
  3421. check_cflags -fno-tree-vectorize
  3422. check_cflags -Werror=implicit-function-declaration
  3423. check_cflags -Werror=missing-prototypes
  3424. elif enabled llvm_gcc; then
  3425. check_cflags -mllvm -stack-alignment=16
  3426. elif enabled clang; then
  3427. check_cflags -mllvm -stack-alignment=16
  3428. check_cflags -Qunused-arguments
  3429. elif enabled armcc; then
  3430. # 2523: use of inline assembler is deprecated
  3431. add_cflags -W${armcc_opt},--diag_suppress=2523
  3432. add_cflags -W${armcc_opt},--diag_suppress=1207
  3433. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  3434. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  3435. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  3436. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  3437. elif enabled tms470; then
  3438. add_cflags -pds=824 -pds=837
  3439. elif enabled pathscale; then
  3440. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  3441. fi
  3442. # If a missing snprintf/broken strtod is detected, force-include headers
  3443. # that override prototypes and define it to a prefixed one implemented in
  3444. # libavutil. We do this at the end since -I flags aren't set in configure,
  3445. # and any additional check_cflags() beyond here will thus fail (because
  3446. # it can't find these files, because the -I$(srcdir) wasn't set).
  3447. enabled snprintf || force_include compat/snprintf.h
  3448. enabled broken_strtod && force_include compat/strtod.h
  3449. enabled_any $THREADS_LIST && enable threads
  3450. check_deps $CONFIG_LIST \
  3451. $CONFIG_EXTRA \
  3452. $HAVE_LIST \
  3453. $ALL_COMPONENTS \
  3454. $ALL_TESTS \
  3455. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  3456. if test $target_os = "haiku"; then
  3457. disable memalign
  3458. disable posix_memalign
  3459. fi
  3460. ! enabled_any memalign posix_memalign aligned_malloc &&
  3461. enabled_any $need_memalign && enable memalign_hack
  3462. # add_dep lib dep
  3463. # -> enable ${lib}_deps_${dep}
  3464. # -> add $dep to ${lib}_deps only once
  3465. add_dep() {
  3466. lib=$1
  3467. dep=$2
  3468. enabled "${lib}_deps_${dep}" && return 0
  3469. enable "${lib}_deps_${dep}"
  3470. prepend "${lib}_deps" $dep
  3471. }
  3472. # merge deps lib components
  3473. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  3474. merge_deps() {
  3475. lib=$1
  3476. shift
  3477. for comp in $*; do
  3478. enabled $comp || continue
  3479. eval "dep=\"\$${comp}_deps\""
  3480. for d in $dep; do
  3481. add_dep $lib $d
  3482. done
  3483. done
  3484. }
  3485. merge_deps libavfilter $FILTER_LIST
  3486. echo "install prefix $prefix"
  3487. echo "source path $source_path"
  3488. echo "C compiler $cc"
  3489. echo "ARCH $arch ($cpu)"
  3490. if test "$build_suffix" != ""; then
  3491. echo "build suffix $build_suffix"
  3492. fi
  3493. if test "$progs_suffix" != ""; then
  3494. echo "progs suffix $progs_suffix"
  3495. fi
  3496. if test "$extra_version" != ""; then
  3497. echo "version string suffix $extra_version"
  3498. fi
  3499. echo "big-endian ${bigendian-no}"
  3500. echo "runtime cpu detection ${runtime_cpudetect-no}"
  3501. if enabled x86; then
  3502. echo "${yasmexe} ${yasm-no}"
  3503. echo "MMX enabled ${mmx-no}"
  3504. echo "MMXEXT enabled ${mmxext-no}"
  3505. echo "3DNow! enabled ${amd3dnow-no}"
  3506. echo "3DNow! extended enabled ${amd3dnowext-no}"
  3507. echo "SSE enabled ${sse-no}"
  3508. echo "SSSE3 enabled ${ssse3-no}"
  3509. echo "AVX enabled ${avx-no}"
  3510. echo "FMA4 enabled ${fma4-no}"
  3511. echo "CMOV enabled ${cmov-no}"
  3512. echo "CMOV is fast ${fast_cmov-no}"
  3513. echo "EBX available ${ebx_available-no}"
  3514. echo "EBP available ${ebp_available-no}"
  3515. fi
  3516. if enabled arm; then
  3517. echo "ARMv5TE enabled ${armv5te-no}"
  3518. echo "ARMv6 enabled ${armv6-no}"
  3519. echo "ARMv6T2 enabled ${armv6t2-no}"
  3520. echo "ARM VFP enabled ${armvfp-no}"
  3521. echo "NEON enabled ${neon-no}"
  3522. fi
  3523. if enabled mips; then
  3524. echo "MMI enabled ${mmi-no}"
  3525. echo "MIPS FPU enabled ${mipsfpu-no}"
  3526. echo "MIPS32R2 enabled ${mips32r2-no}"
  3527. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  3528. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  3529. fi
  3530. if enabled ppc; then
  3531. echo "AltiVec enabled ${altivec-no}"
  3532. echo "PPC 4xx optimizations ${ppc4xx-no}"
  3533. echo "dcbzl available ${dcbzl-no}"
  3534. fi
  3535. if enabled sparc; then
  3536. echo "VIS enabled ${vis-no}"
  3537. fi
  3538. echo "debug symbols ${debug-no}"
  3539. echo "strip symbols ${stripping-no}"
  3540. echo "optimize for size ${small-no}"
  3541. echo "optimizations ${optimizations-no}"
  3542. echo "static ${static-no}"
  3543. echo "shared ${shared-no}"
  3544. echo "postprocessing support ${postproc-no}"
  3545. echo "new filter support ${avfilter-no}"
  3546. echo "network support ${network-no}"
  3547. echo "threading support ${thread_type-no}"
  3548. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  3549. echo "SDL support ${sdl-no}"
  3550. echo "libdxva2 enabled ${dxva2-no}"
  3551. echo "libva enabled ${vaapi-no}"
  3552. echo "libvdpau enabled ${vdpau-no}"
  3553. echo "AVISynth enabled ${avisynth-no}"
  3554. echo "frei0r enabled ${frei0r-no}"
  3555. echo "gnutls enabled ${gnutls-no}"
  3556. echo "libaacplus enabled ${libaacplus-no}"
  3557. echo "libass enabled ${libass-no}"
  3558. echo "libcaca enabled ${libcaca-no}"
  3559. echo "libcdio support ${libcdio-no}"
  3560. echo "libcelt enabled ${libcelt-no}"
  3561. echo "libdc1394 support ${libdc1394-no}"
  3562. echo "libfaac enabled ${libfaac-no}"
  3563. echo "libfdk-aac enabled ${libfdk_aac-no}"
  3564. echo "libgsm enabled ${libgsm-no}"
  3565. echo "libiec61883 support ${libiec61883-no}"
  3566. echo "libilbc enabled ${libilbc-no}"
  3567. echo "libmodplug enabled ${libmodplug-no}"
  3568. echo "libmp3lame enabled ${libmp3lame-no}"
  3569. echo "libnut enabled ${libnut-no}"
  3570. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  3571. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  3572. echo "libopencv support ${libopencv-no}"
  3573. echo "libopenjpeg enabled ${libopenjpeg-no}"
  3574. echo "libopus enabled ${libopus-no}"
  3575. echo "libpulse enabled ${libpulse-no}"
  3576. echo "librtmp enabled ${librtmp-no}"
  3577. echo "libschroedinger enabled ${libschroedinger-no}"
  3578. echo "libspeex enabled ${libspeex-no}"
  3579. echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
  3580. echo "libtheora enabled ${libtheora-no}"
  3581. echo "libtwolame enabled ${libtwolame-no}"
  3582. echo "libutvideo enabled ${libutvideo-no}"
  3583. echo "libv4l2 enabled ${libv4l2-no}"
  3584. echo "libvo-aacenc support ${libvo_aacenc-no}"
  3585. echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
  3586. echo "libvorbis enabled ${libvorbis-no}"
  3587. echo "libvpx enabled ${libvpx-no}"
  3588. echo "libx264 enabled ${libx264-no}"
  3589. echo "libxavs enabled ${libxavs-no}"
  3590. echo "libxvid enabled ${libxvid-no}"
  3591. echo "openal enabled ${openal-no}"
  3592. echo "openssl enabled ${openssl-no}"
  3593. echo "zlib enabled ${zlib-no}"
  3594. echo "bzlib enabled ${bzlib-no}"
  3595. echo "texi2html enabled ${texi2html-no}"
  3596. echo "perl enabled ${perl-no}"
  3597. echo "pod2man enabled ${pod2man-no}"
  3598. echo "makeinfo enabled ${makeinfo-no}"
  3599. test -n "$random_seed" &&
  3600. echo "random seed ${random_seed}"
  3601. echo
  3602. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  3603. echo "Enabled ${type}s:"
  3604. eval list=\$$(toupper $type)_LIST
  3605. print_enabled '_*' $list | sort | pr -r -3 -t
  3606. echo
  3607. done
  3608. license="LGPL version 2.1 or later"
  3609. if enabled nonfree; then
  3610. license="nonfree and unredistributable"
  3611. elif enabled gplv3; then
  3612. license="GPL version 3 or later"
  3613. elif enabled lgplv3; then
  3614. license="LGPL version 3 or later"
  3615. elif enabled gpl; then
  3616. license="GPL version 2 or later"
  3617. fi
  3618. echo "License: $license"
  3619. echo "Creating config.mak and config.h..."
  3620. test -e Makefile || $ln_s "$source_path/Makefile" .
  3621. enabled stripping || strip="echo skipping strip"
  3622. config_files="$TMPH config.mak"
  3623. cat > config.mak <<EOF
  3624. # Automatically generated by configure - do not modify!
  3625. ifndef FFMPEG_CONFIG_MAK
  3626. FFMPEG_CONFIG_MAK=1
  3627. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  3628. prefix=$prefix
  3629. LIBDIR=\$(DESTDIR)$libdir
  3630. SHLIBDIR=\$(DESTDIR)$shlibdir
  3631. INCDIR=\$(DESTDIR)$incdir
  3632. BINDIR=\$(DESTDIR)$bindir
  3633. DATADIR=\$(DESTDIR)$datadir
  3634. MANDIR=\$(DESTDIR)$mandir
  3635. SRC_PATH=$source_path
  3636. ifndef MAIN_MAKEFILE
  3637. SRC_PATH:=\$(SRC_PATH:.%=..%)
  3638. endif
  3639. CC_IDENT=$cc_ident
  3640. ARCH=$arch
  3641. CC=$cc
  3642. CXX=$cxx
  3643. AS=$as
  3644. LD=$ld
  3645. DEPCC=$dep_cc
  3646. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  3647. DEPAS=$as
  3648. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  3649. YASM=$yasmexe
  3650. DEPYASM=$yasmexe
  3651. AR=$ar
  3652. RANLIB=$ranlib
  3653. CP=cp -p
  3654. LN_S=$ln_s
  3655. STRIP=$strip
  3656. CPPFLAGS=$CPPFLAGS
  3657. CFLAGS=$CFLAGS
  3658. CXXFLAGS=$CXXFLAGS
  3659. ASFLAGS=$ASFLAGS
  3660. AS_C=$AS_C
  3661. AS_O=$AS_O
  3662. CC_C=$CC_C
  3663. CC_O=$CC_O
  3664. CXX_C=$CXX_C
  3665. CXX_O=$CXX_O
  3666. LD_O=$LD_O
  3667. LD_LIB=$LD_LIB
  3668. LD_PATH=$LD_PATH
  3669. DLLTOOL=$dlltool
  3670. LDFLAGS=$LDFLAGS
  3671. LDFLAGS-ffserver=$FFSERVERLDFLAGS
  3672. SHFLAGS=$SHFLAGS
  3673. YASMFLAGS=$YASMFLAGS
  3674. BUILDSUF=$build_suffix
  3675. PROGSSUF=$progs_suffix
  3676. FULLNAME=$FULLNAME
  3677. LIBPREF=$LIBPREF
  3678. LIBSUF=$LIBSUF
  3679. LIBNAME=$LIBNAME
  3680. SLIBPREF=$SLIBPREF
  3681. SLIBSUF=$SLIBSUF
  3682. EXESUF=$EXESUF
  3683. EXTRA_VERSION=$extra_version
  3684. CCDEP=$CCDEP
  3685. CXXDEP=$CXXDEP
  3686. CCDEP_FLAGS=$CCDEP_FLAGS
  3687. ASDEP=$ASDEP
  3688. ASDEP_FLAGS=$ASDEP_FLAGS
  3689. CC_DEPFLAGS=$CC_DEPFLAGS
  3690. AS_DEPFLAGS=$AS_DEPFLAGS
  3691. HOSTCC=$host_cc
  3692. HOSTLD=$host_ld
  3693. HOSTCFLAGS=$host_cflags
  3694. HOSTEXESUF=$HOSTEXESUF
  3695. HOSTLDFLAGS=$host_ldflags
  3696. HOSTLIBS=$host_libs
  3697. DEPHOSTCC=$host_cc
  3698. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  3699. HOSTCCDEP=$HOSTCCDEP
  3700. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  3701. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  3702. HOSTCC_C=$HOSTCC_C
  3703. HOSTCC_O=$HOSTCC_O
  3704. HOSTLD_O=$HOSTLD_O
  3705. TARGET_EXEC=$target_exec
  3706. TARGET_PATH=$target_path
  3707. LIBS-ffplay=$sdl_libs
  3708. CFLAGS-ffplay=$sdl_cflags
  3709. ZLIB=$($ldflags_filter -lz)
  3710. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  3711. EXTRALIBS=$extralibs
  3712. INSTALL=$install
  3713. LIBTARGET=${LIBTARGET}
  3714. SLIBNAME=${SLIBNAME}
  3715. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  3716. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  3717. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  3718. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  3719. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  3720. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  3721. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  3722. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  3723. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  3724. NOREDZONE_FLAGS=$noredzone_flags
  3725. EOF
  3726. get_version(){
  3727. lcname=$1
  3728. name=$(toupper $lcname)
  3729. file=$source_path/$lcname/version.h
  3730. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3731. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3732. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3733. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3734. }
  3735. get_version_old(){
  3736. name=$1
  3737. file=$source_path/$2
  3738. # This condition will be removed when we stop supporting old libpostproc versions
  3739. if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then
  3740. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3741. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3742. fi
  3743. lcname=$(tolower $name)
  3744. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3745. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3746. }
  3747. get_version_old LIBPOSTPROC libpostproc/postprocess.h
  3748. get_version_old LIBSWRESAMPLE libswresample/swresample.h
  3749. get_version libavcodec
  3750. get_version libavdevice
  3751. get_version libavfilter
  3752. get_version libavformat
  3753. get_version libavresample
  3754. get_version libavutil
  3755. get_version libswscale
  3756. cat > $TMPH <<EOF
  3757. /* Automatically generated by configure - do not modify! */
  3758. #ifndef FFMPEG_CONFIG_H
  3759. #define FFMPEG_CONFIG_H
  3760. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  3761. #define FFMPEG_LICENSE "$(c_escape $license)"
  3762. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  3763. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  3764. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  3765. #define av_restrict $_restrict
  3766. #define EXTERN_PREFIX "${extern_prefix}"
  3767. #define EXTERN_ASM ${extern_prefix}
  3768. #define SLIBSUF "$SLIBSUF"
  3769. #define HAVE_MMX2 HAVE_MMXEXT
  3770. EOF
  3771. test -n "$assert_level" &&
  3772. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  3773. test -n "$malloc_prefix" &&
  3774. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  3775. if enabled yasm; then
  3776. append config_files $TMPASM
  3777. printf '' >$TMPASM
  3778. fi
  3779. print_config ARCH_ "$config_files" $ARCH_LIST
  3780. print_config HAVE_ "$config_files" $HAVE_LIST
  3781. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  3782. $CONFIG_EXTRA \
  3783. $ALL_COMPONENTS \
  3784. cat >>config.mak <<EOF
  3785. LAVF_FATE_TESTS=$(print_enabled -n _test $LAVF_FATE_TESTS)
  3786. LAVF_TESTS=$(print_enabled -n _test $LAVF_TESTS)
  3787. LAVFI_TESTS=$(print_enabled -n _test $LAVFI_TESTS)
  3788. SEEK_TESTS=$(print_enabled -n _test $SEEK_TESTS)
  3789. EOF
  3790. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  3791. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  3792. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  3793. cp_if_changed $TMPH config.h
  3794. touch .config
  3795. enabled yasm && cp_if_changed $TMPASM config.asm
  3796. cat > $TMPH <<EOF
  3797. /* Generated by ffconf */
  3798. #ifndef AVUTIL_AVCONFIG_H
  3799. #define AVUTIL_AVCONFIG_H
  3800. EOF
  3801. test "$postproc_version" != current && cat >> $TMPH <<EOF
  3802. #define LIBPOSTPROC_VERSION_MAJOR $LIBPOSTPROC_VERSION_MAJOR
  3803. #define LIBPOSTPROC_VERSION_MINOR $LIBPOSTPROC_VERSION_MINOR
  3804. #define LIBPOSTPROC_VERSION_MICRO $LIBPOSTPROC_VERSION_MICRO
  3805. EOF
  3806. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  3807. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  3808. cp_if_changed $TMPH libavutil/avconfig.h
  3809. test -n "$WARNINGS" && printf "\n$WARNINGS"
  3810. # build pkg-config files
  3811. pkgconfig_generate(){
  3812. name=$1
  3813. shortname=${name#lib}${build_suffix}
  3814. comment=$2
  3815. version=$3
  3816. libs=$4
  3817. requires=$5
  3818. enabled ${name#lib} || return 0
  3819. mkdir -p $name
  3820. cat <<EOF > $name/$name.pc
  3821. prefix=$prefix
  3822. exec_prefix=\${prefix}
  3823. libdir=$libdir
  3824. includedir=$incdir
  3825. Name: $name
  3826. Description: $comment
  3827. Version: $version
  3828. Requires: $(enabled shared || echo $requires)
  3829. Requires.private: $(enabled shared && echo $requires)
  3830. Conflicts:
  3831. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3832. Libs.private: $(enabled shared && echo $libs)
  3833. Cflags: -I\${includedir}
  3834. EOF
  3835. mkdir -p doc/examples/pc-uninstalled
  3836. includedir=${source_path}
  3837. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  3838. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  3839. prefix=
  3840. exec_prefix=
  3841. libdir=\${pcfiledir}/../../../$name
  3842. includedir=${includedir}
  3843. Name: $name
  3844. Description: $comment
  3845. Version: $version
  3846. Requires: $requires
  3847. Conflicts:
  3848. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3849. Cflags: -I\${includedir}
  3850. EOF
  3851. }
  3852. libavfilter_pc_deps=""
  3853. enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
  3854. enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
  3855. enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
  3856. enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION,"
  3857. enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION,"
  3858. libavfilter_pc_deps=${libavfilter_pc_deps%, }
  3859. libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION"
  3860. enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION,"
  3861. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
  3862. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  3863. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  3864. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
  3865. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
  3866. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
  3867. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
  3868. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
  3869. pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"