configure 282 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403
  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. --quiet Suppress showing informative output
  58. --list-decoders show all available decoders
  59. --list-encoders show all available encoders
  60. --list-hwaccels show all available hardware accelerators
  61. --list-demuxers show all available demuxers
  62. --list-muxers show all available muxers
  63. --list-parsers show all available parsers
  64. --list-protocols show all available protocols
  65. --list-bsfs show all available bitstream filters
  66. --list-indevs show all available input devices
  67. --list-outdevs show all available output devices
  68. --list-filters show all available filters
  69. Standard options:
  70. --logfile=FILE log tests and output to FILE [ffbuild/config.log]
  71. --disable-logging do not log configure debug information
  72. --fatal-warnings fail if any configure warning is generated
  73. --prefix=PREFIX install in PREFIX [$prefix_default]
  74. --bindir=DIR install binaries in DIR [PREFIX/bin]
  75. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  76. --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
  77. --libdir=DIR install libs in DIR [PREFIX/lib]
  78. --shlibdir=DIR install shared libs in DIR [LIBDIR]
  79. --incdir=DIR install includes in DIR [PREFIX/include]
  80. --mandir=DIR install man page in DIR [PREFIX/share/man]
  81. --pkgconfigdir=DIR install pkg-config files in DIR [LIBDIR/pkgconfig]
  82. --enable-rpath use rpath to allow installing libraries in paths
  83. not part of the dynamic linker search path
  84. use rpath when linking programs (USE WITH CARE)
  85. --install-name-dir=DIR Darwin directory name for installed targets
  86. Licensing options:
  87. --enable-gpl allow use of GPL code, the resulting libs
  88. and binaries will be under GPL [no]
  89. --enable-version3 upgrade (L)GPL to version 3 [no]
  90. --enable-nonfree allow use of nonfree code, the resulting libs
  91. and binaries will be unredistributable [no]
  92. Configuration options:
  93. --disable-static do not build static libraries [no]
  94. --enable-shared build shared libraries [no]
  95. --enable-small optimize for size instead of speed
  96. --disable-runtime-cpudetect disable detecting CPU capabilities at runtime (smaller binary)
  97. --enable-gray enable full grayscale support (slower color)
  98. --disable-swscale-alpha disable alpha channel support in swscale
  99. --disable-all disable building components, libraries and programs
  100. --disable-autodetect disable automatically detected external libraries [no]
  101. Program options:
  102. --disable-programs do not build command line programs
  103. --disable-ffmpeg disable ffmpeg build
  104. --disable-ffplay disable ffplay build
  105. --disable-ffprobe disable ffprobe 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. --disable-pthreads disable pthreads [autodetect]
  121. --disable-w32threads disable Win32 threads [autodetect]
  122. --disable-os2threads disable OS/2 threads [autodetect]
  123. --disable-network disable network support [no]
  124. --disable-dwt disable DWT code
  125. --disable-error-resilience disable error resilience code
  126. --disable-lsp disable LSP code
  127. --disable-faan disable floating point AAN (I)DCT code
  128. --disable-iamf disable support for Immersive Audio Model
  129. --disable-pixelutils disable pixel utils in libavutil
  130. Individual component options:
  131. --disable-everything disable all components listed below
  132. --disable-encoder=NAME disable encoder NAME
  133. --enable-encoder=NAME enable encoder NAME
  134. --disable-encoders disable all encoders
  135. --disable-decoder=NAME disable decoder NAME
  136. --enable-decoder=NAME enable decoder NAME
  137. --disable-decoders disable all decoders
  138. --disable-hwaccel=NAME disable hwaccel NAME
  139. --enable-hwaccel=NAME enable hwaccel NAME
  140. --disable-hwaccels disable all hwaccels
  141. --disable-muxer=NAME disable muxer NAME
  142. --enable-muxer=NAME enable muxer NAME
  143. --disable-muxers disable all muxers
  144. --disable-demuxer=NAME disable demuxer NAME
  145. --enable-demuxer=NAME enable demuxer NAME
  146. --disable-demuxers disable all demuxers
  147. --enable-parser=NAME enable parser NAME
  148. --disable-parser=NAME disable parser NAME
  149. --disable-parsers disable all parsers
  150. --enable-bsf=NAME enable bitstream filter NAME
  151. --disable-bsf=NAME disable bitstream filter NAME
  152. --disable-bsfs disable all bitstream filters
  153. --enable-protocol=NAME enable protocol NAME
  154. --disable-protocol=NAME disable protocol NAME
  155. --disable-protocols disable all protocols
  156. --enable-indev=NAME enable input device NAME
  157. --disable-indev=NAME disable input device NAME
  158. --disable-indevs disable input devices
  159. --enable-outdev=NAME enable output device NAME
  160. --disable-outdev=NAME disable output device NAME
  161. --disable-outdevs disable output devices
  162. --disable-devices disable all devices
  163. --enable-filter=NAME enable filter NAME
  164. --disable-filter=NAME disable filter NAME
  165. --disable-filters disable all filters
  166. External library support:
  167. Using any of the following switches will allow FFmpeg to link to the
  168. corresponding external library. All the components depending on that library
  169. will become enabled, if all their other dependencies are met and they are not
  170. explicitly disabled. E.g. --enable-libopus will enable linking to
  171. libopus and allow the libopus encoder to be built, unless it is
  172. specifically disabled with --disable-encoder=libopus.
  173. Note that only the system libraries are auto-detected. All the other external
  174. libraries must be explicitly enabled.
  175. Also note that the following help text describes the purpose of the libraries
  176. themselves, not all their features will necessarily be usable by FFmpeg.
  177. --disable-alsa disable ALSA support [autodetect]
  178. --disable-appkit disable Apple AppKit framework [autodetect]
  179. --disable-avfoundation disable Apple AVFoundation framework [autodetect]
  180. --enable-avisynth enable reading of AviSynth script files [no]
  181. --disable-bzlib disable bzlib [autodetect]
  182. --disable-coreimage disable Apple CoreImage framework [autodetect]
  183. --enable-chromaprint enable audio fingerprinting with chromaprint [no]
  184. --enable-frei0r enable frei0r video filtering [no]
  185. --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
  186. if openssl, librtmp or gmp is not used [no]
  187. --enable-gmp enable gmp, needed for rtmp(t)e support
  188. if openssl or librtmp is not used [no]
  189. --enable-gnutls enable gnutls, needed for https support
  190. if openssl, libtls or mbedtls is not used [no]
  191. --disable-iconv disable iconv [autodetect]
  192. --enable-jni enable JNI support [no]
  193. --enable-ladspa enable LADSPA audio filtering [no]
  194. --enable-lcms2 enable ICC profile support via LittleCMS 2 [no]
  195. --enable-libaom enable AV1 video encoding/decoding via libaom [no]
  196. --enable-libaribb24 enable ARIB text and caption decoding via libaribb24 [no]
  197. --enable-libaribcaption enable ARIB text and caption decoding via libaribcaption [no]
  198. --enable-libass enable libass subtitles rendering,
  199. needed for subtitles and ass filter [no]
  200. --enable-libbluray enable BluRay reading using libbluray [no]
  201. --enable-libbs2b enable bs2b DSP library [no]
  202. --enable-libcaca enable textual display using libcaca [no]
  203. --enable-libcelt enable CELT decoding via libcelt [no]
  204. --enable-libcdio enable audio CD grabbing with libcdio [no]
  205. --enable-libcodec2 enable codec2 en/decoding using libcodec2 [no]
  206. --enable-libdav1d enable AV1 decoding via libdav1d [no]
  207. --enable-libdavs2 enable AVS2 decoding via libdavs2 [no]
  208. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  209. and libraw1394 [no]
  210. --enable-libdvdnav enable libdvdnav, needed for DVD demuxing [no]
  211. --enable-libdvdread enable libdvdread, needed for DVD demuxing [no]
  212. --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  213. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  214. --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
  215. --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
  216. --enable-libfribidi enable libfribidi, improves drawtext filter [no]
  217. --enable-libharfbuzz enable libharfbuzz, needed for drawtext filter [no]
  218. --enable-libglslang enable GLSL->SPIRV compilation via libglslang [no]
  219. --enable-libgme enable Game Music Emu via libgme [no]
  220. --enable-libgsm enable GSM de/encoding via libgsm [no]
  221. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  222. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  223. --enable-libjack enable JACK audio sound server [no]
  224. --enable-libjxl enable JPEG XL de/encoding via libjxl [no]
  225. --enable-libklvanc enable Kernel Labs VANC processing [no]
  226. --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
  227. --enable-liblc3 enable LC3 de/encoding via liblc3 [no]
  228. --enable-liblcevc-dec enable LCEVC decoding via liblcevc-dec [no]
  229. --enable-liblensfun enable lensfun lens correction [no]
  230. --enable-libmodplug enable ModPlug via libmodplug [no]
  231. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  232. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  233. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  234. --enable-libopencv enable video filtering via libopencv [no]
  235. --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
  236. --enable-libopenjpeg enable JPEG 2000 encoding via OpenJPEG [no]
  237. --enable-libopenmpt enable decoding tracked files via libopenmpt [no]
  238. --enable-libopenvino enable OpenVINO as a DNN module backend
  239. for DNN based filters like dnn_processing [no]
  240. --enable-libopus enable Opus de/encoding via libopus [no]
  241. --enable-libplacebo enable libplacebo library [no]
  242. --enable-libpulse enable Pulseaudio input via libpulse [no]
  243. --enable-libqrencode enable QR encode generation via libqrencode [no]
  244. --enable-libquirc enable QR decoding via libquirc [no]
  245. --enable-librabbitmq enable RabbitMQ library [no]
  246. --enable-librav1e enable AV1 encoding via rav1e [no]
  247. --enable-librist enable RIST via librist [no]
  248. --enable-librsvg enable SVG rasterization via librsvg [no]
  249. --enable-librubberband enable rubberband needed for rubberband filter [no]
  250. --enable-librtmp enable RTMP[E] support via librtmp [no]
  251. --enable-libshaderc enable GLSL->SPIRV compilation via libshaderc [no]
  252. --enable-libshine enable fixed-point MP3 encoding via libshine [no]
  253. --enable-libsmbclient enable Samba protocol via libsmbclient [no]
  254. --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
  255. --enable-libsoxr enable Include libsoxr resampling [no]
  256. --enable-libspeex enable Speex de/encoding via libspeex [no]
  257. --enable-libsrt enable Haivision SRT protocol via libsrt [no]
  258. --enable-libssh enable SFTP protocol via libssh [no]
  259. --enable-libsvtav1 enable AV1 encoding via SVT [no]
  260. --enable-libtensorflow enable TensorFlow as a DNN module backend
  261. for DNN based filters like sr [no]
  262. --enable-libtesseract enable Tesseract, needed for ocr filter [no]
  263. --enable-libtheora enable Theora encoding via libtheora [no]
  264. --enable-libtls enable LibreSSL (via libtls), needed for https support
  265. if openssl, gnutls or mbedtls is not used [no]
  266. --enable-libtorch enable Torch as one DNN backend [no]
  267. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  268. --enable-libuavs3d enable AVS3 decoding via libuavs3d [no]
  269. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  270. --enable-libvidstab enable video stabilization using vid.stab [no]
  271. --enable-libvmaf enable vmaf filter via libvmaf [no]
  272. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  273. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  274. native implementation exists [no]
  275. --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
  276. --enable-libvvenc enable H.266/VVC encoding via vvenc [no]
  277. --enable-libwebp enable WebP encoding via libwebp [no]
  278. --enable-libx264 enable H.264 encoding via x264 [no]
  279. --enable-libx265 enable HEVC encoding via x265 [no]
  280. --enable-libxeve enable EVC encoding via libxeve [no]
  281. --enable-libxevd enable EVC decoding via libxevd [no]
  282. --enable-libxavs enable AVS encoding via xavs [no]
  283. --enable-libxavs2 enable AVS2 encoding via xavs2 [no]
  284. --enable-libxcb enable X11 grabbing using XCB [autodetect]
  285. --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
  286. --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
  287. --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
  288. --enable-libxvid enable Xvid encoding via xvidcore,
  289. native MPEG-4/Xvid encoder exists [no]
  290. --enable-libxml2 enable XML parsing using the C library libxml2, needed
  291. for dash and imf demuxing support [no]
  292. --enable-libzimg enable z.lib, needed for zscale filter [no]
  293. --enable-libzmq enable message passing via libzmq [no]
  294. --enable-libzvbi enable teletext support via libzvbi [no]
  295. --enable-lv2 enable LV2 audio filtering [no]
  296. --disable-lzma disable lzma [autodetect]
  297. --enable-decklink enable Blackmagic DeckLink I/O support [no]
  298. --enable-mbedtls enable mbedTLS, needed for https support
  299. if openssl, gnutls or libtls is not used [no]
  300. --enable-mediacodec enable Android MediaCodec support [no]
  301. --enable-mediafoundation enable encoding via MediaFoundation [auto]
  302. --disable-metal disable Apple Metal framework [autodetect]
  303. --enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
  304. --enable-openal enable OpenAL 1.1 capture support [no]
  305. --enable-opencl enable OpenCL processing [no]
  306. --enable-opengl enable OpenGL rendering [no]
  307. --enable-openssl enable openssl, needed for https support
  308. if gnutls, libtls or mbedtls is not used [no]
  309. --enable-pocketsphinx enable PocketSphinx, needed for asr filter [no]
  310. --disable-sndio disable sndio support [autodetect]
  311. --disable-schannel disable SChannel SSP, needed for TLS support on
  312. Windows if openssl and gnutls are not used [autodetect]
  313. --disable-sdl2 disable sdl2 [autodetect]
  314. --disable-securetransport disable Secure Transport, needed for TLS support
  315. on OSX if openssl and gnutls are not used [autodetect]
  316. --enable-vapoursynth enable VapourSynth demuxer [no]
  317. --disable-xlib disable xlib [autodetect]
  318. --disable-zlib disable zlib [autodetect]
  319. The following libraries provide various hardware acceleration features:
  320. --disable-amf disable AMF video encoding code [autodetect]
  321. --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
  322. --enable-cuda-nvcc enable Nvidia CUDA compiler [no]
  323. --disable-cuda-llvm disable CUDA compilation using clang [autodetect]
  324. --disable-cuvid disable Nvidia CUVID support [autodetect]
  325. --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
  326. --disable-d3d12va disable Microsoft Direct3D 12 video acceleration code [autodetect]
  327. --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
  328. --disable-ffnvcodec disable dynamically linked Nvidia code [autodetect]
  329. --disable-libdrm disable DRM code (Linux) [autodetect]
  330. --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
  331. --enable-libvpl enable Intel oneVPL code via libvpl if libmfx is not used [no]
  332. --enable-libnpp enable Nvidia Performance Primitives-based code [no]
  333. --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
  334. --disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect]
  335. --disable-nvenc disable Nvidia video encoding code [autodetect]
  336. --enable-omx enable OpenMAX IL code [no]
  337. --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
  338. --enable-rkmpp enable Rockchip Media Process Platform code [no]
  339. --disable-v4l2-m2m disable V4L2 mem2mem code [autodetect]
  340. --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
  341. --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
  342. --disable-videotoolbox disable VideoToolbox code [autodetect]
  343. --disable-vulkan disable Vulkan code [autodetect]
  344. --enable-vulkan-static statically link to libvulkan [no]
  345. Toolchain options:
  346. --arch=ARCH select architecture [$arch]
  347. --cpu=CPU select the minimum required CPU (affects
  348. instruction selection, may crash on older CPUs)
  349. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  350. --progs-suffix=SUFFIX program name suffix []
  351. --enable-cross-compile assume a cross-compiler is used
  352. --sysroot=PATH root of cross-build tree
  353. --sysinclude=PATH location of cross-build system headers
  354. --target-os=OS compiler targets OS [$target_os]
  355. --target-exec=CMD command to run executables on target
  356. --target-path=DIR path to view of build directory on target
  357. --target-samples=DIR path to samples directory on target
  358. --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
  359. --toolchain=NAME set tool defaults according to NAME
  360. (gcc-asan, clang-asan, gcc-msan, clang-msan,
  361. gcc-tsan, clang-tsan, gcc-usan, clang-usan,
  362. valgrind-massif, valgrind-memcheck,
  363. msvc, icl, gcov, llvm-cov, hardened)
  364. --nm=NM use nm tool NM [$nm_default]
  365. --ar=AR use archive tool AR [$ar_default]
  366. --as=AS use assembler AS [$as_default]
  367. --ln_s=LN_S use symbolic link tool LN_S [$ln_s_default]
  368. --strip=STRIP use strip tool STRIP [$strip_default]
  369. --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
  370. --x86asmexe=EXE use nasm-compatible assembler EXE [$x86asmexe_default]
  371. --cc=CC use C compiler CC [$cc_default]
  372. --stdc=STDC use C standard STDC [$stdc_default]
  373. --cxx=CXX use C compiler CXX [$cxx_default]
  374. --stdcxx=STDCXX use C standard STDCXX [$stdcxx_default]
  375. --objcc=OCC use ObjC compiler OCC [$cc_default]
  376. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  377. --nvcc=NVCC use Nvidia CUDA compiler NVCC or clang [$nvcc_default]
  378. --ld=LD use linker LD [$ld_default]
  379. --metalcc=METALCC use metal compiler METALCC [$metalcc_default]
  380. --metallib=METALLIB use metal linker METALLIB [$metallib_default]
  381. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  382. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  383. --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
  384. --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
  385. --host-cc=HOSTCC use host C compiler HOSTCC
  386. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  387. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  388. --host-ld=HOSTLD use host linker HOSTLD
  389. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  390. --host-extralibs=HLIBS use libs HLIBS when linking for host
  391. --host-os=OS compiler host OS [$target_os]
  392. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  393. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  394. --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
  395. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  396. --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
  397. --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
  398. --extra-libs=ELIBS add ELIBS [$ELIBS]
  399. --extra-version=STRING version string suffix []
  400. --optflags=OPTFLAGS override optimization-related compiler flags
  401. --nvccflags=NVCCFLAGS override nvcc flags [$nvccflags_default]
  402. --build-suffix=SUFFIX library name suffix []
  403. --enable-pic build position-independent code
  404. --enable-thumb compile for Thumb instruction set
  405. --enable-lto[=arg] use link-time optimization
  406. --env="ENV=override" override the environment variables
  407. Advanced options (experts only):
  408. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  409. --custom-allocator=NAME use a supported custom allocator
  410. --disable-symver disable symbol versioning
  411. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  412. --disable-safe-bitstream-reader
  413. disable buffer boundary checking in bitreaders
  414. (faster, but may crash)
  415. --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
  416. Optimization options (experts only):
  417. --disable-asm disable all assembly optimizations
  418. --disable-altivec disable AltiVec optimizations
  419. --disable-vsx disable VSX optimizations
  420. --disable-power8 disable POWER8 optimizations
  421. --disable-amd3dnow disable 3DNow! optimizations
  422. --disable-amd3dnowext disable 3DNow! extended optimizations
  423. --disable-mmx disable MMX optimizations
  424. --disable-mmxext disable MMXEXT optimizations
  425. --disable-sse disable SSE optimizations
  426. --disable-sse2 disable SSE2 optimizations
  427. --disable-sse3 disable SSE3 optimizations
  428. --disable-ssse3 disable SSSE3 optimizations
  429. --disable-sse4 disable SSE4 optimizations
  430. --disable-sse42 disable SSE4.2 optimizations
  431. --disable-avx disable AVX optimizations
  432. --disable-xop disable XOP optimizations
  433. --disable-fma3 disable FMA3 optimizations
  434. --disable-fma4 disable FMA4 optimizations
  435. --disable-avx2 disable AVX2 optimizations
  436. --disable-avx512 disable AVX-512 optimizations
  437. --disable-avx512icl disable AVX-512ICL optimizations
  438. --disable-aesni disable AESNI optimizations
  439. --disable-armv5te disable armv5te optimizations
  440. --disable-armv6 disable armv6 optimizations
  441. --disable-armv6t2 disable armv6t2 optimizations
  442. --disable-vfp disable VFP optimizations
  443. --disable-neon disable NEON optimizations
  444. --disable-dotprod disable DOTPROD optimizations
  445. --disable-i8mm disable I8MM optimizations
  446. --disable-sve disable SVE optimizations
  447. --disable-sve2 disable SVE2 optimizations
  448. --disable-inline-asm disable use of inline assembly
  449. --disable-x86asm disable use of standalone x86 assembly
  450. --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
  451. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  452. --disable-msa disable MSA optimizations
  453. --disable-mipsfpu disable floating point MIPS optimizations
  454. --disable-mmi disable Loongson MMI optimizations
  455. --disable-lsx disable Loongson LSX optimizations
  456. --disable-lasx disable Loongson LASX optimizations
  457. --disable-rvv disable RISC-V Vector optimizations
  458. --disable-fast-unaligned consider unaligned accesses slow
  459. --disable-simd128 disable WebAssembly simd128 optimizations
  460. Developer options (useful when working on FFmpeg itself):
  461. --disable-debug disable debugging symbols
  462. --enable-debug=LEVEL set the debug level [$debuglevel]
  463. --disable-optimizations disable compiler optimizations
  464. --enable-extra-warnings enable more compiler warnings
  465. --disable-stripping disable stripping of executables and shared libraries
  466. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  467. 2 causes a slowdown at runtime.
  468. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  469. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  470. leaks and errors, using the specified valgrind binary.
  471. Cannot be combined with --target-exec
  472. --enable-ftrapv Trap arithmetic overflows
  473. --samples=PATH location of test samples for FATE, if not set use
  474. \$FATE_SAMPLES at make invocation time.
  475. --enable-neon-clobber-test check NEON registers for clobbering (should be
  476. used only for debugging purposes)
  477. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  478. should be used only for debugging purposes)
  479. --enable-random randomly enable/disable components
  480. --disable-random
  481. --enable-random=LIST randomly enable/disable specific components or
  482. --disable-random=LIST component groups. LIST is a comma-separated list
  483. of NAME[:PROB] entries where NAME is a component
  484. (group) and PROB the probability associated with
  485. NAME (default 0.5).
  486. --random-seed=VALUE seed value for --enable/disable-random
  487. --disable-valgrind-backtrace do not print a backtrace under Valgrind
  488. (only applies to --disable-optimizations builds)
  489. --enable-ossfuzz Enable building fuzzer tool
  490. --libfuzzer=PATH path to libfuzzer
  491. --ignore-tests=TESTS comma-separated list (without "fate-" prefix
  492. in the name) of tests whose result is ignored
  493. --enable-linux-perf enable Linux Performance Monitor API
  494. --enable-macos-kperf enable macOS kperf (private) API
  495. --disable-large-tests disable tests that use a large amount of memory
  496. --disable-ptx-compression don't compress CUDA PTX code even when possible
  497. --disable-version-tracking don't include the git/release version in the build
  498. NOTE: Object files are built at the place where configure is launched.
  499. EOF
  500. exit 0
  501. }
  502. if test -t 1 && which tput >/dev/null 2>&1; then
  503. ncolors=$(tput colors)
  504. if test -n "$ncolors" && test $ncolors -ge 8; then
  505. bold_color=$(tput bold)
  506. warn_color=$(tput setaf 3)
  507. error_color=$(tput setaf 1)
  508. reset_color=$(tput sgr0)
  509. fi
  510. # 72 used instead of 80 since that's the default of pr
  511. ncols=$(tput cols)
  512. fi
  513. : ${ncols:=72}
  514. log(){
  515. echo "$@" >> $logfile
  516. }
  517. log_file(){
  518. log BEGIN "$1"
  519. log_file_i=1
  520. while IFS= read -r log_file_line; do
  521. printf '%5d\t%s\n' "$log_file_i" "$log_file_line"
  522. log_file_i=$(($log_file_i+1))
  523. done < "$1" >> "$logfile"
  524. log END "$1"
  525. }
  526. warn(){
  527. log "WARNING: $*"
  528. WARNINGS="${WARNINGS}WARNING: $*\n"
  529. }
  530. die(){
  531. log "$@"
  532. echo "$error_color$bold_color$@$reset_color"
  533. cat <<EOF
  534. If you think configure made a mistake, make sure you are using the latest
  535. version from Git. If the latest version fails, report the problem to the
  536. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
  537. EOF
  538. if disabled logging; then
  539. cat <<EOF
  540. Rerun configure with logging enabled (do not use --disable-logging), and
  541. include the log this produces with your report.
  542. EOF
  543. else
  544. cat <<EOF
  545. Include the log file "$logfile" produced by configure as this will help
  546. solve the problem.
  547. EOF
  548. fi
  549. exit 1
  550. }
  551. # Avoid locale weirdness, besides we really just want to translate ASCII.
  552. toupper(){
  553. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  554. }
  555. tolower(){
  556. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  557. }
  558. c_escape(){
  559. echo "$*" | sed 's/["\\]/\\\0/g'
  560. }
  561. sh_quote(){
  562. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  563. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  564. echo "$v"
  565. }
  566. cleanws(){
  567. echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
  568. }
  569. filter(){
  570. pat=$1
  571. shift
  572. for v; do
  573. eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
  574. done
  575. }
  576. filter_out(){
  577. pat=$1
  578. shift
  579. for v; do
  580. eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
  581. done
  582. }
  583. map(){
  584. m=$1
  585. shift
  586. for v; do eval $m; done
  587. }
  588. add_suffix(){
  589. suffix=$1
  590. shift
  591. for v; do echo ${v}${suffix}; done
  592. }
  593. remove_suffix(){
  594. suffix=$1
  595. shift
  596. for v; do echo ${v%$suffix}; done
  597. }
  598. set_all(){
  599. value=$1
  600. shift
  601. for var in $*; do
  602. eval $var=$value
  603. done
  604. }
  605. set_weak(){
  606. value=$1
  607. shift
  608. for var; do
  609. eval : \${$var:=$value}
  610. done
  611. }
  612. sanitize_var_name(){
  613. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  614. }
  615. set_sanitized(){
  616. var=$1
  617. shift
  618. eval $(sanitize_var_name "$var")='$*'
  619. }
  620. get_sanitized(){
  621. eval echo \$$(sanitize_var_name "$1")
  622. }
  623. pushvar(){
  624. for pvar in $*; do
  625. eval level=\${${pvar}_level:=0}
  626. eval ${pvar}_${level}="\$$pvar"
  627. eval ${pvar}_level=$(($level+1))
  628. done
  629. }
  630. popvar(){
  631. for pvar in $*; do
  632. eval level=\${${pvar}_level:-0}
  633. test $level = 0 && continue
  634. eval level=$(($level-1))
  635. eval $pvar="\${${pvar}_${level}}"
  636. eval ${pvar}_level=$level
  637. eval unset ${pvar}_${level}
  638. done
  639. }
  640. request(){
  641. for var in $*; do
  642. eval ${var}_requested=yes
  643. eval $var=
  644. done
  645. }
  646. warn_if_gets_disabled(){
  647. for var in $*; do
  648. WARN_IF_GETS_DISABLED_LIST="$WARN_IF_GETS_DISABLED_LIST $var"
  649. done
  650. }
  651. enable(){
  652. set_all yes $*
  653. }
  654. disable(){
  655. set_all no $*
  656. }
  657. disable_with_reason(){
  658. disable $1
  659. eval "${1}_disable_reason=\"$2\""
  660. if requested $1; then
  661. die "ERROR: $1 requested, but $2"
  662. fi
  663. }
  664. enable_weak(){
  665. set_weak yes $*
  666. }
  667. disable_weak(){
  668. set_weak no $*
  669. }
  670. enable_sanitized(){
  671. for var; do
  672. enable $(sanitize_var_name $var)
  673. done
  674. }
  675. disable_sanitized(){
  676. for var; do
  677. disable $(sanitize_var_name $var)
  678. done
  679. }
  680. do_enable_deep(){
  681. for var; do
  682. enabled $var && continue
  683. set -- $var
  684. eval enable_deep \$${var}_select
  685. var=$1
  686. eval enable_deep_weak \$${var}_suggest
  687. done
  688. }
  689. enable_deep(){
  690. do_enable_deep $*
  691. enable $*
  692. }
  693. enable_deep_weak(){
  694. for var; do
  695. disabled $var && continue
  696. set -- $var
  697. do_enable_deep $var
  698. var=$1
  699. enable_weak $var
  700. done
  701. }
  702. requested(){
  703. test "${1#!}" = "$1" && op="=" || op="!="
  704. eval test "x\$${1#!}_requested" $op "xyes"
  705. }
  706. enabled(){
  707. test "${1#!}" = "$1" && op="=" || op="!="
  708. eval test "x\$${1#!}" $op "xyes"
  709. }
  710. disabled(){
  711. test "${1#!}" = "$1" && op="=" || op="!="
  712. eval test "x\$${1#!}" $op "xno"
  713. }
  714. enabled_all(){
  715. for opt; do
  716. enabled $opt || return 1
  717. done
  718. }
  719. disabled_all(){
  720. for opt; do
  721. disabled $opt || return 1
  722. done
  723. }
  724. enabled_any(){
  725. for opt; do
  726. enabled $opt && return 0
  727. done
  728. }
  729. disabled_any(){
  730. for opt; do
  731. disabled $opt && return 0
  732. done
  733. return 1
  734. }
  735. set_default(){
  736. for opt; do
  737. eval : \${$opt:=\$${opt}_default}
  738. done
  739. }
  740. is_in(){
  741. value=$1
  742. shift
  743. for var in $*; do
  744. [ $var = $value ] && return 0
  745. done
  746. return 1
  747. }
  748. # The cfg loop is very hot (several thousands iterations), and in bash also
  749. # potentialy quite slow. Try to abort the iterations early, preferably without
  750. # calling functions. 70%+ of the time cfg is already done or without deps.
  751. check_deps(){
  752. for cfg; do
  753. eval [ x\$${cfg}_checking = xdone ] && continue
  754. eval [ x\$${cfg}_checking = xinprogress ] && die "Circular dependency for $cfg."
  755. eval "
  756. dep_all=\$${cfg}_deps
  757. dep_any=\$${cfg}_deps_any
  758. dep_con=\$${cfg}_conflict
  759. dep_sel=\$${cfg}_select
  760. dep_sgs=\$${cfg}_suggest
  761. dep_ifa=\$${cfg}_if
  762. dep_ifn=\$${cfg}_if_any
  763. "
  764. # most of the time here $cfg has no deps - avoid costly no-op work
  765. if [ "$dep_all$dep_any$dep_con$dep_sel$dep_sgs$dep_ifa$dep_ifn" ]; then
  766. eval ${cfg}_checking=inprogress
  767. set -- $cfg "$dep_all" "$dep_any" "$dep_con" "$dep_sel" "$dep_sgs" "$dep_ifa" "$dep_ifn"
  768. check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
  769. cfg=$1; dep_all=$2; dep_any=$3; dep_con=$4; dep_sel=$5 dep_sgs=$6; dep_ifa=$7; dep_ifn=$8
  770. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  771. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  772. enabled_all $dep_all || { disable_with_reason $cfg "not all dependencies are satisfied: $dep_all"; }
  773. enabled_any $dep_any || { disable_with_reason $cfg "not any dependency is satisfied: $dep_any"; }
  774. disabled_all $dep_con || { disable_with_reason $cfg "some conflicting dependencies are unsatisfied: $dep_con"; }
  775. disabled_any $dep_sel && { disable_with_reason $cfg "some selected dependency is unsatisfied: $dep_sel"; }
  776. enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
  777. for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
  778. # filter out library deps, these do not belong in extralibs
  779. is_in $dep $LIBRARY_LIST && continue
  780. enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
  781. done
  782. fi
  783. eval ${cfg}_checking=done
  784. done
  785. }
  786. print_config(){
  787. pfx=$1
  788. files=$2
  789. shift 2
  790. map 'eval echo "$v \${$v:-no}"' "$@" |
  791. awk "BEGIN { split(\"$files\", files) }
  792. {
  793. c = \"$pfx\" toupper(\$1);
  794. v = \$2;
  795. sub(/yes/, 1, v);
  796. sub(/no/, 0, v);
  797. for (f in files) {
  798. file = files[f];
  799. if (file ~ /\\.h\$/) {
  800. printf(\"#define %s %d\\n\", c, v) >>file;
  801. } else if (file ~ /\\.asm\$/) {
  802. printf(\"%%define %s %d\\n\", c, v) >>file;
  803. } else if (file ~ /\\.mak\$/) {
  804. n = -v ? \"\" : \"!\";
  805. printf(\"%s%s=yes\\n\", n, c) >>file;
  806. } else if (file ~ /\\.texi\$/) {
  807. pre = -v ? \"\" : \"@c \";
  808. yesno = \$2;
  809. c2 = tolower(c);
  810. gsub(/_/, \"-\", c2);
  811. printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
  812. }
  813. }
  814. }"
  815. }
  816. print_enabled(){
  817. suf=$1
  818. shift
  819. for v; do
  820. enabled $v && printf "%s\n" ${v%$suf}
  821. done
  822. }
  823. append(){
  824. var=$1
  825. shift
  826. eval "$var=\"\$$var $*\""
  827. }
  828. prepend(){
  829. var=$1
  830. shift
  831. eval "$var=\"$* \$$var\""
  832. }
  833. reverse () {
  834. eval '
  835. reverse_out=
  836. for v in $'$1'; do
  837. reverse_out="$v $reverse_out"
  838. done
  839. '$1'=$reverse_out
  840. '
  841. }
  842. # keeps the last occurence of each non-unique item
  843. unique(){
  844. unique_out=
  845. eval unique_in=\$$1
  846. reverse unique_in
  847. for v in $unique_in; do
  848. # " $unique_out" +space such that every item is surrounded with spaces
  849. case " $unique_out" in *" $v "*) continue; esac # already in list
  850. unique_out="$unique_out$v "
  851. done
  852. reverse unique_out
  853. eval $1=\$unique_out
  854. }
  855. resolve(){
  856. resolve_out=
  857. eval resolve_in=\$$1
  858. for v in $resolve_in; do
  859. eval 'resolve_out="$resolve_out$'$v' "'
  860. done
  861. eval $1=\$resolve_out
  862. }
  863. add_cppflags(){
  864. append CPPFLAGS "$@"
  865. }
  866. add_cflags(){
  867. append CFLAGS $($cflags_filter "$@")
  868. }
  869. add_cflags_headers(){
  870. append CFLAGS_HEADERS $($cflags_filter "$@")
  871. }
  872. add_cxxflags(){
  873. append CXXFLAGS $($cflags_filter "$@")
  874. }
  875. add_objcflags(){
  876. append OBJCFLAGS $($objcflags_filter "$@")
  877. }
  878. add_asflags(){
  879. append ASFLAGS $($asflags_filter "$@")
  880. }
  881. add_ldflags(){
  882. append LDFLAGS $($ldflags_filter "$@")
  883. }
  884. add_ldexeflags(){
  885. append LDEXEFLAGS $($ldflags_filter "$@")
  886. }
  887. add_ldsoflags(){
  888. append LDSOFLAGS $($ldflags_filter "$@")
  889. }
  890. add_extralibs(){
  891. prepend extralibs $($ldflags_filter "$@")
  892. }
  893. add_stripflags(){
  894. append ASMSTRIPFLAGS "$@"
  895. }
  896. add_host_cppflags(){
  897. append host_cppflags "$@"
  898. }
  899. add_host_cflags(){
  900. append host_cflags $($host_cflags_filter "$@")
  901. }
  902. add_host_ldflags(){
  903. append host_ldflags $($host_ldflags_filter "$@")
  904. }
  905. add_compat(){
  906. append compat_objs $1
  907. shift
  908. map 'add_cppflags -D$v' "$@"
  909. }
  910. test_cmd(){
  911. log "$@"
  912. "$@" >> $logfile 2>&1
  913. }
  914. test_stat(){
  915. log test_stat "$@"
  916. stat "$1" >> $logfile 2>&1
  917. }
  918. cc_e(){
  919. eval printf '%s\\n' $CC_E
  920. }
  921. cc_o(){
  922. eval printf '%s\\n' $CC_O
  923. }
  924. as_o(){
  925. eval printf '%s\\n' $AS_O
  926. }
  927. x86asm_o(){
  928. eval printf '%s\\n' $X86ASM_O
  929. }
  930. ld_o(){
  931. eval printf '%s\\n' $LD_O
  932. }
  933. hostcc_e(){
  934. eval printf '%s\\n' $HOSTCC_E
  935. }
  936. hostcc_o(){
  937. eval printf '%s\\n' $HOSTCC_O
  938. }
  939. nvcc_o(){
  940. eval printf '%s\\n' $NVCC_O
  941. }
  942. test_cc(){
  943. log test_cc "$@"
  944. cat > $TMPC
  945. log_file $TMPC
  946. test_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  947. }
  948. test_cxx(){
  949. log test_cxx "$@"
  950. cat > $TMPCPP
  951. log_file $TMPCPP
  952. test_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  953. }
  954. test_objcc(){
  955. log test_objcc "$@"
  956. cat > $TMPM
  957. log_file $TMPM
  958. test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
  959. }
  960. test_nvcc(){
  961. log test_nvcc "$@"
  962. cat > $TMPCU
  963. log_file $TMPCU
  964. tmpcu_=$TMPCU
  965. tmpo_=$TMPO
  966. [ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
  967. test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
  968. }
  969. check_nvcc() {
  970. log check_nvcc "$@"
  971. name=$1
  972. shift 1
  973. disabled $name && return
  974. disable $name
  975. test_nvcc "$@" <<EOF && enable $name
  976. extern "C" {
  977. __global__ void hello(unsigned char *data) {}
  978. }
  979. EOF
  980. }
  981. test_cpp(){
  982. log test_cpp "$@"
  983. cat > $TMPC
  984. log_file $TMPC
  985. test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  986. }
  987. test_as(){
  988. log test_as "$@"
  989. cat > $TMPS
  990. log_file $TMPS
  991. test_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  992. }
  993. test_x86asm(){
  994. log test_x86asm "$@"
  995. echo "$1" > $TMPASM
  996. log_file $TMPASM
  997. shift
  998. test_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" $(x86asm_o $TMPO) $TMPASM
  999. }
  1000. check_cmd(){
  1001. log check_cmd "$@"
  1002. cmd=$1
  1003. disabled $cmd && return
  1004. disable $cmd
  1005. test_cmd $@ && enable $cmd
  1006. }
  1007. check_as(){
  1008. log check_as "$@"
  1009. name=$1
  1010. code=$2
  1011. shift 2
  1012. disable $name
  1013. test_as $@ <<EOF && enable $name
  1014. $code
  1015. EOF
  1016. }
  1017. check_inline_asm(){
  1018. log check_inline_asm "$@"
  1019. name="$1"
  1020. code="$2"
  1021. shift 2
  1022. disable $name
  1023. test_cc "$@" <<EOF && enable $name
  1024. void foo(void){ __asm__ volatile($code); }
  1025. EOF
  1026. }
  1027. check_inline_asm_flags(){
  1028. log check_inline_asm_flags "$@"
  1029. name="$1"
  1030. code="$2"
  1031. flags=''
  1032. shift 2
  1033. while [ "$1" != "" ]; do
  1034. append flags $1
  1035. shift
  1036. done;
  1037. disable $name
  1038. cat > $TMPC <<EOF
  1039. void foo(void){ __asm__ volatile($code); }
  1040. EOF
  1041. log_file $TMPC
  1042. test_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
  1043. enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
  1044. }
  1045. check_insn(){
  1046. log check_insn "$@"
  1047. check_inline_asm ${1}_inline "\"$2\""
  1048. check_as ${1}_external "$2"
  1049. }
  1050. check_arch_level(){
  1051. log check_arch_level "$@"
  1052. level="$1"
  1053. check_as tested_arch_level ".arch $level"
  1054. enabled tested_arch_level && as_arch_level="$level"
  1055. }
  1056. check_archext_insn(){
  1057. log check_archext_insn "$@"
  1058. feature="$1"
  1059. instr="$2"
  1060. # Check if the assembly is accepted in inline assembly.
  1061. check_inline_asm ${feature}_inline "\"$instr\""
  1062. # We don't check if the instruction is supported out of the box by the
  1063. # external assembler (we don't try to set ${feature}_external) as we don't
  1064. # need to use these instructions in non-runtime detected codepaths.
  1065. disable $feature
  1066. enabled as_arch_directive && arch_directive=".arch $as_arch_level" || arch_directive=""
  1067. # Test if the assembler supports the .arch_extension $feature directive.
  1068. arch_extension_directive=".arch_extension $feature"
  1069. test_as <<EOF && enable as_archext_${feature}_directive || arch_extension_directive=""
  1070. $arch_directive
  1071. $arch_extension_directive
  1072. EOF
  1073. # Test if we can assemble the instruction after potential .arch and
  1074. # .arch_extension directives.
  1075. test_as <<EOF && enable ${feature}
  1076. $arch_directive
  1077. $arch_extension_directive
  1078. $instr
  1079. EOF
  1080. }
  1081. check_x86asm(){
  1082. log check_x86asm "$@"
  1083. name=$1
  1084. shift
  1085. disable $name
  1086. test_x86asm "$@" && enable $name
  1087. }
  1088. test_ld(){
  1089. log test_ld "$@"
  1090. type=$1
  1091. shift 1
  1092. flags=$(filter_out '-l*|*.so' $@)
  1093. libs=$(filter '-l*|*.so' $@)
  1094. test_$type $($cflags_filter $flags) || return
  1095. flags=$($ldflags_filter $flags)
  1096. libs=$($ldflags_filter $libs)
  1097. test_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  1098. }
  1099. check_ld(){
  1100. log check_ld "$@"
  1101. type=$1
  1102. name=$2
  1103. shift 2
  1104. disable $name
  1105. test_ld $type $@ && enable $name
  1106. }
  1107. print_include(){
  1108. hdr=$1
  1109. test "${hdr%.h}" = "${hdr}" &&
  1110. echo "#include $hdr" ||
  1111. echo "#include <$hdr>"
  1112. }
  1113. test_code(){
  1114. log test_code "$@"
  1115. check=$1
  1116. headers=$2
  1117. code=$3
  1118. shift 3
  1119. {
  1120. for hdr in $headers; do
  1121. print_include $hdr
  1122. done
  1123. echo "int main(void) { $code; return 0; }"
  1124. } | test_$check "$@"
  1125. }
  1126. check_cppflags(){
  1127. log check_cppflags "$@"
  1128. test_cpp "$@" <<EOF && append CPPFLAGS "$@"
  1129. #include <stdlib.h>
  1130. EOF
  1131. }
  1132. test_cflags(){
  1133. log test_cflags "$@"
  1134. set -- $($cflags_filter "$@")
  1135. test_cc "$@" <<EOF
  1136. int x;
  1137. EOF
  1138. }
  1139. check_cflags(){
  1140. log check_cflags "$@"
  1141. test_cflags "$@" && add_cflags "$@"
  1142. }
  1143. check_cxxflags(){
  1144. log check_cxxflags "$@"
  1145. set -- $($cflags_filter "$@")
  1146. test_cxx "$@" <<EOF && append CXXFLAGS "$@"
  1147. int x;
  1148. EOF
  1149. }
  1150. test_objcflags(){
  1151. log test_objcflags "$@"
  1152. set -- $($objcflags_filter "$@")
  1153. test_objcc "$@" <<EOF
  1154. int x;
  1155. EOF
  1156. }
  1157. check_objcflags(){
  1158. log check_objcflags "$@"
  1159. test_objcflags "$@" && add_objcflags "$@"
  1160. }
  1161. test_ldflags(){
  1162. log test_ldflags "$@"
  1163. set -- $($ldflags_filter "$@")
  1164. test_ld "cc" "$@" <<EOF
  1165. int main(void){ return 0; }
  1166. EOF
  1167. }
  1168. check_ldflags(){
  1169. log check_ldflags "$@"
  1170. test_ldflags "$@" && add_ldflags "$@"
  1171. }
  1172. test_stripflags(){
  1173. log test_stripflags "$@"
  1174. # call test_cc to get a fresh TMPO
  1175. test_cc <<EOF
  1176. int main(void) { return 0; }
  1177. EOF
  1178. test_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
  1179. }
  1180. check_stripflags(){
  1181. log check_stripflags "$@"
  1182. test_stripflags "$@" && add_stripflags "$@"
  1183. }
  1184. check_headers(){
  1185. log check_headers "$@"
  1186. headers=$1
  1187. shift
  1188. disable_sanitized $headers
  1189. {
  1190. for hdr in $headers; do
  1191. print_include $hdr
  1192. done
  1193. echo "int x;"
  1194. } | test_cpp "$@" && enable_sanitized $headers
  1195. }
  1196. check_header_objcc(){
  1197. log check_header_objcc "$@"
  1198. rm -f -- "$TMPO"
  1199. header=$1
  1200. shift
  1201. disable_sanitized $header
  1202. {
  1203. echo "#include <$header>"
  1204. echo "int main(void) { return 0; }"
  1205. } | test_objcc && test_stat "$TMPO" && enable_sanitized $header
  1206. }
  1207. check_apple_framework(){
  1208. log check_apple_framework "$@"
  1209. framework="$1"
  1210. name="$(tolower $framework)"
  1211. header="${framework}/${framework}.h"
  1212. disable $name
  1213. check_header_objcc $header &&
  1214. enable $name && eval ${name}_extralibs='"-framework $framework"'
  1215. }
  1216. check_func(){
  1217. log check_func "$@"
  1218. func=$1
  1219. shift
  1220. disable $func
  1221. test_ld "cc" "$@" <<EOF && enable $func
  1222. extern int $func();
  1223. int main(void){ $func(); }
  1224. EOF
  1225. }
  1226. check_mathfunc(){
  1227. log check_mathfunc "$@"
  1228. func=$1
  1229. narg=$2
  1230. shift 2
  1231. test $narg = 2 && args="f, g" || args="f"
  1232. disable $func
  1233. test_ld "cc" "$@" <<EOF && enable $func
  1234. #include <math.h>
  1235. float foo(float f, float g) { return $func($args); }
  1236. int main(void){ return (int) foo; }
  1237. EOF
  1238. }
  1239. check_func_headers(){
  1240. log check_func_headers "$@"
  1241. headers=$1
  1242. funcs=$2
  1243. shift 2
  1244. {
  1245. for hdr in $headers; do
  1246. print_include $hdr
  1247. done
  1248. echo "#include <stdint.h>"
  1249. for func in $funcs; do
  1250. echo "long check_$func(void) { return (long) $func; }"
  1251. done
  1252. echo "int main(void) { int ret = 0;"
  1253. # LTO could optimize out the test functions without this
  1254. for func in $funcs; do
  1255. echo " ret |= ((intptr_t)check_$func) & 0xFFFF;"
  1256. done
  1257. echo "return ret; }"
  1258. } | test_ld "cc" "$@" && enable $funcs && enable_sanitized $headers
  1259. }
  1260. check_class_headers_cpp(){
  1261. log check_class_headers_cpp "$@"
  1262. headers=$1
  1263. classes=$2
  1264. shift 2
  1265. {
  1266. for hdr in $headers; do
  1267. echo "#include <$hdr>"
  1268. done
  1269. echo "int main(void) { "
  1270. i=1
  1271. for class in $classes; do
  1272. echo "$class obj$i;"
  1273. i=$(expr $i + 1)
  1274. done
  1275. echo "return 0; }"
  1276. } | test_ld "cxx" "$@" && enable $funcs && enable_sanitized $headers
  1277. }
  1278. test_cpp_condition(){
  1279. log test_cpp_condition "$@"
  1280. header=$1
  1281. condition=$2
  1282. shift 2
  1283. test_cpp "$@" <<EOF
  1284. #include <$header>
  1285. #if !($condition)
  1286. #error "unsatisfied condition: $condition"
  1287. #endif
  1288. EOF
  1289. }
  1290. check_cpp_condition(){
  1291. log check_cpp_condition "$@"
  1292. name=$1
  1293. shift 1
  1294. disable $name
  1295. test_cpp_condition "$@" && enable $name
  1296. }
  1297. test_cflags_cc(){
  1298. log test_cflags_cc "$@"
  1299. flags=$1
  1300. header=$2
  1301. condition=$3
  1302. shift 3
  1303. set -- $($cflags_filter "$flags")
  1304. test_cc "$@" <<EOF
  1305. #include <$header>
  1306. #if !($condition)
  1307. #error "unsatisfied condition: $condition"
  1308. #endif
  1309. EOF
  1310. }
  1311. check_cflags_cc(){
  1312. log check_cflags_cc "$@"
  1313. flags=$1
  1314. test_cflags_cc "$@" && add_cflags $flags
  1315. }
  1316. test_cxxflags_cc(){
  1317. log test_cxxflags_cc "$@"
  1318. flags=$1
  1319. header=$2
  1320. condition=$3
  1321. shift 3
  1322. set -- $($cflags_filter "$flags")
  1323. test_cxx "$@" <<EOF
  1324. #include <$header>
  1325. #if !($condition)
  1326. #error "unsatisfied condition: $condition"
  1327. #endif
  1328. EOF
  1329. }
  1330. check_cxxflags_cc(){
  1331. log check_cxxflags_cc "$@"
  1332. flags=$1
  1333. test_cxxflags_cc "$@" && add_cxxflags $flags
  1334. }
  1335. check_lib(){
  1336. log check_lib "$@"
  1337. name="$1"
  1338. headers="$2"
  1339. funcs="$3"
  1340. shift 3
  1341. disable $name
  1342. check_func_headers "$headers" "$funcs" "$@" &&
  1343. enable $name && eval ${name}_extralibs="\$@"
  1344. }
  1345. check_lib_cpp(){
  1346. log check_lib_cpp "$@"
  1347. name="$1"
  1348. headers="$2"
  1349. classes="$3"
  1350. shift 3
  1351. disable $name
  1352. check_class_headers_cpp "$headers" "$classes" "$@" &&
  1353. enable $name && eval ${name}_extralibs="\$@"
  1354. }
  1355. test_pkg_config(){
  1356. log test_pkg_config "$@"
  1357. name="$1"
  1358. pkg_version="$2"
  1359. pkg="${2%% *}"
  1360. headers="$3"
  1361. funcs="$4"
  1362. shift 4
  1363. disable $name
  1364. test_cmd $pkg_config --exists --print-errors "$pkg_version" || return
  1365. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1366. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1367. pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
  1368. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  1369. enable $name &&
  1370. set_sanitized "${name}_cflags" $pkg_cflags &&
  1371. set_sanitized "${name}_incdir" $pkg_incdir &&
  1372. set_sanitized "${name}_extralibs" $pkg_libs
  1373. }
  1374. test_pkg_config_cpp(){
  1375. log test_pkg_config_cpp "$@"
  1376. name="$1"
  1377. pkg_version="$2"
  1378. pkg="${2%% *}"
  1379. headers="$3"
  1380. cond="$4"
  1381. shift 4
  1382. disable $name
  1383. test_cmd $pkg_config --exists --print-errors "$pkg_version" || return
  1384. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1385. pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
  1386. pkg_incflags=$($pkg_config --cflags-only-I $pkg_config_flags $pkg)
  1387. test_cpp_condition "$pkg_incdir/$headers" "$cond" "$@" &&
  1388. enable $name &&
  1389. set_sanitized "${name}_cflags" $pkg_cflags &&
  1390. set_sanitized "${name}_incdir" $pkg_incdir &&
  1391. set_sanitized "${name}_incflags" $pkg_incflags
  1392. }
  1393. check_pkg_config(){
  1394. log check_pkg_config "$@"
  1395. name="$1"
  1396. test_pkg_config "$@" &&
  1397. eval add_cflags \$${name}_cflags
  1398. }
  1399. check_pkg_config_cpp(){
  1400. log check_pkg_config_cpp "$@"
  1401. name="$1"
  1402. test_pkg_config_cpp "$@" &&
  1403. eval add_cflags \$${name}_cflags
  1404. }
  1405. check_pkg_config_header_only(){
  1406. log check_pkg_config_cpp "$@"
  1407. name="$1"
  1408. test_pkg_config_cpp "$@" &&
  1409. eval add_cflags \$${name}_incflags
  1410. }
  1411. test_exec(){
  1412. test_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  1413. }
  1414. check_exec_crash(){
  1415. log check_exec_crash "$@"
  1416. code=$(cat)
  1417. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  1418. # are safe but may not be available everywhere. Thus we use
  1419. # raise(SIGTERM) instead. The check is run in a subshell so we
  1420. # can redirect the "Terminated" message from the shell. SIGBUS
  1421. # is not defined by standard C so it is used conditionally.
  1422. (test_exec "$@") >> $logfile 2>&1 <<EOF
  1423. #include <signal.h>
  1424. static void sighandler(int sig){
  1425. raise(SIGTERM);
  1426. }
  1427. int foo(void){
  1428. $code
  1429. }
  1430. int (*func_ptr)(void) = foo;
  1431. int main(void){
  1432. signal(SIGILL, sighandler);
  1433. signal(SIGFPE, sighandler);
  1434. signal(SIGSEGV, sighandler);
  1435. #ifdef SIGBUS
  1436. signal(SIGBUS, sighandler);
  1437. #endif
  1438. return func_ptr();
  1439. }
  1440. EOF
  1441. }
  1442. check_type(){
  1443. log check_type "$@"
  1444. headers=$1
  1445. type=$2
  1446. shift 2
  1447. disable_sanitized "$type"
  1448. test_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
  1449. }
  1450. check_struct(){
  1451. log check_struct "$@"
  1452. headers=$1
  1453. struct=$2
  1454. member=$3
  1455. shift 3
  1456. disable_sanitized "${struct}_${member}"
  1457. test_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  1458. enable_sanitized "${struct}_${member}"
  1459. }
  1460. check_builtin(){
  1461. log check_builtin "$@"
  1462. name=$1
  1463. headers=$2
  1464. builtin=$3
  1465. shift 3
  1466. disable "$name"
  1467. test_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
  1468. }
  1469. check_compile_assert(){
  1470. log check_compile_assert "$@"
  1471. name=$1
  1472. headers=$2
  1473. condition=$3
  1474. shift 3
  1475. disable "$name"
  1476. test_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  1477. }
  1478. check_cc(){
  1479. log check_cc "$@"
  1480. name=$1
  1481. shift
  1482. disable "$name"
  1483. test_code cc "$@" && enable "$name"
  1484. }
  1485. require(){
  1486. log require "$@"
  1487. name_version="$1"
  1488. name="${1%% *}"
  1489. shift
  1490. check_lib $name "$@" || die "ERROR: $name_version not found"
  1491. }
  1492. require_cc(){
  1493. log require_cc "$@"
  1494. name="$1"
  1495. check_cc "$@" || die "ERROR: $name failed"
  1496. }
  1497. require_cpp(){
  1498. log require_cpp "$@"
  1499. name_version="$1"
  1500. name="${1%% *}"
  1501. shift
  1502. check_lib_cpp "$name" "$@" || die "ERROR: $name_version not found"
  1503. }
  1504. require_headers(){
  1505. log require_headers "$@"
  1506. headers="$1"
  1507. check_headers "$@" || die "ERROR: $headers not found"
  1508. }
  1509. require_cpp_condition(){
  1510. log require_cpp_condition "$@"
  1511. condition="$3"
  1512. check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
  1513. }
  1514. require_pkg_config(){
  1515. log require_pkg_config "$@"
  1516. pkg_version="$2"
  1517. check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
  1518. }
  1519. require_pkg_config_cpp(){
  1520. log require_pkg_config_cpp "$@"
  1521. pkg_version="$2"
  1522. check_pkg_config_cpp "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
  1523. }
  1524. test_host_cc(){
  1525. log test_host_cc "$@"
  1526. cat > $TMPC
  1527. log_file $TMPC
  1528. test_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  1529. }
  1530. test_host_cpp(){
  1531. log test_host_cpp "$@"
  1532. cat > $TMPC
  1533. log_file $TMPC
  1534. test_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
  1535. }
  1536. check_host_cppflags(){
  1537. log check_host_cppflags "$@"
  1538. test_host_cpp "$@" <<EOF && append host_cppflags "$@"
  1539. #include <stdlib.h>
  1540. EOF
  1541. }
  1542. check_host_cflags(){
  1543. log check_host_cflags "$@"
  1544. set -- $($host_cflags_filter "$@")
  1545. test_host_cc "$@" <<EOF && append host_cflags "$@"
  1546. int x;
  1547. EOF
  1548. }
  1549. test_host_cflags_cc(){
  1550. log test_host_cflags_cc "$@"
  1551. flags=$1
  1552. header=$2
  1553. condition=$3
  1554. shift 3
  1555. set -- $($host_cflags_filter "$flags")
  1556. test_host_cc "$@" <<EOF
  1557. #include <$header>
  1558. #if !($condition)
  1559. #error "unsatisfied condition: $condition"
  1560. #endif
  1561. EOF
  1562. }
  1563. check_host_cflags_cc(){
  1564. log check_host_cflags_cc "$@"
  1565. flags=$1
  1566. test_host_cflags_cc "$@" && add_host_cflags $flags
  1567. }
  1568. test_host_cpp_condition(){
  1569. log test_host_cpp_condition "$@"
  1570. header=$1
  1571. condition=$2
  1572. shift 2
  1573. test_host_cpp "$@" <<EOF
  1574. #include <$header>
  1575. #if !($condition)
  1576. #error "unsatisfied condition: $condition"
  1577. #endif
  1578. EOF
  1579. }
  1580. check_host_cpp_condition(){
  1581. log check_host_cpp_condition "$@"
  1582. name=$1
  1583. shift 1
  1584. disable $name
  1585. test_host_cpp_condition "$@" && enable $name
  1586. }
  1587. cp_if_changed(){
  1588. cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return
  1589. mkdir -p "$(dirname $2)"
  1590. cp -f "$1" "$2"
  1591. }
  1592. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  1593. # system-dependent things.
  1594. AVCODEC_COMPONENTS="
  1595. bsfs
  1596. decoders
  1597. encoders
  1598. hwaccels
  1599. parsers
  1600. "
  1601. AVDEVICE_COMPONENTS="
  1602. indevs
  1603. outdevs
  1604. "
  1605. AVFILTER_COMPONENTS="
  1606. filters
  1607. "
  1608. AVFORMAT_COMPONENTS="
  1609. demuxers
  1610. muxers
  1611. protocols
  1612. "
  1613. COMPONENT_LIST="
  1614. $AVCODEC_COMPONENTS
  1615. $AVDEVICE_COMPONENTS
  1616. $AVFILTER_COMPONENTS
  1617. $AVFORMAT_COMPONENTS
  1618. "
  1619. EXAMPLE_LIST="
  1620. avio_http_serve_files_example
  1621. avio_list_dir_example
  1622. avio_read_callback_example
  1623. decode_audio_example
  1624. decode_filter_audio_example
  1625. decode_filter_video_example
  1626. decode_video_example
  1627. demux_decode_example
  1628. encode_audio_example
  1629. encode_video_example
  1630. extract_mvs_example
  1631. filter_audio_example
  1632. hw_decode_example
  1633. mux_example
  1634. qsv_decode_example
  1635. remux_example
  1636. resample_audio_example
  1637. scale_video_example
  1638. show_metadata_example
  1639. transcode_aac_example
  1640. transcode_example
  1641. vaapi_encode_example
  1642. vaapi_transcode_example
  1643. qsv_transcode_example
  1644. "
  1645. EXTERNAL_AUTODETECT_LIBRARY_LIST="
  1646. alsa
  1647. appkit
  1648. avfoundation
  1649. bzlib
  1650. coreimage
  1651. iconv
  1652. libxcb
  1653. libxcb_shm
  1654. libxcb_shape
  1655. libxcb_xfixes
  1656. lzma
  1657. mediafoundation
  1658. metal
  1659. schannel
  1660. sdl2
  1661. securetransport
  1662. sndio
  1663. xlib
  1664. zlib
  1665. "
  1666. EXTERNAL_LIBRARY_GPL_LIST="
  1667. avisynth
  1668. frei0r
  1669. libcdio
  1670. libdavs2
  1671. libdvdnav
  1672. libdvdread
  1673. librubberband
  1674. libvidstab
  1675. libx264
  1676. libx265
  1677. libxavs
  1678. libxavs2
  1679. libxvid
  1680. "
  1681. EXTERNAL_LIBRARY_NONFREE_LIST="
  1682. decklink
  1683. libfdk_aac
  1684. libtls
  1685. "
  1686. EXTERNAL_LIBRARY_VERSION3_LIST="
  1687. gmp
  1688. libaribb24
  1689. liblensfun
  1690. libopencore_amrnb
  1691. libopencore_amrwb
  1692. libvo_amrwbenc
  1693. mbedtls
  1694. rkmpp
  1695. "
  1696. EXTERNAL_LIBRARY_GPLV3_LIST="
  1697. libsmbclient
  1698. "
  1699. EXTERNAL_LIBRARY_LIST="
  1700. $EXTERNAL_LIBRARY_GPL_LIST
  1701. $EXTERNAL_LIBRARY_NONFREE_LIST
  1702. $EXTERNAL_LIBRARY_VERSION3_LIST
  1703. $EXTERNAL_LIBRARY_GPLV3_LIST
  1704. chromaprint
  1705. gcrypt
  1706. gnutls
  1707. jni
  1708. ladspa
  1709. lcms2
  1710. libaom
  1711. libaribcaption
  1712. libass
  1713. libbluray
  1714. libbs2b
  1715. libcaca
  1716. libcelt
  1717. libcodec2
  1718. libdav1d
  1719. libdc1394
  1720. libflite
  1721. libfontconfig
  1722. libfreetype
  1723. libfribidi
  1724. libharfbuzz
  1725. libglslang
  1726. libgme
  1727. libgsm
  1728. libiec61883
  1729. libilbc
  1730. libjack
  1731. libjxl
  1732. libklvanc
  1733. libkvazaar
  1734. liblc3
  1735. liblcevc_dec
  1736. libmodplug
  1737. libmp3lame
  1738. libmysofa
  1739. libopencv
  1740. libopenh264
  1741. libopenjpeg
  1742. libopenmpt
  1743. libopenvino
  1744. libopus
  1745. libplacebo
  1746. libpulse
  1747. libqrencode
  1748. libquirc
  1749. librabbitmq
  1750. librav1e
  1751. librist
  1752. librsvg
  1753. librtmp
  1754. libshaderc
  1755. libshine
  1756. libsmbclient
  1757. libsnappy
  1758. libsoxr
  1759. libspeex
  1760. libsrt
  1761. libssh
  1762. libsvtav1
  1763. libtensorflow
  1764. libtesseract
  1765. libtheora
  1766. libtorch
  1767. libtwolame
  1768. libuavs3d
  1769. libv4l2
  1770. libvmaf
  1771. libvorbis
  1772. libvpx
  1773. libvvenc
  1774. libwebp
  1775. libxevd
  1776. libxeve
  1777. libxml2
  1778. libzimg
  1779. libzmq
  1780. libzvbi
  1781. lv2
  1782. mediacodec
  1783. openal
  1784. opengl
  1785. openssl
  1786. pocketsphinx
  1787. vapoursynth
  1788. vulkan_static
  1789. "
  1790. HWACCEL_AUTODETECT_LIBRARY_LIST="
  1791. amf
  1792. audiotoolbox
  1793. cuda
  1794. cuda_llvm
  1795. cuvid
  1796. d3d11va
  1797. d3d12va
  1798. dxva2
  1799. ffnvcodec
  1800. libdrm
  1801. nvdec
  1802. nvenc
  1803. vaapi
  1804. vdpau
  1805. videotoolbox
  1806. vulkan
  1807. v4l2_m2m
  1808. "
  1809. # catchall list of things that require external libs to link
  1810. EXTRALIBS_LIST="
  1811. cpu_init
  1812. cws2fws
  1813. "
  1814. HWACCEL_LIBRARY_NONFREE_LIST="
  1815. cuda_nvcc
  1816. cuda_sdk
  1817. libnpp
  1818. "
  1819. HWACCEL_LIBRARY_LIST="
  1820. $HWACCEL_LIBRARY_NONFREE_LIST
  1821. libmfx
  1822. libvpl
  1823. mmal
  1824. omx
  1825. opencl
  1826. "
  1827. DOCUMENT_LIST="
  1828. doc
  1829. htmlpages
  1830. manpages
  1831. podpages
  1832. txtpages
  1833. "
  1834. FEATURE_LIST="
  1835. ftrapv
  1836. gray
  1837. hardcoded_tables
  1838. omx_rpi
  1839. runtime_cpudetect
  1840. safe_bitstream_reader
  1841. shared
  1842. small
  1843. static
  1844. swscale_alpha
  1845. "
  1846. # this list should be kept in linking order
  1847. LIBRARY_LIST="
  1848. avdevice
  1849. avfilter
  1850. swscale
  1851. postproc
  1852. avformat
  1853. avcodec
  1854. swresample
  1855. avutil
  1856. "
  1857. LICENSE_LIST="
  1858. gpl
  1859. nonfree
  1860. version3
  1861. "
  1862. PROGRAM_LIST="
  1863. ffplay
  1864. ffprobe
  1865. ffmpeg
  1866. "
  1867. SUBSYSTEM_LIST="
  1868. dwt
  1869. error_resilience
  1870. faan
  1871. fast_unaligned
  1872. iamf
  1873. lsp
  1874. pixelutils
  1875. network
  1876. "
  1877. # COMPONENT_LIST needs to come last to ensure correct dependency checking
  1878. CONFIG_LIST="
  1879. $DOCUMENT_LIST
  1880. $EXAMPLE_LIST
  1881. $EXTERNAL_LIBRARY_LIST
  1882. $EXTERNAL_AUTODETECT_LIBRARY_LIST
  1883. $HWACCEL_LIBRARY_LIST
  1884. $HWACCEL_AUTODETECT_LIBRARY_LIST
  1885. $FEATURE_LIST
  1886. $LICENSE_LIST
  1887. $LIBRARY_LIST
  1888. $PROGRAM_LIST
  1889. $SUBSYSTEM_LIST
  1890. autodetect
  1891. fontconfig
  1892. large_tests
  1893. linux_perf
  1894. macos_kperf
  1895. memory_poisoning
  1896. neon_clobber_test
  1897. ossfuzz
  1898. pic
  1899. ptx_compression
  1900. thumb
  1901. valgrind_backtrace
  1902. xmm_clobber_test
  1903. $COMPONENT_LIST
  1904. "
  1905. THREADS_LIST="
  1906. pthreads
  1907. os2threads
  1908. w32threads
  1909. "
  1910. ATOMICS_LIST="
  1911. atomics_win32
  1912. "
  1913. AUTODETECT_LIBS="
  1914. $EXTERNAL_AUTODETECT_LIBRARY_LIST
  1915. $HWACCEL_AUTODETECT_LIBRARY_LIST
  1916. $THREADS_LIST
  1917. "
  1918. ARCH_LIST="
  1919. aarch64
  1920. arm
  1921. ia64
  1922. loongarch
  1923. loongarch32
  1924. loongarch64
  1925. m68k
  1926. mips
  1927. mips64
  1928. parisc
  1929. ppc
  1930. ppc64
  1931. riscv
  1932. s390
  1933. sparc
  1934. sparc64
  1935. tilegx
  1936. tilepro
  1937. wasm
  1938. x86
  1939. x86_32
  1940. x86_64
  1941. "
  1942. ARCH_EXT_LIST_ARM="
  1943. armv5te
  1944. armv6
  1945. armv6t2
  1946. armv8
  1947. dotprod
  1948. i8mm
  1949. neon
  1950. vfp
  1951. vfpv3
  1952. setend
  1953. sve
  1954. sve2
  1955. "
  1956. ARCH_EXT_LIST_MIPS="
  1957. mipsfpu
  1958. mips32r2
  1959. mips32r5
  1960. mips64r2
  1961. mips32r6
  1962. mips64r6
  1963. mipsdsp
  1964. mipsdspr2
  1965. msa
  1966. "
  1967. ARCH_EXT_LIST_LOONGSON="
  1968. loongson2
  1969. loongson3
  1970. mmi
  1971. lsx
  1972. lasx
  1973. "
  1974. ARCH_EXT_LIST_WASM="
  1975. simd128
  1976. "
  1977. ARCH_EXT_LIST_X86_SIMD="
  1978. aesni
  1979. amd3dnow
  1980. amd3dnowext
  1981. avx
  1982. avx2
  1983. avx512
  1984. avx512icl
  1985. fma3
  1986. fma4
  1987. mmx
  1988. mmxext
  1989. sse
  1990. sse2
  1991. sse3
  1992. sse4
  1993. sse42
  1994. ssse3
  1995. xop
  1996. "
  1997. ARCH_EXT_LIST_PPC="
  1998. altivec
  1999. dcbzl
  2000. ldbrx
  2001. power8
  2002. ppc4xx
  2003. vec_xl
  2004. vsx
  2005. "
  2006. ARCH_EXT_LIST_RISCV="
  2007. rv
  2008. rvv
  2009. rv_zicbop
  2010. rv_zvbb
  2011. "
  2012. ARCH_EXT_LIST_X86="
  2013. $ARCH_EXT_LIST_X86_SIMD
  2014. i686
  2015. "
  2016. ARCH_EXT_LIST="
  2017. $ARCH_EXT_LIST_ARM
  2018. $ARCH_EXT_LIST_PPC
  2019. $ARCH_EXT_LIST_RISCV
  2020. $ARCH_EXT_LIST_WASM
  2021. $ARCH_EXT_LIST_X86
  2022. $ARCH_EXT_LIST_MIPS
  2023. $ARCH_EXT_LIST_LOONGSON
  2024. "
  2025. ARCH_FEATURES="
  2026. aligned_stack
  2027. fast_64bit
  2028. fast_clz
  2029. fast_cmov
  2030. fast_float16
  2031. simd_align_16
  2032. simd_align_32
  2033. simd_align_64
  2034. "
  2035. BUILTIN_LIST="
  2036. MemoryBarrier
  2037. mm_empty
  2038. rdtsc
  2039. sem_timedwait
  2040. "
  2041. HAVE_LIST_CMDLINE="
  2042. inline_asm
  2043. symver
  2044. x86asm
  2045. "
  2046. HAVE_LIST_PUB="
  2047. bigendian
  2048. fast_unaligned
  2049. "
  2050. HEADERS_LIST="
  2051. arpa_inet_h
  2052. asm_hwprobe_h
  2053. asm_types_h
  2054. cdio_paranoia_h
  2055. cdio_paranoia_paranoia_h
  2056. cuda_h
  2057. dispatch_dispatch_h
  2058. dev_bktr_ioctl_bt848_h
  2059. dev_bktr_ioctl_meteor_h
  2060. dev_ic_bt8xx_h
  2061. dev_video_bktr_ioctl_bt848_h
  2062. dev_video_meteor_ioctl_meteor_h
  2063. direct_h
  2064. dirent_h
  2065. dxgidebug_h
  2066. dxva_h
  2067. ES2_gl_h
  2068. gsm_h
  2069. io_h
  2070. linux_dma_buf_h
  2071. linux_perf_event_h
  2072. machine_ioctl_bt848_h
  2073. machine_ioctl_meteor_h
  2074. malloc_h
  2075. opencv2_core_core_c_h
  2076. OpenGL_gl3_h
  2077. poll_h
  2078. pthread_np_h
  2079. sys_hwprobe_h
  2080. sys_param_h
  2081. sys_resource_h
  2082. sys_select_h
  2083. sys_soundcard_h
  2084. sys_time_h
  2085. sys_un_h
  2086. sys_videoio_h
  2087. termios_h
  2088. udplite_h
  2089. unistd_h
  2090. valgrind_valgrind_h
  2091. windows_h
  2092. winsock2_h
  2093. "
  2094. INTRINSICS_LIST="
  2095. intrinsics_neon
  2096. intrinsics_sse2
  2097. "
  2098. MATH_FUNCS="
  2099. atanf
  2100. atan2f
  2101. cbrt
  2102. cbrtf
  2103. copysign
  2104. cosf
  2105. erf
  2106. exp2
  2107. exp2f
  2108. expf
  2109. hypot
  2110. isfinite
  2111. isinf
  2112. isnan
  2113. ldexpf
  2114. llrint
  2115. llrintf
  2116. log2
  2117. log2f
  2118. log10f
  2119. lrint
  2120. lrintf
  2121. powf
  2122. rint
  2123. round
  2124. roundf
  2125. sinf
  2126. trunc
  2127. truncf
  2128. "
  2129. SYSTEM_FEATURES="
  2130. dos_paths
  2131. libc_msvcrt
  2132. MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
  2133. section_data_rel_ro
  2134. threads
  2135. uwp
  2136. winrt
  2137. "
  2138. SYSTEM_FUNCS="
  2139. access
  2140. aligned_malloc
  2141. arc4random_buf
  2142. clock_gettime
  2143. closesocket
  2144. CommandLineToArgvW
  2145. elf_aux_info
  2146. fcntl
  2147. getaddrinfo
  2148. getauxval
  2149. getenv
  2150. gethrtime
  2151. getopt
  2152. GetModuleHandle
  2153. GetProcessAffinityMask
  2154. GetProcessMemoryInfo
  2155. GetProcessTimes
  2156. getrusage
  2157. GetStdHandle
  2158. GetSystemTimeAsFileTime
  2159. gettimeofday
  2160. glob
  2161. glXGetProcAddress
  2162. gmtime_r
  2163. inet_aton
  2164. isatty
  2165. kbhit
  2166. localtime_r
  2167. lstat
  2168. lzo1x_999_compress
  2169. mach_absolute_time
  2170. MapViewOfFile
  2171. memalign
  2172. mkstemp
  2173. mmap
  2174. mprotect
  2175. nanosleep
  2176. PeekNamedPipe
  2177. posix_memalign
  2178. prctl
  2179. pthread_cancel
  2180. pthread_set_name_np
  2181. pthread_setname_np
  2182. sched_getaffinity
  2183. SecItemImport
  2184. SetConsoleTextAttribute
  2185. SetConsoleCtrlHandler
  2186. SetDllDirectory
  2187. setmode
  2188. setrlimit
  2189. Sleep
  2190. strerror_r
  2191. sysconf
  2192. sysctl
  2193. sysctlbyname
  2194. tempnam
  2195. usleep
  2196. UTGetOSTypeFromString
  2197. VirtualAlloc
  2198. wglGetProcAddress
  2199. "
  2200. SYSTEM_LIBRARIES="
  2201. bcrypt
  2202. vaapi_drm
  2203. vaapi_x11
  2204. vaapi_win32
  2205. vdpau_x11
  2206. "
  2207. TOOLCHAIN_FEATURES="
  2208. as_arch_directive
  2209. as_archext_dotprod_directive
  2210. as_archext_i8mm_directive
  2211. as_archext_sve_directive
  2212. as_archext_sve2_directive
  2213. as_dn_directive
  2214. as_fpu_directive
  2215. as_func
  2216. as_object_arch
  2217. asm_mod_q
  2218. blocks_extension
  2219. ebp_available
  2220. ebx_available
  2221. gnu_as
  2222. gnu_windres
  2223. ibm_asm
  2224. inline_asm_direct_symbol_refs
  2225. inline_asm_labels
  2226. inline_asm_nonlocal_labels
  2227. pragma_deprecated
  2228. rsync_contimeout
  2229. symver_asm_label
  2230. symver_gnu_asm
  2231. vfp_args
  2232. xform_asm
  2233. xmm_clobbers
  2234. "
  2235. TYPES_LIST="
  2236. DPI_AWARENESS_CONTEXT
  2237. IDXGIOutput5
  2238. kCMVideoCodecType_HEVC
  2239. kCMVideoCodecType_HEVCWithAlpha
  2240. kCMVideoCodecType_VP9
  2241. kCMVideoCodecType_AV1
  2242. kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange
  2243. kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange
  2244. kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange
  2245. kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange
  2246. kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange
  2247. kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange
  2248. kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange
  2249. kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
  2250. kCVImageBufferTransferFunction_ITU_R_2100_HLG
  2251. kCVImageBufferTransferFunction_Linear
  2252. kCVImageBufferYCbCrMatrix_ITU_R_2020
  2253. kCVImageBufferColorPrimaries_ITU_R_2020
  2254. kCVImageBufferTransferFunction_ITU_R_2020
  2255. kCVImageBufferTransferFunction_SMPTE_ST_428_1
  2256. kVTQPModulationLevel_Default
  2257. socklen_t
  2258. struct_addrinfo
  2259. struct_group_source_req
  2260. struct_ip_mreq_source
  2261. struct_ipv6_mreq
  2262. struct_msghdr_msg_flags
  2263. struct_pollfd
  2264. struct_rusage_ru_maxrss
  2265. struct_sctp_event_subscribe
  2266. struct_sockaddr_in6
  2267. struct_sockaddr_sa_len
  2268. struct_sockaddr_storage
  2269. struct_stat_st_mtim_tv_nsec
  2270. struct_v4l2_frmivalenum_discrete
  2271. struct_mfxConfigInterface
  2272. "
  2273. HAVE_LIST="
  2274. $ARCH_EXT_LIST
  2275. $(add_suffix _external $ARCH_EXT_LIST)
  2276. $(add_suffix _inline $ARCH_EXT_LIST)
  2277. $ARCH_FEATURES
  2278. $BUILTIN_LIST
  2279. $HAVE_LIST_CMDLINE
  2280. $HAVE_LIST_PUB
  2281. $HEADERS_LIST
  2282. $INTRINSICS_LIST
  2283. $MATH_FUNCS
  2284. $SYSTEM_FEATURES
  2285. $SYSTEM_FUNCS
  2286. $SYSTEM_LIBRARIES
  2287. $THREADS_LIST
  2288. $TOOLCHAIN_FEATURES
  2289. $TYPES_LIST
  2290. gzip
  2291. libdrm_getfb2
  2292. makeinfo
  2293. makeinfo_html
  2294. opencl_d3d11
  2295. opencl_drm_arm
  2296. opencl_drm_beignet
  2297. opencl_dxva2
  2298. opencl_vaapi_beignet
  2299. opencl_vaapi_intel_media
  2300. opencl_videotoolbox
  2301. perl
  2302. pod2man
  2303. posix_ioctl
  2304. texi2html
  2305. xmllint
  2306. zlib_gzip
  2307. openvino2
  2308. "
  2309. # options emitted with CONFIG_ prefix but not available on the command line
  2310. CONFIG_EXTRA="
  2311. aandcttables
  2312. ac3dsp
  2313. adts_header
  2314. atsc_a53
  2315. audio_frame_queue
  2316. audiodsp
  2317. blockdsp
  2318. bswapdsp
  2319. cabac
  2320. cbs
  2321. cbs_av1
  2322. cbs_h264
  2323. cbs_h265
  2324. cbs_h266
  2325. cbs_jpeg
  2326. cbs_mpeg2
  2327. cbs_vp8
  2328. cbs_vp9
  2329. d3d12va_encode
  2330. deflate_wrapper
  2331. dirac_parse
  2332. dnn
  2333. dovi_rpudec
  2334. dovi_rpuenc
  2335. dvprofile
  2336. evcparse
  2337. exif
  2338. faandct
  2339. faanidct
  2340. fdctdsp
  2341. fmtconvert
  2342. frame_thread_encoder
  2343. g722dsp
  2344. golomb
  2345. gplv3
  2346. h263dsp
  2347. h264chroma
  2348. h264dsp
  2349. h264parse
  2350. h264pred
  2351. h264qpel
  2352. h264_sei
  2353. hevcparse
  2354. hevc_sei
  2355. hpeldsp
  2356. huffman
  2357. huffyuvdsp
  2358. huffyuvencdsp
  2359. iamfdec
  2360. iamfenc
  2361. idctdsp
  2362. iirfilter
  2363. inflate_wrapper
  2364. intrax8
  2365. iso_media
  2366. iso_writer
  2367. ividsp
  2368. jpegtables
  2369. lgplv3
  2370. libx262
  2371. libx264_hdr10
  2372. llauddsp
  2373. llviddsp
  2374. llvidencdsp
  2375. lpc
  2376. lzf
  2377. me_cmp
  2378. mpeg_er
  2379. mpegaudio
  2380. mpegaudiodsp
  2381. mpegaudioheader
  2382. mpeg4audio
  2383. mpegvideo
  2384. mpegvideodec
  2385. mpegvideoenc
  2386. msmpeg4dec
  2387. msmpeg4enc
  2388. mss34dsp
  2389. pixblockdsp
  2390. qpeldsp
  2391. qsv
  2392. qsvdec
  2393. qsvenc
  2394. qsvvpp
  2395. rangecoder
  2396. riffdec
  2397. riffenc
  2398. rtpdec
  2399. rtpenc_chain
  2400. rv34dsp
  2401. scene_sad
  2402. sinewin
  2403. snappy
  2404. srtp
  2405. startcode
  2406. texturedsp
  2407. texturedspenc
  2408. tpeldsp
  2409. vaapi_1
  2410. vaapi_encode
  2411. vc1dsp
  2412. videodsp
  2413. vp3dsp
  2414. vp56dsp
  2415. vp8dsp
  2416. vulkan_encode
  2417. wma_freqs
  2418. wmv2dsp
  2419. "
  2420. CMDLINE_SELECT="
  2421. $ARCH_EXT_LIST
  2422. $CONFIG_LIST
  2423. $HAVE_LIST_CMDLINE
  2424. $THREADS_LIST
  2425. asm
  2426. cross_compile
  2427. debug
  2428. extra_warnings
  2429. logging
  2430. optimizations
  2431. rpath
  2432. stripping
  2433. version_tracking
  2434. "
  2435. PATHS_LIST="
  2436. bindir
  2437. datadir
  2438. docdir
  2439. incdir
  2440. libdir
  2441. mandir
  2442. pkgconfigdir
  2443. prefix
  2444. shlibdir
  2445. install_name_dir
  2446. "
  2447. CMDLINE_SET="
  2448. $PATHS_LIST
  2449. ar
  2450. arch
  2451. as
  2452. assert_level
  2453. build_suffix
  2454. cc
  2455. objcc
  2456. cpu
  2457. cross_prefix
  2458. custom_allocator
  2459. cxx
  2460. dep_cc
  2461. doxygen
  2462. env
  2463. extra_version
  2464. gas
  2465. host_cc
  2466. host_cflags
  2467. host_extralibs
  2468. host_ld
  2469. host_ldflags
  2470. host_os
  2471. ignore_tests
  2472. install
  2473. ld
  2474. ln_s
  2475. logfile
  2476. malloc_prefix
  2477. metalcc
  2478. metallib
  2479. nm
  2480. optflags
  2481. nvcc
  2482. nvccflags
  2483. pkg_config
  2484. pkg_config_flags
  2485. progs_suffix
  2486. random_seed
  2487. ranlib
  2488. samples
  2489. stdc
  2490. stdcxx
  2491. strip
  2492. sws_max_filter_size
  2493. sysinclude
  2494. sysroot
  2495. target_exec
  2496. target_os
  2497. target_path
  2498. target_samples
  2499. tempprefix
  2500. toolchain
  2501. valgrind
  2502. windres
  2503. x86asmexe
  2504. "
  2505. CMDLINE_APPEND="
  2506. extra_cflags
  2507. extra_cxxflags
  2508. extra_objcflags
  2509. host_cppflags
  2510. "
  2511. # code dependency declarations
  2512. # architecture extensions
  2513. armv5te_deps="arm"
  2514. armv6_deps="arm"
  2515. armv6t2_deps="arm"
  2516. armv8_deps="aarch64"
  2517. neon_deps_any="aarch64 arm"
  2518. intrinsics_neon_deps="neon"
  2519. intrinsics_sse2_deps="sse2"
  2520. vfp_deps="arm"
  2521. vfpv3_deps="vfp"
  2522. setend_deps="arm"
  2523. dotprod_deps="aarch64 neon"
  2524. i8mm_deps="aarch64 neon"
  2525. sve_deps="aarch64 neon"
  2526. sve2_deps="aarch64 neon sve"
  2527. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  2528. altivec_deps="ppc"
  2529. dcbzl_deps="ppc"
  2530. ldbrx_deps="ppc"
  2531. ppc4xx_deps="ppc"
  2532. vec_xl_deps="altivec"
  2533. vsx_deps="altivec"
  2534. power8_deps="vsx"
  2535. rv_deps="riscv"
  2536. rvv_deps="rv"
  2537. rv_zicbop="riscv"
  2538. rv_zvbb_deps="rvv"
  2539. loongson2_deps="mips"
  2540. loongson3_deps="mips"
  2541. mmi_deps_any="loongson2 loongson3"
  2542. lsx_deps="loongarch"
  2543. lasx_deps="lsx"
  2544. mips32r2_deps="mips"
  2545. mips32r5_deps="mips"
  2546. mips32r6_deps="mips"
  2547. mips64r2_deps="mips"
  2548. mips64r6_deps="mips"
  2549. mipsfpu_deps="mips"
  2550. mipsdsp_deps="mips"
  2551. mipsdspr2_deps="mips"
  2552. msa_deps="mipsfpu"
  2553. simd128_deps="wasm"
  2554. x86_64_select="i686"
  2555. x86_64_suggest="fast_cmov"
  2556. amd3dnow_deps="mmx"
  2557. amd3dnowext_deps="amd3dnow"
  2558. i686_deps="x86"
  2559. mmx_deps="x86"
  2560. mmxext_deps="mmx"
  2561. sse_deps="mmxext"
  2562. sse2_deps="sse"
  2563. sse3_deps="sse2"
  2564. ssse3_deps="sse3"
  2565. sse4_deps="ssse3"
  2566. sse42_deps="sse4"
  2567. aesni_deps="sse42"
  2568. avx_deps="sse42"
  2569. xop_deps="avx"
  2570. fma3_deps="avx"
  2571. fma4_deps="avx"
  2572. avx2_deps="avx"
  2573. avx512_deps="avx2"
  2574. avx512icl_deps="avx512"
  2575. mmx_external_deps="x86asm"
  2576. mmx_inline_deps="inline_asm x86"
  2577. mmx_suggest="mmx_external mmx_inline"
  2578. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  2579. eval dep=\$${ext}_deps
  2580. eval ${ext}_external_deps='"${dep}_external"'
  2581. eval ${ext}_inline_deps='"${dep}_inline"'
  2582. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  2583. done
  2584. aligned_stack_if_any="aarch64 ppc x86"
  2585. fast_64bit_if_any="aarch64 ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
  2586. fast_clz_if_any="aarch64 mips ppc x86"
  2587. fast_unaligned_if_any="aarch64 ppc x86"
  2588. simd_align_16_if_any="altivec neon sse"
  2589. simd_align_32_if_any="avx"
  2590. simd_align_64_if_any="avx512"
  2591. # system capabilities
  2592. linux_perf_deps="linux_perf_event_h"
  2593. symver_if_any="symver_asm_label symver_gnu_asm"
  2594. valgrind_backtrace_conflict="optimizations"
  2595. valgrind_backtrace_deps="valgrind_valgrind_h"
  2596. # threading support
  2597. atomics_win32_if="MemoryBarrier"
  2598. atomics_native_if_any="$ATOMICS_LIST"
  2599. w32threads_deps="atomics_native"
  2600. threads_if_any="$THREADS_LIST"
  2601. # subsystems
  2602. cbs_av1_select="cbs"
  2603. cbs_h264_select="cbs"
  2604. cbs_h265_select="cbs"
  2605. cbs_h266_select="cbs"
  2606. cbs_jpeg_select="cbs"
  2607. cbs_mpeg2_select="cbs"
  2608. cbs_vp8_select="cbs"
  2609. cbs_vp9_select="cbs"
  2610. deflate_wrapper_deps="zlib"
  2611. dirac_parse_select="golomb"
  2612. dovi_rpudec_select="golomb"
  2613. dovi_rpuenc_select="golomb"
  2614. dnn_deps="avformat swscale"
  2615. dnn_deps_any="libtensorflow libopenvino libtorch"
  2616. error_resilience_select="me_cmp"
  2617. evcparse_select="golomb"
  2618. faandct_deps="faan"
  2619. faandct_select="fdctdsp"
  2620. faanidct_deps="faan"
  2621. faanidct_select="idctdsp"
  2622. h264dsp_select="startcode"
  2623. h264parse_select="golomb"
  2624. h264_sei_select="atsc_a53 golomb"
  2625. hevcparse_select="golomb"
  2626. hevc_sei_select="atsc_a53 golomb"
  2627. iso_writer_select="golomb"
  2628. frame_thread_encoder_deps="encoders threads"
  2629. iamfdec_deps="iamf"
  2630. iamfdec_select="iso_media mpeg4audio"
  2631. iamfenc_deps="iamf"
  2632. inflate_wrapper_deps="zlib"
  2633. intrax8_select="blockdsp wmv2dsp"
  2634. iso_media_select="mpeg4audio"
  2635. me_cmp_select="idctdsp"
  2636. mpeg_er_select="error_resilience"
  2637. mpegaudio_select="mpegaudiodsp mpegaudioheader"
  2638. mpegvideo_select="blockdsp hpeldsp idctdsp videodsp"
  2639. mpegvideodec_select="h264chroma mpegvideo mpeg_er"
  2640. mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
  2641. msmpeg4dec_select="h263_decoder"
  2642. msmpeg4enc_select="h263_encoder"
  2643. vc1dsp_select="h264chroma qpeldsp startcode"
  2644. wmv2dsp_select="qpeldsp"
  2645. # decoders / encoders
  2646. aac_decoder_select="adts_header mpeg4audio sinewin"
  2647. aac_fixed_decoder_select="adts_header mpeg4audio"
  2648. aac_encoder_select="audio_frame_queue iirfilter lpc sinewin"
  2649. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  2650. ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert"
  2651. ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp"
  2652. ac3_encoder_select="ac3dsp audiodsp me_cmp"
  2653. ac3_fixed_encoder_select="ac3dsp audiodsp me_cmp"
  2654. acelp_kelvin_decoder_select="audiodsp"
  2655. adpcm_g722_decoder_select="g722dsp"
  2656. adpcm_g722_encoder_select="g722dsp"
  2657. agm_decoder_select="idctdsp"
  2658. aic_decoder_select="golomb idctdsp"
  2659. alac_encoder_select="lpc"
  2660. als_decoder_select="bswapdsp mpeg4audio"
  2661. amrnb_decoder_select="lsp"
  2662. amrwb_decoder_select="lsp"
  2663. amv_decoder_select="sp5x_decoder exif"
  2664. amv_encoder_select="jpegtables mpegvideoenc"
  2665. ape_decoder_select="bswapdsp llauddsp"
  2666. apng_decoder_select="inflate_wrapper"
  2667. apng_encoder_select="deflate_wrapper llvidencdsp"
  2668. aptx_encoder_select="audio_frame_queue"
  2669. aptx_hd_encoder_select="audio_frame_queue"
  2670. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  2671. asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
  2672. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  2673. asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
  2674. atrac1_decoder_select="sinewin"
  2675. atrac3p_decoder_select="sinewin"
  2676. atrac3pal_decoder_select="sinewin"
  2677. av1_decoder_select="atsc_a53 cbs_av1 dovi_rpudec"
  2678. bink_decoder_select="blockdsp hpeldsp"
  2679. binkaudio_dct_decoder_select="wma_freqs"
  2680. binkaudio_rdft_decoder_select="wma_freqs"
  2681. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  2682. clearvideo_decoder_select="idctdsp"
  2683. cllc_decoder_select="bswapdsp"
  2684. comfortnoise_encoder_select="lpc"
  2685. cook_decoder_select="audiodsp sinewin"
  2686. cri_decoder_select="mjpeg_decoder"
  2687. cscd_decoder_suggest="zlib"
  2688. dds_decoder_select="texturedsp"
  2689. dirac_decoder_select="dirac_parse dwt golomb mpegvideoenc qpeldsp videodsp"
  2690. dnxhd_decoder_select="blockdsp idctdsp"
  2691. dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp"
  2692. dvvideo_decoder_select="dvprofile idctdsp"
  2693. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  2694. dxa_decoder_deps="zlib"
  2695. dxv_decoder_select="lzf texturedsp"
  2696. dxv_encoder_select="texturedspenc"
  2697. eac3_decoder_select="ac3_decoder"
  2698. eac3_encoder_select="ac3_encoder"
  2699. eamad_decoder_select="aandcttables blockdsp bswapdsp"
  2700. eatgq_decoder_select="aandcttables"
  2701. eatqi_decoder_select="aandcttables blockdsp bswapdsp"
  2702. exr_decoder_deps="zlib"
  2703. exr_encoder_deps="zlib"
  2704. ffv1_decoder_select="rangecoder"
  2705. ffv1_encoder_select="rangecoder"
  2706. ffv1_vulkan_encoder_select="vulkan spirv_compiler"
  2707. ffvhuff_decoder_select="huffyuv_decoder"
  2708. ffvhuff_encoder_select="huffyuv_encoder"
  2709. fic_decoder_select="golomb"
  2710. flac_encoder_select="bswapdsp lpc"
  2711. flashsv2_decoder_select="inflate_wrapper"
  2712. flashsv2_encoder_select="deflate_wrapper"
  2713. flashsv_decoder_select="inflate_wrapper"
  2714. flashsv_encoder_deps="zlib"
  2715. flv_decoder_select="h263_decoder"
  2716. flv_encoder_select="h263_encoder"
  2717. fourxm_decoder_select="blockdsp bswapdsp"
  2718. fraps_decoder_select="bswapdsp huffman"
  2719. ftr_decoder_select="adts_header"
  2720. g2m_decoder_deps="zlib"
  2721. g2m_decoder_select="blockdsp idctdsp jpegtables"
  2722. g729_decoder_select="audiodsp"
  2723. h261_decoder_select="mpegvideodec"
  2724. h261_encoder_select="mpegvideoenc"
  2725. h263_decoder_select="h263_parser h263dsp mpegvideodec qpeldsp"
  2726. h263_encoder_select="h263dsp mpegvideoenc"
  2727. h263i_decoder_select="h263_decoder"
  2728. h263p_decoder_select="h263_decoder"
  2729. h263p_encoder_select="h263_encoder"
  2730. h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel h264_sei videodsp"
  2731. h264_decoder_suggest="error_resilience"
  2732. hap_decoder_select="snappy texturedsp"
  2733. hap_encoder_deps="libsnappy"
  2734. hap_encoder_select="texturedspenc"
  2735. hevc_decoder_select="bswapdsp cabac dovi_rpudec golomb hevcparse hevc_sei videodsp"
  2736. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  2737. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp"
  2738. hymt_decoder_select="huffyuv_decoder"
  2739. iac_decoder_select="imc_decoder"
  2740. imc_decoder_select="bswapdsp sinewin"
  2741. imm4_decoder_select="bswapdsp idctdsp"
  2742. imm5_decoder_select="h264_decoder hevc_decoder"
  2743. indeo3_decoder_select="hpeldsp"
  2744. indeo4_decoder_select="ividsp"
  2745. indeo5_decoder_select="ividsp"
  2746. interplay_video_decoder_select="hpeldsp"
  2747. ipu_decoder_select="mpegvideodec"
  2748. jpegls_decoder_select="mjpeg_decoder"
  2749. jv_decoder_select="blockdsp"
  2750. lagarith_decoder_select="llviddsp"
  2751. lead_decoder_select="blockdsp idctdsp jpegtables"
  2752. ljpeg_encoder_select="jpegtables"
  2753. lscr_decoder_select="inflate_wrapper"
  2754. magicyuv_decoder_select="llviddsp"
  2755. magicyuv_encoder_select="llvidencdsp"
  2756. mdec_decoder_select="blockdsp bswapdsp idctdsp"
  2757. media100_decoder_select="media100_to_mjpegb_bsf mjpegb_decoder"
  2758. metasound_decoder_select="lsp sinewin"
  2759. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  2760. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
  2761. mjpeg_encoder_select="jpegtables mpegvideoenc"
  2762. mjpegb_decoder_select="mjpeg_decoder"
  2763. mlp_decoder_select="mlp_parser"
  2764. mlp_encoder_select="lpc audio_frame_queue"
  2765. mobiclip_decoder_select="bswapdsp golomb"
  2766. motionpixels_decoder_select="bswapdsp"
  2767. mp1_decoder_select="mpegaudio"
  2768. mp1float_decoder_select="mpegaudio"
  2769. mp2_decoder_select="mpegaudio"
  2770. mp2float_decoder_select="mpegaudio"
  2771. mp3_decoder_select="mpegaudio"
  2772. mp3adu_decoder_select="mpegaudio"
  2773. mp3adufloat_decoder_select="mpegaudio"
  2774. mp3float_decoder_select="mpegaudio"
  2775. mp3on4_decoder_select="mpegaudio mpeg4audio"
  2776. mp3on4float_decoder_select="mpegaudio mpeg4audio"
  2777. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  2778. mpc8_decoder_select="mpegaudiodsp"
  2779. mpegvideo_decoder_select="mpegvideodec"
  2780. mpeg1video_decoder_select="mpegvideodec"
  2781. mpeg1video_encoder_select="mpegvideoenc"
  2782. mpeg2video_decoder_select="mpegvideodec"
  2783. mpeg2video_encoder_select="mpegvideoenc"
  2784. mpeg4_decoder_select="h263_decoder"
  2785. mpeg4_encoder_select="h263_encoder qpeldsp"
  2786. msa1_decoder_select="mss34dsp"
  2787. mscc_decoder_select="inflate_wrapper"
  2788. msmpeg4v1_decoder_select="msmpeg4dec"
  2789. msmpeg4v2_decoder_select="msmpeg4dec"
  2790. msmpeg4v2_encoder_select="msmpeg4enc"
  2791. msmpeg4v3_decoder_select="msmpeg4dec"
  2792. msmpeg4v3_encoder_select="msmpeg4enc"
  2793. mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder"
  2794. mts2_decoder_select="jpegtables mss34dsp"
  2795. mv30_decoder_select="aandcttables blockdsp"
  2796. mvha_decoder_select="inflate_wrapper llviddsp"
  2797. mwsc_decoder_select="inflate_wrapper"
  2798. mxpeg_decoder_select="mjpeg_decoder"
  2799. nellymoser_decoder_select="sinewin"
  2800. nellymoser_encoder_select="audio_frame_queue sinewin"
  2801. notchlc_decoder_select="lzf"
  2802. nuv_decoder_select="idctdsp"
  2803. opus_decoder_deps="swresample"
  2804. opus_encoder_select="audio_frame_queue"
  2805. pdv_decoder_select="inflate_wrapper"
  2806. png_decoder_select="inflate_wrapper"
  2807. png_encoder_select="deflate_wrapper llvidencdsp"
  2808. prores_decoder_select="blockdsp idctdsp"
  2809. prores_encoder_select="fdctdsp"
  2810. prores_aw_encoder_select="fdctdsp"
  2811. prores_ks_encoder_select="fdctdsp"
  2812. qcelp_decoder_select="lsp"
  2813. qdm2_decoder_select="mpegaudiodsp"
  2814. ra_144_decoder_select="audiodsp"
  2815. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  2816. ralf_decoder_select="golomb"
  2817. rasc_decoder_select="inflate_wrapper"
  2818. rawvideo_decoder_select="bswapdsp"
  2819. rscc_decoder_deps="zlib"
  2820. rtv1_decoder_select="texturedsp"
  2821. rv10_decoder_select="h263_decoder"
  2822. rv10_encoder_select="h263_encoder"
  2823. rv20_decoder_select="h263_decoder"
  2824. rv20_encoder_select="h263_encoder"
  2825. rv30_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
  2826. rv40_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
  2827. rv60_decoder_select="videodsp golomb"
  2828. screenpresso_decoder_deps="zlib"
  2829. shorten_decoder_select="bswapdsp"
  2830. sipr_decoder_select="lsp"
  2831. smvjpeg_decoder_select="mjpeg_decoder"
  2832. snow_decoder_select="dwt h264qpel rangecoder videodsp"
  2833. snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder videodsp"
  2834. sonic_decoder_select="golomb rangecoder"
  2835. sonic_encoder_select="golomb rangecoder"
  2836. sonic_ls_encoder_select="golomb rangecoder"
  2837. sp5x_decoder_select="mjpeg_decoder"
  2838. speedhq_decoder_select="blockdsp idctdsp"
  2839. speedhq_encoder_select="mpegvideoenc"
  2840. srgc_decoder_select="inflate_wrapper"
  2841. svq1_decoder_select="hpeldsp"
  2842. svq1_encoder_select="hpeldsp me_cmp mpegvideoenc"
  2843. svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
  2844. svq3_decoder_suggest="zlib"
  2845. tak_decoder_select="audiodsp"
  2846. tdsc_decoder_deps="zlib"
  2847. tdsc_decoder_select="mjpeg_decoder"
  2848. theora_decoder_select="vp3_decoder"
  2849. thp_decoder_select="mjpeg_decoder"
  2850. tiff_decoder_select="mjpeg_decoder"
  2851. tiff_decoder_suggest="zlib lzma"
  2852. tiff_encoder_suggest="zlib"
  2853. truehd_decoder_select="mlp_parser"
  2854. truehd_encoder_select="lpc audio_frame_queue"
  2855. truemotion2_decoder_select="bswapdsp"
  2856. truespeech_decoder_select="bswapdsp"
  2857. tscc_decoder_select="inflate_wrapper"
  2858. twinvq_decoder_select="lsp sinewin"
  2859. txd_decoder_select="texturedsp"
  2860. utvideo_decoder_select="bswapdsp llviddsp"
  2861. utvideo_encoder_select="bswapdsp huffman llvidencdsp"
  2862. vble_decoder_select="llviddsp"
  2863. vbn_decoder_select="texturedsp"
  2864. vbn_encoder_select="texturedspenc"
  2865. vmix_decoder_select="idctdsp"
  2866. vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp"
  2867. vc1image_decoder_select="vc1_decoder"
  2868. vorbis_encoder_select="audio_frame_queue"
  2869. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2870. vp4_decoder_select="vp3_decoder"
  2871. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
  2872. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
  2873. vp6a_decoder_select="vp6_decoder"
  2874. vp6f_decoder_select="vp6_decoder"
  2875. vp7_decoder_select="h264pred videodsp vp8dsp"
  2876. vp8_decoder_select="h264pred videodsp vp8dsp"
  2877. vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf"
  2878. vvc_decoder_select="cabac cbs_h266 golomb videodsp"
  2879. wcmv_decoder_select="inflate_wrapper"
  2880. webp_decoder_select="vp8_decoder exif"
  2881. wmalossless_decoder_select="llauddsp"
  2882. wmapro_decoder_select="sinewin wma_freqs"
  2883. wmav1_decoder_select="sinewin wma_freqs"
  2884. wmav1_encoder_select="sinewin wma_freqs"
  2885. wmav2_decoder_select="sinewin wma_freqs"
  2886. wmav2_encoder_select="sinewin wma_freqs"
  2887. wmavoice_decoder_select="lsp sinewin"
  2888. wmv1_decoder_select="msmpeg4dec"
  2889. wmv1_encoder_select="msmpeg4enc"
  2890. wmv2_decoder_select="blockdsp error_resilience idctdsp intrax8 msmpeg4dec videodsp wmv2dsp"
  2891. wmv2_encoder_select="msmpeg4enc wmv2dsp"
  2892. wmv3_decoder_select="vc1_decoder"
  2893. wmv3image_decoder_select="wmv3_decoder"
  2894. xma1_decoder_select="wmapro_decoder"
  2895. xma2_decoder_select="wmapro_decoder"
  2896. ylc_decoder_select="bswapdsp"
  2897. zerocodec_decoder_select="inflate_wrapper"
  2898. zlib_decoder_select="inflate_wrapper"
  2899. zlib_encoder_select="deflate_wrapper"
  2900. zmbv_decoder_select="inflate_wrapper"
  2901. zmbv_encoder_select="deflate_wrapper"
  2902. # hardware accelerators
  2903. cuda_deps="ffnvcodec"
  2904. cuvid_deps="ffnvcodec"
  2905. d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
  2906. d3d12va_deps="dxva_h ID3D12Device ID3D12VideoDecoder"
  2907. dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
  2908. ffnvcodec_deps_any="libdl LoadLibrary"
  2909. mediacodec_deps="android mediandk pthreads"
  2910. nvdec_deps="ffnvcodec"
  2911. vaapi_x11_deps="xlib_x11"
  2912. videotoolbox_hwaccel_deps="videotoolbox pthreads"
  2913. videotoolbox_hwaccel_extralibs="-framework QuartzCore"
  2914. vulkan_deps="threads"
  2915. vulkan_deps_any="libdl LoadLibrary"
  2916. av1_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
  2917. av1_d3d11va_hwaccel_select="av1_decoder"
  2918. av1_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
  2919. av1_d3d11va2_hwaccel_select="av1_decoder"
  2920. av1_d3d12va_hwaccel_deps="d3d12va DXVA_PicParams_AV1"
  2921. av1_d3d12va_hwaccel_select="av1_decoder"
  2922. av1_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_AV1"
  2923. av1_dxva2_hwaccel_select="av1_decoder"
  2924. av1_nvdec_hwaccel_deps="nvdec CUVIDAV1PICPARAMS"
  2925. av1_nvdec_hwaccel_select="av1_decoder"
  2926. av1_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferAV1_bit_depth_idx"
  2927. av1_vaapi_hwaccel_select="av1_decoder"
  2928. av1_vdpau_hwaccel_deps="vdpau VdpPictureInfoAV1"
  2929. av1_vdpau_hwaccel_select="av1_decoder"
  2930. av1_videotoolbox_hwaccel_deps="videotoolbox"
  2931. av1_videotoolbox_hwaccel_select="av1_decoder"
  2932. av1_vulkan_hwaccel_deps="vulkan"
  2933. av1_vulkan_hwaccel_select="av1_decoder"
  2934. h263_vaapi_hwaccel_deps="vaapi"
  2935. h263_vaapi_hwaccel_select="h263_decoder"
  2936. h263_videotoolbox_hwaccel_deps="videotoolbox"
  2937. h263_videotoolbox_hwaccel_select="h263_decoder"
  2938. h264_d3d11va_hwaccel_deps="d3d11va"
  2939. h264_d3d11va_hwaccel_select="h264_decoder"
  2940. h264_d3d11va2_hwaccel_deps="d3d11va"
  2941. h264_d3d11va2_hwaccel_select="h264_decoder"
  2942. h264_d3d12va_hwaccel_deps="d3d12va"
  2943. h264_d3d12va_hwaccel_select="h264_decoder"
  2944. h264_dxva2_hwaccel_deps="dxva2"
  2945. h264_dxva2_hwaccel_select="h264_decoder"
  2946. h264_nvdec_hwaccel_deps="nvdec"
  2947. h264_nvdec_hwaccel_select="h264_decoder"
  2948. h264_vaapi_hwaccel_deps="vaapi"
  2949. h264_vaapi_hwaccel_select="h264_decoder"
  2950. h264_vdpau_hwaccel_deps="vdpau"
  2951. h264_vdpau_hwaccel_select="h264_decoder"
  2952. h264_videotoolbox_hwaccel_deps="videotoolbox"
  2953. h264_videotoolbox_hwaccel_select="h264_decoder"
  2954. h264_vulkan_hwaccel_deps="vulkan"
  2955. h264_vulkan_hwaccel_select="h264_decoder"
  2956. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2957. hevc_d3d11va_hwaccel_select="hevc_decoder"
  2958. hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2959. hevc_d3d11va2_hwaccel_select="hevc_decoder"
  2960. hevc_d3d12va_hwaccel_deps="d3d12va DXVA_PicParams_HEVC"
  2961. hevc_d3d12va_hwaccel_select="hevc_decoder"
  2962. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2963. hevc_dxva2_hwaccel_select="hevc_decoder"
  2964. hevc_nvdec_hwaccel_deps="nvdec"
  2965. hevc_nvdec_hwaccel_select="hevc_decoder"
  2966. hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
  2967. hevc_vaapi_hwaccel_select="hevc_decoder"
  2968. hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
  2969. hevc_vdpau_hwaccel_select="hevc_decoder"
  2970. hevc_videotoolbox_hwaccel_deps="videotoolbox"
  2971. hevc_videotoolbox_hwaccel_select="hevc_decoder"
  2972. hevc_vulkan_hwaccel_deps="vulkan"
  2973. hevc_vulkan_hwaccel_select="hevc_decoder"
  2974. mjpeg_nvdec_hwaccel_deps="nvdec"
  2975. mjpeg_nvdec_hwaccel_select="mjpeg_decoder"
  2976. mjpeg_vaapi_hwaccel_deps="vaapi"
  2977. mjpeg_vaapi_hwaccel_select="mjpeg_decoder"
  2978. mpeg1_nvdec_hwaccel_deps="nvdec"
  2979. mpeg1_nvdec_hwaccel_select="mpeg1video_decoder"
  2980. mpeg1_vdpau_hwaccel_deps="vdpau"
  2981. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2982. mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
  2983. mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
  2984. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  2985. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  2986. mpeg2_d3d11va2_hwaccel_deps="d3d11va"
  2987. mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
  2988. mpeg2_d3d12va_hwaccel_deps="d3d12va"
  2989. mpeg2_d3d12va_hwaccel_select="mpeg2video_decoder"
  2990. mpeg2_dxva2_hwaccel_deps="dxva2"
  2991. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2992. mpeg2_nvdec_hwaccel_deps="nvdec"
  2993. mpeg2_nvdec_hwaccel_select="mpeg2video_decoder"
  2994. mpeg2_vaapi_hwaccel_deps="vaapi"
  2995. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2996. mpeg2_vdpau_hwaccel_deps="vdpau"
  2997. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2998. mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
  2999. mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
  3000. mpeg4_nvdec_hwaccel_deps="nvdec"
  3001. mpeg4_nvdec_hwaccel_select="mpeg4_decoder"
  3002. mpeg4_vaapi_hwaccel_deps="vaapi"
  3003. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  3004. mpeg4_vdpau_hwaccel_deps="vdpau"
  3005. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  3006. mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
  3007. mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
  3008. prores_videotoolbox_hwaccel_deps="videotoolbox"
  3009. prores_videotoolbox_hwaccel_select="prores_decoder"
  3010. vc1_d3d11va_hwaccel_deps="d3d11va"
  3011. vc1_d3d11va_hwaccel_select="vc1_decoder"
  3012. vc1_d3d11va2_hwaccel_deps="d3d11va"
  3013. vc1_d3d11va2_hwaccel_select="vc1_decoder"
  3014. vc1_d3d12va_hwaccel_deps="d3d12va"
  3015. vc1_d3d12va_hwaccel_select="vc1_decoder"
  3016. vc1_dxva2_hwaccel_deps="dxva2"
  3017. vc1_dxva2_hwaccel_select="vc1_decoder"
  3018. vc1_nvdec_hwaccel_deps="nvdec"
  3019. vc1_nvdec_hwaccel_select="vc1_decoder"
  3020. vc1_vaapi_hwaccel_deps="vaapi"
  3021. vc1_vaapi_hwaccel_select="vc1_decoder"
  3022. vc1_vdpau_hwaccel_deps="vdpau"
  3023. vc1_vdpau_hwaccel_select="vc1_decoder"
  3024. vp8_nvdec_hwaccel_deps="nvdec"
  3025. vp8_nvdec_hwaccel_select="vp8_decoder"
  3026. vp8_vaapi_hwaccel_deps="vaapi"
  3027. vp8_vaapi_hwaccel_select="vp8_decoder"
  3028. vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  3029. vp9_d3d11va_hwaccel_select="vp9_decoder"
  3030. vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  3031. vp9_d3d11va2_hwaccel_select="vp9_decoder"
  3032. vp9_d3d12va_hwaccel_deps="d3d12va DXVA_PicParams_VP9"
  3033. vp9_d3d12va_hwaccel_select="vp9_decoder"
  3034. vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
  3035. vp9_dxva2_hwaccel_select="vp9_decoder"
  3036. vp9_nvdec_hwaccel_deps="nvdec"
  3037. vp9_nvdec_hwaccel_select="vp9_decoder"
  3038. vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
  3039. vp9_vaapi_hwaccel_select="vp9_decoder"
  3040. vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9"
  3041. vp9_vdpau_hwaccel_select="vp9_decoder"
  3042. vp9_videotoolbox_hwaccel_deps="videotoolbox"
  3043. vp9_videotoolbox_hwaccel_select="vp9_decoder"
  3044. vvc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferVVC"
  3045. vvc_vaapi_hwaccel_select="vvc_decoder"
  3046. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  3047. wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
  3048. wmv3_d3d12va_hwaccel_select="vc1_d3d12va_hwaccel"
  3049. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  3050. wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel"
  3051. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  3052. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  3053. # hardware-accelerated codecs
  3054. d3d12va_encode_deps="d3d12va ID3D12VideoEncoder d3d12_encoder_feature"
  3055. mediafoundation_deps="mftransform_h MFCreateAlignedMemoryBuffer"
  3056. omx_deps="libdl pthreads"
  3057. omx_rpi_select="omx"
  3058. qsv_deps="libmfx"
  3059. qsvdec_select="qsv"
  3060. qsvenc_select="qsv"
  3061. qsvvpp_select="qsv"
  3062. vaapi_encode_deps="vaapi"
  3063. vulkan_encode_deps="vulkan"
  3064. v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
  3065. bilateral_cuda_filter_deps="ffnvcodec"
  3066. bilateral_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3067. chromakey_cuda_filter_deps="ffnvcodec"
  3068. chromakey_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3069. colorspace_cuda_filter_deps="ffnvcodec"
  3070. colorspace_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3071. hwupload_cuda_filter_deps="ffnvcodec"
  3072. scale_npp_filter_deps="ffnvcodec libnpp"
  3073. scale2ref_npp_filter_deps="ffnvcodec libnpp"
  3074. scale_cuda_filter_deps="ffnvcodec"
  3075. scale_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3076. thumbnail_cuda_filter_deps="ffnvcodec"
  3077. thumbnail_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3078. transpose_npp_filter_deps="ffnvcodec libnpp"
  3079. overlay_cuda_filter_deps="ffnvcodec"
  3080. overlay_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3081. sharpen_npp_filter_deps="ffnvcodec libnpp"
  3082. ddagrab_filter_deps="d3d11va IDXGIOutput1 DXGI_OUTDUPL_FRAME_INFO"
  3083. amf_deps_any="libdl LoadLibrary"
  3084. nvenc_deps="ffnvcodec"
  3085. nvenc_deps_any="libdl LoadLibrary"
  3086. aac_mediacodec_decoder_deps="mediacodec"
  3087. aac_mediacodec_decoder_select="aac_adtstoasc_bsf aac_parser"
  3088. aac_mf_encoder_deps="mediafoundation"
  3089. ac3_mf_encoder_deps="mediafoundation"
  3090. amrnb_mediacodec_decoder_deps="mediacodec"
  3091. amrnb_mediacodec_decoder_select="amr_parser"
  3092. amrwb_mediacodec_decoder_deps="mediacodec"
  3093. amrwb_mediacodec_decoder_select="amr_parser"
  3094. av1_amf_encoder_deps="amf"
  3095. av1_amf_decoder_deps="amf"
  3096. av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
  3097. av1_mediacodec_decoder_deps="mediacodec"
  3098. av1_mediacodec_encoder_deps="mediacodec"
  3099. av1_mediacodec_encoder_select="extract_extradata_bsf"
  3100. av1_mf_encoder_deps="mediafoundation"
  3101. av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1"
  3102. av1_nvenc_encoder_select="atsc_a53"
  3103. av1_qsv_decoder_select="qsvdec"
  3104. av1_qsv_encoder_deps="libvpl"
  3105. av1_qsv_encoder_select="qsvenc"
  3106. av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
  3107. av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
  3108. h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
  3109. h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
  3110. h264_amf_encoder_deps="amf"
  3111. h264_amf_decoder_deps="amf"
  3112. h264_cuvid_decoder_deps="cuvid"
  3113. h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
  3114. h264_mediacodec_decoder_deps="mediacodec"
  3115. h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
  3116. h264_mediacodec_encoder_deps="mediacodec"
  3117. h264_mediacodec_encoder_select="extract_extradata_bsf h264_metadata"
  3118. h264_mf_encoder_deps="mediafoundation"
  3119. h264_mmal_decoder_deps="mmal"
  3120. h264_nvenc_encoder_deps="nvenc"
  3121. h264_nvenc_encoder_select="atsc_a53"
  3122. h264_omx_encoder_deps="omx"
  3123. h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec"
  3124. h264_qsv_encoder_select="atsc_a53 qsvenc"
  3125. h264_rkmpp_decoder_deps="rkmpp"
  3126. h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
  3127. h264_vaapi_encoder_select="atsc_a53 cbs_h264 vaapi_encode"
  3128. h264_vulkan_encoder_select="cbs_h264 vulkan_encode"
  3129. h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
  3130. h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
  3131. h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
  3132. hevc_amf_encoder_deps="amf"
  3133. hevc_amf_decoder_deps="amf"
  3134. hevc_cuvid_decoder_deps="cuvid"
  3135. hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
  3136. hevc_d3d12va_encoder_select="cbs_h265 d3d12va_encode"
  3137. hevc_mediacodec_decoder_deps="mediacodec"
  3138. hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
  3139. hevc_mediacodec_encoder_deps="mediacodec"
  3140. hevc_mediacodec_encoder_select="extract_extradata_bsf hevc_metadata"
  3141. hevc_mf_encoder_deps="mediafoundation"
  3142. hevc_nvenc_encoder_deps="nvenc"
  3143. hevc_nvenc_encoder_select="atsc_a53"
  3144. hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec"
  3145. hevc_qsv_encoder_select="hevcparse qsvenc"
  3146. hevc_rkmpp_decoder_deps="rkmpp"
  3147. hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
  3148. hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
  3149. hevc_vaapi_encoder_select="atsc_a53 cbs_h265 vaapi_encode"
  3150. hevc_vulkan_encoder_select="atsc_a53 cbs_h265 vulkan_encode"
  3151. hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
  3152. hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
  3153. hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
  3154. mjpeg_cuvid_decoder_deps="cuvid"
  3155. mjpeg_qsv_decoder_select="qsvdec"
  3156. mjpeg_qsv_encoder_deps="libmfx"
  3157. mjpeg_qsv_encoder_select="qsvenc"
  3158. mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
  3159. mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
  3160. mp3_mf_encoder_deps="mediafoundation"
  3161. mp3_mediacodec_decoder_deps="mediacodec"
  3162. mp3_mediacodec_decoder_select="mpegaudioheader"
  3163. mpeg1_cuvid_decoder_deps="cuvid"
  3164. mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
  3165. mpeg2_cuvid_decoder_deps="cuvid"
  3166. mpeg2_mmal_decoder_deps="mmal"
  3167. mpeg2_mediacodec_decoder_deps="mediacodec"
  3168. mpeg2_qsv_decoder_select="qsvdec"
  3169. mpeg2_qsv_encoder_select="qsvenc"
  3170. mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
  3171. mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
  3172. mpeg4_cuvid_decoder_deps="cuvid"
  3173. mpeg4_mediacodec_decoder_deps="mediacodec"
  3174. mpeg4_mediacodec_encoder_deps="mediacodec"
  3175. mpeg4_mediacodec_encoder_select="extract_extradata_bsf"
  3176. mpeg4_mmal_decoder_deps="mmal"
  3177. mpeg4_omx_encoder_deps="omx"
  3178. mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  3179. mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  3180. vc1_cuvid_decoder_deps="cuvid"
  3181. vc1_mmal_decoder_deps="mmal"
  3182. vc1_qsv_decoder_select="qsvdec"
  3183. vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
  3184. vp8_cuvid_decoder_deps="cuvid"
  3185. vp8_mediacodec_decoder_deps="mediacodec"
  3186. vp8_mediacodec_encoder_deps="mediacodec"
  3187. vp8_qsv_decoder_select="qsvdec"
  3188. vp8_rkmpp_decoder_deps="rkmpp"
  3189. vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
  3190. vp8_vaapi_encoder_select="vaapi_encode"
  3191. vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
  3192. vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
  3193. vp9_cuvid_decoder_deps="cuvid"
  3194. vp9_mediacodec_decoder_deps="mediacodec"
  3195. vp9_mediacodec_encoder_deps="mediacodec"
  3196. vp9_qsv_decoder_select="qsvdec"
  3197. vp9_rkmpp_decoder_deps="rkmpp"
  3198. vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
  3199. vp9_vaapi_encoder_select="vaapi_encode"
  3200. vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9"
  3201. vp9_qsv_encoder_select="qsvenc"
  3202. vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
  3203. vvc_qsv_decoder_select="vvc_mp4toannexb_bsf qsvdec"
  3204. # parsers
  3205. aac_parser_select="adts_header mpeg4audio"
  3206. av1_parser_select="cbs_av1"
  3207. evc_parser_select="evcparse"
  3208. ffv1_parser_select="rangecoder"
  3209. ftr_parser_select="adts_header mpeg4audio"
  3210. h264_parser_select="golomb h264dsp h264parse h264_sei"
  3211. hevc_parser_select="hevcparse hevc_sei"
  3212. mpegaudio_parser_select="mpegaudioheader"
  3213. mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp"
  3214. vc1_parser_select="vc1dsp"
  3215. vvc_parser_select="cbs_h266"
  3216. # bitstream_filters
  3217. aac_adtstoasc_bsf_select="adts_header mpeg4audio"
  3218. av1_frame_merge_bsf_select="cbs_av1"
  3219. av1_frame_split_bsf_select="cbs_av1"
  3220. av1_metadata_bsf_select="cbs_av1"
  3221. dovi_rpu_bsf_select="cbs_h265 cbs_av1 dovi_rpudec dovi_rpuenc"
  3222. dts2pts_bsf_select="cbs_h264 h264parse"
  3223. eac3_core_bsf_select="ac3_parser"
  3224. evc_frame_merge_bsf_select="evcparse"
  3225. filter_units_bsf_select="cbs"
  3226. h264_metadata_bsf_deps="const_nan"
  3227. h264_metadata_bsf_select="cbs_h264"
  3228. h264_redundant_pps_bsf_select="cbs_h264"
  3229. hevc_metadata_bsf_select="cbs_h265"
  3230. mjpeg2jpeg_bsf_select="jpegtables"
  3231. mpeg2_metadata_bsf_select="cbs_mpeg2"
  3232. trace_headers_bsf_select="cbs cbs_vp8"
  3233. vp9_metadata_bsf_select="cbs_vp9"
  3234. vvc_metadata_bsf_select="cbs_h266"
  3235. # external libraries
  3236. aac_at_decoder_deps="audiotoolbox"
  3237. aac_at_decoder_select="aac_adtstoasc_bsf"
  3238. ac3_at_decoder_deps="audiotoolbox"
  3239. ac3_at_decoder_select="ac3_parser"
  3240. adpcm_ima_qt_at_decoder_deps="audiotoolbox"
  3241. alac_at_decoder_deps="audiotoolbox"
  3242. amr_nb_at_decoder_deps="audiotoolbox"
  3243. avisynth_deps_any="libdl LoadLibrary"
  3244. avisynth_demuxer_deps="avisynth"
  3245. avisynth_demuxer_select="riffdec"
  3246. eac3_at_decoder_deps="audiotoolbox"
  3247. eac3_at_decoder_select="ac3_parser"
  3248. gsm_ms_at_decoder_deps="audiotoolbox"
  3249. ilbc_at_decoder_deps="audiotoolbox"
  3250. mp1_at_decoder_deps="audiotoolbox"
  3251. mp2_at_decoder_deps="audiotoolbox"
  3252. mp3_at_decoder_deps="audiotoolbox"
  3253. mp1_at_decoder_select="mpegaudioheader"
  3254. mp2_at_decoder_select="mpegaudioheader"
  3255. mp3_at_decoder_select="mpegaudioheader"
  3256. pcm_alaw_at_decoder_deps="audiotoolbox"
  3257. pcm_mulaw_at_decoder_deps="audiotoolbox"
  3258. qdmc_at_decoder_deps="audiotoolbox"
  3259. qdm2_at_decoder_deps="audiotoolbox"
  3260. aac_at_encoder_deps="audiotoolbox"
  3261. aac_at_encoder_select="audio_frame_queue"
  3262. alac_at_encoder_deps="audiotoolbox"
  3263. alac_at_encoder_select="audio_frame_queue"
  3264. ilbc_at_encoder_deps="audiotoolbox"
  3265. ilbc_at_encoder_select="audio_frame_queue"
  3266. pcm_alaw_at_encoder_deps="audiotoolbox"
  3267. pcm_alaw_at_encoder_select="audio_frame_queue"
  3268. pcm_mulaw_at_encoder_deps="audiotoolbox"
  3269. pcm_mulaw_at_encoder_select="audio_frame_queue"
  3270. chromaprint_muxer_deps="chromaprint"
  3271. h264_videotoolbox_encoder_deps="pthreads"
  3272. h264_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
  3273. hevc_videotoolbox_encoder_deps="pthreads"
  3274. hevc_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
  3275. prores_videotoolbox_encoder_deps="pthreads"
  3276. prores_videotoolbox_encoder_select="videotoolbox_encoder"
  3277. libaom_av1_decoder_deps="libaom"
  3278. libaom_av1_encoder_deps="libaom"
  3279. libaom_av1_encoder_select="extract_extradata_bsf dovi_rpuenc"
  3280. libaribb24_decoder_deps="libaribb24"
  3281. libaribcaption_decoder_deps="libaribcaption"
  3282. libcelt_decoder_deps="libcelt"
  3283. libcodec2_decoder_deps="libcodec2"
  3284. libcodec2_encoder_deps="libcodec2"
  3285. libdav1d_decoder_deps="libdav1d"
  3286. libdav1d_decoder_select="atsc_a53 dovi_rpudec"
  3287. libdavs2_decoder_deps="libdavs2"
  3288. libdavs2_decoder_select="avs2_parser"
  3289. libfdk_aac_decoder_deps="libfdk_aac"
  3290. libfdk_aac_encoder_deps="libfdk_aac"
  3291. libfdk_aac_encoder_select="audio_frame_queue"
  3292. libgme_demuxer_deps="libgme"
  3293. libgsm_decoder_deps="libgsm"
  3294. libgsm_encoder_deps="libgsm"
  3295. libgsm_ms_decoder_deps="libgsm"
  3296. libgsm_ms_encoder_deps="libgsm"
  3297. libilbc_decoder_deps="libilbc"
  3298. libilbc_encoder_deps="libilbc"
  3299. libjxl_anim_decoder_deps="libjxl libjxl_threads"
  3300. libjxl_anim_encoder_deps="libjxl libjxl_threads"
  3301. libjxl_decoder_deps="libjxl libjxl_threads"
  3302. libjxl_encoder_deps="libjxl libjxl_threads"
  3303. libkvazaar_encoder_deps="libkvazaar"
  3304. liblc3_decoder_deps="liblc3"
  3305. liblc3_encoder_deps="liblc3"
  3306. liblc3_encoder_select="audio_frame_queue"
  3307. libmodplug_demuxer_deps="libmodplug"
  3308. libmp3lame_encoder_deps="libmp3lame"
  3309. libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
  3310. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  3311. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  3312. libopencore_amrnb_encoder_select="audio_frame_queue"
  3313. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  3314. libopenh264_decoder_deps="libopenh264"
  3315. libopenh264_decoder_select="h264_mp4toannexb_bsf"
  3316. libopenh264_encoder_deps="libopenh264"
  3317. libopenjpeg_encoder_deps="libopenjpeg"
  3318. libopenmpt_demuxer_deps="libopenmpt"
  3319. libopus_decoder_deps="libopus"
  3320. libopus_encoder_deps="libopus"
  3321. libopus_encoder_select="audio_frame_queue"
  3322. librav1e_encoder_deps="librav1e"
  3323. librsvg_decoder_deps="librsvg"
  3324. libshine_encoder_deps="libshine"
  3325. libshine_encoder_select="audio_frame_queue mpegaudioheader"
  3326. libspeex_decoder_deps="libspeex"
  3327. libspeex_encoder_deps="libspeex"
  3328. libspeex_encoder_select="audio_frame_queue"
  3329. libsvtav1_encoder_deps="libsvtav1"
  3330. libsvtav1_encoder_select="dovi_rpuenc"
  3331. libtheora_encoder_deps="libtheora"
  3332. libtwolame_encoder_deps="libtwolame"
  3333. libuavs3d_decoder_deps="libuavs3d"
  3334. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  3335. libvorbis_decoder_deps="libvorbis"
  3336. libvorbis_encoder_deps="libvorbis libvorbisenc"
  3337. libvorbis_encoder_select="audio_frame_queue"
  3338. libvpx_vp8_decoder_deps="libvpx"
  3339. libvpx_vp8_encoder_deps="libvpx"
  3340. libvpx_vp9_decoder_deps="libvpx"
  3341. libvpx_vp9_encoder_deps="libvpx"
  3342. libvvenc_encoder_deps="libvvenc"
  3343. libwebp_encoder_deps="libwebp"
  3344. libwebp_anim_encoder_deps="libwebp"
  3345. libx262_encoder_deps="libx262"
  3346. libx264_encoder_deps="libx264"
  3347. libx264_encoder_select="atsc_a53 golomb"
  3348. libx264rgb_encoder_deps="libx264"
  3349. libx264rgb_encoder_select="libx264_encoder"
  3350. libx265_encoder_deps="libx265"
  3351. libx265_encoder_select="atsc_a53 dovi_rpuenc"
  3352. libxavs_encoder_deps="libxavs"
  3353. libxavs2_encoder_deps="libxavs2"
  3354. libxevd_decoder_deps="libxevd"
  3355. libxeve_encoder_deps="libxeve"
  3356. libxvid_encoder_deps="libxvid"
  3357. libzvbi_teletext_decoder_deps="libzvbi"
  3358. vapoursynth_demuxer_deps="vapoursynth"
  3359. videotoolbox_suggest="coreservices"
  3360. videotoolbox_deps="corefoundation coremedia corevideo"
  3361. videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
  3362. # demuxers / muxers
  3363. ac3_demuxer_select="ac3_parser"
  3364. act_demuxer_select="riffdec"
  3365. adts_muxer_select="mpeg4audio"
  3366. aiff_muxer_select="iso_media"
  3367. amv_muxer_select="riffenc"
  3368. asf_demuxer_select="riffdec"
  3369. asf_o_demuxer_select="riffdec"
  3370. asf_muxer_select="riffenc"
  3371. asf_stream_muxer_select="asf_muxer"
  3372. av1_demuxer_select="av1_frame_merge_bsf av1_parser"
  3373. avi_demuxer_select="riffdec exif"
  3374. avi_muxer_select="riffenc"
  3375. avif_muxer_select="mov_muxer"
  3376. caf_demuxer_select="iso_media"
  3377. caf_muxer_select="iso_media"
  3378. dash_muxer_select="mp4_muxer"
  3379. dash_demuxer_deps="libxml2"
  3380. daud_muxer_select="pcm_rechunk_bsf"
  3381. dirac_demuxer_select="dirac_parser"
  3382. dts_demuxer_select="dca_parser"
  3383. dtshd_demuxer_select="dca_parser"
  3384. dv_demuxer_select="dvprofile"
  3385. dv_muxer_select="dvprofile"
  3386. dvdvideo_demuxer_select="mpegps_demuxer"
  3387. dvdvideo_demuxer_deps="libdvdnav libdvdread"
  3388. dxa_demuxer_select="riffdec"
  3389. eac3_demuxer_select="ac3_parser"
  3390. evc_demuxer_select="evc_frame_merge_bsf evc_parser"
  3391. f4v_muxer_select="mov_muxer"
  3392. fifo_muxer_deps="threads"
  3393. flac_demuxer_select="flac_parser"
  3394. flv_muxer_select="aac_adtstoasc_bsf iso_writer"
  3395. gxf_muxer_select="pcm_rechunk_bsf"
  3396. hds_muxer_select="flv_muxer"
  3397. hls_demuxer_select="aac_demuxer ac3_demuxer adts_header ac3_parser eac3_demuxer mov_demuxer mpegts_demuxer"
  3398. hls_muxer_select="mov_muxer mpegts_muxer"
  3399. iamf_demuxer_select="iamfdec"
  3400. iamf_muxer_select="iamfenc"
  3401. image2_alias_pix_demuxer_select="image2_demuxer"
  3402. image2_brender_pix_demuxer_select="image2_demuxer"
  3403. imf_demuxer_deps="libxml2"
  3404. imf_demuxer_select="mxf_demuxer"
  3405. ipod_muxer_select="mov_muxer"
  3406. ismv_muxer_select="mov_muxer"
  3407. ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
  3408. latm_muxer_select="aac_adtstoasc_bsf mpeg4audio"
  3409. matroska_audio_muxer_select="matroska_muxer"
  3410. matroska_demuxer_select="riffdec"
  3411. matroska_demuxer_suggest="bzlib zlib"
  3412. matroska_muxer_select="iso_writer mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf"
  3413. mlp_demuxer_select="mlp_parser"
  3414. mmf_muxer_select="riffenc"
  3415. mov_demuxer_select="iso_media riffdec"
  3416. mov_demuxer_suggest="iamfdec zlib"
  3417. mov_muxer_select="iso_media iso_writer riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser"
  3418. mov_muxer_suggest="iamfenc"
  3419. mp3_demuxer_select="mpegaudio_parser"
  3420. mp3_muxer_select="mpegaudioheader"
  3421. mp4_muxer_select="mov_muxer"
  3422. mpegts_demuxer_select="iso_media"
  3423. mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf vvc_mp4toannexb_bsf"
  3424. mpegtsraw_demuxer_select="mpegts_demuxer"
  3425. mxf_muxer_select="iso_writer pcm_rechunk_bsf rangecoder"
  3426. mxf_d10_muxer_select="mxf_muxer"
  3427. mxf_opatom_muxer_select="mxf_muxer"
  3428. nut_muxer_select="riffenc"
  3429. nuv_demuxer_select="riffdec"
  3430. obu_demuxer_select="av1_frame_merge_bsf av1_parser"
  3431. obu_muxer_select="av1_metadata_bsf"
  3432. oga_muxer_select="ogg_muxer"
  3433. ogg_demuxer_select="dirac_parse"
  3434. ogv_muxer_select="ogg_muxer"
  3435. opus_muxer_select="ogg_muxer"
  3436. psp_muxer_select="mov_muxer"
  3437. rtp_demuxer_select="sdp_demuxer"
  3438. rtp_muxer_select="iso_writer"
  3439. rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer"
  3440. rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
  3441. rtsp_demuxer_select="http_protocol rtpdec"
  3442. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  3443. sap_demuxer_select="sdp_demuxer"
  3444. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  3445. sdp_demuxer_select="rtpdec"
  3446. smoothstreaming_muxer_select="ismv_muxer"
  3447. spdif_demuxer_select="adts_header"
  3448. spdif_muxer_select="adts_header"
  3449. spx_muxer_select="ogg_muxer"
  3450. swf_demuxer_suggest="zlib"
  3451. tak_demuxer_select="tak_parser"
  3452. truehd_demuxer_select="mlp_parser"
  3453. tg2_muxer_select="mov_muxer"
  3454. tgp_muxer_select="mov_muxer"
  3455. vobsub_demuxer_select="mpegps_demuxer"
  3456. w64_demuxer_select="wav_demuxer"
  3457. w64_muxer_select="wav_muxer"
  3458. wav_demuxer_select="riffdec"
  3459. wav_muxer_select="riffenc"
  3460. webm_chunk_muxer_select="webm_muxer"
  3461. webm_dash_manifest_demuxer_select="matroska_demuxer"
  3462. wtv_demuxer_select="mpegts_demuxer riffdec"
  3463. wtv_muxer_select="mpegts_muxer riffenc"
  3464. xmv_demuxer_select="riffdec"
  3465. xwma_demuxer_select="riffdec"
  3466. # indevs / outdevs
  3467. android_camera_indev_deps="android camera2ndk mediandk pthreads"
  3468. alsa_indev_deps="alsa"
  3469. alsa_outdev_deps="alsa"
  3470. avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
  3471. avfoundation_indev_suggest="coregraphics applicationservices"
  3472. avfoundation_indev_extralibs="-framework Foundation"
  3473. audiotoolbox_outdev_deps="audiotoolbox pthreads"
  3474. audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework CoreAudio"
  3475. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  3476. caca_outdev_deps="libcaca"
  3477. decklink_deps_any="libdl LoadLibrary"
  3478. decklink_indev_deps="decklink threads"
  3479. decklink_indev_extralibs="-lstdc++"
  3480. decklink_indev_suggest="libzvbi"
  3481. decklink_outdev_deps="decklink threads"
  3482. decklink_outdev_suggest="libklvanc"
  3483. decklink_outdev_extralibs="-lstdc++"
  3484. dshow_indev_deps="IBaseFilter"
  3485. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  3486. fbdev_indev_deps="linux_fb_h"
  3487. fbdev_outdev_deps="linux_fb_h"
  3488. gdigrab_indev_deps="CreateDIBSection"
  3489. gdigrab_indev_extralibs="-lgdi32"
  3490. gdigrab_indev_select="bmp_decoder"
  3491. iec61883_indev_deps="libiec61883"
  3492. iec61883_indev_select="dv_demuxer"
  3493. jack_indev_deps="libjack"
  3494. jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
  3495. kmsgrab_indev_deps="libdrm"
  3496. lavfi_indev_deps="avfilter"
  3497. libcdio_indev_deps="libcdio"
  3498. libdc1394_indev_deps="libdc1394"
  3499. openal_indev_deps="openal"
  3500. opengl_outdev_deps="opengl"
  3501. opengl_outdev_suggest="sdl2"
  3502. oss_indev_deps_any="sys_soundcard_h"
  3503. oss_outdev_deps_any="sys_soundcard_h"
  3504. pulse_indev_deps="libpulse"
  3505. pulse_outdev_deps="libpulse"
  3506. sdl2_outdev_deps="sdl2"
  3507. sndio_indev_deps="sndio"
  3508. sndio_outdev_deps="sndio"
  3509. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  3510. v4l2_indev_suggest="libv4l2"
  3511. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  3512. v4l2_outdev_suggest="libv4l2"
  3513. vfwcap_indev_deps="vfw32 vfwcap_defines"
  3514. xcbgrab_indev_deps="libxcb"
  3515. xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
  3516. xv_outdev_deps="xlib_xv xlib_x11 xlib_xext"
  3517. # protocols
  3518. android_content_protocol_deps="jni"
  3519. android_content_protocol_select="file_protocol"
  3520. async_protocol_deps="threads"
  3521. bluray_protocol_deps="libbluray"
  3522. ffrtmpcrypt_protocol_conflict="librtmp_protocol"
  3523. ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
  3524. ffrtmpcrypt_protocol_select="tcp_protocol"
  3525. ffrtmphttp_protocol_conflict="librtmp_protocol"
  3526. ffrtmphttp_protocol_select="http_protocol"
  3527. ftp_protocol_select="tcp_protocol"
  3528. gopher_protocol_select="tcp_protocol"
  3529. gophers_protocol_select="tls_protocol"
  3530. http_protocol_select="tcp_protocol"
  3531. http_protocol_suggest="zlib"
  3532. httpproxy_protocol_select="tcp_protocol"
  3533. httpproxy_protocol_suggest="zlib"
  3534. https_protocol_select="tls_protocol"
  3535. https_protocol_suggest="zlib"
  3536. icecast_protocol_select="http_protocol"
  3537. mmsh_protocol_select="http_protocol"
  3538. mmst_protocol_select="network"
  3539. rtmp_protocol_conflict="librtmp_protocol"
  3540. rtmp_protocol_select="tcp_protocol"
  3541. rtmp_protocol_suggest="zlib"
  3542. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  3543. rtmpe_protocol_suggest="zlib"
  3544. rtmps_protocol_conflict="librtmp_protocol"
  3545. rtmps_protocol_select="tls_protocol"
  3546. rtmps_protocol_suggest="zlib"
  3547. rtmpt_protocol_select="ffrtmphttp_protocol"
  3548. rtmpt_protocol_suggest="zlib"
  3549. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  3550. rtmpte_protocol_suggest="zlib"
  3551. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  3552. rtmpts_protocol_suggest="zlib"
  3553. rtp_protocol_select="udp_protocol"
  3554. schannel_conflict="openssl gnutls libtls mbedtls"
  3555. sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
  3556. sctp_protocol_select="network"
  3557. securetransport_conflict="openssl gnutls libtls mbedtls"
  3558. srtp_protocol_select="rtp_protocol srtp"
  3559. tcp_protocol_select="network"
  3560. tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
  3561. tls_protocol_select="tcp_protocol"
  3562. udp_protocol_select="network"
  3563. udplite_protocol_select="network"
  3564. unix_protocol_deps="sys_un_h"
  3565. unix_protocol_select="network"
  3566. ipfs_gateway_protocol_select="https_protocol"
  3567. ipns_gateway_protocol_select="https_protocol"
  3568. # external library protocols
  3569. libamqp_protocol_deps="librabbitmq"
  3570. libamqp_protocol_select="network"
  3571. librist_protocol_deps="librist"
  3572. librist_protocol_select="network"
  3573. librtmp_protocol_deps="librtmp"
  3574. librtmpe_protocol_deps="librtmp"
  3575. librtmps_protocol_deps="librtmp"
  3576. librtmpt_protocol_deps="librtmp"
  3577. librtmpte_protocol_deps="librtmp"
  3578. libsmbclient_protocol_deps="libsmbclient gplv3"
  3579. libsrt_protocol_deps="libsrt"
  3580. libsrt_protocol_select="network"
  3581. libssh_protocol_deps="libssh"
  3582. libtls_conflict="openssl gnutls mbedtls"
  3583. libzmq_protocol_deps="libzmq"
  3584. libzmq_protocol_select="network"
  3585. # filters
  3586. ametadata_filter_deps="avformat"
  3587. amovie_filter_deps="avcodec avformat"
  3588. aresample_filter_deps="swresample"
  3589. asr_filter_deps="pocketsphinx"
  3590. ass_filter_deps="libass"
  3591. avgblur_opencl_filter_deps="opencl"
  3592. avgblur_vulkan_filter_deps="vulkan spirv_compiler"
  3593. azmq_filter_deps="libzmq"
  3594. blackframe_filter_deps="gpl"
  3595. blend_vulkan_filter_deps="vulkan spirv_compiler"
  3596. boxblur_filter_deps="gpl"
  3597. boxblur_opencl_filter_deps="opencl gpl"
  3598. bs2b_filter_deps="libbs2b"
  3599. bwdif_cuda_filter_deps="ffnvcodec"
  3600. bwdif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3601. bwdif_vulkan_filter_deps="vulkan spirv_compiler"
  3602. chromaber_vulkan_filter_deps="vulkan spirv_compiler"
  3603. color_vulkan_filter_deps="vulkan spirv_compiler"
  3604. colorkey_opencl_filter_deps="opencl"
  3605. colormatrix_filter_deps="gpl"
  3606. convolution_opencl_filter_deps="opencl"
  3607. coreimage_filter_deps="coreimage appkit"
  3608. coreimage_filter_extralibs="-framework OpenGL"
  3609. coreimagesrc_filter_deps="coreimage appkit"
  3610. coreimagesrc_filter_extralibs="-framework OpenGL"
  3611. cover_rect_filter_deps="avcodec avformat gpl"
  3612. cropdetect_filter_deps="gpl"
  3613. deinterlace_qsv_filter_deps="libmfx"
  3614. deinterlace_qsv_filter_select="qsvvpp"
  3615. deinterlace_vaapi_filter_deps="vaapi"
  3616. delogo_filter_deps="gpl"
  3617. denoise_vaapi_filter_deps="vaapi"
  3618. derain_filter_select="dnn"
  3619. deshake_filter_select="pixelutils"
  3620. deshake_opencl_filter_deps="opencl"
  3621. dilation_opencl_filter_deps="opencl"
  3622. dnn_classify_filter_select="dnn"
  3623. dnn_detect_filter_select="dnn"
  3624. dnn_processing_filter_select="dnn"
  3625. drawtext_filter_deps="libfreetype libharfbuzz"
  3626. drawtext_filter_suggest="libfontconfig libfribidi"
  3627. elbg_filter_deps="avcodec"
  3628. eq_filter_deps="gpl"
  3629. erosion_opencl_filter_deps="opencl"
  3630. find_rect_filter_deps="avcodec avformat gpl"
  3631. flip_vulkan_filter_deps="vulkan spirv_compiler"
  3632. flite_filter_deps="libflite threads"
  3633. framerate_filter_select="scene_sad"
  3634. freezedetect_filter_select="scene_sad"
  3635. frei0r_deps_any="libdl LoadLibrary"
  3636. frei0r_filter_deps="frei0r"
  3637. frei0r_src_filter_deps="frei0r"
  3638. fspp_filter_deps="gpl"
  3639. fsync_filter_deps="avformat"
  3640. gblur_vulkan_filter_deps="vulkan spirv_compiler"
  3641. hflip_vulkan_filter_deps="vulkan spirv_compiler"
  3642. histeq_filter_deps="gpl"
  3643. hqdn3d_filter_deps="gpl"
  3644. iccdetect_filter_deps="lcms2"
  3645. iccgen_filter_deps="lcms2"
  3646. identity_filter_select="scene_sad"
  3647. interlace_filter_deps="gpl"
  3648. interlace_vulkan_filter_deps="vulkan spirv_compiler"
  3649. kerndeint_filter_deps="gpl"
  3650. ladspa_filter_deps="ladspa libdl"
  3651. lcevc_filter_deps="liblcevc_dec"
  3652. lensfun_filter_deps="liblensfun version3"
  3653. libplacebo_filter_deps="libplacebo vulkan"
  3654. lv2_filter_deps="lv2"
  3655. mcdeint_filter_deps="avcodec gpl"
  3656. metadata_filter_deps="avformat"
  3657. movie_filter_deps="avcodec avformat"
  3658. mpdecimate_filter_deps="gpl"
  3659. mpdecimate_filter_select="pixelutils"
  3660. minterpolate_filter_select="scene_sad"
  3661. mptestsrc_filter_deps="gpl"
  3662. msad_filter_select="scene_sad"
  3663. negate_filter_deps="lut_filter"
  3664. nlmeans_opencl_filter_deps="opencl"
  3665. nlmeans_vulkan_filter_deps="vulkan spirv_compiler"
  3666. nnedi_filter_deps="gpl"
  3667. ocr_filter_deps="libtesseract"
  3668. ocv_filter_deps="libopencv"
  3669. openclsrc_filter_deps="opencl"
  3670. qrencode_filter_deps="libqrencode"
  3671. qrencodesrc_filter_deps="libqrencode"
  3672. quirc_filter_deps="libquirc"
  3673. overlay_opencl_filter_deps="opencl"
  3674. overlay_qsv_filter_deps="libmfx"
  3675. overlay_qsv_filter_select="qsvvpp"
  3676. overlay_vaapi_filter_deps="vaapi VAProcPipelineCaps_blend_flags"
  3677. overlay_vulkan_filter_deps="vulkan spirv_compiler"
  3678. owdenoise_filter_deps="gpl"
  3679. pad_opencl_filter_deps="opencl"
  3680. pan_filter_deps="swresample"
  3681. perspective_filter_deps="gpl"
  3682. phase_filter_deps="gpl"
  3683. pp7_filter_deps="gpl"
  3684. pp_filter_deps="gpl postproc"
  3685. prewitt_opencl_filter_deps="opencl"
  3686. procamp_vaapi_filter_deps="vaapi"
  3687. program_opencl_filter_deps="opencl"
  3688. pullup_filter_deps="gpl"
  3689. remap_opencl_filter_deps="opencl"
  3690. removelogo_filter_deps="avcodec avformat swscale"
  3691. repeatfields_filter_deps="gpl"
  3692. roberts_opencl_filter_deps="opencl"
  3693. rubberband_filter_deps="librubberband"
  3694. sab_filter_deps="gpl swscale"
  3695. scale2ref_filter_deps="swscale"
  3696. scale_filter_deps="swscale"
  3697. sr_amf_filter_deps="amf"
  3698. vpp_amf_filter_deps="amf"
  3699. scale_qsv_filter_deps="libmfx"
  3700. scale_qsv_filter_select="qsvvpp"
  3701. scdet_filter_select="scene_sad"
  3702. select_filter_select="scene_sad"
  3703. sharpness_vaapi_filter_deps="vaapi"
  3704. showcqt_filter_deps="avformat swscale"
  3705. showcqt_filter_suggest="libfontconfig libfreetype"
  3706. signature_filter_deps="gpl avcodec avformat"
  3707. smartblur_filter_deps="gpl swscale"
  3708. sobel_opencl_filter_deps="opencl"
  3709. sofalizer_filter_deps="libmysofa"
  3710. spp_filter_deps="gpl avcodec"
  3711. spp_filter_select="idctdsp fdctdsp me_cmp pixblockdsp"
  3712. sr_filter_deps="avformat swscale"
  3713. sr_filter_select="dnn"
  3714. stereo3d_filter_deps="gpl"
  3715. subtitles_filter_deps="avformat avcodec libass"
  3716. super2xsai_filter_deps="gpl"
  3717. pixfmts_super2xsai_test_deps="super2xsai_filter"
  3718. tinterlace_filter_deps="gpl"
  3719. tinterlace_merge_test_deps="tinterlace_filter"
  3720. tinterlace_pad_test_deps="tinterlace_filter"
  3721. tonemap_filter_deps="const_nan"
  3722. tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping"
  3723. tonemap_opencl_filter_deps="opencl const_nan"
  3724. transpose_opencl_filter_deps="opencl"
  3725. transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
  3726. transpose_vt_filter_deps="videotoolbox VTPixelRotationSessionCreate"
  3727. transpose_vulkan_filter_deps="vulkan spirv_compiler"
  3728. unsharp_opencl_filter_deps="opencl"
  3729. uspp_filter_deps="gpl avcodec"
  3730. vaguedenoiser_filter_deps="gpl"
  3731. vflip_vulkan_filter_deps="vulkan spirv_compiler"
  3732. vidstabdetect_filter_deps="libvidstab"
  3733. vidstabtransform_filter_deps="libvidstab"
  3734. libvmaf_filter_deps="libvmaf"
  3735. libvmaf_cuda_filter_deps="libvmaf libvmaf_cuda ffnvcodec"
  3736. zmq_filter_deps="libzmq"
  3737. zoompan_filter_deps="swscale"
  3738. zscale_filter_deps="libzimg const_nan"
  3739. scale_vaapi_filter_deps="vaapi"
  3740. scale_vt_filter_deps="videotoolbox VTPixelTransferSessionCreate"
  3741. scale_vulkan_filter_deps="vulkan spirv_compiler"
  3742. vpp_qsv_filter_deps="libmfx"
  3743. vpp_qsv_filter_select="qsvvpp"
  3744. xfade_opencl_filter_deps="opencl"
  3745. xfade_vulkan_filter_deps="vulkan spirv_compiler"
  3746. yadif_cuda_filter_deps="ffnvcodec"
  3747. yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3748. yadif_videotoolbox_filter_deps="metal corevideo videotoolbox"
  3749. hstack_vaapi_filter_deps="vaapi_1"
  3750. vstack_vaapi_filter_deps="vaapi_1"
  3751. xstack_vaapi_filter_deps="vaapi_1"
  3752. hstack_qsv_filter_deps="libmfx"
  3753. hstack_qsv_filter_select="qsvvpp"
  3754. vstack_qsv_filter_deps="libmfx"
  3755. vstack_qsv_filter_select="qsvvpp"
  3756. xstack_qsv_filter_deps="libmfx"
  3757. xstack_qsv_filter_select="qsvvpp"
  3758. pad_vaapi_filter_deps="vaapi_1"
  3759. drawbox_vaapi_filter_deps="vaapi_1"
  3760. # examples
  3761. avio_http_serve_files_deps="avformat avutil fork"
  3762. avio_list_dir_deps="avformat avutil"
  3763. avio_read_callback_deps="avformat avcodec avutil"
  3764. decode_audio_example_deps="avcodec avutil"
  3765. decode_filter_audio_example_deps="avfilter avcodec avformat avutil"
  3766. decode_filter_video_example_deps="avfilter avcodec avformat avutil"
  3767. decode_video_example_deps="avcodec avutil"
  3768. demux_decode_example_deps="avcodec avformat avutil"
  3769. encode_audio_example_deps="avcodec avutil"
  3770. encode_video_example_deps="avcodec avutil"
  3771. extract_mvs_example_deps="avcodec avformat avutil"
  3772. filter_audio_example_deps="avfilter avutil"
  3773. hw_decode_example_deps="avcodec avformat avutil"
  3774. mux_example_deps="avcodec avformat avutil swscale"
  3775. qsv_decode_example_deps="avcodec avutil libmfx h264_qsv_decoder"
  3776. remux_example_deps="avcodec avformat avutil"
  3777. resample_audio_example_deps="avutil swresample"
  3778. scale_video_example_deps="avutil swscale"
  3779. show_metadata_example_deps="avformat avutil"
  3780. transcode_aac_example_deps="avcodec avformat swresample"
  3781. transcode_example_deps="avfilter avcodec avformat avutil"
  3782. vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
  3783. vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
  3784. qsv_transcode_example_deps="avcodec avformat avutil h264_qsv_encoder"
  3785. # EXTRALIBS_LIST
  3786. cpu_init_extralibs="pthreads_extralibs"
  3787. cws2fws_extralibs="zlib_extralibs"
  3788. # libraries, in any order
  3789. avcodec_deps="avutil"
  3790. avcodec_suggest="libm stdatomic spirv_compiler"
  3791. avdevice_deps="avformat avcodec avutil"
  3792. avdevice_suggest="libm stdatomic"
  3793. avfilter_deps="avutil"
  3794. avfilter_suggest="libm stdatomic spirv_compiler"
  3795. avformat_deps="avcodec avutil"
  3796. avformat_suggest="libm network zlib stdatomic"
  3797. avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic"
  3798. postproc_deps="avutil gpl"
  3799. postproc_suggest="libm stdatomic"
  3800. swresample_deps="avutil"
  3801. swresample_suggest="libm libsoxr stdatomic"
  3802. swscale_deps="avutil"
  3803. swscale_suggest="libm stdatomic"
  3804. avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs liblcevc_dec_extralibs lcms2_extralibs"
  3805. avfilter_extralibs="pthreads_extralibs"
  3806. avutil_extralibs="d3d11va_extralibs d3d12va_extralibs mediacodec_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vaapi_win32_extralibs vdpau_x11_extralibs"
  3807. # programs
  3808. ffmpeg_deps="avcodec avfilter avformat threads"
  3809. ffmpeg_select="aformat_filter anull_filter atrim_filter crop_filter
  3810. format_filter hflip_filter null_filter rotate_filter
  3811. transpose_filter trim_filter vflip_filter"
  3812. ffmpeg_suggest="ole32 psapi shell32"
  3813. ffplay_deps="avcodec avformat avfilter swscale swresample sdl2"
  3814. ffplay_select="crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  3815. ffplay_suggest="shell32 libplacebo vulkan"
  3816. ffprobe_deps="avcodec avformat"
  3817. ffprobe_suggest="shell32"
  3818. # documentation
  3819. podpages_deps="perl"
  3820. manpages_deps="perl pod2man"
  3821. htmlpages_deps="perl"
  3822. htmlpages_deps_any="makeinfo_html texi2html"
  3823. txtpages_deps="perl makeinfo"
  3824. doc_deps_any="manpages htmlpages podpages txtpages"
  3825. # default parameters
  3826. logfile="ffbuild/config.log"
  3827. # installation paths
  3828. prefix_default="/usr/local"
  3829. bindir_default='${prefix}/bin'
  3830. datadir_default='${prefix}/share/ffmpeg'
  3831. docdir_default='${prefix}/share/doc/ffmpeg'
  3832. incdir_default='${prefix}/include'
  3833. libdir_default='${prefix}/lib'
  3834. mandir_default='${prefix}/share/man'
  3835. # toolchain
  3836. ar_default="ar"
  3837. cc_default="gcc"
  3838. stdc_default="c17"
  3839. stdcxx_default="c++11"
  3840. cxx_default="g++"
  3841. host_cc_default="gcc"
  3842. doxygen_default="doxygen"
  3843. install="install"
  3844. ln_s_default="ln -s -f"
  3845. metalcc_default="xcrun -sdk macosx metal"
  3846. metallib_default="xcrun -sdk macosx metallib"
  3847. nm_default="nm -g"
  3848. pkg_config_default=pkg-config
  3849. ranlib_default="ranlib"
  3850. strip_default="strip"
  3851. version_script='--version-script'
  3852. objformat="elf32"
  3853. x86asmexe_default="nasm"
  3854. windres_default="windres"
  3855. striptype="direct"
  3856. # OS
  3857. target_os_default=$(tolower $(uname -s))
  3858. host_os=$target_os_default
  3859. # machine
  3860. if test "$target_os_default" = aix; then
  3861. arch_default=$(uname -p)
  3862. strip_default="strip -X32_64"
  3863. nm_default="nm -g -X32_64"
  3864. else
  3865. arch_default=$(uname -m)
  3866. fi
  3867. cpu="generic"
  3868. intrinsics="none"
  3869. # configurable options
  3870. enable $PROGRAM_LIST
  3871. enable $DOCUMENT_LIST
  3872. enable $EXAMPLE_LIST
  3873. enable $LIBRARY_LIST
  3874. enable stripping
  3875. enable version_tracking
  3876. enable asm
  3877. enable debug
  3878. enable doc
  3879. enable faan faandct faanidct
  3880. enable iamf
  3881. enable large_tests
  3882. enable optimizations
  3883. enable ptx_compression
  3884. enable runtime_cpudetect
  3885. enable safe_bitstream_reader
  3886. enable static
  3887. enable swscale_alpha
  3888. enable valgrind_backtrace
  3889. sws_max_filter_size_default=256
  3890. set_default sws_max_filter_size
  3891. # internal components are enabled by default
  3892. enable $EXTRALIBS_LIST
  3893. # Avoid external, non-system, libraries getting enabled by dependency resolution
  3894. disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
  3895. # build settings
  3896. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  3897. LIBPREF="lib"
  3898. LIBSUF=".a"
  3899. FULLNAME='$(NAME)$(BUILDSUF)'
  3900. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  3901. SLIBPREF="lib"
  3902. SLIBSUF=".so"
  3903. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  3904. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  3905. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  3906. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  3907. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  3908. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  3909. VERSION_SCRIPT_POSTPROCESS_CMD="cat"
  3910. asflags_filter=echo
  3911. cflags_filter=echo
  3912. ldflags_filter=echo
  3913. AS_C='-c'
  3914. AS_O='-o $@'
  3915. CC_C='-c'
  3916. CC_E='-E -o $@'
  3917. CC_O='-o $@'
  3918. CXX_C='-c'
  3919. CXX_O='-o $@'
  3920. OBJCC_C='-c'
  3921. OBJCC_E='-E -o $@'
  3922. OBJCC_O='-o $@'
  3923. X86ASM_O='-o $@'
  3924. LD_O='-o $@'
  3925. LD_LIB='-l%'
  3926. LD_PATH='-L'
  3927. HOSTCC_C='-c'
  3928. HOSTCC_E='-E -o $@'
  3929. HOSTCC_O='-o $@'
  3930. HOSTLD_O='-o $@'
  3931. NVCC_C='-c'
  3932. NVCC_O='-o $@'
  3933. host_extralibs='-lm'
  3934. host_cflags_filter=echo
  3935. host_ldflags_filter=echo
  3936. target_path='$(CURDIR)'
  3937. # since the object filename is not given with the -MM flag, the compiler
  3938. # is only able to print the basename, and we must add the path ourselves
  3939. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
  3940. DEPFLAGS='-MM'
  3941. mkdir -p ffbuild
  3942. # find source path
  3943. if test -f configure; then
  3944. source_path=.
  3945. elif test -f src/configure; then
  3946. source_path=src
  3947. else
  3948. source_path=$(cd $(dirname "$0"); pwd)
  3949. case "$source_path" in
  3950. *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
  3951. esac
  3952. test -e "$source_path/config.h" &&
  3953. die "Out of tree builds are impossible with config.h in source dir."
  3954. fi
  3955. for v in "$@"; do
  3956. r=${v#*=}
  3957. l=${v%"$r"}
  3958. r=$(sh_quote "$r")
  3959. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  3960. done
  3961. find_things_extern(){
  3962. thing=$1
  3963. pattern=$2
  3964. file=$source_path/$3
  3965. out=${4:-$thing}
  3966. sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
  3967. }
  3968. find_filters_extern(){
  3969. file=$source_path/$1
  3970. sed -n 's/^extern const FFFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
  3971. }
  3972. FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
  3973. OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
  3974. INDEV_LIST=$(find_things_extern demuxer FFInputFormat libavdevice/alldevices.c indev)
  3975. MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
  3976. DEMUXER_LIST=$(find_things_extern demuxer FFInputFormat libavformat/allformats.c)
  3977. ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
  3978. DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
  3979. CODEC_LIST="
  3980. $ENCODER_LIST
  3981. $DECODER_LIST
  3982. "
  3983. PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
  3984. BSF_LIST=$(find_things_extern bsf FFBitStreamFilter libavcodec/bitstream_filters.c)
  3985. HWACCEL_LIST=$(find_things_extern hwaccel FFHWAccel libavcodec/hwaccels.h)
  3986. PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
  3987. AVCODEC_COMPONENTS_LIST="
  3988. $BSF_LIST
  3989. $DECODER_LIST
  3990. $ENCODER_LIST
  3991. $HWACCEL_LIST
  3992. $PARSER_LIST
  3993. "
  3994. AVDEVICE_COMPONENTS_LIST="
  3995. $INDEV_LIST
  3996. $OUTDEV_LIST
  3997. "
  3998. AVFILTER_COMPONENTS_LIST="
  3999. $FILTER_LIST
  4000. "
  4001. AVFORMAT_COMPONENTS_LIST="
  4002. $DEMUXER_LIST
  4003. $MUXER_LIST
  4004. $PROTOCOL_LIST
  4005. "
  4006. ALL_COMPONENTS="
  4007. $AVCODEC_COMPONENTS_LIST
  4008. $AVDEVICE_COMPONENTS_LIST
  4009. $AVFILTER_COMPONENTS_LIST
  4010. $AVFORMAT_COMPONENTS_LIST
  4011. "
  4012. for n in $COMPONENT_LIST; do
  4013. v=$(toupper ${n%s})_LIST
  4014. eval enable \$$v
  4015. eval ${n}_if_any="\$$v"
  4016. done
  4017. enable $ARCH_EXT_LIST
  4018. die_unknown(){
  4019. echo "Unknown option \"$1\"."
  4020. echo "See $0 --help for available options."
  4021. exit 1
  4022. }
  4023. print_in_columns() {
  4024. tr ' ' '\n' | sort | tr '\r\n' ' ' | awk -v col_width=24 -v width="$ncols" '
  4025. {
  4026. num_cols = width > col_width ? int(width / col_width) : 1;
  4027. num_rows = int((NF + num_cols-1) / num_cols);
  4028. y = x = 1;
  4029. for (y = 1; y <= num_rows; y++) {
  4030. i = y;
  4031. for (x = 1; x <= num_cols; x++) {
  4032. if (i <= NF) {
  4033. line = sprintf("%s%-" col_width "s", line, $i);
  4034. }
  4035. i = i + num_rows;
  4036. }
  4037. print line; line = "";
  4038. }
  4039. }' | sed 's/ *$//'
  4040. }
  4041. show_list() {
  4042. suffix=_$1
  4043. shift
  4044. echo $* | sed s/$suffix//g | print_in_columns
  4045. exit 0
  4046. }
  4047. rand_list(){
  4048. IFS=', '
  4049. set -- $*
  4050. unset IFS
  4051. for thing; do
  4052. comp=${thing%:*}
  4053. prob=${thing#$comp}
  4054. prob=${prob#:}
  4055. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  4056. echo "prob ${prob:-0.5}"
  4057. printf '%s\n' $comp
  4058. done
  4059. }
  4060. do_random(){
  4061. action=$1
  4062. shift
  4063. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  4064. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  4065. }
  4066. # deprecated components (disabled by default)
  4067. disable sonic_encoder sonic_ls_encoder
  4068. for opt do
  4069. optval="${opt#*=}"
  4070. case "$opt" in
  4071. --extra-ldflags=*)
  4072. add_ldflags $optval
  4073. ;;
  4074. --extra-ldexeflags=*)
  4075. add_ldexeflags $optval
  4076. ;;
  4077. --extra-ldsoflags=*)
  4078. add_ldsoflags $optval
  4079. ;;
  4080. --extra-ldlibflags=*)
  4081. warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
  4082. "removed in the future. Use --extra-ldsoflags instead."
  4083. add_ldsoflags $optval
  4084. ;;
  4085. --extra-libs=*)
  4086. add_extralibs $optval
  4087. ;;
  4088. --disable-devices)
  4089. disable $INDEV_LIST $OUTDEV_LIST
  4090. ;;
  4091. --enable-debug=*)
  4092. debuglevel="$optval"
  4093. ;;
  4094. --disable-programs)
  4095. disable $PROGRAM_LIST
  4096. ;;
  4097. --disable-everything)
  4098. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  4099. ;;
  4100. --disable-all)
  4101. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  4102. disable $LIBRARY_LIST $PROGRAM_LIST doc
  4103. enable avutil
  4104. ;;
  4105. --enable-random|--disable-random)
  4106. action=${opt%%-random}
  4107. do_random ${action#--} $COMPONENT_LIST
  4108. ;;
  4109. --enable-random=*|--disable-random=*)
  4110. action=${opt%%-random=*}
  4111. do_random ${action#--} $optval
  4112. ;;
  4113. --enable-sdl)
  4114. enable sdl2
  4115. ;;
  4116. --enable-lto*)
  4117. lto=-f${opt#--enable-}
  4118. ;;
  4119. --enable-*=*|--disable-*=*)
  4120. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  4121. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  4122. eval list=\$$(toupper $thing)_LIST
  4123. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  4124. list=$(filter "$name" $list)
  4125. [ "$list" = "" ] && warn "Option $opt did not match anything"
  4126. test $action = enable && warn_if_gets_disabled $list
  4127. $action $list
  4128. ;;
  4129. --enable-?*|--disable-?*)
  4130. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  4131. if is_in $option $COMPONENT_LIST; then
  4132. test $action = disable && action=unset
  4133. eval $action \$$(toupper ${option%s})_LIST
  4134. elif is_in $option $CMDLINE_SELECT; then
  4135. $action $option
  4136. else
  4137. die_unknown $opt
  4138. fi
  4139. ;;
  4140. --list-*)
  4141. NAME="${opt#--list-}"
  4142. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  4143. NAME=${NAME%s}
  4144. eval show_list $NAME \$$(toupper $NAME)_LIST
  4145. ;;
  4146. --help|-h) show_help
  4147. ;;
  4148. --quiet|-q) quiet=yes
  4149. ;;
  4150. --fatal-warnings) enable fatal_warnings
  4151. ;;
  4152. --libfuzzer=*)
  4153. libfuzzer_path="$optval"
  4154. ;;
  4155. *)
  4156. optname="${opt%%=*}"
  4157. optname="${optname#--}"
  4158. optname=$(echo "$optname" | sed 's/-/_/g')
  4159. if is_in $optname $CMDLINE_SET; then
  4160. eval $optname='$optval'
  4161. elif is_in $optname $CMDLINE_APPEND; then
  4162. append $optname "$optval"
  4163. else
  4164. die_unknown $opt
  4165. fi
  4166. ;;
  4167. esac
  4168. done
  4169. for e in $env; do
  4170. eval "export $e"
  4171. done
  4172. if disabled autodetect; then
  4173. # Unless iconv is explicitely disabled by the user, we still want to probe
  4174. # for the iconv from the libc.
  4175. disabled iconv || enable libc_iconv
  4176. disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  4177. disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  4178. fi
  4179. # Mark specifically enabled, but normally autodetected libraries as requested.
  4180. for lib in $AUTODETECT_LIBS; do
  4181. enabled $lib && request $lib
  4182. done
  4183. #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
  4184. enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  4185. enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  4186. disabled logging && logfile=/dev/null
  4187. # command line configuration sanity checks
  4188. # we need to build at least one lib type
  4189. if ! enabled_any static shared; then
  4190. cat <<EOF
  4191. At least one library type must be built.
  4192. Specify --enable-static to build the static libraries or --enable-shared to
  4193. build the shared libraries as well. To only build the shared libraries specify
  4194. --disable-static in addition to --enable-shared.
  4195. EOF
  4196. exit 1
  4197. fi
  4198. die_license_disabled() {
  4199. enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
  4200. }
  4201. die_license_disabled_gpl() {
  4202. enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
  4203. }
  4204. map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  4205. map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  4206. enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
  4207. map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
  4208. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4209. if enabled nonfree; then
  4210. license="nonfree and unredistributable"
  4211. elif enabled gplv3; then
  4212. license="GPL version 3 or later"
  4213. elif enabled lgplv3; then
  4214. license="LGPL version 3 or later"
  4215. elif enabled gpl; then
  4216. license="GPL version 2 or later"
  4217. else
  4218. license="LGPL version 2.1 or later"
  4219. fi
  4220. enabled_all gnutls openssl &&
  4221. die "GnuTLS and OpenSSL must not be enabled at the same time."
  4222. enabled_all gnutls mbedtls &&
  4223. die "GnuTLS and mbedTLS must not be enabled at the same time."
  4224. enabled_all openssl mbedtls &&
  4225. die "OpenSSL and mbedTLS must not be enabled at the same time."
  4226. # Disable all the library-specific components if the library itself
  4227. # is disabled, see AVCODEC_LIST and following _LIST variables.
  4228. disable_components(){
  4229. disabled ${1} && disable $(
  4230. eval components="\$$(toupper ${1})_COMPONENTS"
  4231. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  4232. )
  4233. }
  4234. map 'disable_components $v' $LIBRARY_LIST
  4235. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  4236. set >> $logfile
  4237. test -n "$valgrind" && toolchain="valgrind-memcheck"
  4238. enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
  4239. add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
  4240. add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
  4241. }
  4242. add_sanitizer_flags(){
  4243. case "$1" in
  4244. asan)
  4245. add_cflags -fsanitize=address
  4246. add_ldflags -fsanitize=address
  4247. ;;
  4248. lsan)
  4249. add_cflags -fsanitize=leak
  4250. add_ldflags -fsanitize=leak
  4251. ;;
  4252. msan)
  4253. add_cflags -fsanitize=memory -fsanitize-memory-track-origins
  4254. add_ldflags -fsanitize=memory
  4255. ;;
  4256. tsan)
  4257. add_cflags -fsanitize=thread
  4258. add_ldflags -fsanitize=thread
  4259. ;;
  4260. usan)
  4261. add_cflags -fsanitize=undefined
  4262. add_ldflags -fsanitize=undefined
  4263. ;;
  4264. ?*)
  4265. die "Unknown sanitizer $1"
  4266. ;;
  4267. esac
  4268. }
  4269. case "$toolchain" in
  4270. clang-*)
  4271. add_sanitizer_flags "${toolchain#clang-}"
  4272. cc_default="clang"
  4273. cxx_default="clang++"
  4274. ;;
  4275. gcc-*)
  4276. add_sanitizer_flags "${toolchain#gcc-}"
  4277. cc_default="gcc"
  4278. cxx_default="g++"
  4279. # In case of tsan with gcc, PIC has to be enabled
  4280. if [ "${toolchain#gcc-}" = "tsan" ]; then
  4281. add_cflags -fPIC
  4282. add_ldflags -fPIC
  4283. fi
  4284. ;;
  4285. valgrind-*)
  4286. target_exec_default="valgrind"
  4287. case "$toolchain" in
  4288. valgrind-massif)
  4289. 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"
  4290. ;;
  4291. valgrind-memcheck)
  4292. 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"
  4293. ;;
  4294. esac
  4295. ;;
  4296. msvc)
  4297. cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  4298. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  4299. cc_default="cl.exe"
  4300. cxx_default="cl.exe"
  4301. else
  4302. die "Unsupported MSVC version (2013 or newer required)"
  4303. fi
  4304. ld_default="$source_path/compat/windows/mslink"
  4305. windres_default="$source_path/compat/windows/mswindres"
  4306. nm_default="dumpbin.exe -symbols"
  4307. ar_default="lib.exe"
  4308. case "${arch:-$arch_default}" in
  4309. aarch64|arm64)
  4310. as_default="armasm64.exe"
  4311. ;;
  4312. arm*)
  4313. as_default="armasm.exe"
  4314. ;;
  4315. esac
  4316. target_os_default="win32"
  4317. # Use a relative path for TMPDIR. This makes sure all the
  4318. # ffconf temp files are written with a relative path, avoiding
  4319. # issues with msys/win32 path conversion for MSVC parameters
  4320. # such as -Fo<file> or -out:<file>.
  4321. TMPDIR=.
  4322. ;;
  4323. icl)
  4324. cc_default="icl"
  4325. ld_default="xilink"
  4326. nm_default="dumpbin -symbols"
  4327. ar_default="xilib"
  4328. target_os_default="win32"
  4329. TMPDIR=.
  4330. ;;
  4331. gcov)
  4332. add_cflags -fprofile-arcs -ftest-coverage
  4333. add_ldflags -fprofile-arcs -ftest-coverage
  4334. ;;
  4335. llvm-cov)
  4336. add_cflags -fprofile-arcs -ftest-coverage
  4337. add_ldflags --coverage
  4338. ;;
  4339. hardened)
  4340. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  4341. add_cflags -fno-strict-overflow -fstack-protector-all
  4342. add_ldflags -Wl,-z,relro -Wl,-z,now
  4343. add_cflags -fPIE
  4344. add_ldexeflags -fPIE -pie
  4345. ;;
  4346. ?*)
  4347. die "Unknown toolchain $toolchain"
  4348. ;;
  4349. esac
  4350. if test -n "$cross_prefix"; then
  4351. test -n "$arch" && test -n "$target_os" ||
  4352. die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
  4353. enable cross_compile
  4354. fi
  4355. set_default target_os
  4356. if test "$target_os" = android; then
  4357. cc_default="clang"
  4358. fi
  4359. ar_default="${cross_prefix}${ar_default}"
  4360. cc_default="${cross_prefix}${cc_default}"
  4361. cxx_default="${cross_prefix}${cxx_default}"
  4362. nm_default="${cross_prefix}${nm_default}"
  4363. pkg_config_default="${cross_prefix}${pkg_config_default}"
  4364. ranlib_default="${cross_prefix}${ranlib_default}"
  4365. strip_default="${cross_prefix}${strip_default}"
  4366. windres_default="${cross_prefix}${windres_default}"
  4367. sysinclude_default="${sysroot}/usr/include"
  4368. if enabled cuda_sdk; then
  4369. warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
  4370. enable cuda_nvcc
  4371. fi
  4372. if enabled cuda_nvcc; then
  4373. nvcc_default="nvcc"
  4374. nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
  4375. else
  4376. nvcc_default="clang"
  4377. nvccflags_default="--cuda-gpu-arch=sm_30 -O2"
  4378. NVCC_C=""
  4379. fi
  4380. set_default nvcc
  4381. if enabled cuda_nvcc; then
  4382. if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then
  4383. nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2"
  4384. fi
  4385. fi
  4386. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  4387. target_exec x86asmexe metalcc metallib stdc stdcxx
  4388. enabled cross_compile || host_cc_default=$cc
  4389. set_default host_cc
  4390. if ${ranlib} 2>&1 | grep -q "\-D "; then
  4391. ranlib="${ranlib} -D"
  4392. fi
  4393. pkg_config_fail_message=""
  4394. if ! $pkg_config --version >/dev/null 2>&1; then
  4395. warn "$pkg_config not found, library detection may fail."
  4396. pkg_config=false
  4397. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  4398. pkg_config_fail_message="
  4399. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  4400. fi
  4401. if test $doxygen != $doxygen_default && \
  4402. ! $doxygen --version >/dev/null 2>&1; then
  4403. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  4404. fi
  4405. exesuf() {
  4406. case $1 in
  4407. mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  4408. esac
  4409. }
  4410. EXESUF=$(exesuf $target_os)
  4411. HOSTEXESUF=$(exesuf $host_os)
  4412. # set temporary file name
  4413. : ${TMPDIR:=$TEMPDIR}
  4414. : ${TMPDIR:=$TMP}
  4415. : ${TMPDIR:=/tmp}
  4416. if [ -n "$tempprefix" ] ; then
  4417. mktemp(){
  4418. tmpname="$tempprefix.${HOSTNAME}.${UID}"
  4419. echo "$tmpname"
  4420. mkdir "$tmpname"
  4421. }
  4422. elif ! test_cmd mktemp -u XXXXXX; then
  4423. # simple replacement for missing mktemp
  4424. # NOT SAFE FOR GENERAL USE
  4425. mktemp(){
  4426. tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  4427. echo "$tmpname"
  4428. mkdir "$tmpname"
  4429. }
  4430. fi
  4431. FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
  4432. die "Unable to create temporary directory in $TMPDIR."
  4433. tmpfile(){
  4434. tmp="${FFTMPDIR}/test"$2
  4435. (set -C; exec > $tmp) 2> /dev/null ||
  4436. die "Unable to create temporary file in $FFTMPDIR."
  4437. eval $1=$tmp
  4438. }
  4439. trap 'rm -rf -- "$FFTMPDIR"' EXIT
  4440. trap 'exit 2' INT
  4441. tmpfile TMPASM .asm
  4442. tmpfile TMPC .c
  4443. tmpfile TMPCPP .cpp
  4444. tmpfile TMPE $EXESUF
  4445. tmpfile TMPH .h
  4446. tmpfile TMPM .m
  4447. tmpfile TMPCU .cu
  4448. tmpfile TMPO .o
  4449. tmpfile TMPS .S
  4450. tmpfile TMPSH .sh
  4451. tmpfile TMPV .ver
  4452. unset -f mktemp
  4453. chmod +x $TMPE
  4454. # make sure we can execute files in $TMPDIR
  4455. cat > $TMPSH 2>> $logfile <<EOF
  4456. #!/bin/sh
  4457. EOF
  4458. chmod +x $TMPSH >> $logfile 2>&1
  4459. if ! $TMPSH >> $logfile 2>&1; then
  4460. cat <<EOF
  4461. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  4462. variable to another directory and make sure that it is not mounted noexec.
  4463. EOF
  4464. die "Sanity test failed."
  4465. fi
  4466. armasm_flags(){
  4467. for flag; do
  4468. case $flag in
  4469. # Filter out MSVC cl.exe options from cflags that shouldn't
  4470. # be passed to gas-preprocessor
  4471. -M[TD]*) ;;
  4472. *) echo $flag ;;
  4473. esac
  4474. done
  4475. }
  4476. cparser_flags(){
  4477. for flag; do
  4478. case $flag in
  4479. -Wno-switch) echo -Wno-switch-enum ;;
  4480. -Wno-format-zero-length) ;;
  4481. -Wdisabled-optimization) ;;
  4482. -Wno-pointer-sign) echo -Wno-other ;;
  4483. *) echo $flag ;;
  4484. esac
  4485. done
  4486. }
  4487. msvc_common_flags(){
  4488. for flag; do
  4489. case $flag in
  4490. # In addition to specifying certain flags under the compiler
  4491. # specific filters, they must be specified here as well or else the
  4492. # generic catch all at the bottom will print the original flag.
  4493. -Wall) ;;
  4494. -Wextra) ;;
  4495. -std=c*) echo /std:${flag#-std=};;
  4496. # Common flags
  4497. -fomit-frame-pointer) ;;
  4498. -g) echo -Z7 ;;
  4499. -fno-math-errno) ;;
  4500. -fno-common) ;;
  4501. -fno-signed-zeros) ;;
  4502. -fPIC) ;;
  4503. -mthumb) ;;
  4504. -march=*) ;;
  4505. -mfp16-format=*) ;;
  4506. -lz) echo zlib.lib ;;
  4507. -lx264) echo libx264.lib ;;
  4508. -lstdc++) ;;
  4509. -l*) echo ${flag#-l}.lib ;;
  4510. -LARGEADDRESSAWARE) echo $flag ;;
  4511. -L*) echo -libpath:${flag#-L} ;;
  4512. -Wl,*) ;;
  4513. *) echo $flag ;;
  4514. esac
  4515. done
  4516. }
  4517. msvc_flags(){
  4518. msvc_common_flags "$@"
  4519. for flag; do
  4520. case $flag in
  4521. -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
  4522. -wd4554 ;;
  4523. -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  4524. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  4525. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  4526. -wd4307 \
  4527. -wd4273 -wd4554 -wd4701 -wd4703 ;;
  4528. esac
  4529. done
  4530. }
  4531. icl_flags(){
  4532. msvc_common_flags "$@"
  4533. for flag; do
  4534. case $flag in
  4535. # Despite what Intel's documentation says -Wall, which is supported
  4536. # on Windows, does enable remarks so disable them here.
  4537. -Wall) echo $flag -Qdiag-disable:remark ;;
  4538. -std=$stdc) echo -Qstd=$stdc ;;
  4539. -flto*) echo -ipo ;;
  4540. esac
  4541. done
  4542. }
  4543. icc_flags(){
  4544. for flag; do
  4545. case $flag in
  4546. -flto*) echo -ipo ;;
  4547. *) echo $flag ;;
  4548. esac
  4549. done
  4550. }
  4551. suncc_flags(){
  4552. for flag; do
  4553. case $flag in
  4554. -march=*|-mcpu=*)
  4555. case "${flag#*=}" in
  4556. native) echo -xtarget=native ;;
  4557. v9|niagara) echo -xarch=sparc ;;
  4558. ultrasparc) echo -xarch=sparcvis ;;
  4559. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  4560. i586|pentium) echo -xchip=pentium ;;
  4561. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  4562. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  4563. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  4564. pentium4*) echo -xtarget=pentium4 ;;
  4565. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  4566. *-sse3) echo -xarch=sse3 ;;
  4567. core2) echo -xarch=ssse3 -xchip=core2 ;;
  4568. bonnell) echo -xarch=ssse3 ;;
  4569. corei7|nehalem) echo -xtarget=nehalem ;;
  4570. westmere) echo -xtarget=westmere ;;
  4571. silvermont) echo -xarch=sse4_2 ;;
  4572. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  4573. core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
  4574. echo -xarch=avx ;;
  4575. amdfam10|barcelona) echo -xtarget=barcelona ;;
  4576. btver1) echo -xarch=amdsse4a ;;
  4577. btver2|bdver*|znver*) echo -xarch=avx ;;
  4578. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  4579. k8|opteron|athlon64|athlon-fx)
  4580. echo -xarch=sse2a ;;
  4581. athlon*) echo -xarch=pentium_proa ;;
  4582. esac
  4583. ;;
  4584. -std=$stdc) echo -x$stdc ;;
  4585. -fomit-frame-pointer) echo -xregs=frameptr ;;
  4586. -fPIC) echo -KPIC -xcode=pic32 ;;
  4587. -W*,*) echo $flag ;;
  4588. -f*-*|-W*|-mimpure-text) ;;
  4589. -shared) echo -G ;;
  4590. *) echo $flag ;;
  4591. esac
  4592. done
  4593. }
  4594. probe_cc(){
  4595. pfx=$1
  4596. _cc=$2
  4597. first=$3
  4598. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  4599. unset _ld_o _ldflags _ld_lib _ld_path
  4600. unset _depflags _DEPCMD _DEPFLAGS
  4601. _flags_filter=echo
  4602. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  4603. true # no-op to avoid reading stdin in following checks
  4604. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  4605. _type=llvm_gcc
  4606. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  4607. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  4608. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4609. _cflags_speed='-O3'
  4610. _cflags_size='-Os'
  4611. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  4612. _type=gcc
  4613. gcc_version=$($_cc --version | head -n1)
  4614. gcc_basever=$($_cc -dumpversion)
  4615. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  4616. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  4617. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  4618. case $gcc_basever in
  4619. 2) ;;
  4620. 2.*) ;;
  4621. *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
  4622. esac
  4623. if [ "$first" = true ]; then
  4624. case $gcc_basever in
  4625. 4.2*)
  4626. warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
  4627. esac
  4628. fi
  4629. _cflags_speed='-O3'
  4630. _cflags_size='-Os'
  4631. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  4632. _type=icc
  4633. _ident=$($_cc --version | head -n1)
  4634. _depflags='-MMD'
  4635. _cflags_speed='-O3'
  4636. _cflags_size='-Os'
  4637. _cflags_noopt='-O1'
  4638. _flags_filter=icc_flags
  4639. elif $_cc -v 2>&1 | grep -q xlc; then
  4640. _type=xlc
  4641. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  4642. _cflags_speed='-O5'
  4643. _cflags_size='-O5 -qcompact'
  4644. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  4645. test -d "$sysroot" || die "No valid sysroot specified."
  4646. _type=armcc
  4647. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  4648. armcc_conf="$PWD/armcc.conf"
  4649. $_cc --arm_linux_configure \
  4650. --arm_linux_config_file="$armcc_conf" \
  4651. --configure_sysroot="$sysroot" \
  4652. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  4653. die "Error creating armcc configuration file."
  4654. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  4655. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  4656. as_default="${cross_prefix}gcc"
  4657. _depflags='-MMD'
  4658. _cflags_speed='-O3'
  4659. _cflags_size='-Os'
  4660. elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
  4661. _type=clang
  4662. _ident=$($_cc --version 2>/dev/null | head -n1)
  4663. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4664. _cflags_speed='-O3'
  4665. _cflags_size='-Oz'
  4666. elif $_cc -V 2>&1 | grep -q Sun; then
  4667. _type=suncc
  4668. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  4669. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  4670. _DEPFLAGS='-xM1 -x$stdc'
  4671. _ldflags='-std=$stdc'
  4672. _cflags_speed='-O5'
  4673. _cflags_size='-O5 -xspace'
  4674. _flags_filter=suncc_flags
  4675. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  4676. _type=pathscale
  4677. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4678. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4679. _cflags_speed='-O2'
  4680. _cflags_size='-Os'
  4681. _flags_filter='filter_out -Wdisabled-optimization'
  4682. elif $_cc -v 2>&1 | grep -q Open64; then
  4683. _type=open64
  4684. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4685. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4686. _cflags_speed='-O2'
  4687. _cflags_size='-Os'
  4688. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  4689. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  4690. _type=armasm
  4691. _ident=$($_cc | head -n1)
  4692. # 4509: "This form of conditional instruction is deprecated"
  4693. _flags="-nologo -ignore 4509"
  4694. _flags_filter=armasm_flags
  4695. elif $_cc 2>&1 | grep -q Intel; then
  4696. _type=icl
  4697. _ident=$($_cc 2>&1 | head -n1)
  4698. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  4699. # Not only is O3 broken on 13.x+ but it is slower on all previous
  4700. # versions (tested) as well.
  4701. _cflags_speed="-O2"
  4702. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  4703. if $_cc 2>&1 | grep -q Linker; then
  4704. _ld_o='-out:$@'
  4705. else
  4706. _ld_o='-Fe$@'
  4707. fi
  4708. _cc_o='-Fo$@'
  4709. _cc_e='-P'
  4710. _flags_filter=icl_flags
  4711. _ld_lib='lib%.a'
  4712. _ld_path='-libpath:'
  4713. # -Qdiag-error to make icl error when seeing certain unknown arguments
  4714. _flags='-nologo -Qdiag-error:4044,10157'
  4715. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  4716. # with MSVC which enables it by default.
  4717. _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  4718. disable stripping
  4719. elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
  4720. # lld can emulate multiple different linkers; in ms link.exe mode,
  4721. # the -? parameter gives the help output which contains an identifyable
  4722. # string, while it gives an error in other modes.
  4723. _type=lld-link
  4724. # The link.exe mode doesn't have a switch for getting the version,
  4725. # but we can force it back to gnu mode and get the version from there.
  4726. _ident=$($_cc -flavor gnu --version 2>/dev/null)
  4727. _ld_o='-out:$@'
  4728. _flags_filter=msvc_flags
  4729. _ld_lib='lib%.a'
  4730. _ld_path='-libpath:'
  4731. elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
  4732. _type=msvc
  4733. if $_cc -nologo- 2>&1 | grep -q Microsoft; then
  4734. _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
  4735. else
  4736. _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
  4737. fi
  4738. if [ -x "$(command -v wslpath)" ]; then
  4739. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); if (!match($$0, / /)) { print $$0 } }'\'' | xargs -r -d\\n -n1 wslpath -u | awk '\''BEGIN { printf "%s:", "$@" }; { sub(/\r/,""); printf " %s", $$0 }; END { print "" }'\'' > $(@:.o=.d)'
  4740. else
  4741. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  4742. fi
  4743. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  4744. _cflags_speed="-O2"
  4745. _cflags_size="-O1"
  4746. _cflags_noopt="-O1"
  4747. if $_cc -nologo- 2>&1 | grep -q Linker; then
  4748. _ld_o='-out:$@'
  4749. else
  4750. _ld_o='-Fe$@'
  4751. fi
  4752. _cc_o='-Fo$@'
  4753. _cc_e='-P -Fi$@'
  4754. _flags_filter=msvc_flags
  4755. _ld_lib='lib%.a'
  4756. _ld_path='-libpath:'
  4757. _flags='-nologo'
  4758. disable stripping
  4759. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  4760. _type=cparser
  4761. _ident=$($_cc --version | head -n1)
  4762. _depflags='-MMD'
  4763. _cflags_speed='-O4'
  4764. _cflags_size='-O2'
  4765. _flags_filter=cparser_flags
  4766. fi
  4767. eval ${pfx}_type=\$_type
  4768. eval ${pfx}_ident=\$_ident
  4769. }
  4770. set_ccvars(){
  4771. eval ${1}_C=\${_cc_c-\${${1}_C}}
  4772. eval ${1}_E=\${_cc_e-\${${1}_E}}
  4773. eval ${1}_O=\${_cc_o-\${${1}_O}}
  4774. if [ -n "$_depflags" ]; then
  4775. eval ${1}_DEPFLAGS=\$_depflags
  4776. else
  4777. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  4778. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  4779. eval DEP${1}FLAGS=\$_flags
  4780. fi
  4781. }
  4782. probe_cc cc "$cc" "true"
  4783. cflags_filter=$_flags_filter
  4784. cflags_speed=$_cflags_speed
  4785. cflags_size=$_cflags_size
  4786. cflags_noopt=$_cflags_noopt
  4787. add_cflags $_flags $_cflags
  4788. cc_ldflags=$_ldflags
  4789. set_ccvars CC
  4790. set_ccvars CXX
  4791. probe_cc hostcc "$host_cc"
  4792. host_cflags_filter=$_flags_filter
  4793. host_cflags_speed=$_cflags_speed
  4794. add_host_cflags $_flags $_cflags
  4795. set_ccvars HOSTCC
  4796. test -n "$cc_type" && enable $cc_type ||
  4797. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  4798. : ${as_default:=$cc}
  4799. : ${objcc_default:=$cc}
  4800. : ${dep_cc_default:=$cc}
  4801. : ${ld_default:=$cc}
  4802. : ${host_ld_default:=$host_cc}
  4803. set_default ar as objcc dep_cc ld ln_s host_ld windres
  4804. probe_cc as "$as"
  4805. asflags_filter=$_flags_filter
  4806. add_asflags $_flags $_cflags
  4807. set_ccvars AS
  4808. probe_cc objcc "$objcc"
  4809. objcflags_filter=$_flags_filter
  4810. add_objcflags $_flags $_cflags
  4811. set_ccvars OBJC
  4812. probe_cc ld "$ld"
  4813. ldflags_filter=$_flags_filter
  4814. add_ldflags $_flags $_ldflags
  4815. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  4816. LD_O=${_ld_o-$LD_O}
  4817. LD_LIB=${_ld_lib-$LD_LIB}
  4818. LD_PATH=${_ld_path-$LD_PATH}
  4819. probe_cc hostld "$host_ld"
  4820. host_ldflags_filter=$_flags_filter
  4821. add_host_ldflags $_flags $_ldflags
  4822. HOSTLD_O=${_ld_o-$HOSTLD_O}
  4823. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  4824. probe_cc depcc "$dep_cc"
  4825. CCDEP=${_DEPCMD:-$DEPCMD}
  4826. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  4827. DEPCCFLAGS=$_flags
  4828. fi
  4829. if $ar 2>&1 | grep -q Microsoft; then
  4830. arflags="-nologo"
  4831. ar_o='-out:$@'
  4832. elif $ar 2>&1 | grep -q "\[D\] "; then
  4833. arflags="rcD"
  4834. ar_o='$@'
  4835. else
  4836. arflags="rc"
  4837. ar_o='$@'
  4838. fi
  4839. add_cflags $extra_cflags
  4840. add_cxxflags $extra_cxxflags
  4841. add_objcflags $extra_objcflags
  4842. add_asflags $extra_cflags
  4843. if test -n "$sysroot"; then
  4844. case "$cc_type" in
  4845. gcc|llvm_gcc|clang)
  4846. add_cppflags --sysroot="$sysroot"
  4847. add_ldflags --sysroot="$sysroot"
  4848. ;;
  4849. esac
  4850. fi
  4851. if test "$cpu" = host; then
  4852. enabled cross_compile &&
  4853. warn "--cpu=host makes no sense when cross-compiling."
  4854. case "$cc_type" in
  4855. gcc|llvm_gcc)
  4856. check_native(){
  4857. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4858. sed -n "/cc1.*$1=/{
  4859. s/.*$1=\\([^ ]*\\).*/\\1/
  4860. p
  4861. q
  4862. }" $TMPE
  4863. }
  4864. cpu=$(check_native -march || check_native -mcpu)
  4865. ;;
  4866. clang)
  4867. check_native(){
  4868. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4869. sed -n "/cc1.*-target-cpu /{
  4870. s/.*-target-cpu \\([^ ]*\\).*/\\1/
  4871. p
  4872. q
  4873. }" $TMPE
  4874. }
  4875. cpu=$(check_native -march)
  4876. ;;
  4877. esac
  4878. test "${cpu:-host}" = host &&
  4879. die "--cpu=host not supported with compiler $cc"
  4880. fi
  4881. # Deal with common $arch aliases
  4882. case "$arch" in
  4883. aarch64|arm64)
  4884. arch="aarch64"
  4885. ;;
  4886. arm*|iPad*|iPhone*)
  4887. arch="arm"
  4888. ;;
  4889. loongarch*)
  4890. arch="loongarch"
  4891. ;;
  4892. mips*|IP*)
  4893. case "$arch" in
  4894. *el)
  4895. add_cppflags -EL
  4896. add_ldflags -EL
  4897. ;;
  4898. *eb)
  4899. add_cppflags -EB
  4900. add_ldflags -EB
  4901. ;;
  4902. esac
  4903. arch="mips"
  4904. ;;
  4905. parisc*|hppa*)
  4906. arch="parisc"
  4907. ;;
  4908. "Power Macintosh"|ppc*|powerpc*)
  4909. arch="ppc"
  4910. ;;
  4911. riscv*)
  4912. arch="riscv"
  4913. ;;
  4914. s390|s390x)
  4915. arch="s390"
  4916. ;;
  4917. sun4*|sparc*)
  4918. arch="sparc"
  4919. ;;
  4920. tilegx|tile-gx)
  4921. arch="tilegx"
  4922. ;;
  4923. wasm*)
  4924. arch="wasm"
  4925. ;;
  4926. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  4927. arch="x86"
  4928. ;;
  4929. esac
  4930. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  4931. enable $arch
  4932. # Add processor-specific flags
  4933. if enabled aarch64; then
  4934. case $cpu in
  4935. armv*)
  4936. cpuflags="-march=$cpu"
  4937. ;;
  4938. *)
  4939. cpuflags="-mcpu=$cpu"
  4940. ;;
  4941. esac
  4942. elif enabled arm; then
  4943. check_arm_arch() {
  4944. test_cpp_condition stddef.h \
  4945. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  4946. $cpuflags
  4947. }
  4948. probe_arm_arch() {
  4949. if check_arm_arch 4; then echo armv4
  4950. elif check_arm_arch 4T; then echo armv4t
  4951. elif check_arm_arch 5; then echo armv5
  4952. elif check_arm_arch 5E; then echo armv5e
  4953. elif check_arm_arch 5T; then echo armv5t
  4954. elif check_arm_arch 5TE; then echo armv5te
  4955. elif check_arm_arch 5TEJ; then echo armv5te
  4956. elif check_arm_arch 6; then echo armv6
  4957. elif check_arm_arch 6J; then echo armv6j
  4958. elif check_arm_arch 6K; then echo armv6k
  4959. elif check_arm_arch 6Z; then echo armv6z
  4960. elif check_arm_arch 6KZ; then echo armv6zk
  4961. elif check_arm_arch 6ZK; then echo armv6zk
  4962. elif check_arm_arch 6T2; then echo armv6t2
  4963. elif check_arm_arch 7; then echo armv7
  4964. elif check_arm_arch 7A 7_A; then echo armv7-a
  4965. elif check_arm_arch 7S; then echo armv7-a
  4966. elif check_arm_arch 7R 7_R; then echo armv7-r
  4967. elif check_arm_arch 7M 7_M; then echo armv7-m
  4968. elif check_arm_arch 7EM 7E_M; then echo armv7-m
  4969. elif check_arm_arch 8A 8_A; then echo armv8-a
  4970. fi
  4971. }
  4972. case $cpu in
  4973. generic)
  4974. subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g')
  4975. ;;
  4976. armv*)
  4977. cpuflags="-march=$cpu"
  4978. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  4979. ;;
  4980. *)
  4981. cpuflags="-mcpu=$cpu"
  4982. case $cpu in
  4983. cortex-a*) subarch=armv7a ;;
  4984. cortex-r*) subarch=armv7r ;;
  4985. cortex-m*) enable thumb; subarch=armv7m ;;
  4986. arm11*) subarch=armv6 ;;
  4987. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  4988. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  4989. *) subarch=$(probe_arm_arch) ;;
  4990. esac
  4991. ;;
  4992. esac
  4993. case "$subarch" in
  4994. armv5t*) enable fast_clz ;;
  4995. armv[6-8]*)
  4996. enable fast_clz
  4997. disabled fast_unaligned || enable fast_unaligned
  4998. ;;
  4999. esac
  5000. test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee
  5001. elif enabled loongarch; then
  5002. enable simd_align_32
  5003. enable fast_64bit
  5004. enable fast_clz
  5005. enable fast_unaligned
  5006. case $cpu in
  5007. la464)
  5008. cpuflags="-march=$cpu"
  5009. ;;
  5010. esac
  5011. elif enabled mips; then
  5012. if [ "$cpu" != "generic" ]; then
  5013. disable mips32r2
  5014. disable mips32r5
  5015. disable mips64r2
  5016. disable mips32r6
  5017. disable mips64r6
  5018. disable loongson2
  5019. disable loongson3
  5020. disable mipsdsp
  5021. disable mipsdspr2
  5022. cpuflags="-march=$cpu"
  5023. case $cpu in
  5024. # General ISA levels
  5025. mips1|mips3)
  5026. ;;
  5027. mips32r2)
  5028. enable mips32r2
  5029. ;;
  5030. mips32r5)
  5031. enable mips32r2
  5032. enable mips32r5
  5033. ;;
  5034. mips64r2|mips64r5)
  5035. enable mips64r2
  5036. enable loongson3
  5037. ;;
  5038. # Cores from MIPS(MTI)
  5039. 24kc)
  5040. disable mipsfpu
  5041. enable mips32r2
  5042. ;;
  5043. 24kf*|24kec|34kc|74Kc|1004kc)
  5044. enable mips32r2
  5045. ;;
  5046. 24kef*|34kf*|1004kf*)
  5047. enable mipsdsp
  5048. enable mips32r2
  5049. ;;
  5050. p5600)
  5051. enable mips32r2
  5052. enable mips32r5
  5053. check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
  5054. ;;
  5055. i6400)
  5056. enable mips64r6
  5057. check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  5058. ;;
  5059. p6600)
  5060. enable mips64r6
  5061. check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  5062. ;;
  5063. # Cores from Loongson
  5064. loongson2e|loongson2f|loongson3*)
  5065. enable simd_align_16
  5066. enable fast_64bit
  5067. enable fast_clz
  5068. enable fast_cmov
  5069. enable fast_unaligned
  5070. disable aligned_stack
  5071. # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
  5072. if test "$cc_type" = "gcc"; then
  5073. case $gcc_basever in
  5074. 2|2.*|3.*|4.*|5.0|5.1|5.2)
  5075. expensive_optimization_flag="-fno-expensive-optimizations"
  5076. ;;
  5077. *)
  5078. expensive_optimization_flag=""
  5079. ;;
  5080. esac
  5081. fi
  5082. case $cpu in
  5083. loongson3*)
  5084. enable loongson3
  5085. cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
  5086. ;;
  5087. loongson2e)
  5088. enable loongson2
  5089. cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
  5090. ;;
  5091. loongson2f)
  5092. enable loongson2
  5093. cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
  5094. ;;
  5095. esac
  5096. ;;
  5097. *)
  5098. warn "unknown MIPS CPU"
  5099. ;;
  5100. esac
  5101. else
  5102. disable mipsdsp
  5103. disable mipsdspr2
  5104. # Disable DSP stuff for generic CPU, it can't be detected at runtime.
  5105. warn 'generic cpu selected'
  5106. fi
  5107. elif enabled ppc; then
  5108. disable ldbrx
  5109. case $(tolower $cpu) in
  5110. 601|ppc601|powerpc601)
  5111. cpuflags="-mcpu=601"
  5112. disable altivec
  5113. ;;
  5114. 603*|ppc603*|powerpc603*)
  5115. cpuflags="-mcpu=603"
  5116. disable altivec
  5117. ;;
  5118. 604*|ppc604*|powerpc604*)
  5119. cpuflags="-mcpu=604"
  5120. disable altivec
  5121. ;;
  5122. g3|75*|ppc75*|powerpc75*)
  5123. cpuflags="-mcpu=750"
  5124. disable altivec
  5125. ;;
  5126. g4|745*|ppc745*|powerpc745*)
  5127. cpuflags="-mcpu=7450"
  5128. disable vsx
  5129. ;;
  5130. 74*|ppc74*|powerpc74*)
  5131. cpuflags="-mcpu=7400"
  5132. disable vsx
  5133. ;;
  5134. g5|970|ppc970|powerpc970)
  5135. cpuflags="-mcpu=970"
  5136. disable vsx
  5137. ;;
  5138. power[3-6]*)
  5139. cpuflags="-mcpu=$cpu"
  5140. disable vsx
  5141. ;;
  5142. power[7-8]*)
  5143. cpuflags="-mcpu=$cpu"
  5144. ;;
  5145. cell)
  5146. cpuflags="-mcpu=cell"
  5147. enable ldbrx
  5148. disable vsx
  5149. ;;
  5150. e500mc)
  5151. cpuflags="-mcpu=e500mc"
  5152. disable altivec
  5153. ;;
  5154. e500v2)
  5155. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  5156. disable altivec
  5157. disable dcbzl
  5158. ;;
  5159. e500)
  5160. cpuflags="-mcpu=8540 -mhard-float"
  5161. disable altivec
  5162. disable dcbzl
  5163. ;;
  5164. esac
  5165. elif enabled riscv; then
  5166. check_headers asm/hwprobe.h
  5167. check_headers sys/hwprobe.h
  5168. if test_cpp_condition stddef.h "__riscv_zbb"; then
  5169. enable fast_clz
  5170. fi
  5171. if test_cpp_condition stddef.h "__riscv_zfhmin"; then
  5172. enable fast_float16
  5173. fi
  5174. elif enabled sparc; then
  5175. case $cpu in
  5176. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  5177. cpuflags="-mcpu=$cpu"
  5178. ;;
  5179. ultrasparc*|niagara[234])
  5180. cpuflags="-mcpu=$cpu"
  5181. ;;
  5182. esac
  5183. elif enabled x86; then
  5184. case $cpu in
  5185. i[345]86|pentium)
  5186. cpuflags="-march=$cpu"
  5187. disable i686
  5188. disable mmx
  5189. ;;
  5190. # targets that do NOT support nopl and conditional mov (cmov)
  5191. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  5192. cpuflags="-march=$cpu"
  5193. disable i686
  5194. ;;
  5195. # targets that do support conditional mov but on which it's slow
  5196. pentium4|pentium4m|prescott|nocona)
  5197. cpuflags="-march=$cpu"
  5198. enable i686
  5199. disable fast_cmov
  5200. ;;
  5201. # everything else should support nopl and conditional mov (cmov)
  5202. *)
  5203. cpuflags="-march=$cpu"
  5204. enable i686
  5205. enable fast_cmov
  5206. ;;
  5207. esac
  5208. else
  5209. if test_cpp_condition inttypes.h "UINTPTR_MAX >= UINT64_MAX"; then
  5210. enable fast_64bit
  5211. fi
  5212. fi
  5213. if [ "$cpu" != generic ]; then
  5214. add_cflags $cpuflags
  5215. add_asflags $cpuflags
  5216. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  5217. fi
  5218. # compiler sanity check
  5219. test_exec <<EOF
  5220. int main(void){ return 0; }
  5221. EOF
  5222. if test "$?" != 0; then
  5223. echo "$cc is unable to create an executable file."
  5224. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  5225. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  5226. echo "Only do this if you know what cross compiling means."
  5227. fi
  5228. die "C compiler test failed."
  5229. fi
  5230. add_cppflags -D_ISOC11_SOURCE
  5231. add_cxxflags -D__STDC_CONSTANT_MACROS
  5232. check_cxxflags_cc -std=$stdcxx ctype.h "__cplusplus >= 201103L" ||
  5233. { check_cxxflags -std=c++11 && stdcxx="c++11" || { check_cxxflags -std=c++0x && stdcxx="c++0x"; }; }
  5234. # some compilers silently accept -std=c11, so we also need to check that the
  5235. # version macro is defined properly
  5236. check_cflags_cc -std=$stdc ctype.h "__STDC_VERSION__ >= 201112L" ||
  5237. { check_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" && stdc="c11" || die "Compiler lacks C11 support"; }
  5238. test_cc <<EOF || die "Compiler lacks support for C11 static assertions"
  5239. #include <assert.h>
  5240. #include <stddef.h>
  5241. struct Foo {
  5242. int a;
  5243. void *ptr;
  5244. } obj;
  5245. static_assert(offsetof(struct Foo, a) == 0,
  5246. "First element of struct does not have offset 0");
  5247. _Static_assert(offsetof(struct Foo, ptr) >= offsetof(struct Foo, a) + sizeof(obj.a),
  5248. "elements not properly ordered in struct");
  5249. EOF
  5250. check_cppflags -D_FILE_OFFSET_BITS=64
  5251. check_cppflags -D_LARGEFILE_SOURCE
  5252. add_host_cppflags -D_ISOC11_SOURCE
  5253. check_host_cflags_cc -std=$stdc ctype.h "__STDC_VERSION__ >= 201112L" ||
  5254. check_host_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" || die "Host compiler lacks C11 support"
  5255. check_host_cflags -Wall
  5256. check_host_cflags $host_cflags_speed
  5257. check_64bit(){
  5258. arch32=$1
  5259. arch64=$2
  5260. expr=${3:-'sizeof(void *) > 4'}
  5261. test_code cc "" "int test[2*($expr) - 1]" &&
  5262. subarch=$arch64 || subarch=$arch32
  5263. enable $subarch
  5264. }
  5265. case "$arch" in
  5266. aarch64|ia64)
  5267. enabled shared && enable_weak pic
  5268. ;;
  5269. loongarch)
  5270. check_64bit loongarch32 loongarch64
  5271. enabled loongarch64 && disable loongarch32
  5272. enabled shared && enable_weak pic
  5273. ;;
  5274. mips)
  5275. check_64bit mips mips64 '_MIPS_SIM > 1'
  5276. enabled shared && enable_weak pic
  5277. ;;
  5278. parisc)
  5279. check_64bit parisc parisc64
  5280. enabled shared && enable_weak pic
  5281. ;;
  5282. ppc)
  5283. check_64bit ppc ppc64
  5284. enabled shared && enable_weak pic
  5285. ;;
  5286. riscv)
  5287. check_64bit riscv32 riscv64
  5288. enabled shared && enable_weak pic
  5289. ;;
  5290. s390)
  5291. check_64bit s390 s390x
  5292. enabled shared && enable_weak pic
  5293. ;;
  5294. sparc)
  5295. check_64bit sparc sparc64
  5296. enabled shared && enable_weak pic
  5297. ;;
  5298. x86)
  5299. check_64bit x86_32 x86_64
  5300. # Treat x32 as x64 for now. Note it also needs pic if shared
  5301. test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
  5302. subarch=x86_64 && enable x86_64 && disable x86_32
  5303. if enabled x86_64; then
  5304. enabled shared && enable_weak pic
  5305. objformat=elf64
  5306. fi
  5307. ;;
  5308. esac
  5309. # OS specific
  5310. case $target_os in
  5311. aix)
  5312. SHFLAGS=-shared
  5313. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  5314. enabled shared && add_ldflags -Wl,-brtl
  5315. arflags='-Xany -r -c'
  5316. striptype=""
  5317. ;;
  5318. android)
  5319. disable symver
  5320. enable section_data_rel_ro
  5321. add_cflags -fPIE
  5322. add_ldexeflags -fPIE -pie
  5323. SLIB_INSTALL_NAME='$(SLIBNAME)'
  5324. SLIB_INSTALL_LINKS=
  5325. SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
  5326. ;;
  5327. haiku)
  5328. prefix_default="/boot/common"
  5329. network_extralibs="-lnetwork"
  5330. host_extralibs=
  5331. ;;
  5332. sunos)
  5333. SHFLAGS='-shared -Wl,-h,$$(@F)'
  5334. enabled x86 && append SHFLAGS -mimpure-text
  5335. network_extralibs="-lsocket -lnsl"
  5336. add_cppflags -D__EXTENSIONS__
  5337. # When using suncc to build, the Solaris linker will mark
  5338. # an executable with each instruction set encountered by
  5339. # the Solaris assembler. As our libraries contain their own
  5340. # guards for processor-specific code, instead suppress
  5341. # generation of the HWCAPS ELF section on Solaris x86 only.
  5342. enabled_all suncc x86 &&
  5343. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  5344. add_ldflags -Wl,-M,mapfile
  5345. nm_default='nm -P -g'
  5346. striptype=""
  5347. version_script='-M'
  5348. VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
  5349. ;;
  5350. netbsd)
  5351. disable symver
  5352. enable section_data_rel_ro
  5353. oss_indev_extralibs="-lossaudio"
  5354. oss_outdev_extralibs="-lossaudio"
  5355. enabled gcc || check_ldflags -Wl,-zmuldefs
  5356. ;;
  5357. openbsd)
  5358. disable symver
  5359. enable section_data_rel_ro
  5360. striptype=""
  5361. SHFLAGS='-shared'
  5362. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  5363. SLIB_INSTALL_LINKS=
  5364. oss_indev_extralibs="-lossaudio"
  5365. oss_outdev_extralibs="-lossaudio"
  5366. ;;
  5367. dragonfly)
  5368. disable symver
  5369. ;;
  5370. freebsd)
  5371. enable section_data_rel_ro
  5372. ;;
  5373. bsd/os)
  5374. add_extralibs -lpoll -lgnugetopt
  5375. strip="strip -d"
  5376. ;;
  5377. darwin)
  5378. enabled ppc && add_asflags -force_cpusubtype_ALL
  5379. install_name_dir_default='$(SHLIBDIR)'
  5380. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  5381. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  5382. strip="${strip} -x"
  5383. add_ldflags -Wl,-dynamic,-search_paths_first
  5384. check_cflags -Werror=partial-availability
  5385. SLIBSUF=".dylib"
  5386. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  5387. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  5388. enabled x86_64 && objformat="macho64" || objformat="macho32"
  5389. enabled_any pic shared x86_64 ||
  5390. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  5391. check_headers dispatch/dispatch.h &&
  5392. add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
  5393. if test -n "$sysroot"; then
  5394. is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
  5395. is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
  5396. fi
  5397. version_script='-exported_symbols_list'
  5398. VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
  5399. # Workaround for Xcode 11 -fstack-check bug
  5400. if enabled clang; then
  5401. clang_version=$($cc -dumpversion)
  5402. test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check
  5403. fi
  5404. ;;
  5405. msys*)
  5406. die "Native MSYS builds are discouraged, please use the MINGW environment."
  5407. ;;
  5408. mingw32*|mingw64*)
  5409. target_os=mingw32
  5410. LIBTARGET=i386
  5411. if enabled x86_64; then
  5412. LIBTARGET="i386:x86-64"
  5413. elif enabled arm; then
  5414. LIBTARGET="arm"
  5415. elif enabled aarch64; then
  5416. LIBTARGET="arm64"
  5417. fi
  5418. if enabled shared; then
  5419. # Cannot build both shared and static libs when using dllimport.
  5420. disable static
  5421. fi
  5422. ! enabled small && test_cmd $windres --version && enable gnu_windres
  5423. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  5424. add_cppflags -DWIN32_LEAN_AND_MEAN
  5425. shlibdir_default="$bindir_default"
  5426. SLIBPREF=""
  5427. SLIBSUF=".dll"
  5428. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5429. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5430. if test_cmd lib.exe -list; then
  5431. SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  5432. if enabled x86_64; then
  5433. LIBTARGET=x64
  5434. fi
  5435. else
  5436. SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  5437. fi
  5438. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5439. SLIB_INSTALL_LINKS=
  5440. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  5441. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  5442. SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  5443. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
  5444. enabled x86_64 && objformat="win64" || objformat="win32"
  5445. dlltool="${cross_prefix}dlltool"
  5446. ranlib=:
  5447. enable dos_paths
  5448. check_ldflags -Wl,--nxcompat,--dynamicbase
  5449. # Lets work around some stupidity in binutils.
  5450. # ld will strip relocations from executables even though we need them
  5451. # for dynamicbase (ASLR). Using -pie does retain the reloc section
  5452. # however ld then forgets what the entry point should be (oops) so we
  5453. # have to manually (re)set it.
  5454. if enabled x86_32; then
  5455. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
  5456. elif enabled x86_64; then
  5457. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
  5458. check_ldflags -Wl,--high-entropy-va # binutils 2.25
  5459. # Set image base >4GB for extra entropy with HEASLR
  5460. add_ldexeflags -Wl,--image-base,0x140000000
  5461. append SHFLAGS -Wl,--image-base,0x180000000
  5462. fi
  5463. ;;
  5464. win32|win64)
  5465. disable symver
  5466. if enabled shared; then
  5467. # Link to the import library instead of the normal static library
  5468. # for shared libs.
  5469. LD_LIB='%.lib'
  5470. # Cannot build both shared and static libs with MSVC or icl.
  5471. disable static
  5472. fi
  5473. ! enabled small && test_cmd $windres --version && enable gnu_windres
  5474. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  5475. add_cppflags -DWIN32_LEAN_AND_MEAN
  5476. shlibdir_default="$bindir_default"
  5477. SLIBPREF=""
  5478. SLIBSUF=".dll"
  5479. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5480. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5481. SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  5482. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5483. SLIB_INSTALL_LINKS=
  5484. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  5485. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  5486. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  5487. enabled x86_64 && objformat="win64" || objformat="win32"
  5488. ranlib=:
  5489. enable dos_paths
  5490. ;;
  5491. cygwin*)
  5492. target_os=cygwin
  5493. shlibdir_default="$bindir_default"
  5494. SLIBPREF="cyg"
  5495. SLIBSUF=".dll"
  5496. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5497. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5498. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5499. SLIB_INSTALL_LINKS=
  5500. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  5501. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  5502. enabled x86_64 && objformat="win64" || objformat="win32"
  5503. enable dos_paths
  5504. ! enabled small && test_cmd $windres --version && enable gnu_windres
  5505. add_cppflags -DWIN32_LEAN_AND_MEAN
  5506. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5507. ;;
  5508. *-dos|freedos|opendos)
  5509. network_extralibs="-lsocket"
  5510. objformat="coff"
  5511. enable dos_paths
  5512. ;;
  5513. linux)
  5514. enable section_data_rel_ro
  5515. enabled_any arm aarch64 && enable_weak linux_perf
  5516. ;;
  5517. irix*)
  5518. target_os=irix
  5519. ranlib="echo ignoring ranlib"
  5520. ;;
  5521. os/2*)
  5522. strip="lxlite -CS"
  5523. striptype=""
  5524. objformat="aout"
  5525. add_cppflags -D_GNU_SOURCE
  5526. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
  5527. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  5528. LIBSUF="_s.a"
  5529. SLIBPREF=""
  5530. SLIBSUF=".dll"
  5531. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5532. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  5533. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
  5534. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
  5535. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
  5536. echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
  5537. emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
  5538. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
  5539. emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
  5540. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5541. SLIB_INSTALL_LINKS=
  5542. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
  5543. enable dos_paths
  5544. enable_weak os2threads
  5545. ;;
  5546. gnu/kfreebsd)
  5547. add_cppflags -D_BSD_SOURCE
  5548. ;;
  5549. gnu)
  5550. ;;
  5551. qnx)
  5552. add_cppflags -D_QNX_SOURCE
  5553. network_extralibs="-lsocket"
  5554. ;;
  5555. symbian)
  5556. SLIBSUF=".dll"
  5557. enable dos_paths
  5558. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  5559. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  5560. add_ldflags -Wl,--target1-abs,--no-undefined \
  5561. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  5562. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  5563. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  5564. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  5565. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  5566. ;;
  5567. minix)
  5568. ;;
  5569. none)
  5570. ;;
  5571. *)
  5572. die "Unknown OS '$target_os'."
  5573. ;;
  5574. esac
  5575. # test if creating links works
  5576. link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
  5577. link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
  5578. mkdir "$link_dest"
  5579. $ln_s "$link_dest" "$link_name"
  5580. touch "$link_dest/test_file"
  5581. if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
  5582. # create link to source path
  5583. [ -e src ] && rm src
  5584. $ln_s "$source_path" src
  5585. source_link=src
  5586. else
  5587. # creating directory links doesn't work
  5588. # fall back to using the full source path
  5589. source_link="$source_path"
  5590. fi
  5591. # cleanup
  5592. rm -r "$link_dest"
  5593. rm -r "$link_name"
  5594. # determine libc flavour
  5595. probe_libc(){
  5596. pfx=$1
  5597. pfx_no_=${pfx%_}
  5598. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  5599. if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  5600. eval ${pfx}libc_type=uclibc
  5601. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5602. elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  5603. eval ${pfx}libc_type=glibc
  5604. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5605. # MinGW headers can be installed on Cygwin, so check for newlib first.
  5606. elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  5607. eval ${pfx}libc_type=newlib
  5608. add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
  5609. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  5610. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  5611. eval ${pfx}libc_type=mingw64
  5612. if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  5613. add_compat msvcrt/snprintf.o
  5614. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  5615. fi
  5616. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5617. eval test \$${pfx_no_}cc_type = "gcc" &&
  5618. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5619. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5620. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5621. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5622. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  5623. test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  5624. eval ${pfx}libc_type=mingw32
  5625. test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  5626. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  5627. die "ERROR: MinGW32 runtime version must be >= 3.15."
  5628. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5629. test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
  5630. add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
  5631. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5632. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5633. eval test \$${pfx_no_}cc_type = "gcc" &&
  5634. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5635. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5636. elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  5637. eval ${pfx}libc_type=msvcrt
  5638. if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  5639. if [ "$pfx" = host_ ]; then
  5640. add_host_cppflags -Dsnprintf=_snprintf
  5641. else
  5642. add_compat strtod.o strtod=avpriv_strtod
  5643. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  5644. _snprintf=avpriv_snprintf \
  5645. vsnprintf=avpriv_vsnprintf
  5646. fi
  5647. fi
  5648. add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
  5649. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  5650. # 0x601 by default unless something else is set by the user.
  5651. # This can easily lead to us detecting functions only present
  5652. # in such new versions and producing binaries requiring windows 7.0.
  5653. # Therefore explicitly set the default to Vista unless the user has
  5654. # set something else on the command line.
  5655. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  5656. # family. For these cases, configure is free to use any functions
  5657. # found in the SDK headers by default. (Alternatively, we could force
  5658. # _WIN32_WINNT to 0x0602 in that case.)
  5659. test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  5660. { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
  5661. #ifdef WINAPI_FAMILY
  5662. #include <winapifamily.h>
  5663. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5664. #error not desktop
  5665. #endif
  5666. #endif
  5667. EOF
  5668. if [ "$pfx" = "" ]; then
  5669. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  5670. check_func strtoull || add_cflags -Dstrtoull=_strtoui64
  5671. fi
  5672. elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  5673. eval ${pfx}libc_type=klibc
  5674. elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  5675. eval ${pfx}libc_type=bionic
  5676. elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  5677. eval ${pfx}libc_type=solaris
  5678. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  5679. elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
  5680. eval ${pfx}libc_type=djgpp
  5681. add_cppflags -U__STRICT_ANSI__
  5682. add_cflags "-include $source_path/compat/djgpp/math.h"
  5683. add_compat djgpp/math.o
  5684. fi
  5685. test_${pfx}cc <<EOF
  5686. #include <time.h>
  5687. void *v = localtime_r;
  5688. EOF
  5689. test "$?" != 0 && test_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5690. #include <time.h>
  5691. void *v = localtime_r;
  5692. EOF
  5693. eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
  5694. }
  5695. probe_libc
  5696. probe_libc host_
  5697. # hacks for compiler/libc/os combinations
  5698. case $libc_type in
  5699. bionic)
  5700. add_compat strtod.o strtod=avpriv_strtod
  5701. ;;
  5702. esac
  5703. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  5704. add_cppflags '-I\$(SRC_PATH)/compat/float'
  5705. test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  5706. set_default libdir
  5707. : ${shlibdir_default:="$libdir"}
  5708. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  5709. set_default $PATHS_LIST
  5710. set_default nm
  5711. disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
  5712. enable_weak_pic() {
  5713. disabled pic && return
  5714. enable pic
  5715. add_cppflags -DPIC
  5716. case "$target_os" in
  5717. mingw*|cygwin*|win*)
  5718. ;;
  5719. *)
  5720. add_cflags -fPIC
  5721. add_asflags -fPIC
  5722. ;;
  5723. esac
  5724. }
  5725. enabled pic && enable_weak_pic
  5726. test_cc <<EOF || die "Symbol mangling check failed."
  5727. int ff_extern;
  5728. EOF
  5729. sym=$($nm $TMPO | awk '/[ \t]+[^ \t]?ff_extern$/{ print substr($0, match($0, /[^ \t]?ff_extern$/)) }')
  5730. extern_prefix=${sym%%ff_extern*}
  5731. log "Symbol prefix detected as: '${extern_prefix}'"
  5732. ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
  5733. check_cc pragma_deprecated "" '_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
  5734. test_cpp_condition stdlib.h "defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)" && enable bigendian
  5735. check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
  5736. if ! enabled ppc64 || enabled bigendian; then
  5737. disable vsx
  5738. fi
  5739. check_gas() {
  5740. log "check_gas using '$as' as AS"
  5741. # :vararg is used on aarch64, arm and ppc altivec
  5742. check_as vararg "
  5743. .macro m n, y:vararg=0
  5744. \n: .int \y
  5745. .endm
  5746. m x" || return 1
  5747. # .altmacro is only used in arm asm
  5748. ! enabled arm || check_as gnu_as ".altmacro"
  5749. }
  5750. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  5751. nogas=:
  5752. enabled_any arm aarch64 && nogas=die
  5753. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  5754. as_noop=-v
  5755. case $as_type in
  5756. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  5757. gcc) gaspp_as_type=gas ;;
  5758. *) gaspp_as_type=$as_type ;;
  5759. esac
  5760. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  5761. test "${as#*gas-preprocessor.pl}" != "$as" ||
  5762. test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  5763. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  5764. if ! check_gas ; then
  5765. as=${gas:=$as}
  5766. check_gas || \
  5767. $nogas "GNU assembler not found, install/update gas-preprocessor"
  5768. fi
  5769. check_as as_func ".func test
  5770. .endfunc"
  5771. fi
  5772. check_inline_asm inline_asm_labels '"1:\n"'
  5773. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  5774. if enabled aarch64; then
  5775. as_arch_level="armv8-a"
  5776. check_as as_arch_directive ".arch $as_arch_level"
  5777. if enabled as_arch_directive; then
  5778. # Check for higher .arch levels. We only need armv8.2-a in order to
  5779. # enable the extensions we want below - we primarily want to control
  5780. # them via .arch_extension. However:
  5781. #
  5782. # Clang before version 17 (Xcode versions up to and including 15.0)
  5783. # didn't support controlling the dotprod/i8mm extensions via
  5784. # .arch_extension; thus try to enable them via the .arch level as well.
  5785. for level in armv8.2-a armv8.4-a armv8.6-a; do
  5786. check_arch_level $level
  5787. done
  5788. # Clang before version 17 (Xcode versions up to and including 15.0)
  5789. # also had a bug (https://github.com/llvm/llvm-project/issues/32220)
  5790. # causing a plain ".arch <level>" to not have any effect unless it
  5791. # had an extra "+<feature>" included - but it was activated on the next
  5792. # ".arch_extension" directive. Check if we can include "+crc" as dummy
  5793. # feature to make the .arch directive behave as expected and take
  5794. # effect right away.
  5795. check_arch_level "${as_arch_level}+crc"
  5796. fi
  5797. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  5798. # internal assembler in clang 3.3 does not support this instruction
  5799. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  5800. archext_list="dotprod i8mm sve sve2"
  5801. enabled dotprod && check_archext_insn dotprod 'udot v0.4s, v0.16b, v0.16b'
  5802. enabled i8mm && check_archext_insn i8mm 'usdot v0.4s, v0.16b, v0.16b'
  5803. enabled sve && check_archext_insn sve 'whilelt p0.s, x0, x1'
  5804. enabled sve2 && check_archext_insn sve2 'sqrdmulh z0.s, z0.s, z0.s'
  5805. # Disable the main feature (e.g. HAVE_NEON) if neither inline nor external
  5806. # assembly support the feature out of the box. Skip this for the features
  5807. # checked with check_archext_insn above, as that function takes care of
  5808. # updating all the variables as necessary.
  5809. for v in $ARCH_EXT_LIST_ARM; do
  5810. is_in $v $archext_list && continue
  5811. enabled_any ${v}_external ${v}_inline || disable $v
  5812. done
  5813. elif enabled arm; then
  5814. enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
  5815. test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
  5816. float func(float a, float b){ return a+b; }
  5817. EOF
  5818. enabled thumb && check_cflags -mthumb || check_cflags -marm
  5819. if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
  5820. :
  5821. elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  5822. :
  5823. elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  5824. case "${cross_prefix:-$cc}" in
  5825. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  5826. *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
  5827. __asm__ (".eabi_attribute 28, 1");
  5828. int main(void) { return 0; }
  5829. EOF
  5830. esac
  5831. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  5832. fi
  5833. # Test for various instruction sets, testing support both in inline and
  5834. # external assembly. This sets the ${v}_inline or ${v}_external flags
  5835. # if the instruction can be used unconditionally in either inline or
  5836. # external assembly. This means that if the ${v}_external feature is set,
  5837. # that feature can be used unconditionally in various support macros
  5838. # anywhere in external assembly, in any function.
  5839. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  5840. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  5841. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  5842. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  5843. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  5844. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  5845. enabled setend && check_insn setend 'setend be'
  5846. # If neither inline nor external assembly can use the feature by default,
  5847. # disable the main unsuffixed feature (e.g. HAVE_NEON).
  5848. #
  5849. # For targets that support runtime CPU feature detection, don't disable
  5850. # the main feature flag - there we assume that all supported toolchains
  5851. # can assemble code for all instruction set features (e.g. NEON) with
  5852. # suitable assembly flags (such as ".fpu neon"); we don't check
  5853. # specifically that they really do.
  5854. [ $target_os = linux ] || [ $target_os = android ] ||
  5855. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  5856. $ARCH_EXT_LIST_ARM
  5857. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  5858. check_as as_arch_directive ".arch armv7-a"
  5859. check_as as_dn_directive "ra .dn d0.i16"
  5860. check_as as_fpu_directive ".fpu neon"
  5861. # llvm's integrated assembler supports .object_arch from llvm 3.5
  5862. [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
  5863. check_as as_object_arch ".object_arch armv4"
  5864. # MS armasm fails to assemble our PIC constructs
  5865. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  5866. elif enabled mips; then
  5867. # Check toolchain ISA level
  5868. if enabled mips64; then
  5869. enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' &&
  5870. disable mips64r2
  5871. enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
  5872. disable mips32r6 && disable mips32r5 && disable mips32r2
  5873. else
  5874. enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' &&
  5875. disable mips32r5 && disable mips32r2
  5876. enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"'
  5877. enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
  5878. disable mips64r6 && disable mips64r5 && disable mips64r2
  5879. fi
  5880. enabled mipsfpu && check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
  5881. enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
  5882. enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
  5883. enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
  5884. # MSA can be detected at runtime so we supply extra flags here
  5885. enabled mipsfpu && enabled msa && check_inline_asm msa '"addvi.b $w0, $w1, 1"' '-mmsa' && append MSAFLAGS '-mmsa'
  5886. # loongson2 have no switch cflag so we can only probe toolchain ability
  5887. enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"' && disable loongson3
  5888. # loongson3 is paired with MMI
  5889. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext'
  5890. # MMI can be detected at runtime too
  5891. enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi'
  5892. if enabled bigendian && enabled msa; then
  5893. disable msa
  5894. fi
  5895. elif enabled parisc; then
  5896. if enabled gcc; then
  5897. case $($cc -dumpversion) in
  5898. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  5899. esac
  5900. fi
  5901. elif enabled ppc; then
  5902. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  5903. check_inline_asm ibm_asm '"add 0, 0, 0"'
  5904. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  5905. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  5906. if enabled altivec; then
  5907. check_cflags -maltivec -mabi=altivec
  5908. # check if our compiler supports Motorola AltiVec C API
  5909. check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
  5910. vector signed int v2 = (vector signed int) { 1 };
  5911. v1 = vec_add(v1, v2);"
  5912. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  5913. fi
  5914. if enabled vsx; then
  5915. check_cflags -mvsx &&
  5916. check_cc vsx altivec.h "int v[4] = { 0 };
  5917. vector signed int v1 = vec_vsx_ld(0, v);"
  5918. fi
  5919. if enabled power8; then
  5920. check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
  5921. fi
  5922. if enabled altivec; then
  5923. check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
  5924. vector unsigned char y0 = vec_xl(0, y1i);"
  5925. fi
  5926. elif enabled riscv; then
  5927. enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
  5928. enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"'
  5929. enabled rv_zicbop && check_inline_asm rv_zicbop '".option arch, +zicbop\nprefetch.r 64(a0)"'
  5930. enabled rv_zvbb && check_inline_asm rv_zvbb '".option arch, +zvbb\nvclz.v v0, v8"'
  5931. elif enabled wasm; then
  5932. enabled simd128 && check_cc simd128 wasm_simd128.h "v128_t v = wasm_v128_load(0);"
  5933. elif enabled x86; then
  5934. check_builtin rdtsc intrin.h "__rdtsc()"
  5935. check_builtin mm_empty mmintrin.h "_mm_empty()"
  5936. # check whether EBP is available on x86
  5937. # As 'i' is stored on the stack, this program will crash
  5938. # if the base pointer is used to access it because the
  5939. # base pointer is cleared in the inline assembly code.
  5940. check_exec_crash <<EOF && enable ebp_available
  5941. volatile int i=0;
  5942. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  5943. return i;
  5944. EOF
  5945. # check whether EBX is available on x86
  5946. check_inline_asm ebx_available '""::"b"(0)' &&
  5947. check_inline_asm ebx_available '"":::"%ebx"'
  5948. # check whether xmm clobbers are supported
  5949. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  5950. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  5951. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  5952. # check whether binutils is new enough to compile SSSE3/MMXEXT
  5953. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  5954. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  5955. probe_x86asm(){
  5956. x86asmexe_probe=$1
  5957. if test_cmd $x86asmexe_probe -v; then
  5958. x86asmexe=$x86asmexe_probe
  5959. x86asm_debug="-g -F dwarf"
  5960. X86ASMDEP=
  5961. X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
  5962. fi
  5963. check_x86asm x86asm "movbe ecx, [5]"
  5964. }
  5965. if ! disabled_any asm mmx x86asm; then
  5966. disable x86asm
  5967. for program in $x86asmexe nasm; do
  5968. probe_x86asm $program && break
  5969. done
  5970. disabled x86asm && die "nasm not found or too old. Please install/update nasm or use --disable-x86asm for a build without hand-optimized assembly."
  5971. X86ASMFLAGS="-f $objformat"
  5972. test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
  5973. case "$objformat" in
  5974. elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
  5975. esac
  5976. enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
  5977. enabled avx512icl && check_x86asm avx512icl_external "vpdpwssds zmm31{k1}{z}, zmm29, zmm28"
  5978. enabled avx2 && check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
  5979. enabled xop && check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
  5980. enabled fma4 && check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
  5981. fi
  5982. case "$cpu" in
  5983. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  5984. disable fast_clz
  5985. ;;
  5986. esac
  5987. elif enabled loongarch; then
  5988. enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr2"' '-mlsx' && append LSXFLAGS '-mlsx'
  5989. enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr2"' '-mlasx' && append LASXFLAGS '-mlasx'
  5990. fi
  5991. check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
  5992. check_cc intrinsics_sse2 emmintrin.h "__m128i test = _mm_setzero_si128()"
  5993. check_ldflags -Wl,--as-needed
  5994. check_ldflags -Wl,-z,noexecstack
  5995. if [ $target_os = "darwin" ]; then
  5996. check_ldflags -Wl,-no_warn_duplicate_libraries
  5997. fi
  5998. if ! disabled network; then
  5999. check_func getaddrinfo $network_extralibs
  6000. check_func inet_aton $network_extralibs
  6001. check_type netdb.h "struct addrinfo"
  6002. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  6003. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  6004. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  6005. check_type poll.h "struct pollfd"
  6006. check_type netinet/sctp.h "struct sctp_event_subscribe"
  6007. check_struct "sys/socket.h" "struct msghdr" msg_flags
  6008. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  6009. check_type netinet/in.h "struct sockaddr_in6"
  6010. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  6011. check_type "sys/types.h sys/socket.h" socklen_t
  6012. # Prefer arpa/inet.h over winsock2
  6013. if check_headers arpa/inet.h ; then
  6014. check_func closesocket
  6015. elif check_headers winsock2.h ; then
  6016. check_func_headers winsock2.h closesocket -lws2 &&
  6017. network_extralibs="-lws2" ||
  6018. { check_func_headers winsock2.h closesocket -lws2_32 &&
  6019. network_extralibs="-lws2_32"; } || disable winsock2_h network
  6020. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  6021. check_type ws2tcpip.h socklen_t
  6022. check_type ws2tcpip.h "struct addrinfo"
  6023. check_type ws2tcpip.h "struct group_source_req"
  6024. check_type ws2tcpip.h "struct ip_mreq_source"
  6025. check_type ws2tcpip.h "struct ipv6_mreq"
  6026. check_type winsock2.h "struct pollfd"
  6027. check_struct winsock2.h "struct sockaddr" sa_len
  6028. check_type ws2tcpip.h "struct sockaddr_in6"
  6029. check_type ws2tcpip.h "struct sockaddr_storage"
  6030. else
  6031. disable network
  6032. fi
  6033. fi
  6034. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  6035. check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
  6036. check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
  6037. check_builtin float16 "" "_Float16 f16var"
  6038. if enabled float16; then
  6039. if enabled x86; then
  6040. test_cpp_condition stddef.h "defined(__F16C__)" && enable fast_float16
  6041. elif enabled arm || enabled aarch64; then
  6042. enable fast_float16
  6043. fi
  6044. fi
  6045. case "$custom_allocator" in
  6046. "")
  6047. ;;
  6048. jemalloc)
  6049. test -n "$malloc_prefix" ||
  6050. malloc_prefix=$($pkg_config --variable=jemalloc_prefix $pkg_config_flags jemalloc 2>/dev/null)
  6051. require_pkg_config custom_allocator jemalloc jemalloc/jemalloc.h ${malloc_prefix}malloc
  6052. ;;
  6053. tcmalloc)
  6054. require_pkg_config custom_allocator libtcmalloc gperftools/tcmalloc.h tc_malloc
  6055. malloc_prefix=tc_
  6056. ;;
  6057. *)
  6058. require_pkg_config custom_allocator "$custom_allocator" stdlib.h malloc
  6059. ;;
  6060. esac
  6061. if test -n "$custom_allocator"; then
  6062. add_extralibs "$custom_allocator_extralibs"
  6063. fi
  6064. # Unlike other feature flags or libraries, spirv_compiler is not defined
  6065. # within any of our predefined categories of components.
  6066. # It gets defined if either libshaderc or libglslang check succeeds.
  6067. # As such, its in a state of neither being explicitly enabled, nor
  6068. # explicitly disabled, but even in this state, being mentioned in
  6069. # _deps results in it always passing.
  6070. # Disable it explicitly to fix this.
  6071. disable spirv_compiler
  6072. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  6073. check_func ${malloc_prefix}memalign && enable memalign
  6074. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  6075. check_func access
  6076. check_func_headers stdlib.h arc4random_buf
  6077. check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
  6078. check_func fcntl
  6079. check_func fork
  6080. check_func gethrtime
  6081. check_func getopt
  6082. check_func getrusage
  6083. check_func gettimeofday
  6084. check_func isatty
  6085. check_func mkstemp
  6086. check_func mmap
  6087. check_func mprotect
  6088. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  6089. check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
  6090. check_func_headers sys/prctl.h prctl
  6091. check_func sched_getaffinity
  6092. check_func setrlimit
  6093. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  6094. check_func strerror_r
  6095. check_func sysconf
  6096. check_func sysctl
  6097. check_func tempnam
  6098. check_func usleep
  6099. check_func_headers conio.h kbhit
  6100. check_func_headers io.h setmode
  6101. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  6102. check_func_headers mach/mach_time.h mach_absolute_time
  6103. check_func_headers stdlib.h getenv
  6104. check_func_headers sys/stat.h lstat
  6105. check_func_headers sys/auxv.h getauxval
  6106. check_func_headers sys/auxv.h elf_aux_info
  6107. check_func_headers sys/sysctl.h sysctlbyname
  6108. check_func_headers windows.h GetModuleHandle
  6109. check_func_headers windows.h GetProcessAffinityMask
  6110. check_func_headers windows.h GetProcessTimes
  6111. check_func_headers windows.h GetStdHandle
  6112. check_func_headers windows.h GetSystemTimeAsFileTime
  6113. check_func_headers windows.h LoadLibrary
  6114. check_func_headers windows.h MapViewOfFile
  6115. check_func_headers windows.h PeekNamedPipe
  6116. check_func_headers windows.h SetConsoleTextAttribute
  6117. check_func_headers windows.h SetConsoleCtrlHandler
  6118. check_func_headers windows.h SetDllDirectory
  6119. check_func_headers windows.h Sleep
  6120. check_func_headers windows.h VirtualAlloc
  6121. check_func_headers glob.h glob
  6122. if enabled xlib; then
  6123. check_pkg_config xlib_x11 x11 "X11/Xlib.h" XPending ||
  6124. check_lib xlib_x11 "X11/Xlib.h" XPending -lX11 ||
  6125. disable xlib
  6126. check_pkg_config xlib_xext xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach ||
  6127. check_lib xlib_xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach -lXext ||
  6128. disable xlib
  6129. check_pkg_config xlib_xv xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute ||
  6130. check_lib xlib_xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv ||
  6131. disable xlib
  6132. fi
  6133. check_headers direct.h
  6134. check_headers dirent.h
  6135. check_headers dxgidebug.h
  6136. check_headers dxva.h
  6137. check_headers dxva2api.h -D_WIN32_WINNT=0x0600
  6138. check_headers io.h
  6139. enabled libdrm &&
  6140. check_headers linux/dma-buf.h
  6141. check_headers linux/perf_event.h
  6142. check_headers malloc.h
  6143. check_headers mftransform.h
  6144. check_headers net/udplite.h
  6145. check_headers poll.h
  6146. check_headers pthread_np.h
  6147. check_headers sys/param.h
  6148. check_headers sys/resource.h
  6149. check_headers sys/select.h
  6150. check_headers sys/time.h
  6151. check_headers sys/un.h
  6152. check_headers termios.h
  6153. check_headers unistd.h
  6154. check_headers valgrind/valgrind.h
  6155. check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
  6156. check_func_headers VideoToolbox/VideoToolbox.h VTPixelTransferSessionCreate -framework VideoToolbox
  6157. check_func_headers VideoToolbox/VideoToolbox.h VTPixelRotationSessionCreate -framework VideoToolbox
  6158. check_headers windows.h
  6159. check_headers asm/types.h
  6160. # it seems there are versions of clang in some distros that try to use the
  6161. # gcc headers, which explodes for stdatomic
  6162. # so we also check that atomics actually work here
  6163. #
  6164. # some configurations also require linking to libatomic, so try
  6165. # both with -latomic and without
  6166. for LATOMIC in "-latomic" ""; do
  6167. check_builtin stdatomic stdatomic.h \
  6168. "atomic_int foo, bar = -1; atomic_store(&foo, 0); foo += bar" \
  6169. $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
  6170. done
  6171. check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
  6172. check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
  6173. check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
  6174. check_lib ole32 "windows.h objbase.h" CoTaskMemFree -lole32
  6175. check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  6176. check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  6177. check_lib android android/native_window.h ANativeWindow_acquire -landroid
  6178. check_lib mediandk "stdint.h media/NdkMediaFormat.h" AMediaFormat_new -lmediandk
  6179. check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
  6180. enabled appkit && check_apple_framework AppKit
  6181. enabled audiotoolbox && check_apple_framework AudioToolbox
  6182. enabled avfoundation && check_apple_framework AVFoundation
  6183. enabled coreimage && check_apple_framework CoreImage
  6184. enabled metal && check_apple_framework Metal
  6185. enabled videotoolbox && check_apple_framework VideoToolbox
  6186. check_apple_framework CoreFoundation
  6187. check_apple_framework CoreMedia
  6188. check_apple_framework CoreVideo
  6189. check_apple_framework CoreAudio
  6190. enabled avfoundation && {
  6191. disable coregraphics applicationservices
  6192. check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
  6193. check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
  6194. enabled videotoolbox && {
  6195. check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
  6196. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
  6197. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia"
  6198. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_VP9 "-framework CoreMedia"
  6199. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_AV1 "-framework CoreMedia"
  6200. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  6201. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
  6202. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  6203. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
  6204. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
  6205. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  6206. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
  6207. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo"
  6208. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo"
  6209. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo"
  6210. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferYCbCrMatrix_ITU_R_2020 "-framework CoreVideo"
  6211. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 "-framework CoreVideo"
  6212. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2020 "-framework CoreVideo"
  6213. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_428_1 "-framework CoreVideo"
  6214. check_func_headers VideoToolbox/VTCompressionProperties.h kVTQPModulationLevel_Default "-framework CoreVideo"
  6215. }
  6216. enabled metal && test_cmd $metalcc -v || disable metal
  6217. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  6218. check_type "windows.h dxva.h" "DXVA_PicParams_AV1" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6219. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6220. check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6221. check_type "windows.h dxgi1_2.h" "DXGI_OUTDUPL_FRAME_INFO"
  6222. check_type "windows.h dxgi1_2.h" "IDXGIOutput1"
  6223. check_type "windows.h dxgi1_5.h" "IDXGIOutput5"
  6224. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  6225. check_type "windows.h d3d11.h" "ID3D11VideoContext"
  6226. check_type "windows.h d3d12.h" "ID3D12Device"
  6227. check_type "windows.h d3d12video.h" "ID3D12VideoDecoder"
  6228. check_type "windows.h d3d12video.h" "ID3D12VideoEncoder"
  6229. test_code cc "windows.h d3d12video.h" "D3D12_FEATURE_VIDEO feature = D3D12_FEATURE_VIDEO_ENCODER_CODEC" && \
  6230. test_code cc "windows.h d3d12video.h" "D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS req" && enable d3d12_encoder_feature
  6231. check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00
  6232. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  6233. check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat
  6234. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  6235. check_type "vdpau/vdpau.h" "VdpPictureInfoVP9"
  6236. check_type "vdpau/vdpau.h" "VdpPictureInfoAV1"
  6237. if [ -z "$nvccflags" ]; then
  6238. nvccflags=$nvccflags_default
  6239. fi
  6240. nvccflags="$nvccflags -std=c++11"
  6241. if enabled x86_64 || enabled ppc64 || enabled aarch64; then
  6242. nvccflags="$nvccflags -m64"
  6243. else
  6244. nvccflags="$nvccflags -m32"
  6245. fi
  6246. if enabled cuda_nvcc; then
  6247. nvccflags="$nvccflags -ptx"
  6248. else
  6249. nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -Wno-c++11-narrowing -include ${source_link}/compat/cuda/cuda_runtime.h"
  6250. check_nvcc cuda_llvm
  6251. fi
  6252. if ! disabled ffnvcodec; then
  6253. ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
  6254. check_pkg_config ffnvcodec "ffnvcodec >= 12.1.14.0" "$ffnv_hdr_list" "" || \
  6255. check_pkg_config ffnvcodec "ffnvcodec >= 12.0.16.1 ffnvcodec < 12.1" "$ffnv_hdr_list" "" || \
  6256. check_pkg_config ffnvcodec "ffnvcodec >= 11.1.5.3 ffnvcodec < 12.0" "$ffnv_hdr_list" "" || \
  6257. check_pkg_config ffnvcodec "ffnvcodec >= 11.0.10.3 ffnvcodec < 11.1" "$ffnv_hdr_list" "" || \
  6258. check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.15 ffnvcodec < 8.2" "$ffnv_hdr_list" ""
  6259. fi
  6260. if enabled_all libglslang libshaderc; then
  6261. die "ERROR: libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang"
  6262. fi
  6263. check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
  6264. if ! disabled w32threads && ! enabled pthreads; then
  6265. check_func_headers "windows.h process.h" _beginthreadex &&
  6266. check_type "windows.h" CONDITION_VARIABLE &&
  6267. check_type "windows.h" INIT_ONCE &&
  6268. enable w32threads || disable w32threads
  6269. if ! enabled w32threads && enabled winrt; then
  6270. check_func_headers "windows.h" CreateThread &&
  6271. enable w32threads || disable w32threads
  6272. fi
  6273. fi
  6274. # check for some common methods of building with pthread support
  6275. # do this before the optional library checks as some of them require pthreads
  6276. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  6277. if check_lib pthreads pthread.h pthread_join -pthread &&
  6278. check_lib pthreads pthread.h pthread_create -pthread; then
  6279. add_cflags -pthread
  6280. elif check_lib pthreads pthread.h pthread_join -pthreads &&
  6281. check_lib pthreads pthread.h pthread_create -pthreads; then
  6282. add_cflags -pthreads
  6283. elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
  6284. check_lib pthreads pthread.h pthread_create -ldl -pthread; then
  6285. add_cflags -ldl -pthread
  6286. elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
  6287. check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
  6288. :
  6289. elif check_lib pthreads pthread.h pthread_join -lpthread &&
  6290. check_lib pthreads pthread.h pthread_create -lpthread; then
  6291. :
  6292. elif check_func pthread_join && check_func pthread_create; then
  6293. enable pthreads
  6294. fi
  6295. check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
  6296. if enabled pthreads; then
  6297. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
  6298. check_func pthread_cancel $pthreads_extralibs
  6299. hdrs=pthread.h
  6300. if enabled pthread_np_h; then
  6301. hdrs="$hdrs pthread_np.h"
  6302. fi
  6303. check_lib pthread_set_name_np "$hdrs" pthread_set_name_np -lpthread
  6304. check_lib pthread_setname_np "$hdrs" pthread_setname_np -lpthread
  6305. fi
  6306. fi
  6307. enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
  6308. check_lib zlib zlib.h zlibVersion -lz; }
  6309. enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
  6310. enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
  6311. enabled zlib && test_exec $zlib_extralibs <<EOF && enable zlib_gzip
  6312. #include <zlib.h>
  6313. int main(void) {
  6314. if (zlibCompileFlags() & (1 << 17)) return 1;
  6315. return 0;
  6316. }
  6317. EOF
  6318. [ -x "$(command -v gzip)" ] && enable gzip
  6319. enabled zlib_gzip && enabled gzip || disable ptx_compression
  6320. # On some systems dynamic loading requires no extra linker flags
  6321. check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
  6322. check_lib libm math.h sin -lm
  6323. atan2f_args=2
  6324. copysign_args=2
  6325. hypot_args=2
  6326. ldexpf_args=2
  6327. powf_args=2
  6328. for func in $MATH_FUNCS; do
  6329. eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
  6330. done
  6331. # these are off by default, so fail if requested and not available
  6332. enabled avisynth && { require_headers "avisynth/avisynth_c.h avisynth/avs/version.h" &&
  6333. { test_cpp_condition avisynth/avs/version.h "AVS_MAJOR_VER >= 3 && AVS_MINOR_VER >= 7 && AVS_BUGFIX_VER >= 3 || AVS_MAJOR_VER >= 3 && AVS_MINOR_VER > 7 || AVS_MAJOR_VER > 3" ||
  6334. die "ERROR: AviSynth+ header version must be >= 3.7.3"; } }
  6335. enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
  6336. enabled chromaprint && { check_pkg_config chromaprint libchromaprint "chromaprint.h" chromaprint_get_version ||
  6337. require chromaprint chromaprint.h chromaprint_get_version -lchromaprint; }
  6338. enabled decklink && { require_headers DeckLinkAPI.h &&
  6339. { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } }
  6340. enabled frei0r && require_headers "frei0r.h"
  6341. enabled gmp && require gmp gmp.h mpz_export -lgmp
  6342. enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
  6343. enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
  6344. enabled ladspa && require_headers "ladspa.h dlfcn.h"
  6345. enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
  6346. enabled libaom && require_pkg_config libaom "aom >= 2.0.0" aom/aom_codec.h aom_codec_version
  6347. enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
  6348. { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
  6349. die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
  6350. enabled libaribcaption && require_pkg_config libaribcaption "libaribcaption >= 1.1.1" "aribcaption/aribcaption.h" aribcc_context_alloc
  6351. enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
  6352. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  6353. enabled libass && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init
  6354. enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
  6355. enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
  6356. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  6357. { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
  6358. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  6359. enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
  6360. enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
  6361. enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version
  6362. enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
  6363. enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
  6364. enabled libdrm && check_pkg_config libdrm libdrm xf86drm.h drmGetVersion
  6365. enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >= 6.1.1" dvdnav/dvdnav.h dvdnav_open2
  6366. enabled libdvdread && require_pkg_config libdvdread "dvdread >= 6.1.2" dvdread/dvd_reader.h DVDOpen2
  6367. enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
  6368. { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
  6369. warn "using libfdk without pkg-config"; } }
  6370. flite_extralibs="-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"
  6371. enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
  6372. enabled fontconfig && enable libfontconfig
  6373. enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
  6374. enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
  6375. enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
  6376. enabled libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create
  6377. enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
  6378. -lglslang -lMachineIndependent -lGenericCodeGen \
  6379. -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
  6380. require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
  6381. -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \
  6382. -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ; }
  6383. enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
  6384. require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
  6385. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  6386. check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
  6387. done || die "ERROR: libgsm not found"; }
  6388. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
  6389. enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/decode.h JxlDecoderVersion &&
  6390. require_pkg_config libjxl_threads "libjxl_threads >= 0.7.0" jxl/thread_parallel_runner.h JxlThreadParallelRunner
  6391. enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
  6392. enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 2.0.0" kvazaar.h kvz_api_get
  6393. enabled liblc3 && require_pkg_config liblc3 "lc3 >= 1.1.0" lc3.h lc3_hr_setup_encoder
  6394. enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_create
  6395. enabled liblcevc_dec && require_pkg_config liblcevc_dec "lcevc_dec >= 2.0.0" "LCEVC/lcevc_dec.h" LCEVC_CreateDecoder
  6396. if enabled libmfx && enabled libvpl; then
  6397. die "ERROR: can not use libmfx and libvpl together"
  6398. # While it may appear that require is being used as a pkg-config
  6399. # fallback for libmfx, it is actually being used to detect a different
  6400. # installation route altogether. If libmfx is installed via the Intel
  6401. # Media SDK or Intel Media Server Studio, these don't come with
  6402. # pkg-config support. Instead, users should make sure that the build
  6403. # can find the libraries and headers through other means.
  6404. elif enabled libmfx; then
  6405. { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfxvideo.h" MFXInit ||
  6406. # Some old versions of libmfx have the following settings in libmfx.pc:
  6407. # includedir=/usr/include
  6408. # Cflags: -I${includedir}
  6409. # So add -I${includedir}/mfx to CFLAGS
  6410. { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } ||
  6411. { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" &&
  6412. { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } &&
  6413. warn "using libmfx without pkg-config"; } } &&
  6414. warn "libmfx is deprecated. Please run configure with --enable-libvpl to use libvpl instead."
  6415. elif enabled libvpl; then
  6416. # Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option
  6417. # because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. The package name
  6418. # is extracted from "vpl >= 2.6"
  6419. check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad || \
  6420. die "ERROR: libvpl >= 2.6 not found"
  6421. add_cflags -DMFX_DEPRECATED_OFF
  6422. check_type "vpl/mfxdefs.h vpl/mfxvideo.h" "struct mfxConfigInterface"
  6423. fi
  6424. if enabled libmfx; then
  6425. check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9"
  6426. fi
  6427. enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
  6428. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
  6429. enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
  6430. require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
  6431. enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
  6432. check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppif -lnppc -lnppidei ||
  6433. die "ERROR: libnpp not found"; }
  6434. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  6435. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  6436. enabled libopencv && { check_headers opencv2/core/core_c.h &&
  6437. { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
  6438. require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
  6439. require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
  6440. enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
  6441. enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
  6442. { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
  6443. enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
  6444. enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
  6445. { check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
  6446. require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
  6447. enabled libopus && {
  6448. enabled libopus_decoder && {
  6449. require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
  6450. }
  6451. enabled libopus_encoder && {
  6452. require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
  6453. }
  6454. }
  6455. enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 5.229.0" libplacebo/vulkan.h pl_vulkan_create
  6456. enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
  6457. enabled libqrencode && require_pkg_config libqrencode libqrencode qrencode.h QRcode_encodeString
  6458. enabled libquirc && require libquirc quirc.h quirc_decode -lquirc
  6459. enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
  6460. enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
  6461. enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create
  6462. enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_new_from_data
  6463. enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
  6464. enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
  6465. enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
  6466. enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
  6467. enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
  6468. require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
  6469. enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
  6470. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  6471. enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
  6472. enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
  6473. enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
  6474. enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle
  6475. enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
  6476. enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
  6477. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  6478. enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
  6479. enabled libtorch && check_cxxflags -std=c++17 && require_cpp libtorch torch/torch.h "torch::Tensor" -ltorch -lc10 -ltorch_cpu -lstdc++ -lpthread
  6480. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  6481. { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  6482. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  6483. enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode
  6484. enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
  6485. enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  6486. enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init
  6487. enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init
  6488. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  6489. enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
  6490. require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
  6491. enabled libvpx && {
  6492. enabled libvpx_vp8_decoder && {
  6493. check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
  6494. check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  6495. }
  6496. enabled libvpx_vp8_encoder && {
  6497. check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
  6498. check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  6499. }
  6500. enabled libvpx_vp9_decoder && {
  6501. check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
  6502. check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  6503. }
  6504. enabled libvpx_vp9_encoder && {
  6505. check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
  6506. check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  6507. }
  6508. if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
  6509. die "libvpx enabled but no supported decoders found"
  6510. fi
  6511. }
  6512. enabled libvvenc && require_pkg_config libvvenc "libvvenc >= 1.6.1" "vvenc/vvenc.h" vvenc_get_version
  6513. enabled libwebp && {
  6514. enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  6515. enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
  6516. enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
  6517. require_cpp_condition libx264 x264.h "X264_BUILD >= 155" && {
  6518. [ "$toolchain" != "msvc" ] ||
  6519. require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
  6520. check_cpp_condition libx264_hdr10 x264.h "X264_BUILD >= 163" &&
  6521. check_cpp_condition libx262 x264.h "X264_MPEG2"
  6522. enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
  6523. require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
  6524. enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
  6525. enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
  6526. enabled libxevd && require_pkg_config libxevd "xevd >= 0.4.1" "xevd.h" xevd_decode
  6527. enabled libxeve && require_pkg_config libxeve "xeve >= 0.5.1" "xeve.h" xeve_encode
  6528. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  6529. enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
  6530. enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
  6531. enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
  6532. { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
  6533. enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
  6534. enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
  6535. enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
  6536. check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
  6537. check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
  6538. die "ERROR: mbedTLS not found"; }
  6539. enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
  6540. enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  6541. { ! enabled cross_compile &&
  6542. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
  6543. add_ldflags -L/opt/vc/lib/ &&
  6544. check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
  6545. die "ERROR: mmal not found" &&
  6546. check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
  6547. enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" alGetError ||
  6548. { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  6549. check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
  6550. die "ERROR: openal not found"; } &&
  6551. { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  6552. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  6553. enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
  6554. check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel "-framework OpenCL" ||
  6555. check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  6556. die "ERROR: opencl not found"; } &&
  6557. { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  6558. test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  6559. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  6560. enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
  6561. check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  6562. check_lib opengl OpenGL/gl3.h glGetError "-framework OpenGL" ||
  6563. check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -framework OpenGLES" ||
  6564. die "ERROR: opengl not found."
  6565. }
  6566. enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
  6567. { ! enabled cross_compile &&
  6568. add_cflags -isystem/opt/vc/include/IL &&
  6569. test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
  6570. die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
  6571. enable omx
  6572. enabled omx && require_headers OMX_Core.h && \
  6573. warn "The OpenMAX encoders are deprecated and will be removed in future versions"
  6574. enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
  6575. { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
  6576. { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
  6577. check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
  6578. check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
  6579. check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
  6580. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  6581. check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  6582. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  6583. die "ERROR: openssl not found"; }
  6584. enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
  6585. enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
  6586. require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
  6587. { enabled libdrm ||
  6588. die "ERROR: rkmpp requires --enable-libdrm"; }
  6589. }
  6590. enabled vapoursynth && require_headers "vapoursynth/VSScript4.h vapoursynth/VapourSynth4.h"
  6591. if enabled gcrypt; then
  6592. GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
  6593. if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
  6594. gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
  6595. gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
  6596. check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
  6597. die "ERROR: gcrypt not found"
  6598. add_cflags $gcrypt_cflags
  6599. else
  6600. require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
  6601. fi
  6602. fi
  6603. if enabled sdl2; then
  6604. SDL2_CONFIG="${cross_prefix}sdl2-config"
  6605. test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent
  6606. if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
  6607. sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
  6608. sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
  6609. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
  6610. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x030000" $sdl2_cflags &&
  6611. check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
  6612. enable sdl2
  6613. fi
  6614. if test $target_os = "mingw32"; then
  6615. sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
  6616. fi
  6617. fi
  6618. if enabled decklink; then
  6619. case $target_os in
  6620. mingw32*|mingw64*|win32|win64)
  6621. decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
  6622. decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
  6623. ;;
  6624. esac
  6625. fi
  6626. enabled securetransport &&
  6627. check_func SecIdentityCreate "-framework CoreFoundation -framework Security" &&
  6628. check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-framework CoreFoundation -framework Security" ||
  6629. disable securetransport
  6630. enabled securetransport &&
  6631. check_func SecItemImport "-framework CoreFoundation -framework Security"
  6632. enabled schannel &&
  6633. check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
  6634. test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
  6635. schannel_extralibs="-lsecur32" ||
  6636. disable schannel
  6637. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  6638. enabled makeinfo \
  6639. && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
  6640. && enable makeinfo_html || disable makeinfo_html
  6641. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  6642. perl -v > /dev/null 2>&1 && enable perl || disable perl
  6643. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  6644. rsync --help 2> /dev/null | grep -q 'contimeout=' && enable rsync_contimeout || disable rsync_contimeout
  6645. xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
  6646. check_headers linux/fb.h
  6647. check_headers linux/videodev2.h
  6648. test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  6649. test_code cc sys/ioctl.h "int ioctl(int, int, ...)" && enable posix_ioctl
  6650. # check V4L2 codecs available in the API
  6651. if enabled v4l2_m2m; then
  6652. check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
  6653. check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
  6654. check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
  6655. check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
  6656. check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
  6657. check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
  6658. check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
  6659. check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
  6660. check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
  6661. check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
  6662. fi
  6663. check_headers sys/videoio.h
  6664. test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  6665. check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
  6666. check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  6667. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  6668. # w32api 3.12 had it defined wrong
  6669. check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
  6670. check_type "dshow.h" IBaseFilter
  6671. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  6672. check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
  6673. check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
  6674. check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
  6675. check_headers "dev/ic/bt8xx.h"
  6676. if check_struct sys/soundcard.h audio_buf_info bytes; then
  6677. enable_sanitized sys/soundcard.h
  6678. else
  6679. test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
  6680. #include <sys/soundcard.h>
  6681. audio_buf_info abc;
  6682. EOF
  6683. fi
  6684. enabled alsa && { check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
  6685. check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound; }
  6686. enabled libjack &&
  6687. require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
  6688. enabled sndio && check_pkg_config sndio sndio sndio.h sio_open
  6689. if enabled libcdio; then
  6690. check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
  6691. check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
  6692. check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  6693. check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  6694. die "ERROR: No usable libcdio/cdparanoia found"
  6695. fi
  6696. enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
  6697. disable libxcb_shm libxcb_shape libxcb_xfixes
  6698. if enabled libxcb; then
  6699. enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
  6700. enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
  6701. enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
  6702. fi
  6703. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  6704. # check if building for desktop or uwp
  6705. test_cpp <<EOF && enable uwp
  6706. #ifdef WINAPI_FAMILY
  6707. #include <winapifamily.h>
  6708. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  6709. #error desktop, not uwp
  6710. #else
  6711. // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
  6712. #endif
  6713. #else
  6714. #error no family set
  6715. #endif
  6716. EOF
  6717. mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
  6718. if enabled uwp; then
  6719. # In UWP mode, we can't use LoadLibrary+GetProcAddress to conditionally
  6720. # try to load these APIs at runtime, like we do in regular desktop mode -
  6721. # therefore, we need to link directly against these APIs.
  6722. d3d11va_extralibs="-ldxgi -ld3d11"
  6723. d3d12va_extralibs="-ldxgi -ld3d12"
  6724. vaapi_win32_extralibs="-ldxgi"
  6725. mediafoundation_extralibs="-lmfplat $mediafoundation_extralibs"
  6726. fi
  6727. enabled libdrm &&
  6728. check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h" drmModeGetFB2
  6729. enabled vaapi &&
  6730. check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
  6731. if enabled vaapi; then
  6732. case $target_os in
  6733. mingw32*|mingw64*|win32|win64)
  6734. check_pkg_config vaapi_win32 "libva-win32" "va/va_win32.h" vaGetDisplayWin32
  6735. ;;
  6736. *)
  6737. check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
  6738. ;;
  6739. esac
  6740. if enabled xlib_x11; then
  6741. check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
  6742. fi
  6743. check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
  6744. check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
  6745. check_type "va/va.h va/va_dec_vvc.h" "VAPictureParameterBufferVVC"
  6746. check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
  6747. check_struct "va/va.h" "VADecPictureParameterBufferAV1" bit_depth_idx
  6748. check_type "va/va.h va/va_vpp.h" "VAProcFilterParameterBufferHDRToneMapping"
  6749. check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
  6750. check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" blend_flags
  6751. check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
  6752. check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
  6753. check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
  6754. check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
  6755. check_type "va/va.h va/va_enc_av1.h" "VAEncPictureParameterBufferAV1"
  6756. fi
  6757. if enabled_all opencl libdrm ; then
  6758. check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
  6759. enable opencl_drm_beignet
  6760. check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
  6761. enable opencl_drm_arm
  6762. fi
  6763. if enabled_all opencl vaapi ; then
  6764. if enabled opencl_drm_beignet ; then
  6765. enable opencl_vaapi_beignet
  6766. else
  6767. check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
  6768. enable opencl_vaapi_intel_media
  6769. fi
  6770. fi
  6771. if enabled_all opencl dxva2 ; then
  6772. check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
  6773. enable opencl_dxva2
  6774. fi
  6775. if enabled_all opencl d3d11va ; then
  6776. check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
  6777. enable opencl_d3d11
  6778. fi
  6779. if enabled_all opencl videotoolbox ; then
  6780. check_func_headers OpenCL/cl_gl_ext.h clCreateImageFromIOSurfaceWithPropertiesAPPLE -framework VideoToolbox -framework OpenCL &&
  6781. enable opencl_videotoolbox
  6782. fi
  6783. enabled vdpau &&
  6784. check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
  6785. enabled vdpau &&
  6786. check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
  6787. if enabled_all vulkan vulkan_static; then
  6788. check_pkg_config vulkan "vulkan >= 1.3.277" "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
  6789. check_lib vulkan "vulkan/vulkan.h" vkGetInstanceProcAddr -lvulkan
  6790. elif enabled vulkan; then
  6791. check_pkg_config_header_only vulkan "vulkan >= 1.3.277" "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
  6792. check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 277)"
  6793. fi
  6794. if disabled vulkan; then
  6795. disable libglslang libshaderc spirv_compiler
  6796. fi
  6797. if enabled x86; then
  6798. case $target_os in
  6799. freebsd|mingw32*|mingw64*|win32|win64|linux|cygwin*)
  6800. ;;
  6801. *)
  6802. disable ffnvcodec cuvid nvdec nvenc
  6803. ;;
  6804. esac
  6805. elif enabled_any aarch64 ppc64 && ! enabled bigendian; then
  6806. case $target_os in
  6807. linux)
  6808. ;;
  6809. *)
  6810. disable ffnvcodec cuvid nvdec nvenc
  6811. ;;
  6812. esac
  6813. else
  6814. disable ffnvcodec cuvid nvdec nvenc
  6815. fi
  6816. enabled ffnvcodec && enable cuda
  6817. enabled nvenc &&
  6818. test_cc -I$source_path <<EOF || disable nvenc
  6819. #include <ffnvcodec/nvEncodeAPI.h>
  6820. NV_ENCODE_API_FUNCTION_LIST flist;
  6821. void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_CODEC_H264_GUID } }; }
  6822. int main(void) { return 0; }
  6823. EOF
  6824. if enabled nvenc; then
  6825. check_type "ffnvcodec/nvEncodeAPI.h" "NV_ENC_PIC_PARAMS_AV1"
  6826. fi
  6827. if enabled_any nvdec cuvid; then
  6828. check_type "ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h" "CUVIDAV1PICPARAMS"
  6829. fi
  6830. enabled amf &&
  6831. check_cpp_condition amf "AMF/core/Version.h" \
  6832. "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400230000"
  6833. # Funny iconv installations are not unusual, so check it after all flags have been set
  6834. if enabled libc_iconv; then
  6835. check_func_headers iconv.h iconv
  6836. elif enabled iconv; then
  6837. check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
  6838. fi
  6839. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  6840. # add some useful compiler flags if supported
  6841. check_cflags -Wdeclaration-after-statement
  6842. check_cflags -Wall
  6843. check_cflags -Wdisabled-optimization
  6844. check_cflags -Wpointer-arith
  6845. check_cflags -Wredundant-decls
  6846. check_cflags -Wwrite-strings
  6847. check_cflags -Wtype-limits
  6848. check_cflags -Wundef
  6849. check_cflags -Wmissing-prototypes
  6850. check_cflags -Wstrict-prototypes
  6851. check_cflags -Wempty-body
  6852. if enabled extra_warnings; then
  6853. check_cflags -Wcast-qual
  6854. check_cflags -Wextra
  6855. check_cflags -Wpedantic
  6856. fi
  6857. check_disable_warning(){
  6858. warning_flag=-W${1#-Wno-}
  6859. test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
  6860. }
  6861. test_cflags -Werror=unused-command-line-argument &&
  6862. append unknown_warning_flags "-Werror=unused-command-line-argument"
  6863. test_cflags -Werror=unknown-warning-option &&
  6864. append unknown_warning_flags "-Werror=unknown-warning-option"
  6865. check_disable_warning -Wno-parentheses
  6866. check_disable_warning -Wno-switch
  6867. check_disable_warning -Wno-format-zero-length
  6868. check_disable_warning -Wno-pointer-sign
  6869. check_disable_warning -Wno-unused-const-variable
  6870. check_disable_warning -Wno-bool-operation
  6871. check_disable_warning -Wno-char-subscripts
  6872. check_disable_warning -Wno-implicit-const-int-float-conversion
  6873. check_disable_warning_headers(){
  6874. warning_flag=-W${1#-Wno-}
  6875. test_cflags $warning_flag && add_cflags_headers $1
  6876. }
  6877. check_disable_warning_headers -Wno-deprecated-declarations
  6878. check_disable_warning_headers -Wno-unused-variable
  6879. test_cc <<EOF && enable blocks_extension
  6880. void (^block)(void);
  6881. EOF
  6882. # add some linker flags
  6883. check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
  6884. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
  6885. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  6886. # add some strip flags
  6887. check_stripflags -x
  6888. enabled neon_clobber_test &&
  6889. check_ldflags -Wl,--wrap,avcodec_open2 \
  6890. -Wl,--wrap,avcodec_decode_subtitle2 \
  6891. -Wl,--wrap,avcodec_encode_subtitle \
  6892. -Wl,--wrap,avcodec_send_packet \
  6893. -Wl,--wrap,avcodec_receive_packet \
  6894. -Wl,--wrap,avcodec_send_frame \
  6895. -Wl,--wrap,avcodec_receive_frame \
  6896. -Wl,--wrap,swr_convert ||
  6897. disable neon_clobber_test
  6898. enabled xmm_clobber_test &&
  6899. check_ldflags -Wl,--wrap,avcodec_open2 \
  6900. -Wl,--wrap,avcodec_decode_subtitle2 \
  6901. -Wl,--wrap,avcodec_encode_subtitle \
  6902. -Wl,--wrap,avcodec_send_packet \
  6903. -Wl,--wrap,avcodec_receive_packet \
  6904. -Wl,--wrap,avcodec_send_frame \
  6905. -Wl,--wrap,avcodec_receive_frame \
  6906. -Wl,--wrap,swr_convert \
  6907. -Wl,--wrap,sws_scale ||
  6908. disable xmm_clobber_test
  6909. check_ld "cc" proper_dce <<EOF
  6910. extern const int array[512];
  6911. static inline int func(void) { return array[0]; }
  6912. int main(void) { return 0; }
  6913. EOF
  6914. if enabled proper_dce; then
  6915. echo "X { local: *; };" > $TMPV
  6916. if test_ldflags -Wl,${version_script},$TMPV; then
  6917. append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
  6918. quotes='""'
  6919. test_cc <<EOF && enable symver_asm_label
  6920. void ff_foo(void) __asm__ ("av_foo@VERSION");
  6921. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  6922. EOF
  6923. test_cc <<EOF && enable symver_gnu_asm
  6924. __asm__(".symver ff_foo,av_foo@VERSION");
  6925. void ff_foo(void) {}
  6926. EOF
  6927. fi
  6928. fi
  6929. if [ -z "$optflags" ]; then
  6930. if enabled small; then
  6931. optflags=$cflags_size
  6932. elif enabled optimizations; then
  6933. optflags=$cflags_speed
  6934. else
  6935. optflags=$cflags_noopt
  6936. fi
  6937. fi
  6938. check_optflags(){
  6939. check_cflags "$@"
  6940. [ -n "$lto" ] && check_ldflags "$@"
  6941. }
  6942. check_optflags $optflags
  6943. check_optflags -fno-math-errno
  6944. check_optflags -fno-signed-zeros
  6945. if [ -n "$lto" ]; then
  6946. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  6947. check_cflags $lto
  6948. check_ldflags $lto $cpuflags
  6949. disable inline_asm_direct_symbol_refs
  6950. if test "$cc_type" = "clang"; then
  6951. # Clang's LTO fails on Windows, when there are references outside
  6952. # of inline assembly to nonlocal labels defined within inline assembly,
  6953. # see https://github.com/llvm/llvm-project/issues/76046.
  6954. case $target_os in
  6955. mingw32|win32)
  6956. disable inline_asm_nonlocal_labels
  6957. ;;
  6958. esac
  6959. fi
  6960. fi
  6961. enabled ftrapv && check_cflags -ftrapv
  6962. test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  6963. int x;
  6964. EOF
  6965. if enabled icc; then
  6966. # Just warnings, no remarks
  6967. check_cflags -w1
  6968. # -wd: Disable following warnings
  6969. # 144, 167, 556: -Wno-pointer-sign
  6970. # 188: enumerated type mixed with another type
  6971. # 1292: attribute "foo" ignored
  6972. # 1419: external declaration in primary source file
  6973. # 10006: ignoring unknown option -fno-signed-zeros
  6974. # 10148: ignoring unknown option -Wno-parentheses
  6975. # 10156: ignoring option '-W'; no argument required
  6976. # 13200: No EMMS instruction before call to function
  6977. # 13203: No EMMS instruction before return from function
  6978. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  6979. # 11030: Warning unknown option --as-needed
  6980. # 10156: ignoring option '-export'; no argument required
  6981. check_ldflags -wd10156,11030
  6982. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  6983. enable ebp_available
  6984. # The test above does not test linking
  6985. [ -n "$lto" ] && disable symver_asm_label
  6986. if enabled x86_32; then
  6987. icc_version=$($cc -dumpversion)
  6988. test ${icc_version%%.*} -ge 11 &&
  6989. check_cflags -falign-stack=maintain-16-byte ||
  6990. disable aligned_stack
  6991. fi
  6992. elif enabled gcc; then
  6993. check_optflags -fno-tree-vectorize
  6994. check_cflags -Werror=format-security
  6995. check_cflags -Werror=implicit-function-declaration
  6996. check_cflags -Werror=missing-prototypes
  6997. check_cflags -Werror=return-type
  6998. check_cflags -Werror=vla
  6999. check_cflags -Wformat
  7000. check_cflags -fdiagnostics-color=auto
  7001. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  7002. if enabled x86_32; then
  7003. case $target_os in
  7004. *bsd*)
  7005. # BSDs don't guarantee a 16 byte aligned stack, but we can
  7006. # request GCC to try to maintain 16 byte alignment throughout
  7007. # function calls. Library entry points that might call assembly
  7008. # functions align the stack. (The parameter means 2^4 bytes.)
  7009. check_cflags -mpreferred-stack-boundary=4
  7010. ;;
  7011. esac
  7012. fi
  7013. elif enabled llvm_gcc; then
  7014. check_cflags -mllvm -stack-alignment=16
  7015. elif enabled clang; then
  7016. if enabled x86_32; then
  7017. # Clang doesn't support maintaining alignment without assuming the
  7018. # same alignment in every function. If 16 byte alignment would be
  7019. # enabled, one would also have to either add attribute_align_arg on
  7020. # every single entry point into the libraries or enable -mstackrealign
  7021. # (doing stack realignment in every single function).
  7022. case $target_os in
  7023. mingw32|win32|*bsd*)
  7024. disable aligned_stack
  7025. ;;
  7026. *)
  7027. check_cflags -mllvm -stack-alignment=16
  7028. check_cflags -mstack-alignment=16
  7029. ;;
  7030. esac
  7031. else
  7032. check_cflags -mllvm -stack-alignment=16
  7033. check_cflags -mstack-alignment=16
  7034. fi
  7035. check_cflags -Qunused-arguments
  7036. check_cflags -Werror=implicit-function-declaration
  7037. check_cflags -Werror=missing-prototypes
  7038. check_cflags -Werror=return-type
  7039. elif enabled cparser; then
  7040. add_cflags -Wno-missing-variable-declarations
  7041. add_cflags -Wno-empty-statement
  7042. elif enabled armcc; then
  7043. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  7044. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  7045. # 2523: use of inline assembly is deprecated
  7046. add_cflags -W${armcc_opt},--diag_suppress=2523
  7047. add_cflags -W${armcc_opt},--diag_suppress=1207
  7048. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  7049. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  7050. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  7051. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  7052. elif enabled pathscale; then
  7053. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  7054. disable inline_asm
  7055. elif enabled_any msvc icl; then
  7056. enabled x86_32 && disable aligned_stack
  7057. enabled_all x86_32 debug && add_cflags -Oy-
  7058. enabled debug && add_ldflags -debug
  7059. enable pragma_deprecated
  7060. if enabled icl; then
  7061. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  7062. # (correctly) on icl 13.x.
  7063. test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  7064. add_cflags -Qansi-alias
  7065. # Some inline asm is not compilable in debug
  7066. if enabled debug; then
  7067. disable ebp_available
  7068. disable ebx_available
  7069. fi
  7070. fi
  7071. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  7072. check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
  7073. # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
  7074. # Issue has been fixed in MSVC v19.00.24218.
  7075. test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
  7076. check_cflags -d2SSAOptimizer-
  7077. # enable utf-8 source processing on VS2015 U2 and newer
  7078. test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
  7079. add_cflags -utf-8
  7080. fi
  7081. for pfx in "" host_; do
  7082. varname=${pfx%_}cc_type
  7083. eval "type=\$$varname"
  7084. if [ "$type" = "msvc" ]; then
  7085. test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  7086. static inline int foo(int a) { return a; }
  7087. EOF
  7088. fi
  7089. done
  7090. case $as_type in
  7091. clang)
  7092. add_asflags -Qunused-arguments
  7093. ;;
  7094. esac
  7095. case $ld_type in
  7096. clang)
  7097. check_ldflags -Qunused-arguments
  7098. ;;
  7099. esac
  7100. enable frame_thread_encoder
  7101. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  7102. check_deps $CONFIG_LIST \
  7103. $CONFIG_EXTRA \
  7104. $HAVE_LIST \
  7105. $ALL_COMPONENTS \
  7106. 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"
  7107. enabled threads || warn \
  7108. "Threading support was disabled or is not available on the target platform." \
  7109. "This means that not only is this build not multi-threaded, but also" \
  7110. "that the libraries from this build MUST NOT be used in a multi-threaded"\
  7111. "environment."
  7112. case $target_os in
  7113. haiku)
  7114. disable memalign
  7115. disable posix_memalign
  7116. ;;
  7117. *-dos|freedos|opendos)
  7118. if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
  7119. disable memalign
  7120. fi
  7121. ;;
  7122. esac
  7123. flatten_extralibs(){
  7124. nested_entries=
  7125. list_name=$1
  7126. eval list=\$${1}
  7127. for entry in $list; do
  7128. entry_copy=$entry
  7129. resolve entry_copy
  7130. flat_entries=
  7131. for e in $entry_copy; do
  7132. case $e in
  7133. *_extralibs) nested_entries="$nested_entries$e ";;
  7134. *) flat_entries="$flat_entries$e ";;
  7135. esac
  7136. done
  7137. eval $entry="\$flat_entries"
  7138. done
  7139. append $list_name "$nested_entries"
  7140. resolve nested_entries
  7141. if test -n "$(filter '*_extralibs' $nested_entries)"; then
  7142. flatten_extralibs $list_name
  7143. fi
  7144. }
  7145. flatten_extralibs_wrapper(){
  7146. list_name=$1
  7147. flatten_extralibs $list_name
  7148. unique $list_name
  7149. resolve $list_name
  7150. eval $list_name=\$\(\$ldflags_filter \$$list_name\)
  7151. eval printf \''%s'\' \""\$$list_name"\"
  7152. }
  7153. for linkunit in $LIBRARY_LIST; do
  7154. unset current_extralibs
  7155. eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
  7156. for comp in ${components}; do
  7157. enabled $comp || continue
  7158. comp_extralibs="${comp}_extralibs"
  7159. append current_extralibs $comp_extralibs
  7160. done
  7161. eval prepend ${linkunit}_extralibs $current_extralibs
  7162. done
  7163. for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  7164. eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
  7165. done
  7166. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  7167. for thread in $THREADS_LIST; do
  7168. if enabled $thread; then
  7169. test -n "$thread_type" &&
  7170. die "ERROR: Only one thread type must be selected." ||
  7171. thread_type="$thread"
  7172. fi
  7173. done
  7174. if disabled stdatomic; then
  7175. if enabled atomics_win32; then
  7176. add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
  7177. else
  7178. enabled threads && die "Threading is enabled, but no atomics are available"
  7179. add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
  7180. fi
  7181. fi
  7182. check_builtin stdbit "stdbit.h assert.h" \
  7183. 'static_assert(__STDC_VERSION_STDBIT_H__ >= 202311L, "Compiler lacks stdbit.h")' || \
  7184. add_cppflags '-I\$(SRC_PATH)/compat/stdbit'
  7185. # Check if requested libraries were found.
  7186. for lib in $AUTODETECT_LIBS; do
  7187. requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
  7188. done
  7189. enabled zlib && add_cppflags -DZLIB_CONST
  7190. # conditional library dependencies, in any order
  7191. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  7192. enabled aresample_filter && prepend avfilter_deps "swresample"
  7193. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  7194. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  7195. enabled elbg_filter && prepend avfilter_deps "avcodec"
  7196. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  7197. enabled fsync_filter && prepend avfilter_deps "avformat"
  7198. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  7199. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  7200. enabled pan_filter && prepend avfilter_deps "swresample"
  7201. enabled pp_filter && prepend avfilter_deps "postproc"
  7202. enabled qrencode_filter && prepend avfilter_deps "swscale"
  7203. enabled qrencodesrc_filter && prepend avfilter_deps "swscale"
  7204. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  7205. enabled sab_filter && prepend avfilter_deps "swscale"
  7206. enabled scale_filter && prepend avfilter_deps "swscale"
  7207. enabled scale2ref_filter && prepend avfilter_deps "swscale"
  7208. enabled showcqt_filter && prepend avfilter_deps "avformat swscale"
  7209. enabled signature_filter && prepend avfilter_deps "avcodec avformat"
  7210. enabled smartblur_filter && prepend avfilter_deps "swscale"
  7211. enabled spp_filter && prepend avfilter_deps "avcodec"
  7212. enabled sr_filter && prepend avfilter_deps "avformat swscale"
  7213. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  7214. enabled uspp_filter && prepend avfilter_deps "avcodec"
  7215. enabled zoompan_filter && prepend avfilter_deps "swscale"
  7216. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  7217. #FIXME
  7218. enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
  7219. add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
  7220. enabled opus_decoder && prepend avcodec_deps "swresample"
  7221. # reorder the items at var $1 to align with the items order at var $2 .
  7222. # die if an item at $1 is not at $2 .
  7223. reorder_by(){
  7224. eval rb_in=\$$1
  7225. eval rb_ordered=\$$2
  7226. for rb in $rb_in; do
  7227. is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
  7228. done
  7229. rb_out=
  7230. for rb in $rb_ordered; do
  7231. is_in $rb $rb_in && rb_out="$rb_out$rb "
  7232. done
  7233. eval $1=\$rb_out
  7234. }
  7235. # deps-expand fflib $1: N x {append all expanded deps; unique}
  7236. # within a set of N items, N expansions are enough to expose a cycle.
  7237. expand_deps(){
  7238. unique ${1}_deps # required for the early break test.
  7239. for dummy in $LIBRARY_LIST; do # N iteratios
  7240. eval deps=\$${1}_deps
  7241. append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
  7242. unique ${1}_deps
  7243. eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
  7244. done
  7245. eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
  7246. reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
  7247. }
  7248. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  7249. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  7250. map 'expand_deps $v' $LIBRARY_LIST
  7251. if test "$quiet" != "yes"; then
  7252. echo "install prefix $prefix"
  7253. echo "source path $source_path"
  7254. echo "C compiler $cc"
  7255. echo "C library $libc_type"
  7256. if test "$host_cc" != "$cc"; then
  7257. echo "host C compiler $host_cc"
  7258. echo "host C library $host_libc_type"
  7259. fi
  7260. echo "ARCH $arch ($cpu)"
  7261. if test "$build_suffix" != ""; then
  7262. echo "build suffix $build_suffix"
  7263. fi
  7264. if test "$progs_suffix" != ""; then
  7265. echo "progs suffix $progs_suffix"
  7266. fi
  7267. if test "$extra_version" != ""; then
  7268. echo "version string suffix $extra_version"
  7269. fi
  7270. echo "big-endian ${bigendian-no}"
  7271. echo "runtime cpu detection ${runtime_cpudetect-no}"
  7272. if enabled x86; then
  7273. echo "standalone assembly ${x86asm-no}"
  7274. echo "x86 assembler ${x86asmexe}"
  7275. echo "MMX enabled ${mmx-no}"
  7276. echo "MMXEXT enabled ${mmxext-no}"
  7277. echo "3DNow! enabled ${amd3dnow-no}"
  7278. echo "3DNow! extended enabled ${amd3dnowext-no}"
  7279. echo "SSE enabled ${sse-no}"
  7280. echo "SSSE3 enabled ${ssse3-no}"
  7281. echo "AESNI enabled ${aesni-no}"
  7282. echo "AVX enabled ${avx-no}"
  7283. echo "AVX2 enabled ${avx2-no}"
  7284. echo "AVX-512 enabled ${avx512-no}"
  7285. echo "AVX-512ICL enabled ${avx512icl-no}"
  7286. echo "XOP enabled ${xop-no}"
  7287. echo "FMA3 enabled ${fma3-no}"
  7288. echo "FMA4 enabled ${fma4-no}"
  7289. echo "i686 features enabled ${i686-no}"
  7290. echo "CMOV is fast ${fast_cmov-no}"
  7291. echo "EBX available ${ebx_available-no}"
  7292. echo "EBP available ${ebp_available-no}"
  7293. fi
  7294. if enabled aarch64; then
  7295. echo "NEON enabled ${neon-no}"
  7296. echo "DOTPROD enabled ${dotprod-no}"
  7297. echo "I8MM enabled ${i8mm-no}"
  7298. echo "SVE enabled ${sve-no}"
  7299. echo "SVE2 enabled ${sve2-no}"
  7300. fi
  7301. if enabled arm; then
  7302. echo "ARMv5TE enabled ${armv5te-no}"
  7303. echo "ARMv6 enabled ${armv6-no}"
  7304. echo "ARMv6T2 enabled ${armv6t2-no}"
  7305. echo "VFP enabled ${vfp-no}"
  7306. echo "NEON enabled ${neon-no}"
  7307. echo "THUMB enabled ${thumb-no}"
  7308. fi
  7309. if enabled mips; then
  7310. echo "MIPS FPU enabled ${mipsfpu-no}"
  7311. echo "MIPS DSP R1 enabled ${mipsdsp-no}"
  7312. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  7313. echo "MIPS MSA enabled ${msa-no}"
  7314. echo "LOONGSON MMI enabled ${mmi-no}"
  7315. fi
  7316. if enabled ppc; then
  7317. echo "AltiVec enabled ${altivec-no}"
  7318. echo "VSX enabled ${vsx-no}"
  7319. echo "POWER8 enabled ${power8-no}"
  7320. echo "PPC 4xx optimizations ${ppc4xx-no}"
  7321. echo "dcbzl available ${dcbzl-no}"
  7322. echo "vec_xl available ${vec_xl-no}"
  7323. fi
  7324. if enabled loongarch; then
  7325. echo "LSX enabled ${lsx-no}"
  7326. echo "LASX enabled ${lasx-no}"
  7327. fi
  7328. if enabled riscv; then
  7329. echo "RISC-V CBO Prefetch ${rv_zicbop-no}"
  7330. echo "RISC-V Vector enabled ${rvv-no}"
  7331. fi
  7332. echo "debug symbols ${debug-no}"
  7333. echo "strip symbols ${stripping-no}"
  7334. echo "optimize for size ${small-no}"
  7335. echo "optimizations ${optimizations-no}"
  7336. echo "static ${static-no}"
  7337. echo "shared ${shared-no}"
  7338. echo "postprocessing support ${postproc-no}"
  7339. echo "network support ${network-no}"
  7340. echo "threading support ${thread_type-no}"
  7341. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  7342. echo "texi2html enabled ${texi2html-no}"
  7343. echo "perl enabled ${perl-no}"
  7344. echo "pod2man enabled ${pod2man-no}"
  7345. echo "makeinfo enabled ${makeinfo-no}"
  7346. echo "makeinfo supports HTML ${makeinfo_html-no}"
  7347. echo "xmllint enabled ${xmllint-no}"
  7348. test -n "$random_seed" &&
  7349. echo "random seed ${random_seed}"
  7350. echo
  7351. echo "External libraries:"
  7352. print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
  7353. echo
  7354. echo "External libraries providing hardware acceleration:"
  7355. print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
  7356. echo
  7357. echo "Libraries:"
  7358. print_enabled '' $LIBRARY_LIST | print_in_columns
  7359. echo
  7360. echo "Programs:"
  7361. print_enabled '' $PROGRAM_LIST | print_in_columns
  7362. echo
  7363. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  7364. echo "Enabled ${type}s:"
  7365. eval list=\$$(toupper $type)_LIST
  7366. print_enabled '_*' $list | print_in_columns
  7367. echo
  7368. done
  7369. if test -n "$ignore_tests"; then
  7370. ignore_tests=$(echo $ignore_tests | tr ',' ' ')
  7371. echo "Ignored FATE tests:"
  7372. echo $ignore_tests | print_in_columns
  7373. echo
  7374. fi
  7375. echo "License: $license"
  7376. fi # test "$quiet" != "yes"
  7377. if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
  7378. for cfg in $WARN_IF_GETS_DISABLED_LIST; do
  7379. if disabled $cfg; then
  7380. varname=${cfg}_disable_reason
  7381. eval "warn \"Disabled $cfg because \$$varname\""
  7382. fi
  7383. done
  7384. fi
  7385. if test -n "$WARNINGS"; then
  7386. printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
  7387. enabled fatal_warnings && exit 1
  7388. fi
  7389. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  7390. esc(){
  7391. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  7392. }
  7393. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
  7394. enabled stripping || strip="echo skipping strip"
  7395. enabled stripping || striptype=""
  7396. config_files="$TMPH ffbuild/config.mak doc/config.texi"
  7397. cat > ffbuild/config.mak <<EOF
  7398. # Automatically generated by configure - do not modify!
  7399. ifndef FFMPEG_CONFIG_MAK
  7400. FFMPEG_CONFIG_MAK=1
  7401. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  7402. prefix=$prefix
  7403. LIBDIR=\$(DESTDIR)$libdir
  7404. SHLIBDIR=\$(DESTDIR)$shlibdir
  7405. INCDIR=\$(DESTDIR)$incdir
  7406. BINDIR=\$(DESTDIR)$bindir
  7407. DATADIR=\$(DESTDIR)$datadir
  7408. DOCDIR=\$(DESTDIR)$docdir
  7409. MANDIR=\$(DESTDIR)$mandir
  7410. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  7411. INSTALL_NAME_DIR=$install_name_dir
  7412. SRC_PATH=$source_path
  7413. SRC_LINK=$source_link
  7414. ifndef MAIN_MAKEFILE
  7415. SRC_PATH:=\$(SRC_PATH:.%=..%)
  7416. endif
  7417. CC_IDENT=$cc_ident
  7418. ARCH=$arch
  7419. INTRINSICS=$intrinsics
  7420. EXTERN_PREFIX=$extern_prefix
  7421. CC=$cc
  7422. CXX=$cxx
  7423. AS=$as
  7424. OBJCC=$objcc
  7425. LD=$ld
  7426. DEPCC=$dep_cc
  7427. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  7428. DEPAS=$as
  7429. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  7430. X86ASM=$x86asmexe
  7431. DEPX86ASM=$x86asmexe
  7432. DEPX86ASMFLAGS=\$(X86ASMFLAGS)
  7433. AR=$ar
  7434. ARFLAGS=$arflags
  7435. AR_O=$ar_o
  7436. AR_CMD=$ar
  7437. NM_CMD=$nm
  7438. METALCC=$metalcc
  7439. METALLIB=$metallib
  7440. RANLIB=$ranlib
  7441. STRIP=$strip
  7442. STRIPTYPE=$striptype
  7443. NVCC=$nvcc
  7444. CP=cp -p
  7445. LN_S=$ln_s
  7446. CPPFLAGS=$CPPFLAGS
  7447. CFLAGS=$CFLAGS
  7448. CXXFLAGS=$CXXFLAGS
  7449. OBJCCFLAGS=$OBJCFLAGS
  7450. ASFLAGS=$ASFLAGS
  7451. NVCCFLAGS=$nvccflags
  7452. AS_C=$AS_C
  7453. AS_O=$AS_O
  7454. OBJCC_C=$OBJCC_C
  7455. OBJCC_E=$OBJCC_E
  7456. OBJCC_O=$OBJCC_O
  7457. CC_C=$CC_C
  7458. CC_E=$CC_E
  7459. CC_O=$CC_O
  7460. CXX_C=$CXX_C
  7461. CXX_O=$CXX_O
  7462. NVCC_C=$NVCC_C
  7463. NVCC_O=$NVCC_O
  7464. LD_O=$LD_O
  7465. X86ASM_O=$X86ASM_O
  7466. LD_LIB=$LD_LIB
  7467. LD_PATH=$LD_PATH
  7468. DLLTOOL=$dlltool
  7469. WINDRES=$windres
  7470. DOXYGEN=$doxygen
  7471. LDFLAGS=$LDFLAGS
  7472. LDEXEFLAGS=$LDEXEFLAGS
  7473. LDSOFLAGS=$LDSOFLAGS
  7474. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  7475. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  7476. X86ASMFLAGS=$X86ASMFLAGS
  7477. MSAFLAGS=$MSAFLAGS
  7478. MMIFLAGS=$MMIFLAGS
  7479. LSXFLAGS=$LSXFLAGS
  7480. LASXFLAGS=$LASXFLAGS
  7481. BUILDSUF=$build_suffix
  7482. PROGSSUF=$progs_suffix
  7483. FULLNAME=$FULLNAME
  7484. LIBPREF=$LIBPREF
  7485. LIBSUF=$LIBSUF
  7486. LIBNAME=$LIBNAME
  7487. SLIBPREF=$SLIBPREF
  7488. SLIBSUF=$SLIBSUF
  7489. EXESUF=$EXESUF
  7490. EXTRA_VERSION=$extra_version
  7491. CCDEP=$CCDEP
  7492. CXXDEP=$CXXDEP
  7493. CCDEP_FLAGS=$CCDEP_FLAGS
  7494. ASDEP=$ASDEP
  7495. ASDEP_FLAGS=$ASDEP_FLAGS
  7496. X86ASMDEP=$X86ASMDEP
  7497. X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
  7498. CC_DEPFLAGS=$CC_DEPFLAGS
  7499. CXX_DEPFLAGS=$CXX_DEPFLAGS
  7500. OBJCC_DEPFLAGS=$OBJC_DEPFLAGS
  7501. AS_DEPFLAGS=$AS_DEPFLAGS
  7502. X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
  7503. HOSTCC=$host_cc
  7504. HOSTLD=$host_ld
  7505. HOSTCFLAGS=$host_cflags
  7506. HOSTCPPFLAGS=$host_cppflags
  7507. HOSTEXESUF=$HOSTEXESUF
  7508. HOSTLDFLAGS=$host_ldflags
  7509. HOSTEXTRALIBS=$host_extralibs
  7510. DEPHOSTCC=$host_cc
  7511. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  7512. HOSTCCDEP=$HOSTCCDEP
  7513. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  7514. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  7515. HOSTCC_C=$HOSTCC_C
  7516. HOSTCC_O=$HOSTCC_O
  7517. HOSTLD_O=$HOSTLD_O
  7518. TARGET_EXEC=$target_exec $target_exec_args
  7519. TARGET_PATH=$target_path
  7520. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  7521. CFLAGS-ffplay=${sdl2_cflags}
  7522. CFLAGS_HEADERS=$CFLAGS_HEADERS
  7523. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  7524. EXTRALIBS=$extralibs
  7525. COMPAT_OBJS=$compat_objs
  7526. INSTALL=$install
  7527. LIBTARGET=${LIBTARGET}
  7528. SLIBNAME=${SLIBNAME}
  7529. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  7530. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  7531. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  7532. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  7533. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  7534. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  7535. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  7536. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  7537. VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
  7538. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  7539. NOREDZONE_FLAGS=$noredzone_flags
  7540. LIBFUZZER_PATH=$libfuzzer_path
  7541. IGNORE_TESTS=$ignore_tests
  7542. VERSION_TRACKING=$version_tracking
  7543. EOF
  7544. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
  7545. for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  7546. eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
  7547. done
  7548. cat > $TMPH <<EOF
  7549. /* Automatically generated by configure - do not modify! */
  7550. #ifndef FFMPEG_CONFIG_H
  7551. #define FFMPEG_CONFIG_H
  7552. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  7553. #define FFMPEG_LICENSE "$(c_escape $license)"
  7554. #define CONFIG_THIS_YEAR 2025
  7555. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  7556. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  7557. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  7558. #define OS_NAME $target_os
  7559. #define EXTERN_PREFIX "${extern_prefix}"
  7560. #define EXTERN_ASM ${extern_prefix}
  7561. #define BUILDSUF "$build_suffix"
  7562. #define SLIBSUF "$SLIBSUF"
  7563. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  7564. EOF
  7565. test -n "$assert_level" &&
  7566. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  7567. test -n "$malloc_prefix" &&
  7568. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  7569. enabled aarch64 &&
  7570. echo "#define AS_ARCH_LEVEL $as_arch_level" >>$TMPH
  7571. if enabled x86asm; then
  7572. append config_files $TMPASM
  7573. cat > $TMPASM <<EOF
  7574. ; Automatically generated by configure - do not modify!
  7575. EOF
  7576. fi
  7577. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  7578. mkdir -p doc
  7579. mkdir -p tests
  7580. mkdir -p tests/api
  7581. echo "@c auto-generated by configure - do not modify! " > doc/config.texi
  7582. print_config ARCH_ "$config_files" $ARCH_LIST
  7583. print_config HAVE_ "$config_files" $HAVE_LIST
  7584. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  7585. $CONFIG_EXTRA \
  7586. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  7587. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  7588. cp_if_changed $TMPH config.h
  7589. touch ffbuild/.config
  7590. # Copy config.asm before printing ALL_COMPONENTS; that's not needed in assembly.
  7591. enabled x86asm && cp_if_changed $TMPASM config.asm
  7592. # Reopen a new TMPH for config_components.h.
  7593. cat > $TMPH <<EOF
  7594. /* Automatically generated by configure - do not modify! */
  7595. #ifndef FFMPEG_CONFIG_COMPONENTS_H
  7596. #define FFMPEG_CONFIG_COMPONENTS_H
  7597. EOF
  7598. print_config CONFIG_ "$config_files" $ALL_COMPONENTS
  7599. echo "#endif /* FFMPEG_CONFIG_COMPONENTS_H */" >> $TMPH
  7600. echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
  7601. cp_if_changed $TMPH config_components.h
  7602. cat > $TMPH <<EOF
  7603. /* Generated by ffmpeg configure */
  7604. #ifndef AVUTIL_AVCONFIG_H
  7605. #define AVUTIL_AVCONFIG_H
  7606. EOF
  7607. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  7608. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  7609. cp_if_changed $TMPH libavutil/avconfig.h
  7610. # full_filter_name_foo=vf_foo
  7611. # full_filter_name_bar=asrc_bar
  7612. # ...
  7613. eval "$(sed -n "s/^extern const FFFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
  7614. # generate the lists of enabled components
  7615. print_enabled_components(){
  7616. file=$1
  7617. struct_name=$2
  7618. name=$3
  7619. shift 3
  7620. echo "static const $struct_name * const $name[] = {" > $TMPH
  7621. for c in $*; do
  7622. if enabled $c; then
  7623. case $name in
  7624. filter_list)
  7625. eval c=\$full_filter_name_${c%_filter}
  7626. ;;
  7627. indev_list)
  7628. c=${c%_indev}_demuxer
  7629. ;;
  7630. outdev_list)
  7631. c=${c%_outdev}_muxer
  7632. ;;
  7633. esac
  7634. printf " &ff_%s,\n" $c >> $TMPH
  7635. fi
  7636. done
  7637. if [ "$name" = "filter_list" ]; then
  7638. for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
  7639. printf " &ff_%s,\n" $c >> $TMPH
  7640. done
  7641. fi
  7642. echo " NULL };" >> $TMPH
  7643. cp_if_changed $TMPH $file
  7644. }
  7645. print_enabled_components libavfilter/filter_list.c FFFilter filter_list $FILTER_LIST
  7646. print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
  7647. print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
  7648. print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
  7649. print_enabled_components libavformat/demuxer_list.c FFInputFormat demuxer_list $DEMUXER_LIST
  7650. print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
  7651. print_enabled_components libavdevice/indev_list.c FFInputFormat indev_list $INDEV_LIST
  7652. print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
  7653. print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
  7654. # Settings for pkg-config files
  7655. cat > $TMPH <<EOF
  7656. # Automatically generated by configure - do not modify!
  7657. shared=$shared
  7658. build_suffix=$build_suffix
  7659. prefix=$prefix
  7660. libdir=$libdir
  7661. incdir=$incdir
  7662. rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
  7663. source_path=${source_path}
  7664. LIBPREF=${LIBPREF}
  7665. LIBSUF=${LIBSUF}
  7666. extralibs_avutil="$avutil_extralibs"
  7667. extralibs_avcodec="$avcodec_extralibs"
  7668. extralibs_avformat="$avformat_extralibs"
  7669. extralibs_avdevice="$avdevice_extralibs"
  7670. extralibs_avfilter="$avfilter_extralibs"
  7671. extralibs_postproc="$postproc_extralibs"
  7672. extralibs_swscale="$swscale_extralibs"
  7673. extralibs_swresample="$swresample_extralibs"
  7674. EOF
  7675. for lib in $LIBRARY_LIST; do
  7676. lib_deps="$(eval echo \$${lib}_deps)"
  7677. echo ${lib}_deps=\"$lib_deps\" >> $TMPH
  7678. done
  7679. cp_if_changed $TMPH ffbuild/config.sh