configure 279 KB

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