configure 118 KB

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