configure 191 KB

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