configure 112 KB

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