configure 208 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539
  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. --list-decoders show all available decoders
  58. --list-encoders show all available encoders
  59. --list-hwaccels show all available hardware accelerators
  60. --list-demuxers show all available demuxers
  61. --list-muxers show all available muxers
  62. --list-parsers show all available parsers
  63. --list-protocols show all available protocols
  64. --list-bsfs show all available bitstream filters
  65. --list-indevs show all available input devices
  66. --list-outdevs show all available output devices
  67. --list-filters show all available filters
  68. Standard options:
  69. --logfile=FILE log tests and output to FILE [config.log]
  70. --disable-logging do not log configure debug information
  71. --fatal-warnings fail if any configure warning is generated
  72. --prefix=PREFIX install in PREFIX [$prefix]
  73. --bindir=DIR install binaries in DIR [PREFIX/bin]
  74. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  75. --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
  76. --libdir=DIR install libs in DIR [PREFIX/lib]
  77. --shlibdir=DIR install shared libs in DIR [LIBDIR]
  78. --incdir=DIR install includes in DIR [PREFIX/include]
  79. --mandir=DIR install man page in DIR [PREFIX/share/man]
  80. --pkgconfigdir=DIR install pkg-config files in DIR [LIBDIR/pkgconfig]
  81. --enable-rpath use rpath to allow installing libraries in paths
  82. not part of the dynamic linker search path
  83. use rpath when linking programs [USE WITH CARE]
  84. Licensing options:
  85. --enable-gpl allow use of GPL code, the resulting libs
  86. and binaries will be under GPL [no]
  87. --enable-version3 upgrade (L)GPL to version 3 [no]
  88. --enable-nonfree allow use of nonfree code, the resulting libs
  89. and binaries will be unredistributable [no]
  90. Configuration options:
  91. --disable-static do not build static libraries [no]
  92. --enable-shared build shared libraries [no]
  93. --enable-small optimize for size instead of speed
  94. --disable-runtime-cpudetect disable detecting cpu capabilities at runtime (smaller binary)
  95. --enable-gray enable full grayscale support (slower color)
  96. --disable-swscale-alpha disable alpha channel support in swscale
  97. --disable-all disable building components, libraries and programs
  98. --enable-incompatible-libav-abi enable incompatible Libav fork ABI [no]
  99. --enable-raise-major increase major version numbers in sonames [no]
  100. Program options:
  101. --disable-programs do not build command line programs
  102. --disable-ffmpeg disable ffmpeg build
  103. --disable-ffplay disable ffplay build
  104. --disable-ffprobe disable ffprobe build
  105. --disable-ffserver disable ffserver 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 [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. Hardware accelerators:
  136. --disable-d3d11va disable D3D11VA code [autodetect]
  137. --disable-dxva2 disable DXVA2 code [autodetect]
  138. --disable-vaapi disable VAAPI code [autodetect]
  139. --disable-vda disable VDA code [autodetect]
  140. --disable-vdpau disable VDPAU code [autodetect]
  141. --enable-videotoolbox enable VideoToolbox code [autodetect]
  142. Individual component options:
  143. --disable-everything disable all components listed below
  144. --disable-encoder=NAME disable encoder NAME
  145. --enable-encoder=NAME enable encoder NAME
  146. --disable-encoders disable all encoders
  147. --disable-decoder=NAME disable decoder NAME
  148. --enable-decoder=NAME enable decoder NAME
  149. --disable-decoders disable all decoders
  150. --disable-hwaccel=NAME disable hwaccel NAME
  151. --enable-hwaccel=NAME enable hwaccel NAME
  152. --disable-hwaccels disable all hwaccels
  153. --disable-muxer=NAME disable muxer NAME
  154. --enable-muxer=NAME enable muxer NAME
  155. --disable-muxers disable all muxers
  156. --disable-demuxer=NAME disable demuxer NAME
  157. --enable-demuxer=NAME enable demuxer NAME
  158. --disable-demuxers disable all demuxers
  159. --enable-parser=NAME enable parser NAME
  160. --disable-parser=NAME disable parser NAME
  161. --disable-parsers disable all parsers
  162. --enable-bsf=NAME enable bitstream filter NAME
  163. --disable-bsf=NAME disable bitstream filter NAME
  164. --disable-bsfs disable all bitstream filters
  165. --enable-protocol=NAME enable protocol NAME
  166. --disable-protocol=NAME disable protocol NAME
  167. --disable-protocols disable all protocols
  168. --enable-indev=NAME enable input device NAME
  169. --disable-indev=NAME disable input device NAME
  170. --disable-indevs disable input devices
  171. --enable-outdev=NAME enable output device NAME
  172. --disable-outdev=NAME disable output device NAME
  173. --disable-outdevs disable output devices
  174. --disable-devices disable all devices
  175. --enable-filter=NAME enable filter NAME
  176. --disable-filter=NAME disable filter NAME
  177. --disable-filters disable all filters
  178. External library support:
  179. --enable-avisynth enable reading of AviSynth script files [no]
  180. --disable-bzlib disable bzlib [autodetect]
  181. --enable-chromaprint enable audio fingerprinting with chromaprint [no]
  182. --enable-fontconfig enable fontconfig, useful for drawtext filter [no]
  183. --enable-frei0r enable frei0r video filtering [no]
  184. --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
  185. if openssl, librtmp or gmp is not used [no]
  186. --enable-gmp enable gmp, needed for rtmp(t)e support
  187. if openssl or librtmp is not used [no]
  188. --enable-gnutls enable gnutls, needed for https support
  189. if openssl is not used [no]
  190. --disable-iconv disable iconv [autodetect]
  191. --enable-ladspa enable LADSPA audio filtering [no]
  192. --enable-libass enable libass subtitles rendering,
  193. needed for subtitles and ass filter [no]
  194. --enable-libbluray enable BluRay reading using libbluray [no]
  195. --enable-libbs2b enable bs2b DSP library [no]
  196. --enable-libcaca enable textual display using libcaca [no]
  197. --enable-libcelt enable CELT decoding via libcelt [no]
  198. --enable-libcdio enable audio CD grabbing with libcdio [no]
  199. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  200. and libraw1394 [no]
  201. --enable-libdcadec enable DCA decoding via libdcadec [no]
  202. --enable-libfaac enable AAC encoding via libfaac [no]
  203. --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  204. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  205. --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
  206. --enable-libfribidi enable libfribidi, improves drawtext filter [no]
  207. --enable-libgme enable Game Music Emu via libgme [no]
  208. --enable-libgsm enable GSM de/encoding via libgsm [no]
  209. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  210. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  211. --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
  212. --enable-libmfx enable HW acceleration through libmfx
  213. --enable-libmodplug enable ModPlug via libmodplug [no]
  214. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  215. --enable-libnut enable NUT (de)muxing via libnut,
  216. native (de)muxer exists [no]
  217. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  218. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  219. --enable-libopencv enable video filtering via libopencv [no]
  220. --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
  221. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  222. --enable-libopus enable Opus de/encoding via libopus [no]
  223. --enable-libpulse enable Pulseaudio input via libpulse [no]
  224. --enable-librubberband enable rubberband needed for rubberband filter [no]
  225. --enable-librtmp enable RTMP[E] support via librtmp [no]
  226. --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
  227. --enable-libshine enable fixed-point MP3 encoding via libshine [no]
  228. --enable-libsmbclient enable Samba protocol via libsmbclient [no]
  229. --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
  230. --enable-libsoxr enable Include libsoxr resampling [no]
  231. --enable-libspeex enable Speex de/encoding via libspeex [no]
  232. --enable-libssh enable SFTP protocol via libssh [no]
  233. --enable-libtesseract enable Tesseract, needed for ocr filter [no]
  234. --enable-libtheora enable Theora encoding via libtheora [no]
  235. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  236. --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
  237. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  238. --enable-libvidstab enable video stabilization using vid.stab [no]
  239. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  240. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  241. native implementation exists [no]
  242. --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
  243. --enable-libwavpack enable wavpack encoding via libwavpack [no]
  244. --enable-libwebp enable WebP encoding via libwebp [no]
  245. --enable-libx264 enable H.264 encoding via x264 [no]
  246. --enable-libx265 enable HEVC encoding via x265 [no]
  247. --enable-libxavs enable AVS encoding via xavs [no]
  248. --enable-libxcb enable X11 grabbing using XCB [autodetect]
  249. --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
  250. --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
  251. --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
  252. --enable-libxvid enable Xvid encoding via xvidcore,
  253. native MPEG-4/Xvid encoder exists [no]
  254. --enable-libzimg enable z.lib, needed for zscale filter [no]
  255. --enable-libzmq enable message passing via libzmq [no]
  256. --enable-libzvbi enable teletext support via libzvbi [no]
  257. --disable-lzma disable lzma [autodetect]
  258. --enable-decklink enable Blackmagic DeckLink I/O support [no]
  259. --enable-mmal enable decoding via MMAL [no]
  260. --enable-netcdf enable NetCDF, needed for sofalizer filter [no]
  261. --enable-nvenc enable NVIDIA NVENC support [no]
  262. --enable-openal enable OpenAL 1.1 capture support [no]
  263. --enable-opencl enable OpenCL code
  264. --enable-opengl enable OpenGL rendering [no]
  265. --enable-openssl enable openssl, needed for https support
  266. if gnutls is not used [no]
  267. --disable-schannel disable SChannel SSP, needed for TLS support on
  268. Windows if openssl and gnutls are not used [autodetect]
  269. --disable-sdl disable sdl [autodetect]
  270. --disable-securetransport disable Secure Transport, needed for TLS support
  271. on OSX if openssl and gnutls are not used [autodetect]
  272. --enable-x11grab enable X11 grabbing (legacy) [no]
  273. --disable-xlib disable xlib [autodetect]
  274. --disable-zlib disable zlib [autodetect]
  275. Toolchain options:
  276. --arch=ARCH select architecture [$arch]
  277. --cpu=CPU select the minimum required CPU (affects
  278. instruction selection, may crash on older CPUs)
  279. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  280. --progs-suffix=SUFFIX program name suffix []
  281. --enable-cross-compile assume a cross-compiler is used
  282. --sysroot=PATH root of cross-build tree
  283. --sysinclude=PATH location of cross-build system headers
  284. --target-os=OS compiler targets OS [$target_os]
  285. --target-exec=CMD command to run executables on target
  286. --target-path=DIR path to view of build directory on target
  287. --target-samples=DIR path to samples directory on target
  288. --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
  289. --toolchain=NAME set tool defaults according to NAME
  290. --nm=NM use nm tool NM [$nm_default]
  291. --ar=AR use archive tool AR [$ar_default]
  292. --as=AS use assembler AS [$as_default]
  293. --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
  294. --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
  295. --cc=CC use C compiler CC [$cc_default]
  296. --cxx=CXX use C compiler CXX [$cxx_default]
  297. --objcc=OCC use ObjC compiler OCC [$cc_default]
  298. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  299. --ld=LD use linker LD [$ld_default]
  300. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  301. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  302. --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
  303. --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
  304. --host-cc=HOSTCC use host C compiler HOSTCC
  305. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  306. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  307. --host-ld=HOSTLD use host linker HOSTLD
  308. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  309. --host-libs=HLIBS use libs HLIBS when linking for host
  310. --host-os=OS compiler host OS [$target_os]
  311. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  312. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  313. --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
  314. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  315. --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
  316. --extra-ldlibflags=ELDFLAGS add ELDFLAGS to LDLIBFLAGS [$LDLIBFLAGS]
  317. --extra-libs=ELIBS add ELIBS [$ELIBS]
  318. --extra-version=STRING version string suffix []
  319. --optflags=OPTFLAGS override optimization-related compiler flags
  320. --build-suffix=SUFFIX library name suffix []
  321. --enable-pic build position-independent code
  322. --enable-thumb compile for Thumb instruction set
  323. --enable-lto use link-time optimization
  324. --env="ENV=override" override the environment variables
  325. Advanced options (experts only):
  326. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  327. --custom-allocator=NAME use a supported custom allocator
  328. --disable-symver disable symbol versioning
  329. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  330. --disable-safe-bitstream-reader
  331. disable buffer boundary checking in bitreaders
  332. (faster, but may crash)
  333. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  334. --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
  335. Optimization options (experts only):
  336. --disable-asm disable all assembly optimizations
  337. --disable-altivec disable AltiVec optimizations
  338. --disable-vsx disable VSX optimizations
  339. --disable-power8 disable POWER8 optimizations
  340. --disable-amd3dnow disable 3DNow! optimizations
  341. --disable-amd3dnowext disable 3DNow! extended optimizations
  342. --disable-mmx disable MMX optimizations
  343. --disable-mmxext disable MMXEXT optimizations
  344. --disable-sse disable SSE optimizations
  345. --disable-sse2 disable SSE2 optimizations
  346. --disable-sse3 disable SSE3 optimizations
  347. --disable-ssse3 disable SSSE3 optimizations
  348. --disable-sse4 disable SSE4 optimizations
  349. --disable-sse42 disable SSE4.2 optimizations
  350. --disable-avx disable AVX optimizations
  351. --disable-xop disable XOP optimizations
  352. --disable-fma3 disable FMA3 optimizations
  353. --disable-fma4 disable FMA4 optimizations
  354. --disable-avx2 disable AVX2 optimizations
  355. --disable-aesni disable AESNI optimizations
  356. --disable-armv5te disable armv5te optimizations
  357. --disable-armv6 disable armv6 optimizations
  358. --disable-armv6t2 disable armv6t2 optimizations
  359. --disable-vfp disable VFP optimizations
  360. --disable-neon disable NEON optimizations
  361. --disable-inline-asm disable use of inline assembly
  362. --disable-yasm disable use of nasm/yasm assembly
  363. --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
  364. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  365. --disable-msa disable MSA optimizations
  366. --disable-mipsfpu disable floating point MIPS optimizations
  367. --disable-mmi disable Loongson SIMD optimizations
  368. --disable-fast-unaligned consider unaligned accesses slow
  369. Developer options (useful when working on FFmpeg itself):
  370. --disable-debug disable debugging symbols
  371. --enable-debug=LEVEL set the debug level [$debuglevel]
  372. --disable-optimizations disable compiler optimizations
  373. --enable-extra-warnings enable more compiler warnings
  374. --disable-stripping disable stripping of executables and shared libraries
  375. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  376. 2 causes a slowdown at runtime.
  377. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  378. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  379. leaks and errors, using the specified valgrind binary.
  380. Cannot be combined with --target-exec
  381. --enable-ftrapv Trap arithmetic overflows
  382. --samples=PATH location of test samples for FATE, if not set use
  383. \$FATE_SAMPLES at make invocation time.
  384. --enable-neon-clobber-test check NEON registers for clobbering (should be
  385. used only for debugging purposes)
  386. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  387. should be used only for debugging purposes)
  388. --enable-random randomly enable/disable components
  389. --disable-random
  390. --enable-random=LIST randomly enable/disable specific components or
  391. --disable-random=LIST component groups. LIST is a comma-separated list
  392. of NAME[:PROB] entries where NAME is a component
  393. (group) and PROB the probability associated with
  394. NAME (default 0.5).
  395. --random-seed=VALUE seed value for --enable/disable-random
  396. --disable-valgrind-backtrace do not print a backtrace under Valgrind
  397. (only applies to --disable-optimizations builds)
  398. NOTE: Object files are built at the place where configure is launched.
  399. EOF
  400. exit 0
  401. }
  402. quotes='""'
  403. if test -t 1 && which tput >/dev/null 2>&1; then
  404. ncolors=$(tput colors)
  405. if test -n "$ncolors" && test $ncolors -ge 8; then
  406. bold_color=$(tput bold)
  407. warn_color=$(tput setaf 3)
  408. error_color=$(tput setaf 1)
  409. reset_color=$(tput sgr0)
  410. fi
  411. # 72 used instead of 80 since that's the default of pr
  412. ncols=$(tput cols)
  413. fi
  414. : ${ncols:=72}
  415. log(){
  416. echo "$@" >> $logfile
  417. }
  418. log_file(){
  419. log BEGIN $1
  420. pr -n -t $1 >> $logfile
  421. log END $1
  422. }
  423. warn(){
  424. log "WARNING: $*"
  425. WARNINGS="${WARNINGS}WARNING: $*\n"
  426. }
  427. die(){
  428. log "$@"
  429. echo "$error_color$bold_color$@$reset_color"
  430. cat <<EOF
  431. If you think configure made a mistake, make sure you are using the latest
  432. version from Git. If the latest version fails, report the problem to the
  433. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  434. EOF
  435. if disabled logging; then
  436. cat <<EOF
  437. Rerun configure with logging enabled (do not use --disable-logging), and
  438. include the log this produces with your report.
  439. EOF
  440. else
  441. cat <<EOF
  442. Include the log file "$logfile" produced by configure as this will help
  443. solve the problem.
  444. EOF
  445. fi
  446. exit 1
  447. }
  448. # Avoid locale weirdness, besides we really just want to translate ASCII.
  449. toupper(){
  450. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  451. }
  452. tolower(){
  453. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  454. }
  455. c_escape(){
  456. echo "$*" | sed 's/["\\]/\\\0/g'
  457. }
  458. sh_quote(){
  459. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  460. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  461. echo "$v"
  462. }
  463. cleanws(){
  464. echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
  465. }
  466. filter(){
  467. pat=$1
  468. shift
  469. for v; do
  470. eval "case $v in $pat) echo $v ;; esac"
  471. done
  472. }
  473. filter_out(){
  474. pat=$1
  475. shift
  476. for v; do
  477. eval "case $v in $pat) ;; *) echo $v ;; esac"
  478. done
  479. }
  480. map(){
  481. m=$1
  482. shift
  483. for v; do eval $m; done
  484. }
  485. add_suffix(){
  486. suffix=$1
  487. shift
  488. for v; do echo ${v}${suffix}; done
  489. }
  490. set_all(){
  491. value=$1
  492. shift
  493. for var in $*; do
  494. eval $var=$value
  495. done
  496. }
  497. set_weak(){
  498. value=$1
  499. shift
  500. for var; do
  501. eval : \${$var:=$value}
  502. done
  503. }
  504. sanitize_var_name(){
  505. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  506. }
  507. set_safe(){
  508. var=$1
  509. shift
  510. eval $(sanitize_var_name "$var")='$*'
  511. }
  512. get_safe(){
  513. eval echo \$$(sanitize_var_name "$1")
  514. }
  515. pushvar(){
  516. for pvar in $*; do
  517. eval level=\${${pvar}_level:=0}
  518. eval ${pvar}_${level}="\$$pvar"
  519. eval ${pvar}_level=$(($level+1))
  520. done
  521. }
  522. popvar(){
  523. for pvar in $*; do
  524. eval level=\${${pvar}_level:-0}
  525. test $level = 0 && continue
  526. eval level=$(($level-1))
  527. eval $pvar="\${${pvar}_${level}}"
  528. eval ${pvar}_level=$level
  529. eval unset ${pvar}_${level}
  530. done
  531. }
  532. enable(){
  533. set_all yes $*
  534. }
  535. disable(){
  536. set_all no $*
  537. }
  538. enable_weak(){
  539. set_weak yes $*
  540. }
  541. disable_weak(){
  542. set_weak no $*
  543. }
  544. enable_safe(){
  545. for var; do
  546. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  547. done
  548. }
  549. disable_safe(){
  550. for var; do
  551. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  552. done
  553. }
  554. do_enable_deep(){
  555. for var; do
  556. enabled $var && continue
  557. eval sel="\$${var}_select"
  558. eval sgs="\$${var}_suggest"
  559. pushvar var sgs
  560. enable_deep $sel
  561. popvar sgs
  562. enable_deep_weak $sgs
  563. popvar var
  564. done
  565. }
  566. enable_deep(){
  567. do_enable_deep $*
  568. enable $*
  569. }
  570. enable_deep_weak(){
  571. for var; do
  572. disabled $var && continue
  573. pushvar var
  574. do_enable_deep $var
  575. popvar var
  576. enable_weak $var
  577. done
  578. }
  579. enabled(){
  580. test "${1#!}" = "$1" && op='=' || op=!=
  581. eval test "x\$${1#!}" $op "xyes"
  582. }
  583. disabled(){
  584. test "${1#!}" = "$1" && op='=' || op=!=
  585. eval test "x\$${1#!}" $op "xno"
  586. }
  587. enabled_all(){
  588. for opt; do
  589. enabled $opt || return 1
  590. done
  591. }
  592. disabled_all(){
  593. for opt; do
  594. disabled $opt || return 1
  595. done
  596. }
  597. enabled_any(){
  598. for opt; do
  599. enabled $opt && return 0
  600. done
  601. }
  602. disabled_any(){
  603. for opt; do
  604. disabled $opt && return 0
  605. done
  606. return 1
  607. }
  608. set_default(){
  609. for opt; do
  610. eval : \${$opt:=\$${opt}_default}
  611. done
  612. }
  613. is_in(){
  614. value=$1
  615. shift
  616. for var in $*; do
  617. [ $var = $value ] && return 0
  618. done
  619. return 1
  620. }
  621. do_check_deps(){
  622. for cfg; do
  623. cfg="${cfg#!}"
  624. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  625. disabled ${cfg}_checking && continue
  626. enable ${cfg}_checking
  627. append allopts $cfg
  628. eval dep_all="\$${cfg}_deps"
  629. eval dep_any="\$${cfg}_deps_any"
  630. eval dep_sel="\$${cfg}_select"
  631. eval dep_sgs="\$${cfg}_suggest"
  632. eval dep_ifa="\$${cfg}_if"
  633. eval dep_ifn="\$${cfg}_if_any"
  634. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  635. do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  636. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  637. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  638. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  639. enabled_all $dep_all || disable $cfg
  640. enabled_any $dep_any || disable $cfg
  641. disabled_any $dep_sel && disable $cfg
  642. if enabled $cfg; then
  643. enable_deep $dep_sel
  644. enable_deep_weak $dep_sgs
  645. fi
  646. disable ${cfg}_checking
  647. done
  648. }
  649. check_deps(){
  650. unset allopts
  651. do_check_deps "$@"
  652. for cfg in $allopts; do
  653. enabled $cfg || continue
  654. eval dep_extralibs="\$${cfg}_extralibs"
  655. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  656. done
  657. }
  658. print_config(){
  659. pfx=$1
  660. files=$2
  661. shift 2
  662. map 'eval echo "$v \${$v:-no}"' "$@" |
  663. awk "BEGIN { split(\"$files\", files) }
  664. {
  665. c = \"$pfx\" toupper(\$1);
  666. v = \$2;
  667. sub(/yes/, 1, v);
  668. sub(/no/, 0, v);
  669. for (f in files) {
  670. file = files[f];
  671. if (file ~ /\\.h\$/) {
  672. printf(\"#define %s %d\\n\", c, v) >>file;
  673. } else if (file ~ /\\.asm\$/) {
  674. printf(\"%%define %s %d\\n\", c, v) >>file;
  675. } else if (file ~ /\\.mak\$/) {
  676. n = -v ? \"\" : \"!\";
  677. printf(\"%s%s=yes\\n\", n, c) >>file;
  678. } else if (file ~ /\\.texi\$/) {
  679. pre = -v ? \"\" : \"@c \";
  680. yesno = \$2;
  681. c2 = tolower(c);
  682. gsub(/_/, \"-\", c2);
  683. printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
  684. }
  685. }
  686. }"
  687. }
  688. print_enabled(){
  689. suf=$1
  690. shift
  691. for v; do
  692. enabled $v && printf "%s\n" ${v%$suf};
  693. done
  694. }
  695. append(){
  696. var=$1
  697. shift
  698. eval "$var=\"\$$var $*\""
  699. }
  700. prepend(){
  701. var=$1
  702. shift
  703. eval "$var=\"$* \$$var\""
  704. }
  705. unique(){
  706. var=$1
  707. uniq_list=""
  708. for tok in $(eval echo \$$var); do
  709. uniq_list="$(filter_out $tok $uniq_list) $tok"
  710. done
  711. eval "$var=\"${uniq_list}\""
  712. }
  713. add_cppflags(){
  714. append CPPFLAGS "$@"
  715. }
  716. add_cflags(){
  717. append CFLAGS $($cflags_filter "$@")
  718. }
  719. add_cxxflags(){
  720. append CXXFLAGS $($cflags_filter "$@")
  721. }
  722. add_asflags(){
  723. append ASFLAGS $($asflags_filter "$@")
  724. }
  725. add_objcflags(){
  726. append OBJCFLAGS $($objcflags_filter "$@")
  727. }
  728. add_ldflags(){
  729. append LDFLAGS $($ldflags_filter "$@")
  730. }
  731. add_ldexeflags(){
  732. append LDEXEFLAGS $($ldflags_filter "$@")
  733. }
  734. add_ldlibflags(){
  735. append LDLIBFLAGS $($ldflags_filter "$@")
  736. }
  737. add_stripflags(){
  738. append ASMSTRIPFLAGS "$@"
  739. }
  740. add_extralibs(){
  741. prepend extralibs $($ldflags_filter "$@")
  742. }
  743. add_host_cppflags(){
  744. append host_cppflags "$@"
  745. }
  746. add_host_cflags(){
  747. append host_cflags $($host_cflags_filter "$@")
  748. }
  749. add_host_ldflags(){
  750. append host_ldflags $($host_ldflags_filter "$@")
  751. }
  752. add_compat(){
  753. append compat_objs $1
  754. shift
  755. map 'add_cppflags -D$v' "$@"
  756. }
  757. check_cmd(){
  758. log "$@"
  759. "$@" >> $logfile 2>&1
  760. }
  761. check_stat(){
  762. log check_stat "$@"
  763. stat "$1" >> $logfile 2>&1
  764. }
  765. cc_o(){
  766. eval printf '%s\\n' $CC_O
  767. }
  768. cc_e(){
  769. eval printf '%s\\n' $CC_E
  770. }
  771. check_cc(){
  772. log check_cc "$@"
  773. cat > $TMPC
  774. log_file $TMPC
  775. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  776. }
  777. check_cxx(){
  778. log check_cxx "$@"
  779. cat > $TMPCPP
  780. log_file $TMPCPP
  781. check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  782. }
  783. check_objcc(){
  784. log check_objcc "$@"
  785. cat > $TMPM
  786. log_file $TMPM
  787. check_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
  788. }
  789. check_cpp(){
  790. log check_cpp "$@"
  791. cat > $TMPC
  792. log_file $TMPC
  793. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  794. }
  795. as_o(){
  796. eval printf '%s\\n' $AS_O
  797. }
  798. check_as(){
  799. log check_as "$@"
  800. cat > $TMPS
  801. log_file $TMPS
  802. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  803. }
  804. check_inline_asm(){
  805. log check_inline_asm "$@"
  806. name="$1"
  807. code="$2"
  808. shift 2
  809. disable $name
  810. check_cc "$@" <<EOF && enable $name
  811. void foo(void){ __asm__ volatile($code); }
  812. EOF
  813. }
  814. check_inline_asm_flags(){
  815. log check_inline_asm_flags "$@"
  816. name="$1"
  817. code="$2"
  818. flags=''
  819. shift 2
  820. while [ "$1" != "" ]; do
  821. append flags $1
  822. shift
  823. done;
  824. disable $name
  825. cat > $TMPC <<EOF
  826. void foo(void){ __asm__ volatile($code); }
  827. EOF
  828. log_file $TMPC
  829. check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
  830. enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
  831. }
  832. check_insn(){
  833. log check_insn "$@"
  834. check_inline_asm ${1}_inline "\"$2\""
  835. echo "$2" | check_as && enable ${1}_external || disable ${1}_external
  836. }
  837. check_yasm(){
  838. log check_yasm "$@"
  839. echo "$1" > $TMPS
  840. log_file $TMPS
  841. shift 1
  842. check_cmd $yasmexe $YASMFLAGS -Werror "$@" -o $TMPO $TMPS
  843. }
  844. ld_o(){
  845. eval printf '%s\\n' $LD_O
  846. }
  847. check_ld(){
  848. log check_ld "$@"
  849. type=$1
  850. shift 1
  851. flags=$(filter_out '-l*|*.so' $@)
  852. libs=$(filter '-l*|*.so' $@)
  853. check_$type $($cflags_filter $flags) || return
  854. flags=$($ldflags_filter $flags)
  855. libs=$($ldflags_filter $libs)
  856. check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  857. }
  858. print_include(){
  859. hdr=$1
  860. test "${hdr%.h}" = "${hdr}" &&
  861. echo "#include $hdr" ||
  862. echo "#include <$hdr>"
  863. }
  864. check_code(){
  865. log check_code "$@"
  866. check=$1
  867. headers=$2
  868. code=$3
  869. shift 3
  870. {
  871. for hdr in $headers; do
  872. print_include $hdr
  873. done
  874. echo "int main(void) { $code; return 0; }"
  875. } | check_$check "$@"
  876. }
  877. check_cppflags(){
  878. log check_cppflags "$@"
  879. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  880. int x;
  881. EOF
  882. }
  883. test_cflags(){
  884. log test_cflags "$@"
  885. set -- $($cflags_filter "$@")
  886. check_cc "$@" <<EOF
  887. int x;
  888. EOF
  889. }
  890. check_cflags(){
  891. log check_cflags "$@"
  892. test_cflags "$@" && add_cflags "$@"
  893. }
  894. check_cxxflags(){
  895. log check_cxxflags "$@"
  896. set -- $($cflags_filter "$@")
  897. check_cxx "$@" <<EOF && append CXXFLAGS "$@"
  898. int x;
  899. EOF
  900. }
  901. test_objcflags(){
  902. log test_cflags "$@"
  903. set -- $($cflags_filter "$@")
  904. check_objcc "$@" <<EOF
  905. int x;
  906. EOF
  907. }
  908. check_objcflags(){
  909. log check_cflags "$@"
  910. test_objcflags "$@" && add_objcflags "$@"
  911. }
  912. test_ldflags(){
  913. log test_ldflags "$@"
  914. check_ld "cc" "$@" <<EOF
  915. int main(void){ return 0; }
  916. EOF
  917. }
  918. check_ldflags(){
  919. log check_ldflags "$@"
  920. test_ldflags "$@" && add_ldflags "$@"
  921. }
  922. test_stripflags(){
  923. log test_stripflags "$@"
  924. # call check_cc to get a fresh TMPO
  925. check_cc <<EOF
  926. int main(void) { return 0; }
  927. EOF
  928. check_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
  929. }
  930. check_stripflags(){
  931. log check_stripflags "$@"
  932. test_stripflags "$@" && add_stripflags "$@"
  933. }
  934. check_header(){
  935. log check_header "$@"
  936. header=$1
  937. shift
  938. disable_safe $header
  939. check_cpp "$@" <<EOF && enable_safe $header
  940. #include <$header>
  941. int x;
  942. EOF
  943. }
  944. check_header_objcc(){
  945. log check_header_objcc "$@"
  946. rm -f -- "$TMPO"
  947. header=$1
  948. shift
  949. disable_safe $header
  950. {
  951. echo "#include <$header>"
  952. echo "int main(void) { return 0; }"
  953. } | check_objcc && check_stat "$TMPO" && enable_safe $headers
  954. }
  955. check_func(){
  956. log check_func "$@"
  957. func=$1
  958. shift
  959. disable $func
  960. check_ld "cc" "$@" <<EOF && enable $func
  961. extern int $func();
  962. int main(void){ $func(); }
  963. EOF
  964. }
  965. check_complexfunc(){
  966. log check_complexfunc "$@"
  967. func=$1
  968. narg=$2
  969. shift 2
  970. test $narg = 2 && args="f, g" || args="f * I"
  971. disable $func
  972. check_ld "cc" "$@" <<EOF && enable $func
  973. #include <complex.h>
  974. #include <math.h>
  975. float foo(complex float f, complex float g) { return $func($args); }
  976. int main(void){ return (int) foo; }
  977. EOF
  978. }
  979. check_mathfunc(){
  980. log check_mathfunc "$@"
  981. func=$1
  982. narg=$2
  983. shift 2
  984. test $narg = 2 && args="f, g" || args="f"
  985. disable $func
  986. check_ld "cc" "$@" <<EOF && enable $func
  987. #include <math.h>
  988. float foo(float f, float g) { return $func($args); }
  989. int main(void){ return (int) foo; }
  990. EOF
  991. }
  992. check_func_headers(){
  993. log check_func_headers "$@"
  994. headers=$1
  995. funcs=$2
  996. shift 2
  997. {
  998. for hdr in $headers; do
  999. print_include $hdr
  1000. done
  1001. for func in $funcs; do
  1002. echo "long check_$func(void) { return (long) $func; }"
  1003. done
  1004. echo "int main(void) { return 0; }"
  1005. } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
  1006. }
  1007. check_class_headers_cpp(){
  1008. log check_class_headers_cpp "$@"
  1009. headers=$1
  1010. classes=$2
  1011. shift 2
  1012. {
  1013. for hdr in $headers; do
  1014. echo "#include <$hdr>"
  1015. done
  1016. echo "int main(void) { "
  1017. i=1
  1018. for class in $classes; do
  1019. echo "$class obj$i;"
  1020. i=$(expr $i + 1)
  1021. done
  1022. echo "return 0; }"
  1023. } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers
  1024. }
  1025. check_cpp_condition(){
  1026. log check_cpp_condition "$@"
  1027. header=$1
  1028. condition=$2
  1029. shift 2
  1030. check_cpp "$@" <<EOF
  1031. #include <$header>
  1032. #if !($condition)
  1033. #error "unsatisfied condition: $condition"
  1034. #endif
  1035. EOF
  1036. }
  1037. check_lib(){
  1038. log check_lib "$@"
  1039. header="$1"
  1040. func="$2"
  1041. shift 2
  1042. check_header $header && check_func $func "$@" && add_extralibs "$@"
  1043. }
  1044. check_lib2(){
  1045. log check_lib2 "$@"
  1046. headers="$1"
  1047. funcs="$2"
  1048. shift 2
  1049. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  1050. }
  1051. check_lib_cpp(){
  1052. log check_lib_cpp "$@"
  1053. headers="$1"
  1054. classes="$2"
  1055. shift 2
  1056. check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@"
  1057. }
  1058. check_pkg_config(){
  1059. log check_pkg_config "$@"
  1060. pkgandversion="$1"
  1061. pkg="${1%% *}"
  1062. headers="$2"
  1063. funcs="$3"
  1064. shift 3
  1065. check_cmd $pkg_config --exists --print-errors $pkgandversion || return
  1066. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1067. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1068. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  1069. set_safe "${pkg}_cflags" $pkg_cflags &&
  1070. set_safe "${pkg}_libs" $pkg_libs
  1071. }
  1072. check_exec(){
  1073. check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  1074. }
  1075. check_exec_crash(){
  1076. code=$(cat)
  1077. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  1078. # are safe but may not be available everywhere. Thus we use
  1079. # raise(SIGTERM) instead. The check is run in a subshell so we
  1080. # can redirect the "Terminated" message from the shell. SIGBUS
  1081. # is not defined by standard C so it is used conditionally.
  1082. (check_exec "$@") >> $logfile 2>&1 <<EOF
  1083. #include <signal.h>
  1084. static void sighandler(int sig){
  1085. raise(SIGTERM);
  1086. }
  1087. int foo(void){
  1088. $code
  1089. }
  1090. int (*func_ptr)(void) = foo;
  1091. int main(void){
  1092. signal(SIGILL, sighandler);
  1093. signal(SIGFPE, sighandler);
  1094. signal(SIGSEGV, sighandler);
  1095. #ifdef SIGBUS
  1096. signal(SIGBUS, sighandler);
  1097. #endif
  1098. return func_ptr();
  1099. }
  1100. EOF
  1101. }
  1102. check_type(){
  1103. log check_type "$@"
  1104. headers=$1
  1105. type=$2
  1106. shift 2
  1107. disable_safe "$type"
  1108. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  1109. }
  1110. check_struct(){
  1111. log check_struct "$@"
  1112. headers=$1
  1113. struct=$2
  1114. member=$3
  1115. shift 3
  1116. disable_safe "${struct}_${member}"
  1117. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  1118. enable_safe "${struct}_${member}"
  1119. }
  1120. check_builtin(){
  1121. log check_builtin "$@"
  1122. name=$1
  1123. headers=$2
  1124. builtin=$3
  1125. shift 3
  1126. disable "$name"
  1127. check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
  1128. }
  1129. check_compile_assert(){
  1130. log check_compile_assert "$@"
  1131. name=$1
  1132. headers=$2
  1133. condition=$3
  1134. shift 3
  1135. disable "$name"
  1136. check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  1137. }
  1138. require(){
  1139. name="$1"
  1140. header="$2"
  1141. func="$3"
  1142. shift 3
  1143. check_lib $header $func "$@" || die "ERROR: $name not found"
  1144. }
  1145. require2(){
  1146. name="$1"
  1147. headers="$2"
  1148. func="$3"
  1149. shift 3
  1150. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  1151. }
  1152. require_cpp(){
  1153. name="$1"
  1154. headers="$2"
  1155. classes="$3"
  1156. shift 3
  1157. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  1158. }
  1159. use_pkg_config(){
  1160. pkg="$1"
  1161. check_pkg_config "$@" || return 1
  1162. add_cflags $(get_safe "${pkg}_cflags")
  1163. add_extralibs $(get_safe "${pkg}_libs")
  1164. }
  1165. require_pkg_config(){
  1166. use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message"
  1167. }
  1168. require_libfreetype(){
  1169. log require_libfreetype "$@"
  1170. pkg="freetype2"
  1171. check_cmd $pkg_config --exists --print-errors $pkg \
  1172. || die "ERROR: $pkg not found"
  1173. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1174. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1175. {
  1176. echo "#include <ft2build.h>"
  1177. echo "#include FT_FREETYPE_H"
  1178. echo "long check_func(void) { return (long) FT_Init_FreeType; }"
  1179. echo "int main(void) { return 0; }"
  1180. } | check_ld "cc" $pkg_cflags $pkg_libs \
  1181. && set_safe "${pkg}_cflags" $pkg_cflags \
  1182. && set_safe "${pkg}_libs" $pkg_libs \
  1183. || die "ERROR: $pkg not found"
  1184. add_cflags $(get_safe "${pkg}_cflags")
  1185. add_extralibs $(get_safe "${pkg}_libs")
  1186. }
  1187. hostcc_e(){
  1188. eval printf '%s\\n' $HOSTCC_E
  1189. }
  1190. hostcc_o(){
  1191. eval printf '%s\\n' $HOSTCC_O
  1192. }
  1193. check_host_cc(){
  1194. log check_host_cc "$@"
  1195. cat > $TMPC
  1196. log_file $TMPC
  1197. check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  1198. }
  1199. check_host_cpp(){
  1200. log check_host_cpp "$@"
  1201. cat > $TMPC
  1202. log_file $TMPC
  1203. check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
  1204. }
  1205. check_host_cppflags(){
  1206. log check_host_cppflags "$@"
  1207. check_host_cc "$@" <<EOF && append host_cppflags "$@"
  1208. int x;
  1209. EOF
  1210. }
  1211. check_host_cflags(){
  1212. log check_host_cflags "$@"
  1213. set -- $($host_cflags_filter "$@")
  1214. check_host_cc "$@" <<EOF && append host_cflags "$@"
  1215. int x;
  1216. EOF
  1217. }
  1218. check_host_cpp_condition(){
  1219. log check_host_cpp_condition "$@"
  1220. header=$1
  1221. condition=$2
  1222. shift 2
  1223. check_host_cpp "$@" <<EOF
  1224. #include <$header>
  1225. #if !($condition)
  1226. #error "unsatisfied condition: $condition"
  1227. #endif
  1228. EOF
  1229. }
  1230. cp_if_changed(){
  1231. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  1232. mkdir -p "$(dirname $2)"
  1233. $cp_f "$1" "$2"
  1234. }
  1235. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  1236. # system-dependent things.
  1237. AVCODEC_COMPONENTS="
  1238. bsfs
  1239. decoders
  1240. encoders
  1241. hwaccels
  1242. parsers
  1243. "
  1244. AVDEVICE_COMPONENTS="
  1245. indevs
  1246. outdevs
  1247. "
  1248. AVFILTER_COMPONENTS="
  1249. filters
  1250. "
  1251. AVFORMAT_COMPONENTS="
  1252. demuxers
  1253. muxers
  1254. protocols
  1255. "
  1256. AVRESAMPLE_COMPONENTS=""
  1257. AVUTIL_COMPONENTS=""
  1258. COMPONENT_LIST="
  1259. $AVCODEC_COMPONENTS
  1260. $AVDEVICE_COMPONENTS
  1261. $AVFILTER_COMPONENTS
  1262. $AVFORMAT_COMPONENTS
  1263. $AVRESAMPLE_COMPONENTS
  1264. $AVUTIL_COMPONENTS
  1265. "
  1266. EXAMPLE_LIST="
  1267. avio_reading_example
  1268. avio_dir_cmd_example
  1269. decoding_encoding_example
  1270. demuxing_decoding_example
  1271. extract_mvs_example
  1272. filter_audio_example
  1273. filtering_audio_example
  1274. filtering_video_example
  1275. metadata_example
  1276. muxing_example
  1277. qsvdec_example
  1278. remuxing_example
  1279. resampling_audio_example
  1280. scaling_video_example
  1281. transcode_aac_example
  1282. transcoding_example
  1283. "
  1284. EXTERNAL_LIBRARY_LIST="
  1285. avisynth
  1286. bzlib
  1287. chromaprint
  1288. crystalhd
  1289. decklink
  1290. frei0r
  1291. gcrypt
  1292. gmp
  1293. gnutls
  1294. iconv
  1295. ladspa
  1296. libass
  1297. libbluray
  1298. libbs2b
  1299. libcaca
  1300. libcdio
  1301. libcelt
  1302. libdc1394
  1303. libdcadec
  1304. libfaac
  1305. libfdk_aac
  1306. libflite
  1307. libfontconfig
  1308. libfreetype
  1309. libfribidi
  1310. libgme
  1311. libgsm
  1312. libiec61883
  1313. libilbc
  1314. libkvazaar
  1315. libmfx
  1316. libmodplug
  1317. libmp3lame
  1318. libnut
  1319. libopencore_amrnb
  1320. libopencore_amrwb
  1321. libopencv
  1322. libopenh264
  1323. libopenjpeg
  1324. libopus
  1325. libpulse
  1326. librtmp
  1327. librubberband
  1328. libschroedinger
  1329. libshine
  1330. libsmbclient
  1331. libsnappy
  1332. libsoxr
  1333. libspeex
  1334. libssh
  1335. libtesseract
  1336. libtheora
  1337. libtwolame
  1338. libutvideo
  1339. libv4l2
  1340. libvidstab
  1341. libvo_amrwbenc
  1342. libvorbis
  1343. libvpx
  1344. libwavpack
  1345. libwebp
  1346. libx264
  1347. libx265
  1348. libxavs
  1349. libxcb
  1350. libxcb_shm
  1351. libxcb_shape
  1352. libxcb_xfixes
  1353. libxvid
  1354. libzimg
  1355. libzmq
  1356. libzvbi
  1357. lzma
  1358. mmal
  1359. netcdf
  1360. nvenc
  1361. openal
  1362. opencl
  1363. opengl
  1364. openssl
  1365. schannel
  1366. sdl
  1367. securetransport
  1368. x11grab
  1369. xlib
  1370. zlib
  1371. "
  1372. DOCUMENT_LIST="
  1373. doc
  1374. htmlpages
  1375. manpages
  1376. podpages
  1377. txtpages
  1378. "
  1379. FEATURE_LIST="
  1380. ftrapv
  1381. gray
  1382. hardcoded_tables
  1383. runtime_cpudetect
  1384. safe_bitstream_reader
  1385. shared
  1386. small
  1387. static
  1388. swscale_alpha
  1389. "
  1390. HWACCEL_LIST="
  1391. d3d11va
  1392. dxva2
  1393. vaapi
  1394. vda
  1395. vdpau
  1396. videotoolbox
  1397. xvmc
  1398. "
  1399. LIBRARY_LIST="
  1400. avcodec
  1401. avdevice
  1402. avfilter
  1403. avformat
  1404. avresample
  1405. avutil
  1406. postproc
  1407. swresample
  1408. swscale
  1409. "
  1410. LICENSE_LIST="
  1411. gpl
  1412. nonfree
  1413. version3
  1414. "
  1415. PROGRAM_LIST="
  1416. ffplay
  1417. ffprobe
  1418. ffserver
  1419. ffmpeg
  1420. "
  1421. SUBSYSTEM_LIST="
  1422. dct
  1423. dwt
  1424. error_resilience
  1425. faan
  1426. fast_unaligned
  1427. fft
  1428. lsp
  1429. lzo
  1430. mdct
  1431. pixelutils
  1432. network
  1433. rdft
  1434. "
  1435. CONFIG_LIST="
  1436. $COMPONENT_LIST
  1437. $DOCUMENT_LIST
  1438. $EXAMPLE_LIST
  1439. $EXTERNAL_LIBRARY_LIST
  1440. $FEATURE_LIST
  1441. $HWACCEL_LIST
  1442. $LICENSE_LIST
  1443. $LIBRARY_LIST
  1444. $PROGRAM_LIST
  1445. $SUBSYSTEM_LIST
  1446. fontconfig
  1447. incompatible_libav_abi
  1448. memalign_hack
  1449. memory_poisoning
  1450. neon_clobber_test
  1451. pic
  1452. pod2man
  1453. raise_major
  1454. thumb
  1455. valgrind_backtrace
  1456. xmm_clobber_test
  1457. "
  1458. THREADS_LIST="
  1459. pthreads
  1460. os2threads
  1461. w32threads
  1462. "
  1463. ATOMICS_LIST="
  1464. atomics_gcc
  1465. atomics_suncc
  1466. atomics_win32
  1467. "
  1468. ARCH_LIST="
  1469. aarch64
  1470. alpha
  1471. arm
  1472. avr32
  1473. avr32_ap
  1474. avr32_uc
  1475. bfin
  1476. ia64
  1477. m68k
  1478. mips
  1479. mips64
  1480. parisc
  1481. ppc
  1482. ppc64
  1483. s390
  1484. sh4
  1485. sparc
  1486. sparc64
  1487. tilegx
  1488. tilepro
  1489. tomi
  1490. x86
  1491. x86_32
  1492. x86_64
  1493. "
  1494. ARCH_EXT_LIST_ARM="
  1495. armv5te
  1496. armv6
  1497. armv6t2
  1498. armv8
  1499. neon
  1500. vfp
  1501. vfpv3
  1502. setend
  1503. "
  1504. ARCH_EXT_LIST_MIPS="
  1505. mipsfpu
  1506. mips32r2
  1507. mips32r5
  1508. mips64r2
  1509. mips32r6
  1510. mips64r6
  1511. mipsdsp
  1512. mipsdspr2
  1513. msa
  1514. "
  1515. ARCH_EXT_LIST_LOONGSON="
  1516. loongson2
  1517. loongson3
  1518. mmi
  1519. "
  1520. ARCH_EXT_LIST_X86_SIMD="
  1521. aesni
  1522. amd3dnow
  1523. amd3dnowext
  1524. avx
  1525. avx2
  1526. fma3
  1527. fma4
  1528. mmx
  1529. mmxext
  1530. sse
  1531. sse2
  1532. sse3
  1533. sse4
  1534. sse42
  1535. ssse3
  1536. xop
  1537. "
  1538. ARCH_EXT_LIST_PPC="
  1539. altivec
  1540. dcbzl
  1541. ldbrx
  1542. power8
  1543. ppc4xx
  1544. vsx
  1545. "
  1546. ARCH_EXT_LIST_X86="
  1547. $ARCH_EXT_LIST_X86_SIMD
  1548. cpunop
  1549. i686
  1550. "
  1551. ARCH_EXT_LIST="
  1552. $ARCH_EXT_LIST_ARM
  1553. $ARCH_EXT_LIST_PPC
  1554. $ARCH_EXT_LIST_X86
  1555. $ARCH_EXT_LIST_MIPS
  1556. $ARCH_EXT_LIST_LOONGSON
  1557. "
  1558. ARCH_FEATURES="
  1559. aligned_stack
  1560. fast_64bit
  1561. fast_clz
  1562. fast_cmov
  1563. local_aligned_8
  1564. local_aligned_16
  1565. local_aligned_32
  1566. simd_align_16
  1567. "
  1568. BUILTIN_LIST="
  1569. atomic_cas_ptr
  1570. atomic_compare_exchange
  1571. machine_rw_barrier
  1572. MemoryBarrier
  1573. mm_empty
  1574. rdtsc
  1575. sarestart
  1576. sync_val_compare_and_swap
  1577. "
  1578. HAVE_LIST_CMDLINE="
  1579. inline_asm
  1580. symver
  1581. yasm
  1582. "
  1583. HAVE_LIST_PUB="
  1584. bigendian
  1585. fast_unaligned
  1586. incompatible_libav_abi
  1587. "
  1588. HEADERS_LIST="
  1589. alsa_asoundlib_h
  1590. altivec_h
  1591. arpa_inet_h
  1592. asm_types_h
  1593. cdio_paranoia_h
  1594. cdio_paranoia_paranoia_h
  1595. dev_bktr_ioctl_bt848_h
  1596. dev_bktr_ioctl_meteor_h
  1597. dev_ic_bt8xx_h
  1598. dev_video_bktr_ioctl_bt848_h
  1599. dev_video_meteor_ioctl_meteor_h
  1600. direct_h
  1601. dirent_h
  1602. dlfcn_h
  1603. d3d11_h
  1604. dxva_h
  1605. ES2_gl_h
  1606. gsm_h
  1607. io_h
  1608. mach_mach_time_h
  1609. machine_ioctl_bt848_h
  1610. machine_ioctl_meteor_h
  1611. malloc_h
  1612. opencv2_core_core_c_h
  1613. openjpeg_2_1_openjpeg_h
  1614. openjpeg_2_0_openjpeg_h
  1615. openjpeg_1_5_openjpeg_h
  1616. OpenGL_gl3_h
  1617. poll_h
  1618. sndio_h
  1619. soundcard_h
  1620. sys_mman_h
  1621. sys_param_h
  1622. sys_resource_h
  1623. sys_select_h
  1624. sys_soundcard_h
  1625. sys_time_h
  1626. sys_un_h
  1627. sys_videoio_h
  1628. termios_h
  1629. udplite_h
  1630. unistd_h
  1631. valgrind_valgrind_h
  1632. windows_h
  1633. winsock2_h
  1634. "
  1635. INTRINSICS_LIST="
  1636. intrinsics_neon
  1637. "
  1638. COMPLEX_FUNCS="
  1639. cabs
  1640. cexp
  1641. "
  1642. MATH_FUNCS="
  1643. atanf
  1644. atan2f
  1645. cbrt
  1646. cbrtf
  1647. copysign
  1648. cosf
  1649. erf
  1650. exp2
  1651. exp2f
  1652. expf
  1653. hypot
  1654. isfinite
  1655. isinf
  1656. isnan
  1657. ldexpf
  1658. llrint
  1659. llrintf
  1660. log2
  1661. log2f
  1662. log10f
  1663. lrint
  1664. lrintf
  1665. powf
  1666. rint
  1667. round
  1668. roundf
  1669. sinf
  1670. trunc
  1671. truncf
  1672. "
  1673. SYSTEM_FUNCS="
  1674. access
  1675. aligned_malloc
  1676. arc4random
  1677. clock_gettime
  1678. closesocket
  1679. CommandLineToArgvW
  1680. CoTaskMemFree
  1681. CryptGenRandom
  1682. dlopen
  1683. fcntl
  1684. flt_lim
  1685. fork
  1686. getaddrinfo
  1687. gethrtime
  1688. getopt
  1689. GetProcessAffinityMask
  1690. GetProcessMemoryInfo
  1691. GetProcessTimes
  1692. getrusage
  1693. GetSystemTimeAsFileTime
  1694. gettimeofday
  1695. glob
  1696. glXGetProcAddress
  1697. gmtime_r
  1698. inet_aton
  1699. isatty
  1700. jack_port_get_latency_range
  1701. kbhit
  1702. localtime_r
  1703. lstat
  1704. lzo1x_999_compress
  1705. mach_absolute_time
  1706. MapViewOfFile
  1707. memalign
  1708. mkstemp
  1709. mmap
  1710. mprotect
  1711. nanosleep
  1712. PeekNamedPipe
  1713. posix_memalign
  1714. pthread_cancel
  1715. sched_getaffinity
  1716. SetConsoleTextAttribute
  1717. SetConsoleCtrlHandler
  1718. SetDllDirectory
  1719. setmode
  1720. setrlimit
  1721. Sleep
  1722. strerror_r
  1723. sysconf
  1724. sysctl
  1725. usleep
  1726. UTGetOSTypeFromString
  1727. VirtualAlloc
  1728. wglGetProcAddress
  1729. "
  1730. TOOLCHAIN_FEATURES="
  1731. as_dn_directive
  1732. as_func
  1733. as_object_arch
  1734. asm_mod_q
  1735. attribute_may_alias
  1736. attribute_packed
  1737. ebp_available
  1738. ebx_available
  1739. gnu_as
  1740. gnu_windres
  1741. ibm_asm
  1742. inline_asm_direct_symbol_refs
  1743. inline_asm_labels
  1744. inline_asm_nonlocal_labels
  1745. pragma_deprecated
  1746. rsync_contimeout
  1747. symver_asm_label
  1748. symver_gnu_asm
  1749. vfp_args
  1750. xform_asm
  1751. xmm_clobbers
  1752. "
  1753. TYPES_LIST="
  1754. CONDITION_VARIABLE_Ptr
  1755. socklen_t
  1756. struct_addrinfo
  1757. struct_group_source_req
  1758. struct_ip_mreq_source
  1759. struct_ipv6_mreq
  1760. struct_pollfd
  1761. struct_rusage_ru_maxrss
  1762. struct_sctp_event_subscribe
  1763. struct_sockaddr_in6
  1764. struct_sockaddr_sa_len
  1765. struct_sockaddr_storage
  1766. struct_stat_st_mtim_tv_nsec
  1767. struct_v4l2_frmivalenum_discrete
  1768. "
  1769. HAVE_LIST="
  1770. $ARCH_EXT_LIST
  1771. $(add_suffix _external $ARCH_EXT_LIST)
  1772. $(add_suffix _inline $ARCH_EXT_LIST)
  1773. $ARCH_FEATURES
  1774. $ATOMICS_LIST
  1775. $BUILTIN_LIST
  1776. $COMPLEX_FUNCS
  1777. $HAVE_LIST_CMDLINE
  1778. $HAVE_LIST_PUB
  1779. $HEADERS_LIST
  1780. $INTRINSICS_LIST
  1781. $MATH_FUNCS
  1782. $SYSTEM_FUNCS
  1783. $THREADS_LIST
  1784. $TOOLCHAIN_FEATURES
  1785. $TYPES_LIST
  1786. atomics_native
  1787. dos_paths
  1788. dxva2_lib
  1789. dxva2api_cobj
  1790. libc_msvcrt
  1791. libdc1394_1
  1792. libdc1394_2
  1793. makeinfo
  1794. makeinfo_html
  1795. perl
  1796. pod2man
  1797. sdl
  1798. section_data_rel_ro
  1799. texi2html
  1800. threads
  1801. vaapi_x11
  1802. vdpau_x11
  1803. winrt
  1804. xlib
  1805. "
  1806. # options emitted with CONFIG_ prefix but not available on the command line
  1807. CONFIG_EXTRA="
  1808. aandcttables
  1809. ac3dsp
  1810. audio_frame_queue
  1811. audiodsp
  1812. blockdsp
  1813. bswapdsp
  1814. cabac
  1815. dirac_parse
  1816. dvprofile
  1817. exif
  1818. faandct
  1819. faanidct
  1820. fdctdsp
  1821. flacdsp
  1822. fmtconvert
  1823. frame_thread_encoder
  1824. g722dsp
  1825. golomb
  1826. gplv3
  1827. h263dsp
  1828. h264chroma
  1829. h264dsp
  1830. h264pred
  1831. h264qpel
  1832. hpeldsp
  1833. huffman
  1834. huffyuvdsp
  1835. huffyuvencdsp
  1836. idctdsp
  1837. iirfilter
  1838. imdct15
  1839. intrax8
  1840. ividsp
  1841. jpegtables
  1842. lgplv3
  1843. libx262
  1844. llauddsp
  1845. llviddsp
  1846. lpc
  1847. lzf
  1848. me_cmp
  1849. mpeg_er
  1850. mpegaudio
  1851. mpegaudiodsp
  1852. mpegvideo
  1853. mpegvideoenc
  1854. mss34dsp
  1855. pixblockdsp
  1856. qpeldsp
  1857. qsv
  1858. qsvdec
  1859. qsvenc
  1860. rangecoder
  1861. riffdec
  1862. riffenc
  1863. rtpdec
  1864. rtpenc_chain
  1865. rv34dsp
  1866. sinewin
  1867. snappy
  1868. startcode
  1869. texturedsp
  1870. texturedspenc
  1871. tpeldsp
  1872. videodsp
  1873. vp3dsp
  1874. vp56dsp
  1875. vp8dsp
  1876. wma_freqs
  1877. wmv2dsp
  1878. "
  1879. CMDLINE_SELECT="
  1880. $ARCH_EXT_LIST
  1881. $CONFIG_LIST
  1882. $HAVE_LIST_CMDLINE
  1883. $THREADS_LIST
  1884. asm
  1885. cross_compile
  1886. debug
  1887. extra_warnings
  1888. logging
  1889. lto
  1890. optimizations
  1891. rpath
  1892. stripping
  1893. "
  1894. PATHS_LIST="
  1895. bindir
  1896. datadir
  1897. docdir
  1898. incdir
  1899. libdir
  1900. mandir
  1901. pkgconfigdir
  1902. prefix
  1903. shlibdir
  1904. "
  1905. CMDLINE_SET="
  1906. $PATHS_LIST
  1907. ar
  1908. arch
  1909. as
  1910. assert_level
  1911. build_suffix
  1912. cc
  1913. objcc
  1914. cpu
  1915. cross_prefix
  1916. custom_allocator
  1917. cxx
  1918. dep_cc
  1919. doxygen
  1920. env
  1921. extra_version
  1922. gas
  1923. host_cc
  1924. host_cflags
  1925. host_ld
  1926. host_ldflags
  1927. host_libs
  1928. host_os
  1929. install
  1930. ld
  1931. logfile
  1932. malloc_prefix
  1933. nm
  1934. optflags
  1935. pkg_config
  1936. pkg_config_flags
  1937. progs_suffix
  1938. random_seed
  1939. ranlib
  1940. samples
  1941. strip
  1942. sws_max_filter_size
  1943. sysinclude
  1944. sysroot
  1945. target_exec
  1946. target_os
  1947. target_path
  1948. target_samples
  1949. tempprefix
  1950. toolchain
  1951. valgrind
  1952. yasmexe
  1953. "
  1954. CMDLINE_APPEND="
  1955. extra_cflags
  1956. extra_cxxflags
  1957. extra_objcflags
  1958. host_cppflags
  1959. "
  1960. # code dependency declarations
  1961. # architecture extensions
  1962. armv5te_deps="arm"
  1963. armv6_deps="arm"
  1964. armv6t2_deps="arm"
  1965. armv8_deps="aarch64"
  1966. neon_deps_any="aarch64 arm"
  1967. intrinsics_neon_deps="neon"
  1968. vfp_deps_any="aarch64 arm"
  1969. vfpv3_deps="vfp"
  1970. setend_deps="arm"
  1971. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  1972. mipsfpu_deps="mips"
  1973. mipsdsp_deps="mips"
  1974. mipsdspr2_deps="mips"
  1975. mips32r2_deps="mips"
  1976. mips32r5_deps="mips"
  1977. mips32r6_deps="mips"
  1978. mips64r2_deps="mips"
  1979. mips64r6_deps="mips"
  1980. msa_deps="mipsfpu"
  1981. mmi_deps="mips"
  1982. altivec_deps="ppc"
  1983. dcbzl_deps="ppc"
  1984. ldbrx_deps="ppc"
  1985. ppc4xx_deps="ppc"
  1986. vsx_deps="altivec"
  1987. power8_deps="vsx"
  1988. cpunop_deps="i686"
  1989. x86_64_select="i686"
  1990. x86_64_suggest="fast_cmov"
  1991. amd3dnow_deps="mmx"
  1992. amd3dnowext_deps="amd3dnow"
  1993. i686_deps="x86"
  1994. mmx_deps="x86"
  1995. mmxext_deps="mmx"
  1996. sse_deps="mmxext"
  1997. sse2_deps="sse"
  1998. sse3_deps="sse2"
  1999. ssse3_deps="sse3"
  2000. sse4_deps="ssse3"
  2001. sse42_deps="sse4"
  2002. aesni_deps="sse42"
  2003. avx_deps="sse42"
  2004. xop_deps="avx"
  2005. fma3_deps="avx"
  2006. fma4_deps="avx"
  2007. avx2_deps="avx"
  2008. mmx_external_deps="yasm"
  2009. mmx_inline_deps="inline_asm"
  2010. mmx_suggest="mmx_external mmx_inline"
  2011. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  2012. eval dep=\$${ext}_deps
  2013. eval ${ext}_external_deps='"${dep}_external"'
  2014. eval ${ext}_inline_deps='"${dep}_inline"'
  2015. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  2016. done
  2017. aligned_stack_if_any="aarch64 ppc x86"
  2018. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  2019. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  2020. fast_unaligned_if_any="aarch64 ppc x86"
  2021. simd_align_16_if_any="altivec neon sse"
  2022. # system capabilities
  2023. symver_if_any="symver_asm_label symver_gnu_asm"
  2024. valgrind_backtrace_deps="!optimizations valgrind_valgrind_h"
  2025. # threading support
  2026. atomics_gcc_if_any="sync_val_compare_and_swap atomic_compare_exchange"
  2027. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  2028. atomics_win32_if="MemoryBarrier"
  2029. atomics_native_if_any="$ATOMICS_LIST"
  2030. w32threads_deps="atomics_native"
  2031. threads_if_any="$THREADS_LIST"
  2032. # subsystems
  2033. dct_select="rdft"
  2034. dirac_parse_select="golomb"
  2035. error_resilience_select="me_cmp"
  2036. faandct_deps="faan fdctdsp"
  2037. faanidct_deps="faan idctdsp"
  2038. frame_thread_encoder_deps="encoders threads"
  2039. intrax8_select="error_resilience"
  2040. mdct_select="fft"
  2041. me_cmp_select="fdctdsp idctdsp pixblockdsp"
  2042. mpeg_er_select="error_resilience"
  2043. mpegaudio_select="mpegaudiodsp"
  2044. mpegaudiodsp_select="dct"
  2045. mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp mpeg_er videodsp"
  2046. mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
  2047. qsvdec_select="qsv"
  2048. qsvenc_select="qsv"
  2049. rdft_select="fft"
  2050. # decoders / encoders
  2051. aac_decoder_select="imdct15 mdct sinewin"
  2052. aac_fixed_decoder_select="mdct sinewin"
  2053. aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin"
  2054. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  2055. ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
  2056. ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
  2057. ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
  2058. ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
  2059. adpcm_g722_decoder_select="g722dsp"
  2060. adpcm_g722_encoder_select="g722dsp"
  2061. aic_decoder_select="golomb idctdsp"
  2062. alac_encoder_select="lpc"
  2063. als_decoder_select="bswapdsp"
  2064. amrnb_decoder_select="lsp"
  2065. amrwb_decoder_select="lsp"
  2066. amv_decoder_select="sp5x_decoder exif"
  2067. amv_encoder_select="aandcttables jpegtables mpegvideoenc"
  2068. ape_decoder_select="bswapdsp llauddsp"
  2069. apng_decoder_select="zlib"
  2070. apng_encoder_select="huffyuvencdsp zlib"
  2071. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  2072. asv1_encoder_select="bswapdsp fdctdsp pixblockdsp"
  2073. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  2074. asv2_encoder_select="bswapdsp fdctdsp pixblockdsp"
  2075. atrac1_decoder_select="mdct sinewin"
  2076. atrac3_decoder_select="mdct"
  2077. atrac3p_decoder_select="mdct sinewin"
  2078. avrn_decoder_select="exif jpegtables"
  2079. bink_decoder_select="blockdsp hpeldsp"
  2080. binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
  2081. binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
  2082. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  2083. cllc_decoder_select="bswapdsp"
  2084. comfortnoise_encoder_select="lpc"
  2085. cook_decoder_select="audiodsp mdct sinewin"
  2086. cscd_decoder_select="lzo"
  2087. cscd_decoder_suggest="zlib"
  2088. dca_decoder_select="mdct"
  2089. dds_decoder_select="texturedsp"
  2090. dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
  2091. dnxhd_decoder_select="blockdsp idctdsp"
  2092. dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
  2093. dvvideo_decoder_select="dvprofile idctdsp"
  2094. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  2095. dxa_decoder_select="zlib"
  2096. dxv_decoder_select="lzf texturedsp"
  2097. eac3_decoder_select="ac3_decoder"
  2098. eac3_encoder_select="ac3_encoder"
  2099. eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
  2100. eatgq_decoder_select="aandcttables"
  2101. eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpeg1video_decoder"
  2102. exr_decoder_select="zlib"
  2103. ffv1_decoder_select="golomb rangecoder"
  2104. ffv1_encoder_select="rangecoder"
  2105. ffvhuff_decoder_select="huffyuv_decoder"
  2106. ffvhuff_encoder_select="huffyuv_encoder"
  2107. fic_decoder_select="golomb"
  2108. flac_decoder_select="flacdsp golomb"
  2109. flac_encoder_select="bswapdsp flacdsp golomb lpc"
  2110. flashsv2_decoder_select="zlib"
  2111. flashsv2_encoder_select="zlib"
  2112. flashsv_decoder_select="zlib"
  2113. flashsv_encoder_select="zlib"
  2114. flv_decoder_select="h263_decoder"
  2115. flv_encoder_select="h263_encoder"
  2116. fourxm_decoder_select="blockdsp bswapdsp"
  2117. fraps_decoder_select="bswapdsp huffman"
  2118. g2m_decoder_select="blockdsp idctdsp jpegtables zlib"
  2119. g729_decoder_select="audiodsp"
  2120. h261_decoder_select="mpegvideo"
  2121. h261_encoder_select="aandcttables mpegvideoenc"
  2122. h263_decoder_select="h263_parser h263dsp mpegvideo qpeldsp"
  2123. h263_encoder_select="aandcttables h263dsp mpegvideoenc"
  2124. h263i_decoder_select="h263_decoder"
  2125. h263p_decoder_select="h263_decoder"
  2126. h263p_encoder_select="h263_encoder"
  2127. h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
  2128. h264_decoder_suggest="error_resilience"
  2129. h264_qsv_decoder_deps="libmfx"
  2130. h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
  2131. h264_qsv_encoder_deps="libmfx"
  2132. h264_qsv_encoder_select="qsvenc"
  2133. hap_decoder_select="snappy texturedsp"
  2134. hap_encoder_deps="libsnappy"
  2135. hap_encoder_select="texturedspenc"
  2136. hevc_decoder_select="bswapdsp cabac golomb videodsp"
  2137. hevc_qsv_decoder_deps="libmfx"
  2138. hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec hevc_qsv_hwaccel"
  2139. hevc_qsv_encoder_deps="libmfx"
  2140. hevc_qsv_encoder_select="qsvenc"
  2141. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  2142. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llviddsp"
  2143. iac_decoder_select="imc_decoder"
  2144. imc_decoder_select="bswapdsp fft mdct sinewin"
  2145. indeo3_decoder_select="hpeldsp"
  2146. indeo4_decoder_select="ividsp"
  2147. indeo5_decoder_select="ividsp"
  2148. interplay_video_decoder_select="hpeldsp"
  2149. jpegls_decoder_select="golomb mjpeg_decoder"
  2150. jpegls_encoder_select="golomb"
  2151. jv_decoder_select="blockdsp"
  2152. lagarith_decoder_select="huffyuvdsp"
  2153. ljpeg_encoder_select="aandcttables idctdsp jpegtables"
  2154. loco_decoder_select="golomb"
  2155. mdec_decoder_select="blockdsp idctdsp mpegvideo"
  2156. metasound_decoder_select="lsp mdct sinewin"
  2157. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  2158. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
  2159. mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
  2160. mjpegb_decoder_select="mjpeg_decoder"
  2161. mlp_decoder_select="mlp_parser"
  2162. motionpixels_decoder_select="bswapdsp"
  2163. mp1_decoder_select="mpegaudio"
  2164. mp1float_decoder_select="mpegaudio"
  2165. mp2_decoder_select="mpegaudio"
  2166. mp2float_decoder_select="mpegaudio"
  2167. mp3_decoder_select="mpegaudio"
  2168. mp3adu_decoder_select="mpegaudio"
  2169. mp3adufloat_decoder_select="mpegaudio"
  2170. mp3float_decoder_select="mpegaudio"
  2171. mp3on4_decoder_select="mpegaudio"
  2172. mp3on4float_decoder_select="mpegaudio"
  2173. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  2174. mpc8_decoder_select="mpegaudiodsp"
  2175. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  2176. mpeg_xvmc_decoder_select="mpeg2video_decoder"
  2177. mpegvideo_decoder_select="mpegvideo"
  2178. mpeg1video_decoder_select="mpegvideo"
  2179. mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2180. mpeg2video_decoder_select="mpegvideo"
  2181. mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2182. mpeg2_qsv_decoder_deps="libmfx"
  2183. mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel"
  2184. mpeg2_qsv_encoder_deps="libmfx"
  2185. mpeg2_qsv_encoder_select="qsvenc"
  2186. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  2187. mpeg4_encoder_select="h263_encoder"
  2188. msa1_decoder_select="mss34dsp"
  2189. msmpeg4v1_decoder_select="h263_decoder"
  2190. msmpeg4v2_decoder_select="h263_decoder"
  2191. msmpeg4v2_encoder_select="h263_encoder"
  2192. msmpeg4v3_decoder_select="h263_decoder"
  2193. msmpeg4v3_encoder_select="h263_encoder"
  2194. mss2_decoder_select="vc1_decoder"
  2195. mts2_decoder_select="mss34dsp"
  2196. mxpeg_decoder_select="mjpeg_decoder"
  2197. nellymoser_decoder_select="mdct sinewin"
  2198. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  2199. nuv_decoder_select="idctdsp lzo"
  2200. on2avc_decoder_select="mdct"
  2201. opus_decoder_deps="swresample"
  2202. opus_decoder_select="imdct15"
  2203. png_decoder_select="zlib"
  2204. png_encoder_select="huffyuvencdsp zlib"
  2205. prores_decoder_select="blockdsp idctdsp"
  2206. prores_encoder_select="fdctdsp"
  2207. qcelp_decoder_select="lsp"
  2208. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  2209. ra_144_decoder_select="audiodsp"
  2210. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  2211. ralf_decoder_select="golomb"
  2212. rawvideo_decoder_select="bswapdsp"
  2213. rscc_decoder_select="zlib"
  2214. rtjpeg_decoder_select="me_cmp"
  2215. rv10_decoder_select="h263_decoder"
  2216. rv10_encoder_select="h263_encoder"
  2217. rv20_decoder_select="h263_decoder"
  2218. rv20_encoder_select="h263_encoder"
  2219. rv30_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
  2220. rv40_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
  2221. screenpresso_decoder_select="zlib"
  2222. shorten_decoder_select="golomb"
  2223. sipr_decoder_select="lsp"
  2224. snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
  2225. snow_encoder_select="aandcttables dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder"
  2226. sonic_decoder_select="golomb rangecoder"
  2227. sonic_encoder_select="golomb rangecoder"
  2228. sonic_ls_encoder_select="golomb rangecoder"
  2229. sp5x_decoder_select="mjpeg_decoder"
  2230. svq1_decoder_select="hpeldsp"
  2231. svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
  2232. svq3_decoder_select="h264_decoder hpeldsp tpeldsp"
  2233. svq3_decoder_suggest="zlib"
  2234. tak_decoder_select="audiodsp"
  2235. tdsc_decoder_select="zlib mjpeg_decoder"
  2236. theora_decoder_select="vp3_decoder"
  2237. thp_decoder_select="mjpeg_decoder"
  2238. tiff_decoder_suggest="zlib lzma"
  2239. tiff_encoder_suggest="zlib"
  2240. truehd_decoder_select="mlp_parser"
  2241. truemotion2_decoder_select="bswapdsp"
  2242. truespeech_decoder_select="bswapdsp"
  2243. tscc_decoder_select="zlib"
  2244. twinvq_decoder_select="mdct lsp sinewin"
  2245. txd_decoder_select="texturedsp"
  2246. utvideo_decoder_select="bswapdsp"
  2247. utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
  2248. vble_decoder_select="huffyuvdsp"
  2249. vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 qpeldsp startcode"
  2250. vc1_qsv_decoder_deps="libmfx"
  2251. vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel"
  2252. vc1image_decoder_select="vc1_decoder"
  2253. vorbis_decoder_select="mdct"
  2254. vorbis_encoder_select="mdct"
  2255. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2256. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
  2257. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
  2258. vp6a_decoder_select="vp6_decoder"
  2259. vp6f_decoder_select="vp6_decoder"
  2260. vp7_decoder_select="h264pred videodsp vp8dsp"
  2261. vp8_decoder_select="h264pred videodsp vp8dsp"
  2262. vp9_decoder_select="videodsp vp9_parser"
  2263. webp_decoder_select="vp8_decoder exif"
  2264. wmalossless_decoder_select="llauddsp"
  2265. wmapro_decoder_select="mdct sinewin wma_freqs"
  2266. wmav1_decoder_select="mdct sinewin wma_freqs"
  2267. wmav1_encoder_select="mdct sinewin wma_freqs"
  2268. wmav2_decoder_select="mdct sinewin wma_freqs"
  2269. wmav2_encoder_select="mdct sinewin wma_freqs"
  2270. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  2271. wmv1_decoder_select="h263_decoder"
  2272. wmv1_encoder_select="h263_encoder"
  2273. wmv2_decoder_select="blockdsp h263_decoder idctdsp intrax8 videodsp wmv2dsp"
  2274. wmv2_encoder_select="h263_encoder wmv2dsp"
  2275. wmv3_decoder_select="vc1_decoder"
  2276. wmv3image_decoder_select="wmv3_decoder"
  2277. xma1_decoder_select="wmapro_decoder"
  2278. xma2_decoder_select="wmapro_decoder"
  2279. zerocodec_decoder_select="zlib"
  2280. zlib_decoder_select="zlib"
  2281. zlib_encoder_select="zlib"
  2282. zmbv_decoder_select="zlib"
  2283. zmbv_encoder_select="zlib"
  2284. # hardware accelerators
  2285. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2286. d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
  2287. dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
  2288. vaapi_deps="va_va_h"
  2289. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  2290. vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
  2291. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  2292. videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads"
  2293. videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework QuartzCore -framework CoreVideo"
  2294. xvmc_deps="X11_extensions_XvMClib_h"
  2295. h263_vaapi_hwaccel_deps="vaapi"
  2296. h263_vaapi_hwaccel_select="h263_decoder"
  2297. h263_videotoolbox_hwaccel_deps="videotoolbox"
  2298. h263_videotoolbox_hwaccel_select="h263_decoder"
  2299. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2300. h264_d3d11va_hwaccel_deps="d3d11va"
  2301. h264_d3d11va_hwaccel_select="h264_decoder"
  2302. h264_dxva2_hwaccel_deps="dxva2"
  2303. h264_dxva2_hwaccel_select="h264_decoder"
  2304. h264_mmal_decoder_deps="mmal"
  2305. h264_mmal_decoder_select="mmal"
  2306. h264_mmal_hwaccel_deps="mmal"
  2307. h264_qsv_hwaccel_deps="libmfx"
  2308. h264_vaapi_hwaccel_deps="vaapi"
  2309. h264_vaapi_hwaccel_select="h264_decoder"
  2310. h264_vda_decoder_deps="vda"
  2311. h264_vda_decoder_select="h264_decoder"
  2312. h264_vda_hwaccel_deps="vda"
  2313. h264_vda_hwaccel_select="h264_decoder"
  2314. h264_vda_old_hwaccel_deps="vda"
  2315. h264_vda_old_hwaccel_select="h264_decoder"
  2316. h264_vdpau_decoder_deps="vdpau"
  2317. h264_vdpau_decoder_select="h264_decoder"
  2318. h264_vdpau_hwaccel_deps="vdpau"
  2319. h264_vdpau_hwaccel_select="h264_decoder"
  2320. h264_videotoolbox_hwaccel_deps="videotoolbox"
  2321. h264_videotoolbox_hwaccel_select="h264_decoder"
  2322. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2323. hevc_d3d11va_hwaccel_select="hevc_decoder"
  2324. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2325. hevc_dxva2_hwaccel_select="hevc_decoder"
  2326. hevc_qsv_hwaccel_deps="libmfx"
  2327. hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
  2328. hevc_vaapi_hwaccel_select="hevc_decoder"
  2329. hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
  2330. hevc_vdpau_hwaccel_select="hevc_decoder"
  2331. mpeg_vdpau_decoder_deps="vdpau"
  2332. mpeg_vdpau_decoder_select="mpeg2video_decoder"
  2333. mpeg_xvmc_hwaccel_deps="xvmc"
  2334. mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
  2335. mpeg1_vdpau_decoder_deps="vdpau"
  2336. mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  2337. mpeg1_vdpau_hwaccel_deps="vdpau"
  2338. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2339. mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
  2340. mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
  2341. mpeg1_xvmc_hwaccel_deps="xvmc"
  2342. mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
  2343. mpeg2_crystalhd_decoder_select="crystalhd"
  2344. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  2345. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  2346. mpeg2_dxva2_hwaccel_deps="dxva2"
  2347. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2348. mpeg2_mmal_decoder_deps="mmal"
  2349. mpeg2_mmal_decoder_select="mmal"
  2350. mpeg2_mmal_hwaccel_deps="mmal"
  2351. mpeg2_qsv_hwaccel_deps="libmfx"
  2352. mpeg2_qsv_hwaccel_select="qsvdec_mpeg2"
  2353. mpeg2_vaapi_hwaccel_deps="vaapi"
  2354. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2355. mpeg2_vdpau_hwaccel_deps="vdpau"
  2356. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2357. mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
  2358. mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
  2359. mpeg2_xvmc_hwaccel_deps="xvmc"
  2360. mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
  2361. mpeg4_crystalhd_decoder_select="crystalhd"
  2362. mpeg4_mmal_decoder_deps="mmal"
  2363. mpeg4_mmal_decoder_select="mmal"
  2364. mpeg4_mmal_hwaccel_deps="mmal"
  2365. mpeg4_vaapi_hwaccel_deps="vaapi"
  2366. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2367. mpeg4_vdpau_decoder_deps="vdpau"
  2368. mpeg4_vdpau_decoder_select="mpeg4_decoder"
  2369. mpeg4_vdpau_hwaccel_deps="vdpau"
  2370. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2371. mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
  2372. mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
  2373. msmpeg4_crystalhd_decoder_select="crystalhd"
  2374. vc1_crystalhd_decoder_select="crystalhd"
  2375. vc1_d3d11va_hwaccel_deps="d3d11va"
  2376. vc1_d3d11va_hwaccel_select="vc1_decoder"
  2377. vc1_dxva2_hwaccel_deps="dxva2"
  2378. vc1_dxva2_hwaccel_select="vc1_decoder"
  2379. vc1_mmal_decoder_deps="mmal"
  2380. vc1_mmal_decoder_select="mmal"
  2381. vc1_mmal_hwaccel_deps="mmal"
  2382. vc1_qsv_hwaccel_deps="libmfx"
  2383. vc1_qsv_hwaccel_select="qsvdec_vc1"
  2384. vc1_vaapi_hwaccel_deps="vaapi"
  2385. vc1_vaapi_hwaccel_select="vc1_decoder"
  2386. vc1_vdpau_decoder_deps="vdpau"
  2387. vc1_vdpau_decoder_select="vc1_decoder"
  2388. vc1_vdpau_hwaccel_deps="vdpau"
  2389. vc1_vdpau_hwaccel_select="vc1_decoder"
  2390. vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  2391. vp9_d3d11va_hwaccel_select="vp9_decoder"
  2392. vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
  2393. vp9_dxva2_hwaccel_select="vp9_decoder"
  2394. vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9"
  2395. vp9_vaapi_hwaccel_select="vp9_decoder"
  2396. wmv3_crystalhd_decoder_select="crystalhd"
  2397. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  2398. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2399. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2400. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  2401. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2402. # parsers
  2403. h264_parser_select="h264_decoder"
  2404. hevc_parser_select="golomb"
  2405. mpegvideo_parser_select="mpegvideo"
  2406. mpeg4video_parser_select="h263dsp mpegvideo qpeldsp"
  2407. vc1_parser_select="mpegvideo startcode vc1_decoder"
  2408. # bitstream_filters
  2409. mjpeg2jpeg_bsf_select="jpegtables"
  2410. # external libraries
  2411. chromaprint_muxer_deps="chromaprint"
  2412. libcelt_decoder_deps="libcelt"
  2413. libdcadec_decoder_deps="libdcadec"
  2414. libfaac_encoder_deps="libfaac"
  2415. libfaac_encoder_select="audio_frame_queue"
  2416. libfdk_aac_decoder_deps="libfdk_aac"
  2417. libfdk_aac_encoder_deps="libfdk_aac"
  2418. libfdk_aac_encoder_select="audio_frame_queue"
  2419. libgme_demuxer_deps="libgme"
  2420. libgsm_decoder_deps="libgsm"
  2421. libgsm_encoder_deps="libgsm"
  2422. libgsm_ms_decoder_deps="libgsm"
  2423. libgsm_ms_encoder_deps="libgsm"
  2424. libilbc_decoder_deps="libilbc"
  2425. libilbc_encoder_deps="libilbc"
  2426. libkvazaar_encoder_deps="libkvazaar"
  2427. libmodplug_demuxer_deps="libmodplug"
  2428. libmp3lame_encoder_deps="libmp3lame"
  2429. libmp3lame_encoder_select="audio_frame_queue"
  2430. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2431. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2432. libopencore_amrnb_encoder_select="audio_frame_queue"
  2433. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2434. libopenh264_encoder_deps="libopenh264"
  2435. libopenjpeg_decoder_deps="libopenjpeg"
  2436. libopenjpeg_encoder_deps="libopenjpeg"
  2437. libopus_decoder_deps="libopus"
  2438. libopus_encoder_deps="libopus"
  2439. libopus_encoder_select="audio_frame_queue"
  2440. libschroedinger_decoder_deps="libschroedinger"
  2441. libschroedinger_encoder_deps="libschroedinger"
  2442. libshine_encoder_deps="libshine"
  2443. libshine_encoder_select="audio_frame_queue"
  2444. libspeex_decoder_deps="libspeex"
  2445. libspeex_encoder_deps="libspeex"
  2446. libspeex_encoder_select="audio_frame_queue"
  2447. libtheora_encoder_deps="libtheora"
  2448. libtwolame_encoder_deps="libtwolame"
  2449. libutvideo_decoder_deps="libutvideo"
  2450. libutvideo_encoder_deps="libutvideo"
  2451. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2452. libvorbis_decoder_deps="libvorbis"
  2453. libvorbis_encoder_deps="libvorbis"
  2454. libvorbis_encoder_select="audio_frame_queue"
  2455. libvpx_vp8_decoder_deps="libvpx"
  2456. libvpx_vp8_encoder_deps="libvpx"
  2457. libvpx_vp9_decoder_deps="libvpx"
  2458. libvpx_vp9_encoder_deps="libvpx"
  2459. libwavpack_encoder_deps="libwavpack"
  2460. libwebp_encoder_deps="libwebp"
  2461. libwebp_anim_encoder_deps="libwebp"
  2462. libx262_encoder_deps="libx262"
  2463. libx264_encoder_deps="libx264"
  2464. libx264rgb_encoder_deps="libx264"
  2465. libx264rgb_encoder_select="libx264_encoder"
  2466. libx265_encoder_deps="libx265"
  2467. libxavs_encoder_deps="libxavs"
  2468. libxvid_encoder_deps="libxvid"
  2469. libzvbi_teletext_decoder_deps="libzvbi"
  2470. nvenc_encoder_deps="nvenc"
  2471. nvenc_h264_encoder_deps="nvenc"
  2472. nvenc_hevc_encoder_deps="nvenc"
  2473. # demuxers / muxers
  2474. ac3_demuxer_select="ac3_parser"
  2475. asf_demuxer_select="riffdec"
  2476. asf_o_demuxer_select="riffdec"
  2477. asf_muxer_select="riffenc"
  2478. asf_stream_muxer_select="asf_muxer"
  2479. avi_demuxer_select="riffdec exif"
  2480. avi_muxer_select="riffenc"
  2481. avisynth_demuxer_deps="avisynth"
  2482. avisynth_demuxer_select="riffdec"
  2483. caf_demuxer_select="riffdec"
  2484. dash_muxer_select="mp4_muxer"
  2485. dirac_demuxer_select="dirac_parser"
  2486. dts_demuxer_select="dca_parser"
  2487. dtshd_demuxer_select="dca_parser"
  2488. dv_demuxer_select="dvprofile"
  2489. dv_muxer_select="dvprofile"
  2490. dxa_demuxer_select="riffdec"
  2491. eac3_demuxer_select="ac3_parser"
  2492. f4v_muxer_select="mov_muxer"
  2493. flac_demuxer_select="flac_parser"
  2494. hds_muxer_select="flv_muxer"
  2495. hls_muxer_select="mpegts_muxer"
  2496. image2_alias_pix_demuxer_select="image2_demuxer"
  2497. image2_brender_pix_demuxer_select="image2_demuxer"
  2498. ipod_muxer_select="mov_muxer"
  2499. ismv_muxer_select="mov_muxer"
  2500. libnut_demuxer_deps="libnut"
  2501. libnut_muxer_deps="libnut"
  2502. matroska_audio_muxer_select="matroska_muxer"
  2503. matroska_demuxer_select="riffdec"
  2504. matroska_demuxer_suggest="bzlib lzo zlib"
  2505. matroska_muxer_select="riffenc"
  2506. mmf_muxer_select="riffenc"
  2507. mov_demuxer_select="riffdec"
  2508. mov_demuxer_suggest="zlib"
  2509. mov_muxer_select="riffenc rtpenc_chain"
  2510. mp3_demuxer_select="mpegaudio_parser"
  2511. mp4_muxer_select="mov_muxer"
  2512. mpegts_muxer_select="adts_muxer latm_muxer"
  2513. mpegtsraw_demuxer_select="mpegts_demuxer"
  2514. mxf_d10_muxer_select="mxf_muxer"
  2515. mxf_opatom_muxer_select="mxf_muxer"
  2516. nut_muxer_select="riffenc"
  2517. nuv_demuxer_select="riffdec"
  2518. oga_muxer_select="ogg_muxer"
  2519. ogg_demuxer_select="dirac_parse"
  2520. opus_muxer_select="ogg_muxer"
  2521. psp_muxer_select="mov_muxer"
  2522. rtp_demuxer_select="sdp_demuxer"
  2523. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol"
  2524. rtsp_demuxer_select="http_protocol rtpdec"
  2525. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  2526. sap_demuxer_select="sdp_demuxer"
  2527. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  2528. sdp_demuxer_select="rtpdec"
  2529. smoothstreaming_muxer_select="ismv_muxer"
  2530. spdif_muxer_select="aac_parser"
  2531. spx_muxer_select="ogg_muxer"
  2532. swf_demuxer_suggest="zlib"
  2533. tak_demuxer_select="tak_parser"
  2534. tg2_muxer_select="mov_muxer"
  2535. tgp_muxer_select="mov_muxer"
  2536. vobsub_demuxer_select="mpegps_demuxer"
  2537. w64_demuxer_select="wav_demuxer"
  2538. w64_muxer_select="wav_muxer"
  2539. wav_demuxer_select="riffdec"
  2540. wav_muxer_select="riffenc"
  2541. webm_muxer_select="riffenc"
  2542. wtv_demuxer_select="riffdec"
  2543. wtv_muxer_select="riffenc"
  2544. xmv_demuxer_select="riffdec"
  2545. xwma_demuxer_select="riffdec"
  2546. # indevs / outdevs
  2547. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  2548. alsa_outdev_deps="alsa_asoundlib_h"
  2549. avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia"
  2550. avfoundation_indev_select="avfoundation"
  2551. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  2552. caca_outdev_deps="libcaca"
  2553. decklink_indev_deps="decklink pthreads"
  2554. decklink_indev_extralibs="-lstdc++"
  2555. decklink_outdev_deps="decklink pthreads"
  2556. decklink_outdev_extralibs="-lstdc++"
  2557. dshow_indev_deps="IBaseFilter"
  2558. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  2559. dv1394_indev_deps="dv1394"
  2560. dv1394_indev_select="dv_demuxer"
  2561. fbdev_indev_deps="linux_fb_h"
  2562. fbdev_outdev_deps="linux_fb_h"
  2563. gdigrab_indev_deps="CreateDIBSection"
  2564. gdigrab_indev_extralibs="-lgdi32"
  2565. gdigrab_indev_select="bmp_decoder"
  2566. iec61883_indev_deps="libiec61883"
  2567. jack_indev_deps="jack_jack_h sem_timedwait"
  2568. lavfi_indev_deps="avfilter"
  2569. libcdio_indev_deps="libcdio"
  2570. libdc1394_indev_deps="libdc1394"
  2571. libv4l2_indev_deps="libv4l2"
  2572. openal_indev_deps="openal"
  2573. opengl_outdev_deps="opengl"
  2574. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  2575. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  2576. pulse_indev_deps="libpulse"
  2577. pulse_outdev_deps="libpulse"
  2578. qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
  2579. qtkit_indev_select="qtkit"
  2580. sdl_outdev_deps="sdl"
  2581. sndio_indev_deps="sndio_h"
  2582. sndio_outdev_deps="sndio_h"
  2583. v4l_indev_deps="linux_videodev_h"
  2584. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  2585. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  2586. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  2587. vfwcap_indev_extralibs="-lavicap32"
  2588. x11grab_indev_deps="x11grab"
  2589. x11grab_xcb_indev_deps="libxcb"
  2590. xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
  2591. xv_outdev_extralibs="-lXv -lX11 -lXext"
  2592. # protocols
  2593. async_protocol_deps="threads"
  2594. bluray_protocol_deps="libbluray"
  2595. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  2596. ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
  2597. ffrtmpcrypt_protocol_select="tcp_protocol"
  2598. ffrtmphttp_protocol_deps="!librtmp_protocol"
  2599. ffrtmphttp_protocol_select="http_protocol"
  2600. ftp_protocol_select="tcp_protocol"
  2601. gopher_protocol_select="network"
  2602. http_protocol_select="tcp_protocol"
  2603. httpproxy_protocol_select="tcp_protocol"
  2604. https_protocol_select="tls_protocol"
  2605. icecast_protocol_select="http_protocol"
  2606. librtmp_protocol_deps="librtmp"
  2607. librtmpe_protocol_deps="librtmp"
  2608. librtmps_protocol_deps="librtmp"
  2609. librtmpt_protocol_deps="librtmp"
  2610. librtmpte_protocol_deps="librtmp"
  2611. libsmbclient_protocol_deps="libsmbclient gplv3"
  2612. libssh_protocol_deps="libssh"
  2613. mmsh_protocol_select="http_protocol"
  2614. mmst_protocol_select="network"
  2615. rtmp_protocol_deps="!librtmp_protocol"
  2616. rtmp_protocol_select="tcp_protocol"
  2617. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  2618. rtmps_protocol_deps="!librtmp_protocol"
  2619. rtmps_protocol_select="tls_protocol"
  2620. rtmpt_protocol_select="ffrtmphttp_protocol"
  2621. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  2622. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  2623. rtp_protocol_select="udp_protocol"
  2624. sctp_protocol_deps="struct_sctp_event_subscribe"
  2625. sctp_protocol_select="network"
  2626. srtp_protocol_select="rtp_protocol"
  2627. tcp_protocol_select="network"
  2628. tls_gnutls_protocol_deps="gnutls !tls_schannel_protocol !tls_securetransport_protocol"
  2629. tls_gnutls_protocol_select="tcp_protocol"
  2630. tls_openssl_protocol_deps="openssl !tls_schannel_protocol !tls_securetransport_protocol !tls_gnutls_protocol"
  2631. tls_openssl_protocol_select="tcp_protocol"
  2632. tls_schannel_protocol_deps="schannel"
  2633. tls_schannel_protocol_select="tcp_protocol"
  2634. tls_securetransport_protocol_deps="securetransport"
  2635. tls_securetransport_protocol_select="tcp_protocol"
  2636. tls_protocol_deps_any="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol"
  2637. udp_protocol_select="network"
  2638. udplite_protocol_select="network"
  2639. unix_protocol_deps="sys_un_h"
  2640. unix_protocol_select="network"
  2641. # filters
  2642. afftfilt_filter_deps="avcodec"
  2643. afftfilt_filter_select="fft"
  2644. amovie_filter_deps="avcodec avformat"
  2645. aresample_filter_deps="swresample"
  2646. ass_filter_deps="libass"
  2647. asyncts_filter_deps="avresample"
  2648. atempo_filter_deps="avcodec"
  2649. atempo_filter_select="rdft"
  2650. azmq_filter_deps="libzmq"
  2651. blackframe_filter_deps="gpl"
  2652. boxblur_filter_deps="gpl"
  2653. bs2b_filter_deps="libbs2b"
  2654. colormatrix_filter_deps="gpl"
  2655. cover_rect_filter_deps="avcodec avformat gpl"
  2656. cropdetect_filter_deps="gpl"
  2657. delogo_filter_deps="gpl"
  2658. deshake_filter_select="pixelutils"
  2659. drawtext_filter_deps="libfreetype"
  2660. ebur128_filter_deps="gpl"
  2661. eq_filter_deps="gpl"
  2662. fftfilt_filter_deps="avcodec"
  2663. fftfilt_filter_select="rdft"
  2664. find_rect_filter_deps="avcodec avformat gpl"
  2665. flite_filter_deps="libflite"
  2666. frei0r_filter_deps="frei0r dlopen"
  2667. frei0r_src_filter_deps="frei0r dlopen"
  2668. fspp_filter_deps="gpl"
  2669. geq_filter_deps="gpl"
  2670. histeq_filter_deps="gpl"
  2671. hqdn3d_filter_deps="gpl"
  2672. interlace_filter_deps="gpl"
  2673. kerndeint_filter_deps="gpl"
  2674. ladspa_filter_deps="ladspa dlopen"
  2675. mcdeint_filter_deps="avcodec gpl"
  2676. movie_filter_deps="avcodec avformat"
  2677. mpdecimate_filter_deps="gpl"
  2678. mpdecimate_filter_select="pixelutils"
  2679. mptestsrc_filter_deps="gpl"
  2680. negate_filter_deps="lut_filter"
  2681. nnedi_filter_deps="gpl"
  2682. ocr_filter_deps="libtesseract"
  2683. ocv_filter_deps="libopencv"
  2684. owdenoise_filter_deps="gpl"
  2685. pan_filter_deps="swresample"
  2686. perspective_filter_deps="gpl"
  2687. phase_filter_deps="gpl"
  2688. pp7_filter_deps="gpl"
  2689. pp_filter_deps="gpl postproc"
  2690. pullup_filter_deps="gpl"
  2691. removelogo_filter_deps="avcodec avformat swscale"
  2692. repeatfields_filter_deps="gpl"
  2693. resample_filter_deps="avresample"
  2694. rubberband_filter_deps="librubberband"
  2695. sab_filter_deps="gpl swscale"
  2696. scale2ref_filter_deps="swscale"
  2697. scale_filter_deps="swscale"
  2698. select_filter_select="pixelutils"
  2699. showcqt_filter_deps="avcodec avformat swscale"
  2700. showcqt_filter_select="fft"
  2701. showfreqs_filter_deps="avcodec"
  2702. showfreqs_filter_select="fft"
  2703. showspectrum_filter_deps="avcodec"
  2704. showspectrum_filter_select="fft"
  2705. showspectrumpic_filter_deps="avcodec"
  2706. showspectrumpic_filter_select="fft"
  2707. smartblur_filter_deps="gpl swscale"
  2708. sofalizer_filter_deps="netcdf avcodec"
  2709. sofalizer_filter_select="fft"
  2710. spectrumsynth_filter_deps="avcodec"
  2711. spectrumsynth_filter_select="fft"
  2712. spp_filter_deps="gpl avcodec"
  2713. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  2714. stereo3d_filter_deps="gpl"
  2715. subtitles_filter_deps="avformat avcodec libass"
  2716. super2xsai_filter_deps="gpl"
  2717. pixfmts_super2xsai_test_deps="super2xsai_filter"
  2718. tinterlace_filter_deps="gpl"
  2719. tinterlace_merge_test_deps="tinterlace_filter"
  2720. tinterlace_pad_test_deps="tinterlace_filter"
  2721. uspp_filter_deps="gpl avcodec"
  2722. vidstabdetect_filter_deps="libvidstab"
  2723. vidstabtransform_filter_deps="libvidstab"
  2724. zmq_filter_deps="libzmq"
  2725. zoompan_filter_deps="swscale"
  2726. zscale_filter_deps="libzimg"
  2727. # examples
  2728. avcodec_example_deps="avcodec avutil"
  2729. avio_dir_cmd="avformat avutil"
  2730. avio_reading="avformat avcodec avutil"
  2731. decoding_encoding_example_deps="avcodec avformat avutil"
  2732. demuxing_decoding_example_deps="avcodec avformat avutil"
  2733. extract_mvs_example_deps="avcodec avformat avutil"
  2734. filter_audio_example_deps="avfilter avutil"
  2735. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  2736. filtering_video_example_deps="avfilter avcodec avformat avutil"
  2737. metadata_example_deps="avformat avutil"
  2738. muxing_example_deps="avcodec avformat avutil swscale"
  2739. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
  2740. remuxing_example_deps="avcodec avformat avutil"
  2741. resampling_audio_example_deps="avutil swresample"
  2742. scaling_video_example_deps="avutil swscale"
  2743. transcode_aac_example_deps="avcodec avformat swresample"
  2744. transcoding_example_deps="avfilter avcodec avformat avutil"
  2745. # libraries, in linking order
  2746. avcodec_deps="avutil"
  2747. avdevice_deps="avformat avcodec avutil"
  2748. avfilter_deps="avutil"
  2749. avformat_deps="avcodec avutil"
  2750. avresample_deps="avutil"
  2751. postproc_deps="avutil gpl"
  2752. swresample_deps="avutil"
  2753. swscale_deps="avutil"
  2754. # programs
  2755. ffmpeg_deps="avcodec avfilter avformat swresample"
  2756. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  2757. null_filter
  2758. setpts_filter trim_filter"
  2759. ffplay_deps="avcodec avformat swscale swresample sdl"
  2760. ffplay_libs='$sdl_libs'
  2761. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  2762. ffprobe_deps="avcodec avformat"
  2763. ffserver_deps="avformat fork sarestart"
  2764. ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  2765. # documentation
  2766. podpages_deps="perl"
  2767. manpages_deps="perl pod2man"
  2768. htmlpages_deps="perl"
  2769. htmlpages_deps_any="makeinfo_html texi2html"
  2770. txtpages_deps="perl makeinfo"
  2771. doc_deps_any="manpages htmlpages podpages txtpages"
  2772. # default parameters
  2773. logfile="config.log"
  2774. # installation paths
  2775. prefix_default="/usr/local"
  2776. bindir_default='${prefix}/bin'
  2777. datadir_default='${prefix}/share/ffmpeg'
  2778. docdir_default='${prefix}/share/doc/ffmpeg'
  2779. incdir_default='${prefix}/include'
  2780. libdir_default='${prefix}/lib'
  2781. mandir_default='${prefix}/share/man'
  2782. # toolchain
  2783. ar_default="ar"
  2784. cc_default="gcc"
  2785. cxx_default="g++"
  2786. host_cc_default="gcc"
  2787. cp_f="cp -f"
  2788. doxygen_default="doxygen"
  2789. install="install"
  2790. ln_s="ln -s -f"
  2791. nm_default="nm -g"
  2792. objformat="elf"
  2793. pkg_config_default=pkg-config
  2794. ranlib_default="ranlib"
  2795. strip_default="strip"
  2796. yasmexe_default="yasm"
  2797. windres_default="windres"
  2798. # OS
  2799. target_os_default=$(tolower $(uname -s))
  2800. host_os=$target_os_default
  2801. # machine
  2802. if test "$target_os_default" = aix; then
  2803. arch_default=$(uname -p)
  2804. strip_default="strip -X32_64"
  2805. else
  2806. arch_default=$(uname -m)
  2807. fi
  2808. cpu="generic"
  2809. intrinsics="none"
  2810. # configurable options
  2811. enable $PROGRAM_LIST
  2812. enable $DOCUMENT_LIST
  2813. enable $EXAMPLE_LIST
  2814. enable $(filter_out avresample $LIBRARY_LIST)
  2815. enable stripping
  2816. enable asm
  2817. enable debug
  2818. enable doc
  2819. enable faan faandct faanidct
  2820. enable optimizations
  2821. enable runtime_cpudetect
  2822. enable safe_bitstream_reader
  2823. enable static
  2824. enable swscale_alpha
  2825. enable valgrind_backtrace
  2826. sws_max_filter_size_default=256
  2827. set_default sws_max_filter_size
  2828. # Enable hwaccels by default.
  2829. enable d3d11va dxva2 vaapi vda vdpau videotoolbox xvmc
  2830. enable xlib
  2831. # build settings
  2832. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  2833. LIBPREF="lib"
  2834. LIBSUF=".a"
  2835. FULLNAME='$(NAME)$(BUILDSUF)'
  2836. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  2837. SLIBPREF="lib"
  2838. SLIBSUF=".so"
  2839. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  2840. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  2841. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  2842. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  2843. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  2844. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  2845. asflags_filter=echo
  2846. cflags_filter=echo
  2847. ldflags_filter=echo
  2848. AS_C='-c'
  2849. AS_O='-o $@'
  2850. CC_C='-c'
  2851. CC_E='-E -o $@'
  2852. CC_O='-o $@'
  2853. CXX_C='-c'
  2854. CXX_O='-o $@'
  2855. OBJCC_C='-c'
  2856. OBJCC_E='-E -o $@'
  2857. OBJCC_O='-o $@'
  2858. LD_O='-o $@'
  2859. LD_LIB='-l%'
  2860. LD_PATH='-L'
  2861. HOSTCC_C='-c'
  2862. HOSTCC_E='-E -o $@'
  2863. HOSTCC_O='-o $@'
  2864. HOSTLD_O='-o $@'
  2865. host_libs='-lm'
  2866. host_cflags_filter=echo
  2867. host_ldflags_filter=echo
  2868. target_path='$(CURDIR)'
  2869. # since the object filename is not given with the -MM flag, the compiler
  2870. # is only able to print the basename, and we must add the path ourselves
  2871. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
  2872. DEPFLAGS='-MM'
  2873. # find source path
  2874. if test -f configure; then
  2875. source_path=.
  2876. else
  2877. source_path=$(cd $(dirname "$0"); pwd)
  2878. case "$source_path" in
  2879. *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
  2880. esac
  2881. test -e "$source_path/config.h" &&
  2882. die "Out of tree builds are impossible with config.h in source dir."
  2883. fi
  2884. for v in "$@"; do
  2885. r=${v#*=}
  2886. l=${v%"$r"}
  2887. r=$(sh_quote "$r")
  2888. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  2889. done
  2890. find_things(){
  2891. thing=$1
  2892. pattern=$2
  2893. file=$source_path/$3
  2894. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2895. }
  2896. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2897. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2898. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2899. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2900. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  2901. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2902. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2903. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  2904. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2905. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  2906. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2907. ALL_COMPONENTS="
  2908. $BSF_LIST
  2909. $DECODER_LIST
  2910. $DEMUXER_LIST
  2911. $ENCODER_LIST
  2912. $FILTER_LIST
  2913. $HWACCEL_LIST
  2914. $INDEV_LIST
  2915. $MUXER_LIST
  2916. $OUTDEV_LIST
  2917. $PARSER_LIST
  2918. $PROTOCOL_LIST
  2919. "
  2920. for n in $COMPONENT_LIST; do
  2921. v=$(toupper ${n%s})_LIST
  2922. eval enable \$$v
  2923. eval ${n}_if_any="\$$v"
  2924. done
  2925. enable $ARCH_EXT_LIST
  2926. die_unknown(){
  2927. echo "Unknown option \"$1\"."
  2928. echo "See $0 --help for available options."
  2929. exit 1
  2930. }
  2931. print_in_columns() {
  2932. cols=$(expr $ncols / 24)
  2933. cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
  2934. }
  2935. show_list() {
  2936. suffix=_$1
  2937. shift
  2938. echo $* | sed s/$suffix//g | print_in_columns
  2939. exit 0
  2940. }
  2941. rand_list(){
  2942. IFS=', '
  2943. set -- $*
  2944. unset IFS
  2945. for thing; do
  2946. comp=${thing%:*}
  2947. prob=${thing#$comp}
  2948. prob=${prob#:}
  2949. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  2950. echo "prob ${prob:-0.5}"
  2951. printf '%s\n' $comp
  2952. done
  2953. }
  2954. do_random(){
  2955. action=$1
  2956. shift
  2957. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  2958. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  2959. }
  2960. for opt do
  2961. optval="${opt#*=}"
  2962. case "$opt" in
  2963. --extra-ldflags=*)
  2964. add_ldflags $optval
  2965. ;;
  2966. --extra-ldexeflags=*)
  2967. add_ldexeflags $optval
  2968. ;;
  2969. --extra-ldlibflags=*)
  2970. add_ldlibflags $optval
  2971. ;;
  2972. --extra-libs=*)
  2973. add_extralibs $optval
  2974. ;;
  2975. --disable-devices)
  2976. disable $INDEV_LIST $OUTDEV_LIST
  2977. ;;
  2978. --enable-debug=*)
  2979. debuglevel="$optval"
  2980. ;;
  2981. --disable-programs)
  2982. disable $PROGRAM_LIST
  2983. ;;
  2984. --disable-everything)
  2985. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2986. ;;
  2987. --disable-all)
  2988. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2989. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2990. enable avutil
  2991. ;;
  2992. --enable-random|--disable-random)
  2993. action=${opt%%-random}
  2994. do_random ${action#--} $COMPONENT_LIST
  2995. ;;
  2996. --enable-random=*|--disable-random=*)
  2997. action=${opt%%-random=*}
  2998. do_random ${action#--} $optval
  2999. ;;
  3000. --enable-*=*|--disable-*=*)
  3001. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  3002. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  3003. eval list=\$$(toupper $thing)_LIST
  3004. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  3005. list=$(filter "$name" $list)
  3006. [ "$list" = "" ] && warn "Option $opt did not match anything"
  3007. $action $list
  3008. ;;
  3009. --enable-?*|--disable-?*)
  3010. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  3011. if is_in $option $COMPONENT_LIST; then
  3012. test $action = disable && action=unset
  3013. eval $action \$$(toupper ${option%s})_LIST
  3014. elif is_in $option $CMDLINE_SELECT; then
  3015. $action $option
  3016. else
  3017. die_unknown $opt
  3018. fi
  3019. ;;
  3020. --list-*)
  3021. NAME="${opt#--list-}"
  3022. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  3023. NAME=${NAME%s}
  3024. eval show_list $NAME \$$(toupper $NAME)_LIST
  3025. ;;
  3026. --help|-h) show_help
  3027. ;;
  3028. --fatal-warnings) enable fatal_warnings
  3029. ;;
  3030. *)
  3031. optname="${opt%%=*}"
  3032. optname="${optname#--}"
  3033. optname=$(echo "$optname" | sed 's/-/_/g')
  3034. if is_in $optname $CMDLINE_SET; then
  3035. eval $optname='$optval'
  3036. elif is_in $optname $CMDLINE_APPEND; then
  3037. append $optname "$optval"
  3038. else
  3039. die_unknown $opt
  3040. fi
  3041. ;;
  3042. esac
  3043. done
  3044. for e in $env; do
  3045. eval "export $e"
  3046. done
  3047. disabled logging && logfile=/dev/null
  3048. # Disable all the library-specific components if the library itself
  3049. # is disabled, see AVCODEC_LIST and following _LIST variables.
  3050. disable_components(){
  3051. disabled ${1} && disable $(
  3052. eval components="\$$(toupper ${1})_COMPONENTS"
  3053. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  3054. )
  3055. }
  3056. map 'disable_components $v' $LIBRARY_LIST
  3057. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  3058. set >> $logfile
  3059. test -n "$valgrind" && toolchain="valgrind-memcheck"
  3060. case "$toolchain" in
  3061. clang-asan)
  3062. cc_default="clang"
  3063. add_cflags -fsanitize=address
  3064. add_ldflags -fsanitize=address
  3065. ;;
  3066. clang-tsan)
  3067. cc_default="clang"
  3068. add_cflags -fsanitize=thread -pie
  3069. add_ldflags -fsanitize=thread -pie
  3070. ;;
  3071. clang-usan)
  3072. cc_default="clang"
  3073. add_cflags -fsanitize=undefined
  3074. add_ldflags -fsanitize=undefined
  3075. ;;
  3076. gcc-asan)
  3077. cc_default="gcc"
  3078. add_cflags -fsanitize=address
  3079. add_ldflags -fsanitize=address
  3080. ;;
  3081. gcc-tsan)
  3082. cc_default="gcc"
  3083. add_cflags -fsanitize=thread -pie -fPIC
  3084. add_ldflags -fsanitize=thread -pie -fPIC
  3085. ;;
  3086. gcc-usan)
  3087. cc_default="gcc"
  3088. add_cflags -fsanitize=undefined
  3089. add_ldflags -fsanitize=undefined
  3090. ;;
  3091. valgrind-massif)
  3092. target_exec_default=${valgrind:-"valgrind"}
  3093. 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"
  3094. ;;
  3095. valgrind-memcheck)
  3096. target_exec_default=${valgrind:-"valgrind"}
  3097. 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"
  3098. ;;
  3099. msvc)
  3100. # Check whether the current MSVC version needs the C99 converter.
  3101. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  3102. # support enough of C99 to build ffmpeg. Default to the new
  3103. # behaviour if the regexp was unable to match anything, since this
  3104. # successfully parses the version number of existing supported
  3105. # versions that require the converter (MSVC 2010 and 2012).
  3106. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  3107. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  3108. cc_default="cl"
  3109. else
  3110. cc_default="c99wrap cl"
  3111. fi
  3112. ld_default="$source_path/compat/windows/mslink"
  3113. nm_default="dumpbin -symbols"
  3114. ar_default="lib"
  3115. case "$arch" in
  3116. arm*)
  3117. as_default="armasm"
  3118. ;;
  3119. esac
  3120. target_os_default="win32"
  3121. # Use a relative path for TMPDIR. This makes sure all the
  3122. # ffconf temp files are written with a relative path, avoiding
  3123. # issues with msys/win32 path conversion for MSVC parameters
  3124. # such as -Fo<file> or -out:<file>.
  3125. TMPDIR=.
  3126. ;;
  3127. icl)
  3128. cc_default="icl"
  3129. ld_default="xilink"
  3130. nm_default="dumpbin -symbols"
  3131. ar_default="xilib"
  3132. target_os_default="win32"
  3133. TMPDIR=.
  3134. ;;
  3135. gcov)
  3136. add_cflags -fprofile-arcs -ftest-coverage
  3137. add_ldflags -fprofile-arcs -ftest-coverage
  3138. ;;
  3139. hardened)
  3140. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  3141. add_cflags -fno-strict-overflow -fstack-protector-all
  3142. add_ldflags -Wl,-z,relro -Wl,-z,now
  3143. ;;
  3144. ?*)
  3145. die "Unknown toolchain $toolchain"
  3146. ;;
  3147. esac
  3148. test -n "$cross_prefix" && enable cross_compile
  3149. if enabled cross_compile; then
  3150. test -n "$arch" && test -n "$target_os" ||
  3151. die "Must specify target arch and OS when cross-compiling"
  3152. fi
  3153. ar_default="${cross_prefix}${ar_default}"
  3154. cc_default="${cross_prefix}${cc_default}"
  3155. cxx_default="${cross_prefix}${cxx_default}"
  3156. nm_default="${cross_prefix}${nm_default}"
  3157. pkg_config_default="${cross_prefix}${pkg_config_default}"
  3158. if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then
  3159. ranlib_default="${cross_prefix}${ranlib_default} -D"
  3160. else
  3161. ranlib_default="${cross_prefix}${ranlib_default}"
  3162. fi
  3163. strip_default="${cross_prefix}${strip_default}"
  3164. windres_default="${cross_prefix}${windres_default}"
  3165. sysinclude_default="${sysroot}/usr/include"
  3166. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  3167. target_exec target_os yasmexe
  3168. enabled cross_compile || host_cc_default=$cc
  3169. set_default host_cc
  3170. pkg_config_fail_message=""
  3171. if ! $pkg_config --version >/dev/null 2>&1; then
  3172. warn "$pkg_config not found, library detection may fail."
  3173. pkg_config=false
  3174. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  3175. pkg_config_fail_message="
  3176. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  3177. fi
  3178. if test $doxygen != $doxygen_default && \
  3179. ! $doxygen --version >/dev/null 2>&1; then
  3180. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  3181. fi
  3182. exesuf() {
  3183. case $1 in
  3184. mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  3185. esac
  3186. }
  3187. EXESUF=$(exesuf $target_os)
  3188. HOSTEXESUF=$(exesuf $host_os)
  3189. # set temporary file name
  3190. : ${TMPDIR:=$TEMPDIR}
  3191. : ${TMPDIR:=$TMP}
  3192. : ${TMPDIR:=/tmp}
  3193. if [ -n "$tempprefix" ] ; then
  3194. mktemp(){
  3195. echo $tempprefix.${HOSTNAME}.${UID}
  3196. }
  3197. elif ! check_cmd mktemp -u XXXXXX; then
  3198. # simple replacement for missing mktemp
  3199. # NOT SAFE FOR GENERAL USE
  3200. mktemp(){
  3201. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  3202. }
  3203. fi
  3204. tmpfile(){
  3205. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  3206. (set -C; exec > $tmp) 2>/dev/null ||
  3207. die "Unable to create temporary file in $TMPDIR."
  3208. append TMPFILES $tmp
  3209. eval $1=$tmp
  3210. }
  3211. trap 'rm -f -- $TMPFILES' EXIT
  3212. tmpfile TMPASM .asm
  3213. tmpfile TMPC .c
  3214. tmpfile TMPCPP .cpp
  3215. tmpfile TMPE $EXESUF
  3216. tmpfile TMPH .h
  3217. tmpfile TMPM .m
  3218. tmpfile TMPO .o
  3219. tmpfile TMPS .S
  3220. tmpfile TMPSH .sh
  3221. tmpfile TMPV .ver
  3222. unset -f mktemp
  3223. chmod +x $TMPE
  3224. # make sure we can execute files in $TMPDIR
  3225. cat > $TMPSH 2>> $logfile <<EOF
  3226. #! /bin/sh
  3227. EOF
  3228. chmod +x $TMPSH >> $logfile 2>&1
  3229. if ! $TMPSH >> $logfile 2>&1; then
  3230. cat <<EOF
  3231. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  3232. variable to another directory and make sure that it is not mounted noexec.
  3233. EOF
  3234. die "Sanity test failed."
  3235. fi
  3236. armasm_flags(){
  3237. for flag; do
  3238. case $flag in
  3239. # Filter out MSVC cl.exe options from cflags that shouldn't
  3240. # be passed to gas-preprocessor
  3241. -M[TD]*) ;;
  3242. *) echo $flag ;;
  3243. esac
  3244. done
  3245. }
  3246. ccc_flags(){
  3247. for flag; do
  3248. case $flag in
  3249. -std=c99) echo -c99 ;;
  3250. -mcpu=*) echo -arch ${flag#*=} ;;
  3251. -mieee) echo -ieee ;;
  3252. -O*|-fast) echo $flag ;;
  3253. -fno-math-errno) echo -assume nomath_errno ;;
  3254. -g) echo -g3 ;;
  3255. -Wall) echo -msg_enable level2 ;;
  3256. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  3257. -Wl,*) echo $flag ;;
  3258. -f*|-W*) ;;
  3259. *) echo $flag ;;
  3260. esac
  3261. done
  3262. }
  3263. cparser_flags(){
  3264. for flag; do
  3265. case $flag in
  3266. -Wno-switch) echo -Wno-switch-enum ;;
  3267. -Wno-format-zero-length) ;;
  3268. -Wdisabled-optimization) ;;
  3269. -Wno-pointer-sign) echo -Wno-other ;;
  3270. *) echo $flag ;;
  3271. esac
  3272. done
  3273. }
  3274. msvc_common_flags(){
  3275. for flag; do
  3276. case $flag in
  3277. # In addition to specifying certain flags under the compiler
  3278. # specific filters, they must be specified here as well or else the
  3279. # generic catch all at the bottom will print the original flag.
  3280. -Wall) ;;
  3281. -std=c99) ;;
  3282. # Common flags
  3283. -fomit-frame-pointer) ;;
  3284. -g) echo -Z7 ;;
  3285. -fno-math-errno) ;;
  3286. -fno-common) ;;
  3287. -fno-signed-zeros) ;;
  3288. -fPIC) ;;
  3289. -mthumb) ;;
  3290. -march=*) ;;
  3291. -lz) echo zlib.lib ;;
  3292. -lavifil32) echo vfw32.lib ;;
  3293. -lavicap32) echo vfw32.lib user32.lib ;;
  3294. -lx264) echo libx264.lib ;;
  3295. -l*) echo ${flag#-l}.lib ;;
  3296. -LARGEADDRESSAWARE) echo $flag ;;
  3297. -L*) echo -libpath:${flag#-L} ;;
  3298. *) echo $flag ;;
  3299. esac
  3300. done
  3301. }
  3302. msvc_flags(){
  3303. msvc_common_flags "$@"
  3304. for flag; do
  3305. case $flag in
  3306. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  3307. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  3308. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  3309. -wd4307 \
  3310. -wd4273 -wd4554 -wd4701 ;;
  3311. esac
  3312. done
  3313. }
  3314. icl_flags(){
  3315. msvc_common_flags "$@"
  3316. for flag; do
  3317. case $flag in
  3318. # Despite what Intel's documentation says -Wall, which is supported
  3319. # on Windows, does enable remarks so disable them here.
  3320. -Wall) echo $flag -Qdiag-disable:remark ;;
  3321. -std=c99) echo -Qstd=c99 ;;
  3322. -flto) echo -ipo ;;
  3323. esac
  3324. done
  3325. }
  3326. icc_flags(){
  3327. for flag; do
  3328. case $flag in
  3329. -flto) echo -ipo ;;
  3330. *) echo $flag ;;
  3331. esac
  3332. done
  3333. }
  3334. pgi_flags(){
  3335. for flag; do
  3336. case $flag in
  3337. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  3338. -fomit-frame-pointer) echo -Mnoframe ;;
  3339. -g) echo -gopt ;;
  3340. *) echo $flag ;;
  3341. esac
  3342. done
  3343. }
  3344. suncc_flags(){
  3345. for flag; do
  3346. case $flag in
  3347. -march=*|-mcpu=*)
  3348. case "${flag#*=}" in
  3349. native) echo -xtarget=native ;;
  3350. v9|niagara) echo -xarch=sparc ;;
  3351. ultrasparc) echo -xarch=sparcvis ;;
  3352. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  3353. i586|pentium) echo -xchip=pentium ;;
  3354. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  3355. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  3356. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  3357. pentium4*) echo -xtarget=pentium4 ;;
  3358. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  3359. *-sse3) echo -xarch=sse3 ;;
  3360. core2) echo -xarch=ssse3 -xchip=core2 ;;
  3361. bonnell) echo -xarch=ssse3 ;;
  3362. corei7|nehalem) echo -xtarget=nehalem ;;
  3363. westmere) echo -xtarget=westmere ;;
  3364. silvermont) echo -xarch=sse4_2 ;;
  3365. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  3366. core-avx*|ivybridge|haswell|broadwell)
  3367. echo -xarch=avx ;;
  3368. amdfam10|barcelona) echo -xtarget=barcelona ;;
  3369. btver1) echo -xarch=amdsse4a ;;
  3370. btver2|bdver*) echo -xarch=avx ;;
  3371. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  3372. k8|opteron|athlon64|athlon-fx)
  3373. echo -xarch=sse2a ;;
  3374. athlon*) echo -xarch=pentium_proa ;;
  3375. esac
  3376. ;;
  3377. -std=c99) echo -xc99 ;;
  3378. -fomit-frame-pointer) echo -xregs=frameptr ;;
  3379. -fPIC) echo -KPIC -xcode=pic32 ;;
  3380. -W*,*) echo $flag ;;
  3381. -f*-*|-W*|-mimpure-text) ;;
  3382. -shared) echo -G ;;
  3383. *) echo $flag ;;
  3384. esac
  3385. done
  3386. }
  3387. tms470_flags(){
  3388. for flag; do
  3389. case $flag in
  3390. -march=*|-mcpu=*)
  3391. case "${flag#*=}" in
  3392. armv7-a|cortex-a*) echo -mv=7a8 ;;
  3393. armv7-r|cortex-r*) echo -mv=7r4 ;;
  3394. armv7-m|cortex-m*) echo -mv=7m3 ;;
  3395. armv6*|arm11*) echo -mv=6 ;;
  3396. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  3397. echo -mv=5e ;;
  3398. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  3399. esac
  3400. ;;
  3401. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  3402. -mfpu=vfp) echo --float_support=vfpv2 ;;
  3403. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  3404. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  3405. -msoft-float) echo --float_support=vfplib ;;
  3406. -O[0-3]|-mf=*) echo $flag ;;
  3407. -g) echo -g -mn ;;
  3408. -pds=*) echo $flag ;;
  3409. -D*|-I*) echo $flag ;;
  3410. --gcc|--abi=*) echo $flag ;;
  3411. -me) echo $flag ;;
  3412. esac
  3413. done
  3414. }
  3415. probe_cc(){
  3416. pfx=$1
  3417. _cc=$2
  3418. first=$3
  3419. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  3420. unset _ld_o _ldflags _ld_lib _ld_path
  3421. unset _depflags _DEPCMD _DEPFLAGS
  3422. _flags_filter=echo
  3423. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  3424. true # no-op to avoid reading stdin in following checks
  3425. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  3426. _type=llvm_gcc
  3427. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  3428. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  3429. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3430. _cflags_speed='-O3'
  3431. _cflags_size='-Os'
  3432. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  3433. _type=gcc
  3434. gcc_version=$($_cc --version | head -n1)
  3435. gcc_basever=$($_cc -dumpversion)
  3436. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  3437. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  3438. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  3439. case $gcc_basever in
  3440. 2) ;;
  3441. 2.*) ;;
  3442. *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
  3443. esac
  3444. if [ "$first" = true ]; then
  3445. case $gcc_basever in
  3446. 4.2*)
  3447. warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
  3448. esac
  3449. fi
  3450. _cflags_speed='-O3'
  3451. _cflags_size='-Os'
  3452. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  3453. _type=icc
  3454. _ident=$($_cc --version | head -n1)
  3455. _depflags='-MMD'
  3456. _cflags_speed='-O3'
  3457. _cflags_size='-Os'
  3458. _cflags_noopt='-O1'
  3459. _flags_filter=icc_flags
  3460. elif $_cc -v 2>&1 | grep -q xlc; then
  3461. _type=xlc
  3462. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  3463. _cflags_speed='-O5'
  3464. _cflags_size='-O5 -qcompact'
  3465. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  3466. _type=ccc
  3467. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  3468. _DEPFLAGS='-M'
  3469. _cflags_speed='-fast'
  3470. _cflags_size='-O1'
  3471. _flags_filter=ccc_flags
  3472. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  3473. test -d "$sysroot" || die "No valid sysroot specified."
  3474. _type=armcc
  3475. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  3476. armcc_conf="$PWD/armcc.conf"
  3477. $_cc --arm_linux_configure \
  3478. --arm_linux_config_file="$armcc_conf" \
  3479. --configure_sysroot="$sysroot" \
  3480. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  3481. die "Error creating armcc configuration file."
  3482. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  3483. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  3484. as_default="${cross_prefix}gcc"
  3485. _depflags='-MMD'
  3486. _cflags_speed='-O3'
  3487. _cflags_size='-Os'
  3488. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  3489. _type=tms470
  3490. _ident=$($_cc -version | head -n1 | tr -s ' ')
  3491. _flags='--gcc --abi=eabi -me'
  3492. _cc_e='-ppl -fe=$@'
  3493. _cc_o='-fe=$@'
  3494. _depflags='-ppa -ppd=$(@:.o=.d)'
  3495. _cflags_speed='-O3 -mf=5'
  3496. _cflags_size='-O3 -mf=2'
  3497. _flags_filter=tms470_flags
  3498. elif $_cc -v 2>&1 | grep -q clang; then
  3499. _type=clang
  3500. _ident=$($_cc --version 2>/dev/null | head -n1)
  3501. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3502. _cflags_speed='-O3'
  3503. _cflags_size='-Os'
  3504. elif $_cc -V 2>&1 | grep -q Sun; then
  3505. _type=suncc
  3506. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  3507. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  3508. _DEPFLAGS='-xM1 -xc99'
  3509. _ldflags='-std=c99'
  3510. _cflags_speed='-O5'
  3511. _cflags_size='-O5 -xspace'
  3512. _flags_filter=suncc_flags
  3513. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  3514. _type=pathscale
  3515. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3516. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3517. _cflags_speed='-O2'
  3518. _cflags_size='-Os'
  3519. _flags_filter='filter_out -Wdisabled-optimization'
  3520. elif $_cc -v 2>&1 | grep -q Open64; then
  3521. _type=open64
  3522. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3523. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3524. _cflags_speed='-O2'
  3525. _cflags_size='-Os'
  3526. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  3527. elif $_cc -V 2>&1 | grep -q Portland; then
  3528. _type=pgi
  3529. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  3530. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  3531. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  3532. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  3533. _cflags_noopt="-O"
  3534. _flags_filter=pgi_flags
  3535. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  3536. _type=armasm
  3537. _ident=$($_cc | head -n1)
  3538. # 4509: "This form of conditional instruction is deprecated"
  3539. _flags="-nologo -ignore 4509"
  3540. _flags_filter=armasm_flags
  3541. elif $_cc 2>&1 | grep -q Intel; then
  3542. _type=icl
  3543. _ident=$($_cc 2>&1 | head -n1)
  3544. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  3545. # Not only is O3 broken on 13.x+ but it is slower on all previous
  3546. # versions (tested) as well.
  3547. _cflags_speed="-O2"
  3548. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  3549. if $_cc 2>&1 | grep -q Linker; then
  3550. _ld_o='-out:$@'
  3551. else
  3552. _ld_o='-Fe$@'
  3553. fi
  3554. _cc_o='-Fo$@'
  3555. _cc_e='-P'
  3556. _flags_filter=icl_flags
  3557. _ld_lib='lib%.a'
  3558. _ld_path='-libpath:'
  3559. # -Qdiag-error to make icl error when seeing certain unknown arguments
  3560. _flags='-nologo -Qdiag-error:4044,10157'
  3561. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  3562. # with MSVC which enables it by default.
  3563. _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  3564. disable stripping
  3565. elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
  3566. _type=msvc
  3567. _ident=$($_cc 2>&1 | head -n1)
  3568. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  3569. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  3570. _cflags_speed="-O2"
  3571. _cflags_size="-O1"
  3572. if $_cc -nologo- 2>&1 | grep -q Linker; then
  3573. _ld_o='-out:$@'
  3574. else
  3575. _ld_o='-Fe$@'
  3576. fi
  3577. _cc_o='-Fo$@'
  3578. _cc_e='-P -Fi$@'
  3579. _flags_filter=msvc_flags
  3580. _ld_lib='lib%.a'
  3581. _ld_path='-libpath:'
  3582. _flags='-nologo'
  3583. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS'
  3584. disable stripping
  3585. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  3586. _type=cparser
  3587. _ident=$($_cc --version | head -n1)
  3588. _depflags='-MMD'
  3589. _cflags_speed='-O4'
  3590. _cflags_size='-O2'
  3591. _flags_filter=cparser_flags
  3592. fi
  3593. eval ${pfx}_type=\$_type
  3594. eval ${pfx}_ident=\$_ident
  3595. }
  3596. set_ccvars(){
  3597. eval ${1}_C=\${_cc_c-\${${1}_C}}
  3598. eval ${1}_E=\${_cc_e-\${${1}_E}}
  3599. eval ${1}_O=\${_cc_o-\${${1}_O}}
  3600. if [ -n "$_depflags" ]; then
  3601. eval ${1}_DEPFLAGS=\$_depflags
  3602. else
  3603. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  3604. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  3605. eval DEP${1}FLAGS=\$_flags
  3606. fi
  3607. }
  3608. probe_cc cc "$cc" "true"
  3609. cflags_filter=$_flags_filter
  3610. cflags_speed=$_cflags_speed
  3611. cflags_size=$_cflags_size
  3612. cflags_noopt=$_cflags_noopt
  3613. add_cflags $_flags $_cflags
  3614. cc_ldflags=$_ldflags
  3615. set_ccvars CC
  3616. probe_cc hostcc "$host_cc"
  3617. host_cflags_filter=$_flags_filter
  3618. add_host_cflags $_flags $_cflags
  3619. set_ccvars HOSTCC
  3620. test -n "$cc_type" && enable $cc_type ||
  3621. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  3622. : ${as_default:=$cc}
  3623. : ${objcc_default:=$cc}
  3624. : ${dep_cc_default:=$cc}
  3625. : ${ld_default:=$cc}
  3626. : ${host_ld_default:=$host_cc}
  3627. set_default ar as objcc dep_cc ld host_ld windres
  3628. probe_cc as "$as"
  3629. asflags_filter=$_flags_filter
  3630. add_asflags $_flags $_cflags
  3631. set_ccvars AS
  3632. probe_cc objcc "$objcc"
  3633. objcflags_filter=$_flags_filter
  3634. add_objcflags $_flags $_cflags
  3635. set_ccvars OBJC
  3636. probe_cc ld "$ld"
  3637. ldflags_filter=$_flags_filter
  3638. add_ldflags $_flags $_ldflags
  3639. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  3640. LD_O=${_ld_o-$LD_O}
  3641. LD_LIB=${_ld_lib-$LD_LIB}
  3642. LD_PATH=${_ld_path-$LD_PATH}
  3643. probe_cc hostld "$host_ld"
  3644. host_ldflags_filter=$_flags_filter
  3645. add_host_ldflags $_flags $_ldflags
  3646. HOSTLD_O=${_ld_o-$HOSTLD_O}
  3647. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  3648. probe_cc depcc "$dep_cc"
  3649. CCDEP=${_DEPCMD:-$DEPCMD}
  3650. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  3651. DEPCCFLAGS=$_flags
  3652. fi
  3653. if $ar 2>&1 | grep -q Microsoft; then
  3654. arflags="-nologo"
  3655. ar_o='-out:$@'
  3656. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  3657. arflags="rq"
  3658. ar_o='$@'
  3659. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  3660. arflags='-Xany -r -c'
  3661. ar_o='$@'
  3662. elif $ar 2>&1 | grep -q "\[D\] "; then
  3663. arflags="rcD"
  3664. ar_o='$@'
  3665. else
  3666. arflags="rc"
  3667. ar_o='$@'
  3668. fi
  3669. add_cflags $extra_cflags
  3670. add_cxxflags $extra_cxxflags
  3671. add_objcflags $extra_objcflags
  3672. add_asflags $extra_cflags
  3673. if test -n "$sysroot"; then
  3674. case "$cc_type" in
  3675. gcc|llvm_gcc|clang)
  3676. add_cppflags --sysroot="$sysroot"
  3677. add_ldflags --sysroot="$sysroot"
  3678. # On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
  3679. add_cppflags -isysroot "$sysroot"
  3680. add_ldflags -isysroot "$sysroot"
  3681. ;;
  3682. tms470)
  3683. add_cppflags -I"$sysinclude"
  3684. add_ldflags --sysroot="$sysroot"
  3685. ;;
  3686. esac
  3687. fi
  3688. if test "$cpu" = host; then
  3689. enabled cross_compile &&
  3690. die "--cpu=host makes no sense when cross-compiling."
  3691. case "$cc_type" in
  3692. gcc|llvm_gcc)
  3693. check_native(){
  3694. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  3695. sed -n "/cc1.*$1=/{
  3696. s/.*$1=\\([^ ]*\\).*/\\1/
  3697. p
  3698. q
  3699. }" $TMPE
  3700. }
  3701. cpu=$(check_native -march || check_native -mcpu)
  3702. ;;
  3703. clang)
  3704. check_native(){
  3705. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  3706. sed -n "/cc1.*-target-cpu /{
  3707. s/.*-target-cpu \\([^ ]*\\).*/\\1/
  3708. p
  3709. q
  3710. }" $TMPE
  3711. }
  3712. cpu=$(check_native -march)
  3713. ;;
  3714. esac
  3715. test "${cpu:-host}" = host &&
  3716. die "--cpu=host not supported with compiler $cc"
  3717. fi
  3718. # Deal with common $arch aliases
  3719. case "$arch" in
  3720. aarch64|arm64)
  3721. arch="aarch64"
  3722. ;;
  3723. arm*|iPad*|iPhone*)
  3724. arch="arm"
  3725. ;;
  3726. mips*|IP*)
  3727. case "$arch" in
  3728. *el)
  3729. add_cppflags -EL
  3730. add_ldflags -EL
  3731. ;;
  3732. *eb)
  3733. add_cppflags -EB
  3734. add_ldflags -EB
  3735. ;;
  3736. esac
  3737. arch="mips"
  3738. ;;
  3739. parisc*|hppa*)
  3740. arch="parisc"
  3741. ;;
  3742. "Power Macintosh"|ppc*|powerpc*)
  3743. arch="ppc"
  3744. ;;
  3745. s390|s390x)
  3746. arch="s390"
  3747. ;;
  3748. sh4|sh)
  3749. arch="sh4"
  3750. ;;
  3751. sun4u|sparc*)
  3752. arch="sparc"
  3753. ;;
  3754. tilegx|tile-gx)
  3755. arch="tilegx"
  3756. ;;
  3757. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  3758. arch="x86"
  3759. ;;
  3760. esac
  3761. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  3762. enable $arch
  3763. # Add processor-specific flags
  3764. if enabled aarch64; then
  3765. case $cpu in
  3766. armv*)
  3767. cpuflags="-march=$cpu"
  3768. ;;
  3769. *)
  3770. cpuflags="-mcpu=$cpu"
  3771. ;;
  3772. esac
  3773. elif enabled alpha; then
  3774. cpuflags="-mcpu=$cpu"
  3775. elif enabled arm; then
  3776. check_arm_arch() {
  3777. check_cpp_condition stddef.h \
  3778. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  3779. $cpuflags
  3780. }
  3781. probe_arm_arch() {
  3782. if check_arm_arch 4; then echo armv4;
  3783. elif check_arm_arch 4T; then echo armv4t;
  3784. elif check_arm_arch 5; then echo armv5;
  3785. elif check_arm_arch 5E; then echo armv5e;
  3786. elif check_arm_arch 5T; then echo armv5t;
  3787. elif check_arm_arch 5TE; then echo armv5te;
  3788. elif check_arm_arch 5TEJ; then echo armv5te;
  3789. elif check_arm_arch 6; then echo armv6;
  3790. elif check_arm_arch 6J; then echo armv6j;
  3791. elif check_arm_arch 6K; then echo armv6k;
  3792. elif check_arm_arch 6Z; then echo armv6z;
  3793. elif check_arm_arch 6ZK; then echo armv6zk;
  3794. elif check_arm_arch 6T2; then echo armv6t2;
  3795. elif check_arm_arch 7; then echo armv7;
  3796. elif check_arm_arch 7A 7_A; then echo armv7-a;
  3797. elif check_arm_arch 7S; then echo armv7-a;
  3798. elif check_arm_arch 7R 7_R; then echo armv7-r;
  3799. elif check_arm_arch 7M 7_M; then echo armv7-m;
  3800. elif check_arm_arch 7EM 7E_M; then echo armv7-m;
  3801. elif check_arm_arch 8A 8_A; then echo armv8-a;
  3802. fi
  3803. }
  3804. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  3805. case $cpu in
  3806. armv*)
  3807. cpuflags="-march=$cpu"
  3808. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  3809. ;;
  3810. *)
  3811. cpuflags="-mcpu=$cpu"
  3812. case $cpu in
  3813. cortex-a*) subarch=armv7a ;;
  3814. cortex-r*) subarch=armv7r ;;
  3815. cortex-m*) enable thumb; subarch=armv7m ;;
  3816. arm11*) subarch=armv6 ;;
  3817. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  3818. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  3819. *) subarch=$(probe_arm_arch) ;;
  3820. esac
  3821. ;;
  3822. esac
  3823. case "$subarch" in
  3824. armv5t*) enable fast_clz ;;
  3825. armv[6-8]*)
  3826. enable fast_clz
  3827. disabled fast_unaligned || enable fast_unaligned
  3828. ;;
  3829. esac
  3830. elif enabled avr32; then
  3831. case $cpu in
  3832. ap7[02]0[0-2])
  3833. subarch="avr32_ap"
  3834. cpuflags="-mpart=$cpu"
  3835. ;;
  3836. ap)
  3837. subarch="avr32_ap"
  3838. cpuflags="-march=$cpu"
  3839. ;;
  3840. uc3[ab]*)
  3841. subarch="avr32_uc"
  3842. cpuflags="-mcpu=$cpu"
  3843. ;;
  3844. uc)
  3845. subarch="avr32_uc"
  3846. cpuflags="-march=$cpu"
  3847. ;;
  3848. esac
  3849. elif enabled bfin; then
  3850. cpuflags="-mcpu=$cpu"
  3851. elif enabled mips; then
  3852. cpuflags="-march=$cpu"
  3853. if [ "$cpu" != "generic" ]; then
  3854. disable mips32r2
  3855. disable mips32r5
  3856. disable mips64r2
  3857. disable mips32r6
  3858. disable mips64r6
  3859. disable loongson2
  3860. disable loongson3
  3861. case $cpu in
  3862. 24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
  3863. enable mips32r2
  3864. disable msa
  3865. ;;
  3866. p5600|i6400|p6600)
  3867. disable mipsdsp
  3868. disable mipsdspr2
  3869. ;;
  3870. loongson*)
  3871. enable loongson2
  3872. enable loongson3
  3873. enable local_aligned_8 local_aligned_16 local_aligned_32
  3874. enable simd_align_16
  3875. enable fast_64bit
  3876. enable fast_clz
  3877. enable fast_cmov
  3878. enable fast_unaligned
  3879. disable aligned_stack
  3880. case $cpu in
  3881. loongson3*)
  3882. cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
  3883. ;;
  3884. loongson2e)
  3885. cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
  3886. ;;
  3887. loongson2f)
  3888. cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
  3889. ;;
  3890. esac
  3891. ;;
  3892. *)
  3893. # Unknown CPU. Disable everything.
  3894. warn "unknown CPU. Disabling all MIPS optimizations."
  3895. disable mipsfpu
  3896. disable mipsdsp
  3897. disable mipsdspr2
  3898. disable msa
  3899. disable mmi
  3900. ;;
  3901. esac
  3902. case $cpu in
  3903. 24kc)
  3904. disable mipsfpu
  3905. disable mipsdsp
  3906. disable mipsdspr2
  3907. ;;
  3908. 24kf*)
  3909. disable mipsdsp
  3910. disable mipsdspr2
  3911. ;;
  3912. 24kec|34kc|1004kc)
  3913. disable mipsfpu
  3914. disable mipsdspr2
  3915. ;;
  3916. 24kef*|34kf*|1004kf*)
  3917. disable mipsdspr2
  3918. ;;
  3919. 74kc)
  3920. disable mipsfpu
  3921. ;;
  3922. p5600)
  3923. enable mips32r5
  3924. check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
  3925. ;;
  3926. i6400)
  3927. enable mips64r6
  3928. check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  3929. ;;
  3930. p6600)
  3931. enable mips64r6
  3932. check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  3933. ;;
  3934. esac
  3935. else
  3936. # We do not disable anything. Is up to the user to disable the unwanted features.
  3937. warn 'generic cpu selected'
  3938. fi
  3939. elif enabled ppc; then
  3940. disable ldbrx
  3941. case $(tolower $cpu) in
  3942. 601|ppc601|powerpc601)
  3943. cpuflags="-mcpu=601"
  3944. disable altivec
  3945. ;;
  3946. 603*|ppc603*|powerpc603*)
  3947. cpuflags="-mcpu=603"
  3948. disable altivec
  3949. ;;
  3950. 604*|ppc604*|powerpc604*)
  3951. cpuflags="-mcpu=604"
  3952. disable altivec
  3953. ;;
  3954. g3|75*|ppc75*|powerpc75*)
  3955. cpuflags="-mcpu=750"
  3956. disable altivec
  3957. ;;
  3958. g4|745*|ppc745*|powerpc745*)
  3959. cpuflags="-mcpu=7450"
  3960. disable vsx
  3961. ;;
  3962. 74*|ppc74*|powerpc74*)
  3963. cpuflags="-mcpu=7400"
  3964. disable vsx
  3965. ;;
  3966. g5|970|ppc970|powerpc970)
  3967. cpuflags="-mcpu=970"
  3968. disable vsx
  3969. ;;
  3970. power[3-6]*)
  3971. cpuflags="-mcpu=$cpu"
  3972. disable vsx
  3973. ;;
  3974. power[7-8]*)
  3975. cpuflags="-mcpu=$cpu"
  3976. ;;
  3977. cell)
  3978. cpuflags="-mcpu=cell"
  3979. enable ldbrx
  3980. disable vsx
  3981. ;;
  3982. e500mc)
  3983. cpuflags="-mcpu=e500mc"
  3984. disable altivec
  3985. ;;
  3986. e500v2)
  3987. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3988. disable altivec
  3989. disable dcbzl
  3990. ;;
  3991. e500)
  3992. cpuflags="-mcpu=8540 -mhard-float"
  3993. disable altivec
  3994. disable dcbzl
  3995. ;;
  3996. esac
  3997. elif enabled sparc; then
  3998. case $cpu in
  3999. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  4000. cpuflags="-mcpu=$cpu"
  4001. ;;
  4002. ultrasparc*|niagara[234])
  4003. cpuflags="-mcpu=$cpu"
  4004. ;;
  4005. esac
  4006. elif enabled x86; then
  4007. case $cpu in
  4008. i[345]86|pentium)
  4009. cpuflags="-march=$cpu"
  4010. disable i686
  4011. disable mmx
  4012. ;;
  4013. # targets that do NOT support nopl and conditional mov (cmov)
  4014. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  4015. cpuflags="-march=$cpu"
  4016. disable i686
  4017. ;;
  4018. # targets that do support nopl and conditional mov (cmov)
  4019. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  4020. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
  4021. cpuflags="-march=$cpu"
  4022. enable i686
  4023. enable fast_cmov
  4024. ;;
  4025. # targets that do support conditional mov but on which it's slow
  4026. pentium4|pentium4m|prescott|nocona)
  4027. cpuflags="-march=$cpu"
  4028. enable i686
  4029. disable fast_cmov
  4030. ;;
  4031. esac
  4032. fi
  4033. if [ "$cpu" != generic ]; then
  4034. add_cflags $cpuflags
  4035. add_asflags $cpuflags
  4036. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  4037. fi
  4038. # compiler sanity check
  4039. check_exec <<EOF
  4040. int main(void){ return 0; }
  4041. EOF
  4042. if test "$?" != 0; then
  4043. echo "$cc is unable to create an executable file."
  4044. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  4045. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  4046. echo "Only do this if you know what cross compiling means."
  4047. fi
  4048. die "C compiler test failed."
  4049. fi
  4050. add_cppflags -D_ISOC99_SOURCE
  4051. add_cxxflags -D__STDC_CONSTANT_MACROS
  4052. check_cflags -std=c99
  4053. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  4054. #include <stdlib.h>
  4055. EOF
  4056. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  4057. #include <stdlib.h>
  4058. EOF
  4059. add_host_cppflags -D_ISOC99_SOURCE
  4060. check_host_cflags -std=c99
  4061. check_host_cflags -Wall
  4062. check_host_cflags -O3
  4063. check_64bit(){
  4064. arch32=$1
  4065. arch64=$2
  4066. expr=$3
  4067. check_code cc "" "int test[2*($expr) - 1]" &&
  4068. subarch=$arch64 || subarch=$arch32
  4069. }
  4070. case "$arch" in
  4071. aarch64|alpha|ia64)
  4072. spic=$shared
  4073. ;;
  4074. mips)
  4075. check_64bit mips mips64 '_MIPS_SIM > 1'
  4076. spic=$shared
  4077. ;;
  4078. parisc)
  4079. check_64bit parisc parisc64 'sizeof(void *) > 4'
  4080. spic=$shared
  4081. ;;
  4082. ppc)
  4083. check_64bit ppc ppc64 'sizeof(void *) > 4'
  4084. spic=$shared
  4085. ;;
  4086. s390)
  4087. check_64bit s390 s390x 'sizeof(void *) > 4'
  4088. spic=$shared
  4089. ;;
  4090. sparc)
  4091. check_64bit sparc sparc64 'sizeof(void *) > 4'
  4092. spic=$shared
  4093. ;;
  4094. x86)
  4095. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  4096. # Treat x32 as x64 for now. Note it also needs spic=$shared
  4097. test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
  4098. subarch=x86_64
  4099. if test "$subarch" = "x86_64"; then
  4100. spic=$shared
  4101. fi
  4102. ;;
  4103. ppc)
  4104. check_cc <<EOF && subarch="ppc64"
  4105. int test[(int)sizeof(char*) - 7];
  4106. EOF
  4107. ;;
  4108. esac
  4109. enable $subarch
  4110. enabled spic && enable_weak pic
  4111. # OS specific
  4112. case $target_os in
  4113. aix)
  4114. SHFLAGS=-shared
  4115. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  4116. enabled shared && add_ldflags -Wl,-brtl
  4117. ;;
  4118. android)
  4119. disable symver
  4120. enable section_data_rel_ro
  4121. SLIB_INSTALL_NAME='$(SLIBNAME)'
  4122. SLIB_INSTALL_LINKS=
  4123. SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
  4124. ;;
  4125. haiku)
  4126. prefix_default="/boot/common"
  4127. network_extralibs="-lnetwork"
  4128. host_libs=
  4129. ;;
  4130. sunos)
  4131. SHFLAGS='-shared -Wl,-h,$$(@F)'
  4132. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  4133. network_extralibs="-lsocket -lnsl"
  4134. add_cppflags -D__EXTENSIONS__
  4135. # When using suncc to build, the Solaris linker will mark
  4136. # an executable with each instruction set encountered by
  4137. # the Solaris assembler. As our libraries contain their own
  4138. # guards for processor-specific code, instead suppress
  4139. # generation of the HWCAPS ELF section on Solaris x86 only.
  4140. enabled_all suncc x86 &&
  4141. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  4142. add_ldflags -Wl,-M,mapfile
  4143. nm_default='nm -P -g'
  4144. SLIB_CREATE_DEF_CMD='$(Q)perl $(SRC_PATH)/compat/solaris/make_sunver.pl $$(filter %.ver,$$^) $(OBJS) | grep -v @ > $(SUBDIR)lib$(NAME).ver-sol2'
  4145. ;;
  4146. netbsd)
  4147. disable symver
  4148. oss_indev_extralibs="-lossaudio"
  4149. oss_outdev_extralibs="-lossaudio"
  4150. enabled gcc || check_ldflags -Wl,-zmuldefs
  4151. ;;
  4152. openbsd|bitrig)
  4153. disable symver
  4154. SHFLAGS='-shared'
  4155. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  4156. SLIB_INSTALL_LINKS=
  4157. oss_indev_extralibs="-lossaudio"
  4158. oss_outdev_extralibs="-lossaudio"
  4159. ;;
  4160. dragonfly)
  4161. disable symver
  4162. ;;
  4163. freebsd)
  4164. ;;
  4165. bsd/os)
  4166. add_extralibs -lpoll -lgnugetopt
  4167. strip="strip -d"
  4168. ;;
  4169. darwin)
  4170. enabled ppc && add_asflags -force_cpusubtype_ALL
  4171. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  4172. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  4173. strip="${strip} -x"
  4174. add_ldflags -Wl,-dynamic,-search_paths_first
  4175. SLIBSUF=".dylib"
  4176. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  4177. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  4178. objformat="macho"
  4179. enabled x86_64 && objformat="macho64"
  4180. enabled_any pic shared x86_64 ||
  4181. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  4182. ;;
  4183. msys*)
  4184. die "Native MSYS builds are discouraged, please use the MINGW environment.";
  4185. ;;
  4186. mingw32*|mingw64*)
  4187. if test $target_os = "mingw32ce"; then
  4188. disable network
  4189. else
  4190. target_os=mingw32
  4191. fi
  4192. decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
  4193. decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
  4194. LIBTARGET=i386
  4195. if enabled x86_64; then
  4196. LIBTARGET="i386:x86-64"
  4197. elif enabled arm; then
  4198. LIBTARGET=arm-wince
  4199. fi
  4200. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  4201. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  4202. shlibdir_default="$bindir_default"
  4203. SLIBPREF=""
  4204. SLIBSUF=".dll"
  4205. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4206. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4207. dlltool="${cross_prefix}dlltool"
  4208. if check_cmd lib.exe -list; then
  4209. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4210. if enabled x86_64; then
  4211. LIBTARGET=x64
  4212. fi
  4213. elif check_cmd $dlltool --version; then
  4214. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  4215. fi
  4216. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4217. SLIB_INSTALL_LINKS=
  4218. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4219. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4220. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--disable-auto-image-base'
  4221. objformat="win32"
  4222. ranlib=:
  4223. enable dos_paths
  4224. check_ldflags -Wl,--nxcompat,--dynamicbase
  4225. # Lets work around some stupidity in binutils.
  4226. # ld will strip relocations from executables even though we need them
  4227. # for dynamicbase (ASLR). Using -pie does retain the reloc section
  4228. # however ld then forgets what the entry point should be (oops) so we
  4229. # have to manually (re)set it.
  4230. if enabled x86_32; then
  4231. add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
  4232. elif enabled x86_64; then
  4233. add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
  4234. check_ldflags -Wl,--high-entropy-va # binutils 2.25
  4235. # Set image base >4GB for extra entropy with HEASLR
  4236. add_ldexeflags -Wl,--image-base,0x140000000
  4237. append SHFLAGS -Wl,--image-base,0x180000000
  4238. fi
  4239. ;;
  4240. win32|win64)
  4241. disable symver
  4242. if enabled shared; then
  4243. # Link to the import library instead of the normal static library
  4244. # for shared libs.
  4245. LD_LIB='%.lib'
  4246. # Cannot build both shared and static libs with MSVC or icl.
  4247. disable static
  4248. fi
  4249. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  4250. shlibdir_default="$bindir_default"
  4251. SLIBPREF=""
  4252. SLIBSUF=".dll"
  4253. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4254. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4255. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  4256. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4257. SLIB_INSTALL_LINKS=
  4258. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4259. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4260. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4261. objformat="win32"
  4262. ranlib=:
  4263. enable dos_paths
  4264. ;;
  4265. cygwin*)
  4266. target_os=cygwin
  4267. shlibdir_default="$bindir_default"
  4268. SLIBPREF="cyg"
  4269. SLIBSUF=".dll"
  4270. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4271. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4272. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4273. SLIB_INSTALL_LINKS=
  4274. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  4275. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  4276. objformat="win32"
  4277. enable dos_paths
  4278. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  4279. ;;
  4280. *-dos|freedos|opendos)
  4281. network_extralibs="-lsocket"
  4282. objformat="coff"
  4283. enable dos_paths
  4284. add_cppflags -U__STRICT_ANSI__
  4285. ;;
  4286. linux)
  4287. enable dv1394
  4288. enable section_data_rel_ro
  4289. ;;
  4290. irix*)
  4291. target_os=irix
  4292. ranlib="echo ignoring ranlib"
  4293. ;;
  4294. os/2*)
  4295. strip="lxlite -CS"
  4296. ln_s="cp -f"
  4297. objformat="aout"
  4298. add_cppflags -D_GNU_SOURCE
  4299. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  4300. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  4301. LIBSUF="_s.a"
  4302. SLIBPREF=""
  4303. SLIBSUF=".dll"
  4304. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  4305. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  4306. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  4307. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  4308. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  4309. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  4310. emxexp $(OBJS) >> $(SUBDIR)$(NAME).def'
  4311. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  4312. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  4313. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  4314. enable dos_paths
  4315. enable_weak os2threads
  4316. ;;
  4317. gnu/kfreebsd)
  4318. add_cppflags -D_BSD_SOURCE
  4319. ;;
  4320. gnu)
  4321. ;;
  4322. qnx)
  4323. add_cppflags -D_QNX_SOURCE
  4324. network_extralibs="-lsocket"
  4325. ;;
  4326. symbian)
  4327. SLIBSUF=".dll"
  4328. enable dos_paths
  4329. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  4330. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  4331. add_ldflags -Wl,--target1-abs,--no-undefined \
  4332. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  4333. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  4334. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  4335. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  4336. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  4337. ;;
  4338. osf1)
  4339. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  4340. ;;
  4341. minix)
  4342. ;;
  4343. plan9)
  4344. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  4345. -D_REENTRANT_SOURCE \
  4346. -D_RESEARCH_SOURCE \
  4347. -DFD_SETSIZE=96 \
  4348. -DHAVE_SOCK_OPTS
  4349. add_compat strtod.o strtod=avpriv_strtod
  4350. network_extralibs='-lbsd'
  4351. exeobjs=compat/plan9/main.o
  4352. disable ffserver
  4353. cp_f='cp'
  4354. ;;
  4355. none)
  4356. ;;
  4357. *)
  4358. die "Unknown OS '$target_os'."
  4359. ;;
  4360. esac
  4361. # test if creating links works
  4362. link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
  4363. link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
  4364. mkdir "$link_dest"
  4365. $ln_s "$link_dest" "$link_name"
  4366. touch "$link_dest/test_file"
  4367. if [ "$source_path" != "." ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
  4368. # create link to source path
  4369. [ -e src ] && rm src
  4370. $ln_s "$source_path" src
  4371. source_link=src
  4372. else
  4373. # creating directory links doesn't work
  4374. # fall back to using the full source path
  4375. source_link="$source_path"
  4376. fi
  4377. # cleanup
  4378. rm -r "$link_dest"
  4379. rm -r "$link_name"
  4380. # determine libc flavour
  4381. probe_libc(){
  4382. pfx=$1
  4383. pfx_no_=${pfx%_}
  4384. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  4385. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  4386. eval ${pfx}libc_type=uclibc
  4387. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4388. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  4389. eval ${pfx}libc_type=glibc
  4390. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4391. # MinGW headers can be installed on Cygwin, so check for newlib first.
  4392. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  4393. eval ${pfx}libc_type=newlib
  4394. add_${pfx}cppflags -U__STRICT_ANSI__
  4395. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  4396. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  4397. eval ${pfx}libc_type=mingw64
  4398. if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  4399. add_compat msvcrt/snprintf.o
  4400. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  4401. fi
  4402. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4403. eval test \$${pfx_no_}cc_type = "gcc" &&
  4404. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4405. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  4406. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  4407. eval ${pfx}libc_type=mingw32
  4408. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  4409. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  4410. die "ERROR: MinGW32 runtime version must be >= 3.15."
  4411. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4412. eval test \$${pfx_no_}cc_type = "gcc" &&
  4413. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4414. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  4415. eval ${pfx}libc_type=msvcrt
  4416. if check_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  4417. if [ "$pfx" = host_ ]; then
  4418. add_host_cppflags -Dsnprintf=_snprintf
  4419. else
  4420. add_compat strtod.o strtod=avpriv_strtod
  4421. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  4422. _snprintf=avpriv_snprintf \
  4423. vsnprintf=avpriv_vsnprintf
  4424. fi
  4425. fi
  4426. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  4427. # 0x601 by default unless something else is set by the user.
  4428. # This can easily lead to us detecting functions only present
  4429. # in such new versions and producing binaries requiring windows 7.0.
  4430. # Therefore explicitly set the default to XP unless the user has
  4431. # set something else on the command line.
  4432. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  4433. # family. For these cases, configure is free to use any functions
  4434. # found in the SDK headers by default. (Alternatively, we could force
  4435. # _WIN32_WINNT to 0x0602 in that case.)
  4436. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  4437. { check_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0502; }
  4438. #ifdef WINAPI_FAMILY
  4439. #include <winapifamily.h>
  4440. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  4441. #error not desktop
  4442. #endif
  4443. #endif
  4444. EOF
  4445. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  4446. eval ${pfx}libc_type=klibc
  4447. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  4448. eval ${pfx}libc_type=bionic
  4449. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  4450. eval ${pfx}libc_type=solaris
  4451. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  4452. fi
  4453. check_${pfx}cc <<EOF
  4454. #include <time.h>
  4455. void *v = localtime_r;
  4456. EOF
  4457. test "$?" != 0 && check_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4458. #include <time.h>
  4459. void *v = localtime_r;
  4460. EOF
  4461. }
  4462. probe_libc
  4463. test -n "$libc_type" && enable libc_$libc_type
  4464. probe_libc host_
  4465. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  4466. case $libc_type in
  4467. bionic)
  4468. add_compat strtod.o strtod=avpriv_strtod
  4469. ;;
  4470. esac
  4471. # hacks for compiler/libc/os combinations
  4472. if enabled_all tms470 libc_glibc; then
  4473. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  4474. add_cppflags -D__USER_LABEL_PREFIX__=
  4475. add_cppflags -D__builtin_memset=memset
  4476. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  4477. add_cflags -pds=48 # incompatible redefinition of macro
  4478. fi
  4479. if enabled_all ccc libc_glibc; then
  4480. add_ldflags -Wl,-z,now # calls to libots crash without this
  4481. fi
  4482. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  4483. add_cppflags '-I\$(SRC_PATH)/compat/float'
  4484. esc(){
  4485. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  4486. }
  4487. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  4488. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  4489. set_default libdir
  4490. : ${shlibdir_default:="$libdir"}
  4491. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  4492. set_default $PATHS_LIST
  4493. set_default nm
  4494. # we need to build at least one lib type
  4495. if ! enabled_any static shared; then
  4496. cat <<EOF
  4497. At least one library type must be built.
  4498. Specify --enable-static to build the static libraries or --enable-shared to
  4499. build the shared libraries as well. To only build the shared libraries specify
  4500. --disable-static in addition to --enable-shared.
  4501. EOF
  4502. exit 1;
  4503. fi
  4504. die_license_disabled() {
  4505. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  4506. }
  4507. die_license_disabled_gpl() {
  4508. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  4509. }
  4510. die_license_disabled gpl frei0r
  4511. die_license_disabled gpl libcdio
  4512. die_license_disabled gpl librubberband
  4513. die_license_disabled gpl libsmbclient
  4514. die_license_disabled gpl libutvideo
  4515. die_license_disabled gpl libvidstab
  4516. die_license_disabled gpl libx264
  4517. die_license_disabled gpl libx265
  4518. die_license_disabled gpl libxavs
  4519. die_license_disabled gpl libxvid
  4520. die_license_disabled gpl x11grab
  4521. die_license_disabled nonfree libfaac
  4522. die_license_disabled nonfree nvenc
  4523. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  4524. enabled gpl && die_license_disabled_gpl nonfree openssl
  4525. die_license_disabled version3 gmp
  4526. die_license_disabled version3 libopencore_amrnb
  4527. die_license_disabled version3 libopencore_amrwb
  4528. die_license_disabled version3 libsmbclient
  4529. die_license_disabled version3 libvo_amrwbenc
  4530. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4531. disabled optimizations || check_cflags -fomit-frame-pointer
  4532. enable_weak_pic() {
  4533. disabled pic && return
  4534. enable pic
  4535. add_cppflags -DPIC
  4536. case "$target_os" in
  4537. mingw*|cygwin*)
  4538. ;;
  4539. *)
  4540. add_cflags -fPIC
  4541. ;;
  4542. esac
  4543. add_asflags -fPIC
  4544. }
  4545. enabled pic && enable_weak_pic
  4546. check_cc <<EOF || die "Symbol mangling check failed."
  4547. int ff_extern;
  4548. EOF
  4549. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  4550. extern_prefix=${sym%%ff_extern*}
  4551. check_cc <<EOF && enable_weak inline_asm
  4552. void foo(void) { __asm__ volatile ("" ::); }
  4553. EOF
  4554. _restrict=
  4555. for restrict_keyword in restrict __restrict__ __restrict; do
  4556. check_cc <<EOF && _restrict=$restrict_keyword && break
  4557. void foo(char * $restrict_keyword p);
  4558. EOF
  4559. done
  4560. check_cc <<EOF && enable pragma_deprecated
  4561. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  4562. EOF
  4563. check_cc <<EOF && enable attribute_packed
  4564. struct { int x; } __attribute__((packed)) x;
  4565. EOF
  4566. check_cc <<EOF && enable attribute_may_alias
  4567. union { int x; } __attribute__((may_alias)) x;
  4568. EOF
  4569. check_cc <<EOF || die "endian test failed"
  4570. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  4571. EOF
  4572. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  4573. if ! enabled ppc64 || enabled bigendian; then
  4574. disable vsx
  4575. fi
  4576. check_gas() {
  4577. log "check_gas using '$as' as AS"
  4578. # :vararg is used on aarch64, arm and ppc altivec
  4579. check_as <<EOF || return 1
  4580. .macro m n, y:vararg=0
  4581. \n: .int \y
  4582. .endm
  4583. m x
  4584. EOF
  4585. # .altmacro is only used in arm asm
  4586. ! enabled arm || check_as <<EOF || return 1
  4587. .altmacro
  4588. EOF
  4589. enable gnu_as
  4590. return 0
  4591. }
  4592. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  4593. nogas=:
  4594. enabled_any arm aarch64 && nogas=die
  4595. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  4596. as_noop=-v
  4597. case $as_type in
  4598. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  4599. gcc) gaspp_as_type=gas ;;
  4600. *) gaspp_as_type=$as_type ;;
  4601. esac
  4602. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  4603. test "${as#*gas-preprocessor.pl}" != "$as" ||
  4604. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  4605. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  4606. if ! check_gas ; then
  4607. as=${gas:=$as}
  4608. check_gas || \
  4609. $nogas "GNU assembler not found, install/update gas-preprocessor"
  4610. fi
  4611. check_as <<EOF && enable as_func
  4612. .func test
  4613. .endfunc
  4614. EOF
  4615. fi
  4616. check_inline_asm inline_asm_labels '"1:\n"'
  4617. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  4618. if enabled aarch64; then
  4619. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  4620. # internal assembler in clang 3.3 does not support this instruction
  4621. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  4622. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  4623. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  4624. elif enabled alpha; then
  4625. check_cflags -mieee
  4626. elif enabled arm; then
  4627. enabled msvc && check_cpp_condition stddef.h "defined _M_ARMT" && enable thumb
  4628. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  4629. float func(float a, float b){ return a+b; }
  4630. EOF
  4631. enabled thumb && check_cflags -mthumb || check_cflags -marm
  4632. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  4633. enable vfp_args
  4634. elif check_cpp_condition stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  4635. enable vfp_args
  4636. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  4637. case "${cross_prefix:-$cc}" in
  4638. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  4639. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  4640. __asm__ (".eabi_attribute 28, 1");
  4641. int main(void) { return 0; }
  4642. EOF
  4643. esac
  4644. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  4645. fi
  4646. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  4647. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  4648. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  4649. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  4650. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  4651. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  4652. enabled setend && check_insn setend 'setend be'
  4653. [ $target_os = linux ] || [ $target_os = android ] ||
  4654. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  4655. $ARCH_EXT_LIST_ARM
  4656. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  4657. check_as <<EOF && enable as_dn_directive
  4658. ra .dn d0.i16
  4659. .unreq ra
  4660. EOF
  4661. # llvm's integrated assembler supports .object_arch from llvm 3.5
  4662. [ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
  4663. .object_arch armv4
  4664. EOF
  4665. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  4666. elif enabled mips; then
  4667. enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"'
  4668. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
  4669. enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
  4670. # Enable minimum ISA based on selected options
  4671. if enabled mips64; then
  4672. enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
  4673. enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
  4674. disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
  4675. else
  4676. enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
  4677. enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
  4678. enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
  4679. disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
  4680. fi
  4681. enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
  4682. enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
  4683. enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa
  4684. enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
  4685. enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
  4686. elif enabled parisc; then
  4687. if enabled gcc; then
  4688. case $($cc -dumpversion) in
  4689. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  4690. esac
  4691. fi
  4692. elif enabled ppc; then
  4693. enable local_aligned_8 local_aligned_16 local_aligned_32
  4694. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  4695. check_inline_asm ibm_asm '"add 0, 0, 0"'
  4696. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  4697. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  4698. # AltiVec flags: The FSF version of GCC differs from the Apple version
  4699. if enabled altivec; then
  4700. check_cflags -maltivec -mabi=altivec &&
  4701. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  4702. check_cflags -faltivec
  4703. # check if our compiler supports Motorola AltiVec C API
  4704. check_cc <<EOF || disable altivec
  4705. $inc_altivec_h
  4706. int main(void) {
  4707. vector signed int v1 = (vector signed int) { 0 };
  4708. vector signed int v2 = (vector signed int) { 1 };
  4709. v1 = vec_add(v1, v2);
  4710. return 0;
  4711. }
  4712. EOF
  4713. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  4714. fi
  4715. if enabled vsx; then
  4716. check_cflags -mvsx &&
  4717. check_builtin vec_vsx_ld "altivec.h" "__builtin_vec_vsx_ld" || disable vsx
  4718. fi
  4719. if enabled power8; then
  4720. check_cpp_condition "altivec.h" "defined(_ARCH_PWR8)" || disable power8
  4721. fi
  4722. elif enabled x86; then
  4723. check_builtin rdtsc intrin.h "__rdtsc()"
  4724. check_builtin mm_empty mmintrin.h "_mm_empty()"
  4725. enable local_aligned_8 local_aligned_16 local_aligned_32
  4726. # check whether EBP is available on x86
  4727. # As 'i' is stored on the stack, this program will crash
  4728. # if the base pointer is used to access it because the
  4729. # base pointer is cleared in the inline assembly code.
  4730. check_exec_crash <<EOF && enable ebp_available
  4731. volatile int i=0;
  4732. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  4733. return i;
  4734. EOF
  4735. # check whether EBX is available on x86
  4736. check_inline_asm ebx_available '""::"b"(0)' &&
  4737. check_inline_asm ebx_available '"":::"%ebx"'
  4738. # check whether xmm clobbers are supported
  4739. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  4740. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  4741. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  4742. # check whether binutils is new enough to compile SSSE3/MMXEXT
  4743. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  4744. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  4745. if ! disabled_any asm mmx yasm; then
  4746. if check_cmd $yasmexe --version; then
  4747. enabled x86_64 && yasm_extra="-m amd64"
  4748. yasm_debug="-g dwarf2"
  4749. elif check_cmd nasm -v; then
  4750. yasmexe=nasm
  4751. yasm_debug="-g -F dwarf"
  4752. if enabled x86_64; then
  4753. case "$objformat" in
  4754. elf) objformat=elf64 ;;
  4755. win32) objformat=win64 ;;
  4756. esac
  4757. fi
  4758. fi
  4759. YASMFLAGS="-f $objformat $yasm_extra"
  4760. enabled pic && append YASMFLAGS "-DPIC"
  4761. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  4762. case "$objformat" in
  4763. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  4764. esac
  4765. check_yasm "movbe ecx, [5]" && enable yasm ||
  4766. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  4767. check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  4768. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  4769. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  4770. check_yasm "CPU amdnop" || disable cpunop
  4771. fi
  4772. case "$cpu" in
  4773. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  4774. disable fast_clz
  4775. ;;
  4776. esac
  4777. fi
  4778. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  4779. check_ldflags -Wl,--as-needed
  4780. check_ldflags -Wl,-z,noexecstack
  4781. if check_func dlopen; then
  4782. ldl=
  4783. elif check_func dlopen -ldl; then
  4784. ldl=-ldl
  4785. fi
  4786. decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl"
  4787. decklink_indev_extralibs="$decklink_indev_extralibs $ldl"
  4788. frei0r_filter_extralibs='$ldl'
  4789. frei0r_src_filter_extralibs='$ldl'
  4790. ladspa_filter_extralibs='$ldl'
  4791. nvenc_encoder_extralibs='$ldl'
  4792. if ! disabled network; then
  4793. check_func getaddrinfo $network_extralibs
  4794. check_func inet_aton $network_extralibs
  4795. check_type netdb.h "struct addrinfo"
  4796. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  4797. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  4798. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  4799. check_type poll.h "struct pollfd"
  4800. check_type netinet/sctp.h "struct sctp_event_subscribe"
  4801. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  4802. check_type netinet/in.h "struct sockaddr_in6"
  4803. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  4804. check_type "sys/types.h sys/socket.h" socklen_t
  4805. # Prefer arpa/inet.h over winsock2
  4806. if check_header arpa/inet.h ; then
  4807. check_func closesocket
  4808. elif check_header winsock2.h ; then
  4809. check_func_headers winsock2.h closesocket -lws2 &&
  4810. network_extralibs="-lws2" ||
  4811. { check_func_headers winsock2.h closesocket -lws2_32 &&
  4812. network_extralibs="-lws2_32"; } || disable winsock2_h network
  4813. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  4814. check_type ws2tcpip.h socklen_t
  4815. check_type ws2tcpip.h "struct addrinfo"
  4816. check_type ws2tcpip.h "struct group_source_req"
  4817. check_type ws2tcpip.h "struct ip_mreq_source"
  4818. check_type ws2tcpip.h "struct ipv6_mreq"
  4819. check_type winsock2.h "struct pollfd"
  4820. check_struct winsock2.h "struct sockaddr" sa_len
  4821. check_type ws2tcpip.h "struct sockaddr_in6"
  4822. check_type ws2tcpip.h "struct sockaddr_storage"
  4823. else
  4824. disable network
  4825. fi
  4826. fi
  4827. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  4828. check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
  4829. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  4830. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  4831. check_builtin sarestart signal.h "SA_RESTART"
  4832. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  4833. check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
  4834. check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
  4835. case "$custom_allocator" in
  4836. jemalloc)
  4837. # jemalloc by default does not use a prefix
  4838. require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
  4839. ;;
  4840. tcmalloc)
  4841. require_pkg_config libtcmalloc gperftools/tcmalloc.h tc_malloc
  4842. malloc_prefix=tc_
  4843. ;;
  4844. esac
  4845. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  4846. check_func ${malloc_prefix}memalign && enable memalign
  4847. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  4848. check_func access
  4849. check_func arc4random
  4850. check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4851. check_func fcntl
  4852. check_func fork
  4853. check_func gethrtime
  4854. check_func getopt
  4855. check_func getrusage
  4856. check_func gettimeofday
  4857. check_func isatty
  4858. check_func mach_absolute_time
  4859. check_func mkstemp
  4860. check_func mmap
  4861. check_func mprotect
  4862. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  4863. check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4864. check_func sched_getaffinity
  4865. check_func setrlimit
  4866. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  4867. check_func strerror_r
  4868. check_func sysconf
  4869. check_func sysctl
  4870. check_func usleep
  4871. check_func_headers conio.h kbhit
  4872. check_func_headers io.h setmode
  4873. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  4874. check_func_headers stdlib.h getenv
  4875. check_func_headers sys/stat.h lstat
  4876. check_func_headers windows.h CoTaskMemFree -lole32
  4877. check_func_headers windows.h GetProcessAffinityMask
  4878. check_func_headers windows.h GetProcessTimes
  4879. check_func_headers windows.h GetSystemTimeAsFileTime
  4880. check_func_headers windows.h MapViewOfFile
  4881. check_func_headers windows.h PeekNamedPipe
  4882. check_func_headers windows.h SetConsoleTextAttribute
  4883. check_func_headers windows.h SetConsoleCtrlHandler
  4884. check_func_headers windows.h SetDllDirectory
  4885. check_func_headers windows.h Sleep
  4886. check_func_headers windows.h VirtualAlloc
  4887. check_struct windows.h "CONDITION_VARIABLE" Ptr
  4888. check_func_headers glob.h glob
  4889. enabled xlib &&
  4890. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  4891. check_header direct.h
  4892. check_header dirent.h
  4893. check_header dlfcn.h
  4894. check_header d3d11.h
  4895. check_header dxva.h
  4896. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  4897. check_header io.h
  4898. check_header libcrystalhd/libcrystalhd_if.h
  4899. check_header mach/mach_time.h
  4900. check_header malloc.h
  4901. check_header net/udplite.h
  4902. check_header poll.h
  4903. check_header sys/mman.h
  4904. check_header sys/param.h
  4905. check_header sys/resource.h
  4906. check_header sys/select.h
  4907. check_header sys/time.h
  4908. check_header sys/un.h
  4909. check_header termios.h
  4910. check_header unistd.h
  4911. check_header valgrind/valgrind.h
  4912. check_header vdpau/vdpau.h
  4913. check_header vdpau/vdpau_x11.h
  4914. check_header VideoDecodeAcceleration/VDADecoder.h
  4915. check_header VideoToolbox/VideoToolbox.h
  4916. check_header windows.h
  4917. check_header X11/extensions/XvMClib.h
  4918. check_header asm/types.h
  4919. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  4920. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  4921. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  4922. check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices"
  4923. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  4924. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  4925. check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  4926. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  4927. check_type "windows.h d3d11.h" "ID3D11VideoContext"
  4928. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  4929. check_type "va/va.h" "VAPictureParameterBufferHEVC"
  4930. check_type "va/va.h" "VADecPictureParameterBufferVP9"
  4931. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  4932. check_cpp_condition windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" && enable winrt || disable winrt
  4933. if ! disabled w32threads && ! enabled pthreads; then
  4934. check_func_headers "windows.h process.h" _beginthreadex &&
  4935. enable w32threads || disable w32threads
  4936. if ! enabled w32threads && enabled winrt; then
  4937. check_func_headers "windows.h" CreateThread &&
  4938. enable w32threads || disable w32threads
  4939. fi
  4940. fi
  4941. # check for some common methods of building with pthread support
  4942. # do this before the optional library checks as some of them require pthreads
  4943. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  4944. enable pthreads
  4945. if check_func pthread_join -pthread && check_func pthread_create -pthread; then
  4946. add_cflags -pthread
  4947. add_extralibs -pthread
  4948. elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
  4949. add_cflags -pthreads
  4950. add_extralibs -pthreads
  4951. elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
  4952. add_cflags -ldl -pthread
  4953. add_extralibs -ldl -pthread
  4954. elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
  4955. add_extralibs -lpthreadGC2
  4956. elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
  4957. :
  4958. elif ! check_func pthread_join && ! check_func pthread_create; then
  4959. disable pthreads
  4960. fi
  4961. check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
  4962. fi
  4963. if enabled pthreads; then
  4964. check_func pthread_cancel
  4965. fi
  4966. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  4967. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  4968. disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
  4969. check_lib math.h sin -lm && LIBM="-lm"
  4970. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  4971. atan2f_args=2
  4972. copysign_args=2
  4973. hypot_args=2
  4974. ldexpf_args=2
  4975. powf_args=2
  4976. for func in $MATH_FUNCS; do
  4977. eval check_mathfunc $func \${${func}_args:-1}
  4978. done
  4979. for func in $COMPLEX_FUNCS; do
  4980. eval check_complexfunc $func \${${func}_args:-1}
  4981. done
  4982. # these are off by default, so fail if requested and not available
  4983. enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
  4984. enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
  4985. check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
  4986. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  4987. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  4988. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  4989. enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
  4990. enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
  4991. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  4992. enabled gmp && require2 gmp gmp.h mpz_export -lgmp
  4993. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  4994. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  4995. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  4996. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  4997. enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
  4998. enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
  4999. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  5000. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  5001. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  5002. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  5003. enabled libdcadec && require_pkg_config "dcadec >= 0.1.0" libdcadec/dca_context.h dcadec_context_create
  5004. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  5005. enabled libfdk_aac && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
  5006. { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
  5007. warn "using libfdk without pkg-config"; } }
  5008. flite_libs="-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"
  5009. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  5010. enabled fontconfig && enable libfontconfig
  5011. enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  5012. enabled libfreetype && require_libfreetype
  5013. enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
  5014. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  5015. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  5016. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  5017. done || die "ERROR: libgsm not found"; }
  5018. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  5019. enabled libkvazaar && require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
  5020. enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
  5021. enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
  5022. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  5023. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  5024. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  5025. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  5026. enabled libopencv && { check_header opencv2/core/core_c.h &&
  5027. require_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
  5028. require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
  5029. enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
  5030. enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  5031. check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
  5032. { check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  5033. { check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  5034. { check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  5035. die "ERROR: libopenjpeg not found"; }
  5036. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  5037. enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  5038. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  5039. enabled librubberband && require_pkg_config "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
  5040. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  5041. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  5042. enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
  5043. require smbclient libsmbclient.h smbc_init -lsmbclient; }
  5044. enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy
  5045. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
  5046. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  5047. enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
  5048. enabled libtesseract && require_pkg_config tesseract tesseract/capi.h TessBaseAPICreate
  5049. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  5050. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  5051. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  5052. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  5053. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  5054. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  5055. enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  5056. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  5057. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  5058. enabled libvpx && {
  5059. enabled libvpx_vp8_decoder && {
  5060. use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
  5061. check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  5062. die "ERROR: libvpx decoder version must be >=0.9.1";
  5063. }
  5064. enabled libvpx_vp8_encoder && {
  5065. use_pkg_config "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
  5066. check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  5067. die "ERROR: libvpx encoder version must be >=0.9.7";
  5068. }
  5069. enabled libvpx_vp9_decoder && {
  5070. use_pkg_config "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
  5071. check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
  5072. disable libvpx_vp9_decoder;
  5073. }
  5074. enabled libvpx_vp9_encoder && {
  5075. use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
  5076. check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
  5077. disable libvpx_vp9_encoder;
  5078. }
  5079. if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
  5080. die "libvpx enabled but no supported decoders found"
  5081. fi
  5082. }
  5083. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  5084. enabled libwebp && {
  5085. enabled libwebp_encoder && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  5086. enabled libwebp_anim_encoder && { use_pkg_config "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit || disable libwebp_anim_encoder; } }
  5087. enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
  5088. { require libx264 x264.h x264_encoder_encode -lx264 &&
  5089. warn "using libx264 without pkg-config"; } } &&
  5090. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  5091. die "ERROR: libx264 must be installed and version must be >= 0.118."; } &&
  5092. { check_cpp_condition x264.h "X264_MPEG2" &&
  5093. enable libx262; }
  5094. enabled libx265 && require_pkg_config x265 x265.h x265_api_get &&
  5095. { check_cpp_condition x265.h "X265_BUILD >= 68" ||
  5096. die "ERROR: libx265 version must be >= 68."; }
  5097. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  5098. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  5099. enabled libzimg && require_pkg_config zimg zimg.h zimg_get_api_version
  5100. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  5101. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi &&
  5102. { check_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
  5103. enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
  5104. enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  5105. { ! enabled cross_compile && {
  5106. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ;
  5107. add_extralibs -L/opt/vc/lib/ -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ;
  5108. check_lib interface/mmal/mmal.h mmal_port_connect ; }
  5109. check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
  5110. die "ERROR: mmal not found"; }
  5111. enabled mmal &&
  5112. (check_code cc interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS" ||
  5113. die "ERROR: mmal firmware headers too old")
  5114. enabled netcdf && require_pkg_config netcdf netcdf.h nc_inq_libvers
  5115. enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
  5116. { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
  5117. die "ERROR: NVENC API version 4 or older is not supported"; } &&
  5118. { [ $target_os != cygwin ] || die "ERROR: NVENC is not supported on Cygwin currently."; }
  5119. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  5120. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  5121. die "ERROR: openal not found"; } &&
  5122. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  5123. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  5124. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  5125. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  5126. die "ERROR: opencl not found"; } &&
  5127. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  5128. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  5129. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  5130. enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
  5131. check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  5132. check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  5133. check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  5134. die "ERROR: opengl not found."
  5135. }
  5136. enabled openssl && { use_pkg_config openssl openssl/ssl.h SSL_library_init ||
  5137. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  5138. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  5139. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  5140. die "ERROR: openssl not found"; }
  5141. enabled qtkit_indev && { check_header_objcc QTKit/QTKit.h || disable qtkit_indev; }
  5142. # libdc1394 check
  5143. if enabled libdc1394; then
  5144. { require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new &&
  5145. enable libdc1394_2; } ||
  5146. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  5147. enable libdc1394_1; } ||
  5148. die "ERROR: No version of libdc1394 found "
  5149. fi
  5150. if enabled gcrypt; then
  5151. GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
  5152. if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
  5153. gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
  5154. gcrypt_libs=$("${GCRYPT_CONFIG}" --libs)
  5155. check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_libs ||
  5156. die "ERROR: gcrypt not found"
  5157. add_cflags $gcrypt_cflags && add_extralibs $gcrypt_libs
  5158. else
  5159. require2 gcrypt gcrypt.h gcry_mpi_new -lgcrypt
  5160. fi
  5161. fi
  5162. if ! disabled sdl; then
  5163. SDL_CONFIG="${cross_prefix}sdl-config"
  5164. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  5165. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  5166. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  5167. enable sdl
  5168. else
  5169. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  5170. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  5171. sdl_libs=$("${SDL_CONFIG}" --libs)
  5172. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  5173. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  5174. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  5175. enable sdl
  5176. elif enabled sdl ; then
  5177. die "ERROR: SDL not found"
  5178. else
  5179. disable sdl
  5180. fi
  5181. fi
  5182. if test $target_os = "mingw32"; then
  5183. sdl_libs="$sdl_libs -mconsole"
  5184. fi
  5185. fi
  5186. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  5187. disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  5188. check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  5189. enable securetransport; }
  5190. disabled schannel || { check_func_headers "windows.h Security.h" InitializeSecurityContext -DSECURITY_WIN32 -lSecur32 &&
  5191. check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lSecur32; }
  5192. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  5193. enabled makeinfo \
  5194. && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
  5195. && enable makeinfo_html || disable makeinfo_html
  5196. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  5197. perl -v > /dev/null 2>&1 && enable perl || disable perl
  5198. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  5199. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  5200. check_header linux/fb.h
  5201. check_header linux/videodev.h
  5202. check_header linux/videodev2.h
  5203. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  5204. check_header sys/videoio.h
  5205. check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  5206. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  5207. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  5208. # w32api 3.12 had it defined wrong
  5209. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  5210. check_type "dshow.h" IBaseFilter
  5211. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  5212. { check_header dev/bktr/ioctl_meteor.h &&
  5213. check_header dev/bktr/ioctl_bt848.h; } ||
  5214. { check_header machine/ioctl_meteor.h &&
  5215. check_header machine/ioctl_bt848.h; } ||
  5216. { check_header dev/video/meteor/ioctl_meteor.h &&
  5217. check_header dev/video/bktr/ioctl_bt848.h; } ||
  5218. check_header dev/ic/bt8xx.h
  5219. check_header sndio.h
  5220. if check_struct sys/soundcard.h audio_buf_info bytes; then
  5221. enable_safe sys/soundcard.h
  5222. else
  5223. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  5224. #include <sys/soundcard.h>
  5225. audio_buf_info abc;
  5226. EOF
  5227. fi
  5228. check_header soundcard.h
  5229. enabled_any alsa_indev alsa_outdev &&
  5230. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  5231. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  5232. check_func jack_port_get_latency_range -ljack
  5233. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  5234. if enabled libcdio; then
  5235. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5236. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5237. die "ERROR: No usable libcdio/cdparanoia found"
  5238. fi
  5239. enabled xlib &&
  5240. check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
  5241. if ! disabled libxcb; then
  5242. check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
  5243. enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
  5244. } && disable x11grab && enable libxcb
  5245. if enabled libxcb; then
  5246. disabled libxcb_shm || {
  5247. check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
  5248. enabled libxcb_shm && die "ERROR: libxcb_shm not found";
  5249. } && check_header sys/shm.h && enable libxcb_shm; }
  5250. disabled libxcb_xfixes || {
  5251. check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
  5252. enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
  5253. } && enable libxcb_xfixes; }
  5254. disabled libxcb_shape || {
  5255. check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
  5256. enabled libxcb_shape && die "ERROR: libxcb_shape not found";
  5257. } && enable libxcb_shape; }
  5258. add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
  5259. add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
  5260. fi
  5261. fi
  5262. if enabled x11grab; then
  5263. enabled xlib || die "ERROR: Xlib not found"
  5264. require Xext X11/extensions/XShm.h XShmCreateImage -lXext
  5265. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  5266. fi
  5267. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  5268. enabled dxva2api_h &&
  5269. check_cc <<EOF && enable dxva2api_cobj
  5270. #define _WIN32_WINNT 0x0600
  5271. #define COBJMACROS
  5272. #include <windows.h>
  5273. #include <d3d9.h>
  5274. #include <dxva2api.h>
  5275. int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
  5276. EOF
  5277. enabled vaapi &&
  5278. check_lib va/va.h vaInitialize -lva ||
  5279. disable vaapi
  5280. enabled vaapi && enabled xlib &&
  5281. check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
  5282. enable vaapi_x11
  5283. enabled vdpau &&
  5284. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  5285. disable vdpau
  5286. enabled vdpau && enabled xlib &&
  5287. check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  5288. prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
  5289. enable vdpau_x11
  5290. # Funny iconv installations are not unusual, so check it after all flags have been set
  5291. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  5292. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  5293. # add some useful compiler flags if supported
  5294. check_cflags -Wdeclaration-after-statement
  5295. check_cflags -Wall
  5296. check_cflags -Wdisabled-optimization
  5297. check_cflags -Wpointer-arith
  5298. check_cflags -Wredundant-decls
  5299. check_cflags -Wwrite-strings
  5300. check_cflags -Wtype-limits
  5301. check_cflags -Wundef
  5302. check_cflags -Wmissing-prototypes
  5303. check_cflags -Wno-pointer-to-int-cast
  5304. check_cflags -Wstrict-prototypes
  5305. check_cflags -Wempty-body
  5306. enabled extra_warnings && check_cflags -Winline
  5307. enabled extra_warnings && check_cflags -Wcast-qual
  5308. check_disable_warning(){
  5309. warning_flag=-W${1#-Wno-}
  5310. test_cflags $warning_flag && add_cflags $1
  5311. }
  5312. check_disable_warning -Wno-parentheses
  5313. check_disable_warning -Wno-switch
  5314. check_disable_warning -Wno-format-zero-length
  5315. check_disable_warning -Wno-pointer-sign
  5316. check_disable_warning -Wno-unused-const-variable
  5317. # add some linker flags
  5318. check_ldflags -Wl,--warn-common
  5319. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  5320. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
  5321. enabled rpath && add_ldlibflags -Wl,-rpath,$libdir
  5322. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  5323. # add some strip flags
  5324. # -wN '..@*' is more selective than -x, but not available everywhere.
  5325. check_stripflags -wN \'..@*\' || check_stripflags -x
  5326. enabled neon_clobber_test &&
  5327. check_ldflags -Wl,--wrap,avcodec_open2 \
  5328. -Wl,--wrap,avcodec_decode_audio4 \
  5329. -Wl,--wrap,avcodec_decode_video2 \
  5330. -Wl,--wrap,avcodec_decode_subtitle2 \
  5331. -Wl,--wrap,avcodec_encode_audio2 \
  5332. -Wl,--wrap,avcodec_encode_video2 \
  5333. -Wl,--wrap,avcodec_encode_subtitle \
  5334. -Wl,--wrap,swr_convert \
  5335. -Wl,--wrap,avresample_convert ||
  5336. disable neon_clobber_test
  5337. enabled xmm_clobber_test &&
  5338. check_ldflags -Wl,--wrap,avcodec_open2 \
  5339. -Wl,--wrap,avcodec_decode_audio4 \
  5340. -Wl,--wrap,avcodec_decode_video2 \
  5341. -Wl,--wrap,avcodec_decode_subtitle2 \
  5342. -Wl,--wrap,avcodec_encode_audio2 \
  5343. -Wl,--wrap,avcodec_encode_video2 \
  5344. -Wl,--wrap,avcodec_encode_subtitle \
  5345. -Wl,--wrap,swr_convert \
  5346. -Wl,--wrap,avresample_convert \
  5347. -Wl,--wrap,sws_scale ||
  5348. disable xmm_clobber_test
  5349. echo "X { local: *; };" > $TMPV
  5350. if test_ldflags -Wl,--version-script,$TMPV; then
  5351. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  5352. elif test_ldflags -Wl,-M,$TMPV; then
  5353. append SHFLAGS '-Wl,-M,\$(SUBDIR)lib\$(NAME).ver-sol2'
  5354. fi
  5355. check_cc <<EOF && enable symver_asm_label
  5356. void ff_foo(void) __asm__ ("av_foo@VERSION");
  5357. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  5358. EOF
  5359. check_cc <<EOF && enable symver_gnu_asm
  5360. __asm__(".symver ff_foo,av_foo@VERSION");
  5361. void ff_foo(void) {}
  5362. EOF
  5363. if [ -z "$optflags" ]; then
  5364. if enabled small; then
  5365. optflags=$cflags_size
  5366. elif enabled optimizations; then
  5367. optflags=$cflags_speed
  5368. else
  5369. optflags=$cflags_noopt
  5370. fi
  5371. fi
  5372. check_optflags(){
  5373. check_cflags "$@"
  5374. enabled lto && check_ldflags "$@"
  5375. }
  5376. if enabled lto; then
  5377. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  5378. check_cflags -flto
  5379. check_ldflags -flto $cpuflags
  5380. disable inline_asm_direct_symbol_refs
  5381. fi
  5382. check_optflags $optflags
  5383. check_optflags -fno-math-errno
  5384. check_optflags -fno-signed-zeros
  5385. enabled ftrapv && check_cflags -ftrapv
  5386. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  5387. int x;
  5388. EOF
  5389. if enabled icc; then
  5390. # Just warnings, no remarks
  5391. check_cflags -w1
  5392. # -wd: Disable following warnings
  5393. # 144, 167, 556: -Wno-pointer-sign
  5394. # 188: enumerated type mixed with another type
  5395. # 1292: attribute "foo" ignored
  5396. # 1419: external declaration in primary source file
  5397. # 10006: ignoring unknown option -fno-signed-zeros
  5398. # 10148: ignoring unknown option -Wno-parentheses
  5399. # 10156: ignoring option '-W'; no argument required
  5400. # 13200: No EMMS instruction before call to function
  5401. # 13203: No EMMS instruction before return from function
  5402. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  5403. # 11030: Warning unknown option --as-needed
  5404. # 10156: ignoring option '-export'; no argument required
  5405. check_ldflags -wd10156,11030
  5406. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  5407. enable ebp_available
  5408. # The test above does not test linking
  5409. enabled lto && disable symver_asm_label
  5410. if enabled x86_32; then
  5411. icc_version=$($cc -dumpversion)
  5412. test ${icc_version%%.*} -ge 11 &&
  5413. check_cflags -falign-stack=maintain-16-byte ||
  5414. disable aligned_stack
  5415. fi
  5416. elif enabled ccc; then
  5417. # disable some annoying warnings
  5418. add_cflags -msg_disable bitnotint
  5419. add_cflags -msg_disable mixfuncvoid
  5420. add_cflags -msg_disable nonstandcast
  5421. add_cflags -msg_disable unsupieee
  5422. elif enabled gcc; then
  5423. check_optflags -fno-tree-vectorize
  5424. check_cflags -Werror=format-security
  5425. check_cflags -Werror=implicit-function-declaration
  5426. check_cflags -Werror=missing-prototypes
  5427. check_cflags -Werror=return-type
  5428. check_cflags -Werror=vla
  5429. check_cflags -Wformat
  5430. check_cflags -fdiagnostics-color=auto
  5431. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  5432. elif enabled llvm_gcc; then
  5433. check_cflags -mllvm -stack-alignment=16
  5434. elif enabled clang; then
  5435. check_cflags -mllvm -stack-alignment=16
  5436. check_cflags -Qunused-arguments
  5437. check_cflags -Werror=implicit-function-declaration
  5438. check_cflags -Werror=missing-prototypes
  5439. check_cflags -Werror=return-type
  5440. elif enabled cparser; then
  5441. add_cflags -Wno-missing-variable-declarations
  5442. add_cflags -Wno-empty-statement
  5443. elif enabled armcc; then
  5444. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  5445. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  5446. # 2523: use of inline assembly is deprecated
  5447. add_cflags -W${armcc_opt},--diag_suppress=2523
  5448. add_cflags -W${armcc_opt},--diag_suppress=1207
  5449. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  5450. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  5451. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  5452. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  5453. elif enabled tms470; then
  5454. add_cflags -pds=824 -pds=837
  5455. disable inline_asm
  5456. elif enabled pathscale; then
  5457. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  5458. elif enabled_any msvc icl; then
  5459. enabled x86_32 && disable aligned_stack
  5460. enabled_all x86_32 debug && add_cflags -Oy-
  5461. enabled debug && add_ldflags -debug
  5462. enable pragma_deprecated
  5463. if enabled icl; then
  5464. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  5465. # (correctly) on icl 13.x.
  5466. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  5467. add_cflags -Qansi-alias
  5468. # Some inline asm is not compilable in debug
  5469. if enabled debug; then
  5470. disable ebp_available
  5471. disable ebx_available
  5472. fi
  5473. fi
  5474. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  5475. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  5476. # The CRT headers contain __declspec(restrict) in a few places, but if redefining
  5477. # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
  5478. # (as it ends up if the restrict redefine is done before including stdlib.h), while
  5479. # MSVC 2013 and newer can handle it fine.
  5480. # If this declspec fails, force including stdlib.h before the restrict redefinition
  5481. # happens in config.h.
  5482. if [ $_restrict != restrict ]; then
  5483. check_cc <<EOF || add_cflags -FIstdlib.h
  5484. __declspec($_restrict) void* foo(int);
  5485. EOF
  5486. fi
  5487. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  5488. check_func strtoull || add_cflags -Dstrtoull=_strtoui64
  5489. fi
  5490. for pfx in "" host_; do
  5491. varname=${pfx%_}cc_type
  5492. eval "type=\$$varname"
  5493. if [ $type = "msvc" ]; then
  5494. check_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  5495. static inline int foo(int a) { return a; }
  5496. EOF
  5497. fi
  5498. done
  5499. case $as_type in
  5500. clang)
  5501. add_asflags -Qunused-arguments
  5502. ;;
  5503. esac
  5504. case $ld_type in
  5505. clang)
  5506. check_ldflags -Qunused-arguments
  5507. ;;
  5508. esac
  5509. case $target_os in
  5510. osf1)
  5511. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  5512. ;;
  5513. plan9)
  5514. add_cppflags -Dmain=plan9_main
  5515. ;;
  5516. esac
  5517. enable frame_thread_encoder
  5518. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  5519. check_deps $CONFIG_LIST \
  5520. $CONFIG_EXTRA \
  5521. $HAVE_LIST \
  5522. $ALL_COMPONENTS \
  5523. 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"
  5524. if test $target_os = "haiku"; then
  5525. disable memalign
  5526. disable posix_memalign
  5527. fi
  5528. enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
  5529. prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
  5530. enable dxva2_lib
  5531. ! enabled_any memalign posix_memalign aligned_malloc &&
  5532. enabled simd_align_16 && enable memalign_hack
  5533. # add_dep lib dep
  5534. # -> enable ${lib}_deps_${dep}
  5535. # -> add $dep to ${lib}_deps only once
  5536. add_dep() {
  5537. lib=$1
  5538. dep=$2
  5539. enabled "${lib}_deps_${dep}" && return 0
  5540. enable "${lib}_deps_${dep}"
  5541. prepend "${lib}_deps" $dep
  5542. }
  5543. # merge deps lib components
  5544. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  5545. merge_deps() {
  5546. lib=$1
  5547. shift
  5548. for comp in $*; do
  5549. enabled $comp || continue
  5550. eval "dep=\"\$${comp}_deps\""
  5551. for d in $dep; do
  5552. add_dep $lib $d
  5553. done
  5554. done
  5555. }
  5556. merge_deps libavfilter $FILTER_LIST
  5557. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  5558. for thread in $THREADS_LIST; do
  5559. if enabled $thread; then
  5560. test -n "$thread_type" &&
  5561. die "ERROR: Only one thread type must be selected." ||
  5562. thread_type="$thread"
  5563. fi
  5564. done
  5565. enabled zlib && add_cppflags -DZLIB_CONST
  5566. # conditional library dependencies, in linking order
  5567. enabled afftfilt_filter && prepend avfilter_deps "avcodec"
  5568. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  5569. enabled aresample_filter && prepend avfilter_deps "swresample"
  5570. enabled asyncts_filter && prepend avfilter_deps "avresample"
  5571. enabled atempo_filter && prepend avfilter_deps "avcodec"
  5572. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  5573. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  5574. enabled elbg_filter && prepend avfilter_deps "avcodec"
  5575. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  5576. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  5577. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  5578. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  5579. enabled pan_filter && prepend avfilter_deps "swresample"
  5580. enabled pp_filter && prepend avfilter_deps "postproc"
  5581. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  5582. enabled resample_filter && prepend avfilter_deps "avresample"
  5583. enabled sab_filter && prepend avfilter_deps "swscale"
  5584. enabled scale_filter && prepend avfilter_deps "swscale"
  5585. enabled scale2ref_filter && prepend avfilter_deps "swscale"
  5586. enabled sofalizer_filter && prepend avfilter_deps "avcodec"
  5587. enabled showcqt_filter && prepend avfilter_deps "avformat avcodec swscale"
  5588. enabled showfreqs_filter && prepend avfilter_deps "avcodec"
  5589. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  5590. enabled smartblur_filter && prepend avfilter_deps "swscale"
  5591. enabled spectrumsynth_filter && prepend avfilter_deps "avcodec"
  5592. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  5593. enabled uspp_filter && prepend avfilter_deps "avcodec"
  5594. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  5595. enabled opus_decoder && prepend avcodec_deps "swresample"
  5596. expand_deps(){
  5597. lib_deps=${1}_deps
  5598. eval "deps=\$$lib_deps"
  5599. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  5600. unique $lib_deps
  5601. }
  5602. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  5603. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  5604. map 'expand_deps $v' $LIBRARY_LIST
  5605. echo "install prefix $prefix"
  5606. echo "source path $source_path"
  5607. echo "C compiler $cc"
  5608. echo "C library $libc_type"
  5609. if test "$host_cc" != "$cc"; then
  5610. echo "host C compiler $host_cc"
  5611. echo "host C library $host_libc_type"
  5612. fi
  5613. echo "ARCH $arch ($cpu)"
  5614. if test "$build_suffix" != ""; then
  5615. echo "build suffix $build_suffix"
  5616. fi
  5617. if test "$progs_suffix" != ""; then
  5618. echo "progs suffix $progs_suffix"
  5619. fi
  5620. if test "$extra_version" != ""; then
  5621. echo "version string suffix $extra_version"
  5622. fi
  5623. echo "big-endian ${bigendian-no}"
  5624. echo "runtime cpu detection ${runtime_cpudetect-no}"
  5625. if enabled x86; then
  5626. echo "${yasmexe} ${yasm-no}"
  5627. echo "MMX enabled ${mmx-no}"
  5628. echo "MMXEXT enabled ${mmxext-no}"
  5629. echo "3DNow! enabled ${amd3dnow-no}"
  5630. echo "3DNow! extended enabled ${amd3dnowext-no}"
  5631. echo "SSE enabled ${sse-no}"
  5632. echo "SSSE3 enabled ${ssse3-no}"
  5633. echo "AESNI enabled ${aesni-no}"
  5634. echo "AVX enabled ${avx-no}"
  5635. echo "XOP enabled ${xop-no}"
  5636. echo "FMA3 enabled ${fma3-no}"
  5637. echo "FMA4 enabled ${fma4-no}"
  5638. echo "i686 features enabled ${i686-no}"
  5639. echo "CMOV is fast ${fast_cmov-no}"
  5640. echo "EBX available ${ebx_available-no}"
  5641. echo "EBP available ${ebp_available-no}"
  5642. fi
  5643. if enabled aarch64; then
  5644. echo "NEON enabled ${neon-no}"
  5645. echo "VFP enabled ${vfp-no}"
  5646. fi
  5647. if enabled arm; then
  5648. echo "ARMv5TE enabled ${armv5te-no}"
  5649. echo "ARMv6 enabled ${armv6-no}"
  5650. echo "ARMv6T2 enabled ${armv6t2-no}"
  5651. echo "VFP enabled ${vfp-no}"
  5652. echo "NEON enabled ${neon-no}"
  5653. echo "THUMB enabled ${thumb-no}"
  5654. fi
  5655. if enabled mips; then
  5656. echo "MIPS FPU enabled ${mipsfpu-no}"
  5657. echo "MIPS DSP R1 enabled ${mipsdsp-no}"
  5658. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  5659. echo "MIPS MSA enabled ${msa-no}"
  5660. echo "LOONGSON MMI enabled ${mmi-no}"
  5661. fi
  5662. if enabled ppc; then
  5663. echo "AltiVec enabled ${altivec-no}"
  5664. echo "VSX enabled ${vsx-no}"
  5665. echo "POWER8 enabled ${power8-no}"
  5666. echo "PPC 4xx optimizations ${ppc4xx-no}"
  5667. echo "dcbzl available ${dcbzl-no}"
  5668. fi
  5669. echo "debug symbols ${debug-no}"
  5670. echo "strip symbols ${stripping-no}"
  5671. echo "optimize for size ${small-no}"
  5672. echo "optimizations ${optimizations-no}"
  5673. echo "static ${static-no}"
  5674. echo "shared ${shared-no}"
  5675. echo "postprocessing support ${postproc-no}"
  5676. echo "new filter support ${avfilter-no}"
  5677. echo "network support ${network-no}"
  5678. echo "threading support ${thread_type-no}"
  5679. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  5680. echo "SDL support ${sdl-no}"
  5681. echo "opencl enabled ${opencl-no}"
  5682. echo "texi2html enabled ${texi2html-no}"
  5683. echo "perl enabled ${perl-no}"
  5684. echo "pod2man enabled ${pod2man-no}"
  5685. echo "makeinfo enabled ${makeinfo-no}"
  5686. echo "makeinfo supports HTML ${makeinfo_html-no}"
  5687. test -n "$random_seed" &&
  5688. echo "random seed ${random_seed}"
  5689. echo
  5690. echo "Enabled programs:"
  5691. print_enabled '' $PROGRAM_LIST | print_in_columns
  5692. echo
  5693. echo "External libraries:"
  5694. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_in_columns
  5695. echo
  5696. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  5697. echo "Enabled ${type}s:"
  5698. eval list=\$$(toupper $type)_LIST
  5699. print_enabled '_*' $list | print_in_columns
  5700. echo
  5701. done
  5702. license="LGPL version 2.1 or later"
  5703. if enabled nonfree; then
  5704. license="nonfree and unredistributable"
  5705. elif enabled gplv3; then
  5706. license="GPL version 3 or later"
  5707. elif enabled lgplv3; then
  5708. license="LGPL version 3 or later"
  5709. elif enabled gpl; then
  5710. license="GPL version 2 or later"
  5711. fi
  5712. echo "License: $license"
  5713. echo "Creating config.mak, config.h, and doc/config.texi..."
  5714. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  5715. enabled stripping || strip="echo skipping strip"
  5716. config_files="$TMPH config.mak doc/config.texi"
  5717. cat > config.mak <<EOF
  5718. # Automatically generated by configure - do not modify!
  5719. ifndef FFMPEG_CONFIG_MAK
  5720. FFMPEG_CONFIG_MAK=1
  5721. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  5722. prefix=$prefix
  5723. LIBDIR=\$(DESTDIR)$libdir
  5724. SHLIBDIR=\$(DESTDIR)$shlibdir
  5725. INCDIR=\$(DESTDIR)$incdir
  5726. BINDIR=\$(DESTDIR)$bindir
  5727. DATADIR=\$(DESTDIR)$datadir
  5728. DOCDIR=\$(DESTDIR)$docdir
  5729. MANDIR=\$(DESTDIR)$mandir
  5730. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  5731. SRC_PATH=$source_path
  5732. SRC_LINK=$source_link
  5733. ifndef MAIN_MAKEFILE
  5734. SRC_PATH:=\$(SRC_PATH:.%=..%)
  5735. endif
  5736. CC_IDENT=$cc_ident
  5737. ARCH=$arch
  5738. INTRINSICS=$intrinsics
  5739. CC=$cc
  5740. CXX=$cxx
  5741. AS=$as
  5742. OBJCC=$objcc
  5743. LD=$ld
  5744. DEPCC=$dep_cc
  5745. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  5746. DEPAS=$as
  5747. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  5748. YASM=$yasmexe
  5749. DEPYASM=$yasmexe
  5750. AR=$ar
  5751. ARFLAGS=$arflags
  5752. AR_O=$ar_o
  5753. RANLIB=$ranlib
  5754. STRIP=$strip
  5755. CP=cp -p
  5756. LN_S=$ln_s
  5757. CPPFLAGS=$CPPFLAGS
  5758. CFLAGS=$CFLAGS
  5759. CXXFLAGS=$CXXFLAGS
  5760. OBJCFLAGS=$OBJCFLAGS
  5761. ASFLAGS=$ASFLAGS
  5762. AS_C=$AS_C
  5763. AS_O=$AS_O
  5764. OBJCC_C=$OBJCC_C
  5765. OBJCC_E=$OBJCC_E
  5766. OBJCC_O=$OBJCC_O
  5767. CC_C=$CC_C
  5768. CC_E=$CC_E
  5769. CC_O=$CC_O
  5770. CXX_C=$CXX_C
  5771. CXX_O=$CXX_O
  5772. LD_O=$LD_O
  5773. LD_LIB=$LD_LIB
  5774. LD_PATH=$LD_PATH
  5775. DLLTOOL=$dlltool
  5776. WINDRES=$windres
  5777. DEPWINDRES=$dep_cc
  5778. DOXYGEN=$doxygen
  5779. LDFLAGS=$LDFLAGS
  5780. LDEXEFLAGS=$LDEXEFLAGS
  5781. LDLIBFLAGS=$LDLIBFLAGS
  5782. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  5783. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  5784. YASMFLAGS=$YASMFLAGS
  5785. BUILDSUF=$build_suffix
  5786. PROGSSUF=$progs_suffix
  5787. FULLNAME=$FULLNAME
  5788. LIBPREF=$LIBPREF
  5789. LIBSUF=$LIBSUF
  5790. LIBNAME=$LIBNAME
  5791. SLIBPREF=$SLIBPREF
  5792. SLIBSUF=$SLIBSUF
  5793. EXESUF=$EXESUF
  5794. EXTRA_VERSION=$extra_version
  5795. CCDEP=$CCDEP
  5796. CXXDEP=$CXXDEP
  5797. CCDEP_FLAGS=$CCDEP_FLAGS
  5798. ASDEP=$ASDEP
  5799. ASDEP_FLAGS=$ASDEP_FLAGS
  5800. CC_DEPFLAGS=$CC_DEPFLAGS
  5801. AS_DEPFLAGS=$AS_DEPFLAGS
  5802. HOSTCC=$host_cc
  5803. HOSTLD=$host_ld
  5804. HOSTCFLAGS=$host_cflags
  5805. HOSTCPPFLAGS=$host_cppflags
  5806. HOSTEXESUF=$HOSTEXESUF
  5807. HOSTLDFLAGS=$host_ldflags
  5808. HOSTLIBS=$host_libs
  5809. DEPHOSTCC=$host_cc
  5810. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  5811. HOSTCCDEP=$HOSTCCDEP
  5812. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  5813. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  5814. HOSTCC_C=$HOSTCC_C
  5815. HOSTCC_O=$HOSTCC_O
  5816. HOSTLD_O=$HOSTLD_O
  5817. TARGET_EXEC=$target_exec $target_exec_args
  5818. TARGET_PATH=$target_path
  5819. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  5820. CFLAGS-ffplay=$sdl_cflags
  5821. ZLIB=$($ldflags_filter -lz)
  5822. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  5823. EXTRALIBS=$extralibs
  5824. COMPAT_OBJS=$compat_objs
  5825. EXEOBJS=$exeobjs
  5826. INSTALL=$install
  5827. LIBTARGET=${LIBTARGET}
  5828. SLIBNAME=${SLIBNAME}
  5829. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  5830. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  5831. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  5832. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  5833. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  5834. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  5835. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  5836. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  5837. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  5838. NOREDZONE_FLAGS=$noredzone_flags
  5839. EOF
  5840. get_version(){
  5841. lcname=lib${1}
  5842. name=$(toupper $lcname)
  5843. file=$source_path/$lcname/version.h
  5844. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  5845. enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
  5846. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  5847. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  5848. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  5849. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  5850. }
  5851. map 'get_version $v' $LIBRARY_LIST
  5852. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
  5853. print_program_libs(){
  5854. eval "program_libs=\$${1}_libs"
  5855. eval echo "LIBS-${1}=${program_libs}" >> config.mak
  5856. }
  5857. map 'print_program_libs $v' $PROGRAM_LIST
  5858. cat > $TMPH <<EOF
  5859. /* Automatically generated by configure - do not modify! */
  5860. #ifndef FFMPEG_CONFIG_H
  5861. #define FFMPEG_CONFIG_H
  5862. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  5863. #define FFMPEG_LICENSE "$(c_escape $license)"
  5864. #define CONFIG_THIS_YEAR 2018
  5865. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  5866. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  5867. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  5868. #define av_restrict $_restrict
  5869. #define EXTERN_PREFIX "${extern_prefix}"
  5870. #define EXTERN_ASM ${extern_prefix}
  5871. #define BUILDSUF "$build_suffix"
  5872. #define SLIBSUF "$SLIBSUF"
  5873. #define HAVE_MMX2 HAVE_MMXEXT
  5874. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  5875. EOF
  5876. test -n "$assert_level" &&
  5877. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  5878. test -n "$malloc_prefix" &&
  5879. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  5880. if enabled yasm; then
  5881. append config_files $TMPASM
  5882. printf '' >$TMPASM
  5883. fi
  5884. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  5885. mkdir -p doc
  5886. mkdir -p tests
  5887. mkdir -p tests/api
  5888. echo "@c auto-generated by configure - do not modify! " > doc/config.texi
  5889. print_config ARCH_ "$config_files" $ARCH_LIST
  5890. print_config HAVE_ "$config_files" $HAVE_LIST
  5891. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  5892. $CONFIG_EXTRA \
  5893. $ALL_COMPONENTS \
  5894. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  5895. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  5896. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  5897. cp_if_changed $TMPH config.h
  5898. touch .config
  5899. enabled yasm && cp_if_changed $TMPASM config.asm
  5900. cat > $TMPH <<EOF
  5901. /* Generated by ffconf */
  5902. #ifndef AVUTIL_AVCONFIG_H
  5903. #define AVUTIL_AVCONFIG_H
  5904. EOF
  5905. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  5906. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  5907. cp_if_changed $TMPH libavutil/avconfig.h
  5908. if test -n "$WARNINGS"; then
  5909. printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
  5910. enabled fatal_warnings && exit 1
  5911. fi
  5912. # build pkg-config files
  5913. lib_version(){
  5914. eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
  5915. }
  5916. pkgconfig_generate(){
  5917. name=$1
  5918. shortname=${name#lib}${build_suffix}
  5919. comment=$2
  5920. version=$3
  5921. libs=$4
  5922. requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
  5923. requires=${requires%, }
  5924. enabled ${name#lib} || return 0
  5925. mkdir -p $name
  5926. cat <<EOF > $name/$name${build_suffix}.pc
  5927. prefix=$prefix
  5928. exec_prefix=\${prefix}
  5929. libdir=$libdir
  5930. includedir=$incdir
  5931. Name: $name
  5932. Description: $comment
  5933. Version: $version
  5934. Requires: $(enabled shared || echo $requires)
  5935. Requires.private: $(enabled shared && echo $requires)
  5936. Conflicts:
  5937. Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
  5938. Libs.private: $(enabled shared && echo $libs)
  5939. Cflags: -I\${includedir}
  5940. EOF
  5941. mkdir -p doc/examples/pc-uninstalled
  5942. includedir=${source_path}
  5943. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  5944. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  5945. prefix=
  5946. exec_prefix=
  5947. libdir=\${pcfiledir}/../../../$name
  5948. includedir=${includedir}
  5949. Name: $name
  5950. Description: $comment
  5951. Version: $version
  5952. Requires: $requires
  5953. Conflicts:
  5954. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  5955. Cflags: -I\${includedir}
  5956. EOF
  5957. }
  5958. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
  5959. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
  5960. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
  5961. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
  5962. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
  5963. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
  5964. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
  5965. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
  5966. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR"