configure 265 KB

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