configure 220 KB

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