configure 263 KB

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