configure 177 KB

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