configure 282 KB

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