configure 221 KB

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