configure 265 KB

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