configure 281 KB

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