configure 283 KB

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