configure 197 KB

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