configure 181 KB

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