configure 249 KB

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