configure 191 KB

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