configure 150 KB

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