configure 218 KB

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