configure 272 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152
  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. texi2html
  2221. xmllint
  2222. zlib_gzip
  2223. openvino2
  2224. "
  2225. # options emitted with CONFIG_ prefix but not available on the command line
  2226. CONFIG_EXTRA="
  2227. aandcttables
  2228. ac3dsp
  2229. adts_header
  2230. atsc_a53
  2231. audio_frame_queue
  2232. audiodsp
  2233. blockdsp
  2234. bswapdsp
  2235. cabac
  2236. cbs
  2237. cbs_av1
  2238. cbs_h264
  2239. cbs_h265
  2240. cbs_h266
  2241. cbs_jpeg
  2242. cbs_mpeg2
  2243. cbs_vp9
  2244. deflate_wrapper
  2245. dirac_parse
  2246. dnn
  2247. dovi_rpu
  2248. dvprofile
  2249. evcparse
  2250. exif
  2251. faandct
  2252. faanidct
  2253. fdctdsp
  2254. fmtconvert
  2255. frame_thread_encoder
  2256. g722dsp
  2257. golomb
  2258. gplv3
  2259. h263dsp
  2260. h264chroma
  2261. h264dsp
  2262. h264parse
  2263. h264pred
  2264. h264qpel
  2265. h264_sei
  2266. hevcparse
  2267. hevc_sei
  2268. hpeldsp
  2269. huffman
  2270. huffyuvdsp
  2271. huffyuvencdsp
  2272. idctdsp
  2273. iirfilter
  2274. inflate_wrapper
  2275. intrax8
  2276. iso_media
  2277. ividsp
  2278. jpegtables
  2279. lgplv3
  2280. libx262
  2281. llauddsp
  2282. llviddsp
  2283. llvidencdsp
  2284. lpc
  2285. lzf
  2286. me_cmp
  2287. mpeg_er
  2288. mpegaudio
  2289. mpegaudiodsp
  2290. mpegaudioheader
  2291. mpeg4audio
  2292. mpegvideo
  2293. mpegvideodec
  2294. mpegvideoenc
  2295. msmpeg4dec
  2296. msmpeg4enc
  2297. mss34dsp
  2298. pixblockdsp
  2299. qpeldsp
  2300. qsv
  2301. qsvdec
  2302. qsvenc
  2303. qsvvpp
  2304. rangecoder
  2305. riffdec
  2306. riffenc
  2307. rtpdec
  2308. rtpenc_chain
  2309. rv34dsp
  2310. scene_sad
  2311. sinewin
  2312. snappy
  2313. srtp
  2314. startcode
  2315. texturedsp
  2316. texturedspenc
  2317. tpeldsp
  2318. vaapi_1
  2319. vaapi_encode
  2320. vc1dsp
  2321. videodsp
  2322. vp3dsp
  2323. vp56dsp
  2324. vp8dsp
  2325. wma_freqs
  2326. wmv2dsp
  2327. "
  2328. CMDLINE_SELECT="
  2329. $ARCH_EXT_LIST
  2330. $CONFIG_LIST
  2331. $HAVE_LIST_CMDLINE
  2332. $THREADS_LIST
  2333. asm
  2334. cross_compile
  2335. debug
  2336. extra_warnings
  2337. logging
  2338. optimizations
  2339. rpath
  2340. stripping
  2341. "
  2342. PATHS_LIST="
  2343. bindir
  2344. datadir
  2345. docdir
  2346. incdir
  2347. libdir
  2348. mandir
  2349. pkgconfigdir
  2350. prefix
  2351. shlibdir
  2352. install_name_dir
  2353. "
  2354. CMDLINE_SET="
  2355. $PATHS_LIST
  2356. ar
  2357. arch
  2358. as
  2359. assert_level
  2360. build_suffix
  2361. cc
  2362. objcc
  2363. cpu
  2364. cross_prefix
  2365. custom_allocator
  2366. cxx
  2367. dep_cc
  2368. doxygen
  2369. env
  2370. extra_version
  2371. gas
  2372. host_cc
  2373. host_cflags
  2374. host_extralibs
  2375. host_ld
  2376. host_ldflags
  2377. host_os
  2378. ignore_tests
  2379. install
  2380. ld
  2381. ln_s
  2382. logfile
  2383. malloc_prefix
  2384. metalcc
  2385. metallib
  2386. nm
  2387. optflags
  2388. nvcc
  2389. nvccflags
  2390. pkg_config
  2391. pkg_config_flags
  2392. progs_suffix
  2393. random_seed
  2394. ranlib
  2395. samples
  2396. strip
  2397. sws_max_filter_size
  2398. sysinclude
  2399. sysroot
  2400. target_exec
  2401. target_os
  2402. target_path
  2403. target_samples
  2404. tempprefix
  2405. toolchain
  2406. valgrind
  2407. windres
  2408. x86asmexe
  2409. "
  2410. CMDLINE_APPEND="
  2411. extra_cflags
  2412. extra_cxxflags
  2413. extra_objcflags
  2414. host_cppflags
  2415. "
  2416. # code dependency declarations
  2417. # architecture extensions
  2418. armv5te_deps="arm"
  2419. armv6_deps="arm"
  2420. armv6t2_deps="arm"
  2421. armv8_deps="aarch64"
  2422. neon_deps_any="aarch64 arm"
  2423. intrinsics_neon_deps="neon"
  2424. vfp_deps="arm"
  2425. vfpv3_deps="vfp"
  2426. setend_deps="arm"
  2427. dotprod_deps="aarch64 neon"
  2428. i8mm_deps="aarch64 neon"
  2429. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  2430. altivec_deps="ppc"
  2431. dcbzl_deps="ppc"
  2432. ldbrx_deps="ppc"
  2433. ppc4xx_deps="ppc"
  2434. vsx_deps="altivec"
  2435. power8_deps="vsx"
  2436. rvv_deps="riscv"
  2437. loongson2_deps="mips"
  2438. loongson3_deps="mips"
  2439. mmi_deps_any="loongson2 loongson3"
  2440. lsx_deps="loongarch"
  2441. lasx_deps="lsx"
  2442. mips32r2_deps="mips"
  2443. mips32r5_deps="mips"
  2444. mips32r6_deps="mips"
  2445. mips64r2_deps="mips"
  2446. mips64r6_deps="mips"
  2447. mipsfpu_deps="mips"
  2448. mipsdsp_deps="mips"
  2449. mipsdspr2_deps="mips"
  2450. msa_deps="mipsfpu"
  2451. cpunop_deps="i686"
  2452. x86_64_select="i686"
  2453. x86_64_suggest="fast_cmov"
  2454. amd3dnow_deps="mmx"
  2455. amd3dnowext_deps="amd3dnow"
  2456. i686_deps="x86"
  2457. mmx_deps="x86"
  2458. mmxext_deps="mmx"
  2459. sse_deps="mmxext"
  2460. sse2_deps="sse"
  2461. sse3_deps="sse2"
  2462. ssse3_deps="sse3"
  2463. sse4_deps="ssse3"
  2464. sse42_deps="sse4"
  2465. aesni_deps="sse42"
  2466. avx_deps="sse42"
  2467. xop_deps="avx"
  2468. fma3_deps="avx"
  2469. fma4_deps="avx"
  2470. avx2_deps="avx"
  2471. avx512_deps="avx2"
  2472. avx512icl_deps="avx512"
  2473. mmx_external_deps="x86asm"
  2474. mmx_inline_deps="inline_asm x86"
  2475. mmx_suggest="mmx_external mmx_inline"
  2476. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  2477. eval dep=\$${ext}_deps
  2478. eval ${ext}_external_deps='"${dep}_external"'
  2479. eval ${ext}_inline_deps='"${dep}_inline"'
  2480. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  2481. done
  2482. aligned_stack_if_any="aarch64 ppc x86"
  2483. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
  2484. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  2485. fast_unaligned_if_any="aarch64 ppc x86"
  2486. simd_align_16_if_any="altivec neon sse"
  2487. simd_align_32_if_any="avx"
  2488. simd_align_64_if_any="avx512"
  2489. # system capabilities
  2490. linux_perf_deps="linux_perf_event_h"
  2491. symver_if_any="symver_asm_label symver_gnu_asm"
  2492. valgrind_backtrace_conflict="optimizations"
  2493. valgrind_backtrace_deps="valgrind_valgrind_h"
  2494. # threading support
  2495. atomics_gcc_if="sync_val_compare_and_swap"
  2496. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  2497. atomics_win32_if="MemoryBarrier"
  2498. atomics_native_if_any="$ATOMICS_LIST"
  2499. w32threads_deps="atomics_native"
  2500. threads_if_any="$THREADS_LIST"
  2501. # subsystems
  2502. cbs_av1_select="cbs"
  2503. cbs_h264_select="cbs"
  2504. cbs_h265_select="cbs"
  2505. cbs_h266_select="cbs"
  2506. cbs_jpeg_select="cbs"
  2507. cbs_mpeg2_select="cbs"
  2508. cbs_vp9_select="cbs"
  2509. deflate_wrapper_deps="zlib"
  2510. dirac_parse_select="golomb"
  2511. dovi_rpu_select="golomb"
  2512. dnn_suggest="libtensorflow libopenvino"
  2513. dnn_deps="avformat swscale"
  2514. error_resilience_select="me_cmp"
  2515. evcparse_select="golomb"
  2516. faandct_deps="faan"
  2517. faandct_select="fdctdsp"
  2518. faanidct_deps="faan"
  2519. faanidct_select="idctdsp"
  2520. h264dsp_select="startcode"
  2521. h264_sei_select="atsc_a53 golomb"
  2522. hevcparse_select="golomb"
  2523. hevc_sei_select="atsc_a53 golomb"
  2524. frame_thread_encoder_deps="encoders threads"
  2525. inflate_wrapper_deps="zlib"
  2526. intrax8_select="blockdsp wmv2dsp"
  2527. iso_media_select="mpeg4audio"
  2528. me_cmp_select="idctdsp"
  2529. mpeg_er_select="error_resilience"
  2530. mpegaudio_select="mpegaudiodsp mpegaudioheader"
  2531. mpegvideo_select="blockdsp hpeldsp idctdsp videodsp"
  2532. mpegvideodec_select="h264chroma mpegvideo mpeg_er"
  2533. mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
  2534. msmpeg4dec_select="h263_decoder"
  2535. msmpeg4enc_select="h263_encoder"
  2536. vc1dsp_select="h264chroma qpeldsp startcode"
  2537. # decoders / encoders
  2538. aac_decoder_select="adts_header mpeg4audio sinewin"
  2539. aac_fixed_decoder_select="adts_header mpeg4audio"
  2540. aac_encoder_select="audio_frame_queue iirfilter lpc sinewin"
  2541. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  2542. ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert"
  2543. ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp"
  2544. ac3_encoder_select="ac3dsp audiodsp me_cmp"
  2545. ac3_fixed_encoder_select="ac3dsp audiodsp me_cmp"
  2546. acelp_kelvin_decoder_select="audiodsp"
  2547. adpcm_g722_decoder_select="g722dsp"
  2548. adpcm_g722_encoder_select="g722dsp"
  2549. agm_decoder_select="idctdsp"
  2550. aic_decoder_select="golomb idctdsp"
  2551. alac_encoder_select="lpc"
  2552. als_decoder_select="bswapdsp mpeg4audio"
  2553. amrnb_decoder_select="lsp"
  2554. amrwb_decoder_select="lsp"
  2555. amv_decoder_select="sp5x_decoder exif"
  2556. amv_encoder_select="jpegtables mpegvideoenc"
  2557. ape_decoder_select="bswapdsp llauddsp"
  2558. apng_decoder_select="inflate_wrapper"
  2559. apng_encoder_select="deflate_wrapper llvidencdsp"
  2560. aptx_encoder_select="audio_frame_queue"
  2561. aptx_hd_encoder_select="audio_frame_queue"
  2562. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  2563. asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
  2564. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  2565. asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
  2566. atrac1_decoder_select="sinewin"
  2567. av1_decoder_select="cbs_av1 atsc_a53"
  2568. bink_decoder_select="blockdsp hpeldsp"
  2569. binkaudio_dct_decoder_select="wma_freqs"
  2570. binkaudio_rdft_decoder_select="wma_freqs"
  2571. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  2572. clearvideo_decoder_select="idctdsp"
  2573. cllc_decoder_select="bswapdsp"
  2574. comfortnoise_encoder_select="lpc"
  2575. cook_decoder_select="audiodsp sinewin"
  2576. cri_decoder_select="mjpeg_decoder"
  2577. cscd_decoder_suggest="zlib"
  2578. dds_decoder_select="texturedsp"
  2579. dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
  2580. dnxhd_decoder_select="blockdsp idctdsp"
  2581. dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp"
  2582. dvvideo_decoder_select="dvprofile idctdsp"
  2583. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  2584. dxa_decoder_deps="zlib"
  2585. dxv_decoder_select="lzf texturedsp"
  2586. eac3_decoder_select="ac3_decoder"
  2587. eac3_encoder_select="ac3_encoder"
  2588. eamad_decoder_select="aandcttables blockdsp bswapdsp"
  2589. eatgq_decoder_select="aandcttables"
  2590. eatqi_decoder_select="aandcttables blockdsp bswapdsp"
  2591. exr_decoder_deps="zlib"
  2592. exr_encoder_deps="zlib"
  2593. ffv1_decoder_select="rangecoder"
  2594. ffv1_encoder_select="rangecoder"
  2595. ffvhuff_decoder_select="huffyuv_decoder"
  2596. ffvhuff_encoder_select="huffyuv_encoder"
  2597. fic_decoder_select="golomb"
  2598. flac_encoder_select="bswapdsp lpc"
  2599. flashsv2_decoder_select="inflate_wrapper"
  2600. flashsv2_encoder_select="deflate_wrapper"
  2601. flashsv_decoder_select="inflate_wrapper"
  2602. flashsv_encoder_deps="zlib"
  2603. flv_decoder_select="h263_decoder"
  2604. flv_encoder_select="h263_encoder"
  2605. fourxm_decoder_select="blockdsp bswapdsp"
  2606. fraps_decoder_select="bswapdsp huffman"
  2607. g2m_decoder_deps="zlib"
  2608. g2m_decoder_select="blockdsp idctdsp jpegtables"
  2609. g729_decoder_select="audiodsp"
  2610. h261_decoder_select="mpegvideodec"
  2611. h261_encoder_select="mpegvideoenc"
  2612. h263_decoder_select="h263_parser h263dsp mpegvideodec qpeldsp"
  2613. h263_encoder_select="h263dsp mpegvideoenc"
  2614. h263i_decoder_select="h263_decoder"
  2615. h263p_decoder_select="h263_decoder"
  2616. h263p_encoder_select="h263_encoder"
  2617. h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel h264_sei videodsp"
  2618. h264_decoder_suggest="error_resilience"
  2619. hap_decoder_select="snappy texturedsp"
  2620. hap_encoder_deps="libsnappy"
  2621. hap_encoder_select="texturedspenc"
  2622. hevc_decoder_select="bswapdsp cabac dovi_rpu golomb hevcparse hevc_sei videodsp"
  2623. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  2624. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp"
  2625. hymt_decoder_select="huffyuv_decoder"
  2626. iac_decoder_select="imc_decoder"
  2627. imc_decoder_select="bswapdsp sinewin"
  2628. imm4_decoder_select="bswapdsp idctdsp"
  2629. imm5_decoder_select="h264_decoder hevc_decoder"
  2630. indeo3_decoder_select="hpeldsp"
  2631. indeo4_decoder_select="ividsp"
  2632. indeo5_decoder_select="ividsp"
  2633. interplay_video_decoder_select="hpeldsp"
  2634. ipu_decoder_select="mpegvideodec"
  2635. jpegls_decoder_select="mjpeg_decoder"
  2636. jv_decoder_select="blockdsp"
  2637. lagarith_decoder_select="llviddsp"
  2638. ljpeg_encoder_select="jpegtables"
  2639. lscr_decoder_select="inflate_wrapper"
  2640. magicyuv_decoder_select="llviddsp"
  2641. magicyuv_encoder_select="llvidencdsp"
  2642. mdec_decoder_select="blockdsp bswapdsp idctdsp"
  2643. media100_decoder_select="media100_to_mjpegb_bsf mjpegb_decoder"
  2644. metasound_decoder_select="lsp sinewin"
  2645. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  2646. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
  2647. mjpeg_encoder_select="jpegtables mpegvideoenc"
  2648. mjpegb_decoder_select="mjpeg_decoder"
  2649. mlp_decoder_select="mlp_parser"
  2650. mlp_encoder_select="lpc audio_frame_queue"
  2651. mobiclip_decoder_select="bswapdsp golomb"
  2652. motionpixels_decoder_select="bswapdsp"
  2653. mp1_decoder_select="mpegaudio"
  2654. mp1float_decoder_select="mpegaudio"
  2655. mp2_decoder_select="mpegaudio"
  2656. mp2float_decoder_select="mpegaudio"
  2657. mp3_decoder_select="mpegaudio"
  2658. mp3adu_decoder_select="mpegaudio"
  2659. mp3adufloat_decoder_select="mpegaudio"
  2660. mp3float_decoder_select="mpegaudio"
  2661. mp3on4_decoder_select="mpegaudio mpeg4audio"
  2662. mp3on4float_decoder_select="mpegaudio mpeg4audio"
  2663. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  2664. mpc8_decoder_select="mpegaudiodsp"
  2665. mpegvideo_decoder_select="mpegvideodec"
  2666. mpeg1video_decoder_select="mpegvideodec"
  2667. mpeg1video_encoder_select="mpegvideoenc"
  2668. mpeg2video_decoder_select="mpegvideodec"
  2669. mpeg2video_encoder_select="mpegvideoenc"
  2670. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  2671. mpeg4_encoder_select="h263_encoder qpeldsp"
  2672. msa1_decoder_select="mss34dsp"
  2673. mscc_decoder_select="inflate_wrapper"
  2674. msmpeg4v1_decoder_select="msmpeg4dec"
  2675. msmpeg4v2_decoder_select="msmpeg4dec"
  2676. msmpeg4v2_encoder_select="msmpeg4enc"
  2677. msmpeg4v3_decoder_select="msmpeg4dec"
  2678. msmpeg4v3_encoder_select="msmpeg4enc"
  2679. mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder"
  2680. mts2_decoder_select="jpegtables mss34dsp"
  2681. mv30_decoder_select="aandcttables blockdsp"
  2682. mvha_decoder_select="inflate_wrapper llviddsp"
  2683. mwsc_decoder_select="inflate_wrapper"
  2684. mxpeg_decoder_select="mjpeg_decoder"
  2685. nellymoser_decoder_select="sinewin"
  2686. nellymoser_encoder_select="audio_frame_queue sinewin"
  2687. notchlc_decoder_select="lzf"
  2688. nuv_decoder_select="idctdsp"
  2689. opus_decoder_deps="swresample"
  2690. opus_encoder_select="audio_frame_queue"
  2691. pdv_decoder_deps="zlib"
  2692. png_decoder_select="inflate_wrapper"
  2693. png_encoder_select="deflate_wrapper llvidencdsp"
  2694. prores_decoder_select="blockdsp idctdsp"
  2695. prores_encoder_select="fdctdsp"
  2696. prores_aw_encoder_select="fdctdsp"
  2697. prores_ks_encoder_select="fdctdsp"
  2698. qcelp_decoder_select="lsp"
  2699. qdm2_decoder_select="mpegaudiodsp"
  2700. ra_144_decoder_select="audiodsp"
  2701. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  2702. ralf_decoder_select="golomb"
  2703. rasc_decoder_select="inflate_wrapper"
  2704. rawvideo_decoder_select="bswapdsp"
  2705. rscc_decoder_deps="zlib"
  2706. rtv1_decoder_select="texturedsp"
  2707. rv10_decoder_select="h263_decoder"
  2708. rv10_encoder_select="h263_encoder"
  2709. rv20_decoder_select="h263_decoder"
  2710. rv20_encoder_select="h263_encoder"
  2711. rv30_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
  2712. rv40_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
  2713. screenpresso_decoder_deps="zlib"
  2714. shorten_decoder_select="bswapdsp"
  2715. sipr_decoder_select="lsp"
  2716. smvjpeg_decoder_select="mjpeg_decoder"
  2717. snow_decoder_select="dwt h264qpel rangecoder videodsp"
  2718. snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder videodsp"
  2719. sonic_decoder_select="golomb rangecoder"
  2720. sonic_encoder_select="golomb rangecoder"
  2721. sonic_ls_encoder_select="golomb rangecoder"
  2722. sp5x_decoder_select="mjpeg_decoder"
  2723. speedhq_decoder_select="blockdsp idctdsp"
  2724. speedhq_encoder_select="mpegvideoenc"
  2725. srgc_decoder_select="inflate_wrapper"
  2726. svq1_decoder_select="hpeldsp"
  2727. svq1_encoder_select="hpeldsp me_cmp mpegvideoenc"
  2728. svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
  2729. svq3_decoder_suggest="zlib"
  2730. tak_decoder_select="audiodsp"
  2731. tdsc_decoder_deps="zlib"
  2732. tdsc_decoder_select="mjpeg_decoder"
  2733. theora_decoder_select="vp3_decoder"
  2734. thp_decoder_select="mjpeg_decoder"
  2735. tiff_decoder_select="mjpeg_decoder"
  2736. tiff_decoder_suggest="zlib lzma"
  2737. tiff_encoder_suggest="zlib"
  2738. truehd_decoder_select="mlp_parser"
  2739. truehd_encoder_select="lpc audio_frame_queue"
  2740. truemotion2_decoder_select="bswapdsp"
  2741. truespeech_decoder_select="bswapdsp"
  2742. tscc_decoder_select="inflate_wrapper"
  2743. twinvq_decoder_select="lsp sinewin"
  2744. txd_decoder_select="texturedsp"
  2745. utvideo_decoder_select="bswapdsp llviddsp"
  2746. utvideo_encoder_select="bswapdsp huffman llvidencdsp"
  2747. vble_decoder_select="llviddsp"
  2748. vbn_decoder_select="texturedsp"
  2749. vbn_encoder_select="texturedspenc"
  2750. vmix_decoder_select="idctdsp"
  2751. vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp"
  2752. vc1image_decoder_select="vc1_decoder"
  2753. vorbis_encoder_select="audio_frame_queue"
  2754. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2755. vp4_decoder_select="vp3_decoder"
  2756. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
  2757. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
  2758. vp6a_decoder_select="vp6_decoder"
  2759. vp6f_decoder_select="vp6_decoder"
  2760. vp7_decoder_select="h264pred videodsp vp8dsp"
  2761. vp8_decoder_select="h264pred videodsp vp8dsp"
  2762. vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf"
  2763. wcmv_decoder_select="inflate_wrapper"
  2764. webp_decoder_select="vp8_decoder exif"
  2765. wmalossless_decoder_select="llauddsp"
  2766. wmapro_decoder_select="sinewin wma_freqs"
  2767. wmav1_decoder_select="sinewin wma_freqs"
  2768. wmav1_encoder_select="sinewin wma_freqs"
  2769. wmav2_decoder_select="sinewin wma_freqs"
  2770. wmav2_encoder_select="sinewin wma_freqs"
  2771. wmavoice_decoder_select="lsp sinewin"
  2772. wmv1_decoder_select="msmpeg4dec"
  2773. wmv1_encoder_select="msmpeg4enc"
  2774. wmv2_decoder_select="blockdsp error_resilience idctdsp intrax8 msmpeg4dec videodsp wmv2dsp"
  2775. wmv2_encoder_select="msmpeg4enc wmv2dsp"
  2776. wmv3_decoder_select="vc1_decoder"
  2777. wmv3image_decoder_select="wmv3_decoder"
  2778. xma1_decoder_select="wmapro_decoder"
  2779. xma2_decoder_select="wmapro_decoder"
  2780. ylc_decoder_select="bswapdsp"
  2781. zerocodec_decoder_select="inflate_wrapper"
  2782. zlib_decoder_select="inflate_wrapper"
  2783. zlib_encoder_select="deflate_wrapper"
  2784. zmbv_decoder_select="inflate_wrapper"
  2785. zmbv_encoder_select="deflate_wrapper"
  2786. # hardware accelerators
  2787. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2788. cuda_deps="ffnvcodec"
  2789. cuvid_deps="ffnvcodec"
  2790. d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
  2791. dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
  2792. ffnvcodec_deps_any="libdl LoadLibrary"
  2793. mediacodec_deps="android"
  2794. nvdec_deps="ffnvcodec"
  2795. vaapi_x11_deps="xlib_x11"
  2796. videotoolbox_hwaccel_deps="videotoolbox pthreads"
  2797. videotoolbox_hwaccel_extralibs="-framework QuartzCore"
  2798. vulkan_deps_any="libdl LoadLibrary"
  2799. av1_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
  2800. av1_d3d11va_hwaccel_select="av1_decoder"
  2801. av1_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
  2802. av1_d3d11va2_hwaccel_select="av1_decoder"
  2803. av1_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_AV1"
  2804. av1_dxva2_hwaccel_select="av1_decoder"
  2805. av1_nvdec_hwaccel_deps="nvdec CUVIDAV1PICPARAMS"
  2806. av1_nvdec_hwaccel_select="av1_decoder"
  2807. av1_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferAV1_bit_depth_idx"
  2808. av1_vaapi_hwaccel_select="av1_decoder"
  2809. av1_vdpau_hwaccel_deps="vdpau VdpPictureInfoAV1"
  2810. av1_vdpau_hwaccel_select="av1_decoder"
  2811. av1_vulkan_hwaccel_deps="vulkan"
  2812. av1_vulkan_hwaccel_select="av1_decoder"
  2813. h263_vaapi_hwaccel_deps="vaapi"
  2814. h263_vaapi_hwaccel_select="h263_decoder"
  2815. h263_videotoolbox_hwaccel_deps="videotoolbox"
  2816. h263_videotoolbox_hwaccel_select="h263_decoder"
  2817. h264_d3d11va_hwaccel_deps="d3d11va"
  2818. h264_d3d11va_hwaccel_select="h264_decoder"
  2819. h264_d3d11va2_hwaccel_deps="d3d11va"
  2820. h264_d3d11va2_hwaccel_select="h264_decoder"
  2821. h264_dxva2_hwaccel_deps="dxva2"
  2822. h264_dxva2_hwaccel_select="h264_decoder"
  2823. h264_nvdec_hwaccel_deps="nvdec"
  2824. h264_nvdec_hwaccel_select="h264_decoder"
  2825. h264_vaapi_hwaccel_deps="vaapi"
  2826. h264_vaapi_hwaccel_select="h264_decoder"
  2827. h264_vdpau_hwaccel_deps="vdpau"
  2828. h264_vdpau_hwaccel_select="h264_decoder"
  2829. h264_videotoolbox_hwaccel_deps="videotoolbox"
  2830. h264_videotoolbox_hwaccel_select="h264_decoder"
  2831. h264_vulkan_hwaccel_deps="vulkan"
  2832. h264_vulkan_hwaccel_select="h264_decoder"
  2833. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2834. hevc_d3d11va_hwaccel_select="hevc_decoder"
  2835. hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2836. hevc_d3d11va2_hwaccel_select="hevc_decoder"
  2837. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2838. hevc_dxva2_hwaccel_select="hevc_decoder"
  2839. hevc_nvdec_hwaccel_deps="nvdec"
  2840. hevc_nvdec_hwaccel_select="hevc_decoder"
  2841. hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
  2842. hevc_vaapi_hwaccel_select="hevc_decoder"
  2843. hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
  2844. hevc_vdpau_hwaccel_select="hevc_decoder"
  2845. hevc_videotoolbox_hwaccel_deps="videotoolbox"
  2846. hevc_videotoolbox_hwaccel_select="hevc_decoder"
  2847. hevc_vulkan_hwaccel_deps="vulkan"
  2848. hevc_vulkan_hwaccel_select="hevc_decoder"
  2849. mjpeg_nvdec_hwaccel_deps="nvdec"
  2850. mjpeg_nvdec_hwaccel_select="mjpeg_decoder"
  2851. mjpeg_vaapi_hwaccel_deps="vaapi"
  2852. mjpeg_vaapi_hwaccel_select="mjpeg_decoder"
  2853. mpeg1_nvdec_hwaccel_deps="nvdec"
  2854. mpeg1_nvdec_hwaccel_select="mpeg1video_decoder"
  2855. mpeg1_vdpau_hwaccel_deps="vdpau"
  2856. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2857. mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
  2858. mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
  2859. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  2860. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  2861. mpeg2_d3d11va2_hwaccel_deps="d3d11va"
  2862. mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
  2863. mpeg2_dxva2_hwaccel_deps="dxva2"
  2864. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2865. mpeg2_nvdec_hwaccel_deps="nvdec"
  2866. mpeg2_nvdec_hwaccel_select="mpeg2video_decoder"
  2867. mpeg2_vaapi_hwaccel_deps="vaapi"
  2868. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2869. mpeg2_vdpau_hwaccel_deps="vdpau"
  2870. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2871. mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
  2872. mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
  2873. mpeg4_nvdec_hwaccel_deps="nvdec"
  2874. mpeg4_nvdec_hwaccel_select="mpeg4_decoder"
  2875. mpeg4_vaapi_hwaccel_deps="vaapi"
  2876. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2877. mpeg4_vdpau_hwaccel_deps="vdpau"
  2878. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2879. mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
  2880. mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
  2881. prores_videotoolbox_hwaccel_deps="videotoolbox"
  2882. prores_videotoolbox_hwaccel_select="prores_decoder"
  2883. vc1_d3d11va_hwaccel_deps="d3d11va"
  2884. vc1_d3d11va_hwaccel_select="vc1_decoder"
  2885. vc1_d3d11va2_hwaccel_deps="d3d11va"
  2886. vc1_d3d11va2_hwaccel_select="vc1_decoder"
  2887. vc1_dxva2_hwaccel_deps="dxva2"
  2888. vc1_dxva2_hwaccel_select="vc1_decoder"
  2889. vc1_nvdec_hwaccel_deps="nvdec"
  2890. vc1_nvdec_hwaccel_select="vc1_decoder"
  2891. vc1_vaapi_hwaccel_deps="vaapi"
  2892. vc1_vaapi_hwaccel_select="vc1_decoder"
  2893. vc1_vdpau_hwaccel_deps="vdpau"
  2894. vc1_vdpau_hwaccel_select="vc1_decoder"
  2895. vp8_nvdec_hwaccel_deps="nvdec"
  2896. vp8_nvdec_hwaccel_select="vp8_decoder"
  2897. vp8_vaapi_hwaccel_deps="vaapi"
  2898. vp8_vaapi_hwaccel_select="vp8_decoder"
  2899. vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  2900. vp9_d3d11va_hwaccel_select="vp9_decoder"
  2901. vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  2902. vp9_d3d11va2_hwaccel_select="vp9_decoder"
  2903. vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
  2904. vp9_dxva2_hwaccel_select="vp9_decoder"
  2905. vp9_nvdec_hwaccel_deps="nvdec"
  2906. vp9_nvdec_hwaccel_select="vp9_decoder"
  2907. vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
  2908. vp9_vaapi_hwaccel_select="vp9_decoder"
  2909. vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9"
  2910. vp9_vdpau_hwaccel_select="vp9_decoder"
  2911. vp9_videotoolbox_hwaccel_deps="videotoolbox"
  2912. vp9_videotoolbox_hwaccel_select="vp9_decoder"
  2913. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  2914. wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
  2915. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2916. wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel"
  2917. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2918. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2919. # hardware-accelerated codecs
  2920. mediafoundation_deps="mftransform_h MFCreateAlignedMemoryBuffer"
  2921. omx_deps="libdl pthreads"
  2922. omx_rpi_select="omx"
  2923. qsv_deps="libmfx"
  2924. qsvdec_select="qsv"
  2925. qsvenc_select="qsv"
  2926. qsvvpp_select="qsv"
  2927. vaapi_encode_deps="vaapi"
  2928. v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
  2929. bilateral_cuda_filter_deps="ffnvcodec"
  2930. bilateral_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2931. chromakey_cuda_filter_deps="ffnvcodec"
  2932. chromakey_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2933. colorspace_cuda_filter_deps="ffnvcodec"
  2934. colorspace_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2935. hwupload_cuda_filter_deps="ffnvcodec"
  2936. scale_npp_filter_deps="ffnvcodec libnpp"
  2937. scale2ref_npp_filter_deps="ffnvcodec libnpp"
  2938. scale_cuda_filter_deps="ffnvcodec"
  2939. scale_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2940. thumbnail_cuda_filter_deps="ffnvcodec"
  2941. thumbnail_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2942. transpose_npp_filter_deps="ffnvcodec libnpp"
  2943. overlay_cuda_filter_deps="ffnvcodec"
  2944. overlay_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2945. sharpen_npp_filter_deps="ffnvcodec libnpp"
  2946. ddagrab_filter_deps="d3d11va IDXGIOutput1 DXGI_OUTDUPL_FRAME_INFO"
  2947. amf_deps_any="libdl LoadLibrary"
  2948. nvenc_deps="ffnvcodec"
  2949. nvenc_deps_any="libdl LoadLibrary"
  2950. aac_mf_encoder_deps="mediafoundation"
  2951. ac3_mf_encoder_deps="mediafoundation"
  2952. av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
  2953. av1_mediacodec_decoder_deps="mediacodec"
  2954. av1_mediacodec_encoder_deps="mediacodec"
  2955. av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1"
  2956. av1_nvenc_encoder_select="atsc_a53"
  2957. h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
  2958. h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
  2959. h264_amf_encoder_deps="amf"
  2960. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2961. h264_cuvid_decoder_deps="cuvid"
  2962. h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
  2963. h264_mediacodec_decoder_deps="mediacodec"
  2964. h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
  2965. h264_mediacodec_encoder_deps="mediacodec"
  2966. h264_mediacodec_encoder_select="h264_metadata"
  2967. h264_mf_encoder_deps="mediafoundation"
  2968. h264_mmal_decoder_deps="mmal"
  2969. h264_nvenc_encoder_deps="nvenc"
  2970. h264_nvenc_encoder_select="atsc_a53"
  2971. h264_omx_encoder_deps="omx"
  2972. h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec"
  2973. h264_qsv_encoder_select="atsc_a53 qsvenc"
  2974. h264_rkmpp_decoder_deps="rkmpp"
  2975. h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
  2976. h264_vaapi_encoder_select="atsc_a53 cbs_h264 vaapi_encode"
  2977. h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
  2978. h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
  2979. h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
  2980. hevc_amf_encoder_deps="amf"
  2981. hevc_cuvid_decoder_deps="cuvid"
  2982. hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
  2983. hevc_mediacodec_decoder_deps="mediacodec"
  2984. hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
  2985. hevc_mediacodec_encoder_deps="mediacodec"
  2986. hevc_mediacodec_encoder_select="hevc_metadata"
  2987. hevc_mf_encoder_deps="mediafoundation"
  2988. hevc_nvenc_encoder_deps="nvenc"
  2989. hevc_nvenc_encoder_select="atsc_a53"
  2990. hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec"
  2991. hevc_qsv_encoder_select="hevcparse qsvenc"
  2992. hevc_rkmpp_decoder_deps="rkmpp"
  2993. hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
  2994. hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
  2995. hevc_vaapi_encoder_select="atsc_a53 cbs_h265 vaapi_encode"
  2996. hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
  2997. hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
  2998. hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
  2999. mjpeg_cuvid_decoder_deps="cuvid"
  3000. mjpeg_qsv_decoder_select="qsvdec"
  3001. mjpeg_qsv_encoder_deps="libmfx"
  3002. mjpeg_qsv_encoder_select="qsvenc"
  3003. mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
  3004. mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
  3005. mp3_mf_encoder_deps="mediafoundation"
  3006. mpeg1_cuvid_decoder_deps="cuvid"
  3007. mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
  3008. mpeg2_crystalhd_decoder_select="crystalhd"
  3009. mpeg2_cuvid_decoder_deps="cuvid"
  3010. mpeg2_mmal_decoder_deps="mmal"
  3011. mpeg2_mediacodec_decoder_deps="mediacodec"
  3012. mpeg2_qsv_decoder_select="qsvdec"
  3013. mpeg2_qsv_encoder_select="qsvenc"
  3014. mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
  3015. mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
  3016. mpeg4_crystalhd_decoder_select="crystalhd"
  3017. mpeg4_cuvid_decoder_deps="cuvid"
  3018. mpeg4_mediacodec_decoder_deps="mediacodec"
  3019. mpeg4_mediacodec_encoder_deps="mediacodec"
  3020. mpeg4_mmal_decoder_deps="mmal"
  3021. mpeg4_omx_encoder_deps="omx"
  3022. mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  3023. mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  3024. msmpeg4_crystalhd_decoder_select="crystalhd"
  3025. vc1_crystalhd_decoder_select="crystalhd"
  3026. vc1_cuvid_decoder_deps="cuvid"
  3027. vc1_mmal_decoder_deps="mmal"
  3028. vc1_qsv_decoder_select="qsvdec"
  3029. vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
  3030. vp8_cuvid_decoder_deps="cuvid"
  3031. vp8_mediacodec_decoder_deps="mediacodec"
  3032. vp8_mediacodec_encoder_deps="mediacodec"
  3033. vp8_qsv_decoder_select="qsvdec"
  3034. vp8_rkmpp_decoder_deps="rkmpp"
  3035. vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
  3036. vp8_vaapi_encoder_select="vaapi_encode"
  3037. vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
  3038. vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
  3039. vp9_cuvid_decoder_deps="cuvid"
  3040. vp9_mediacodec_decoder_deps="mediacodec"
  3041. vp9_mediacodec_encoder_deps="mediacodec"
  3042. vp9_qsv_decoder_select="qsvdec"
  3043. vp9_rkmpp_decoder_deps="rkmpp"
  3044. vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
  3045. vp9_vaapi_encoder_select="vaapi_encode"
  3046. vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9"
  3047. vp9_qsv_encoder_select="qsvenc"
  3048. vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
  3049. wmv3_crystalhd_decoder_select="crystalhd"
  3050. av1_qsv_decoder_select="qsvdec"
  3051. av1_qsv_encoder_select="qsvenc"
  3052. av1_qsv_encoder_deps="libvpl"
  3053. av1_amf_encoder_deps="amf"
  3054. av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
  3055. av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
  3056. # parsers
  3057. aac_parser_select="adts_header mpeg4audio"
  3058. av1_parser_select="cbs_av1"
  3059. evc_parser_select="evcparse"
  3060. h264_parser_select="golomb h264dsp h264parse h264_sei"
  3061. hevc_parser_select="hevcparse hevc_sei"
  3062. mpegaudio_parser_select="mpegaudioheader"
  3063. mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp"
  3064. vc1_parser_select="vc1dsp"
  3065. vvc_parser_select="cbs_h266"
  3066. # bitstream_filters
  3067. aac_adtstoasc_bsf_select="adts_header mpeg4audio"
  3068. av1_frame_merge_bsf_select="cbs_av1"
  3069. av1_frame_split_bsf_select="cbs_av1"
  3070. av1_metadata_bsf_select="cbs_av1"
  3071. dts2pts_bsf_select="cbs_h264 h264parse"
  3072. eac3_core_bsf_select="ac3_parser"
  3073. evc_frame_merge_bsf_select="evcparse"
  3074. filter_units_bsf_select="cbs"
  3075. h264_metadata_bsf_deps="const_nan"
  3076. h264_metadata_bsf_select="cbs_h264"
  3077. h264_redundant_pps_bsf_select="cbs_h264"
  3078. hevc_metadata_bsf_select="cbs_h265"
  3079. mjpeg2jpeg_bsf_select="jpegtables"
  3080. mpeg2_metadata_bsf_select="cbs_mpeg2"
  3081. trace_headers_bsf_select="cbs"
  3082. vp9_metadata_bsf_select="cbs_vp9"
  3083. vvc_metadata_bsf_select="cbs_h266"
  3084. # external libraries
  3085. aac_at_decoder_deps="audiotoolbox"
  3086. aac_at_decoder_select="aac_adtstoasc_bsf"
  3087. ac3_at_decoder_deps="audiotoolbox"
  3088. ac3_at_decoder_select="ac3_parser"
  3089. adpcm_ima_qt_at_decoder_deps="audiotoolbox"
  3090. alac_at_decoder_deps="audiotoolbox"
  3091. amr_nb_at_decoder_deps="audiotoolbox"
  3092. avisynth_deps_any="libdl LoadLibrary"
  3093. avisynth_demuxer_deps="avisynth"
  3094. avisynth_demuxer_select="riffdec"
  3095. eac3_at_decoder_deps="audiotoolbox"
  3096. eac3_at_decoder_select="ac3_parser"
  3097. gsm_ms_at_decoder_deps="audiotoolbox"
  3098. ilbc_at_decoder_deps="audiotoolbox"
  3099. mp1_at_decoder_deps="audiotoolbox"
  3100. mp2_at_decoder_deps="audiotoolbox"
  3101. mp3_at_decoder_deps="audiotoolbox"
  3102. mp1_at_decoder_select="mpegaudioheader"
  3103. mp2_at_decoder_select="mpegaudioheader"
  3104. mp3_at_decoder_select="mpegaudioheader"
  3105. pcm_alaw_at_decoder_deps="audiotoolbox"
  3106. pcm_mulaw_at_decoder_deps="audiotoolbox"
  3107. qdmc_at_decoder_deps="audiotoolbox"
  3108. qdm2_at_decoder_deps="audiotoolbox"
  3109. aac_at_encoder_deps="audiotoolbox"
  3110. aac_at_encoder_select="audio_frame_queue"
  3111. alac_at_encoder_deps="audiotoolbox"
  3112. alac_at_encoder_select="audio_frame_queue"
  3113. ilbc_at_encoder_deps="audiotoolbox"
  3114. ilbc_at_encoder_select="audio_frame_queue"
  3115. pcm_alaw_at_encoder_deps="audiotoolbox"
  3116. pcm_alaw_at_encoder_select="audio_frame_queue"
  3117. pcm_mulaw_at_encoder_deps="audiotoolbox"
  3118. pcm_mulaw_at_encoder_select="audio_frame_queue"
  3119. chromaprint_muxer_deps="chromaprint"
  3120. h264_videotoolbox_encoder_deps="pthreads"
  3121. h264_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
  3122. hevc_videotoolbox_encoder_deps="pthreads"
  3123. hevc_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
  3124. prores_videotoolbox_encoder_deps="pthreads"
  3125. prores_videotoolbox_encoder_select="videotoolbox_encoder"
  3126. libaom_av1_decoder_deps="libaom"
  3127. libaom_av1_encoder_deps="libaom"
  3128. libaom_av1_encoder_select="extract_extradata_bsf"
  3129. libaribb24_decoder_deps="libaribb24"
  3130. libaribcaption_decoder_deps="libaribcaption"
  3131. libcelt_decoder_deps="libcelt"
  3132. libcodec2_decoder_deps="libcodec2"
  3133. libcodec2_encoder_deps="libcodec2"
  3134. libdav1d_decoder_deps="libdav1d"
  3135. libdav1d_decoder_select="atsc_a53"
  3136. libdavs2_decoder_deps="libdavs2"
  3137. libdavs2_decoder_select="avs2_parser"
  3138. libfdk_aac_decoder_deps="libfdk_aac"
  3139. libfdk_aac_encoder_deps="libfdk_aac"
  3140. libfdk_aac_encoder_select="audio_frame_queue"
  3141. libgme_demuxer_deps="libgme"
  3142. libgsm_decoder_deps="libgsm"
  3143. libgsm_encoder_deps="libgsm"
  3144. libgsm_ms_decoder_deps="libgsm"
  3145. libgsm_ms_encoder_deps="libgsm"
  3146. libilbc_decoder_deps="libilbc"
  3147. libilbc_encoder_deps="libilbc"
  3148. libjxl_decoder_deps="libjxl libjxl_threads"
  3149. libjxl_encoder_deps="libjxl libjxl_threads"
  3150. libkvazaar_encoder_deps="libkvazaar"
  3151. libmodplug_demuxer_deps="libmodplug"
  3152. libmp3lame_encoder_deps="libmp3lame"
  3153. libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
  3154. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  3155. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  3156. libopencore_amrnb_encoder_select="audio_frame_queue"
  3157. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  3158. libopenh264_decoder_deps="libopenh264"
  3159. libopenh264_decoder_select="h264_mp4toannexb_bsf"
  3160. libopenh264_encoder_deps="libopenh264"
  3161. libopenjpeg_encoder_deps="libopenjpeg"
  3162. libopenmpt_demuxer_deps="libopenmpt"
  3163. libopus_decoder_deps="libopus"
  3164. libopus_encoder_deps="libopus"
  3165. libopus_encoder_select="audio_frame_queue"
  3166. librav1e_encoder_deps="librav1e"
  3167. librsvg_decoder_deps="librsvg"
  3168. libshine_encoder_deps="libshine"
  3169. libshine_encoder_select="audio_frame_queue mpegaudioheader"
  3170. libspeex_decoder_deps="libspeex"
  3171. libspeex_encoder_deps="libspeex"
  3172. libspeex_encoder_select="audio_frame_queue"
  3173. libsvtav1_encoder_deps="libsvtav1"
  3174. libtheora_encoder_deps="libtheora"
  3175. libtwolame_encoder_deps="libtwolame"
  3176. libuavs3d_decoder_deps="libuavs3d"
  3177. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  3178. libvorbis_decoder_deps="libvorbis"
  3179. libvorbis_encoder_deps="libvorbis libvorbisenc"
  3180. libvorbis_encoder_select="audio_frame_queue"
  3181. libvpx_vp8_decoder_deps="libvpx"
  3182. libvpx_vp8_encoder_deps="libvpx"
  3183. libvpx_vp9_decoder_deps="libvpx"
  3184. libvpx_vp9_encoder_deps="libvpx"
  3185. libwebp_encoder_deps="libwebp"
  3186. libwebp_anim_encoder_deps="libwebp"
  3187. libx262_encoder_deps="libx262"
  3188. libx264_encoder_deps="libx264"
  3189. libx264_encoder_select="atsc_a53"
  3190. libx264rgb_encoder_deps="libx264"
  3191. libx264rgb_encoder_select="libx264_encoder"
  3192. libx265_encoder_deps="libx265"
  3193. libx265_encoder_select="atsc_a53"
  3194. libxavs_encoder_deps="libxavs"
  3195. libxavs2_encoder_deps="libxavs2"
  3196. libxvid_encoder_deps="libxvid"
  3197. libzvbi_teletext_decoder_deps="libzvbi"
  3198. vapoursynth_demuxer_deps="vapoursynth"
  3199. videotoolbox_suggest="coreservices"
  3200. videotoolbox_deps="corefoundation coremedia corevideo"
  3201. videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
  3202. # demuxers / muxers
  3203. ac3_demuxer_select="ac3_parser"
  3204. act_demuxer_select="riffdec"
  3205. adts_muxer_select="mpeg4audio"
  3206. aiff_muxer_select="iso_media"
  3207. amv_muxer_select="riffenc"
  3208. asf_demuxer_select="riffdec"
  3209. asf_o_demuxer_select="riffdec"
  3210. asf_muxer_select="riffenc"
  3211. asf_stream_muxer_select="asf_muxer"
  3212. av1_demuxer_select="av1_frame_merge_bsf av1_parser"
  3213. avi_demuxer_select="riffdec exif"
  3214. avi_muxer_select="riffenc"
  3215. avif_muxer_select="mov_muxer"
  3216. caf_demuxer_select="iso_media"
  3217. caf_muxer_select="iso_media"
  3218. dash_muxer_select="mp4_muxer"
  3219. dash_demuxer_deps="libxml2"
  3220. dirac_demuxer_select="dirac_parser"
  3221. dts_demuxer_select="dca_parser"
  3222. dtshd_demuxer_select="dca_parser"
  3223. dv_demuxer_select="dvprofile"
  3224. dv_muxer_select="dvprofile"
  3225. dxa_demuxer_select="riffdec"
  3226. eac3_demuxer_select="ac3_parser"
  3227. evc_demuxer_select="evc_frame_merge_bsf evc_parser"
  3228. f4v_muxer_select="mov_muxer"
  3229. fifo_muxer_deps="threads"
  3230. flac_demuxer_select="flac_parser"
  3231. flv_muxer_select="aac_adtstoasc_bsf"
  3232. gxf_muxer_select="pcm_rechunk_bsf"
  3233. hds_muxer_select="flv_muxer"
  3234. hls_demuxer_select="adts_header ac3_parser mov_demuxer mpegts_demuxer"
  3235. hls_muxer_select="mov_muxer mpegts_muxer"
  3236. image2_alias_pix_demuxer_select="image2_demuxer"
  3237. image2_brender_pix_demuxer_select="image2_demuxer"
  3238. imf_demuxer_deps="libxml2"
  3239. imf_demuxer_select="mxf_demuxer"
  3240. ipod_muxer_select="mov_muxer"
  3241. ismv_muxer_select="mov_muxer"
  3242. ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
  3243. latm_muxer_select="aac_adtstoasc_bsf mpeg4audio"
  3244. matroska_audio_muxer_select="matroska_muxer"
  3245. matroska_demuxer_select="riffdec"
  3246. matroska_demuxer_suggest="bzlib zlib"
  3247. matroska_muxer_select="mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf"
  3248. mlp_demuxer_select="mlp_parser"
  3249. mmf_muxer_select="riffenc"
  3250. mov_demuxer_select="iso_media riffdec"
  3251. mov_demuxer_suggest="zlib"
  3252. mov_muxer_select="iso_media riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser"
  3253. mp3_demuxer_select="mpegaudio_parser"
  3254. mp3_muxer_select="mpegaudioheader"
  3255. mp4_muxer_select="mov_muxer"
  3256. mpegts_demuxer_select="iso_media"
  3257. mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf"
  3258. mpegtsraw_demuxer_select="mpegts_demuxer"
  3259. mxf_muxer_select="pcm_rechunk_bsf rangecoder"
  3260. mxf_d10_muxer_select="mxf_muxer"
  3261. mxf_opatom_muxer_select="mxf_muxer"
  3262. nut_muxer_select="riffenc"
  3263. nuv_demuxer_select="riffdec"
  3264. obu_demuxer_select="av1_frame_merge_bsf av1_parser"
  3265. obu_muxer_select="av1_metadata_bsf"
  3266. oga_muxer_select="ogg_muxer"
  3267. ogg_demuxer_select="dirac_parse"
  3268. ogv_muxer_select="ogg_muxer"
  3269. opus_muxer_select="ogg_muxer"
  3270. psp_muxer_select="mov_muxer"
  3271. rtp_demuxer_select="sdp_demuxer"
  3272. rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer"
  3273. rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
  3274. rtsp_demuxer_select="http_protocol rtpdec"
  3275. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  3276. sap_demuxer_select="sdp_demuxer"
  3277. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  3278. sdp_demuxer_select="rtpdec"
  3279. smoothstreaming_muxer_select="ismv_muxer"
  3280. spdif_demuxer_select="adts_header"
  3281. spdif_muxer_select="adts_header"
  3282. spx_muxer_select="ogg_muxer"
  3283. swf_demuxer_suggest="zlib"
  3284. tak_demuxer_select="tak_parser"
  3285. truehd_demuxer_select="mlp_parser"
  3286. tg2_muxer_select="mov_muxer"
  3287. tgp_muxer_select="mov_muxer"
  3288. vobsub_demuxer_select="mpegps_demuxer"
  3289. w64_demuxer_select="wav_demuxer"
  3290. w64_muxer_select="wav_muxer"
  3291. wav_demuxer_select="riffdec"
  3292. wav_muxer_select="riffenc"
  3293. webm_chunk_muxer_select="webm_muxer"
  3294. webm_dash_manifest_demuxer_select="matroska_demuxer"
  3295. wtv_demuxer_select="mpegts_demuxer riffdec"
  3296. wtv_muxer_select="mpegts_muxer riffenc"
  3297. xmv_demuxer_select="riffdec"
  3298. xwma_demuxer_select="riffdec"
  3299. # indevs / outdevs
  3300. android_camera_indev_deps="android camera2ndk mediandk pthreads"
  3301. alsa_indev_deps="alsa"
  3302. alsa_outdev_deps="alsa"
  3303. avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
  3304. avfoundation_indev_suggest="coregraphics applicationservices"
  3305. avfoundation_indev_extralibs="-framework Foundation"
  3306. audiotoolbox_outdev_deps="audiotoolbox pthreads"
  3307. audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework CoreAudio"
  3308. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  3309. caca_outdev_deps="libcaca"
  3310. decklink_deps_any="libdl LoadLibrary"
  3311. decklink_indev_deps="decklink threads"
  3312. decklink_indev_extralibs="-lstdc++"
  3313. decklink_indev_suggest="libzvbi"
  3314. decklink_outdev_deps="decklink threads"
  3315. decklink_outdev_suggest="libklvanc"
  3316. decklink_outdev_extralibs="-lstdc++"
  3317. dshow_indev_deps="IBaseFilter"
  3318. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  3319. fbdev_indev_deps="linux_fb_h"
  3320. fbdev_outdev_deps="linux_fb_h"
  3321. gdigrab_indev_deps="CreateDIBSection"
  3322. gdigrab_indev_extralibs="-lgdi32"
  3323. gdigrab_indev_select="bmp_decoder"
  3324. iec61883_indev_deps="libiec61883"
  3325. iec61883_indev_select="dv_demuxer"
  3326. jack_indev_deps="libjack"
  3327. jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
  3328. kmsgrab_indev_deps="libdrm"
  3329. lavfi_indev_deps="avfilter"
  3330. libcdio_indev_deps="libcdio"
  3331. libdc1394_indev_deps="libdc1394"
  3332. openal_indev_deps="openal"
  3333. opengl_outdev_deps="opengl"
  3334. opengl_outdev_suggest="sdl2"
  3335. oss_indev_deps_any="sys_soundcard_h"
  3336. oss_outdev_deps_any="sys_soundcard_h"
  3337. pulse_indev_deps="libpulse"
  3338. pulse_outdev_deps="libpulse"
  3339. sdl2_outdev_deps="sdl2"
  3340. sndio_indev_deps="sndio"
  3341. sndio_outdev_deps="sndio"
  3342. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  3343. v4l2_indev_suggest="libv4l2"
  3344. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  3345. v4l2_outdev_suggest="libv4l2"
  3346. vfwcap_indev_deps="vfw32 vfwcap_defines"
  3347. xcbgrab_indev_deps="libxcb"
  3348. xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
  3349. xv_outdev_deps="xlib_xv xlib_x11 xlib_xext"
  3350. # protocols
  3351. async_protocol_deps="threads"
  3352. bluray_protocol_deps="libbluray"
  3353. ffrtmpcrypt_protocol_conflict="librtmp_protocol"
  3354. ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
  3355. ffrtmpcrypt_protocol_select="tcp_protocol"
  3356. ffrtmphttp_protocol_conflict="librtmp_protocol"
  3357. ffrtmphttp_protocol_select="http_protocol"
  3358. ftp_protocol_select="tcp_protocol"
  3359. gopher_protocol_select="tcp_protocol"
  3360. gophers_protocol_select="tls_protocol"
  3361. http_protocol_select="tcp_protocol"
  3362. http_protocol_suggest="zlib"
  3363. httpproxy_protocol_select="tcp_protocol"
  3364. httpproxy_protocol_suggest="zlib"
  3365. https_protocol_select="tls_protocol"
  3366. https_protocol_suggest="zlib"
  3367. icecast_protocol_select="http_protocol"
  3368. mmsh_protocol_select="http_protocol"
  3369. mmst_protocol_select="network"
  3370. rtmp_protocol_conflict="librtmp_protocol"
  3371. rtmp_protocol_select="tcp_protocol"
  3372. rtmp_protocol_suggest="zlib"
  3373. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  3374. rtmpe_protocol_suggest="zlib"
  3375. rtmps_protocol_conflict="librtmp_protocol"
  3376. rtmps_protocol_select="tls_protocol"
  3377. rtmps_protocol_suggest="zlib"
  3378. rtmpt_protocol_select="ffrtmphttp_protocol"
  3379. rtmpt_protocol_suggest="zlib"
  3380. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  3381. rtmpte_protocol_suggest="zlib"
  3382. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  3383. rtmpts_protocol_suggest="zlib"
  3384. rtp_protocol_select="udp_protocol"
  3385. schannel_conflict="openssl gnutls libtls mbedtls"
  3386. sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
  3387. sctp_protocol_select="network"
  3388. securetransport_conflict="openssl gnutls libtls mbedtls"
  3389. srtp_protocol_select="rtp_protocol srtp"
  3390. tcp_protocol_select="network"
  3391. tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
  3392. tls_protocol_select="tcp_protocol"
  3393. udp_protocol_select="network"
  3394. udplite_protocol_select="network"
  3395. unix_protocol_deps="sys_un_h"
  3396. unix_protocol_select="network"
  3397. ipfs_gateway_protocol_select="https_protocol"
  3398. ipns_gateway_protocol_select="https_protocol"
  3399. # external library protocols
  3400. libamqp_protocol_deps="librabbitmq"
  3401. libamqp_protocol_select="network"
  3402. librist_protocol_deps="librist"
  3403. librist_protocol_select="network"
  3404. librtmp_protocol_deps="librtmp"
  3405. librtmpe_protocol_deps="librtmp"
  3406. librtmps_protocol_deps="librtmp"
  3407. librtmpt_protocol_deps="librtmp"
  3408. librtmpte_protocol_deps="librtmp"
  3409. libsmbclient_protocol_deps="libsmbclient gplv3"
  3410. libsrt_protocol_deps="libsrt"
  3411. libsrt_protocol_select="network"
  3412. libssh_protocol_deps="libssh"
  3413. libtls_conflict="openssl gnutls mbedtls"
  3414. libzmq_protocol_deps="libzmq"
  3415. libzmq_protocol_select="network"
  3416. # filters
  3417. ametadata_filter_deps="avformat"
  3418. amovie_filter_deps="avcodec avformat"
  3419. aresample_filter_deps="swresample"
  3420. asr_filter_deps="pocketsphinx"
  3421. ass_filter_deps="libass"
  3422. avgblur_opencl_filter_deps="opencl"
  3423. avgblur_vulkan_filter_deps="vulkan spirv_compiler"
  3424. azmq_filter_deps="libzmq"
  3425. blackframe_filter_deps="gpl"
  3426. blend_vulkan_filter_deps="vulkan spirv_compiler"
  3427. boxblur_filter_deps="gpl"
  3428. boxblur_opencl_filter_deps="opencl gpl"
  3429. bs2b_filter_deps="libbs2b"
  3430. bwdif_cuda_filter_deps="ffnvcodec"
  3431. bwdif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3432. bwdif_vulkan_filter_deps="vulkan spirv_compiler"
  3433. chromaber_vulkan_filter_deps="vulkan spirv_compiler"
  3434. color_vulkan_filter_deps="vulkan spirv_compiler"
  3435. colorkey_opencl_filter_deps="opencl"
  3436. colormatrix_filter_deps="gpl"
  3437. convolution_opencl_filter_deps="opencl"
  3438. coreimage_filter_deps="coreimage appkit"
  3439. coreimage_filter_extralibs="-framework OpenGL"
  3440. coreimagesrc_filter_deps="coreimage appkit"
  3441. coreimagesrc_filter_extralibs="-framework OpenGL"
  3442. cover_rect_filter_deps="avcodec avformat gpl"
  3443. cropdetect_filter_deps="gpl"
  3444. deinterlace_qsv_filter_deps="libmfx"
  3445. deinterlace_qsv_filter_select="qsvvpp"
  3446. deinterlace_vaapi_filter_deps="vaapi"
  3447. delogo_filter_deps="gpl"
  3448. denoise_vaapi_filter_deps="vaapi"
  3449. derain_filter_select="dnn"
  3450. deshake_filter_select="pixelutils"
  3451. deshake_opencl_filter_deps="opencl"
  3452. dilation_opencl_filter_deps="opencl"
  3453. dnn_classify_filter_select="dnn"
  3454. dnn_detect_filter_select="dnn"
  3455. dnn_processing_filter_select="dnn"
  3456. drawtext_filter_deps="libfreetype libharfbuzz"
  3457. drawtext_filter_suggest="libfontconfig libfribidi"
  3458. elbg_filter_deps="avcodec"
  3459. eq_filter_deps="gpl"
  3460. erosion_opencl_filter_deps="opencl"
  3461. find_rect_filter_deps="avcodec avformat gpl"
  3462. flip_vulkan_filter_deps="vulkan spirv_compiler"
  3463. flite_filter_deps="libflite threads"
  3464. framerate_filter_select="scene_sad"
  3465. freezedetect_filter_select="scene_sad"
  3466. frei0r_deps_any="libdl LoadLibrary"
  3467. frei0r_filter_deps="frei0r"
  3468. frei0r_src_filter_deps="frei0r"
  3469. fspp_filter_deps="gpl"
  3470. gblur_vulkan_filter_deps="vulkan spirv_compiler"
  3471. hflip_vulkan_filter_deps="vulkan spirv_compiler"
  3472. histeq_filter_deps="gpl"
  3473. hqdn3d_filter_deps="gpl"
  3474. iccdetect_filter_deps="lcms2"
  3475. iccgen_filter_deps="lcms2"
  3476. interlace_filter_deps="gpl"
  3477. kerndeint_filter_deps="gpl"
  3478. ladspa_filter_deps="ladspa libdl"
  3479. lensfun_filter_deps="liblensfun version3"
  3480. libplacebo_filter_deps="libplacebo vulkan"
  3481. lv2_filter_deps="lv2"
  3482. mcdeint_filter_deps="avcodec gpl"
  3483. metadata_filter_deps="avformat"
  3484. movie_filter_deps="avcodec avformat"
  3485. mpdecimate_filter_deps="gpl"
  3486. mpdecimate_filter_select="pixelutils"
  3487. minterpolate_filter_select="scene_sad"
  3488. mptestsrc_filter_deps="gpl"
  3489. negate_filter_deps="lut_filter"
  3490. nlmeans_opencl_filter_deps="opencl"
  3491. nlmeans_vulkan_filter_deps="vulkan spirv_compiler"
  3492. nnedi_filter_deps="gpl"
  3493. ocr_filter_deps="libtesseract"
  3494. ocv_filter_deps="libopencv"
  3495. openclsrc_filter_deps="opencl"
  3496. overlay_opencl_filter_deps="opencl"
  3497. overlay_qsv_filter_deps="libmfx"
  3498. overlay_qsv_filter_select="qsvvpp"
  3499. overlay_vaapi_filter_deps="vaapi VAProcPipelineCaps_blend_flags"
  3500. overlay_vulkan_filter_deps="vulkan spirv_compiler"
  3501. owdenoise_filter_deps="gpl"
  3502. pad_opencl_filter_deps="opencl"
  3503. pan_filter_deps="swresample"
  3504. perspective_filter_deps="gpl"
  3505. phase_filter_deps="gpl"
  3506. pp7_filter_deps="gpl"
  3507. pp_filter_deps="gpl postproc"
  3508. prewitt_opencl_filter_deps="opencl"
  3509. procamp_vaapi_filter_deps="vaapi"
  3510. program_opencl_filter_deps="opencl"
  3511. pullup_filter_deps="gpl"
  3512. remap_opencl_filter_deps="opencl"
  3513. removelogo_filter_deps="avcodec avformat swscale"
  3514. repeatfields_filter_deps="gpl"
  3515. roberts_opencl_filter_deps="opencl"
  3516. rubberband_filter_deps="librubberband"
  3517. sab_filter_deps="gpl swscale"
  3518. scale2ref_filter_deps="swscale"
  3519. scale_filter_deps="swscale"
  3520. scale_qsv_filter_deps="libmfx"
  3521. scale_qsv_filter_select="qsvvpp"
  3522. scdet_filter_select="scene_sad"
  3523. select_filter_select="scene_sad"
  3524. sharpness_vaapi_filter_deps="vaapi"
  3525. showcqt_filter_deps="avformat swscale"
  3526. showcqt_filter_suggest="libfontconfig libfreetype"
  3527. signature_filter_deps="gpl avcodec avformat"
  3528. smartblur_filter_deps="gpl swscale"
  3529. sobel_opencl_filter_deps="opencl"
  3530. sofalizer_filter_deps="libmysofa"
  3531. spp_filter_deps="gpl avcodec"
  3532. spp_filter_select="idctdsp fdctdsp me_cmp pixblockdsp"
  3533. sr_filter_deps="avformat swscale"
  3534. sr_filter_select="dnn"
  3535. stereo3d_filter_deps="gpl"
  3536. subtitles_filter_deps="avformat avcodec libass"
  3537. super2xsai_filter_deps="gpl"
  3538. pixfmts_super2xsai_test_deps="super2xsai_filter"
  3539. tinterlace_filter_deps="gpl"
  3540. tinterlace_merge_test_deps="tinterlace_filter"
  3541. tinterlace_pad_test_deps="tinterlace_filter"
  3542. tonemap_filter_deps="const_nan"
  3543. tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping"
  3544. tonemap_opencl_filter_deps="opencl const_nan"
  3545. transpose_opencl_filter_deps="opencl"
  3546. transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
  3547. transpose_vt_filter_deps="videotoolbox VTPixelRotationSessionCreate"
  3548. transpose_vulkan_filter_deps="vulkan spirv_compiler"
  3549. unsharp_opencl_filter_deps="opencl"
  3550. uspp_filter_deps="gpl avcodec"
  3551. vaguedenoiser_filter_deps="gpl"
  3552. vflip_vulkan_filter_deps="vulkan spirv_compiler"
  3553. vidstabdetect_filter_deps="libvidstab"
  3554. vidstabtransform_filter_deps="libvidstab"
  3555. libvmaf_filter_deps="libvmaf"
  3556. libvmaf_cuda_filter_deps="libvmaf libvmaf_cuda ffnvcodec"
  3557. zmq_filter_deps="libzmq"
  3558. zoompan_filter_deps="swscale"
  3559. zscale_filter_deps="libzimg const_nan"
  3560. scale_vaapi_filter_deps="vaapi"
  3561. scale_vt_filter_deps="videotoolbox"
  3562. scale_vulkan_filter_deps="vulkan spirv_compiler"
  3563. vpp_qsv_filter_deps="libmfx"
  3564. vpp_qsv_filter_select="qsvvpp"
  3565. xfade_opencl_filter_deps="opencl"
  3566. xfade_vulkan_filter_deps="vulkan spirv_compiler"
  3567. yadif_cuda_filter_deps="ffnvcodec"
  3568. yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3569. yadif_videotoolbox_filter_deps="metal corevideo videotoolbox"
  3570. hstack_vaapi_filter_deps="vaapi_1"
  3571. vstack_vaapi_filter_deps="vaapi_1"
  3572. xstack_vaapi_filter_deps="vaapi_1"
  3573. hstack_qsv_filter_deps="libmfx"
  3574. hstack_qsv_filter_select="qsvvpp"
  3575. vstack_qsv_filter_deps="libmfx"
  3576. vstack_qsv_filter_select="qsvvpp"
  3577. xstack_qsv_filter_deps="libmfx"
  3578. xstack_qsv_filter_select="qsvvpp"
  3579. # examples
  3580. avio_http_serve_files_deps="avformat avutil fork"
  3581. avio_list_dir_deps="avformat avutil"
  3582. avio_read_callback_deps="avformat avcodec avutil"
  3583. decode_audio_example_deps="avcodec avutil"
  3584. decode_filter_audio_example_deps="avfilter avcodec avformat avutil"
  3585. decode_filter_video_example_deps="avfilter avcodec avformat avutil"
  3586. decode_video_example_deps="avcodec avutil"
  3587. demux_decode_example_deps="avcodec avformat avutil"
  3588. encode_audio_example_deps="avcodec avutil"
  3589. encode_video_example_deps="avcodec avutil"
  3590. extract_mvs_example_deps="avcodec avformat avutil"
  3591. filter_audio_example_deps="avfilter avutil"
  3592. hw_decode_example_deps="avcodec avformat avutil"
  3593. mux_example_deps="avcodec avformat avutil swscale"
  3594. qsv_decode_example_deps="avcodec avutil libmfx h264_qsv_decoder"
  3595. remux_example_deps="avcodec avformat avutil"
  3596. resample_audio_example_deps="avutil swresample"
  3597. scale_video_example_deps="avutil swscale"
  3598. show_metadata_example_deps="avformat avutil"
  3599. transcode_aac_example_deps="avcodec avformat swresample"
  3600. transcode_example_deps="avfilter avcodec avformat avutil"
  3601. vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
  3602. vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
  3603. qsv_transcode_example_deps="avcodec avformat avutil h264_qsv_encoder"
  3604. # EXTRALIBS_LIST
  3605. cpu_init_extralibs="pthreads_extralibs"
  3606. cws2fws_extralibs="zlib_extralibs"
  3607. # libraries, in any order
  3608. avcodec_deps="avutil"
  3609. avcodec_suggest="libm stdatomic"
  3610. avdevice_deps="avformat avcodec avutil"
  3611. avdevice_suggest="libm stdatomic"
  3612. avfilter_deps="avutil"
  3613. avfilter_suggest="libm stdatomic"
  3614. avformat_deps="avcodec avutil"
  3615. avformat_suggest="libm network zlib stdatomic"
  3616. avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic"
  3617. postproc_deps="avutil gpl"
  3618. postproc_suggest="libm stdatomic"
  3619. swresample_deps="avutil"
  3620. swresample_suggest="libm libsoxr stdatomic"
  3621. swscale_deps="avutil"
  3622. swscale_suggest="libm stdatomic"
  3623. avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs lcms2_extralibs"
  3624. avfilter_extralibs="pthreads_extralibs"
  3625. avutil_extralibs="d3d11va_extralibs mediacodec_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vaapi_win32_extralibs vdpau_x11_extralibs"
  3626. # programs
  3627. ffmpeg_deps="avcodec avfilter avformat threads"
  3628. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  3629. hflip_filter null_filter
  3630. transpose_filter trim_filter vflip_filter"
  3631. ffmpeg_suggest="ole32 psapi shell32"
  3632. ffplay_deps="avcodec avformat avfilter swscale swresample sdl2"
  3633. ffplay_select="crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  3634. ffplay_suggest="shell32"
  3635. ffprobe_deps="avcodec avformat"
  3636. ffprobe_suggest="shell32"
  3637. # documentation
  3638. podpages_deps="perl"
  3639. manpages_deps="perl pod2man"
  3640. htmlpages_deps="perl"
  3641. htmlpages_deps_any="makeinfo_html texi2html"
  3642. txtpages_deps="perl makeinfo"
  3643. doc_deps_any="manpages htmlpages podpages txtpages"
  3644. # default parameters
  3645. logfile="ffbuild/config.log"
  3646. # installation paths
  3647. prefix_default="/usr/local"
  3648. bindir_default='${prefix}/bin'
  3649. datadir_default='${prefix}/share/ffmpeg'
  3650. docdir_default='${prefix}/share/doc/ffmpeg'
  3651. incdir_default='${prefix}/include'
  3652. libdir_default='${prefix}/lib'
  3653. mandir_default='${prefix}/share/man'
  3654. # toolchain
  3655. ar_default="ar"
  3656. cc_default="gcc"
  3657. cxx_default="g++"
  3658. host_cc_default="gcc"
  3659. doxygen_default="doxygen"
  3660. install="install"
  3661. ln_s_default="ln -s -f"
  3662. metalcc_default="xcrun -sdk macosx metal"
  3663. metallib_default="xcrun -sdk macosx metallib"
  3664. nm_default="nm -g"
  3665. pkg_config_default=pkg-config
  3666. ranlib_default="ranlib"
  3667. strip_default="strip"
  3668. version_script='--version-script'
  3669. objformat="elf32"
  3670. x86asmexe_default="nasm"
  3671. windres_default="windres"
  3672. striptype="direct"
  3673. # OS
  3674. target_os_default=$(tolower $(uname -s))
  3675. host_os=$target_os_default
  3676. # machine
  3677. if test "$target_os_default" = aix; then
  3678. arch_default=$(uname -p)
  3679. strip_default="strip -X32_64"
  3680. nm_default="nm -g -X32_64"
  3681. else
  3682. arch_default=$(uname -m)
  3683. fi
  3684. cpu="generic"
  3685. intrinsics="none"
  3686. # configurable options
  3687. enable $PROGRAM_LIST
  3688. enable $DOCUMENT_LIST
  3689. enable $EXAMPLE_LIST
  3690. enable $LIBRARY_LIST
  3691. enable stripping
  3692. enable asm
  3693. enable debug
  3694. enable doc
  3695. enable faan faandct faanidct
  3696. enable large_tests
  3697. enable optimizations
  3698. enable ptx_compression
  3699. enable runtime_cpudetect
  3700. enable safe_bitstream_reader
  3701. enable static
  3702. enable swscale_alpha
  3703. enable valgrind_backtrace
  3704. sws_max_filter_size_default=256
  3705. set_default sws_max_filter_size
  3706. # internal components are enabled by default
  3707. enable $EXTRALIBS_LIST
  3708. # Avoid external, non-system, libraries getting enabled by dependency resolution
  3709. disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
  3710. # build settings
  3711. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  3712. LIBPREF="lib"
  3713. LIBSUF=".a"
  3714. FULLNAME='$(NAME)$(BUILDSUF)'
  3715. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  3716. SLIBPREF="lib"
  3717. SLIBSUF=".so"
  3718. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  3719. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  3720. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  3721. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  3722. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  3723. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  3724. VERSION_SCRIPT_POSTPROCESS_CMD="cat"
  3725. asflags_filter=echo
  3726. cflags_filter=echo
  3727. ldflags_filter=echo
  3728. AS_C='-c'
  3729. AS_O='-o $@'
  3730. CC_C='-c'
  3731. CC_E='-E -o $@'
  3732. CC_O='-o $@'
  3733. CXX_C='-c'
  3734. CXX_O='-o $@'
  3735. OBJCC_C='-c'
  3736. OBJCC_E='-E -o $@'
  3737. OBJCC_O='-o $@'
  3738. X86ASM_O='-o $@'
  3739. LD_O='-o $@'
  3740. LD_LIB='-l%'
  3741. LD_PATH='-L'
  3742. HOSTCC_C='-c'
  3743. HOSTCC_E='-E -o $@'
  3744. HOSTCC_O='-o $@'
  3745. HOSTLD_O='-o $@'
  3746. NVCC_C='-c'
  3747. NVCC_O='-o $@'
  3748. host_extralibs='-lm'
  3749. host_cflags_filter=echo
  3750. host_ldflags_filter=echo
  3751. target_path='$(CURDIR)'
  3752. # since the object filename is not given with the -MM flag, the compiler
  3753. # is only able to print the basename, and we must add the path ourselves
  3754. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
  3755. DEPFLAGS='-MM'
  3756. mkdir -p ffbuild
  3757. # find source path
  3758. if test -f configure; then
  3759. source_path=.
  3760. elif test -f src/configure; then
  3761. source_path=src
  3762. else
  3763. source_path=$(cd $(dirname "$0"); pwd)
  3764. case "$source_path" in
  3765. *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
  3766. esac
  3767. test -e "$source_path/config.h" &&
  3768. die "Out of tree builds are impossible with config.h in source dir."
  3769. fi
  3770. for v in "$@"; do
  3771. r=${v#*=}
  3772. l=${v%"$r"}
  3773. r=$(sh_quote "$r")
  3774. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  3775. done
  3776. find_things_extern(){
  3777. thing=$1
  3778. pattern=$2
  3779. file=$source_path/$3
  3780. out=${4:-$thing}
  3781. sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
  3782. }
  3783. find_filters_extern(){
  3784. file=$source_path/$1
  3785. sed -n 's/^extern const AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
  3786. }
  3787. FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
  3788. OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
  3789. INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
  3790. MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
  3791. DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
  3792. ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
  3793. DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
  3794. CODEC_LIST="
  3795. $ENCODER_LIST
  3796. $DECODER_LIST
  3797. "
  3798. PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
  3799. BSF_LIST=$(find_things_extern bsf FFBitStreamFilter libavcodec/bitstream_filters.c)
  3800. HWACCEL_LIST=$(find_things_extern hwaccel FFHWAccel libavcodec/hwaccels.h)
  3801. PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
  3802. AVCODEC_COMPONENTS_LIST="
  3803. $BSF_LIST
  3804. $DECODER_LIST
  3805. $ENCODER_LIST
  3806. $HWACCEL_LIST
  3807. $PARSER_LIST
  3808. "
  3809. AVDEVICE_COMPONENTS_LIST="
  3810. $INDEV_LIST
  3811. $OUTDEV_LIST
  3812. "
  3813. AVFILTER_COMPONENTS_LIST="
  3814. $FILTER_LIST
  3815. "
  3816. AVFORMAT_COMPONENTS_LIST="
  3817. $DEMUXER_LIST
  3818. $MUXER_LIST
  3819. $PROTOCOL_LIST
  3820. "
  3821. ALL_COMPONENTS="
  3822. $AVCODEC_COMPONENTS_LIST
  3823. $AVDEVICE_COMPONENTS_LIST
  3824. $AVFILTER_COMPONENTS_LIST
  3825. $AVFORMAT_COMPONENTS_LIST
  3826. "
  3827. for n in $COMPONENT_LIST; do
  3828. v=$(toupper ${n%s})_LIST
  3829. eval enable \$$v
  3830. eval ${n}_if_any="\$$v"
  3831. done
  3832. enable $ARCH_EXT_LIST
  3833. die_unknown(){
  3834. echo "Unknown option \"$1\"."
  3835. echo "See $0 --help for available options."
  3836. exit 1
  3837. }
  3838. print_in_columns() {
  3839. tr ' ' '\n' | sort | tr '\r\n' ' ' | awk -v col_width=24 -v width="$ncols" '
  3840. {
  3841. num_cols = width > col_width ? int(width / col_width) : 1;
  3842. num_rows = int((NF + num_cols-1) / num_cols);
  3843. y = x = 1;
  3844. for (y = 1; y <= num_rows; y++) {
  3845. i = y;
  3846. for (x = 1; x <= num_cols; x++) {
  3847. if (i <= NF) {
  3848. line = sprintf("%s%-" col_width "s", line, $i);
  3849. }
  3850. i = i + num_rows;
  3851. }
  3852. print line; line = "";
  3853. }
  3854. }' | sed 's/ *$//'
  3855. }
  3856. show_list() {
  3857. suffix=_$1
  3858. shift
  3859. echo $* | sed s/$suffix//g | print_in_columns
  3860. exit 0
  3861. }
  3862. rand_list(){
  3863. IFS=', '
  3864. set -- $*
  3865. unset IFS
  3866. for thing; do
  3867. comp=${thing%:*}
  3868. prob=${thing#$comp}
  3869. prob=${prob#:}
  3870. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  3871. echo "prob ${prob:-0.5}"
  3872. printf '%s\n' $comp
  3873. done
  3874. }
  3875. do_random(){
  3876. action=$1
  3877. shift
  3878. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  3879. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  3880. }
  3881. for opt do
  3882. optval="${opt#*=}"
  3883. case "$opt" in
  3884. --extra-ldflags=*)
  3885. add_ldflags $optval
  3886. ;;
  3887. --extra-ldexeflags=*)
  3888. add_ldexeflags $optval
  3889. ;;
  3890. --extra-ldsoflags=*)
  3891. add_ldsoflags $optval
  3892. ;;
  3893. --extra-ldlibflags=*)
  3894. warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
  3895. "removed in the future. Use --extra-ldsoflags instead."
  3896. add_ldsoflags $optval
  3897. ;;
  3898. --extra-libs=*)
  3899. add_extralibs $optval
  3900. ;;
  3901. --disable-devices)
  3902. disable $INDEV_LIST $OUTDEV_LIST
  3903. ;;
  3904. --enable-debug=*)
  3905. debuglevel="$optval"
  3906. ;;
  3907. --disable-programs)
  3908. disable $PROGRAM_LIST
  3909. ;;
  3910. --disable-everything)
  3911. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3912. ;;
  3913. --disable-all)
  3914. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3915. disable $LIBRARY_LIST $PROGRAM_LIST doc
  3916. enable avutil
  3917. ;;
  3918. --enable-random|--disable-random)
  3919. action=${opt%%-random}
  3920. do_random ${action#--} $COMPONENT_LIST
  3921. ;;
  3922. --enable-random=*|--disable-random=*)
  3923. action=${opt%%-random=*}
  3924. do_random ${action#--} $optval
  3925. ;;
  3926. --enable-sdl)
  3927. enable sdl2
  3928. ;;
  3929. --enable-lto*)
  3930. lto=-f${opt#--enable-}
  3931. ;;
  3932. --enable-*=*|--disable-*=*)
  3933. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  3934. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  3935. eval list=\$$(toupper $thing)_LIST
  3936. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  3937. list=$(filter "$name" $list)
  3938. [ "$list" = "" ] && warn "Option $opt did not match anything"
  3939. test $action = enable && warn_if_gets_disabled $list
  3940. $action $list
  3941. ;;
  3942. --enable-yasm|--disable-yasm)
  3943. warn "The ${opt} option is only provided for compatibility and will be\n"\
  3944. "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
  3945. test $opt = --enable-yasm && x86asm=yes || x86asm=no
  3946. ;;
  3947. --yasmexe=*)
  3948. warn "The --yasmexe option is only provided for compatibility and will be\n"\
  3949. "removed in the future. Use --x86asmexe instead."
  3950. x86asmexe="$optval"
  3951. ;;
  3952. --enable-?*|--disable-?*)
  3953. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  3954. if is_in $option $COMPONENT_LIST; then
  3955. test $action = disable && action=unset
  3956. eval $action \$$(toupper ${option%s})_LIST
  3957. elif is_in $option $CMDLINE_SELECT; then
  3958. $action $option
  3959. else
  3960. die_unknown $opt
  3961. fi
  3962. ;;
  3963. --list-*)
  3964. NAME="${opt#--list-}"
  3965. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  3966. NAME=${NAME%s}
  3967. eval show_list $NAME \$$(toupper $NAME)_LIST
  3968. ;;
  3969. --help|-h) show_help
  3970. ;;
  3971. --quiet|-q) quiet=yes
  3972. ;;
  3973. --fatal-warnings) enable fatal_warnings
  3974. ;;
  3975. --libfuzzer=*)
  3976. libfuzzer_path="$optval"
  3977. ;;
  3978. *)
  3979. optname="${opt%%=*}"
  3980. optname="${optname#--}"
  3981. optname=$(echo "$optname" | sed 's/-/_/g')
  3982. if is_in $optname $CMDLINE_SET; then
  3983. eval $optname='$optval'
  3984. elif is_in $optname $CMDLINE_APPEND; then
  3985. append $optname "$optval"
  3986. else
  3987. die_unknown $opt
  3988. fi
  3989. ;;
  3990. esac
  3991. done
  3992. for e in $env; do
  3993. eval "export $e"
  3994. done
  3995. if disabled autodetect; then
  3996. # Unless iconv is explicitely disabled by the user, we still want to probe
  3997. # for the iconv from the libc.
  3998. disabled iconv || enable libc_iconv
  3999. disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  4000. disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  4001. fi
  4002. # Mark specifically enabled, but normally autodetected libraries as requested.
  4003. for lib in $AUTODETECT_LIBS; do
  4004. enabled $lib && request $lib
  4005. done
  4006. #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
  4007. enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  4008. enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  4009. disabled logging && logfile=/dev/null
  4010. # command line configuration sanity checks
  4011. # we need to build at least one lib type
  4012. if ! enabled_any static shared; then
  4013. cat <<EOF
  4014. At least one library type must be built.
  4015. Specify --enable-static to build the static libraries or --enable-shared to
  4016. build the shared libraries as well. To only build the shared libraries specify
  4017. --disable-static in addition to --enable-shared.
  4018. EOF
  4019. exit 1
  4020. fi
  4021. die_license_disabled() {
  4022. enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
  4023. }
  4024. die_license_disabled_gpl() {
  4025. enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
  4026. }
  4027. map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  4028. map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  4029. enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
  4030. map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
  4031. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4032. if enabled nonfree; then
  4033. license="nonfree and unredistributable"
  4034. elif enabled gplv3; then
  4035. license="GPL version 3 or later"
  4036. elif enabled lgplv3; then
  4037. license="LGPL version 3 or later"
  4038. elif enabled gpl; then
  4039. license="GPL version 2 or later"
  4040. else
  4041. license="LGPL version 2.1 or later"
  4042. fi
  4043. enabled_all gnutls openssl &&
  4044. die "GnuTLS and OpenSSL must not be enabled at the same time."
  4045. enabled_all gnutls mbedtls &&
  4046. die "GnuTLS and mbedTLS must not be enabled at the same time."
  4047. enabled_all openssl mbedtls &&
  4048. die "OpenSSL and mbedTLS must not be enabled at the same time."
  4049. # Disable all the library-specific components if the library itself
  4050. # is disabled, see AVCODEC_LIST and following _LIST variables.
  4051. disable_components(){
  4052. disabled ${1} && disable $(
  4053. eval components="\$$(toupper ${1})_COMPONENTS"
  4054. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  4055. )
  4056. }
  4057. map 'disable_components $v' $LIBRARY_LIST
  4058. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  4059. set >> $logfile
  4060. test -n "$valgrind" && toolchain="valgrind-memcheck"
  4061. enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
  4062. add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
  4063. add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
  4064. }
  4065. case "$toolchain" in
  4066. *-asan)
  4067. cc_default="${toolchain%-asan}"
  4068. add_cflags -fsanitize=address
  4069. add_ldflags -fsanitize=address
  4070. ;;
  4071. *-lsan)
  4072. cc_default="${toolchain%-lsan}"
  4073. add_cflags -fsanitize=leak
  4074. add_ldflags -fsanitize=leak
  4075. ;;
  4076. *-msan)
  4077. cc_default="${toolchain%-msan}"
  4078. add_cflags -fsanitize=memory -fsanitize-memory-track-origins
  4079. add_ldflags -fsanitize=memory
  4080. ;;
  4081. *-tsan)
  4082. cc_default="${toolchain%-tsan}"
  4083. add_cflags -fsanitize=thread
  4084. add_ldflags -fsanitize=thread
  4085. case "$toolchain" in
  4086. gcc-tsan)
  4087. add_cflags -fPIC
  4088. add_ldflags -fPIC
  4089. ;;
  4090. esac
  4091. ;;
  4092. *-usan)
  4093. cc_default="${toolchain%-usan}"
  4094. add_cflags -fsanitize=undefined
  4095. add_ldflags -fsanitize=undefined
  4096. ;;
  4097. valgrind-*)
  4098. target_exec_default="valgrind"
  4099. case "$toolchain" in
  4100. valgrind-massif)
  4101. 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"
  4102. ;;
  4103. valgrind-memcheck)
  4104. 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"
  4105. ;;
  4106. esac
  4107. ;;
  4108. msvc)
  4109. cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  4110. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  4111. cc_default="cl.exe"
  4112. cxx_default="cl.exe"
  4113. else
  4114. die "Unsupported MSVC version (2013 or newer required)"
  4115. fi
  4116. ld_default="$source_path/compat/windows/mslink"
  4117. windres_default="$source_path/compat/windows/mswindres"
  4118. nm_default="dumpbin.exe -symbols"
  4119. ar_default="lib.exe"
  4120. case "${arch:-$arch_default}" in
  4121. aarch64|arm64)
  4122. as_default="armasm64.exe"
  4123. ;;
  4124. arm*)
  4125. as_default="armasm.exe"
  4126. ;;
  4127. esac
  4128. target_os_default="win32"
  4129. # Use a relative path for TMPDIR. This makes sure all the
  4130. # ffconf temp files are written with a relative path, avoiding
  4131. # issues with msys/win32 path conversion for MSVC parameters
  4132. # such as -Fo<file> or -out:<file>.
  4133. TMPDIR=.
  4134. ;;
  4135. icl)
  4136. cc_default="icl"
  4137. ld_default="xilink"
  4138. nm_default="dumpbin -symbols"
  4139. ar_default="xilib"
  4140. target_os_default="win32"
  4141. TMPDIR=.
  4142. ;;
  4143. gcov)
  4144. add_cflags -fprofile-arcs -ftest-coverage
  4145. add_ldflags -fprofile-arcs -ftest-coverage
  4146. ;;
  4147. llvm-cov)
  4148. add_cflags -fprofile-arcs -ftest-coverage
  4149. add_ldflags --coverage
  4150. ;;
  4151. hardened)
  4152. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  4153. add_cflags -fno-strict-overflow -fstack-protector-all
  4154. add_ldflags -Wl,-z,relro -Wl,-z,now
  4155. add_cflags -fPIE
  4156. add_ldexeflags -fPIE -pie
  4157. ;;
  4158. ?*)
  4159. die "Unknown toolchain $toolchain"
  4160. ;;
  4161. esac
  4162. if test -n "$cross_prefix"; then
  4163. test -n "$arch" && test -n "$target_os" ||
  4164. die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
  4165. enable cross_compile
  4166. fi
  4167. set_default target_os
  4168. if test "$target_os" = android; then
  4169. cc_default="clang"
  4170. fi
  4171. ar_default="${cross_prefix}${ar_default}"
  4172. cc_default="${cross_prefix}${cc_default}"
  4173. cxx_default="${cross_prefix}${cxx_default}"
  4174. nm_default="${cross_prefix}${nm_default}"
  4175. pkg_config_default="${cross_prefix}${pkg_config_default}"
  4176. ranlib_default="${cross_prefix}${ranlib_default}"
  4177. strip_default="${cross_prefix}${strip_default}"
  4178. windres_default="${cross_prefix}${windres_default}"
  4179. sysinclude_default="${sysroot}/usr/include"
  4180. if enabled cuda_sdk; then
  4181. warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
  4182. enable cuda_nvcc
  4183. fi
  4184. if enabled cuda_nvcc; then
  4185. nvcc_default="nvcc"
  4186. nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
  4187. else
  4188. nvcc_default="clang"
  4189. nvccflags_default="--cuda-gpu-arch=sm_30 -O2"
  4190. NVCC_C=""
  4191. fi
  4192. set_default nvcc
  4193. if enabled cuda_nvcc; then
  4194. if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then
  4195. nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2"
  4196. fi
  4197. fi
  4198. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  4199. target_exec x86asmexe metalcc metallib
  4200. enabled cross_compile || host_cc_default=$cc
  4201. set_default host_cc
  4202. if ${ranlib} 2>&1 | grep -q "\-D "; then
  4203. ranlib="${ranlib} -D"
  4204. fi
  4205. pkg_config_fail_message=""
  4206. if ! $pkg_config --version >/dev/null 2>&1; then
  4207. warn "$pkg_config not found, library detection may fail."
  4208. pkg_config=false
  4209. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  4210. pkg_config_fail_message="
  4211. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  4212. fi
  4213. if test $doxygen != $doxygen_default && \
  4214. ! $doxygen --version >/dev/null 2>&1; then
  4215. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  4216. fi
  4217. exesuf() {
  4218. case $1 in
  4219. mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  4220. esac
  4221. }
  4222. EXESUF=$(exesuf $target_os)
  4223. HOSTEXESUF=$(exesuf $host_os)
  4224. # set temporary file name
  4225. : ${TMPDIR:=$TEMPDIR}
  4226. : ${TMPDIR:=$TMP}
  4227. : ${TMPDIR:=/tmp}
  4228. if [ -n "$tempprefix" ] ; then
  4229. mktemp(){
  4230. tmpname="$tempprefix.${HOSTNAME}.${UID}"
  4231. echo "$tmpname"
  4232. mkdir "$tmpname"
  4233. }
  4234. elif ! test_cmd mktemp -u XXXXXX; then
  4235. # simple replacement for missing mktemp
  4236. # NOT SAFE FOR GENERAL USE
  4237. mktemp(){
  4238. tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  4239. echo "$tmpname"
  4240. mkdir "$tmpname"
  4241. }
  4242. fi
  4243. FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
  4244. die "Unable to create temporary directory in $TMPDIR."
  4245. tmpfile(){
  4246. tmp="${FFTMPDIR}/test"$2
  4247. (set -C; exec > $tmp) 2> /dev/null ||
  4248. die "Unable to create temporary file in $FFTMPDIR."
  4249. eval $1=$tmp
  4250. }
  4251. trap 'rm -rf -- "$FFTMPDIR"' EXIT
  4252. trap 'exit 2' INT
  4253. tmpfile TMPASM .asm
  4254. tmpfile TMPC .c
  4255. tmpfile TMPCPP .cpp
  4256. tmpfile TMPE $EXESUF
  4257. tmpfile TMPH .h
  4258. tmpfile TMPM .m
  4259. tmpfile TMPCU .cu
  4260. tmpfile TMPO .o
  4261. tmpfile TMPS .S
  4262. tmpfile TMPSH .sh
  4263. tmpfile TMPV .ver
  4264. unset -f mktemp
  4265. chmod +x $TMPE
  4266. # make sure we can execute files in $TMPDIR
  4267. cat > $TMPSH 2>> $logfile <<EOF
  4268. #! /bin/sh
  4269. EOF
  4270. chmod +x $TMPSH >> $logfile 2>&1
  4271. if ! $TMPSH >> $logfile 2>&1; then
  4272. cat <<EOF
  4273. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  4274. variable to another directory and make sure that it is not mounted noexec.
  4275. EOF
  4276. die "Sanity test failed."
  4277. fi
  4278. armasm_flags(){
  4279. for flag; do
  4280. case $flag in
  4281. # Filter out MSVC cl.exe options from cflags that shouldn't
  4282. # be passed to gas-preprocessor
  4283. -M[TD]*) ;;
  4284. *) echo $flag ;;
  4285. esac
  4286. done
  4287. }
  4288. cparser_flags(){
  4289. for flag; do
  4290. case $flag in
  4291. -Wno-switch) echo -Wno-switch-enum ;;
  4292. -Wno-format-zero-length) ;;
  4293. -Wdisabled-optimization) ;;
  4294. -Wno-pointer-sign) echo -Wno-other ;;
  4295. *) echo $flag ;;
  4296. esac
  4297. done
  4298. }
  4299. msvc_common_flags(){
  4300. for flag; do
  4301. case $flag in
  4302. # In addition to specifying certain flags under the compiler
  4303. # specific filters, they must be specified here as well or else the
  4304. # generic catch all at the bottom will print the original flag.
  4305. -Wall) ;;
  4306. -Wextra) ;;
  4307. -std=c*) ;;
  4308. # Common flags
  4309. -fomit-frame-pointer) ;;
  4310. -g) echo -Z7 ;;
  4311. -fno-math-errno) ;;
  4312. -fno-common) ;;
  4313. -fno-signed-zeros) ;;
  4314. -fPIC) ;;
  4315. -mthumb) ;;
  4316. -march=*) ;;
  4317. -lz) echo zlib.lib ;;
  4318. -lx264) echo libx264.lib ;;
  4319. -lstdc++) ;;
  4320. -l*) echo ${flag#-l}.lib ;;
  4321. -LARGEADDRESSAWARE) echo $flag ;;
  4322. -L*) echo -libpath:${flag#-L} ;;
  4323. -Wl,*) ;;
  4324. *) echo $flag ;;
  4325. esac
  4326. done
  4327. }
  4328. msvc_flags(){
  4329. msvc_common_flags "$@"
  4330. for flag; do
  4331. case $flag in
  4332. -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
  4333. -wd4554 ;;
  4334. -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  4335. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  4336. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  4337. -wd4307 \
  4338. -wd4273 -wd4554 -wd4701 -wd4703 ;;
  4339. esac
  4340. done
  4341. }
  4342. icl_flags(){
  4343. msvc_common_flags "$@"
  4344. for flag; do
  4345. case $flag in
  4346. # Despite what Intel's documentation says -Wall, which is supported
  4347. # on Windows, does enable remarks so disable them here.
  4348. -Wall) echo $flag -Qdiag-disable:remark ;;
  4349. -std=c99) echo -Qstd=c99 ;;
  4350. -flto*) echo -ipo ;;
  4351. esac
  4352. done
  4353. }
  4354. icc_flags(){
  4355. for flag; do
  4356. case $flag in
  4357. -flto*) echo -ipo ;;
  4358. *) echo $flag ;;
  4359. esac
  4360. done
  4361. }
  4362. suncc_flags(){
  4363. for flag; do
  4364. case $flag in
  4365. -march=*|-mcpu=*)
  4366. case "${flag#*=}" in
  4367. native) echo -xtarget=native ;;
  4368. v9|niagara) echo -xarch=sparc ;;
  4369. ultrasparc) echo -xarch=sparcvis ;;
  4370. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  4371. i586|pentium) echo -xchip=pentium ;;
  4372. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  4373. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  4374. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  4375. pentium4*) echo -xtarget=pentium4 ;;
  4376. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  4377. *-sse3) echo -xarch=sse3 ;;
  4378. core2) echo -xarch=ssse3 -xchip=core2 ;;
  4379. bonnell) echo -xarch=ssse3 ;;
  4380. corei7|nehalem) echo -xtarget=nehalem ;;
  4381. westmere) echo -xtarget=westmere ;;
  4382. silvermont) echo -xarch=sse4_2 ;;
  4383. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  4384. core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
  4385. echo -xarch=avx ;;
  4386. amdfam10|barcelona) echo -xtarget=barcelona ;;
  4387. btver1) echo -xarch=amdsse4a ;;
  4388. btver2|bdver*|znver*) echo -xarch=avx ;;
  4389. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  4390. k8|opteron|athlon64|athlon-fx)
  4391. echo -xarch=sse2a ;;
  4392. athlon*) echo -xarch=pentium_proa ;;
  4393. esac
  4394. ;;
  4395. -std=c99) echo -xc99 ;;
  4396. -fomit-frame-pointer) echo -xregs=frameptr ;;
  4397. -fPIC) echo -KPIC -xcode=pic32 ;;
  4398. -W*,*) echo $flag ;;
  4399. -f*-*|-W*|-mimpure-text) ;;
  4400. -shared) echo -G ;;
  4401. *) echo $flag ;;
  4402. esac
  4403. done
  4404. }
  4405. probe_cc(){
  4406. pfx=$1
  4407. _cc=$2
  4408. first=$3
  4409. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  4410. unset _ld_o _ldflags _ld_lib _ld_path
  4411. unset _depflags _DEPCMD _DEPFLAGS
  4412. _flags_filter=echo
  4413. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  4414. true # no-op to avoid reading stdin in following checks
  4415. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  4416. _type=llvm_gcc
  4417. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  4418. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  4419. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4420. _cflags_speed='-O3'
  4421. _cflags_size='-Os'
  4422. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  4423. _type=gcc
  4424. gcc_version=$($_cc --version | head -n1)
  4425. gcc_basever=$($_cc -dumpversion)
  4426. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  4427. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  4428. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  4429. case $gcc_basever in
  4430. 2) ;;
  4431. 2.*) ;;
  4432. *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
  4433. esac
  4434. if [ "$first" = true ]; then
  4435. case $gcc_basever in
  4436. 4.2*)
  4437. warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
  4438. esac
  4439. fi
  4440. _cflags_speed='-O3'
  4441. _cflags_size='-Os'
  4442. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  4443. _type=icc
  4444. _ident=$($_cc --version | head -n1)
  4445. _depflags='-MMD'
  4446. _cflags_speed='-O3'
  4447. _cflags_size='-Os'
  4448. _cflags_noopt='-O1'
  4449. _flags_filter=icc_flags
  4450. elif $_cc -v 2>&1 | grep -q xlc; then
  4451. _type=xlc
  4452. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  4453. _cflags_speed='-O5'
  4454. _cflags_size='-O5 -qcompact'
  4455. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  4456. test -d "$sysroot" || die "No valid sysroot specified."
  4457. _type=armcc
  4458. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  4459. armcc_conf="$PWD/armcc.conf"
  4460. $_cc --arm_linux_configure \
  4461. --arm_linux_config_file="$armcc_conf" \
  4462. --configure_sysroot="$sysroot" \
  4463. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  4464. die "Error creating armcc configuration file."
  4465. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  4466. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  4467. as_default="${cross_prefix}gcc"
  4468. _depflags='-MMD'
  4469. _cflags_speed='-O3'
  4470. _cflags_size='-Os'
  4471. elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
  4472. _type=clang
  4473. _ident=$($_cc --version 2>/dev/null | head -n1)
  4474. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4475. _cflags_speed='-O3'
  4476. _cflags_size='-Oz'
  4477. elif $_cc -V 2>&1 | grep -q Sun; then
  4478. _type=suncc
  4479. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  4480. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  4481. _DEPFLAGS='-xM1 -xc99'
  4482. _ldflags='-std=c99'
  4483. _cflags_speed='-O5'
  4484. _cflags_size='-O5 -xspace'
  4485. _flags_filter=suncc_flags
  4486. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  4487. _type=pathscale
  4488. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4489. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4490. _cflags_speed='-O2'
  4491. _cflags_size='-Os'
  4492. _flags_filter='filter_out -Wdisabled-optimization'
  4493. elif $_cc -v 2>&1 | grep -q Open64; then
  4494. _type=open64
  4495. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4496. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4497. _cflags_speed='-O2'
  4498. _cflags_size='-Os'
  4499. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  4500. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  4501. _type=armasm
  4502. _ident=$($_cc | head -n1)
  4503. # 4509: "This form of conditional instruction is deprecated"
  4504. _flags="-nologo -ignore 4509"
  4505. _flags_filter=armasm_flags
  4506. elif $_cc 2>&1 | grep -q Intel; then
  4507. _type=icl
  4508. _ident=$($_cc 2>&1 | head -n1)
  4509. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  4510. # Not only is O3 broken on 13.x+ but it is slower on all previous
  4511. # versions (tested) as well.
  4512. _cflags_speed="-O2"
  4513. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  4514. if $_cc 2>&1 | grep -q Linker; then
  4515. _ld_o='-out:$@'
  4516. else
  4517. _ld_o='-Fe$@'
  4518. fi
  4519. _cc_o='-Fo$@'
  4520. _cc_e='-P'
  4521. _flags_filter=icl_flags
  4522. _ld_lib='lib%.a'
  4523. _ld_path='-libpath:'
  4524. # -Qdiag-error to make icl error when seeing certain unknown arguments
  4525. _flags='-nologo -Qdiag-error:4044,10157'
  4526. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  4527. # with MSVC which enables it by default.
  4528. _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  4529. disable stripping
  4530. elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
  4531. # lld can emulate multiple different linkers; in ms link.exe mode,
  4532. # the -? parameter gives the help output which contains an identifyable
  4533. # string, while it gives an error in other modes.
  4534. _type=lld-link
  4535. # The link.exe mode doesn't have a switch for getting the version,
  4536. # but we can force it back to gnu mode and get the version from there.
  4537. _ident=$($_cc -flavor gnu --version 2>/dev/null)
  4538. _ld_o='-out:$@'
  4539. _flags_filter=msvc_flags
  4540. _ld_lib='lib%.a'
  4541. _ld_path='-libpath:'
  4542. elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
  4543. _type=msvc
  4544. if $_cc -nologo- 2>&1 | grep -q Microsoft; then
  4545. _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
  4546. else
  4547. _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
  4548. fi
  4549. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  4550. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  4551. _cflags_speed="-O2"
  4552. _cflags_size="-O1"
  4553. _cflags_noopt="-O1"
  4554. if $_cc -nologo- 2>&1 | grep -q Linker; then
  4555. _ld_o='-out:$@'
  4556. else
  4557. _ld_o='-Fe$@'
  4558. fi
  4559. _cc_o='-Fo$@'
  4560. _cc_e='-P -Fi$@'
  4561. _flags_filter=msvc_flags
  4562. _ld_lib='lib%.a'
  4563. _ld_path='-libpath:'
  4564. _flags='-nologo'
  4565. disable stripping
  4566. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  4567. _type=cparser
  4568. _ident=$($_cc --version | head -n1)
  4569. _depflags='-MMD'
  4570. _cflags_speed='-O4'
  4571. _cflags_size='-O2'
  4572. _flags_filter=cparser_flags
  4573. fi
  4574. eval ${pfx}_type=\$_type
  4575. eval ${pfx}_ident=\$_ident
  4576. }
  4577. set_ccvars(){
  4578. eval ${1}_C=\${_cc_c-\${${1}_C}}
  4579. eval ${1}_E=\${_cc_e-\${${1}_E}}
  4580. eval ${1}_O=\${_cc_o-\${${1}_O}}
  4581. if [ -n "$_depflags" ]; then
  4582. eval ${1}_DEPFLAGS=\$_depflags
  4583. else
  4584. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  4585. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  4586. eval DEP${1}FLAGS=\$_flags
  4587. fi
  4588. }
  4589. probe_cc cc "$cc" "true"
  4590. cflags_filter=$_flags_filter
  4591. cflags_speed=$_cflags_speed
  4592. cflags_size=$_cflags_size
  4593. cflags_noopt=$_cflags_noopt
  4594. add_cflags $_flags $_cflags
  4595. cc_ldflags=$_ldflags
  4596. set_ccvars CC
  4597. set_ccvars CXX
  4598. probe_cc hostcc "$host_cc"
  4599. host_cflags_filter=$_flags_filter
  4600. host_cflags_speed=$_cflags_speed
  4601. add_host_cflags $_flags $_cflags
  4602. set_ccvars HOSTCC
  4603. test -n "$cc_type" && enable $cc_type ||
  4604. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  4605. : ${as_default:=$cc}
  4606. : ${objcc_default:=$cc}
  4607. : ${dep_cc_default:=$cc}
  4608. : ${ld_default:=$cc}
  4609. : ${host_ld_default:=$host_cc}
  4610. set_default ar as objcc dep_cc ld ln_s host_ld windres
  4611. probe_cc as "$as"
  4612. asflags_filter=$_flags_filter
  4613. add_asflags $_flags $_cflags
  4614. set_ccvars AS
  4615. probe_cc objcc "$objcc"
  4616. objcflags_filter=$_flags_filter
  4617. add_objcflags $_flags $_cflags
  4618. set_ccvars OBJC
  4619. probe_cc ld "$ld"
  4620. ldflags_filter=$_flags_filter
  4621. add_ldflags $_flags $_ldflags
  4622. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  4623. LD_O=${_ld_o-$LD_O}
  4624. LD_LIB=${_ld_lib-$LD_LIB}
  4625. LD_PATH=${_ld_path-$LD_PATH}
  4626. probe_cc hostld "$host_ld"
  4627. host_ldflags_filter=$_flags_filter
  4628. add_host_ldflags $_flags $_ldflags
  4629. HOSTLD_O=${_ld_o-$HOSTLD_O}
  4630. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  4631. probe_cc depcc "$dep_cc"
  4632. CCDEP=${_DEPCMD:-$DEPCMD}
  4633. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  4634. DEPCCFLAGS=$_flags
  4635. fi
  4636. if $ar 2>&1 | grep -q Microsoft; then
  4637. arflags="-nologo"
  4638. ar_o='-out:$@'
  4639. elif $ar 2>&1 | grep -q "\[D\] "; then
  4640. arflags="rcD"
  4641. ar_o='$@'
  4642. else
  4643. arflags="rc"
  4644. ar_o='$@'
  4645. fi
  4646. add_cflags $extra_cflags
  4647. add_cxxflags $extra_cxxflags
  4648. add_objcflags $extra_objcflags
  4649. add_asflags $extra_cflags
  4650. if test -n "$sysroot"; then
  4651. case "$cc_type" in
  4652. gcc|llvm_gcc|clang)
  4653. add_cppflags --sysroot="$sysroot"
  4654. add_ldflags --sysroot="$sysroot"
  4655. ;;
  4656. esac
  4657. fi
  4658. if test "$cpu" = host; then
  4659. enabled cross_compile &&
  4660. warn "--cpu=host makes no sense when cross-compiling."
  4661. case "$cc_type" in
  4662. gcc|llvm_gcc)
  4663. check_native(){
  4664. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4665. sed -n "/cc1.*$1=/{
  4666. s/.*$1=\\([^ ]*\\).*/\\1/
  4667. p
  4668. q
  4669. }" $TMPE
  4670. }
  4671. cpu=$(check_native -march || check_native -mcpu)
  4672. ;;
  4673. clang)
  4674. check_native(){
  4675. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4676. sed -n "/cc1.*-target-cpu /{
  4677. s/.*-target-cpu \\([^ ]*\\).*/\\1/
  4678. p
  4679. q
  4680. }" $TMPE
  4681. }
  4682. cpu=$(check_native -march)
  4683. ;;
  4684. esac
  4685. test "${cpu:-host}" = host &&
  4686. die "--cpu=host not supported with compiler $cc"
  4687. fi
  4688. # Deal with common $arch aliases
  4689. case "$arch" in
  4690. aarch64|arm64)
  4691. arch="aarch64"
  4692. ;;
  4693. arm*|iPad*|iPhone*)
  4694. arch="arm"
  4695. ;;
  4696. loongarch*)
  4697. arch="loongarch"
  4698. ;;
  4699. mips*|IP*)
  4700. case "$arch" in
  4701. *el)
  4702. add_cppflags -EL
  4703. add_ldflags -EL
  4704. ;;
  4705. *eb)
  4706. add_cppflags -EB
  4707. add_ldflags -EB
  4708. ;;
  4709. esac
  4710. arch="mips"
  4711. ;;
  4712. parisc*|hppa*)
  4713. arch="parisc"
  4714. ;;
  4715. "Power Macintosh"|ppc*|powerpc*)
  4716. arch="ppc"
  4717. ;;
  4718. riscv*)
  4719. arch="riscv"
  4720. ;;
  4721. s390|s390x)
  4722. arch="s390"
  4723. ;;
  4724. sh4|sh)
  4725. arch="sh4"
  4726. ;;
  4727. sun4*|sparc*)
  4728. arch="sparc"
  4729. ;;
  4730. tilegx|tile-gx)
  4731. arch="tilegx"
  4732. ;;
  4733. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  4734. arch="x86"
  4735. ;;
  4736. esac
  4737. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  4738. enable $arch
  4739. # Add processor-specific flags
  4740. if enabled aarch64; then
  4741. case $cpu in
  4742. armv*)
  4743. cpuflags="-march=$cpu"
  4744. ;;
  4745. *)
  4746. cpuflags="-mcpu=$cpu"
  4747. ;;
  4748. esac
  4749. elif enabled alpha; then
  4750. cpuflags="-mcpu=$cpu"
  4751. elif enabled arm; then
  4752. check_arm_arch() {
  4753. test_cpp_condition stddef.h \
  4754. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  4755. $cpuflags
  4756. }
  4757. probe_arm_arch() {
  4758. if check_arm_arch 4; then echo armv4
  4759. elif check_arm_arch 4T; then echo armv4t
  4760. elif check_arm_arch 5; then echo armv5
  4761. elif check_arm_arch 5E; then echo armv5e
  4762. elif check_arm_arch 5T; then echo armv5t
  4763. elif check_arm_arch 5TE; then echo armv5te
  4764. elif check_arm_arch 5TEJ; then echo armv5te
  4765. elif check_arm_arch 6; then echo armv6
  4766. elif check_arm_arch 6J; then echo armv6j
  4767. elif check_arm_arch 6K; then echo armv6k
  4768. elif check_arm_arch 6Z; then echo armv6z
  4769. elif check_arm_arch 6KZ; then echo armv6zk
  4770. elif check_arm_arch 6ZK; then echo armv6zk
  4771. elif check_arm_arch 6T2; then echo armv6t2
  4772. elif check_arm_arch 7; then echo armv7
  4773. elif check_arm_arch 7A 7_A; then echo armv7-a
  4774. elif check_arm_arch 7S; then echo armv7-a
  4775. elif check_arm_arch 7R 7_R; then echo armv7-r
  4776. elif check_arm_arch 7M 7_M; then echo armv7-m
  4777. elif check_arm_arch 7EM 7E_M; then echo armv7-m
  4778. elif check_arm_arch 8A 8_A; then echo armv8-a
  4779. fi
  4780. }
  4781. case $cpu in
  4782. generic)
  4783. subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g')
  4784. ;;
  4785. armv*)
  4786. cpuflags="-march=$cpu"
  4787. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  4788. ;;
  4789. *)
  4790. cpuflags="-mcpu=$cpu"
  4791. case $cpu in
  4792. cortex-a*) subarch=armv7a ;;
  4793. cortex-r*) subarch=armv7r ;;
  4794. cortex-m*) enable thumb; subarch=armv7m ;;
  4795. arm11*) subarch=armv6 ;;
  4796. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  4797. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  4798. *) subarch=$(probe_arm_arch) ;;
  4799. esac
  4800. ;;
  4801. esac
  4802. case "$subarch" in
  4803. armv5t*) enable fast_clz ;;
  4804. armv[6-8]*)
  4805. enable fast_clz
  4806. disabled fast_unaligned || enable fast_unaligned
  4807. ;;
  4808. esac
  4809. test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee
  4810. elif enabled avr32; then
  4811. case $cpu in
  4812. ap7[02]0[0-2])
  4813. subarch="avr32_ap"
  4814. cpuflags="-mpart=$cpu"
  4815. ;;
  4816. ap)
  4817. subarch="avr32_ap"
  4818. cpuflags="-march=$cpu"
  4819. ;;
  4820. uc3[ab]*)
  4821. subarch="avr32_uc"
  4822. cpuflags="-mcpu=$cpu"
  4823. ;;
  4824. uc)
  4825. subarch="avr32_uc"
  4826. cpuflags="-march=$cpu"
  4827. ;;
  4828. esac
  4829. elif enabled bfin; then
  4830. cpuflags="-mcpu=$cpu"
  4831. elif enabled loongarch; then
  4832. enable local_aligned
  4833. enable simd_align_32
  4834. enable fast_64bit
  4835. enable fast_clz
  4836. enable fast_unaligned
  4837. case $cpu in
  4838. la464)
  4839. cpuflags="-march=$cpu"
  4840. ;;
  4841. esac
  4842. elif enabled mips; then
  4843. if [ "$cpu" != "generic" ]; then
  4844. disable mips32r2
  4845. disable mips32r5
  4846. disable mips64r2
  4847. disable mips32r6
  4848. disable mips64r6
  4849. disable loongson2
  4850. disable loongson3
  4851. disable mipsdsp
  4852. disable mipsdspr2
  4853. cpuflags="-march=$cpu"
  4854. case $cpu in
  4855. # General ISA levels
  4856. mips1|mips3)
  4857. ;;
  4858. mips32r2)
  4859. enable mips32r2
  4860. ;;
  4861. mips32r5)
  4862. enable mips32r2
  4863. enable mips32r5
  4864. ;;
  4865. mips64r2|mips64r5)
  4866. enable mips64r2
  4867. enable loongson3
  4868. ;;
  4869. # Cores from MIPS(MTI)
  4870. 24kc)
  4871. disable mipsfpu
  4872. enable mips32r2
  4873. ;;
  4874. 24kf*|24kec|34kc|74Kc|1004kc)
  4875. enable mips32r2
  4876. ;;
  4877. 24kef*|34kf*|1004kf*)
  4878. enable mipsdsp
  4879. enable mips32r2
  4880. ;;
  4881. p5600)
  4882. enable mips32r2
  4883. enable mips32r5
  4884. check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
  4885. ;;
  4886. i6400)
  4887. enable mips64r6
  4888. check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4889. ;;
  4890. p6600)
  4891. enable mips64r6
  4892. check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4893. ;;
  4894. # Cores from Loongson
  4895. loongson2e|loongson2f|loongson3*)
  4896. enable local_aligned
  4897. enable simd_align_16
  4898. enable fast_64bit
  4899. enable fast_clz
  4900. enable fast_cmov
  4901. enable fast_unaligned
  4902. disable aligned_stack
  4903. # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
  4904. if test "$cc_type" = "gcc"; then
  4905. case $gcc_basever in
  4906. 2|2.*|3.*|4.*|5.0|5.1|5.2)
  4907. expensive_optimization_flag="-fno-expensive-optimizations"
  4908. ;;
  4909. *)
  4910. expensive_optimization_flag=""
  4911. ;;
  4912. esac
  4913. fi
  4914. case $cpu in
  4915. loongson3*)
  4916. enable loongson3
  4917. cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
  4918. ;;
  4919. loongson2e)
  4920. enable loongson2
  4921. cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
  4922. ;;
  4923. loongson2f)
  4924. enable loongson2
  4925. cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
  4926. ;;
  4927. esac
  4928. ;;
  4929. *)
  4930. warn "unknown MIPS CPU"
  4931. ;;
  4932. esac
  4933. else
  4934. disable mipsdsp
  4935. disable mipsdspr2
  4936. # Disable DSP stuff for generic CPU, it can't be detected at runtime.
  4937. warn 'generic cpu selected'
  4938. fi
  4939. elif enabled ppc; then
  4940. disable ldbrx
  4941. case $(tolower $cpu) in
  4942. 601|ppc601|powerpc601)
  4943. cpuflags="-mcpu=601"
  4944. disable altivec
  4945. ;;
  4946. 603*|ppc603*|powerpc603*)
  4947. cpuflags="-mcpu=603"
  4948. disable altivec
  4949. ;;
  4950. 604*|ppc604*|powerpc604*)
  4951. cpuflags="-mcpu=604"
  4952. disable altivec
  4953. ;;
  4954. g3|75*|ppc75*|powerpc75*)
  4955. cpuflags="-mcpu=750"
  4956. disable altivec
  4957. ;;
  4958. g4|745*|ppc745*|powerpc745*)
  4959. cpuflags="-mcpu=7450"
  4960. disable vsx
  4961. ;;
  4962. 74*|ppc74*|powerpc74*)
  4963. cpuflags="-mcpu=7400"
  4964. disable vsx
  4965. ;;
  4966. g5|970|ppc970|powerpc970)
  4967. cpuflags="-mcpu=970"
  4968. disable vsx
  4969. ;;
  4970. power[3-6]*)
  4971. cpuflags="-mcpu=$cpu"
  4972. disable vsx
  4973. ;;
  4974. power[7-8]*)
  4975. cpuflags="-mcpu=$cpu"
  4976. ;;
  4977. cell)
  4978. cpuflags="-mcpu=cell"
  4979. enable ldbrx
  4980. disable vsx
  4981. ;;
  4982. e500mc)
  4983. cpuflags="-mcpu=e500mc"
  4984. disable altivec
  4985. ;;
  4986. e500v2)
  4987. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  4988. disable altivec
  4989. disable dcbzl
  4990. ;;
  4991. e500)
  4992. cpuflags="-mcpu=8540 -mhard-float"
  4993. disable altivec
  4994. disable dcbzl
  4995. ;;
  4996. esac
  4997. elif enabled riscv; then
  4998. if test_cpp_condition stddef.h "__riscv_zbb"; then
  4999. enable fast_clz
  5000. fi
  5001. elif enabled sparc; then
  5002. case $cpu in
  5003. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  5004. cpuflags="-mcpu=$cpu"
  5005. ;;
  5006. ultrasparc*|niagara[234])
  5007. cpuflags="-mcpu=$cpu"
  5008. ;;
  5009. esac
  5010. elif enabled x86; then
  5011. case $cpu in
  5012. i[345]86|pentium)
  5013. cpuflags="-march=$cpu"
  5014. disable i686
  5015. disable mmx
  5016. ;;
  5017. # targets that do NOT support nopl and conditional mov (cmov)
  5018. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  5019. cpuflags="-march=$cpu"
  5020. disable i686
  5021. ;;
  5022. # targets that do support conditional mov but on which it's slow
  5023. pentium4|pentium4m|prescott|nocona)
  5024. cpuflags="-march=$cpu"
  5025. enable i686
  5026. disable fast_cmov
  5027. ;;
  5028. # everything else should support nopl and conditional mov (cmov)
  5029. *)
  5030. cpuflags="-march=$cpu"
  5031. enable i686
  5032. enable fast_cmov
  5033. ;;
  5034. esac
  5035. fi
  5036. if [ "$cpu" != generic ]; then
  5037. add_cflags $cpuflags
  5038. add_asflags $cpuflags
  5039. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  5040. fi
  5041. # compiler sanity check
  5042. test_exec <<EOF
  5043. int main(void){ return 0; }
  5044. EOF
  5045. if test "$?" != 0; then
  5046. echo "$cc is unable to create an executable file."
  5047. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  5048. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  5049. echo "Only do this if you know what cross compiling means."
  5050. fi
  5051. die "C compiler test failed."
  5052. fi
  5053. add_cppflags -D_ISOC99_SOURCE
  5054. add_cxxflags -D__STDC_CONSTANT_MACROS
  5055. check_cxxflags -std=c++11 || check_cxxflags -std=c++0x
  5056. # some compilers silently accept -std=c11, so we also need to check that the
  5057. # version macro is defined properly
  5058. test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" &&
  5059. add_cflags -std=c11 ||
  5060. check_cflags -std=c99
  5061. check_cppflags -D_FILE_OFFSET_BITS=64
  5062. check_cppflags -D_LARGEFILE_SOURCE
  5063. add_host_cppflags -D_ISOC99_SOURCE
  5064. check_host_cflags -std=c99
  5065. check_host_cflags -Wall
  5066. check_host_cflags $host_cflags_speed
  5067. check_64bit(){
  5068. arch32=$1
  5069. arch64=$2
  5070. expr=${3:-'sizeof(void *) > 4'}
  5071. test_code cc "" "int test[2*($expr) - 1]" &&
  5072. subarch=$arch64 || subarch=$arch32
  5073. enable $subarch
  5074. }
  5075. case "$arch" in
  5076. aarch64|alpha|ia64)
  5077. enabled shared && enable_weak pic
  5078. ;;
  5079. loongarch)
  5080. check_64bit loongarch32 loongarch64
  5081. enabled loongarch64 && disable loongarch32
  5082. enabled shared && enable_weak pic
  5083. ;;
  5084. mips)
  5085. check_64bit mips mips64 '_MIPS_SIM > 1'
  5086. enabled shared && enable_weak pic
  5087. ;;
  5088. parisc)
  5089. check_64bit parisc parisc64
  5090. enabled shared && enable_weak pic
  5091. ;;
  5092. ppc)
  5093. check_64bit ppc ppc64
  5094. enabled shared && enable_weak pic
  5095. ;;
  5096. riscv)
  5097. check_64bit riscv32 riscv64
  5098. enabled shared && enable_weak pic
  5099. ;;
  5100. s390)
  5101. check_64bit s390 s390x
  5102. enabled shared && enable_weak pic
  5103. ;;
  5104. sparc)
  5105. check_64bit sparc sparc64
  5106. enabled shared && enable_weak pic
  5107. ;;
  5108. x86)
  5109. check_64bit x86_32 x86_64
  5110. # Treat x32 as x64 for now. Note it also needs pic if shared
  5111. test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
  5112. subarch=x86_64 && enable x86_64 && disable x86_32
  5113. if enabled x86_64; then
  5114. enabled shared && enable_weak pic
  5115. objformat=elf64
  5116. fi
  5117. ;;
  5118. esac
  5119. # OS specific
  5120. case $target_os in
  5121. aix)
  5122. SHFLAGS=-shared
  5123. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  5124. enabled shared && add_ldflags -Wl,-brtl
  5125. arflags='-Xany -r -c'
  5126. striptype=""
  5127. ;;
  5128. android)
  5129. disable symver
  5130. enable section_data_rel_ro
  5131. add_cflags -fPIE
  5132. add_ldexeflags -fPIE -pie
  5133. SLIB_INSTALL_NAME='$(SLIBNAME)'
  5134. SLIB_INSTALL_LINKS=
  5135. SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
  5136. ;;
  5137. haiku)
  5138. prefix_default="/boot/common"
  5139. network_extralibs="-lnetwork"
  5140. host_extralibs=
  5141. ;;
  5142. sunos)
  5143. SHFLAGS='-shared -Wl,-h,$$(@F)'
  5144. enabled x86 && append SHFLAGS -mimpure-text
  5145. network_extralibs="-lsocket -lnsl"
  5146. add_cppflags -D__EXTENSIONS__
  5147. # When using suncc to build, the Solaris linker will mark
  5148. # an executable with each instruction set encountered by
  5149. # the Solaris assembler. As our libraries contain their own
  5150. # guards for processor-specific code, instead suppress
  5151. # generation of the HWCAPS ELF section on Solaris x86 only.
  5152. enabled_all suncc x86 &&
  5153. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  5154. add_ldflags -Wl,-M,mapfile
  5155. nm_default='nm -P -g'
  5156. striptype=""
  5157. version_script='-M'
  5158. VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
  5159. ;;
  5160. netbsd)
  5161. disable symver
  5162. enable section_data_rel_ro
  5163. oss_indev_extralibs="-lossaudio"
  5164. oss_outdev_extralibs="-lossaudio"
  5165. enabled gcc || check_ldflags -Wl,-zmuldefs
  5166. ;;
  5167. openbsd|bitrig)
  5168. disable symver
  5169. enable section_data_rel_ro
  5170. striptype=""
  5171. SHFLAGS='-shared'
  5172. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  5173. SLIB_INSTALL_LINKS=
  5174. oss_indev_extralibs="-lossaudio"
  5175. oss_outdev_extralibs="-lossaudio"
  5176. ;;
  5177. dragonfly)
  5178. disable symver
  5179. ;;
  5180. freebsd)
  5181. enable section_data_rel_ro
  5182. ;;
  5183. bsd/os)
  5184. add_extralibs -lpoll -lgnugetopt
  5185. strip="strip -d"
  5186. ;;
  5187. darwin)
  5188. enabled ppc && add_asflags -force_cpusubtype_ALL
  5189. install_name_dir_default='$(SHLIBDIR)'
  5190. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  5191. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  5192. strip="${strip} -x"
  5193. add_ldflags -Wl,-dynamic,-search_paths_first
  5194. check_cflags -Werror=partial-availability
  5195. SLIBSUF=".dylib"
  5196. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  5197. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  5198. enabled x86_64 && objformat="macho64" || objformat="macho32"
  5199. enabled_any pic shared x86_64 ||
  5200. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  5201. check_headers dispatch/dispatch.h &&
  5202. add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
  5203. if test -n "$sysroot"; then
  5204. is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
  5205. is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
  5206. fi
  5207. version_script='-exported_symbols_list'
  5208. VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
  5209. # Workaround for Xcode 11 -fstack-check bug
  5210. if enabled clang; then
  5211. clang_version=$($cc -dumpversion)
  5212. test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check
  5213. fi
  5214. ;;
  5215. msys*)
  5216. die "Native MSYS builds are discouraged, please use the MINGW environment."
  5217. ;;
  5218. mingw32*|mingw64*)
  5219. target_os=mingw32
  5220. LIBTARGET=i386
  5221. if enabled x86_64; then
  5222. LIBTARGET="i386:x86-64"
  5223. elif enabled arm; then
  5224. LIBTARGET="arm"
  5225. elif enabled aarch64; then
  5226. LIBTARGET="arm64"
  5227. fi
  5228. if enabled shared; then
  5229. # Cannot build both shared and static libs when using dllimport.
  5230. disable static
  5231. fi
  5232. ! enabled small && test_cmd $windres --version && enable gnu_windres
  5233. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  5234. add_cppflags -DWIN32_LEAN_AND_MEAN
  5235. shlibdir_default="$bindir_default"
  5236. SLIBPREF=""
  5237. SLIBSUF=".dll"
  5238. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5239. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5240. if test_cmd lib.exe -list; then
  5241. SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  5242. if enabled x86_64; then
  5243. LIBTARGET=x64
  5244. fi
  5245. else
  5246. SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  5247. fi
  5248. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5249. SLIB_INSTALL_LINKS=
  5250. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  5251. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  5252. 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)'
  5253. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
  5254. enabled x86_64 && objformat="win64" || objformat="win32"
  5255. dlltool="${cross_prefix}dlltool"
  5256. ranlib=:
  5257. enable dos_paths
  5258. check_ldflags -Wl,--nxcompat,--dynamicbase
  5259. # Lets work around some stupidity in binutils.
  5260. # ld will strip relocations from executables even though we need them
  5261. # for dynamicbase (ASLR). Using -pie does retain the reloc section
  5262. # however ld then forgets what the entry point should be (oops) so we
  5263. # have to manually (re)set it.
  5264. if enabled x86_32; then
  5265. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
  5266. elif enabled x86_64; then
  5267. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
  5268. check_ldflags -Wl,--high-entropy-va # binutils 2.25
  5269. # Set image base >4GB for extra entropy with HEASLR
  5270. add_ldexeflags -Wl,--image-base,0x140000000
  5271. append SHFLAGS -Wl,--image-base,0x180000000
  5272. fi
  5273. ;;
  5274. win32|win64)
  5275. disable symver
  5276. if enabled shared; then
  5277. # Link to the import library instead of the normal static library
  5278. # for shared libs.
  5279. LD_LIB='%.lib'
  5280. # Cannot build both shared and static libs with MSVC or icl.
  5281. disable static
  5282. fi
  5283. ! enabled small && test_cmd $windres --version && enable gnu_windres
  5284. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  5285. add_cppflags -DWIN32_LEAN_AND_MEAN
  5286. shlibdir_default="$bindir_default"
  5287. SLIBPREF=""
  5288. SLIBSUF=".dll"
  5289. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5290. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5291. SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  5292. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5293. SLIB_INSTALL_LINKS=
  5294. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  5295. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  5296. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  5297. enabled x86_64 && objformat="win64" || objformat="win32"
  5298. ranlib=:
  5299. enable dos_paths
  5300. ;;
  5301. cygwin*)
  5302. target_os=cygwin
  5303. shlibdir_default="$bindir_default"
  5304. SLIBPREF="cyg"
  5305. SLIBSUF=".dll"
  5306. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5307. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5308. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5309. SLIB_INSTALL_LINKS=
  5310. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  5311. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  5312. enabled x86_64 && objformat="win64" || objformat="win32"
  5313. enable dos_paths
  5314. ! enabled small && test_cmd $windres --version && enable gnu_windres
  5315. add_cppflags -DWIN32_LEAN_AND_MEAN
  5316. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5317. ;;
  5318. *-dos|freedos|opendos)
  5319. network_extralibs="-lsocket"
  5320. objformat="coff"
  5321. enable dos_paths
  5322. ;;
  5323. linux)
  5324. enable section_data_rel_ro
  5325. enabled_any arm aarch64 && enable_weak linux_perf
  5326. ;;
  5327. irix*)
  5328. target_os=irix
  5329. ranlib="echo ignoring ranlib"
  5330. ;;
  5331. os/2*)
  5332. strip="lxlite -CS"
  5333. striptype=""
  5334. objformat="aout"
  5335. add_cppflags -D_GNU_SOURCE
  5336. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
  5337. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  5338. LIBSUF="_s.a"
  5339. SLIBPREF=""
  5340. SLIBSUF=".dll"
  5341. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5342. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  5343. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
  5344. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
  5345. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
  5346. echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
  5347. emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
  5348. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
  5349. emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
  5350. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5351. SLIB_INSTALL_LINKS=
  5352. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
  5353. enable dos_paths
  5354. enable_weak os2threads
  5355. ;;
  5356. gnu/kfreebsd)
  5357. add_cppflags -D_BSD_SOURCE
  5358. ;;
  5359. gnu)
  5360. ;;
  5361. qnx)
  5362. add_cppflags -D_QNX_SOURCE
  5363. network_extralibs="-lsocket"
  5364. ;;
  5365. symbian)
  5366. SLIBSUF=".dll"
  5367. enable dos_paths
  5368. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  5369. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  5370. add_ldflags -Wl,--target1-abs,--no-undefined \
  5371. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  5372. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  5373. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  5374. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  5375. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  5376. ;;
  5377. minix)
  5378. ;;
  5379. none)
  5380. ;;
  5381. *)
  5382. die "Unknown OS '$target_os'."
  5383. ;;
  5384. esac
  5385. # test if creating links works
  5386. link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
  5387. link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
  5388. mkdir "$link_dest"
  5389. $ln_s "$link_dest" "$link_name"
  5390. touch "$link_dest/test_file"
  5391. if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
  5392. # create link to source path
  5393. [ -e src ] && rm src
  5394. $ln_s "$source_path" src
  5395. source_link=src
  5396. else
  5397. # creating directory links doesn't work
  5398. # fall back to using the full source path
  5399. source_link="$source_path"
  5400. fi
  5401. # cleanup
  5402. rm -r "$link_dest"
  5403. rm -r "$link_name"
  5404. # determine libc flavour
  5405. probe_libc(){
  5406. pfx=$1
  5407. pfx_no_=${pfx%_}
  5408. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  5409. if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  5410. eval ${pfx}libc_type=uclibc
  5411. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5412. elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  5413. eval ${pfx}libc_type=glibc
  5414. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5415. # MinGW headers can be installed on Cygwin, so check for newlib first.
  5416. elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  5417. eval ${pfx}libc_type=newlib
  5418. add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
  5419. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  5420. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  5421. eval ${pfx}libc_type=mingw64
  5422. if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  5423. add_compat msvcrt/snprintf.o
  5424. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  5425. fi
  5426. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5427. eval test \$${pfx_no_}cc_type = "gcc" &&
  5428. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5429. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5430. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5431. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5432. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  5433. test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  5434. eval ${pfx}libc_type=mingw32
  5435. test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  5436. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  5437. die "ERROR: MinGW32 runtime version must be >= 3.15."
  5438. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5439. test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
  5440. add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
  5441. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5442. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5443. eval test \$${pfx_no_}cc_type = "gcc" &&
  5444. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5445. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5446. elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  5447. eval ${pfx}libc_type=msvcrt
  5448. if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  5449. if [ "$pfx" = host_ ]; then
  5450. add_host_cppflags -Dsnprintf=_snprintf
  5451. else
  5452. add_compat strtod.o strtod=avpriv_strtod
  5453. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  5454. _snprintf=avpriv_snprintf \
  5455. vsnprintf=avpriv_vsnprintf
  5456. fi
  5457. fi
  5458. add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
  5459. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  5460. # 0x601 by default unless something else is set by the user.
  5461. # This can easily lead to us detecting functions only present
  5462. # in such new versions and producing binaries requiring windows 7.0.
  5463. # Therefore explicitly set the default to Vista unless the user has
  5464. # set something else on the command line.
  5465. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  5466. # family. For these cases, configure is free to use any functions
  5467. # found in the SDK headers by default. (Alternatively, we could force
  5468. # _WIN32_WINNT to 0x0602 in that case.)
  5469. test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  5470. { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
  5471. #ifdef WINAPI_FAMILY
  5472. #include <winapifamily.h>
  5473. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5474. #error not desktop
  5475. #endif
  5476. #endif
  5477. EOF
  5478. if [ "$pfx" = "" ]; then
  5479. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  5480. check_func strtoull || add_cflags -Dstrtoull=_strtoui64
  5481. fi
  5482. elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  5483. eval ${pfx}libc_type=klibc
  5484. elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  5485. eval ${pfx}libc_type=bionic
  5486. elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  5487. eval ${pfx}libc_type=solaris
  5488. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  5489. elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
  5490. eval ${pfx}libc_type=djgpp
  5491. add_cppflags -U__STRICT_ANSI__
  5492. add_cflags "-include $source_path/compat/djgpp/math.h"
  5493. add_compat djgpp/math.o
  5494. fi
  5495. test_${pfx}cc <<EOF
  5496. #include <time.h>
  5497. void *v = localtime_r;
  5498. EOF
  5499. 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
  5500. #include <time.h>
  5501. void *v = localtime_r;
  5502. EOF
  5503. eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
  5504. }
  5505. probe_libc
  5506. probe_libc host_
  5507. # hacks for compiler/libc/os combinations
  5508. case $libc_type in
  5509. bionic)
  5510. add_compat strtod.o strtod=avpriv_strtod
  5511. ;;
  5512. esac
  5513. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  5514. add_cppflags '-I\$(SRC_PATH)/compat/float'
  5515. test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  5516. set_default libdir
  5517. : ${shlibdir_default:="$libdir"}
  5518. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  5519. set_default $PATHS_LIST
  5520. set_default nm
  5521. disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
  5522. enable_weak_pic() {
  5523. disabled pic && return
  5524. enable pic
  5525. add_cppflags -DPIC
  5526. case "$target_os" in
  5527. mingw*|cygwin*|win*)
  5528. ;;
  5529. *)
  5530. add_cflags -fPIC
  5531. add_asflags -fPIC
  5532. ;;
  5533. esac
  5534. }
  5535. enabled pic && enable_weak_pic
  5536. test_cc <<EOF || die "Symbol mangling check failed."
  5537. int ff_extern;
  5538. EOF
  5539. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  5540. extern_prefix=${sym%%ff_extern*}
  5541. ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
  5542. for restrict_keyword in restrict __restrict__ __restrict ""; do
  5543. test_code cc "" "char * $restrict_keyword p" && break
  5544. done
  5545. check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
  5546. # The global variable ensures the bits appear unchanged in the object file.
  5547. test_cc <<EOF || die "endian test failed"
  5548. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  5549. EOF
  5550. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  5551. check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
  5552. if ! enabled ppc64 || enabled bigendian; then
  5553. disable vsx
  5554. fi
  5555. check_gas() {
  5556. log "check_gas using '$as' as AS"
  5557. # :vararg is used on aarch64, arm and ppc altivec
  5558. check_as vararg "
  5559. .macro m n, y:vararg=0
  5560. \n: .int \y
  5561. .endm
  5562. m x" || return 1
  5563. # .altmacro is only used in arm asm
  5564. ! enabled arm || check_as gnu_as ".altmacro"
  5565. }
  5566. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  5567. nogas=:
  5568. enabled_any arm aarch64 && nogas=die
  5569. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  5570. as_noop=-v
  5571. case $as_type in
  5572. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  5573. gcc) gaspp_as_type=gas ;;
  5574. *) gaspp_as_type=$as_type ;;
  5575. esac
  5576. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  5577. test "${as#*gas-preprocessor.pl}" != "$as" ||
  5578. test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  5579. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  5580. if ! check_gas ; then
  5581. as=${gas:=$as}
  5582. check_gas || \
  5583. $nogas "GNU assembler not found, install/update gas-preprocessor"
  5584. fi
  5585. check_as as_func ".func test
  5586. .endfunc"
  5587. fi
  5588. check_inline_asm inline_asm_labels '"1:\n"'
  5589. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  5590. if enabled aarch64; then
  5591. as_arch_level="armv8-a"
  5592. check_as as_arch_directive ".arch $as_arch_level"
  5593. enabled as_arch_directive && check_arch_level armv8.2-a
  5594. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  5595. # internal assembler in clang 3.3 does not support this instruction
  5596. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  5597. archext_list="dotprod i8mm"
  5598. enabled dotprod && check_archext_insn dotprod 'udot v0.4s, v0.16b, v0.16b'
  5599. enabled i8mm && check_archext_insn i8mm 'usdot v0.4s, v0.16b, v0.16b'
  5600. # Disable the main feature (e.g. HAVE_NEON) if neither inline nor external
  5601. # assembly support the feature out of the box. Skip this for the features
  5602. # checked with check_archext_insn above, as that function takes care of
  5603. # updating all the variables as necessary.
  5604. for v in $ARCH_EXT_LIST_ARM; do
  5605. is_in $v $archext_list && continue
  5606. enabled_any ${v}_external ${v}_inline || disable $v
  5607. done
  5608. elif enabled alpha; then
  5609. check_cflags -mieee
  5610. elif enabled arm; then
  5611. enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
  5612. test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
  5613. float func(float a, float b){ return a+b; }
  5614. EOF
  5615. enabled thumb && check_cflags -mthumb || check_cflags -marm
  5616. if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
  5617. :
  5618. elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  5619. :
  5620. elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  5621. case "${cross_prefix:-$cc}" in
  5622. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  5623. *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
  5624. __asm__ (".eabi_attribute 28, 1");
  5625. int main(void) { return 0; }
  5626. EOF
  5627. esac
  5628. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  5629. fi
  5630. # Test for various instruction sets, testing support both in inline and
  5631. # external assembly. This sets the ${v}_inline or ${v}_external flags
  5632. # if the instruction can be used unconditionally in either inline or
  5633. # external assembly. This means that if the ${v}_external feature is set,
  5634. # that feature can be used unconditionally in various support macros
  5635. # anywhere in external assembly, in any function.
  5636. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  5637. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  5638. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  5639. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  5640. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  5641. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  5642. enabled setend && check_insn setend 'setend be'
  5643. # If neither inline nor external assembly can use the feature by default,
  5644. # disable the main unsuffixed feature (e.g. HAVE_NEON).
  5645. #
  5646. # For targets that support runtime CPU feature detection, don't disable
  5647. # the main feature flag - there we assume that all supported toolchains
  5648. # can assemble code for all instruction set features (e.g. NEON) with
  5649. # suitable assembly flags (such as ".fpu neon"); we don't check
  5650. # specifically that they really do.
  5651. [ $target_os = linux ] || [ $target_os = android ] ||
  5652. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  5653. $ARCH_EXT_LIST_ARM
  5654. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  5655. check_as as_arch_directive ".arch armv7-a"
  5656. check_as as_dn_directive "ra .dn d0.i16"
  5657. check_as as_fpu_directive ".fpu neon"
  5658. # llvm's integrated assembler supports .object_arch from llvm 3.5
  5659. [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
  5660. check_as as_object_arch ".object_arch armv4"
  5661. # MS armasm fails to assemble our PIC constructs
  5662. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  5663. elif enabled mips; then
  5664. # Check toolchain ISA level
  5665. if enabled mips64; then
  5666. enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' &&
  5667. disable mips64r2
  5668. enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
  5669. disable mips32r6 && disable mips32r5 && disable mips32r2
  5670. else
  5671. enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' &&
  5672. disable mips32r5 && disable mips32r2
  5673. enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"'
  5674. enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
  5675. disable mips64r6 && disable mips64r5 && disable mips64r2
  5676. fi
  5677. enabled mipsfpu && check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
  5678. enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
  5679. enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
  5680. enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
  5681. # MSA can be detected at runtime so we supply extra flags here
  5682. enabled mipsfpu && enabled msa && check_inline_asm msa '"addvi.b $w0, $w1, 1"' '-mmsa' && append MSAFLAGS '-mmsa'
  5683. # loongson2 have no switch cflag so we can only probe toolchain ability
  5684. enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"' && disable loongson3
  5685. # loongson3 is paired with MMI
  5686. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext'
  5687. # MMI can be detected at runtime too
  5688. enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi'
  5689. if enabled bigendian && enabled msa; then
  5690. disable msa
  5691. fi
  5692. elif enabled parisc; then
  5693. if enabled gcc; then
  5694. case $($cc -dumpversion) in
  5695. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  5696. esac
  5697. fi
  5698. elif enabled ppc; then
  5699. enable local_aligned
  5700. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  5701. check_inline_asm ibm_asm '"add 0, 0, 0"'
  5702. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  5703. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  5704. if enabled altivec; then
  5705. check_cflags -maltivec -mabi=altivec
  5706. # check if our compiler supports Motorola AltiVec C API
  5707. check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
  5708. vector signed int v2 = (vector signed int) { 1 };
  5709. v1 = vec_add(v1, v2);"
  5710. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  5711. fi
  5712. if enabled vsx; then
  5713. check_cflags -mvsx &&
  5714. check_cc vsx altivec.h "int v[4] = { 0 };
  5715. vector signed int v1 = vec_vsx_ld(0, v);"
  5716. fi
  5717. if enabled power8; then
  5718. check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
  5719. fi
  5720. elif enabled riscv; then
  5721. enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"'
  5722. elif enabled x86; then
  5723. check_builtin rdtsc intrin.h "__rdtsc()"
  5724. check_builtin mm_empty mmintrin.h "_mm_empty()"
  5725. enable local_aligned
  5726. # check whether EBP is available on x86
  5727. # As 'i' is stored on the stack, this program will crash
  5728. # if the base pointer is used to access it because the
  5729. # base pointer is cleared in the inline assembly code.
  5730. check_exec_crash <<EOF && enable ebp_available
  5731. volatile int i=0;
  5732. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  5733. return i;
  5734. EOF
  5735. # check whether EBX is available on x86
  5736. check_inline_asm ebx_available '""::"b"(0)' &&
  5737. check_inline_asm ebx_available '"":::"%ebx"'
  5738. # check whether xmm clobbers are supported
  5739. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  5740. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  5741. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  5742. # check whether binutils is new enough to compile SSSE3/MMXEXT
  5743. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  5744. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  5745. probe_x86asm(){
  5746. x86asmexe_probe=$1
  5747. if test_cmd $x86asmexe_probe -v; then
  5748. x86asmexe=$x86asmexe_probe
  5749. x86asm_type=nasm
  5750. x86asm_debug="-g -F dwarf"
  5751. X86ASMDEP=
  5752. X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
  5753. elif test_cmd $x86asmexe_probe --version; then
  5754. x86asmexe=$x86asmexe_probe
  5755. x86asm_type=yasm
  5756. x86asm_debug="-g dwarf2"
  5757. X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
  5758. X86ASM_DEPFLAGS=
  5759. fi
  5760. check_x86asm x86asm "movbe ecx, [5]"
  5761. }
  5762. if ! disabled_any asm mmx x86asm; then
  5763. disable x86asm
  5764. for program in $x86asmexe nasm yasm; do
  5765. probe_x86asm $program && break
  5766. done
  5767. disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
  5768. X86ASMFLAGS="-f $objformat"
  5769. enabled pic && append X86ASMFLAGS "-DPIC"
  5770. test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
  5771. case "$objformat" in
  5772. elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
  5773. esac
  5774. enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
  5775. enabled avx512icl && check_x86asm avx512icl_external "vpdpwssds zmm31{k1}{z}, zmm29, zmm28"
  5776. enabled avx2 && check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
  5777. enabled xop && check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
  5778. enabled fma4 && check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
  5779. check_x86asm cpunop "CPU amdnop"
  5780. fi
  5781. case "$cpu" in
  5782. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  5783. disable fast_clz
  5784. ;;
  5785. esac
  5786. elif enabled loongarch; then
  5787. enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr2"' '-mlsx' && append LSXFLAGS '-mlsx'
  5788. enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr2"' '-mlasx' && append LASXFLAGS '-mlasx'
  5789. fi
  5790. check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
  5791. check_ldflags -Wl,--as-needed
  5792. check_ldflags -Wl,-z,noexecstack
  5793. if ! disabled network; then
  5794. check_func getaddrinfo $network_extralibs
  5795. check_func inet_aton $network_extralibs
  5796. check_type netdb.h "struct addrinfo"
  5797. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  5798. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  5799. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  5800. check_type poll.h "struct pollfd"
  5801. check_type netinet/sctp.h "struct sctp_event_subscribe"
  5802. check_struct "sys/socket.h" "struct msghdr" msg_flags
  5803. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  5804. check_type netinet/in.h "struct sockaddr_in6"
  5805. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  5806. check_type "sys/types.h sys/socket.h" socklen_t
  5807. # Prefer arpa/inet.h over winsock2
  5808. if check_headers arpa/inet.h ; then
  5809. check_func closesocket
  5810. elif check_headers winsock2.h ; then
  5811. check_func_headers winsock2.h closesocket -lws2 &&
  5812. network_extralibs="-lws2" ||
  5813. { check_func_headers winsock2.h closesocket -lws2_32 &&
  5814. network_extralibs="-lws2_32"; } || disable winsock2_h network
  5815. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  5816. check_type ws2tcpip.h socklen_t
  5817. check_type ws2tcpip.h "struct addrinfo"
  5818. check_type ws2tcpip.h "struct group_source_req"
  5819. check_type ws2tcpip.h "struct ip_mreq_source"
  5820. check_type ws2tcpip.h "struct ipv6_mreq"
  5821. check_type winsock2.h "struct pollfd"
  5822. check_struct winsock2.h "struct sockaddr" sa_len
  5823. check_type ws2tcpip.h "struct sockaddr_in6"
  5824. check_type ws2tcpip.h "struct sockaddr_storage"
  5825. else
  5826. disable network
  5827. fi
  5828. fi
  5829. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  5830. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  5831. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  5832. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  5833. check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
  5834. check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
  5835. check_builtin float16 "" "_Float16 f16var"
  5836. if enabled float16; then
  5837. if enabled x86; then
  5838. test_cpp_condition stddef.h "defined(__F16C__)" && enable fast_float16
  5839. elif enabled arm || enabled aarch64; then
  5840. enable fast_float16
  5841. fi
  5842. fi
  5843. case "$custom_allocator" in
  5844. "")
  5845. ;;
  5846. jemalloc)
  5847. test -n "$malloc_prefix" ||
  5848. malloc_prefix=$($pkg_config --variable=jemalloc_prefix $pkg_config_flags jemalloc 2>/dev/null)
  5849. require_pkg_config custom_allocator jemalloc jemalloc/jemalloc.h ${malloc_prefix}malloc
  5850. ;;
  5851. tcmalloc)
  5852. require_pkg_config custom_allocator libtcmalloc gperftools/tcmalloc.h tc_malloc
  5853. malloc_prefix=tc_
  5854. ;;
  5855. *)
  5856. require_pkg_config custom_allocator "$custom_allocator" stdlib.h malloc
  5857. ;;
  5858. esac
  5859. if test -n "$custom_allocator"; then
  5860. add_extralibs "$custom_allocator_extralibs"
  5861. fi
  5862. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  5863. check_func ${malloc_prefix}memalign && enable memalign
  5864. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  5865. check_func access
  5866. check_func_headers stdlib.h arc4random_buf
  5867. check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
  5868. check_func fcntl
  5869. check_func fork
  5870. check_func gethrtime
  5871. check_func getopt
  5872. check_func getrusage
  5873. check_func gettimeofday
  5874. check_func isatty
  5875. check_func mkstemp
  5876. check_func mmap
  5877. check_func mprotect
  5878. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  5879. check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
  5880. check_func_headers sys/prctl.h prctl
  5881. check_func sched_getaffinity
  5882. check_func setrlimit
  5883. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  5884. check_func strerror_r
  5885. check_func sysconf
  5886. check_func sysctl
  5887. check_func usleep
  5888. check_func_headers conio.h kbhit
  5889. check_func_headers io.h setmode
  5890. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  5891. check_func_headers mach/mach_time.h mach_absolute_time
  5892. check_func_headers stdlib.h getenv
  5893. check_func_headers sys/stat.h lstat
  5894. check_func_headers sys/auxv.h getauxval
  5895. check_func_headers sys/sysctl.h sysctlbyname
  5896. check_func_headers windows.h GetModuleHandle
  5897. check_func_headers windows.h GetProcessAffinityMask
  5898. check_func_headers windows.h GetProcessTimes
  5899. check_func_headers windows.h GetStdHandle
  5900. check_func_headers windows.h GetSystemTimeAsFileTime
  5901. check_func_headers windows.h LoadLibrary
  5902. check_func_headers windows.h MapViewOfFile
  5903. check_func_headers windows.h PeekNamedPipe
  5904. check_func_headers windows.h SetConsoleTextAttribute
  5905. check_func_headers windows.h SetConsoleCtrlHandler
  5906. check_func_headers windows.h SetDllDirectory
  5907. check_func_headers windows.h Sleep
  5908. check_func_headers windows.h VirtualAlloc
  5909. check_func_headers glob.h glob
  5910. if enabled xlib; then
  5911. check_pkg_config xlib_x11 x11 "X11/Xlib.h" XPending ||
  5912. check_lib xlib_x11 "X11/Xlib.h" XPending -lX11 ||
  5913. disable xlib
  5914. check_pkg_config xlib_xext xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach ||
  5915. check_lib xlib_xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach -lXext ||
  5916. disable xlib
  5917. check_pkg_config xlib_xv xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute ||
  5918. check_lib xlib_xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv ||
  5919. disable xlib
  5920. fi
  5921. check_headers direct.h
  5922. check_headers dirent.h
  5923. check_headers dxgidebug.h
  5924. check_headers dxva.h
  5925. check_headers dxva2api.h -D_WIN32_WINNT=0x0600
  5926. check_headers io.h
  5927. enabled libdrm &&
  5928. check_headers linux/dma-buf.h
  5929. check_headers linux/perf_event.h
  5930. check_headers libcrystalhd/libcrystalhd_if.h
  5931. check_headers malloc.h
  5932. check_headers mftransform.h
  5933. check_headers net/udplite.h
  5934. check_headers poll.h
  5935. check_headers pthread_np.h
  5936. check_headers sys/param.h
  5937. check_headers sys/resource.h
  5938. check_headers sys/select.h
  5939. check_headers sys/time.h
  5940. check_headers sys/un.h
  5941. check_headers termios.h
  5942. check_headers unistd.h
  5943. check_headers valgrind/valgrind.h
  5944. check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
  5945. check_func_headers VideoToolbox/VideoToolbox.h VTPixelRotationSessionCreate -framework VideoToolbox
  5946. check_headers windows.h
  5947. check_headers asm/types.h
  5948. # it seems there are versions of clang in some distros that try to use the
  5949. # gcc headers, which explodes for stdatomic
  5950. # so we also check that atomics actually work here
  5951. #
  5952. # some configurations also require linking to libatomic, so try
  5953. # both with -latomic and without
  5954. for LATOMIC in "-latomic" ""; do
  5955. check_builtin stdatomic stdatomic.h \
  5956. "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" \
  5957. $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
  5958. done
  5959. check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
  5960. check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
  5961. check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
  5962. check_lib ole32 "windows.h objbase.h" CoTaskMemFree -lole32
  5963. check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  5964. check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  5965. check_lib android android/native_window.h ANativeWindow_acquire -landroid
  5966. check_lib mediandk "stdint.h media/NdkImage.h" AImage_delete -lmediandk
  5967. check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
  5968. enabled appkit && check_apple_framework AppKit
  5969. enabled audiotoolbox && check_apple_framework AudioToolbox
  5970. enabled avfoundation && check_apple_framework AVFoundation
  5971. enabled coreimage && check_apple_framework CoreImage
  5972. enabled metal && check_apple_framework Metal
  5973. enabled videotoolbox && check_apple_framework VideoToolbox
  5974. check_apple_framework CoreFoundation
  5975. check_apple_framework CoreMedia
  5976. check_apple_framework CoreVideo
  5977. check_apple_framework CoreAudio
  5978. enabled avfoundation && {
  5979. disable coregraphics applicationservices
  5980. check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
  5981. check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
  5982. enabled videotoolbox && {
  5983. check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
  5984. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
  5985. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia"
  5986. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_VP9 "-framework CoreMedia"
  5987. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  5988. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
  5989. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  5990. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
  5991. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
  5992. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  5993. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
  5994. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo"
  5995. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo"
  5996. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo"
  5997. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferYCbCrMatrix_ITU_R_2020 "-framework CoreVideo"
  5998. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 "-framework CoreVideo"
  5999. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2020 "-framework CoreVideo"
  6000. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_428_1 "-framework CoreVideo"
  6001. }
  6002. enabled metal && test_cmd $metalcc -v || disable metal
  6003. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  6004. check_type "windows.h dxva.h" "DXVA_PicParams_AV1" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6005. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6006. check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6007. check_type "windows.h dxgi1_2.h" "DXGI_OUTDUPL_FRAME_INFO"
  6008. check_type "windows.h dxgi1_2.h" "IDXGIOutput1"
  6009. check_type "windows.h dxgi1_5.h" "IDXGIOutput5"
  6010. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  6011. check_type "windows.h d3d11.h" "ID3D11VideoContext"
  6012. check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00
  6013. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  6014. check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat
  6015. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  6016. check_type "vdpau/vdpau.h" "VdpPictureInfoVP9"
  6017. check_type "vdpau/vdpau.h" "VdpPictureInfoAV1"
  6018. if [ -z "$nvccflags" ]; then
  6019. nvccflags=$nvccflags_default
  6020. fi
  6021. nvccflags="$nvccflags -std=c++11"
  6022. if enabled x86_64 || enabled ppc64 || enabled aarch64; then
  6023. nvccflags="$nvccflags -m64"
  6024. else
  6025. nvccflags="$nvccflags -m32"
  6026. fi
  6027. if enabled cuda_nvcc; then
  6028. nvccflags="$nvccflags -ptx"
  6029. else
  6030. nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -Wno-c++11-narrowing -include ${source_link}/compat/cuda/cuda_runtime.h"
  6031. check_nvcc cuda_llvm
  6032. fi
  6033. if ! disabled ffnvcodec; then
  6034. ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
  6035. check_pkg_config ffnvcodec "ffnvcodec >= 12.1.14.0" "$ffnv_hdr_list" "" || \
  6036. check_pkg_config ffnvcodec "ffnvcodec >= 12.0.16.1 ffnvcodec < 12.1" "$ffnv_hdr_list" "" || \
  6037. check_pkg_config ffnvcodec "ffnvcodec >= 11.1.5.3 ffnvcodec < 12.0" "$ffnv_hdr_list" "" || \
  6038. check_pkg_config ffnvcodec "ffnvcodec >= 11.0.10.3 ffnvcodec < 11.1" "$ffnv_hdr_list" "" || \
  6039. check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.15 ffnvcodec < 8.2" "$ffnv_hdr_list" ""
  6040. fi
  6041. if enabled_all libglslang libshaderc; then
  6042. die "ERROR: libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang"
  6043. fi
  6044. check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
  6045. if ! disabled w32threads && ! enabled pthreads; then
  6046. check_func_headers "windows.h process.h" _beginthreadex &&
  6047. check_type "windows.h" CONDITION_VARIABLE &&
  6048. check_type "windows.h" INIT_ONCE &&
  6049. enable w32threads || disable w32threads
  6050. if ! enabled w32threads && enabled winrt; then
  6051. check_func_headers "windows.h" CreateThread &&
  6052. enable w32threads || disable w32threads
  6053. fi
  6054. fi
  6055. # check for some common methods of building with pthread support
  6056. # do this before the optional library checks as some of them require pthreads
  6057. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  6058. if check_lib pthreads pthread.h pthread_join -pthread &&
  6059. check_lib pthreads pthread.h pthread_create -pthread; then
  6060. add_cflags -pthread
  6061. elif check_lib pthreads pthread.h pthread_join -pthreads &&
  6062. check_lib pthreads pthread.h pthread_create -pthreads; then
  6063. add_cflags -pthreads
  6064. elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
  6065. check_lib pthreads pthread.h pthread_create -ldl -pthread; then
  6066. add_cflags -ldl -pthread
  6067. elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
  6068. check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
  6069. :
  6070. elif check_lib pthreads pthread.h pthread_join -lpthread &&
  6071. check_lib pthreads pthread.h pthread_create -lpthread; then
  6072. :
  6073. elif check_func pthread_join && check_func pthread_create; then
  6074. enable pthreads
  6075. fi
  6076. check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
  6077. if enabled pthreads; then
  6078. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
  6079. check_func pthread_cancel $pthreads_extralibs
  6080. hdrs=pthread.h
  6081. if enabled pthread_np_h; then
  6082. hdrs="$hdrs pthread_np.h"
  6083. fi
  6084. check_lib pthread_set_name_np "$hdrs" pthread_set_name_np -lpthread
  6085. check_lib pthread_setname_np "$hdrs" pthread_setname_np -lpthread
  6086. fi
  6087. fi
  6088. enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
  6089. check_lib zlib zlib.h zlibVersion -lz; }
  6090. enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
  6091. enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
  6092. enabled zlib && test_exec $zlib_extralibs <<EOF && enable zlib_gzip
  6093. #include <zlib.h>
  6094. int main(void) {
  6095. if (zlibCompileFlags() & (1 << 17)) return 1;
  6096. return 0;
  6097. }
  6098. EOF
  6099. [ -x "$(command -v gzip)" ] && enable gzip
  6100. enabled zlib_gzip && enabled gzip || disable ptx_compression
  6101. # On some systems dynamic loading requires no extra linker flags
  6102. check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
  6103. check_lib libm math.h sin -lm
  6104. atan2f_args=2
  6105. copysign_args=2
  6106. hypot_args=2
  6107. ldexpf_args=2
  6108. powf_args=2
  6109. for func in $MATH_FUNCS; do
  6110. eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
  6111. done
  6112. # these are off by default, so fail if requested and not available
  6113. enabled avisynth && { require_headers "avisynth/avisynth_c.h avisynth/avs/version.h" &&
  6114. { 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" ||
  6115. die "ERROR: AviSynth+ header version must be >= 3.7.3"; } }
  6116. enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
  6117. enabled chromaprint && { check_pkg_config chromaprint libchromaprint "chromaprint.h" chromaprint_get_version ||
  6118. require chromaprint chromaprint.h chromaprint_get_version -lchromaprint; }
  6119. enabled decklink && { require_headers DeckLinkAPI.h &&
  6120. { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } }
  6121. enabled frei0r && require_headers "frei0r.h"
  6122. enabled gmp && require gmp gmp.h mpz_export -lgmp
  6123. enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
  6124. enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
  6125. enabled ladspa && require_headers "ladspa.h dlfcn.h"
  6126. enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
  6127. enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
  6128. enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
  6129. { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
  6130. die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
  6131. enabled libaribcaption && require_pkg_config libaribcaption "libaribcaption >= 1.1.1" "aribcaption/aribcaption.h" aribcc_context_alloc
  6132. enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
  6133. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  6134. enabled libass && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init
  6135. enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
  6136. enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
  6137. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  6138. { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
  6139. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  6140. enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
  6141. enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
  6142. enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version
  6143. enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
  6144. enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
  6145. enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
  6146. enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
  6147. { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
  6148. warn "using libfdk without pkg-config"; } }
  6149. 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"
  6150. enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
  6151. enabled fontconfig && enable libfontconfig
  6152. enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
  6153. enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
  6154. enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
  6155. enabled libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create
  6156. enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
  6157. -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \
  6158. -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
  6159. require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
  6160. -lglslang -lOSDependent -lHLSL -lOGLCompiler \
  6161. -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm; }
  6162. enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
  6163. require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
  6164. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  6165. check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
  6166. done || die "ERROR: libgsm not found"; }
  6167. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
  6168. enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/decode.h JxlDecoderVersion &&
  6169. require_pkg_config libjxl_threads "libjxl_threads >= 0.7.0" jxl/thread_parallel_runner.h JxlThreadParallelRunner
  6170. enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
  6171. enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 2.0.0" kvazaar.h kvz_api_get
  6172. enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new
  6173. if enabled libmfx && enabled libvpl; then
  6174. die "ERROR: can not use libmfx and libvpl together"
  6175. # While it may appear that require is being used as a pkg-config
  6176. # fallback for libmfx, it is actually being used to detect a different
  6177. # installation route altogether. If libmfx is installed via the Intel
  6178. # Media SDK or Intel Media Server Studio, these don't come with
  6179. # pkg-config support. Instead, users should make sure that the build
  6180. # can find the libraries and headers through other means.
  6181. elif enabled libmfx; then
  6182. { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfxvideo.h" MFXInit ||
  6183. # Some old versions of libmfx have the following settings in libmfx.pc:
  6184. # includedir=/usr/include
  6185. # Cflags: -I${includedir}
  6186. # So add -I${includedir}/mfx to CFLAGS
  6187. { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } ||
  6188. { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" &&
  6189. { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } &&
  6190. warn "using libmfx without pkg-config"; } } &&
  6191. warn "libmfx is deprecated. Please run configure with --enable-libvpl to use libvpl instead."
  6192. elif enabled libvpl; then
  6193. # Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option
  6194. # because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. The package name
  6195. # is extracted from "vpl >= 2.6"
  6196. check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad || \
  6197. die "ERROR: libvpl >= 2.6 not found"
  6198. fi
  6199. if enabled libmfx; then
  6200. check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9"
  6201. fi
  6202. enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
  6203. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
  6204. enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
  6205. require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
  6206. enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
  6207. check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppif -lnppc -lnppidei ||
  6208. die "ERROR: libnpp not found"; }
  6209. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  6210. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  6211. enabled libopencv && { check_headers opencv2/core/core_c.h &&
  6212. { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
  6213. require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
  6214. require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
  6215. enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
  6216. enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
  6217. { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
  6218. enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
  6219. enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
  6220. { check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
  6221. require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
  6222. enabled libopus && {
  6223. enabled libopus_decoder && {
  6224. require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
  6225. }
  6226. enabled libopus_encoder && {
  6227. require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
  6228. }
  6229. }
  6230. enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
  6231. enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
  6232. enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
  6233. enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
  6234. enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create
  6235. enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_new_from_data
  6236. enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
  6237. enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
  6238. enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
  6239. enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
  6240. enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
  6241. require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
  6242. enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
  6243. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  6244. enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
  6245. enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
  6246. enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
  6247. enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle
  6248. enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
  6249. enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
  6250. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  6251. enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
  6252. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  6253. { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  6254. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  6255. enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode
  6256. enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
  6257. enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  6258. enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init
  6259. enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init
  6260. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  6261. enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
  6262. require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
  6263. enabled libvpx && {
  6264. enabled libvpx_vp8_decoder && {
  6265. check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
  6266. 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"
  6267. }
  6268. enabled libvpx_vp8_encoder && {
  6269. check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
  6270. 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"
  6271. }
  6272. enabled libvpx_vp9_decoder && {
  6273. check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
  6274. 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"
  6275. }
  6276. enabled libvpx_vp9_encoder && {
  6277. check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
  6278. 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"
  6279. }
  6280. if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
  6281. die "libvpx enabled but no supported decoders found"
  6282. fi
  6283. }
  6284. enabled libwebp && {
  6285. enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  6286. enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
  6287. enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
  6288. require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && {
  6289. [ "$toolchain" != "msvc" ] ||
  6290. require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
  6291. check_cpp_condition libx262 x264.h "X264_MPEG2"
  6292. enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
  6293. require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
  6294. enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
  6295. enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
  6296. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  6297. enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
  6298. enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
  6299. enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
  6300. { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
  6301. enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
  6302. enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
  6303. enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
  6304. check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
  6305. check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
  6306. die "ERROR: mbedTLS not found"; }
  6307. enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
  6308. enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  6309. { ! enabled cross_compile &&
  6310. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
  6311. add_ldflags -L/opt/vc/lib/ &&
  6312. check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
  6313. die "ERROR: mmal not found" &&
  6314. check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
  6315. enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" alGetError ||
  6316. { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  6317. check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
  6318. die "ERROR: openal not found"; } &&
  6319. { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  6320. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  6321. enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
  6322. check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  6323. check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  6324. die "ERROR: opencl not found"; } &&
  6325. { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  6326. test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  6327. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  6328. enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
  6329. check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  6330. check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  6331. check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  6332. die "ERROR: opengl not found."
  6333. }
  6334. enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
  6335. { ! enabled cross_compile &&
  6336. add_cflags -isystem/opt/vc/include/IL &&
  6337. test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
  6338. die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
  6339. enable omx
  6340. enabled omx && require_headers OMX_Core.h
  6341. enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
  6342. { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
  6343. { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
  6344. check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
  6345. check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
  6346. check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
  6347. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  6348. check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  6349. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  6350. die "ERROR: openssl not found"; }
  6351. enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
  6352. enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
  6353. require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
  6354. { enabled libdrm ||
  6355. die "ERROR: rkmpp requires --enable-libdrm"; }
  6356. }
  6357. enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
  6358. if enabled gcrypt; then
  6359. GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
  6360. if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
  6361. gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
  6362. gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
  6363. check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
  6364. die "ERROR: gcrypt not found"
  6365. add_cflags $gcrypt_cflags
  6366. else
  6367. require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
  6368. fi
  6369. fi
  6370. if enabled sdl2; then
  6371. SDL2_CONFIG="${cross_prefix}sdl2-config"
  6372. test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent
  6373. if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
  6374. sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
  6375. sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
  6376. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
  6377. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x030000" $sdl2_cflags &&
  6378. check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
  6379. enable sdl2
  6380. fi
  6381. if test $target_os = "mingw32"; then
  6382. sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
  6383. fi
  6384. fi
  6385. if enabled decklink; then
  6386. case $target_os in
  6387. mingw32*|mingw64*|win32|win64)
  6388. decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
  6389. decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
  6390. ;;
  6391. esac
  6392. fi
  6393. enabled securetransport &&
  6394. check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  6395. check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
  6396. disable securetransport
  6397. enabled securetransport &&
  6398. check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
  6399. enabled schannel &&
  6400. check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
  6401. test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
  6402. schannel_extralibs="-lsecur32" ||
  6403. disable schannel
  6404. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  6405. enabled makeinfo \
  6406. && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
  6407. && enable makeinfo_html || disable makeinfo_html
  6408. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  6409. perl -v > /dev/null 2>&1 && enable perl || disable perl
  6410. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  6411. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  6412. xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
  6413. # check V4L2 codecs available in the API
  6414. if enabled v4l2_m2m; then
  6415. check_headers linux/fb.h
  6416. check_headers linux/videodev2.h
  6417. test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  6418. check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
  6419. check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
  6420. check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
  6421. check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
  6422. check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
  6423. check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
  6424. check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
  6425. check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
  6426. check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
  6427. check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
  6428. fi
  6429. check_headers sys/videoio.h
  6430. test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  6431. check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
  6432. check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  6433. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  6434. # w32api 3.12 had it defined wrong
  6435. check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
  6436. check_type "dshow.h" IBaseFilter
  6437. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  6438. check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
  6439. check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
  6440. check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
  6441. check_headers "dev/ic/bt8xx.h"
  6442. if check_struct sys/soundcard.h audio_buf_info bytes; then
  6443. enable_sanitized sys/soundcard.h
  6444. else
  6445. test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
  6446. #include <sys/soundcard.h>
  6447. audio_buf_info abc;
  6448. EOF
  6449. fi
  6450. enabled alsa && { check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
  6451. check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound; }
  6452. enabled libjack &&
  6453. require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
  6454. enabled sndio && check_pkg_config sndio sndio sndio.h sio_open
  6455. if enabled libcdio; then
  6456. check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
  6457. check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
  6458. check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  6459. check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  6460. die "ERROR: No usable libcdio/cdparanoia found"
  6461. fi
  6462. enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
  6463. disable libxcb_shm libxcb_shape libxcb_xfixes
  6464. if enabled libxcb; then
  6465. enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
  6466. enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
  6467. enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
  6468. fi
  6469. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  6470. # d3d11va requires linking directly to dxgi and d3d11 if not building for
  6471. # the desktop api partition
  6472. test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
  6473. #ifdef WINAPI_FAMILY
  6474. #include <winapifamily.h>
  6475. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  6476. #error desktop, not uwp
  6477. #else
  6478. // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
  6479. #endif
  6480. #else
  6481. #error no family set
  6482. #endif
  6483. EOF
  6484. # vaapi_win32 requires linking directly to dxgi if not building for
  6485. # the desktop api partition
  6486. test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
  6487. #ifdef WINAPI_FAMILY
  6488. #include <winapifamily.h>
  6489. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  6490. #error desktop, not uwp
  6491. #else
  6492. // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
  6493. #endif
  6494. #else
  6495. #error no family set
  6496. #endif
  6497. EOF
  6498. # mediafoundation requires linking directly to mfplat if building for uwp target
  6499. enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
  6500. enabled libdrm &&
  6501. check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h" drmModeGetFB2
  6502. enabled vaapi &&
  6503. check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
  6504. if enabled vaapi; then
  6505. case $target_os in
  6506. mingw32*|mingw64*|win32|win64)
  6507. check_pkg_config vaapi_win32 "libva-win32" "va/va_win32.h" vaGetDisplayWin32
  6508. ;;
  6509. *)
  6510. check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
  6511. ;;
  6512. esac
  6513. if enabled xlib_x11; then
  6514. check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
  6515. fi
  6516. check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
  6517. check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
  6518. check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
  6519. check_struct "va/va.h" "VADecPictureParameterBufferAV1" bit_depth_idx
  6520. check_type "va/va.h va/va_vpp.h" "VAProcFilterParameterBufferHDRToneMapping"
  6521. check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
  6522. check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" blend_flags
  6523. check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
  6524. check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
  6525. check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
  6526. check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
  6527. check_type "va/va.h va/va_enc_av1.h" "VAEncPictureParameterBufferAV1"
  6528. fi
  6529. if enabled_all opencl libdrm ; then
  6530. check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
  6531. enable opencl_drm_beignet
  6532. check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
  6533. enable opencl_drm_arm
  6534. fi
  6535. if enabled_all opencl vaapi ; then
  6536. if enabled opencl_drm_beignet ; then
  6537. enable opencl_vaapi_beignet
  6538. else
  6539. check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
  6540. enable opencl_vaapi_intel_media
  6541. fi
  6542. fi
  6543. if enabled_all opencl dxva2 ; then
  6544. check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
  6545. enable opencl_dxva2
  6546. fi
  6547. if enabled_all opencl d3d11va ; then
  6548. check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
  6549. enable opencl_d3d11
  6550. fi
  6551. enabled vdpau &&
  6552. check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
  6553. enabled vdpau &&
  6554. check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
  6555. enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd && \
  6556. warn "CrystalHD support is deprecated and will be removed, please contact the developers if you are interested" \
  6557. "in maintaining it."
  6558. if enabled vulkan; then
  6559. check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
  6560. check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)"
  6561. fi
  6562. if disabled vulkan; then
  6563. disable libglslang libshaderc spirv_compiler
  6564. fi
  6565. if enabled x86; then
  6566. case $target_os in
  6567. freebsd|mingw32*|mingw64*|win32|win64|linux|cygwin*)
  6568. ;;
  6569. *)
  6570. disable ffnvcodec cuvid nvdec nvenc
  6571. ;;
  6572. esac
  6573. elif enabled_any aarch64 ppc64 && ! enabled bigendian; then
  6574. case $target_os in
  6575. linux)
  6576. ;;
  6577. *)
  6578. disable ffnvcodec cuvid nvdec nvenc
  6579. ;;
  6580. esac
  6581. else
  6582. disable ffnvcodec cuvid nvdec nvenc
  6583. fi
  6584. enabled ffnvcodec && enable cuda
  6585. enabled nvenc &&
  6586. test_cc -I$source_path <<EOF || disable nvenc
  6587. #include <ffnvcodec/nvEncodeAPI.h>
  6588. NV_ENCODE_API_FUNCTION_LIST flist;
  6589. void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_CODEC_H264_GUID } }; }
  6590. int main(void) { return 0; }
  6591. EOF
  6592. if enabled nvenc; then
  6593. check_type "ffnvcodec/nvEncodeAPI.h" "NV_ENC_PIC_PARAMS_AV1"
  6594. fi
  6595. if enabled_any nvdec cuvid; then
  6596. check_type "ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h" "CUVIDAV1PICPARAMS"
  6597. fi
  6598. enabled amf &&
  6599. check_cpp_condition amf "AMF/core/Version.h" \
  6600. "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x00010004001d0000"
  6601. # Funny iconv installations are not unusual, so check it after all flags have been set
  6602. if enabled libc_iconv; then
  6603. check_func_headers iconv.h iconv
  6604. elif enabled iconv; then
  6605. check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
  6606. fi
  6607. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  6608. # add some useful compiler flags if supported
  6609. check_cflags -Wdeclaration-after-statement
  6610. check_cflags -Wall
  6611. check_cflags -Wdisabled-optimization
  6612. check_cflags -Wpointer-arith
  6613. check_cflags -Wredundant-decls
  6614. check_cflags -Wwrite-strings
  6615. check_cflags -Wtype-limits
  6616. check_cflags -Wundef
  6617. check_cflags -Wmissing-prototypes
  6618. check_cflags -Wstrict-prototypes
  6619. check_cflags -Wempty-body
  6620. if enabled extra_warnings; then
  6621. check_cflags -Wcast-qual
  6622. check_cflags -Wextra
  6623. check_cflags -Wpedantic
  6624. fi
  6625. check_disable_warning(){
  6626. warning_flag=-W${1#-Wno-}
  6627. test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
  6628. }
  6629. test_cflags -Werror=unused-command-line-argument &&
  6630. append unknown_warning_flags "-Werror=unused-command-line-argument"
  6631. test_cflags -Werror=unknown-warning-option &&
  6632. append unknown_warning_flags "-Werror=unknown-warning-option"
  6633. check_disable_warning -Wno-parentheses
  6634. check_disable_warning -Wno-switch
  6635. check_disable_warning -Wno-format-zero-length
  6636. check_disable_warning -Wno-pointer-sign
  6637. check_disable_warning -Wno-unused-const-variable
  6638. check_disable_warning -Wno-bool-operation
  6639. check_disable_warning -Wno-char-subscripts
  6640. check_disable_warning_headers(){
  6641. warning_flag=-W${1#-Wno-}
  6642. test_cflags $warning_flag && add_cflags_headers $1
  6643. }
  6644. check_disable_warning_headers -Wno-deprecated-declarations
  6645. check_disable_warning_headers -Wno-unused-variable
  6646. test_cc <<EOF && enable blocks_extension
  6647. void (^block)(void);
  6648. EOF
  6649. # add some linker flags
  6650. check_ldflags -Wl,--warn-common
  6651. check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
  6652. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
  6653. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  6654. # add some strip flags
  6655. check_stripflags -x
  6656. enabled neon_clobber_test &&
  6657. check_ldflags -Wl,--wrap,avcodec_open2 \
  6658. -Wl,--wrap,avcodec_decode_subtitle2 \
  6659. -Wl,--wrap,avcodec_encode_subtitle \
  6660. -Wl,--wrap,avcodec_send_packet \
  6661. -Wl,--wrap,avcodec_receive_packet \
  6662. -Wl,--wrap,avcodec_send_frame \
  6663. -Wl,--wrap,avcodec_receive_frame \
  6664. -Wl,--wrap,swr_convert ||
  6665. disable neon_clobber_test
  6666. enabled xmm_clobber_test &&
  6667. check_ldflags -Wl,--wrap,avcodec_open2 \
  6668. -Wl,--wrap,avcodec_decode_subtitle2 \
  6669. -Wl,--wrap,avcodec_encode_subtitle \
  6670. -Wl,--wrap,avcodec_send_packet \
  6671. -Wl,--wrap,avcodec_receive_packet \
  6672. -Wl,--wrap,avcodec_send_frame \
  6673. -Wl,--wrap,avcodec_receive_frame \
  6674. -Wl,--wrap,swr_convert \
  6675. -Wl,--wrap,sws_scale ||
  6676. disable xmm_clobber_test
  6677. check_ld "cc" proper_dce <<EOF
  6678. extern const int array[512];
  6679. static inline int func(void) { return array[0]; }
  6680. int main(void) { return 0; }
  6681. EOF
  6682. if enabled proper_dce; then
  6683. echo "X { local: *; };" > $TMPV
  6684. if test_ldflags -Wl,${version_script},$TMPV; then
  6685. append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
  6686. quotes='""'
  6687. test_cc <<EOF && enable symver_asm_label
  6688. void ff_foo(void) __asm__ ("av_foo@VERSION");
  6689. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  6690. EOF
  6691. test_cc <<EOF && enable symver_gnu_asm
  6692. __asm__(".symver ff_foo,av_foo@VERSION");
  6693. void ff_foo(void) {}
  6694. EOF
  6695. fi
  6696. fi
  6697. if [ -z "$optflags" ]; then
  6698. if enabled small; then
  6699. optflags=$cflags_size
  6700. elif enabled optimizations; then
  6701. optflags=$cflags_speed
  6702. else
  6703. optflags=$cflags_noopt
  6704. fi
  6705. fi
  6706. check_optflags(){
  6707. check_cflags "$@"
  6708. [ -n "$lto" ] && check_ldflags "$@"
  6709. }
  6710. check_optflags $optflags
  6711. check_optflags -fno-math-errno
  6712. check_optflags -fno-signed-zeros
  6713. if [ -n "$lto" ]; then
  6714. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  6715. check_cflags $lto
  6716. check_ldflags $lto $cpuflags
  6717. disable inline_asm_direct_symbol_refs
  6718. fi
  6719. enabled ftrapv && check_cflags -ftrapv
  6720. test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  6721. int x;
  6722. EOF
  6723. if enabled icc; then
  6724. # Just warnings, no remarks
  6725. check_cflags -w1
  6726. # -wd: Disable following warnings
  6727. # 144, 167, 556: -Wno-pointer-sign
  6728. # 188: enumerated type mixed with another type
  6729. # 1292: attribute "foo" ignored
  6730. # 1419: external declaration in primary source file
  6731. # 10006: ignoring unknown option -fno-signed-zeros
  6732. # 10148: ignoring unknown option -Wno-parentheses
  6733. # 10156: ignoring option '-W'; no argument required
  6734. # 13200: No EMMS instruction before call to function
  6735. # 13203: No EMMS instruction before return from function
  6736. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  6737. # 11030: Warning unknown option --as-needed
  6738. # 10156: ignoring option '-export'; no argument required
  6739. check_ldflags -wd10156,11030
  6740. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  6741. enable ebp_available
  6742. # The test above does not test linking
  6743. [ -n "$lto" ] && disable symver_asm_label
  6744. if enabled x86_32; then
  6745. icc_version=$($cc -dumpversion)
  6746. test ${icc_version%%.*} -ge 11 &&
  6747. check_cflags -falign-stack=maintain-16-byte ||
  6748. disable aligned_stack
  6749. fi
  6750. elif enabled gcc; then
  6751. check_optflags -fno-tree-vectorize
  6752. check_cflags -Werror=format-security
  6753. check_cflags -Werror=implicit-function-declaration
  6754. check_cflags -Werror=missing-prototypes
  6755. check_cflags -Werror=return-type
  6756. check_cflags -Werror=vla
  6757. check_cflags -Wformat
  6758. check_cflags -fdiagnostics-color=auto
  6759. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  6760. if enabled x86_32; then
  6761. case $target_os in
  6762. *bsd*)
  6763. # BSDs don't guarantee a 16 byte aligned stack, but we can
  6764. # request GCC to try to maintain 16 byte alignment throughout
  6765. # function calls. Library entry points that might call assembly
  6766. # functions align the stack. (The parameter means 2^4 bytes.)
  6767. check_cflags -mpreferred-stack-boundary=4
  6768. ;;
  6769. esac
  6770. fi
  6771. elif enabled llvm_gcc; then
  6772. check_cflags -mllvm -stack-alignment=16
  6773. elif enabled clang; then
  6774. if enabled x86_32; then
  6775. # Clang doesn't support maintaining alignment without assuming the
  6776. # same alignment in every function. If 16 byte alignment would be
  6777. # enabled, one would also have to either add attribute_align_arg on
  6778. # every single entry point into the libraries or enable -mstackrealign
  6779. # (doing stack realignment in every single function).
  6780. case $target_os in
  6781. mingw32|win32|*bsd*)
  6782. disable aligned_stack
  6783. ;;
  6784. *)
  6785. check_cflags -mllvm -stack-alignment=16
  6786. check_cflags -mstack-alignment=16
  6787. ;;
  6788. esac
  6789. else
  6790. check_cflags -mllvm -stack-alignment=16
  6791. check_cflags -mstack-alignment=16
  6792. fi
  6793. check_cflags -Qunused-arguments
  6794. check_cflags -Werror=implicit-function-declaration
  6795. check_cflags -Werror=missing-prototypes
  6796. check_cflags -Werror=return-type
  6797. elif enabled cparser; then
  6798. add_cflags -Wno-missing-variable-declarations
  6799. add_cflags -Wno-empty-statement
  6800. elif enabled armcc; then
  6801. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  6802. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  6803. # 2523: use of inline assembly is deprecated
  6804. add_cflags -W${armcc_opt},--diag_suppress=2523
  6805. add_cflags -W${armcc_opt},--diag_suppress=1207
  6806. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  6807. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  6808. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  6809. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  6810. elif enabled pathscale; then
  6811. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  6812. disable inline_asm
  6813. elif enabled_any msvc icl; then
  6814. enabled x86_32 && disable aligned_stack
  6815. enabled_all x86_32 debug && add_cflags -Oy-
  6816. enabled debug && add_ldflags -debug
  6817. enable pragma_deprecated
  6818. if enabled icl; then
  6819. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  6820. # (correctly) on icl 13.x.
  6821. test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  6822. add_cflags -Qansi-alias
  6823. # Some inline asm is not compilable in debug
  6824. if enabled debug; then
  6825. disable ebp_available
  6826. disable ebx_available
  6827. fi
  6828. fi
  6829. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  6830. check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
  6831. # The CRT headers contain __declspec(restrict) in a few places, but if redefining
  6832. # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
  6833. # (as it ends up if the restrict redefine is done before including stdlib.h), while
  6834. # MSVC 2013 and newer can handle it fine.
  6835. # If this declspec fails, force including stdlib.h before the restrict redefinition
  6836. # happens in config.h.
  6837. if [ $restrict_keyword != restrict ]; then
  6838. test_cc <<EOF || add_cflags -FIstdlib.h
  6839. __declspec($restrict_keyword) void *foo(int);
  6840. EOF
  6841. fi
  6842. # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
  6843. # Issue has been fixed in MSVC v19.00.24218.
  6844. test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
  6845. check_cflags -d2SSAOptimizer-
  6846. # enable utf-8 source processing on VS2015 U2 and newer
  6847. test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
  6848. add_cflags -utf-8
  6849. fi
  6850. for pfx in "" host_; do
  6851. varname=${pfx%_}cc_type
  6852. eval "type=\$$varname"
  6853. if [ "$type" = "msvc" ]; then
  6854. test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  6855. static inline int foo(int a) { return a; }
  6856. EOF
  6857. fi
  6858. done
  6859. case $as_type in
  6860. clang)
  6861. add_asflags -Qunused-arguments
  6862. ;;
  6863. esac
  6864. case $ld_type in
  6865. clang)
  6866. check_ldflags -Qunused-arguments
  6867. ;;
  6868. esac
  6869. enable frame_thread_encoder
  6870. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  6871. check_deps $CONFIG_LIST \
  6872. $CONFIG_EXTRA \
  6873. $HAVE_LIST \
  6874. $ALL_COMPONENTS \
  6875. 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"
  6876. case $target_os in
  6877. haiku)
  6878. disable memalign
  6879. disable posix_memalign
  6880. ;;
  6881. *-dos|freedos|opendos)
  6882. if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
  6883. disable memalign
  6884. fi
  6885. ;;
  6886. esac
  6887. flatten_extralibs(){
  6888. nested_entries=
  6889. list_name=$1
  6890. eval list=\$${1}
  6891. for entry in $list; do
  6892. entry_copy=$entry
  6893. resolve entry_copy
  6894. flat_entries=
  6895. for e in $entry_copy; do
  6896. case $e in
  6897. *_extralibs) nested_entries="$nested_entries$e ";;
  6898. *) flat_entries="$flat_entries$e ";;
  6899. esac
  6900. done
  6901. eval $entry="\$flat_entries"
  6902. done
  6903. append $list_name "$nested_entries"
  6904. resolve nested_entries
  6905. if test -n "$(filter '*_extralibs' $nested_entries)"; then
  6906. flatten_extralibs $list_name
  6907. fi
  6908. }
  6909. flatten_extralibs_wrapper(){
  6910. list_name=$1
  6911. flatten_extralibs $list_name
  6912. unique $list_name
  6913. resolve $list_name
  6914. eval $list_name=\$\(\$ldflags_filter \$$list_name\)
  6915. eval printf \''%s'\' \""\$$list_name"\"
  6916. }
  6917. for linkunit in $LIBRARY_LIST; do
  6918. unset current_extralibs
  6919. eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
  6920. for comp in ${components}; do
  6921. enabled $comp || continue
  6922. comp_extralibs="${comp}_extralibs"
  6923. append current_extralibs $comp_extralibs
  6924. done
  6925. eval prepend ${linkunit}_extralibs $current_extralibs
  6926. done
  6927. for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  6928. eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
  6929. done
  6930. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  6931. for thread in $THREADS_LIST; do
  6932. if enabled $thread; then
  6933. test -n "$thread_type" &&
  6934. die "ERROR: Only one thread type must be selected." ||
  6935. thread_type="$thread"
  6936. fi
  6937. done
  6938. if disabled stdatomic; then
  6939. if enabled atomics_gcc; then
  6940. add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
  6941. elif enabled atomics_win32; then
  6942. add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
  6943. elif enabled atomics_suncc; then
  6944. add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
  6945. elif enabled pthreads; then
  6946. add_compat atomics/pthread/stdatomic.o
  6947. add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
  6948. else
  6949. enabled threads && die "Threading is enabled, but no atomics are available"
  6950. add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
  6951. fi
  6952. fi
  6953. # Check if requested libraries were found.
  6954. for lib in $AUTODETECT_LIBS; do
  6955. requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
  6956. done
  6957. enabled zlib && add_cppflags -DZLIB_CONST
  6958. # conditional library dependencies, in any order
  6959. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  6960. enabled aresample_filter && prepend avfilter_deps "swresample"
  6961. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  6962. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  6963. enabled elbg_filter && prepend avfilter_deps "avcodec"
  6964. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  6965. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  6966. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  6967. enabled pan_filter && prepend avfilter_deps "swresample"
  6968. enabled pp_filter && prepend avfilter_deps "postproc"
  6969. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  6970. enabled sab_filter && prepend avfilter_deps "swscale"
  6971. enabled scale_filter && prepend avfilter_deps "swscale"
  6972. enabled scale2ref_filter && prepend avfilter_deps "swscale"
  6973. enabled showcqt_filter && prepend avfilter_deps "avformat swscale"
  6974. enabled signature_filter && prepend avfilter_deps "avcodec avformat"
  6975. enabled smartblur_filter && prepend avfilter_deps "swscale"
  6976. enabled spp_filter && prepend avfilter_deps "avcodec"
  6977. enabled sr_filter && prepend avfilter_deps "avformat swscale"
  6978. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  6979. enabled uspp_filter && prepend avfilter_deps "avcodec"
  6980. enabled zoompan_filter && prepend avfilter_deps "swscale"
  6981. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  6982. #FIXME
  6983. enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
  6984. add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
  6985. enabled opus_decoder && prepend avcodec_deps "swresample"
  6986. # reorder the items at var $1 to align with the items order at var $2 .
  6987. # die if an item at $1 is not at $2 .
  6988. reorder_by(){
  6989. eval rb_in=\$$1
  6990. eval rb_ordered=\$$2
  6991. for rb in $rb_in; do
  6992. is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
  6993. done
  6994. rb_out=
  6995. for rb in $rb_ordered; do
  6996. is_in $rb $rb_in && rb_out="$rb_out$rb "
  6997. done
  6998. eval $1=\$rb_out
  6999. }
  7000. # deps-expand fflib $1: N x {append all expanded deps; unique}
  7001. # within a set of N items, N expansions are enough to expose a cycle.
  7002. expand_deps(){
  7003. unique ${1}_deps # required for the early break test.
  7004. for dummy in $LIBRARY_LIST; do # N iteratios
  7005. eval deps=\$${1}_deps
  7006. append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
  7007. unique ${1}_deps
  7008. eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
  7009. done
  7010. eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
  7011. reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
  7012. }
  7013. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  7014. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  7015. map 'expand_deps $v' $LIBRARY_LIST
  7016. if test "$quiet" != "yes"; then
  7017. echo "install prefix $prefix"
  7018. echo "source path $source_path"
  7019. echo "C compiler $cc"
  7020. echo "C library $libc_type"
  7021. if test "$host_cc" != "$cc"; then
  7022. echo "host C compiler $host_cc"
  7023. echo "host C library $host_libc_type"
  7024. fi
  7025. echo "ARCH $arch ($cpu)"
  7026. if test "$build_suffix" != ""; then
  7027. echo "build suffix $build_suffix"
  7028. fi
  7029. if test "$progs_suffix" != ""; then
  7030. echo "progs suffix $progs_suffix"
  7031. fi
  7032. if test "$extra_version" != ""; then
  7033. echo "version string suffix $extra_version"
  7034. fi
  7035. echo "big-endian ${bigendian-no}"
  7036. echo "runtime cpu detection ${runtime_cpudetect-no}"
  7037. if enabled x86; then
  7038. echo "standalone assembly ${x86asm-no}"
  7039. echo "x86 assembler ${x86asmexe}"
  7040. echo "MMX enabled ${mmx-no}"
  7041. echo "MMXEXT enabled ${mmxext-no}"
  7042. echo "3DNow! enabled ${amd3dnow-no}"
  7043. echo "3DNow! extended enabled ${amd3dnowext-no}"
  7044. echo "SSE enabled ${sse-no}"
  7045. echo "SSSE3 enabled ${ssse3-no}"
  7046. echo "AESNI enabled ${aesni-no}"
  7047. echo "AVX enabled ${avx-no}"
  7048. echo "AVX2 enabled ${avx2-no}"
  7049. echo "AVX-512 enabled ${avx512-no}"
  7050. echo "AVX-512ICL enabled ${avx512icl-no}"
  7051. echo "XOP enabled ${xop-no}"
  7052. echo "FMA3 enabled ${fma3-no}"
  7053. echo "FMA4 enabled ${fma4-no}"
  7054. echo "i686 features enabled ${i686-no}"
  7055. echo "CMOV is fast ${fast_cmov-no}"
  7056. echo "EBX available ${ebx_available-no}"
  7057. echo "EBP available ${ebp_available-no}"
  7058. fi
  7059. if enabled aarch64; then
  7060. echo "NEON enabled ${neon-no}"
  7061. echo "DOTPROD enabled ${dotprod-no}"
  7062. echo "I8MM enabled ${i8mm-no}"
  7063. fi
  7064. if enabled arm; then
  7065. echo "ARMv5TE enabled ${armv5te-no}"
  7066. echo "ARMv6 enabled ${armv6-no}"
  7067. echo "ARMv6T2 enabled ${armv6t2-no}"
  7068. echo "VFP enabled ${vfp-no}"
  7069. echo "NEON enabled ${neon-no}"
  7070. echo "THUMB enabled ${thumb-no}"
  7071. fi
  7072. if enabled mips; then
  7073. echo "MIPS FPU enabled ${mipsfpu-no}"
  7074. echo "MIPS DSP R1 enabled ${mipsdsp-no}"
  7075. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  7076. echo "MIPS MSA enabled ${msa-no}"
  7077. echo "LOONGSON MMI enabled ${mmi-no}"
  7078. fi
  7079. if enabled ppc; then
  7080. echo "AltiVec enabled ${altivec-no}"
  7081. echo "VSX enabled ${vsx-no}"
  7082. echo "POWER8 enabled ${power8-no}"
  7083. echo "PPC 4xx optimizations ${ppc4xx-no}"
  7084. echo "dcbzl available ${dcbzl-no}"
  7085. fi
  7086. if enabled loongarch; then
  7087. echo "LSX enabled ${lsx-no}"
  7088. echo "LASX enabled ${lasx-no}"
  7089. fi
  7090. if enabled riscv; then
  7091. echo "RISC-V Vector enabled ${rvv-no}"
  7092. fi
  7093. echo "debug symbols ${debug-no}"
  7094. echo "strip symbols ${stripping-no}"
  7095. echo "optimize for size ${small-no}"
  7096. echo "optimizations ${optimizations-no}"
  7097. echo "static ${static-no}"
  7098. echo "shared ${shared-no}"
  7099. echo "postprocessing support ${postproc-no}"
  7100. echo "network support ${network-no}"
  7101. echo "threading support ${thread_type-no}"
  7102. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  7103. echo "texi2html enabled ${texi2html-no}"
  7104. echo "perl enabled ${perl-no}"
  7105. echo "pod2man enabled ${pod2man-no}"
  7106. echo "makeinfo enabled ${makeinfo-no}"
  7107. echo "makeinfo supports HTML ${makeinfo_html-no}"
  7108. echo "xmllint enabled ${xmllint-no}"
  7109. test -n "$random_seed" &&
  7110. echo "random seed ${random_seed}"
  7111. echo
  7112. echo "External libraries:"
  7113. print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
  7114. echo
  7115. echo "External libraries providing hardware acceleration:"
  7116. print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
  7117. echo
  7118. echo "Libraries:"
  7119. print_enabled '' $LIBRARY_LIST | print_in_columns
  7120. echo
  7121. echo "Programs:"
  7122. print_enabled '' $PROGRAM_LIST | print_in_columns
  7123. echo
  7124. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  7125. echo "Enabled ${type}s:"
  7126. eval list=\$$(toupper $type)_LIST
  7127. print_enabled '_*' $list | print_in_columns
  7128. echo
  7129. done
  7130. if test -n "$ignore_tests"; then
  7131. ignore_tests=$(echo $ignore_tests | tr ',' ' ')
  7132. echo "Ignored FATE tests:"
  7133. echo $ignore_tests | print_in_columns
  7134. echo
  7135. fi
  7136. echo "License: $license"
  7137. fi # test "$quiet" != "yes"
  7138. if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
  7139. for cfg in $WARN_IF_GETS_DISABLED_LIST; do
  7140. if disabled $cfg; then
  7141. varname=${cfg}_disable_reason
  7142. eval "warn \"Disabled $cfg because \$$varname\""
  7143. fi
  7144. done
  7145. fi
  7146. if test -n "$WARNINGS"; then
  7147. printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
  7148. enabled fatal_warnings && exit 1
  7149. fi
  7150. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  7151. esc(){
  7152. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  7153. }
  7154. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
  7155. enabled stripping || strip="echo skipping strip"
  7156. enabled stripping || striptype=""
  7157. config_files="$TMPH ffbuild/config.mak doc/config.texi"
  7158. cat > ffbuild/config.mak <<EOF
  7159. # Automatically generated by configure - do not modify!
  7160. ifndef FFMPEG_CONFIG_MAK
  7161. FFMPEG_CONFIG_MAK=1
  7162. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  7163. prefix=$prefix
  7164. LIBDIR=\$(DESTDIR)$libdir
  7165. SHLIBDIR=\$(DESTDIR)$shlibdir
  7166. INCDIR=\$(DESTDIR)$incdir
  7167. BINDIR=\$(DESTDIR)$bindir
  7168. DATADIR=\$(DESTDIR)$datadir
  7169. DOCDIR=\$(DESTDIR)$docdir
  7170. MANDIR=\$(DESTDIR)$mandir
  7171. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  7172. INSTALL_NAME_DIR=$install_name_dir
  7173. SRC_PATH=$source_path
  7174. SRC_LINK=$source_link
  7175. ifndef MAIN_MAKEFILE
  7176. SRC_PATH:=\$(SRC_PATH:.%=..%)
  7177. endif
  7178. CC_IDENT=$cc_ident
  7179. ARCH=$arch
  7180. INTRINSICS=$intrinsics
  7181. EXTERN_PREFIX=$extern_prefix
  7182. CC=$cc
  7183. CXX=$cxx
  7184. AS=$as
  7185. OBJCC=$objcc
  7186. LD=$ld
  7187. DEPCC=$dep_cc
  7188. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  7189. DEPAS=$as
  7190. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  7191. X86ASM=$x86asmexe
  7192. DEPX86ASM=$x86asmexe
  7193. DEPX86ASMFLAGS=\$(X86ASMFLAGS)
  7194. AR=$ar
  7195. ARFLAGS=$arflags
  7196. AR_O=$ar_o
  7197. AR_CMD=$ar
  7198. NM_CMD=$nm
  7199. METALCC=$metalcc
  7200. METALLIB=$metallib
  7201. RANLIB=$ranlib
  7202. STRIP=$strip
  7203. STRIPTYPE=$striptype
  7204. NVCC=$nvcc
  7205. CP=cp -p
  7206. LN_S=$ln_s
  7207. CPPFLAGS=$CPPFLAGS
  7208. CFLAGS=$CFLAGS
  7209. CXXFLAGS=$CXXFLAGS
  7210. OBJCCFLAGS=$OBJCFLAGS
  7211. ASFLAGS=$ASFLAGS
  7212. NVCCFLAGS=$nvccflags
  7213. AS_C=$AS_C
  7214. AS_O=$AS_O
  7215. OBJCC_C=$OBJCC_C
  7216. OBJCC_E=$OBJCC_E
  7217. OBJCC_O=$OBJCC_O
  7218. CC_C=$CC_C
  7219. CC_E=$CC_E
  7220. CC_O=$CC_O
  7221. CXX_C=$CXX_C
  7222. CXX_O=$CXX_O
  7223. NVCC_C=$NVCC_C
  7224. NVCC_O=$NVCC_O
  7225. LD_O=$LD_O
  7226. X86ASM_O=$X86ASM_O
  7227. LD_LIB=$LD_LIB
  7228. LD_PATH=$LD_PATH
  7229. DLLTOOL=$dlltool
  7230. WINDRES=$windres
  7231. DOXYGEN=$doxygen
  7232. LDFLAGS=$LDFLAGS
  7233. LDEXEFLAGS=$LDEXEFLAGS
  7234. LDSOFLAGS=$LDSOFLAGS
  7235. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  7236. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  7237. X86ASMFLAGS=$X86ASMFLAGS
  7238. MSAFLAGS=$MSAFLAGS
  7239. MMIFLAGS=$MMIFLAGS
  7240. LSXFLAGS=$LSXFLAGS
  7241. LASXFLAGS=$LASXFLAGS
  7242. BUILDSUF=$build_suffix
  7243. PROGSSUF=$progs_suffix
  7244. FULLNAME=$FULLNAME
  7245. LIBPREF=$LIBPREF
  7246. LIBSUF=$LIBSUF
  7247. LIBNAME=$LIBNAME
  7248. SLIBPREF=$SLIBPREF
  7249. SLIBSUF=$SLIBSUF
  7250. EXESUF=$EXESUF
  7251. EXTRA_VERSION=$extra_version
  7252. CCDEP=$CCDEP
  7253. CXXDEP=$CXXDEP
  7254. CCDEP_FLAGS=$CCDEP_FLAGS
  7255. ASDEP=$ASDEP
  7256. ASDEP_FLAGS=$ASDEP_FLAGS
  7257. X86ASMDEP=$X86ASMDEP
  7258. X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
  7259. CC_DEPFLAGS=$CC_DEPFLAGS
  7260. CXX_DEPFLAGS=$CXX_DEPFLAGS
  7261. OBJCC_DEPFLAGS=$OBJC_DEPFLAGS
  7262. AS_DEPFLAGS=$AS_DEPFLAGS
  7263. X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
  7264. HOSTCC=$host_cc
  7265. HOSTLD=$host_ld
  7266. HOSTCFLAGS=$host_cflags
  7267. HOSTCPPFLAGS=$host_cppflags
  7268. HOSTEXESUF=$HOSTEXESUF
  7269. HOSTLDFLAGS=$host_ldflags
  7270. HOSTEXTRALIBS=$host_extralibs
  7271. DEPHOSTCC=$host_cc
  7272. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  7273. HOSTCCDEP=$HOSTCCDEP
  7274. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  7275. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  7276. HOSTCC_C=$HOSTCC_C
  7277. HOSTCC_O=$HOSTCC_O
  7278. HOSTLD_O=$HOSTLD_O
  7279. TARGET_EXEC=$target_exec $target_exec_args
  7280. TARGET_PATH=$target_path
  7281. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  7282. CFLAGS-ffplay=${sdl2_cflags}
  7283. CFLAGS_HEADERS=$CFLAGS_HEADERS
  7284. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  7285. EXTRALIBS=$extralibs
  7286. COMPAT_OBJS=$compat_objs
  7287. INSTALL=$install
  7288. LIBTARGET=${LIBTARGET}
  7289. SLIBNAME=${SLIBNAME}
  7290. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  7291. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  7292. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  7293. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  7294. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  7295. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  7296. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  7297. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  7298. VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
  7299. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  7300. NOREDZONE_FLAGS=$noredzone_flags
  7301. LIBFUZZER_PATH=$libfuzzer_path
  7302. IGNORE_TESTS=$ignore_tests
  7303. EOF
  7304. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
  7305. for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  7306. eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
  7307. done
  7308. cat > $TMPH <<EOF
  7309. /* Automatically generated by configure - do not modify! */
  7310. #ifndef FFMPEG_CONFIG_H
  7311. #define FFMPEG_CONFIG_H
  7312. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  7313. #define FFMPEG_LICENSE "$(c_escape $license)"
  7314. #define CONFIG_THIS_YEAR 2023
  7315. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  7316. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  7317. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  7318. #define OS_NAME $target_os
  7319. #define av_restrict $restrict_keyword
  7320. #define EXTERN_PREFIX "${extern_prefix}"
  7321. #define EXTERN_ASM ${extern_prefix}
  7322. #define BUILDSUF "$build_suffix"
  7323. #define SLIBSUF "$SLIBSUF"
  7324. #define HAVE_MMX2 HAVE_MMXEXT
  7325. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  7326. EOF
  7327. test -n "$assert_level" &&
  7328. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  7329. test -n "$malloc_prefix" &&
  7330. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  7331. enabled aarch64 &&
  7332. echo "#define AS_ARCH_LEVEL $as_arch_level" >>$TMPH
  7333. if enabled x86asm; then
  7334. append config_files $TMPASM
  7335. cat > $TMPASM <<EOF
  7336. ; Automatically generated by configure - do not modify!
  7337. EOF
  7338. fi
  7339. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  7340. mkdir -p doc
  7341. mkdir -p tests
  7342. mkdir -p tests/api
  7343. echo "@c auto-generated by configure - do not modify! " > doc/config.texi
  7344. print_config ARCH_ "$config_files" $ARCH_LIST
  7345. print_config HAVE_ "$config_files" $HAVE_LIST
  7346. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  7347. $CONFIG_EXTRA \
  7348. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  7349. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  7350. cp_if_changed $TMPH config.h
  7351. touch ffbuild/.config
  7352. # Copy config.asm before printing ALL_COMPONENTS; that's not needed in assembly.
  7353. enabled x86asm && cp_if_changed $TMPASM config.asm
  7354. # Reopen a new TMPH for config_components.h.
  7355. cat > $TMPH <<EOF
  7356. /* Automatically generated by configure - do not modify! */
  7357. #ifndef FFMPEG_CONFIG_COMPONENTS_H
  7358. #define FFMPEG_CONFIG_COMPONENTS_H
  7359. EOF
  7360. print_config CONFIG_ "$config_files" $ALL_COMPONENTS
  7361. echo "#endif /* FFMPEG_CONFIG_COMPONENTS_H */" >> $TMPH
  7362. echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
  7363. cp_if_changed $TMPH config_components.h
  7364. cat > $TMPH <<EOF
  7365. /* Generated by ffmpeg configure */
  7366. #ifndef AVUTIL_AVCONFIG_H
  7367. #define AVUTIL_AVCONFIG_H
  7368. EOF
  7369. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  7370. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  7371. cp_if_changed $TMPH libavutil/avconfig.h
  7372. # full_filter_name_foo=vf_foo
  7373. # full_filter_name_bar=asrc_bar
  7374. # ...
  7375. eval "$(sed -n "s/^extern const AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
  7376. # generate the lists of enabled components
  7377. print_enabled_components(){
  7378. file=$1
  7379. struct_name=$2
  7380. name=$3
  7381. shift 3
  7382. echo "static const $struct_name * const $name[] = {" > $TMPH
  7383. for c in $*; do
  7384. if enabled $c; then
  7385. case $name in
  7386. filter_list)
  7387. eval c=\$full_filter_name_${c%_filter}
  7388. ;;
  7389. indev_list)
  7390. c=${c%_indev}_demuxer
  7391. ;;
  7392. outdev_list)
  7393. c=${c%_outdev}_muxer
  7394. ;;
  7395. esac
  7396. printf " &ff_%s,\n" $c >> $TMPH
  7397. fi
  7398. done
  7399. if [ "$name" = "filter_list" ]; then
  7400. for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
  7401. printf " &ff_%s,\n" $c >> $TMPH
  7402. done
  7403. fi
  7404. echo " NULL };" >> $TMPH
  7405. cp_if_changed $TMPH $file
  7406. }
  7407. print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
  7408. print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
  7409. print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
  7410. print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
  7411. print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
  7412. print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
  7413. print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
  7414. print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
  7415. print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
  7416. # Settings for pkg-config files
  7417. cat > $TMPH <<EOF
  7418. # Automatically generated by configure - do not modify!
  7419. shared=$shared
  7420. build_suffix=$build_suffix
  7421. prefix=$prefix
  7422. libdir=$libdir
  7423. incdir=$incdir
  7424. rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
  7425. source_path=${source_path}
  7426. LIBPREF=${LIBPREF}
  7427. LIBSUF=${LIBSUF}
  7428. extralibs_avutil="$avutil_extralibs"
  7429. extralibs_avcodec="$avcodec_extralibs"
  7430. extralibs_avformat="$avformat_extralibs"
  7431. extralibs_avdevice="$avdevice_extralibs"
  7432. extralibs_avfilter="$avfilter_extralibs"
  7433. extralibs_postproc="$postproc_extralibs"
  7434. extralibs_swscale="$swscale_extralibs"
  7435. extralibs_swresample="$swresample_extralibs"
  7436. EOF
  7437. for lib in $LIBRARY_LIST; do
  7438. lib_deps="$(eval echo \$${lib}_deps)"
  7439. echo ${lib}_deps=\"$lib_deps\" >> $TMPH
  7440. done
  7441. cp_if_changed $TMPH ffbuild/config.sh