configure 275 KB

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