configure 241 KB

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