configure 119 KB

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