configure 99 KB

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