configure 252 KB

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