configure 292 KB

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