configure 266 KB

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