configure 246 KB

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