configure 221 KB

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