configure 272 KB

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