configure 277 KB

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