configure 241 KB

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