configure 266 KB

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