configure 265 KB

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