configure 281 KB

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