configure 279 KB

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