configure 124 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144
  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. show_help(){
  51. cat <<EOF
  52. Usage: configure [options]
  53. Options: [defaults in brackets after descriptions]
  54. Help options:
  55. --help print this message
  56. --list-decoders show all available decoders
  57. --list-encoders show all available encoders
  58. --list-hwaccels show all available hardware accelerators
  59. --list-demuxers show all available demuxers
  60. --list-muxers show all available muxers
  61. --list-parsers show all available parsers
  62. --list-protocols show all available protocols
  63. --list-bsfs show all available bitstream filters
  64. --list-indevs show all available input devices
  65. --list-outdevs show all available output devices
  66. --list-filters show all available filters
  67. Standard options:
  68. --logfile=FILE log tests and output to FILE [config.log]
  69. --disable-logging do not log configure debug information
  70. --prefix=PREFIX install in PREFIX [$prefix]
  71. --bindir=DIR install binaries in DIR [PREFIX/bin]
  72. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  73. --libdir=DIR install libs in DIR [PREFIX/lib]
  74. --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
  75. --incdir=DIR install includes in DIR [PREFIX/include]
  76. --mandir=DIR install man page in DIR [PREFIX/share/man]
  77. Licensing options:
  78. --enable-gpl allow use of GPL code, the resulting libs
  79. and binaries will be under GPL [no]
  80. --enable-version3 upgrade (L)GPL to version 3 [no]
  81. --enable-nonfree allow use of nonfree code, the resulting libs
  82. and binaries will be unredistributable [no]
  83. Configuration options:
  84. --disable-static do not build static libraries [no]
  85. --enable-shared build shared libraries [no]
  86. --enable-small optimize for size instead of speed
  87. --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
  88. --enable-gray enable full grayscale support (slower color)
  89. --disable-swscale-alpha disable alpha channel support in swscale
  90. Component options:
  91. --disable-doc do not build documentation
  92. --disable-ffmpeg disable ffmpeg build
  93. --disable-ffplay disable ffplay build
  94. --disable-ffprobe disable ffprobe build
  95. --disable-ffserver disable ffserver build
  96. --disable-avdevice disable libavdevice build
  97. --disable-avcodec disable libavcodec build
  98. --disable-avformat disable libavformat build
  99. --disable-swresample disable libswresample build
  100. --disable-swscale disable libswscale build
  101. --disable-postproc disable libpostproc build
  102. --disable-avfilter disable libavfilter build
  103. --enable-avresample enable libavresample build [no]
  104. --disable-pthreads disable pthreads [auto]
  105. --disable-w32threads disable Win32 threads [auto]
  106. --disable-os2threads disable OS/2 threads [auto]
  107. --enable-x11grab enable X11 grabbing [no]
  108. --disable-network disable network support [no]
  109. --disable-dct disable DCT code
  110. --disable-dwt disable DWT code
  111. --disable-lsp disable LSP code
  112. --disable-mdct disable MDCT code
  113. --disable-rdft disable RDFT code
  114. --disable-fft disable FFT code
  115. --enable-dxva2 enable DXVA2 code
  116. --enable-vaapi enable VAAPI code [autodetect]
  117. --enable-vda enable VDA code [autodetect]
  118. --enable-vdpau enable VDPAU code [autodetect]
  119. Individual component options:
  120. --disable-everything disable all components listed below
  121. --disable-encoder=NAME disable encoder NAME
  122. --enable-encoder=NAME enable encoder NAME
  123. --disable-encoders disable all encoders
  124. --disable-decoder=NAME disable decoder NAME
  125. --enable-decoder=NAME enable decoder NAME
  126. --disable-decoders disable all decoders
  127. --disable-hwaccel=NAME disable hwaccel NAME
  128. --enable-hwaccel=NAME enable hwaccel NAME
  129. --disable-hwaccels disable all hwaccels
  130. --disable-muxer=NAME disable muxer NAME
  131. --enable-muxer=NAME enable muxer NAME
  132. --disable-muxers disable all muxers
  133. --disable-demuxer=NAME disable demuxer NAME
  134. --enable-demuxer=NAME enable demuxer NAME
  135. --disable-demuxers disable all demuxers
  136. --enable-parser=NAME enable parser NAME
  137. --disable-parser=NAME disable parser NAME
  138. --disable-parsers disable all parsers
  139. --enable-bsf=NAME enable bitstream filter NAME
  140. --disable-bsf=NAME disable bitstream filter NAME
  141. --disable-bsfs disable all bitstream filters
  142. --enable-protocol=NAME enable protocol NAME
  143. --disable-protocol=NAME disable protocol NAME
  144. --disable-protocols disable all protocols
  145. --enable-indev=NAME enable input device NAME
  146. --disable-indev=NAME disable input device NAME
  147. --disable-indevs disable input devices
  148. --enable-outdev=NAME enable output device NAME
  149. --disable-outdev=NAME disable output device NAME
  150. --disable-outdevs disable output devices
  151. --disable-devices disable all devices
  152. --enable-filter=NAME enable filter NAME
  153. --disable-filter=NAME disable filter NAME
  154. --disable-filters disable all filters
  155. External library support:
  156. --enable-avisynth enable reading of AVISynth script files [no]
  157. --enable-bzlib enable bzlib [autodetect]
  158. --enable-fontconfig enable fontconfig
  159. --enable-frei0r enable frei0r video filtering
  160. --enable-gnutls enable gnutls [no]
  161. --enable-libaacplus enable AAC+ encoding via libaacplus [no]
  162. --enable-libass enable libass subtitles rendering [no]
  163. --enable-libbluray enable BluRay reading using libbluray [no]
  164. --enable-libcaca enable textual display using libcaca
  165. --enable-libcelt enable CELT decoding via libcelt [no]
  166. --enable-libcdio enable audio CD grabbing with libcdio
  167. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  168. and libraw1394 [no]
  169. --enable-libfaac enable AAC encoding via libfaac [no]
  170. --enable-libfdk-aac enable AAC encoding via libfdk-aac [no]
  171. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  172. --enable-libfreetype enable libfreetype [no]
  173. --enable-libgsm enable GSM de/encoding via libgsm [no]
  174. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  175. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  176. --enable-libmodplug enable ModPlug via libmodplug [no]
  177. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  178. --enable-libnut enable NUT (de)muxing via libnut,
  179. native (de)muxer exists [no]
  180. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  181. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  182. --enable-libopencv enable video filtering via libopencv [no]
  183. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  184. --enable-libopus enable Opus decoding via libopus [no]
  185. --enable-libpulse enable Pulseaudio input via libpulse [no]
  186. --enable-librtmp enable RTMP[E] support via librtmp [no]
  187. --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
  188. --enable-libspeex enable Speex de/encoding via libspeex [no]
  189. --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
  190. --enable-libtheora enable Theora encoding via libtheora [no]
  191. --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
  192. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  193. --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
  194. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  195. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  196. native implementation exists [no]
  197. --enable-libvpx enable VP8 de/encoding via libvpx [no]
  198. --enable-libx264 enable H.264 encoding via x264 [no]
  199. --enable-libxavs enable AVS encoding via xavs [no]
  200. --enable-libxvid enable Xvid encoding via xvidcore,
  201. native MPEG-4/Xvid encoder exists [no]
  202. --enable-openal enable OpenAL 1.1 capture support [no]
  203. --enable-openssl enable openssl [no]
  204. --enable-zlib enable zlib [autodetect]
  205. Advanced options (experts only):
  206. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  207. --enable-cross-compile assume a cross-compiler is used
  208. --sysroot=PATH root of cross-build tree
  209. --sysinclude=PATH location of cross-build system headers
  210. --target-os=OS compiler targets OS [$target_os]
  211. --target-exec=CMD command to run executables on target
  212. --target-path=DIR path to view of build directory on target
  213. --nm=NM use nm tool NM [$nm_default]
  214. --ar=AR use archive tool AR [$ar_default]
  215. --as=AS use assembler AS [$as_default]
  216. --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
  217. --cc=CC use C compiler CC [$cc_default]
  218. --cxx=CXX use C compiler CXX [$cxx_default]
  219. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  220. --ld=LD use linker LD [$ld_default]
  221. --host-cc=HOSTCC use host C compiler HOSTCC
  222. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  223. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  224. --host-libs=HLIBS use libs HLIBS when linking for host
  225. --host-os=OS compiler host OS [$target_os]
  226. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  227. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  228. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  229. --extra-libs=ELIBS add ELIBS [$ELIBS]
  230. --extra-version=STRING version string suffix []
  231. --optflags=OPTFLAGS override optimization-related compiler flags
  232. --build-suffix=SUFFIX library name suffix []
  233. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  234. --progs-suffix=SUFFIX program name suffix []
  235. --arch=ARCH select architecture [$arch]
  236. --cpu=CPU select the minimum required CPU (affects
  237. instruction selection, may crash on older CPUs)
  238. --enable-pic build position-independent code
  239. --enable-sram allow use of on-chip SRAM
  240. --enable-thumb compile for Thumb instruction set
  241. --disable-symver disable symbol versioning
  242. --disable-fastdiv disable table-based division
  243. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  244. --disable-safe-bitstream-reader
  245. disable buffer boundary checking in bitreaders
  246. (faster, but may crash)
  247. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  248. Optimization options (experts only):
  249. --disable-asm disable all assembler optimizations
  250. --disable-altivec disable AltiVec optimizations
  251. --disable-amd3dnow disable 3DNow! optimizations
  252. --disable-amd3dnowext disable 3DNow! extended optimizations
  253. --disable-mmx disable MMX optimizations
  254. --disable-mmxext disable MMXEXT optimizations
  255. --disable-sse disable SSE optimizations
  256. --disable-ssse3 disable SSSE3 optimizations
  257. --disable-avx disable AVX optimizations
  258. --disable-fma4 disable FMA4 optimizations
  259. --disable-armv5te disable armv5te optimizations
  260. --disable-armv6 disable armv6 optimizations
  261. --disable-armv6t2 disable armv6t2 optimizations
  262. --disable-armvfp disable ARM VFP optimizations
  263. --disable-mmi disable MMI optimizations
  264. --disable-neon disable NEON optimizations
  265. --disable-vis disable VIS optimizations
  266. --disable-yasm disable use of yasm assembler
  267. --disable-mips32r2 disable MIPS32R2 optimizations
  268. --disable-mipsdspr1 disable MIPS DSP ASE R1 optimizations
  269. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  270. --disable-mipsfpu disable floating point MIPS optimizations
  271. --disable-fast-unaligned consider unaligned accesses slow
  272. --postproc-version=V build libpostproc version V.
  273. Where V can be '$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO' or 'current'. [$postproc_version_default]
  274. Developer options (useful when working on FFmpeg itself):
  275. --enable-coverage build with test coverage instrumentation
  276. --disable-debug disable debugging symbols
  277. --enable-debug=LEVEL set the debug level [$debuglevel]
  278. --disable-optimizations disable compiler optimizations
  279. --enable-extra-warnings enable more compiler warnings
  280. --disable-stripping disable stripping of executables and shared libraries
  281. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  282. 2 causes a slowdown at runtime.
  283. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  284. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  285. leaks and errors, using the specified valgrind binary.
  286. Cannot be combined with --target-exec
  287. --samples=PATH location of test samples for FATE, if not set use
  288. \$FATE_SAMPLES at make invocation time.
  289. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  290. should be used only for debugging purposes)
  291. --enable-random randomly enable/disable components
  292. --disable-random
  293. --enable-random=LIST randomly enable/disable specific components or
  294. --disable-random=LIST component groups. LIST is a comma-separated list
  295. of NAME[:PROB] entries where NAME is a component
  296. (group) and PROB the probability associated with
  297. NAME (default 0.5).
  298. --random-seed=VALUE seed value for --enable/disable-random
  299. NOTE: Object files are built at the place where configure is launched.
  300. EOF
  301. exit 0
  302. }
  303. quotes='""'
  304. log(){
  305. echo "$@" >> $logfile
  306. }
  307. log_file(){
  308. log BEGIN $1
  309. pr -n -t $1 >> $logfile
  310. log END $1
  311. }
  312. echolog(){
  313. log "$@"
  314. echo "$@"
  315. }
  316. warn(){
  317. log "WARNING: $*"
  318. WARNINGS="${WARNINGS}WARNING: $*\n"
  319. }
  320. die(){
  321. echolog "$@"
  322. cat <<EOF
  323. If you think configure made a mistake, make sure you are using the latest
  324. version from Git. If the latest version fails, report the problem to the
  325. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  326. EOF
  327. if disabled logging; then
  328. cat <<EOF
  329. Rerun configure with logging enabled (do not use --disable-logging), and
  330. include the log this produces with your report.
  331. EOF
  332. else
  333. cat <<EOF
  334. Include the log file "$logfile" produced by configure as this will help
  335. solving the problem.
  336. EOF
  337. fi
  338. exit 1
  339. }
  340. # Avoid locale weirdness, besides we really just want to translate ASCII.
  341. toupper(){
  342. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  343. }
  344. tolower(){
  345. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  346. }
  347. c_escape(){
  348. echo "$*" | sed 's/["\\]/\\\0/g'
  349. }
  350. sh_quote(){
  351. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  352. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  353. echo "$v"
  354. }
  355. cleanws(){
  356. echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
  357. }
  358. filter(){
  359. pat=$1
  360. shift
  361. for v; do
  362. eval "case $v in $pat) echo $v ;; esac"
  363. done
  364. }
  365. filter_out(){
  366. pat=$1
  367. shift
  368. for v; do
  369. eval "case $v in $pat) ;; *) echo $v ;; esac"
  370. done
  371. }
  372. map(){
  373. m=$1
  374. shift
  375. for v; do eval $m; done
  376. }
  377. set_all(){
  378. value=$1
  379. shift
  380. for var in $*; do
  381. eval $var=$value
  382. done
  383. }
  384. set_weak(){
  385. value=$1
  386. shift
  387. for var; do
  388. eval : \${$var:=$value}
  389. done
  390. }
  391. set_safe(){
  392. var=$1
  393. shift
  394. eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
  395. }
  396. get_safe(){
  397. eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
  398. }
  399. pushvar(){
  400. for var in $*; do
  401. eval level=\${${var}_level:=0}
  402. eval ${var}_${level}="\$$var"
  403. eval ${var}_level=$(($level+1))
  404. done
  405. }
  406. popvar(){
  407. for var in $*; do
  408. eval level=\${${var}_level:-0}
  409. test $level = 0 && continue
  410. eval level=$(($level-1))
  411. eval $var="\${${var}_${level}}"
  412. eval ${var}_level=$level
  413. eval unset ${var}_${level}
  414. done
  415. }
  416. enable(){
  417. set_all yes $*
  418. }
  419. disable(){
  420. set_all no $*
  421. }
  422. enable_weak(){
  423. set_weak yes $*
  424. }
  425. disable_weak(){
  426. set_weak no $*
  427. }
  428. enable_safe(){
  429. for var; do
  430. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  431. done
  432. }
  433. disable_safe(){
  434. for var; do
  435. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  436. done
  437. }
  438. do_enable_deep(){
  439. for var; do
  440. enabled $var && continue
  441. eval sel="\$${var}_select"
  442. eval sgs="\$${var}_suggest"
  443. pushvar var sgs
  444. enable_deep $sel
  445. popvar sgs
  446. enable_deep_weak $sgs
  447. popvar var
  448. done
  449. }
  450. enable_deep(){
  451. do_enable_deep $*
  452. enable $*
  453. }
  454. enable_deep_weak(){
  455. do_enable_deep $*
  456. enable_weak $*
  457. }
  458. enabled(){
  459. test "${1#!}" = "$1" && op== || op=!=
  460. eval test "x\$${1#!}" $op "xyes"
  461. }
  462. disabled(){
  463. test "${1#!}" = "$1" && op== || op=!=
  464. eval test "x\$${1#!}" $op "xno"
  465. }
  466. enabled_all(){
  467. for opt; do
  468. enabled $opt || return 1
  469. done
  470. }
  471. disabled_all(){
  472. for opt; do
  473. disabled $opt || return 1
  474. done
  475. }
  476. enabled_any(){
  477. for opt; do
  478. enabled $opt && return 0
  479. done
  480. }
  481. disabled_any(){
  482. for opt; do
  483. disabled $opt && return 0
  484. done
  485. return 1
  486. }
  487. set_default(){
  488. for opt; do
  489. eval : \${$opt:=\$${opt}_default}
  490. done
  491. }
  492. is_in(){
  493. value=$1
  494. shift
  495. for var in $*; do
  496. [ $var = $value ] && return 0
  497. done
  498. return 1
  499. }
  500. check_deps(){
  501. for cfg; do
  502. cfg="${cfg#!}"
  503. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  504. disabled ${cfg}_checking && continue
  505. enable ${cfg}_checking
  506. eval dep_all="\$${cfg}_deps"
  507. eval dep_any="\$${cfg}_deps_any"
  508. eval dep_sel="\$${cfg}_select"
  509. eval dep_sgs="\$${cfg}_suggest"
  510. eval dep_ifa="\$${cfg}_if"
  511. eval dep_ifn="\$${cfg}_if_any"
  512. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  513. check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  514. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  515. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  516. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  517. enabled_all $dep_all || disable $cfg
  518. enabled_any $dep_any || disable $cfg
  519. disabled_any $dep_sel && disable $cfg
  520. if enabled $cfg; then
  521. eval dep_extralibs="\$${cfg}_extralibs"
  522. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  523. enable_deep $dep_sel
  524. enable_deep_weak $dep_sgs
  525. fi
  526. disable ${cfg}_checking
  527. done
  528. }
  529. print_config_h(){
  530. enabled $1 && v=1 || v=0
  531. echo "#define $2 $v"
  532. }
  533. print_config_mak(){
  534. enabled $1 && v= || v=!
  535. echo "$v$2=yes"
  536. }
  537. print_config_asm(){
  538. enabled $1 && v=1 || v=0
  539. echo "%define $2 $v"
  540. }
  541. print_config(){
  542. pfx=$1
  543. files=$2
  544. shift 2
  545. for cfg; do
  546. ucname="$(toupper $cfg)"
  547. for f in $files; do
  548. "print_config_${f##*.}" $cfg ${pfx}${ucname} >>$f
  549. done
  550. done
  551. }
  552. print_enabled(){
  553. test "$1" = -n && end=" " && shift || end="\n"
  554. suf=$1
  555. shift
  556. for v; do
  557. enabled $v && printf "%s$end" ${v%$suf};
  558. done
  559. }
  560. append(){
  561. var=$1
  562. shift
  563. eval "$var=\"\$$var $*\""
  564. }
  565. prepend(){
  566. var=$1
  567. shift
  568. eval "$var=\"$* \$$var\""
  569. }
  570. add_cppflags(){
  571. append CPPFLAGS "$@"
  572. }
  573. add_cflags(){
  574. append CFLAGS $($cflags_filter "$@")
  575. }
  576. add_cxxflags(){
  577. append CXXFLAGS $($cflags_filter "$@")
  578. }
  579. add_asflags(){
  580. append ASFLAGS $($asflags_filter "$@")
  581. }
  582. add_ldflags(){
  583. append LDFLAGS $($ldflags_filter "$@")
  584. }
  585. add_extralibs(){
  586. prepend extralibs $($ldflags_filter "$@")
  587. }
  588. add_host_cflags(){
  589. append host_cflags $($host_cflags_filter "$@")
  590. }
  591. add_host_ldflags(){
  592. append host_ldflags $($host_ldflags_filter "$@")
  593. }
  594. check_cmd(){
  595. log "$@"
  596. "$@" >> $logfile 2>&1
  597. }
  598. cc_o(){
  599. eval printf '%s\\n' $CC_O
  600. }
  601. cc_e(){
  602. eval printf '%s\\n' $CC_E
  603. }
  604. check_cc(){
  605. log check_cc "$@"
  606. cat > $TMPC
  607. log_file $TMPC
  608. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  609. }
  610. check_cxx(){
  611. log check_cxx "$@"
  612. cat > $TMPCPP
  613. log_file $TMPCPP
  614. check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  615. }
  616. check_cpp(){
  617. log check_cpp "$@"
  618. cat > $TMPC
  619. log_file $TMPC
  620. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  621. }
  622. check_as(){
  623. log check_as "$@"
  624. cat > $TMPC
  625. log_file $TMPC
  626. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C -o $TMPO $TMPC
  627. }
  628. check_asm(){
  629. log check_asm "$@"
  630. name="$1"
  631. code="$2"
  632. shift 2
  633. disable $name
  634. check_as "$@" <<EOF && enable $name
  635. void foo(void){ __asm__ volatile($code); }
  636. EOF
  637. }
  638. check_yasm(){
  639. log check_yasm "$@"
  640. echo "$1" > $TMPS
  641. log_file $TMPS
  642. shift 1
  643. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  644. }
  645. check_ld(){
  646. log check_ld "$@"
  647. type=$1
  648. shift 1
  649. flags=''
  650. libs=''
  651. for f; do
  652. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  653. done
  654. check_$type $($cflags_filter $flags) || return
  655. flags=$($ldflags_filter $flags)
  656. libs=$($ldflags_filter $libs)
  657. check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs
  658. }
  659. check_code(){
  660. log check_code "$@"
  661. check=$1
  662. headers=$2
  663. code=$3
  664. shift 3
  665. {
  666. for hdr in $headers; do
  667. echo "#include <$hdr>"
  668. done
  669. echo "int main(void) { $code; return 0; }"
  670. } | check_$check "$@"
  671. }
  672. check_cppflags(){
  673. log check_cppflags "$@"
  674. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  675. int x;
  676. EOF
  677. }
  678. check_cflags(){
  679. log check_cflags "$@"
  680. set -- $($cflags_filter "$@")
  681. check_cc "$@" <<EOF && append CFLAGS "$@"
  682. int x;
  683. EOF
  684. }
  685. check_cxxflags(){
  686. log check_cxxflags "$@"
  687. set -- $($cflags_filter "$@")
  688. check_cxx "$@" <<EOF && append CXXFLAGS "$@"
  689. int x;
  690. EOF
  691. }
  692. test_ldflags(){
  693. log test_ldflags "$@"
  694. check_ld "cc" "$@" <<EOF
  695. int main(void){ return 0; }
  696. EOF
  697. }
  698. check_ldflags(){
  699. log check_ldflags "$@"
  700. test_ldflags "$@" && add_ldflags "$@"
  701. }
  702. check_header(){
  703. log check_header "$@"
  704. header=$1
  705. shift
  706. disable_safe $header
  707. check_cpp "$@" <<EOF && enable_safe $header
  708. #include <$header>
  709. int x;
  710. EOF
  711. }
  712. check_func(){
  713. log check_func "$@"
  714. func=$1
  715. shift
  716. disable $func
  717. check_ld "cc" "$@" <<EOF && enable $func
  718. extern int $func();
  719. int main(void){ $func(); }
  720. EOF
  721. }
  722. check_mathfunc(){
  723. log check_mathfunc "$@"
  724. func=$1
  725. shift
  726. disable $func
  727. check_ld "cc" "$@" <<EOF && enable $func
  728. #include <math.h>
  729. float foo(float f) { return $func(f); }
  730. int main(void){ return (int) foo; }
  731. EOF
  732. }
  733. check_func_headers(){
  734. log check_func_headers "$@"
  735. headers=$1
  736. funcs=$2
  737. shift 2
  738. {
  739. for hdr in $headers; do
  740. echo "#include <$hdr>"
  741. done
  742. for func in $funcs; do
  743. echo "long check_$func(void) { return (long) $func; }"
  744. done
  745. echo "int main(void) { return 0; }"
  746. } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
  747. }
  748. check_class_headers_cpp(){
  749. log check_class_headers_cpp "$@"
  750. headers=$1
  751. classes=$2
  752. shift 2
  753. {
  754. for hdr in $headers; do
  755. echo "#include <$hdr>"
  756. done
  757. echo "int main(void) { "
  758. i=1
  759. for class in $classes; do
  760. echo "$class obj$i;"
  761. i=$(expr $i + 1)
  762. done
  763. echo "return 0; }"
  764. } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers
  765. }
  766. check_cpp_condition(){
  767. log check_cpp_condition "$@"
  768. header=$1
  769. condition=$2
  770. shift 2
  771. check_cpp "$@" <<EOF
  772. #include <$header>
  773. #if !($condition)
  774. #error "unsatisfied condition: $condition"
  775. #endif
  776. EOF
  777. }
  778. check_lib(){
  779. log check_lib "$@"
  780. header="$1"
  781. func="$2"
  782. shift 2
  783. check_header $header && check_func $func "$@" && add_extralibs "$@"
  784. }
  785. check_lib2(){
  786. log check_lib2 "$@"
  787. headers="$1"
  788. funcs="$2"
  789. shift 2
  790. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  791. }
  792. check_lib_cpp(){
  793. log check_lib_cpp "$@"
  794. headers="$1"
  795. classes="$2"
  796. shift 2
  797. check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@"
  798. }
  799. check_pkg_config(){
  800. log check_pkg_config "$@"
  801. pkg="$1"
  802. headers="$2"
  803. funcs="$3"
  804. shift 3
  805. $pkg_config --exists $pkg 2>/dev/null || return
  806. pkg_cflags=$($pkg_config --cflags $pkg)
  807. pkg_libs=$($pkg_config --libs $pkg)
  808. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  809. set_safe ${pkg}_cflags $pkg_cflags &&
  810. set_safe ${pkg}_libs $pkg_libs
  811. }
  812. check_exec(){
  813. check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  814. }
  815. check_exec_crash(){
  816. code=$(cat)
  817. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  818. # are safe but may not be available everywhere. Thus we use
  819. # raise(SIGTERM) instead. The check is run in a subshell so we
  820. # can redirect the "Terminated" message from the shell. SIGBUS
  821. # is not defined by standard C so it is used conditionally.
  822. (check_exec "$@") >> $logfile 2>&1 <<EOF
  823. #include <signal.h>
  824. static void sighandler(int sig){
  825. raise(SIGTERM);
  826. }
  827. int func(void){
  828. $code
  829. }
  830. int (*func_ptr)(void) = func;
  831. int main(void){
  832. signal(SIGILL, sighandler);
  833. signal(SIGFPE, sighandler);
  834. signal(SIGSEGV, sighandler);
  835. #ifdef SIGBUS
  836. signal(SIGBUS, sighandler);
  837. #endif
  838. return func_ptr();
  839. }
  840. EOF
  841. }
  842. check_type(){
  843. log check_type "$@"
  844. headers=$1
  845. type=$2
  846. shift 2
  847. disable_safe "$type"
  848. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  849. }
  850. check_struct(){
  851. log check_type "$@"
  852. headers=$1
  853. struct=$2
  854. member=$3
  855. shift 3
  856. disable_safe "${struct}_${member}"
  857. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  858. enable_safe "${struct}_${member}"
  859. }
  860. require(){
  861. name="$1"
  862. header="$2"
  863. func="$3"
  864. shift 3
  865. check_lib $header $func "$@" || die "ERROR: $name not found"
  866. }
  867. require2(){
  868. name="$1"
  869. headers="$2"
  870. func="$3"
  871. shift 3
  872. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  873. }
  874. require_cpp(){
  875. name="$1"
  876. headers="$2"
  877. classes="$3"
  878. shift 3
  879. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  880. }
  881. require_pkg_config(){
  882. pkg="$1"
  883. check_pkg_config "$@" || die "ERROR: $pkg not found"
  884. add_cflags $(get_safe ${pkg}_cflags)
  885. add_extralibs $(get_safe ${pkg}_libs)
  886. }
  887. check_host_cc(){
  888. log check_host_cc "$@"
  889. cat > $TMPC
  890. log_file $TMPC
  891. check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC
  892. }
  893. check_host_cflags(){
  894. log check_host_cflags "$@"
  895. set -- $($host_cflags_filter "$@")
  896. check_host_cc "$@" <<EOF && append host_cflags "$@"
  897. int x;
  898. EOF
  899. }
  900. apply(){
  901. file=$1
  902. shift
  903. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  904. }
  905. cp_if_changed(){
  906. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  907. mkdir -p "$(dirname $2)"
  908. cp -f "$1" "$2"
  909. }
  910. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  911. # system-dependent things.
  912. COMPONENT_LIST="
  913. bsfs
  914. decoders
  915. demuxers
  916. encoders
  917. filters
  918. hwaccels
  919. indevs
  920. muxers
  921. outdevs
  922. parsers
  923. protocols
  924. "
  925. PROGRAM_LIST="
  926. ffplay
  927. ffprobe
  928. ffserver
  929. ffmpeg
  930. "
  931. CONFIG_LIST="
  932. $COMPONENT_LIST
  933. $PROGRAM_LIST
  934. avcodec
  935. avdevice
  936. avfilter
  937. avformat
  938. avresample
  939. avisynth
  940. bzlib
  941. crystalhd
  942. dct
  943. doc
  944. dwt
  945. dxva2
  946. fast_unaligned
  947. fastdiv
  948. fft
  949. fontconfig
  950. frei0r
  951. gnutls
  952. gpl
  953. gray
  954. hardcoded_tables
  955. libaacplus
  956. libass
  957. libbluray
  958. libcaca
  959. libcdio
  960. libcelt
  961. libdc1394
  962. libfaac
  963. libfdk_aac
  964. libflite
  965. libfreetype
  966. libgsm
  967. libiec61883
  968. libilbc
  969. libmodplug
  970. libmp3lame
  971. libnut
  972. libopencore_amrnb
  973. libopencore_amrwb
  974. libopencv
  975. libopenjpeg
  976. libopus
  977. libpulse
  978. librtmp
  979. libschroedinger
  980. libspeex
  981. libstagefright_h264
  982. libtheora
  983. libutvideo
  984. libv4l2
  985. libvo_aacenc
  986. libvo_amrwbenc
  987. libvorbis
  988. libvpx
  989. libx264
  990. libxavs
  991. libxvid
  992. lsp
  993. mdct
  994. memalign_hack
  995. memory_poisoning
  996. network
  997. nonfree
  998. openal
  999. openssl
  1000. pic
  1001. postproc
  1002. rdft
  1003. runtime_cpudetect
  1004. safe_bitstream_reader
  1005. shared
  1006. small
  1007. sram
  1008. static
  1009. swresample
  1010. swscale
  1011. swscale_alpha
  1012. thumb
  1013. vaapi
  1014. vda
  1015. vdpau
  1016. version3
  1017. xmm_clobber_test
  1018. x11grab
  1019. zlib
  1020. "
  1021. THREADS_LIST='
  1022. pthreads
  1023. w32threads
  1024. os2threads
  1025. '
  1026. ARCH_LIST='
  1027. alpha
  1028. arm
  1029. avr32
  1030. avr32_ap
  1031. avr32_uc
  1032. bfin
  1033. ia64
  1034. m68k
  1035. mips
  1036. mips64
  1037. parisc
  1038. ppc
  1039. ppc64
  1040. s390
  1041. sh4
  1042. sparc
  1043. sparc64
  1044. tomi
  1045. x86
  1046. x86_32
  1047. x86_64
  1048. '
  1049. ARCH_EXT_LIST='
  1050. altivec
  1051. amd3dnow
  1052. amd3dnowext
  1053. armv5te
  1054. armv6
  1055. armv6t2
  1056. armvfp
  1057. avx
  1058. fma4
  1059. mmi
  1060. mmx
  1061. mmxext
  1062. neon
  1063. ppc4xx
  1064. sse
  1065. ssse3
  1066. vfpv3
  1067. vis
  1068. mipsfpu
  1069. mips32r2
  1070. mipsdspr1
  1071. mipsdspr2
  1072. '
  1073. HAVE_LIST_PUB='
  1074. bigendian
  1075. fast_unaligned
  1076. '
  1077. HAVE_LIST="
  1078. $ARCH_EXT_LIST
  1079. $HAVE_LIST_PUB
  1080. $THREADS_LIST
  1081. aligned_malloc
  1082. aligned_stack
  1083. alsa_asoundlib_h
  1084. altivec_h
  1085. arpa_inet_h
  1086. asm_mod_y
  1087. asm_types_h
  1088. attribute_may_alias
  1089. attribute_packed
  1090. cbrtf
  1091. clock_gettime
  1092. closesocket
  1093. cmov
  1094. cpuid
  1095. dcbzl
  1096. dev_bktr_ioctl_bt848_h
  1097. dev_bktr_ioctl_meteor_h
  1098. dev_ic_bt8xx_h
  1099. dev_video_bktr_ioctl_bt848_h
  1100. dev_video_meteor_ioctl_meteor_h
  1101. dlfcn_h
  1102. dlopen
  1103. dos_paths
  1104. dxva_h
  1105. ebp_available
  1106. ebx_available
  1107. exp2
  1108. exp2f
  1109. fast_64bit
  1110. fast_clz
  1111. fast_cmov
  1112. fcntl
  1113. fork
  1114. getaddrinfo
  1115. gethrtime
  1116. getopt
  1117. GetProcessAffinityMask
  1118. GetProcessMemoryInfo
  1119. GetProcessTimes
  1120. GetSystemTimeAsFileTime
  1121. getrusage
  1122. gettimeofday
  1123. glob
  1124. gnu_as
  1125. ibm_asm
  1126. inet_aton
  1127. inline_asm
  1128. isatty
  1129. isinf
  1130. isnan
  1131. jack_port_get_latency_range
  1132. kbhit
  1133. ldbrx
  1134. libdc1394_1
  1135. libdc1394_2
  1136. llrint
  1137. llrintf
  1138. local_aligned_16
  1139. local_aligned_8
  1140. localtime_r
  1141. log2
  1142. log2f
  1143. loongson
  1144. lrint
  1145. lrintf
  1146. lzo1x_999_compress
  1147. machine_ioctl_bt848_h
  1148. machine_ioctl_meteor_h
  1149. makeinfo
  1150. malloc_h
  1151. MapViewOfFile
  1152. memalign
  1153. mkstemp
  1154. mm_empty
  1155. mmap
  1156. nanosleep
  1157. netinet_sctp_h
  1158. PeekNamedPipe
  1159. pod2man
  1160. poll_h
  1161. posix_memalign
  1162. pthread_cancel
  1163. rdtsc
  1164. rint
  1165. round
  1166. roundf
  1167. rweflags
  1168. sched_getaffinity
  1169. sdl
  1170. sdl_video_size
  1171. setmode
  1172. setrlimit
  1173. Sleep
  1174. sndio_h
  1175. socklen_t
  1176. soundcard_h
  1177. strerror_r
  1178. strptime
  1179. struct_addrinfo
  1180. struct_group_source_req
  1181. struct_ip_mreq_source
  1182. struct_ipv6_mreq
  1183. struct_pollfd
  1184. struct_rusage_ru_maxrss
  1185. struct_sockaddr_in6
  1186. struct_sockaddr_sa_len
  1187. struct_sockaddr_storage
  1188. struct_v4l2_frmivalenum_discrete
  1189. symver
  1190. symver_asm_label
  1191. symver_gnu_asm
  1192. sysconf
  1193. sysctl
  1194. sys_mman_h
  1195. sys_param_h
  1196. sys_resource_h
  1197. sys_select_h
  1198. sys_soundcard_h
  1199. sys_time_h
  1200. sys_videoio_h
  1201. termios_h
  1202. texi2html
  1203. threads
  1204. trunc
  1205. truncf
  1206. unistd_h
  1207. usleep
  1208. vfp_args
  1209. VirtualAlloc
  1210. windows_h
  1211. winsock2_h
  1212. xform_asm
  1213. xgetbv
  1214. xmm_clobbers
  1215. yasm
  1216. "
  1217. # options emitted with CONFIG_ prefix but not available on command line
  1218. CONFIG_EXTRA="
  1219. aandcttables
  1220. ac3dsp
  1221. avutil
  1222. gcrypt
  1223. golomb
  1224. gplv3
  1225. h264chroma
  1226. h264dsp
  1227. h264pred
  1228. h264qpel
  1229. huffman
  1230. lgplv3
  1231. lpc
  1232. mpegaudiodsp
  1233. nettle
  1234. rtpdec
  1235. sinewin
  1236. vp3dsp
  1237. "
  1238. CMDLINE_SELECT="
  1239. $ARCH_EXT_LIST
  1240. $CONFIG_LIST
  1241. $THREADS_LIST
  1242. asm
  1243. coverage
  1244. cross_compile
  1245. debug
  1246. extra_warnings
  1247. logging
  1248. optimizations
  1249. stripping
  1250. symver
  1251. yasm
  1252. "
  1253. PATHS_LIST='
  1254. bindir
  1255. datadir
  1256. incdir
  1257. libdir
  1258. mandir
  1259. prefix
  1260. shlibdir
  1261. '
  1262. CMDLINE_SET="
  1263. $PATHS_LIST
  1264. ar
  1265. arch
  1266. as
  1267. assert_level
  1268. build_suffix
  1269. cc
  1270. cpu
  1271. cross_prefix
  1272. cxx
  1273. dep_cc
  1274. extra_version
  1275. host_cc
  1276. host_cflags
  1277. host_ldflags
  1278. host_libs
  1279. host_os
  1280. install
  1281. ld
  1282. logfile
  1283. malloc_prefix
  1284. nm
  1285. optflags
  1286. pkg_config
  1287. postproc_version
  1288. progs_suffix
  1289. random_seed
  1290. samples
  1291. strip
  1292. sysinclude
  1293. sysroot
  1294. target_exec
  1295. target_os
  1296. target_path
  1297. valgrind
  1298. yasmexe
  1299. "
  1300. CMDLINE_APPEND="
  1301. extra_cflags
  1302. extra_cxxflags
  1303. "
  1304. # code dependency declarations
  1305. # architecture extensions
  1306. armv5te_deps="arm"
  1307. armv6_deps="arm"
  1308. armv6t2_deps="arm"
  1309. armvfp_deps="arm"
  1310. neon_deps="arm"
  1311. vfpv3_deps="armvfp"
  1312. mipsfpu_deps="mips"
  1313. mips32r2_deps="mips"
  1314. mipsdspr1_deps="mips"
  1315. mipsdspr2_deps="mips"
  1316. mmi_deps="mips"
  1317. altivec_deps="ppc"
  1318. ppc4xx_deps="ppc"
  1319. vis_deps="sparc"
  1320. x86_64_suggest="cmov fast_cmov"
  1321. amd3dnow_deps="mmx"
  1322. amd3dnowext_deps="amd3dnow"
  1323. mmx_deps="x86"
  1324. mmxext_deps="mmx"
  1325. sse_deps="mmx"
  1326. ssse3_deps="sse"
  1327. avx_deps="ssse3"
  1328. fma4_deps="avx"
  1329. aligned_stack_if_any="ppc x86"
  1330. fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1331. fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
  1332. fast_unaligned_if_any="armv6 ppc x86"
  1333. inline_asm_deps="!tms470"
  1334. need_memalign="altivec neon sse"
  1335. symver_if_any="symver_asm_label symver_gnu_asm"
  1336. # subsystems
  1337. dct_select="rdft"
  1338. mdct_select="fft"
  1339. rdft_select="fft"
  1340. mpegaudiodsp_select="dct"
  1341. # decoders / encoders / hardware accelerators
  1342. aac_decoder_select="mdct sinewin"
  1343. aac_encoder_select="mdct sinewin"
  1344. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1345. ac3_decoder_select="mdct ac3dsp ac3_parser"
  1346. ac3_encoder_select="mdct ac3dsp"
  1347. ac3_fixed_encoder_select="mdct ac3dsp"
  1348. alac_encoder_select="lpc"
  1349. amrnb_decoder_select="lsp"
  1350. amrwb_decoder_select="lsp"
  1351. amv_encoder_select="aandcttables"
  1352. atrac1_decoder_select="mdct sinewin"
  1353. atrac3_decoder_select="mdct"
  1354. binkaudio_dct_decoder_select="mdct rdft dct sinewin"
  1355. binkaudio_rdft_decoder_select="mdct rdft sinewin"
  1356. cavs_decoder_select="golomb"
  1357. cook_decoder_select="mdct sinewin"
  1358. cscd_decoder_suggest="zlib"
  1359. dca_decoder_select="mdct"
  1360. dirac_decoder_select="dwt golomb"
  1361. dnxhd_encoder_select="aandcttables"
  1362. dxa_decoder_select="zlib"
  1363. eac3_decoder_select="ac3_decoder"
  1364. eac3_encoder_select="mdct ac3dsp"
  1365. eamad_decoder_select="aandcttables"
  1366. eatgq_decoder_select="aandcttables"
  1367. eatqi_decoder_select="aandcttables"
  1368. exr_decoder_select="zlib"
  1369. ffv1_decoder_select="golomb"
  1370. flac_decoder_select="golomb"
  1371. flac_encoder_select="golomb lpc"
  1372. flashsv_decoder_select="zlib"
  1373. flashsv_encoder_select="zlib"
  1374. flashsv2_encoder_select="zlib"
  1375. flashsv2_decoder_select="zlib"
  1376. flv_decoder_select="h263_decoder"
  1377. flv_encoder_select="h263_encoder"
  1378. fraps_decoder_select="huffman"
  1379. h261_encoder_select="aandcttables"
  1380. h263_decoder_select="h263_parser"
  1381. h263_encoder_select="aandcttables"
  1382. h263_vaapi_hwaccel_select="vaapi h263_decoder"
  1383. h263i_decoder_select="h263_decoder"
  1384. h263p_encoder_select="h263_encoder"
  1385. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  1386. h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
  1387. h264_dxva2_hwaccel_deps="dxva2api_h"
  1388. h264_dxva2_hwaccel_select="dxva2 h264_decoder"
  1389. h264_vaapi_hwaccel_select="vaapi h264_decoder"
  1390. h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1391. h264_vda_hwaccel_select="vda h264_decoder"
  1392. h264_vdpau_decoder_select="vdpau h264_decoder"
  1393. iac_decoder_select="fft mdct sinewin"
  1394. imc_decoder_select="fft mdct sinewin"
  1395. jpegls_decoder_select="golomb"
  1396. jpegls_encoder_select="golomb"
  1397. ljpeg_encoder_select="aandcttables"
  1398. loco_decoder_select="golomb"
  1399. mjpeg_encoder_select="aandcttables"
  1400. mlp_decoder_select="mlp_parser"
  1401. mp1_decoder_select="mpegaudiodsp"
  1402. mp1float_decoder_select="mpegaudiodsp"
  1403. mp2_decoder_select="mpegaudiodsp"
  1404. mp2float_decoder_select="mpegaudiodsp"
  1405. mp3_decoder_select="mpegaudiodsp"
  1406. mp3adu_decoder_select="mpegaudiodsp"
  1407. mp3adufloat_decoder_select="mpegaudiodsp"
  1408. mp3float_decoder_select="mpegaudiodsp"
  1409. mp3on4_decoder_select="mpegaudiodsp"
  1410. mp3on4float_decoder_select="mpegaudiodsp"
  1411. mpc7_decoder_select="mpegaudiodsp"
  1412. mpc8_decoder_select="mpegaudiodsp"
  1413. mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
  1414. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1415. mpeg_xvmc_decoder_select="mpegvideo_decoder"
  1416. mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
  1417. mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
  1418. mpeg1video_encoder_select="aandcttables"
  1419. mpeg2_crystalhd_decoder_select="crystalhd"
  1420. mpeg2_dxva2_hwaccel_deps="dxva2api_h"
  1421. mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
  1422. mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
  1423. mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
  1424. mpeg2video_encoder_select="aandcttables"
  1425. mpeg4_crystalhd_decoder_select="crystalhd"
  1426. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1427. mpeg4_encoder_select="h263_encoder"
  1428. mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
  1429. mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
  1430. msmpeg4_crystalhd_decoder_select="crystalhd"
  1431. msmpeg4v1_decoder_select="h263_decoder"
  1432. msmpeg4v1_encoder_select="h263_encoder"
  1433. msmpeg4v2_decoder_select="h263_decoder"
  1434. msmpeg4v2_encoder_select="h263_encoder"
  1435. msmpeg4v3_decoder_select="h263_decoder"
  1436. msmpeg4v3_encoder_select="h263_encoder"
  1437. nellymoser_decoder_select="mdct sinewin"
  1438. nellymoser_encoder_select="mdct sinewin"
  1439. png_decoder_select="zlib"
  1440. png_encoder_select="zlib"
  1441. qcelp_decoder_select="lsp"
  1442. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1443. ra_144_encoder_select="lpc"
  1444. ralf_decoder_select="golomb"
  1445. rv10_decoder_select="h263_decoder"
  1446. rv10_encoder_select="h263_encoder"
  1447. rv20_decoder_select="h263_decoder"
  1448. rv20_encoder_select="h263_encoder"
  1449. rv30_decoder_select="golomb h264chroma h264pred h264qpel"
  1450. rv40_decoder_select="golomb h264chroma h264pred h264qpel"
  1451. shorten_decoder_select="golomb"
  1452. sipr_decoder_select="lsp"
  1453. snow_decoder_select="dwt"
  1454. snow_encoder_select="aandcttables dwt"
  1455. sonic_decoder_select="golomb"
  1456. sonic_encoder_select="golomb"
  1457. sonic_ls_encoder_select="golomb"
  1458. svq1_encoder_select="aandcttables"
  1459. svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
  1460. svq3_decoder_suggest="zlib"
  1461. theora_decoder_select="vp3_decoder"
  1462. tiff_decoder_suggest="zlib"
  1463. tiff_encoder_suggest="zlib"
  1464. tscc_decoder_select="zlib"
  1465. twinvq_decoder_select="mdct lsp sinewin"
  1466. vc1_crystalhd_decoder_select="crystalhd"
  1467. vc1_decoder_select="h263_decoder h264chroma h264qpel"
  1468. vc1_dxva2_hwaccel_deps="dxva2api_h"
  1469. vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
  1470. vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
  1471. vc1_vdpau_decoder_select="vdpau vc1_decoder"
  1472. vc1image_decoder_select="vc1_decoder"
  1473. vorbis_decoder_select="mdct"
  1474. vorbis_encoder_select="mdct"
  1475. vp3_decoder_select="vp3dsp"
  1476. vp5_decoder_select="vp3dsp"
  1477. vp6_decoder_select="huffman vp3dsp"
  1478. vp6a_decoder_select="vp6_decoder"
  1479. vp6f_decoder_select="vp6_decoder"
  1480. vp8_decoder_select="h264pred h264qpel"
  1481. wmapro_decoder_select="mdct sinewin"
  1482. wmav1_decoder_select="mdct sinewin"
  1483. wmav1_encoder_select="mdct sinewin"
  1484. wmav2_decoder_select="mdct sinewin"
  1485. wmav2_encoder_select="mdct sinewin"
  1486. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  1487. wmv1_decoder_select="h263_decoder"
  1488. wmv1_encoder_select="h263_encoder"
  1489. wmv2_decoder_select="h263_decoder"
  1490. wmv2_encoder_select="h263_encoder"
  1491. wmv3_decoder_select="vc1_decoder"
  1492. wmv3_crystalhd_decoder_select="crystalhd"
  1493. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  1494. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1495. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1496. wmv3image_decoder_select="wmv3_decoder"
  1497. zerocodec_decoder_select="zlib"
  1498. zlib_decoder_select="zlib"
  1499. zlib_encoder_select="zlib"
  1500. zmbv_decoder_select="zlib"
  1501. zmbv_encoder_select="zlib"
  1502. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  1503. vaapi_deps="va_va_h"
  1504. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1505. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1506. # parsers
  1507. h264_parser_select="golomb h264dsp h264pred"
  1508. # external libraries
  1509. libaacplus_encoder_deps="libaacplus"
  1510. libcelt_decoder_deps="libcelt"
  1511. libfaac_encoder_deps="libfaac"
  1512. libfdk_aac_encoder_deps="libfdk_aac"
  1513. libgsm_decoder_deps="libgsm"
  1514. libgsm_encoder_deps="libgsm"
  1515. libgsm_ms_decoder_deps="libgsm"
  1516. libgsm_ms_encoder_deps="libgsm"
  1517. libilbc_decoder_deps="libilbc"
  1518. libilbc_encoder_deps="libilbc"
  1519. libmodplug_demuxer_deps="libmodplug"
  1520. libmp3lame_encoder_deps="libmp3lame"
  1521. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1522. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1523. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1524. libopenjpeg_decoder_deps="libopenjpeg"
  1525. libopenjpeg_encoder_deps="libopenjpeg"
  1526. libopus_decoder_deps="libopus"
  1527. libschroedinger_decoder_deps="libschroedinger"
  1528. libschroedinger_encoder_deps="libschroedinger"
  1529. libspeex_decoder_deps="libspeex"
  1530. libspeex_encoder_deps="libspeex"
  1531. libstagefright_h264_decoder_deps="libstagefright_h264"
  1532. libtheora_encoder_deps="libtheora"
  1533. libvo_aacenc_encoder_deps="libvo_aacenc"
  1534. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  1535. libvorbis_decoder_deps="libvorbis"
  1536. libvorbis_encoder_deps="libvorbis"
  1537. libvpx_decoder_deps="libvpx"
  1538. libvpx_encoder_deps="libvpx"
  1539. libx264_encoder_deps="libx264"
  1540. libx264rgb_encoder_deps="libx264"
  1541. libxavs_encoder_deps="libxavs"
  1542. libxvid_encoder_deps="libxvid"
  1543. libutvideo_decoder_deps="libutvideo"
  1544. libutvideo_encoder_deps="libutvideo"
  1545. # demuxers / muxers
  1546. ac3_demuxer_select="ac3_parser"
  1547. asf_stream_muxer_select="asf_muxer"
  1548. avisynth_demuxer_deps="avisynth"
  1549. dirac_demuxer_select="dirac_parser"
  1550. eac3_demuxer_select="ac3_parser"
  1551. flac_demuxer_select="flac_parser"
  1552. ipod_muxer_select="mov_muxer"
  1553. libnut_demuxer_deps="libnut"
  1554. libnut_muxer_deps="libnut"
  1555. matroska_audio_muxer_select="matroska_muxer"
  1556. matroska_demuxer_suggest="zlib bzlib"
  1557. mov_demuxer_suggest="zlib"
  1558. mp3_demuxer_select="mpegaudio_parser"
  1559. mp4_muxer_select="mov_muxer"
  1560. mpegts_muxer_select="adts_muxer latm_muxer"
  1561. mpegtsraw_demuxer_select="mpegts_demuxer"
  1562. mxf_d10_muxer_select="mxf_muxer"
  1563. ogg_demuxer_select="golomb"
  1564. psp_muxer_select="mov_muxer"
  1565. rtp_demuxer_select="sdp_demuxer"
  1566. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  1567. rtsp_demuxer_select="http_protocol rtpdec"
  1568. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol"
  1569. sap_demuxer_select="sdp_demuxer"
  1570. sap_muxer_select="rtp_muxer rtp_protocol"
  1571. sdp_demuxer_select="rtpdec"
  1572. spdif_muxer_select="aac_parser"
  1573. tg2_muxer_select="mov_muxer"
  1574. tgp_muxer_select="mov_muxer"
  1575. w64_demuxer_deps="wav_demuxer"
  1576. # indevs / outdevs
  1577. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1578. alsa_outdev_deps="alsa_asoundlib_h"
  1579. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1580. caca_outdev_deps="libcaca"
  1581. dshow_indev_deps="IBaseFilter"
  1582. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
  1583. dv1394_indev_deps="dv1394 dv_demuxer"
  1584. fbdev_indev_deps="linux_fb_h"
  1585. iec61883_indev_deps="libiec61883"
  1586. jack_indev_deps="jack_jack_h sem_timedwait"
  1587. lavfi_indev_deps="avfilter"
  1588. libcdio_indev_deps="libcdio"
  1589. libdc1394_indev_deps="libdc1394"
  1590. libv4l2_indev_deps="libv4l2"
  1591. openal_indev_deps="openal"
  1592. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1593. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1594. pulse_indev_deps="libpulse"
  1595. sdl_outdev_deps="sdl"
  1596. sndio_indev_deps="sndio_h"
  1597. sndio_outdev_deps="sndio_h"
  1598. v4l_indev_deps="linux_videodev_h"
  1599. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1600. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  1601. vfwcap_indev_extralibs="-lavicap32"
  1602. x11grab_indev_deps="x11grab"
  1603. # protocols
  1604. bluray_protocol_deps="libbluray"
  1605. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  1606. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  1607. ffrtmpcrypt_protocol_select="tcp_protocol"
  1608. ffrtmphttp_protocol_deps="!librtmp_protocol"
  1609. ffrtmphttp_protocol_select="http_protocol"
  1610. gopher_protocol_deps="network"
  1611. httpproxy_protocol_deps="network"
  1612. httpproxy_protocol_select="tcp_protocol"
  1613. http_protocol_deps="network"
  1614. http_protocol_select="tcp_protocol"
  1615. https_protocol_select="tls_protocol"
  1616. librtmp_protocol_deps="librtmp"
  1617. librtmpe_protocol_deps="librtmp"
  1618. librtmps_protocol_deps="librtmp"
  1619. librtmpt_protocol_deps="librtmp"
  1620. librtmpte_protocol_deps="librtmp"
  1621. mmsh_protocol_select="http_protocol"
  1622. mmst_protocol_deps="network"
  1623. rtmp_protocol_deps="!librtmp_protocol"
  1624. rtmp_protocol_select="tcp_protocol"
  1625. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  1626. rtmps_protocol_deps="!librtmp_protocol"
  1627. rtmps_protocol_select="tls_protocol"
  1628. rtmpt_protocol_select="ffrtmphttp_protocol"
  1629. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  1630. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  1631. rtp_protocol_select="udp_protocol"
  1632. sctp_protocol_deps="network netinet_sctp_h"
  1633. tcp_protocol_deps="network"
  1634. tls_protocol_deps_any="openssl gnutls"
  1635. tls_protocol_select="tcp_protocol"
  1636. udp_protocol_deps="network"
  1637. # filters
  1638. aconvert_filter_deps="swresample"
  1639. amovie_filter_deps="avcodec avformat"
  1640. aresample_filter_deps="swresample"
  1641. ass_filter_deps="libass"
  1642. asyncts_filter_deps="avresample"
  1643. atempo_filter_deps="avcodec rdft"
  1644. blackframe_filter_deps="gpl"
  1645. boxblur_filter_deps="gpl"
  1646. colormatrix_filter_deps="gpl"
  1647. cropdetect_filter_deps="gpl"
  1648. delogo_filter_deps="gpl"
  1649. deshake_filter_deps="avcodec"
  1650. drawtext_filter_deps="libfreetype"
  1651. flite_filter_deps="libflite"
  1652. frei0r_filter_deps="frei0r dlopen"
  1653. frei0r_filter_extralibs='$ldl'
  1654. frei0r_src_filter_deps="frei0r dlopen"
  1655. frei0r_src_filter_extralibs='$ldl'
  1656. hqdn3d_filter_deps="gpl"
  1657. movie_filter_deps="avcodec avformat"
  1658. mp_filter_deps="gpl avcodec swscale postproc"
  1659. mptestsrc_filter_deps="gpl"
  1660. negate_filter_deps="lut_filter"
  1661. resample_filter_deps="avresample"
  1662. ocv_filter_deps="libopencv"
  1663. pan_filter_deps="swresample"
  1664. removelogo_filter_deps="avcodec avformat swscale"
  1665. scale_filter_deps="swscale"
  1666. select_filter_deps="avcodec"
  1667. super2xsai_filter_deps="gpl"
  1668. tinterlace_filter_deps="gpl"
  1669. yadif_filter_deps="gpl"
  1670. # libraries
  1671. avdevice_deps="avcodec avformat"
  1672. avformat_deps="avcodec"
  1673. postproc_deps="gpl"
  1674. # programs
  1675. ffmpeg_deps="avcodec avfilter avformat swscale swresample"
  1676. ffmpeg_select="buffersink_filter format_filter aformat_filter
  1677. setpts_filter null_filter anull_filter abuffersink_filter"
  1678. ffplay_deps="avcodec avformat swscale swresample sdl"
  1679. ffplay_select="buffersink_filter rdft"
  1680. ffprobe_deps="avcodec avformat"
  1681. ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
  1682. ffserver_extralibs='$ldl'
  1683. doc_deps_any="texi2html makeinfo pod2man"
  1684. # tests
  1685. colormatrix1_test_deps="colormatrix_filter"
  1686. colormatrix2_test_deps="colormatrix_filter"
  1687. flashsv2_test_deps="zlib"
  1688. mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
  1689. mpng_test_deps="zlib"
  1690. pp_test_deps="mp_filter"
  1691. pp2_test_deps="mp_filter"
  1692. pp3_test_deps="mp_filter"
  1693. pp4_test_deps="mp_filter"
  1694. pp5_test_deps="mp_filter"
  1695. pp6_test_deps="mp_filter"
  1696. seek_lavf_mxf_d10_test_deps="mxf_d10_test"
  1697. zlib_test_deps="zlib"
  1698. zmbv_test_deps="zlib"
  1699. test_deps(){
  1700. suf1=$1
  1701. suf2=$2
  1702. shift 2
  1703. for v; do
  1704. dep=${v%=*}
  1705. tests=${v#*=}
  1706. for name in ${tests}; do
  1707. append ${name}_test_deps ${dep}$suf1 ${dep}$suf2
  1708. done
  1709. done
  1710. }
  1711. test_deps _muxer _demuxer \
  1712. aiff \
  1713. pcm_alaw=alaw \
  1714. asf \
  1715. au \
  1716. avi \
  1717. dv=dv_fmt \
  1718. ffm \
  1719. flv=flv_fmt \
  1720. gxf \
  1721. matroska=mkv \
  1722. mmf \
  1723. mov="mov ismv" \
  1724. pcm_mulaw=mulaw \
  1725. mxf="mxf mxf_d10" \
  1726. nut \
  1727. ogg="ogg ogg_vp3" \
  1728. rawvideo=pixfmt \
  1729. rm \
  1730. swf \
  1731. mpegts=ts \
  1732. voc \
  1733. wav \
  1734. yuv4mpegpipe=yuv4mpeg \
  1735. # default parameters
  1736. logfile="config.log"
  1737. # installation paths
  1738. prefix_default="/usr/local"
  1739. bindir_default='${prefix}/bin'
  1740. datadir_default='${prefix}/share/ffmpeg'
  1741. incdir_default='${prefix}/include'
  1742. libdir_default='${prefix}/lib'
  1743. mandir_default='${prefix}/share/man'
  1744. shlibdir_default="$libdir_default"
  1745. postproc_version_default="current"
  1746. # toolchain
  1747. ar_default="ar"
  1748. cc_default="gcc"
  1749. cxx_default="g++"
  1750. host_cc_default="gcc"
  1751. install="install"
  1752. ln_s="ln -sf"
  1753. nm_default="nm"
  1754. objformat="elf"
  1755. pkg_config_default=pkg-config
  1756. ranlib="ranlib"
  1757. strip_default="strip"
  1758. yasmexe_default="yasm"
  1759. nm_opts='-g'
  1760. nogas=":"
  1761. # machine
  1762. arch_default=$(uname -m)
  1763. cpu="generic"
  1764. # OS
  1765. target_os_default=$(tolower $(uname -s))
  1766. host_os=$target_os_default
  1767. # alternative libpostproc version
  1768. ALT_PP_VER_MAJOR=51
  1769. ALT_PP_VER_MINOR=2
  1770. ALT_PP_VER_MICRO=101
  1771. ALT_PP_VER=$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO
  1772. # configurable options
  1773. enable $PROGRAM_LIST
  1774. enable avcodec
  1775. enable avdevice
  1776. enable avfilter
  1777. enable avformat
  1778. enable avutil
  1779. enable postproc
  1780. enable stripping
  1781. enable swresample
  1782. enable swscale
  1783. enable asm
  1784. enable debug
  1785. enable doc
  1786. enable fastdiv
  1787. enable network
  1788. enable optimizations
  1789. enable safe_bitstream_reader
  1790. enable static
  1791. enable swscale_alpha
  1792. # build settings
  1793. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1794. FFSERVERLDFLAGS=-Wl,-E
  1795. LIBPREF="lib"
  1796. LIBSUF=".a"
  1797. FULLNAME='$(NAME)$(BUILDSUF)'
  1798. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1799. SLIBPREF="lib"
  1800. SLIBSUF=".so"
  1801. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1802. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1803. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1804. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1805. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  1806. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  1807. asflags_filter=echo
  1808. cflags_filter=echo
  1809. ldflags_filter=echo
  1810. AS_C='-c'
  1811. AS_O='-o $@'
  1812. CC_C='-c'
  1813. CC_E='-E -o $@'
  1814. CC_O='-o $@'
  1815. CXX_C='-c'
  1816. CXX_O='-o $@'
  1817. LD_O='-o $@'
  1818. HOSTCC_C='-c'
  1819. HOSTCC_O='-o $@'
  1820. host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
  1821. host_libs='-lm'
  1822. host_cflags_filter=echo
  1823. host_ldflags_filter=echo
  1824. target_path='$(CURDIR)'
  1825. # since the object filename is not given with the -MM flag, the compiler
  1826. # is only able to print the basename, and we must add the path ourselves
  1827. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  1828. DEPFLAGS='-MM'
  1829. # find source path
  1830. if test -f configure; then
  1831. source_path=.
  1832. else
  1833. source_path=$(cd $(dirname "$0"); pwd)
  1834. echo "$source_path" | grep -q '[[:blank:]]' &&
  1835. die "Out of tree builds are impossible with whitespace in source path."
  1836. test -e "$source_path/config.h" &&
  1837. die "Out of tree builds are impossible with config.h in source dir."
  1838. fi
  1839. for v in "$@"; do
  1840. r=${v#*=}
  1841. l=${v%"$r"}
  1842. r=$(sh_quote "$r")
  1843. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1844. done
  1845. find_things(){
  1846. thing=$1
  1847. pattern=$2
  1848. file=$source_path/$3
  1849. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1850. }
  1851. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1852. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1853. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1854. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1855. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1856. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1857. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1858. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1859. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1860. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1861. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1862. ALL_COMPONENTS="
  1863. $BSF_LIST
  1864. $DECODER_LIST
  1865. $DEMUXER_LIST
  1866. $ENCODER_LIST
  1867. $FILTER_LIST
  1868. $HWACCEL_LIST
  1869. $INDEV_LIST
  1870. $MUXER_LIST
  1871. $OUTDEV_LIST
  1872. $PARSER_LIST
  1873. $PROTOCOL_LIST
  1874. "
  1875. find_tests(){
  1876. map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
  1877. }
  1878. LAVF_FATE_TESTS=$(find_tests lavf-fate)
  1879. LAVF_TESTS=$(find_tests lavf)
  1880. LAVFI_TESTS=$(find_tests lavfi)
  1881. SEEK_TESTS=$(find_tests seek seek_)
  1882. ALL_TESTS="$LAVF_FATE_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS"
  1883. for n in $COMPONENT_LIST; do
  1884. v=$(toupper ${n%s})_LIST
  1885. eval enable \$$v
  1886. eval ${n}_if_any="\$$v"
  1887. done
  1888. enable $ARCH_EXT_LIST $ALL_TESTS
  1889. die_unknown(){
  1890. echo "Unknown option \"$1\"."
  1891. echo "See $0 --help for available options."
  1892. exit 1
  1893. }
  1894. show_list() {
  1895. suffix=_$1
  1896. shift
  1897. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
  1898. exit 0
  1899. }
  1900. rand_list(){
  1901. IFS=', '
  1902. set -- $*
  1903. unset IFS
  1904. for thing; do
  1905. comp=${thing%:*}
  1906. prob=${thing#$comp}
  1907. prob=${prob#:}
  1908. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  1909. echo "prob ${prob:-0.5}"
  1910. printf '%s\n' $comp
  1911. done
  1912. }
  1913. do_random(){
  1914. action=$1
  1915. shift
  1916. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  1917. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  1918. }
  1919. for opt do
  1920. optval="${opt#*=}"
  1921. case "$opt" in
  1922. --extra-ldflags=*) add_ldflags $optval
  1923. ;;
  1924. --extra-libs=*) add_extralibs $optval
  1925. ;;
  1926. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1927. ;;
  1928. --enable-debug=*) debuglevel="$optval"
  1929. ;;
  1930. --disable-everything)
  1931. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  1932. ;;
  1933. --enable-random|--disable-random)
  1934. action=${opt%%-random}
  1935. do_random ${action#--} $COMPONENT_LIST
  1936. ;;
  1937. --enable-random=*|--disable-random=*)
  1938. action=${opt%%-random=*}
  1939. do_random ${action#--} $optval
  1940. ;;
  1941. --enable-*=*|--disable-*=*)
  1942. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  1943. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  1944. eval list=\$$(toupper $thing)_LIST
  1945. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  1946. $action $(filter "$name" $list)
  1947. ;;
  1948. --enable-?*|--disable-?*)
  1949. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  1950. if is_in $option $COMPONENT_LIST; then
  1951. test $action = disable && action=unset
  1952. eval $action \$$(toupper ${option%s})_LIST
  1953. elif is_in $option $CMDLINE_SELECT; then
  1954. $action $option
  1955. else
  1956. die_unknown $opt
  1957. fi
  1958. ;;
  1959. --list-*)
  1960. NAME="${opt#--list-}"
  1961. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1962. NAME=${NAME%s}
  1963. eval show_list $NAME \$$(toupper $NAME)_LIST
  1964. ;;
  1965. --help|-h) show_help
  1966. ;;
  1967. *)
  1968. optname="${opt%%=*}"
  1969. optname="${optname#--}"
  1970. optname=$(echo "$optname" | sed 's/-/_/g')
  1971. if is_in $optname $CMDLINE_SET; then
  1972. eval $optname='$optval'
  1973. elif is_in $optname $CMDLINE_APPEND; then
  1974. append $optname "$optval"
  1975. else
  1976. die_unknown $opt
  1977. fi
  1978. ;;
  1979. esac
  1980. done
  1981. disabled logging && logfile=/dev/null
  1982. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  1983. set >> $logfile
  1984. test -n "$cross_prefix" && enable cross_compile
  1985. if enabled cross_compile; then
  1986. test -n "$arch" && test -n "$target_os" ||
  1987. die "Must specify target arch and OS when cross-compiling"
  1988. fi
  1989. set_default arch target_os postproc_version
  1990. # Check if we should build alternative libpostproc version instead of current
  1991. if test "$postproc_version" = $ALT_PP_VER; then
  1992. LIBPOSTPROC_VERSION=$ALT_PP_VER
  1993. LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR
  1994. LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR
  1995. LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO
  1996. elif test "$postproc_version" != current; then
  1997. die "Invalid argument to --postproc-version. See --help output."
  1998. fi
  1999. ar_default="${cross_prefix}${ar_default}"
  2000. cc_default="${cross_prefix}${cc_default}"
  2001. cxx_default="${cross_prefix}${cxx_default}"
  2002. nm_default="${cross_prefix}${nm_default}"
  2003. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2004. ranlib="${cross_prefix}${ranlib}"
  2005. strip_default="${cross_prefix}${strip_default}"
  2006. sysinclude_default="${sysroot}/usr/include"
  2007. set_default cc cxx nm pkg_config strip sysinclude yasmexe
  2008. enabled cross_compile || host_cc_default=$cc
  2009. set_default host_cc
  2010. if ! $pkg_config --version >/dev/null 2>&1; then
  2011. warn "$pkg_config not found, library detection may fail."
  2012. pkg_config=false
  2013. fi
  2014. exesuf() {
  2015. case $1 in
  2016. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2017. esac
  2018. }
  2019. EXESUF=$(exesuf $target_os)
  2020. HOSTEXESUF=$(exesuf $host_os)
  2021. # set temporary file name
  2022. : ${TMPDIR:=$TEMPDIR}
  2023. : ${TMPDIR:=$TMP}
  2024. : ${TMPDIR:=/tmp}
  2025. if ! check_cmd mktemp -u XXXXXX; then
  2026. # simple replacement for missing mktemp
  2027. # NOT SAFE FOR GENERAL USE
  2028. mktemp(){
  2029. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2030. }
  2031. fi
  2032. tmpfile(){
  2033. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2034. (set -C; exec > $tmp) 2>/dev/null ||
  2035. die "Unable to create temporary file in $TMPDIR."
  2036. append TMPFILES $tmp
  2037. eval $1=$tmp
  2038. }
  2039. trap 'rm -f -- $TMPFILES' EXIT
  2040. tmpfile TMPASM .asm
  2041. tmpfile TMPC .c
  2042. tmpfile TMPCPP .cpp
  2043. tmpfile TMPE $EXESUF
  2044. tmpfile TMPH .h
  2045. tmpfile TMPO .o
  2046. tmpfile TMPS .S
  2047. tmpfile TMPSH .sh
  2048. tmpfile TMPV .ver
  2049. unset -f mktemp
  2050. chmod +x $TMPE
  2051. # make sure we can execute files in $TMPDIR
  2052. cat > $TMPSH 2>> $logfile <<EOF
  2053. #! /bin/sh
  2054. EOF
  2055. chmod +x $TMPSH >> $logfile 2>&1
  2056. if ! $TMPSH >> $logfile 2>&1; then
  2057. cat <<EOF
  2058. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2059. variable to another directory and make sure that it is not mounted noexec.
  2060. EOF
  2061. die "Sanity test failed."
  2062. fi
  2063. pgi_flags(){
  2064. for flag; do
  2065. case $flag in
  2066. -fomit-frame-pointer) echo -Mnoframe ;;
  2067. -g) echo -gopt ;;
  2068. *) echo $flag ;;
  2069. esac
  2070. done
  2071. }
  2072. suncc_flags(){
  2073. for flag; do
  2074. case $flag in
  2075. -march=*|-mcpu=*)
  2076. case "${flag#*=}" in
  2077. native) echo -xtarget=native ;;
  2078. v9|niagara) echo -xarch=sparc ;;
  2079. ultrasparc) echo -xarch=sparcvis ;;
  2080. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2081. i586|pentium) echo -xchip=pentium ;;
  2082. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2083. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2084. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2085. pentium4*) echo -xtarget=pentium4 ;;
  2086. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2087. *-sse3) echo -xarch=sse3 ;;
  2088. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2089. amdfam10|barcelona) echo -xarch=sse4_1 ;;
  2090. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2091. k8|opteron|athlon64|athlon-fx)
  2092. echo -xarch=sse2a ;;
  2093. athlon*) echo -xarch=pentium_proa ;;
  2094. esac
  2095. ;;
  2096. -std=c99) echo -xc99 ;;
  2097. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2098. -fPIC) echo -KPIC -xcode=pic32 ;;
  2099. -W*,*) echo $flag ;;
  2100. -f*-*|-W*) ;;
  2101. *) echo $flag ;;
  2102. esac
  2103. done
  2104. }
  2105. tms470_flags(){
  2106. for flag; do
  2107. case $flag in
  2108. -march=*|-mcpu=*)
  2109. case "${flag#*=}" in
  2110. armv7-a|cortex-a*) echo -mv=7a8 ;;
  2111. armv7-r|cortex-r*) echo -mv=7r4 ;;
  2112. armv7-m|cortex-m*) echo -mv=7m3 ;;
  2113. armv6*|arm11*) echo -mv=6 ;;
  2114. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  2115. echo -mv=5e ;;
  2116. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  2117. esac
  2118. ;;
  2119. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  2120. -mfpu=vfp) echo --float_support=vfpv2 ;;
  2121. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  2122. -msoft-float) echo --float_support=vfplib ;;
  2123. -O[0-3]|-mf=*) echo $flag ;;
  2124. -g) echo -g -mn ;;
  2125. -pds=*) echo $flag ;;
  2126. -D*|-I*) echo $flag ;;
  2127. --gcc|--abi=*) echo $flag ;;
  2128. -me) echo $flag ;;
  2129. esac
  2130. done
  2131. }
  2132. probe_cc(){
  2133. pfx=$1
  2134. _cc=$2
  2135. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags _ldflags
  2136. unset _depflags _DEPCMD _DEPFLAGS
  2137. _flags_filter=echo
  2138. if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2139. _type=llvm_gcc
  2140. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  2141. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  2142. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2143. _cflags_speed='-O3'
  2144. _cflags_size='-Os'
  2145. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  2146. _type=gcc
  2147. gcc_version=$($_cc --version | head -n1)
  2148. gcc_basever=$($_cc -dumpversion)
  2149. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2150. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2151. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2152. if ! $_cc -dumpversion | grep -q '^2\.'; then
  2153. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2154. fi
  2155. _cflags_speed='-O3'
  2156. _cflags_size='-Os'
  2157. elif $_cc --version 2>/dev/null | grep -q Intel; then
  2158. _type=icc
  2159. _ident=$($_cc --version | head -n1)
  2160. _depflags='-MMD'
  2161. _cflags_speed='-O3'
  2162. _cflags_size='-Os'
  2163. _cflags_noopt='-O1'
  2164. elif $_cc -v 2>&1 | grep -q xlc; then
  2165. _type=xlc
  2166. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  2167. _cflags_speed='-O5'
  2168. _cflags_size='-O5 -qcompact'
  2169. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  2170. _type=ccc
  2171. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  2172. _DEPFLAGS='-M'
  2173. debuglevel=3
  2174. _ldflags='-Wl,-z,now' # calls to libots crash without this
  2175. _cflags_speed='-fast'
  2176. _cflags_size='-O1'
  2177. elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  2178. test -d "$sysroot" || die "No valid sysroot specified."
  2179. _type=armcc
  2180. _ident=$($_cc --vsn | head -n1)
  2181. armcc_conf="$PWD/armcc.conf"
  2182. $_cc --arm_linux_configure \
  2183. --arm_linux_config_file="$armcc_conf" \
  2184. --configure_sysroot="$sysroot" \
  2185. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2186. die "Error creating armcc configuration file."
  2187. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2188. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  2189. as_default="${cross_prefix}gcc"
  2190. _depflags='-MMD'
  2191. _cflags_speed='-O3'
  2192. _cflags_size='-Os'
  2193. elif $_cc -version 2>/dev/null | grep -q TMS470; then
  2194. _type=tms470
  2195. _ident=$($_cc -version | head -n1 | tr -s ' ')
  2196. _flags='--gcc --abi=eabi -me'
  2197. _cflags='-D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__='
  2198. _cc_e='-ppl -fe=$@'
  2199. _cc_o='-fe=$@'
  2200. as_default="${cross_prefix}gcc"
  2201. ld_default="${cross_prefix}gcc"
  2202. _depflags='-ppa -ppd=$(@:.o=.d)'
  2203. _cflags_speed='-O3 -mf=5'
  2204. _cflags_size='-O3 -mf=2'
  2205. _flags_filter=tms470_flags
  2206. elif $_cc -v 2>&1 | grep -q clang; then
  2207. _type=clang
  2208. _ident=$($_cc --version | head -n1)
  2209. _depflags='-MMD'
  2210. _cflags_speed='-O3'
  2211. _cflags_size='-Os'
  2212. elif $_cc -V 2>&1 | grep -q Sun; then
  2213. _type=suncc
  2214. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2215. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2216. _DEPFLAGS='-xM1'
  2217. _ldflags='-std=c99'
  2218. _cflags_speed='-O5'
  2219. _cflags_size='-O5 -xspace'
  2220. _flags_filter=suncc_flags
  2221. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2222. _type=pathscale
  2223. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2224. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2225. _cflags_speed='-O2'
  2226. _cflags_size='-Os'
  2227. _flags_filter='filter_out -Wdisabled-optimization'
  2228. elif $_cc -v 2>&1 | grep -q Open64; then
  2229. _type=open64
  2230. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2231. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2232. _cflags_speed='-O2'
  2233. _cflags_size='-Os'
  2234. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2235. elif $_cc -V 2>&1 | grep -q Portland; then
  2236. _type=pgi
  2237. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  2238. opt_common='-alias=ansi -Mlre -Mpre'
  2239. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  2240. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  2241. _cflags_noopt="-O1"
  2242. _flags_filter=pgi_flags
  2243. fi
  2244. eval ${pfx}_type=\$_type
  2245. eval ${pfx}_ident=\$_ident
  2246. }
  2247. set_ccvars(){
  2248. eval ${1}_C=\${_cc_c-\${${1}_C}}
  2249. eval ${1}_E=\${_cc_e-\${${1}_E}}
  2250. eval ${1}_O=\${_cc_o-\${${1}_O}}
  2251. if [ -n "$_depflags" ]; then
  2252. eval ${1}_DEPFLAGS=\$_depflags
  2253. else
  2254. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  2255. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  2256. eval DEP${1}FLAGS=\$_flags
  2257. fi
  2258. }
  2259. probe_cc cc "$cc"
  2260. cflags_filter=$_flags_filter
  2261. cflags_speed=$_cflags_speed
  2262. cflags_size=$_cflags_size
  2263. cflags_noopt=$_cflags_noopt
  2264. add_cflags $_flags $_cflags
  2265. cc_ldflags=$_ldflags
  2266. set_ccvars CC
  2267. probe_cc hostcc "$host_cc"
  2268. host_cflags_filter=$_flags_filter
  2269. host_ldflags_filter=$_flags_filter
  2270. add_host_cflags $_flags $_cflags
  2271. add_host_ldflags $_flags $_ldflags
  2272. set_ccvars HOSTCC
  2273. test -n "$cc_type" && enable $cc_type ||
  2274. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  2275. : ${as_default:=$cc}
  2276. : ${dep_cc_default:=$cc}
  2277. : ${ld_default:=$cc}
  2278. set_default ar as dep_cc ld
  2279. probe_cc as "$as"
  2280. asflags_filter=$_flags_filter
  2281. add_asflags $_flags $_cflags
  2282. set_ccvars AS
  2283. probe_cc ld "$ld"
  2284. ldflags_filter=$_flags_filter
  2285. add_ldflags $_flags $_ldflags
  2286. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  2287. LD_O=${_cc_o-$LD_O}
  2288. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  2289. probe_cc depcc "$dep_cc"
  2290. CCDEP=${_DEPCMD:-$DEPCMD}
  2291. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  2292. DEPCCFLAGS=$_flags
  2293. fi
  2294. add_cflags $extra_cflags
  2295. add_cxxflags $extra_cxxflags
  2296. add_asflags $extra_cflags
  2297. if test -n "$sysroot"; then
  2298. case "$cc_type" in
  2299. gcc|llvm_gcc|clang)
  2300. add_cppflags --sysroot="$sysroot"
  2301. add_ldflags --sysroot="$sysroot"
  2302. ;;
  2303. tms470)
  2304. add_cppflags -I"$sysinclude"
  2305. add_ldflags --sysroot="$sysroot"
  2306. ;;
  2307. esac
  2308. fi
  2309. if test "$cpu" = host; then
  2310. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  2311. case "$cc_type" in
  2312. gcc|llvm_gcc)
  2313. check_native(){
  2314. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  2315. sed -n "/cc1.*$1=/{
  2316. s/.*$1=\\([^ ]*\\).*/\\1/
  2317. p
  2318. q
  2319. }" $TMPE
  2320. }
  2321. cpu=$(check_native -march || check_native -mcpu)
  2322. ;;
  2323. esac
  2324. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  2325. fi
  2326. # Deal with common $arch aliases
  2327. case "$arch" in
  2328. arm*|iPad*)
  2329. arch="arm"
  2330. ;;
  2331. mips|mipsel|IP*)
  2332. arch="mips"
  2333. ;;
  2334. mips64*)
  2335. arch="mips"
  2336. subarch="mips64"
  2337. ;;
  2338. parisc|hppa)
  2339. arch="parisc"
  2340. ;;
  2341. parisc64|hppa64)
  2342. arch="parisc"
  2343. subarch="parisc64"
  2344. ;;
  2345. "Power Macintosh"|ppc|powerpc|ppc64|powerpc64)
  2346. arch="ppc"
  2347. ;;
  2348. s390|s390x)
  2349. arch="s390"
  2350. ;;
  2351. sh4|sh)
  2352. arch="sh4"
  2353. ;;
  2354. sun4u|sparc64)
  2355. arch="sparc"
  2356. subarch="sparc64"
  2357. ;;
  2358. i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  2359. arch="x86"
  2360. ;;
  2361. esac
  2362. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  2363. enable $arch
  2364. # Add processor-specific flags
  2365. if test "$cpu" = generic; then
  2366. : do nothing
  2367. elif enabled ppc; then
  2368. case $(tolower $cpu) in
  2369. 601|ppc601|powerpc601)
  2370. cpuflags="-mcpu=601"
  2371. disable altivec
  2372. ;;
  2373. 603*|ppc603*|powerpc603*)
  2374. cpuflags="-mcpu=603"
  2375. disable altivec
  2376. ;;
  2377. 604*|ppc604*|powerpc604*)
  2378. cpuflags="-mcpu=604"
  2379. disable altivec
  2380. ;;
  2381. g3|75*|ppc75*|powerpc75*)
  2382. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  2383. disable altivec
  2384. ;;
  2385. g4|745*|ppc745*|powerpc745*)
  2386. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  2387. ;;
  2388. 74*|ppc74*|powerpc74*)
  2389. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  2390. ;;
  2391. g5|970|ppc970|powerpc970)
  2392. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  2393. ;;
  2394. power[3-7]*)
  2395. cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64"
  2396. ;;
  2397. cell)
  2398. cpuflags="-mcpu=cell"
  2399. enable ldbrx
  2400. ;;
  2401. e500v2)
  2402. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  2403. disable altivec
  2404. ;;
  2405. e500)
  2406. cpuflags="-mcpu=8540 -mhard-float"
  2407. disable altivec
  2408. ;;
  2409. esac
  2410. elif enabled x86; then
  2411. case $cpu in
  2412. i[345]86|pentium)
  2413. cpuflags="-march=$cpu"
  2414. disable mmx
  2415. ;;
  2416. # targets that do NOT support conditional mov (cmov)
  2417. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  2418. cpuflags="-march=$cpu"
  2419. disable cmov
  2420. ;;
  2421. # targets that do support conditional mov (cmov)
  2422. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom)
  2423. cpuflags="-march=$cpu"
  2424. enable cmov
  2425. enable fast_cmov
  2426. ;;
  2427. # targets that do support conditional mov but on which it's slow
  2428. pentium4|pentium4m|prescott|nocona)
  2429. cpuflags="-march=$cpu"
  2430. enable cmov
  2431. disable fast_cmov
  2432. ;;
  2433. esac
  2434. elif enabled sparc; then
  2435. case $cpu in
  2436. niagara)
  2437. cpuflags="-mcpu=$cpu"
  2438. disable vis
  2439. ;;
  2440. sparc64)
  2441. cpuflags="-mcpu=v9"
  2442. ;;
  2443. esac
  2444. elif enabled arm; then
  2445. case $cpu in
  2446. armv*)
  2447. cpuflags="-march=$cpu"
  2448. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  2449. ;;
  2450. *)
  2451. cpuflags="-mcpu=$cpu"
  2452. case $cpu in
  2453. cortex-a*) subarch=armv7a ;;
  2454. cortex-r*) subarch=armv7r ;;
  2455. cortex-m*) enable thumb; subarch=armv7m ;;
  2456. arm11*) subarch=armv6 ;;
  2457. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  2458. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  2459. esac
  2460. ;;
  2461. esac
  2462. elif enabled alpha; then
  2463. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  2464. elif enabled bfin; then
  2465. cpuflags="-mcpu=$cpu"
  2466. elif enabled mips; then
  2467. cpuflags="-march=$cpu"
  2468. case $cpu in
  2469. 24kc)
  2470. disable mipsfpu
  2471. disable mipsdspr1
  2472. disable mipsdspr2
  2473. ;;
  2474. 24kf*)
  2475. disable mipsdspr1
  2476. disable mipsdspr2
  2477. ;;
  2478. 24kec|34kc|1004kc)
  2479. disable mipsfpu
  2480. disable mipsdspr2
  2481. ;;
  2482. 24kef*|34kf*|1004kf*)
  2483. disable mipsdspr2
  2484. ;;
  2485. 74kc)
  2486. disable mipsfpu
  2487. ;;
  2488. esac
  2489. elif enabled avr32; then
  2490. case $cpu in
  2491. ap7[02]0[0-2])
  2492. subarch="avr32_ap"
  2493. cpuflags="-mpart=$cpu"
  2494. ;;
  2495. ap)
  2496. subarch="avr32_ap"
  2497. cpuflags="-march=$cpu"
  2498. ;;
  2499. uc3[ab]*)
  2500. subarch="avr32_uc"
  2501. cpuflags="-mcpu=$cpu"
  2502. ;;
  2503. uc)
  2504. subarch="avr32_uc"
  2505. cpuflags="-march=$cpu"
  2506. ;;
  2507. esac
  2508. fi
  2509. add_cflags $cpuflags
  2510. add_asflags $cpuflags
  2511. # compiler sanity check
  2512. check_exec <<EOF
  2513. int main(void){ return 0; }
  2514. EOF
  2515. if test "$?" != 0; then
  2516. echo "$cc is unable to create an executable file."
  2517. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  2518. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  2519. echo "Only do this if you know what cross compiling means."
  2520. fi
  2521. die "C compiler test failed."
  2522. fi
  2523. add_cppflags -D_ISOC99_SOURCE
  2524. add_cxxflags -D__STDC_CONSTANT_MACROS
  2525. check_cflags -std=c99
  2526. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  2527. #include <stdlib.h>
  2528. EOF
  2529. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  2530. #include <stdlib.h>
  2531. EOF
  2532. check_host_cflags -std=c99
  2533. check_host_cflags -Wall
  2534. case "$arch" in
  2535. alpha|ia64|mips|parisc|sparc)
  2536. spic=$shared
  2537. ;;
  2538. x86)
  2539. subarch="x86_32"
  2540. check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
  2541. if test "$subarch" = "x86_64"; then
  2542. spic=$shared
  2543. fi
  2544. ;;
  2545. ppc)
  2546. check_cc <<EOF && subarch="ppc64"
  2547. int test[(int)sizeof(char*) - 7];
  2548. EOF
  2549. ;;
  2550. esac
  2551. enable $subarch
  2552. enabled spic && enable pic
  2553. # OS specific
  2554. case $target_os in
  2555. haiku)
  2556. prefix_default="/boot/common"
  2557. network_extralibs="-lnetwork"
  2558. host_libs=
  2559. ;;
  2560. sunos)
  2561. FFSERVERLDFLAGS=""
  2562. SHFLAGS='-shared -Wl,-h,$$(@F)'
  2563. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  2564. network_extralibs="-lsocket -lnsl"
  2565. add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  2566. # When using suncc to build, the Solaris linker will mark
  2567. # an executable with each instruction set encountered by
  2568. # the Solaris assembler. As our libraries contain their own
  2569. # guards for processor-specific code, instead suppress
  2570. # generation of the HWCAPS ELF section on Solaris x86 only.
  2571. enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile
  2572. nm_opts='-P -g'
  2573. ;;
  2574. netbsd)
  2575. disable symver
  2576. oss_indev_extralibs="-lossaudio"
  2577. oss_outdev_extralibs="-lossaudio"
  2578. ;;
  2579. openbsd|bitrig)
  2580. # On OpenBSD 4.5. the compiler does not use PIC unless
  2581. # explicitly using -fPIC. FFmpeg builds fine without PIC,
  2582. # however the generated executable will not do anything
  2583. # (simply quits with exit-code 1, no crash, no output).
  2584. # Thus explicitly enable PIC here.
  2585. enable pic
  2586. disable symver
  2587. SHFLAGS='-shared'
  2588. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
  2589. oss_indev_extralibs="-lossaudio"
  2590. oss_outdev_extralibs="-lossaudio"
  2591. ;;
  2592. dragonfly)
  2593. disable symver
  2594. ;;
  2595. freebsd)
  2596. ;;
  2597. bsd/os)
  2598. add_extralibs -lpoll -lgnugetopt
  2599. strip="strip -d"
  2600. ;;
  2601. darwin)
  2602. gas="gas-preprocessor.pl $cc"
  2603. enabled ppc && add_asflags -force_cpusubtype_ALL
  2604. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  2605. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  2606. strip="${strip} -x"
  2607. add_ldflags -Wl,-dynamic,-search_paths_first
  2608. SLIBSUF=".dylib"
  2609. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  2610. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  2611. FFSERVERLDFLAGS=-Wl,-bind_at_load
  2612. objformat="macho"
  2613. enabled x86_64 && objformat="macho64"
  2614. enabled_any pic shared ||
  2615. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  2616. ;;
  2617. mingw32*)
  2618. if test $target_os = "mingw32ce"; then
  2619. disable network
  2620. else
  2621. target_os=mingw32
  2622. fi
  2623. LIBTARGET=i386
  2624. if enabled x86_64; then
  2625. LIBTARGET="i386:x86-64"
  2626. elif enabled arm; then
  2627. LIBTARGET=arm-wince
  2628. fi
  2629. shlibdir_default="$bindir_default"
  2630. SLIBPREF=""
  2631. SLIBSUF=".dll"
  2632. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2633. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2634. dlltool="${cross_prefix}dlltool"
  2635. if check_cmd lib.exe; then
  2636. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  2637. if enabled x86_64; then
  2638. LIBTARGET=x64
  2639. fi
  2640. elif check_cmd $dlltool --version; then
  2641. SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  2642. fi
  2643. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  2644. SLIB_INSTALL_LINKS=
  2645. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  2646. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  2647. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  2648. objformat="win32"
  2649. enable dos_paths
  2650. check_cflags -fno-common
  2651. check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
  2652. || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  2653. die "ERROR: MinGW runtime version must be >= 3.15."
  2654. add_cppflags -U__STRICT_ANSI__
  2655. ;;
  2656. cygwin*)
  2657. target_os=cygwin
  2658. shlibdir_default="$bindir_default"
  2659. SLIBPREF="cyg"
  2660. SLIBSUF=".dll"
  2661. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2662. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2663. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  2664. objformat="win32"
  2665. enable dos_paths
  2666. check_cflags -fno-common
  2667. add_cppflags -U__STRICT_ANSI__
  2668. ;;
  2669. *-dos|freedos|opendos)
  2670. network_extralibs="-lsocket"
  2671. objformat="coff"
  2672. enable dos_paths
  2673. add_cppflags -U__STRICT_ANSI__
  2674. ;;
  2675. linux)
  2676. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2677. enable dv1394
  2678. ;;
  2679. irix*)
  2680. target_os=irix
  2681. ranlib="echo ignoring ranlib"
  2682. ;;
  2683. os/2*)
  2684. strip="lxlite -CS"
  2685. ln_s="cp -f"
  2686. objformat="aout"
  2687. add_cppflags -D_GNU_SOURCE
  2688. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  2689. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  2690. FFSERVERLDFLAGS=""
  2691. LIBSUF="_s.a"
  2692. SLIBPREF=""
  2693. SLIBSUF=".dll"
  2694. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  2695. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  2696. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  2697. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  2698. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  2699. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  2700. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  2701. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  2702. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  2703. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  2704. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  2705. enable dos_paths
  2706. enable_weak os2threads
  2707. ;;
  2708. gnu/kfreebsd)
  2709. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
  2710. ;;
  2711. gnu)
  2712. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2713. ;;
  2714. qnx)
  2715. add_cppflags -D_QNX_SOURCE
  2716. network_extralibs="-lsocket"
  2717. ;;
  2718. symbian)
  2719. SLIBSUF=".dll"
  2720. enable dos_paths
  2721. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  2722. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  2723. add_ldflags -Wl,--target1-abs,--no-undefined \
  2724. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  2725. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  2726. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  2727. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  2728. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  2729. ;;
  2730. none)
  2731. ;;
  2732. *)
  2733. die "Unknown OS '$target_os'."
  2734. ;;
  2735. esac
  2736. esc(){
  2737. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  2738. }
  2739. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  2740. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
  2741. set_default $PATHS_LIST
  2742. # we need to build at least one lib type
  2743. if ! enabled_any static shared; then
  2744. cat <<EOF
  2745. At least one library type must be built.
  2746. Specify --enable-static to build the static libraries or --enable-shared to
  2747. build the shared libraries as well. To only build the shared libraries specify
  2748. --disable-static in addition to --enable-shared.
  2749. EOF
  2750. exit 1;
  2751. fi
  2752. die_license_disabled() {
  2753. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  2754. }
  2755. die_license_disabled_gpl() {
  2756. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  2757. }
  2758. die_license_disabled gpl libcdio
  2759. die_license_disabled gpl libutvideo
  2760. die_license_disabled gpl libx264
  2761. die_license_disabled gpl libxavs
  2762. die_license_disabled gpl libxvid
  2763. die_license_disabled gpl x11grab
  2764. die_license_disabled nonfree libaacplus
  2765. die_license_disabled nonfree libfaac
  2766. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  2767. enabled gpl && die_license_disabled_gpl nonfree openssl
  2768. die_license_disabled version3 libopencore_amrnb
  2769. die_license_disabled version3 libopencore_amrwb
  2770. die_license_disabled version3 libvo_aacenc
  2771. die_license_disabled version3 libvo_amrwbenc
  2772. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  2773. disabled optimizations || check_cflags -fomit-frame-pointer
  2774. enable_pic() {
  2775. enable pic
  2776. add_cppflags -DPIC
  2777. add_cflags -fPIC
  2778. add_asflags -fPIC
  2779. }
  2780. enabled pic && enable_pic
  2781. check_cc <<EOF || die "Symbol mangling check failed."
  2782. int ff_extern;
  2783. EOF
  2784. sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  2785. extern_prefix=${sym%%ff_extern*}
  2786. check_cc <<EOF && enable inline_asm
  2787. void foo(void) { __asm__ volatile ("" ::); }
  2788. EOF
  2789. _restrict=
  2790. for restrict_keyword in restrict __restrict__ __restrict; do
  2791. check_cc <<EOF && _restrict=$restrict_keyword && break
  2792. void foo(char * $restrict_keyword p);
  2793. EOF
  2794. done
  2795. check_cc <<EOF && enable attribute_packed
  2796. struct { int x; } __attribute__((packed)) x;
  2797. EOF
  2798. check_cc <<EOF && enable attribute_may_alias
  2799. union { int x; } __attribute__((may_alias)) x;
  2800. EOF
  2801. check_cc <<EOF || die "endian test failed"
  2802. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  2803. EOF
  2804. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  2805. if enabled alpha; then
  2806. check_cflags -mieee
  2807. elif enabled arm; then
  2808. enabled thumb && check_cflags -mthumb || check_cflags -marm
  2809. nogas=die
  2810. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  2811. enable vfp_args
  2812. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  2813. case "${cross_prefix:-$cc}" in
  2814. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  2815. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  2816. __asm__ (".eabi_attribute 28, 1");
  2817. int main(void) { return 0; }
  2818. EOF
  2819. esac
  2820. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  2821. fi
  2822. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  2823. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  2824. enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
  2825. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  2826. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  2827. enabled vfpv3 && check_asm vfpv3 '"vmov.f32 s0, #1.0"'
  2828. check_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
  2829. enabled_all armv6t2 shared !pic && enable_pic
  2830. elif enabled mips; then
  2831. check_asm loongson '"dmult.g $1, $2, $3"'
  2832. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  2833. enabled mips32r2 && add_cflags "-mips32r2" &&
  2834. check_asm mips32r2 '"rotr $t0, $t1, 1"'
  2835. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  2836. check_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  2837. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  2838. check_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  2839. enabled mipsfpu && add_cflags "-mhard-float" &&
  2840. check_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  2841. elif enabled ppc; then
  2842. enable local_aligned_8 local_aligned_16
  2843. check_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  2844. check_asm ibm_asm '"add 0, 0, 0"'
  2845. check_asm ppc4xx '"maclhw r10, r11, r12"'
  2846. check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  2847. # AltiVec flags: The FSF version of GCC differs from the Apple version
  2848. if enabled altivec; then
  2849. nogas=warn
  2850. check_cflags -maltivec -mabi=altivec &&
  2851. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  2852. check_cflags -faltivec
  2853. # check if our compiler supports Motorola AltiVec C API
  2854. check_cc <<EOF || disable altivec
  2855. $inc_altivec_h
  2856. int main(void) {
  2857. vector signed int v1, v2, v3;
  2858. v1 = vec_add(v2,v3);
  2859. return 0;
  2860. }
  2861. EOF
  2862. # check if our compiler supports braces for vector declarations
  2863. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  2864. $inc_altivec_h
  2865. int main (void) { (vector int) {1}; return 0; }
  2866. EOF
  2867. fi
  2868. elif enabled sparc; then
  2869. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  2870. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  2871. elif enabled x86; then
  2872. check_code ld immintrin.h "__xgetbv(0)" "cc" && enable xgetbv
  2873. check_code ld intrin.h "int info[4]; __cpuid(info, 0)" "cc" && enable cpuid
  2874. check_code ld intrin.h "__rdtsc()" "cc" && enable rdtsc
  2875. check_code ld intrin.h "unsigned int x = __readeflags()" "cc" && enable rweflags
  2876. check_code ld mmintrin.h "_mm_empty()" "cc" && enable mm_empty
  2877. enable local_aligned_8 local_aligned_16
  2878. # check whether EBP is available on x86
  2879. # As 'i' is stored on the stack, this program will crash
  2880. # if the base pointer is used to access it because the
  2881. # base pointer is cleared in the inline assembly code.
  2882. check_exec_crash <<EOF && enable ebp_available
  2883. volatile int i=0;
  2884. __asm__ volatile (
  2885. "xorl %%ebp, %%ebp"
  2886. ::: "%ebp");
  2887. return i;
  2888. EOF
  2889. # check whether EBX is available on x86
  2890. check_asm ebx_available '""::"b"(0)' &&
  2891. check_asm ebx_available '"":::"%ebx"'
  2892. # check whether xmm clobbers are supported
  2893. check_asm xmm_clobbers '"":::"%xmm0"'
  2894. # check whether binutils is new enough to compile SSSE3/MMXEXT
  2895. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  2896. enabled mmxext && check_asm mmxext '"pmaxub %mm0, %mm1"'
  2897. if ! disabled_any asm mmx yasm; then
  2898. if check_cmd $yasmexe --version; then
  2899. enabled x86_64 && yasm_extra="-m amd64"
  2900. yasm_debug="-g dwarf2"
  2901. elif check_cmd nasm -v; then
  2902. yasmexe=nasm
  2903. yasm_debug="-g -F dwarf"
  2904. enabled x86_64 && test "$objformat" = elf && objformat=elf64
  2905. fi
  2906. YASMFLAGS="-f $objformat $yasm_extra"
  2907. enabled pic && append YASMFLAGS "-DPIC"
  2908. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  2909. case "$objformat" in
  2910. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  2911. esac
  2912. check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
  2913. die "yasm not found, use --disable-yasm for a crippled build"
  2914. check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
  2915. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4
  2916. fi
  2917. case "$cpu" in
  2918. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  2919. disable fast_clz
  2920. ;;
  2921. esac
  2922. fi
  2923. if enabled asm; then
  2924. as=${gas:=$as}
  2925. check_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
  2926. $nogas "GNU assembler not found, install gas-preprocessor"
  2927. fi
  2928. check_ldflags -Wl,--as-needed
  2929. if check_func dlopen; then
  2930. ldl=
  2931. elif check_func dlopen -ldl; then
  2932. ldl=-ldl
  2933. fi
  2934. if enabled network; then
  2935. check_type "sys/types.h sys/socket.h" socklen_t
  2936. check_type netdb.h "struct addrinfo"
  2937. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  2938. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  2939. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  2940. check_type netinet/in.h "struct sockaddr_in6"
  2941. check_type poll.h "struct pollfd"
  2942. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  2943. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  2944. check_header netinet/sctp.h
  2945. check_func getaddrinfo $network_extralibs
  2946. # Prefer arpa/inet.h over winsock2
  2947. if check_header arpa/inet.h ; then
  2948. check_func closesocket
  2949. elif check_header winsock2.h ; then
  2950. check_func_headers winsock2.h closesocket -lws2 &&
  2951. network_extralibs="-lws2" ||
  2952. { check_func_headers winsock2.h closesocket -lws2_32 &&
  2953. network_extralibs="-lws2_32"; }
  2954. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  2955. check_type ws2tcpip.h socklen_t
  2956. check_type ws2tcpip.h "struct addrinfo"
  2957. check_type ws2tcpip.h "struct group_source_req"
  2958. check_type ws2tcpip.h "struct ip_mreq_source"
  2959. check_type ws2tcpip.h "struct ipv6_mreq"
  2960. check_type winsock2.h "struct pollfd"
  2961. check_type ws2tcpip.h "struct sockaddr_in6"
  2962. check_type ws2tcpip.h "struct sockaddr_storage"
  2963. check_struct winsock2.h "struct sockaddr" sa_len
  2964. else
  2965. disable network
  2966. fi
  2967. fi
  2968. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  2969. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  2970. check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
  2971. check_func fcntl
  2972. check_func fork
  2973. check_func gethrtime
  2974. check_func getopt
  2975. check_func getrusage
  2976. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  2977. check_func gettimeofday
  2978. check_func inet_aton $network_extralibs
  2979. check_func isatty
  2980. check_func localtime_r
  2981. check_func ${malloc_prefix}memalign && enable memalign
  2982. check_func mkstemp
  2983. check_func mmap
  2984. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  2985. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  2986. check_func setrlimit
  2987. check_func strerror_r
  2988. check_func strptime
  2989. check_func sched_getaffinity
  2990. check_func sysconf
  2991. check_func sysctl
  2992. check_func usleep
  2993. check_func_headers conio.h kbhit
  2994. check_func_headers windows.h PeekNamedPipe
  2995. check_func_headers io.h setmode
  2996. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  2997. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  2998. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  2999. check_func_headers windows.h GetProcessAffinityMask
  3000. check_func_headers windows.h GetProcessTimes
  3001. check_func_headers windows.h GetSystemTimeAsFileTime
  3002. check_func_headers windows.h MapViewOfFile
  3003. check_func_headers windows.h Sleep
  3004. check_func_headers windows.h VirtualAlloc
  3005. check_func_headers glob.h glob
  3006. check_header dlfcn.h
  3007. check_header dxva.h
  3008. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  3009. check_header libcrystalhd/libcrystalhd_if.h
  3010. check_header malloc.h
  3011. check_header poll.h
  3012. check_header sys/mman.h
  3013. check_header sys/param.h
  3014. check_header sys/resource.h
  3015. check_header sys/select.h
  3016. check_header sys/time.h
  3017. check_header termios.h
  3018. check_header unistd.h
  3019. check_header vdpau/vdpau.h
  3020. check_header vdpau/vdpau_x11.h
  3021. check_header windows.h
  3022. check_header X11/extensions/XvMClib.h
  3023. check_header asm/types.h
  3024. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  3025. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  3026. # check for VDA header
  3027. if ! disabled vda; then
  3028. if check_header VideoDecodeAcceleration/VDADecoder.h; then
  3029. enable vda
  3030. add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
  3031. fi
  3032. fi
  3033. if ! disabled w32threads && ! enabled pthreads; then
  3034. check_func _beginthreadex && enable w32threads
  3035. fi
  3036. # check for some common methods of building with pthread support
  3037. # do this before the optional library checks as some of them require pthreads
  3038. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  3039. enable pthreads
  3040. if check_func pthread_create; then
  3041. :
  3042. elif check_func pthread_create -pthread; then
  3043. add_cflags -pthread
  3044. add_extralibs -pthread
  3045. elif check_func pthread_create -pthreads; then
  3046. add_cflags -pthreads
  3047. add_extralibs -pthreads
  3048. elif check_func pthread_create -lpthreadGC2; then
  3049. add_extralibs -lpthreadGC2
  3050. elif ! check_lib pthread.h pthread_create -lpthread; then
  3051. disable pthreads
  3052. fi
  3053. fi
  3054. for thread in $THREADS_LIST; do
  3055. if enabled $thread; then
  3056. test -n "$thread_type" &&
  3057. die "ERROR: Only one thread type must be selected." ||
  3058. thread_type="$thread"
  3059. fi
  3060. done
  3061. if enabled pthreads; then
  3062. check_func pthread_cancel
  3063. fi
  3064. check_lib math.h sin -lm && LIBM="-lm"
  3065. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  3066. enabled vaapi && require vaapi va/va.h vaInitialize -lva
  3067. check_mathfunc cbrtf
  3068. check_mathfunc exp2
  3069. check_mathfunc exp2f
  3070. check_mathfunc isinf
  3071. check_mathfunc isnan
  3072. check_mathfunc llrint
  3073. check_mathfunc llrintf
  3074. check_mathfunc log2
  3075. check_mathfunc log2f
  3076. check_mathfunc lrint
  3077. check_mathfunc lrintf
  3078. check_mathfunc rint
  3079. check_mathfunc round
  3080. check_mathfunc roundf
  3081. check_mathfunc trunc
  3082. check_mathfunc truncf
  3083. # these are off by default, so fail if requested and not available
  3084. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
  3085. enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  3086. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  3087. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  3088. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  3089. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  3090. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  3091. enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
  3092. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  3093. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  3094. die "ERROR: libcelt version must be >= 0.11.0."; }
  3095. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  3096. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  3097. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  3098. 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"
  3099. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  3100. enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
  3101. enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
  3102. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  3103. enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
  3104. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  3105. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  3106. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  3107. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  3108. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  3109. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  3110. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  3111. enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
  3112. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  3113. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  3114. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  3115. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  3116. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  3117. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  3118. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  3119. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  3120. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  3121. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  3122. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  3123. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  3124. enabled libvpx && {
  3125. enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  3126. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  3127. enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  3128. die "ERROR: libvpx encoder version must be >=0.9.7"; } }
  3129. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
  3130. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  3131. die "ERROR: libx264 version must be >= 0.118."; }
  3132. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  3133. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  3134. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  3135. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  3136. die "ERROR: openal not found"; } &&
  3137. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  3138. die "ERROR: openal version must be 1.1 or compatible"; }
  3139. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  3140. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  3141. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  3142. die "ERROR: openssl not found"; }
  3143. if enabled gnutls; then
  3144. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  3145. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  3146. fi
  3147. # libdc1394 check
  3148. if enabled libdc1394; then
  3149. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  3150. enable libdc1394_2; } ||
  3151. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  3152. enable libdc1394_1; } ||
  3153. die "ERROR: No version of libdc1394 found "
  3154. fi
  3155. SDL_CONFIG="${cross_prefix}sdl-config"
  3156. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  3157. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3158. enable sdl &&
  3159. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3160. else
  3161. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  3162. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  3163. sdl_libs=$("${SDL_CONFIG}" --libs)
  3164. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  3165. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3166. enable sdl &&
  3167. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3168. fi
  3169. fi
  3170. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  3171. texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  3172. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  3173. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  3174. check_header linux/fb.h
  3175. check_header linux/videodev.h
  3176. check_header linux/videodev2.h
  3177. check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
  3178. check_header sys/videoio.h
  3179. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  3180. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  3181. # w32api 3.12 had it defined wrong
  3182. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  3183. check_type "dshow.h" IBaseFilter
  3184. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  3185. { check_header dev/bktr/ioctl_meteor.h &&
  3186. check_header dev/bktr/ioctl_bt848.h; } ||
  3187. { check_header machine/ioctl_meteor.h &&
  3188. check_header machine/ioctl_bt848.h; } ||
  3189. { check_header dev/video/meteor/ioctl_meteor.h &&
  3190. check_header dev/video/bktr/ioctl_bt848.h; } ||
  3191. check_header dev/ic/bt8xx.h
  3192. check_header sndio.h
  3193. if check_struct sys/soundcard.h audio_buf_info bytes; then
  3194. enable_safe sys/soundcard.h
  3195. else
  3196. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  3197. #include <sys/soundcard.h>
  3198. audio_buf_info abc;
  3199. EOF
  3200. fi
  3201. check_header soundcard.h
  3202. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  3203. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  3204. check_func jack_port_get_latency_range -ljack
  3205. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  3206. enabled libcdio &&
  3207. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio"
  3208. enabled x11grab &&
  3209. require X11 X11/Xlib.h XOpenDisplay -lX11 &&
  3210. require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
  3211. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  3212. if ! disabled vaapi; then
  3213. check_lib va/va.h vaInitialize -lva && {
  3214. check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
  3215. warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
  3216. } || disable vaapi
  3217. fi
  3218. if ! disabled vdpau && enabled vdpau_vdpau_h; then
  3219. check_cpp_condition \
  3220. vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  3221. { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
  3222. disable vdpau; }
  3223. fi
  3224. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  3225. enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
  3226. test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
  3227. # add some useful compiler flags if supported
  3228. check_cflags -Wdeclaration-after-statement
  3229. check_cflags -Wall
  3230. check_cflags -Wno-parentheses
  3231. check_cflags -Wno-switch
  3232. check_cflags -Wno-format-zero-length
  3233. check_cflags -Wdisabled-optimization
  3234. check_cflags -Wpointer-arith
  3235. check_cflags -Wredundant-decls
  3236. check_cflags -Wno-pointer-sign
  3237. check_cflags -Wwrite-strings
  3238. check_cflags -Wtype-limits
  3239. check_cflags -Wundef
  3240. check_cflags -Wmissing-prototypes
  3241. check_cflags -Wno-pointer-to-int-cast
  3242. check_cflags -Wstrict-prototypes
  3243. enabled extra_warnings && check_cflags -Winline
  3244. # add some linker flags
  3245. check_ldflags -Wl,--warn-common
  3246. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  3247. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  3248. enabled xmm_clobber_test &&
  3249. check_ldflags -Wl,--wrap,avcodec_open2 \
  3250. -Wl,--wrap,avcodec_decode_audio4 \
  3251. -Wl,--wrap,avcodec_decode_video2 \
  3252. -Wl,--wrap,avcodec_decode_subtitle2 \
  3253. -Wl,--wrap,avcodec_encode_audio2 \
  3254. -Wl,--wrap,avcodec_encode_video \
  3255. -Wl,--wrap,avcodec_encode_subtitle \
  3256. -Wl,--wrap,sws_scale ||
  3257. disable xmm_clobber_test
  3258. echo "X{};" > $TMPV
  3259. if test_ldflags -Wl,--version-script,$TMPV; then
  3260. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  3261. check_cc <<EOF && enable symver_asm_label
  3262. void ff_foo(void) __asm__ ("av_foo@VERSION");
  3263. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  3264. EOF
  3265. check_cc <<EOF && enable symver_gnu_asm
  3266. __asm__(".symver ff_foo,av_foo@VERSION");
  3267. void ff_foo(void) {}
  3268. EOF
  3269. fi
  3270. if [ -n "$optflags" ]; then
  3271. add_cflags $optflags
  3272. elif enabled small; then
  3273. add_cflags $cflags_size
  3274. elif enabled optimizations; then
  3275. add_cflags $cflags_speed
  3276. else
  3277. add_cflags $cflags_noopt
  3278. fi
  3279. check_cflags -fno-math-errno
  3280. check_cflags -fno-signed-zeros
  3281. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  3282. int x;
  3283. EOF
  3284. if enabled icc; then
  3285. # Just warnings, no remarks
  3286. check_cflags -w1
  3287. # -wd: Disable following warnings
  3288. # 144, 167, 556: -Wno-pointer-sign
  3289. # 1292: attribute "foo" ignored
  3290. # 1419: external declaration in primary source file
  3291. # 10006: ignoring unknown option -fno-signed-zeros
  3292. # 10148: ignoring unknown option -Wno-parentheses
  3293. # 10156: ignoring option '-W'; no argument required
  3294. check_cflags -wd144,167,556,1292,1419,10006,10148,10156
  3295. # 11030: Warning unknown option --as-needed
  3296. # 10156: ignoring option '-export'; no argument required
  3297. check_ldflags -wd10156,11030
  3298. # Allow to compile with optimizations
  3299. check_ldflags -march=$cpu
  3300. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  3301. enable ebp_available
  3302. if enabled x86_32; then
  3303. icc_version=$($cc -dumpversion)
  3304. test ${icc_version%%.*} -ge 11 &&
  3305. check_cflags -falign-stack=maintain-16-byte ||
  3306. disable aligned_stack
  3307. fi
  3308. elif enabled ccc; then
  3309. # disable some annoying warnings
  3310. add_cflags -msg_disable cvtu32to64
  3311. add_cflags -msg_disable embedcomment
  3312. add_cflags -msg_disable needconstext
  3313. add_cflags -msg_disable nomainieee
  3314. add_cflags -msg_disable ptrmismatch1
  3315. add_cflags -msg_disable unreachcode
  3316. elif enabled gcc; then
  3317. check_cflags -fno-tree-vectorize
  3318. check_cflags -Werror=implicit-function-declaration
  3319. check_cflags -Werror=missing-prototypes
  3320. elif enabled llvm_gcc; then
  3321. check_cflags -mllvm -stack-alignment=16
  3322. elif enabled clang; then
  3323. check_cflags -mllvm -stack-alignment=16
  3324. check_cflags -Qunused-arguments
  3325. elif enabled armcc; then
  3326. # 2523: use of inline assembler is deprecated
  3327. add_cflags -W${armcc_opt},--diag_suppress=2523
  3328. add_cflags -W${armcc_opt},--diag_suppress=1207
  3329. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  3330. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  3331. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  3332. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  3333. elif enabled tms470; then
  3334. add_cflags -pds=824 -pds=837
  3335. elif enabled pathscale; then
  3336. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  3337. fi
  3338. enabled_any $THREADS_LIST && enable threads
  3339. check_deps $CONFIG_LIST \
  3340. $CONFIG_EXTRA \
  3341. $HAVE_LIST \
  3342. $ALL_COMPONENTS \
  3343. $ALL_TESTS \
  3344. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  3345. if test $target_os = "haiku"; then
  3346. disable memalign
  3347. disable posix_memalign
  3348. fi
  3349. ! enabled_any memalign posix_memalign aligned_malloc &&
  3350. enabled_any $need_memalign && enable memalign_hack
  3351. # add_dep lib dep
  3352. # -> enable ${lib}_deps_${dep}
  3353. # -> add $dep to ${lib}_deps only once
  3354. add_dep() {
  3355. lib=$1
  3356. dep=$2
  3357. enabled "${lib}_deps_${dep}" && return 0
  3358. enable "${lib}_deps_${dep}"
  3359. prepend "${lib}_deps" $dep
  3360. }
  3361. # merge deps lib components
  3362. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  3363. merge_deps() {
  3364. lib=$1
  3365. shift
  3366. for comp in $*; do
  3367. enabled $comp || continue
  3368. eval "dep=\"\$${comp}_deps\""
  3369. for d in $dep; do
  3370. add_dep $lib $d
  3371. done
  3372. done
  3373. }
  3374. merge_deps libavfilter $FILTER_LIST
  3375. echo "install prefix $prefix"
  3376. echo "source path $source_path"
  3377. echo "C compiler $cc"
  3378. echo "ARCH $arch ($cpu)"
  3379. if test "$build_suffix" != ""; then
  3380. echo "build suffix $build_suffix"
  3381. fi
  3382. if test "$progs_suffix" != ""; then
  3383. echo "progs suffix $progs_suffix"
  3384. fi
  3385. if test "$extra_version" != ""; then
  3386. echo "version string suffix $extra_version"
  3387. fi
  3388. echo "big-endian ${bigendian-no}"
  3389. echo "runtime cpu detection ${runtime_cpudetect-no}"
  3390. if enabled x86; then
  3391. echo "${yasmexe} ${yasm-no}"
  3392. echo "MMX enabled ${mmx-no}"
  3393. echo "MMXEXT enabled ${mmxext-no}"
  3394. echo "3DNow! enabled ${amd3dnow-no}"
  3395. echo "3DNow! extended enabled ${amd3dnowext-no}"
  3396. echo "SSE enabled ${sse-no}"
  3397. echo "SSSE3 enabled ${ssse3-no}"
  3398. echo "AVX enabled ${avx-no}"
  3399. echo "FMA4 enabled ${fma4-no}"
  3400. echo "CMOV enabled ${cmov-no}"
  3401. echo "CMOV is fast ${fast_cmov-no}"
  3402. echo "EBX available ${ebx_available-no}"
  3403. echo "EBP available ${ebp_available-no}"
  3404. fi
  3405. if enabled arm; then
  3406. echo "ARMv5TE enabled ${armv5te-no}"
  3407. echo "ARMv6 enabled ${armv6-no}"
  3408. echo "ARMv6T2 enabled ${armv6t2-no}"
  3409. echo "ARM VFP enabled ${armvfp-no}"
  3410. echo "NEON enabled ${neon-no}"
  3411. fi
  3412. if enabled mips; then
  3413. echo "MMI enabled ${mmi-no}"
  3414. echo "MIPS FPU enabled ${mipsfpu-no}"
  3415. echo "MIPS32R2 enabled ${mips32r2-no}"
  3416. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  3417. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  3418. fi
  3419. if enabled ppc; then
  3420. echo "AltiVec enabled ${altivec-no}"
  3421. echo "PPC 4xx optimizations ${ppc4xx-no}"
  3422. echo "dcbzl available ${dcbzl-no}"
  3423. fi
  3424. if enabled sparc; then
  3425. echo "VIS enabled ${vis-no}"
  3426. fi
  3427. echo "debug symbols ${debug-no}"
  3428. echo "strip symbols ${stripping-no}"
  3429. echo "optimize for size ${small-no}"
  3430. echo "optimizations ${optimizations-no}"
  3431. echo "static ${static-no}"
  3432. echo "shared ${shared-no}"
  3433. echo "postprocessing support ${postproc-no}"
  3434. echo "new filter support ${avfilter-no}"
  3435. echo "network support ${network-no}"
  3436. echo "threading support ${thread_type-no}"
  3437. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  3438. echo "SDL support ${sdl-no}"
  3439. echo "libdxva2 enabled ${dxva2-no}"
  3440. echo "libva enabled ${vaapi-no}"
  3441. echo "libvdpau enabled ${vdpau-no}"
  3442. echo "AVISynth enabled ${avisynth-no}"
  3443. echo "frei0r enabled ${frei0r-no}"
  3444. echo "gnutls enabled ${gnutls-no}"
  3445. echo "libaacplus enabled ${libaacplus-no}"
  3446. echo "libass enabled ${libass-no}"
  3447. echo "libcaca enabled ${libcaca-no}"
  3448. echo "libcdio support ${libcdio-no}"
  3449. echo "libcelt enabled ${libcelt-no}"
  3450. echo "libdc1394 support ${libdc1394-no}"
  3451. echo "libfaac enabled ${libfaac-no}"
  3452. echo "libfdk-aac enabled ${libfdk_aac-no}"
  3453. echo "libgsm enabled ${libgsm-no}"
  3454. echo "libiec61883 support ${libiec61883-no}"
  3455. echo "libilbc enabled ${libilbc-no}"
  3456. echo "libmodplug enabled ${libmodplug-no}"
  3457. echo "libmp3lame enabled ${libmp3lame-no}"
  3458. echo "libnut enabled ${libnut-no}"
  3459. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  3460. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  3461. echo "libopencv support ${libopencv-no}"
  3462. echo "libopenjpeg enabled ${libopenjpeg-no}"
  3463. echo "libopus enabled ${libopus-no}"
  3464. echo "libpulse enabled ${libpulse-no}"
  3465. echo "librtmp enabled ${librtmp-no}"
  3466. echo "libschroedinger enabled ${libschroedinger-no}"
  3467. echo "libspeex enabled ${libspeex-no}"
  3468. echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
  3469. echo "libtheora enabled ${libtheora-no}"
  3470. echo "libutvideo enabled ${libutvideo-no}"
  3471. echo "libv4l2 enabled ${libv4l2-no}"
  3472. echo "libvo-aacenc support ${libvo_aacenc-no}"
  3473. echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
  3474. echo "libvorbis enabled ${libvorbis-no}"
  3475. echo "libvpx enabled ${libvpx-no}"
  3476. echo "libx264 enabled ${libx264-no}"
  3477. echo "libxavs enabled ${libxavs-no}"
  3478. echo "libxvid enabled ${libxvid-no}"
  3479. echo "openal enabled ${openal-no}"
  3480. echo "openssl enabled ${openssl-no}"
  3481. echo "zlib enabled ${zlib-no}"
  3482. echo "bzlib enabled ${bzlib-no}"
  3483. echo "texi2html enabled ${texi2html-no}"
  3484. echo "pod2man enabled ${pod2man-no}"
  3485. echo "makeinfo enabled ${makeinfo-no}"
  3486. test -n "$random_seed" &&
  3487. echo "random seed ${random_seed}"
  3488. echo
  3489. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  3490. echo "Enabled ${type}s:"
  3491. eval list=\$$(toupper $type)_LIST
  3492. print_enabled '_*' $list | sort | pr -r -3 -t
  3493. echo
  3494. done
  3495. license="LGPL version 2.1 or later"
  3496. if enabled nonfree; then
  3497. license="nonfree and unredistributable"
  3498. elif enabled gplv3; then
  3499. license="GPL version 3 or later"
  3500. elif enabled lgplv3; then
  3501. license="LGPL version 3 or later"
  3502. elif enabled gpl; then
  3503. license="GPL version 2 or later"
  3504. fi
  3505. echo "License: $license"
  3506. echo "Creating config.mak and config.h..."
  3507. test -e Makefile || $ln_s "$source_path/Makefile" .
  3508. enabled stripping || strip="echo skipping strip"
  3509. config_files="$TMPH config.mak"
  3510. cat > config.mak <<EOF
  3511. # Automatically generated by configure - do not modify!
  3512. ifndef FFMPEG_CONFIG_MAK
  3513. FFMPEG_CONFIG_MAK=1
  3514. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  3515. prefix=$prefix
  3516. LIBDIR=\$(DESTDIR)$libdir
  3517. SHLIBDIR=\$(DESTDIR)$shlibdir
  3518. INCDIR=\$(DESTDIR)$incdir
  3519. BINDIR=\$(DESTDIR)$bindir
  3520. DATADIR=\$(DESTDIR)$datadir
  3521. MANDIR=\$(DESTDIR)$mandir
  3522. SRC_PATH=$source_path
  3523. ifndef MAIN_MAKEFILE
  3524. SRC_PATH:=\$(SRC_PATH:.%=..%)
  3525. endif
  3526. CC_IDENT=$cc_ident
  3527. ARCH=$arch
  3528. CC=$cc
  3529. CXX=$cxx
  3530. AS=$as
  3531. LD=$ld
  3532. DEPCC=$dep_cc
  3533. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  3534. DEPAS=$as
  3535. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  3536. YASM=$yasmexe
  3537. DEPYASM=$yasmexe
  3538. AR=$ar
  3539. RANLIB=$ranlib
  3540. CP=cp -p
  3541. LN_S=$ln_s
  3542. STRIP=$strip
  3543. CPPFLAGS=$CPPFLAGS
  3544. CFLAGS=$CFLAGS
  3545. CXXFLAGS=$CXXFLAGS
  3546. ASFLAGS=$ASFLAGS
  3547. AS_C=$AS_C
  3548. AS_O=$AS_O
  3549. CC_C=$CC_C
  3550. CC_O=$CC_O
  3551. CXX_C=$CXX_C
  3552. CXX_O=$CXX_O
  3553. LD_O=$LD_O
  3554. DLLTOOL=$dlltool
  3555. LDFLAGS=$LDFLAGS
  3556. FFSERVERLDFLAGS=$FFSERVERLDFLAGS
  3557. SHFLAGS=$SHFLAGS
  3558. YASMFLAGS=$YASMFLAGS
  3559. BUILDSUF=$build_suffix
  3560. PROGSSUF=$progs_suffix
  3561. FULLNAME=$FULLNAME
  3562. LIBPREF=$LIBPREF
  3563. LIBSUF=$LIBSUF
  3564. LIBNAME=$LIBNAME
  3565. SLIBPREF=$SLIBPREF
  3566. SLIBSUF=$SLIBSUF
  3567. EXESUF=$EXESUF
  3568. EXTRA_VERSION=$extra_version
  3569. CCDEP=$CCDEP
  3570. CXXDEP=$CXXDEP
  3571. CCDEP_FLAGS=$CCDEP_FLAGS
  3572. ASDEP=$ASDEP
  3573. ASDEP_FLAGS=$ASDEP_FLAGS
  3574. CC_DEPFLAGS=$CC_DEPFLAGS
  3575. AS_DEPFLAGS=$AS_DEPFLAGS
  3576. HOSTCC=$host_cc
  3577. HOSTCFLAGS=$host_cflags
  3578. HOSTEXESUF=$HOSTEXESUF
  3579. HOSTLDFLAGS=$host_ldflags
  3580. HOSTLIBS=$host_libs
  3581. DEPHOSTCC=$host_cc
  3582. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  3583. HOSTCCDEP=$HOSTCCDEP
  3584. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  3585. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  3586. HOSTCC_C=$HOSTCC_C
  3587. HOSTCC_O=$HOSTCC_O
  3588. TARGET_EXEC=$target_exec
  3589. TARGET_PATH=$target_path
  3590. SDL_LIBS=$sdl_libs
  3591. SDL_CFLAGS=$sdl_cflags
  3592. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  3593. EXTRALIBS=$extralibs
  3594. INSTALL=$install
  3595. LIBTARGET=${LIBTARGET}
  3596. SLIBNAME=${SLIBNAME}
  3597. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  3598. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  3599. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  3600. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  3601. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  3602. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  3603. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  3604. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  3605. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  3606. NOREDZONE_FLAGS=$noredzone_flags
  3607. EOF
  3608. get_version(){
  3609. lcname=$1
  3610. name=$(toupper $lcname)
  3611. file=$source_path/$lcname/version.h
  3612. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3613. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3614. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3615. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3616. }
  3617. get_version_old(){
  3618. name=$1
  3619. file=$source_path/$2
  3620. # This condition will be removed when we stop supporting old libpostproc versions
  3621. if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then
  3622. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3623. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3624. fi
  3625. lcname=$(tolower $name)
  3626. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3627. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3628. }
  3629. get_version_old LIBPOSTPROC libpostproc/postprocess.h
  3630. get_version_old LIBSWRESAMPLE libswresample/swresample.h
  3631. get_version libavcodec
  3632. get_version libavdevice
  3633. get_version libavfilter
  3634. get_version libavformat
  3635. get_version libavresample
  3636. get_version libavutil
  3637. get_version libswscale
  3638. cat > $TMPH <<EOF
  3639. /* Automatically generated by configure - do not modify! */
  3640. #ifndef FFMPEG_CONFIG_H
  3641. #define FFMPEG_CONFIG_H
  3642. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  3643. #define FFMPEG_LICENSE "$(c_escape $license)"
  3644. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  3645. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  3646. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  3647. #define av_restrict $_restrict
  3648. #define EXTERN_PREFIX "${extern_prefix}"
  3649. #define EXTERN_ASM ${extern_prefix}
  3650. #define SLIBSUF "$SLIBSUF"
  3651. #define HAVE_MMX2 HAVE_MMXEXT
  3652. EOF
  3653. test -n "$assert_level" &&
  3654. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  3655. test -n "$malloc_prefix" &&
  3656. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  3657. if enabled yasm; then
  3658. append config_files $TMPASM
  3659. printf '' >$TMPASM
  3660. fi
  3661. print_config ARCH_ "$config_files" $ARCH_LIST
  3662. print_config HAVE_ "$config_files" $HAVE_LIST
  3663. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  3664. $CONFIG_EXTRA \
  3665. $ALL_COMPONENTS \
  3666. cat >>config.mak <<EOF
  3667. LAVF_FATE_TESTS=$(print_enabled -n _test $LAVF_FATE_TESTS)
  3668. LAVF_TESTS=$(print_enabled -n _test $LAVF_TESTS)
  3669. LAVFI_TESTS=$(print_enabled -n _test $LAVFI_TESTS)
  3670. SEEK_TESTS=$(print_enabled -n _test $SEEK_TESTS)
  3671. EOF
  3672. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  3673. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  3674. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  3675. cp_if_changed $TMPH config.h
  3676. touch .config
  3677. enabled yasm && cp_if_changed $TMPASM config.asm
  3678. cat > $TMPH <<EOF
  3679. /* Generated by ffconf */
  3680. #ifndef AVUTIL_AVCONFIG_H
  3681. #define AVUTIL_AVCONFIG_H
  3682. EOF
  3683. test "$postproc_version" != current && cat >> $TMPH <<EOF
  3684. #define LIBPOSTPROC_VERSION_MAJOR $LIBPOSTPROC_VERSION_MAJOR
  3685. #define LIBPOSTPROC_VERSION_MINOR $LIBPOSTPROC_VERSION_MINOR
  3686. #define LIBPOSTPROC_VERSION_MICRO $LIBPOSTPROC_VERSION_MICRO
  3687. EOF
  3688. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  3689. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  3690. cp_if_changed $TMPH libavutil/avconfig.h
  3691. test -n "$WARNINGS" && printf "\n$WARNINGS"
  3692. # build pkg-config files
  3693. pkgconfig_generate(){
  3694. name=$1
  3695. shortname=${name#lib}${build_suffix}
  3696. comment=$2
  3697. version=$3
  3698. libs=$4
  3699. requires=$5
  3700. enabled ${name#lib} || return 0
  3701. mkdir -p $name
  3702. cat <<EOF > $name/$name.pc
  3703. prefix=$prefix
  3704. exec_prefix=\${prefix}
  3705. libdir=$libdir
  3706. includedir=$incdir
  3707. Name: $name
  3708. Description: $comment
  3709. Version: $version
  3710. Requires: $(enabled shared || echo $requires)
  3711. Requires.private: $(enabled shared && echo $requires)
  3712. Conflicts:
  3713. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3714. Libs.private: $(enabled shared && echo $libs)
  3715. Cflags: -I\${includedir}
  3716. EOF
  3717. mkdir -p doc/examples/pc-uninstalled
  3718. includedir=${source_path}
  3719. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  3720. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  3721. prefix=
  3722. exec_prefix=
  3723. libdir=\${pcfiledir}/../../../$name
  3724. includedir=${includedir}
  3725. Name: $name
  3726. Description: $comment
  3727. Version: $version
  3728. Requires: $requires
  3729. Conflicts:
  3730. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3731. Cflags: -I\${includedir}
  3732. EOF
  3733. }
  3734. libavfilter_pc_deps=""
  3735. enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
  3736. enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
  3737. enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
  3738. enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION,"
  3739. enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION,"
  3740. libavfilter_pc_deps=${libavfilter_pc_deps%, }
  3741. libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION"
  3742. enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION,"
  3743. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
  3744. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  3745. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  3746. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
  3747. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
  3748. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
  3749. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
  3750. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
  3751. pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"