configure 280 KB

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