configure 176 KB

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