configure 261 KB

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