configure 286 KB

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