configure 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801
  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. echo "Usage: configure [options]"
  52. echo "Options: [defaults in brackets after descriptions]"
  53. echo
  54. echo "Standard options:"
  55. echo " --help print this message"
  56. echo " --logfile=FILE log tests and output to FILE [config.err]"
  57. echo " --disable-logging do not log configure debug information"
  58. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  59. echo " --bindir=DIR install binaries in DIR [PREFIX/bin]"
  60. echo " --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]"
  61. echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
  62. echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
  63. echo " --incdir=DIR install includes in DIR [PREFIX/include]"
  64. echo " --mandir=DIR install man page in DIR [PREFIX/share/man]"
  65. echo
  66. echo "Configuration options:"
  67. echo " --disable-static do not build static libraries [no]"
  68. echo " --enable-shared build shared libraries [no]"
  69. echo " --enable-gpl allow use of GPL code, the resulting libs"
  70. echo " and binaries will be under GPL [no]"
  71. echo " --enable-version3 upgrade (L)GPL to version 3 [no]"
  72. echo " --enable-nonfree allow use of nonfree code, the resulting libs"
  73. echo " and binaries will be unredistributable [no]"
  74. echo " --disable-ffmpeg disable ffmpeg build"
  75. echo " --disable-ffplay disable ffplay build"
  76. echo " --disable-ffserver disable ffserver build"
  77. echo " --enable-postproc enable GPLed postprocessing support [no]"
  78. echo " --enable-avfilter video filter support [no]"
  79. echo " --enable-avfilter-lavf video filters dependent on avformat [no]"
  80. echo " --enable-beosthreads use BeOS threads [no]"
  81. echo " --enable-os2threads use OS/2 threads [no]"
  82. echo " --enable-pthreads use pthreads [no]"
  83. echo " --enable-w32threads use Win32 threads [no]"
  84. echo " --enable-x11grab enable X11 grabbing [no]"
  85. echo " --disable-network disable network support [no]"
  86. echo " --disable-ipv6 disable IPv6 support [no]"
  87. echo " --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]"
  88. echo " --enable-gray enable full grayscale support (slower color)"
  89. echo " --disable-swscale-alpha disable alpha channel support in swscale"
  90. echo " --disable-fastdiv disable table-based division"
  91. echo " --enable-small optimize for size instead of speed"
  92. echo " --disable-aandct disable AAN DCT code"
  93. echo " --disable-fft disable FFT code"
  94. echo " --disable-golomb disable Golomb code"
  95. echo " --disable-mdct disable MDCT code"
  96. echo " --disable-rdft disable RDFT code"
  97. echo " --disable-vaapi disable VAAPI code"
  98. echo " --disable-vdpau disable VDPAU code"
  99. echo " --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)"
  100. echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation"
  101. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  102. echo " --enable-beos-netserver enable BeOS netserver"
  103. echo " --disable-encoder=NAME disable encoder NAME"
  104. echo " --enable-encoder=NAME enable encoder NAME"
  105. echo " --disable-encoders disable all encoders"
  106. echo " --disable-decoder=NAME disable decoder NAME"
  107. echo " --enable-decoder=NAME enable decoder NAME"
  108. echo " --disable-decoders disable all decoders"
  109. echo " --disable-hwaccel=NAME disable hwaccel NAME"
  110. echo " --enable-hwaccel=NAME enable hwaccel NAME"
  111. echo " --disable-hwaccels disable all hwaccels"
  112. echo " --disable-muxer=NAME disable muxer NAME"
  113. echo " --enable-muxer=NAME enable muxer NAME"
  114. echo " --disable-muxers disable all muxers"
  115. echo " --disable-demuxer=NAME disable demuxer NAME"
  116. echo " --enable-demuxer=NAME enable demuxer NAME"
  117. echo " --disable-demuxers disable all demuxers"
  118. echo " --enable-parser=NAME enable parser NAME"
  119. echo " --disable-parser=NAME disable parser NAME"
  120. echo " --disable-parsers disable all parsers"
  121. echo " --enable-bsf=NAME enable bitstream filter NAME"
  122. echo " --disable-bsf=NAME disable bitstream filter NAME"
  123. echo " --disable-bsfs disable all bitstream filters"
  124. echo " --enable-protocol=NAME enable protocol NAME"
  125. echo " --disable-protocol=NAME disable protocol NAME"
  126. echo " --disable-protocols disable all protocols"
  127. echo " --disable-indev=NAME disable input device NAME"
  128. echo " --disable-outdev=NAME disable output device NAME"
  129. echo " --disable-indevs disable input devices"
  130. echo " --disable-outdevs disable output devices"
  131. echo " --disable-devices disable all devices"
  132. echo " --enable-filter=NAME enable filter NAME"
  133. echo " --disable-filter=NAME disable filter NAME"
  134. echo " --disable-filters disable all filters"
  135. echo " --list-decoders show all available decoders"
  136. echo " --list-encoders show all available encoders"
  137. echo " --list-hwaccels show all available hardware accelerators"
  138. echo " --list-muxers show all available muxers"
  139. echo " --list-demuxers show all available demuxers"
  140. echo " --list-parsers show all available parsers"
  141. echo " --list-protocols show all available protocols"
  142. echo " --list-bsfs show all available bitstream filters"
  143. echo " --list-indevs show all available input devices"
  144. echo " --list-outdevs show all available output devices"
  145. echo " --list-filters show all available filters"
  146. echo
  147. echo "External library support:"
  148. echo " --enable-avisynth enable reading of AVISynth script files [no]"
  149. echo " --enable-bzlib enable bzlib [autodetect]"
  150. echo " --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]"
  151. echo " --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]"
  152. echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394"
  153. echo " and libraw1394 [no]"
  154. echo " --enable-libdirac enable Dirac support via libdirac [no]"
  155. echo " --enable-libfaac enable FAAC support via libfaac [no]"
  156. echo " --enable-libfaad enable FAAD support via libfaad [no]"
  157. echo " --enable-libfaadbin open libfaad.so.0 at runtime [no]"
  158. echo " --enable-libgsm enable GSM support via libgsm [no]"
  159. echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [no]"
  160. echo " --enable-libnut enable NUT (de)muxing via libnut,"
  161. echo " native (de)muxer exists [no]"
  162. echo " --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]"
  163. echo " --enable-libschroedinger enable Dirac support via libschroedinger [no]"
  164. echo " --enable-libspeex enable Speex decoding via libspeex [no]"
  165. echo " --enable-libtheora enable Theora encoding via libtheora [no]"
  166. echo " --enable-libvorbis enable Vorbis encoding via libvorbis,"
  167. echo " native implementation exists [no]"
  168. echo " --enable-libx264 enable H.264 encoding via x264 [no]"
  169. echo " --enable-libxvid enable Xvid encoding via xvidcore,"
  170. echo " native MPEG-4/Xvid encoder exists [no]"
  171. echo " --enable-mlib enable Sun medialib [no]"
  172. echo " --enable-zlib enable zlib [autodetect]"
  173. echo ""
  174. echo "Advanced options (experts only):"
  175. echo " --source-path=PATH path to source code [$source_path]"
  176. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  177. echo " --enable-cross-compile assume a cross-compiler is used"
  178. echo " --sysroot=PATH root of cross-build tree"
  179. echo " --sysinclude=PATH location of cross-build system headers"
  180. echo " --target-os=OS compiler targets OS [$target_os]"
  181. echo " --target-exec=CMD command to run executables on target"
  182. echo " --target-path=DIR path to view of build directory on target"
  183. echo " --nm=NM use nm tool"
  184. echo " --as=AS use assembler AS [$as_default]"
  185. echo " --cc=CC use C compiler CC [$cc_default]"
  186. echo " --ld=LD use linker LD"
  187. echo " --host-cc=HOSTCC use host C compiler HOSTCC"
  188. echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host"
  189. echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host"
  190. echo " --host-libs=HLIBS use libs HLIBS when linking for host"
  191. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  192. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  193. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  194. echo " --extra-version=STRING version string suffix []"
  195. echo " --build-suffix=SUFFIX library name suffix []"
  196. echo " --arch=ARCH select architecture [$arch]"
  197. echo " --cpu=CPU select the minimum required CPU (affects"
  198. echo " instruction selection, may crash on older CPUs)"
  199. echo " --enable-powerpc-perf enable performance report on PPC"
  200. echo " (requires enabling PMC)"
  201. echo " --disable-altivec disable AltiVec optimizations"
  202. echo " --disable-amd3dnow disable 3DNow! optimizations"
  203. echo " --disable-amd3dnowext disable 3DNow! extended optimizations"
  204. echo " --disable-mmx disable MMX optimizations"
  205. echo " --disable-mmx2 disable MMX2 optimizations"
  206. echo " --disable-sse disable SSE optimizations"
  207. echo " --disable-ssse3 disable SSSE3 optimizations"
  208. echo " --disable-armv5te disable armv5te optimizations"
  209. echo " --disable-armv6 disable armv6 optimizations"
  210. echo " --disable-armv6t2 disable armv6t2 optimizations"
  211. echo " --disable-armvfp disable ARM VFP optimizations"
  212. echo " --disable-iwmmxt disable iwmmxt optimizations"
  213. echo " --disable-mmi disable MMI optimizations"
  214. echo " --disable-neon disable neon optimizations"
  215. echo " --disable-vis disable VIS optimizations"
  216. echo " --disable-yasm disable use of yasm assembler"
  217. echo
  218. echo "Developer options (useful when working on FFmpeg itself):"
  219. echo " --disable-debug disable debugging symbols"
  220. echo " --enable-debug=LEVEL set the debug level [$debuglevel]"
  221. echo " --enable-gprof enable profiling with gprof [$gprof]"
  222. echo " --disable-optimizations disable compiler optimizations"
  223. echo " --enable-extra-warnings enable more compiler warnings"
  224. echo " --disable-stripping disable stripping of executables and shared libraries"
  225. echo ""
  226. echo "NOTE: Object files are built at the place where configure is launched."
  227. exit 0
  228. }
  229. log(){
  230. echo "$@" >> $logfile
  231. }
  232. log_file(){
  233. log BEGIN $1
  234. pr -n -t $1 >> $logfile
  235. log END $1
  236. }
  237. echolog(){
  238. log "$@"
  239. echo "$@"
  240. }
  241. die(){
  242. echolog "$@"
  243. cat <<EOF
  244. If you think configure made a mistake, make sure you are using the latest
  245. version from SVN. If the latest version fails, report the problem to the
  246. ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
  247. EOF
  248. if disabled logging; then
  249. cat <<EOF
  250. Rerun configure with logging enabled (do not use --disable-logging), and
  251. include the log this produces with your report.
  252. EOF
  253. else
  254. cat <<EOF
  255. Include the log file "$logfile" produced by configure as this will help
  256. solving the problem.
  257. EOF
  258. fi
  259. exit 1
  260. }
  261. # Avoid locale weirdness, besides we really just want to translate ASCII.
  262. toupper(){
  263. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  264. }
  265. tolower(){
  266. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  267. }
  268. c_escape(){
  269. echo "$*" | sed 's/["\\]/\\\0/g'
  270. }
  271. sh_quote(){
  272. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  273. test "$v" = "${v#*[ |&;<>()$\`\\\"\'*?\[\]#~=%]}" || v="'$v'"
  274. echo "$v"
  275. }
  276. filter(){
  277. pat=$1
  278. shift
  279. for v; do
  280. case "$v" in $pat) echo "$v" ;; esac
  281. done
  282. }
  283. set_all(){
  284. value=$1
  285. shift
  286. for var in $*; do
  287. eval $var=$value
  288. done
  289. }
  290. set_weak(){
  291. value=$1
  292. shift
  293. for var; do
  294. eval : \${$var:=$value}
  295. done
  296. }
  297. pushvar(){
  298. for var in $*; do
  299. eval level=\${${var}_level:=0}
  300. eval ${var}_${level}="\$$var"
  301. eval ${var}_level=$(($level+1))
  302. done
  303. }
  304. popvar(){
  305. for var in $*; do
  306. eval level=\${${var}_level:-0}
  307. test $level = 0 && continue
  308. eval level=$(($level-1))
  309. eval $var="\${${var}_${level}}"
  310. eval ${var}_level=$level
  311. eval unset ${var}_${level}
  312. done
  313. }
  314. enable(){
  315. set_all yes $*
  316. }
  317. disable(){
  318. set_all no $*
  319. }
  320. enable_weak(){
  321. set_weak yes $*
  322. }
  323. disable_weak(){
  324. set_weak no $*
  325. }
  326. enable_safe(){
  327. enable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
  328. }
  329. disable_safe(){
  330. disable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
  331. }
  332. do_enable_deep(){
  333. for var; do
  334. enabled $var && continue
  335. eval sel="\$${var}_select"
  336. eval sgs="\$${var}_suggest"
  337. pushvar var sgs
  338. enable_deep $sel
  339. popvar sgs
  340. enable_deep_weak $sgs
  341. popvar var
  342. done
  343. }
  344. enable_deep(){
  345. do_enable_deep $*
  346. enable $*
  347. }
  348. enable_deep_weak(){
  349. do_enable_deep $*
  350. enable_weak $*
  351. }
  352. enabled(){
  353. test "${1#!}" = "$1" && op== || op=!=
  354. eval test "x\$${1#!}" $op "xyes"
  355. }
  356. disabled(){
  357. test "${1#!}" = "$1" && op== || op=!=
  358. eval test "x\$${1#!}" $op "xno"
  359. }
  360. enabled_all(){
  361. for opt; do
  362. enabled $opt || return 1
  363. done
  364. }
  365. disabled_all(){
  366. for opt; do
  367. disabled $opt || return 1
  368. done
  369. }
  370. enabled_any(){
  371. for opt; do
  372. enabled $opt && return 0
  373. done
  374. }
  375. disabled_any(){
  376. for opt; do
  377. disabled $opt && return 0
  378. done
  379. return 1
  380. }
  381. set_default(){
  382. for opt; do
  383. eval : \${$opt:=\$${opt}_default}
  384. done
  385. }
  386. is_in(){
  387. value=$1
  388. shift
  389. for var in $*; do
  390. [ $var = $value ] && return 0
  391. done
  392. return 1
  393. }
  394. check_deps(){
  395. for cfg; do
  396. cfg="${cfg#!}"
  397. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  398. disabled ${cfg}_checking && continue
  399. enable ${cfg}_checking
  400. eval dep_all="\$${cfg}_deps"
  401. eval dep_any="\$${cfg}_deps_any"
  402. eval dep_sel="\$${cfg}_select"
  403. eval dep_sgs="\$${cfg}_suggest"
  404. pushvar cfg dep_all dep_any dep_sel dep_sgs
  405. check_deps $dep_all $dep_any $dep_sel $dep_sgs
  406. popvar cfg dep_all dep_any dep_sel dep_sgs
  407. enabled_all $dep_all || disable $cfg
  408. enabled_any $dep_any || disable $cfg
  409. disabled_any $dep_sel && disable $cfg
  410. if enabled $cfg; then
  411. eval dep_extralibs="\$${cfg}_extralibs"
  412. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  413. enable_deep $dep_sel
  414. enable_deep_weak $dep_sgs
  415. fi
  416. disable ${cfg}_checking
  417. done
  418. }
  419. print_config(){
  420. pfx=$1
  421. header=$2
  422. makefile=$3
  423. shift 3
  424. for cfg; do
  425. ucname="$(toupper $cfg)"
  426. if enabled $cfg; then
  427. echo "#define ${pfx}${ucname} 1" >> $header
  428. echo "${pfx}${ucname}=yes" >> $makefile
  429. else
  430. echo "#define ${pfx}${ucname} 0" >> $header
  431. fi
  432. done
  433. }
  434. flags_saved(){
  435. (: ${SAVE_CFLAGS?}) 2> /dev/null
  436. }
  437. save_flags(){
  438. flags_saved && return
  439. SAVE_CFLAGS="$CFLAGS"
  440. SAVE_LDFLAGS="$LDFLAGS"
  441. SAVE_extralibs="$extralibs"
  442. }
  443. restore_flags(){
  444. flags_saved || return
  445. CFLAGS="$SAVE_CFLAGS"
  446. LDFLAGS="$SAVE_LDFLAGS"
  447. extralibs="$SAVE_extralibs"
  448. unset SAVE_CFLAGS
  449. unset SAVE_LDFLAGS
  450. unset SAVE_extralibs
  451. }
  452. temp_cflags(){
  453. save_flags
  454. CFLAGS="$CFLAGS $*"
  455. }
  456. temp_ldflags(){
  457. save_flags
  458. LDFLAGS="$LDFLAGS $*"
  459. }
  460. temp_extralibs(){
  461. save_flags
  462. extralibs="$extralibs $*"
  463. }
  464. append(){
  465. var=$1
  466. shift
  467. flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
  468. eval "$var=\"\$$var $*\""
  469. }
  470. add_cppflags(){
  471. append CPPFLAGS $($filter_cppflags "$@")
  472. }
  473. add_cflags(){
  474. append CFLAGS $($filter_cflags "$@")
  475. }
  476. add_asflags(){
  477. append ASFLAGS $($filter_asflags "$@")
  478. }
  479. add_ldflags(){
  480. append LDFLAGS "$@"
  481. }
  482. add_extralibs(){
  483. append extralibs "$@"
  484. }
  485. check_cmd(){
  486. log "$@"
  487. "$@" >> $logfile 2>&1
  488. }
  489. check_cc(){
  490. log check_cc "$@"
  491. cat > $TMPC
  492. log_file $TMPC
  493. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
  494. }
  495. check_cpp(){
  496. log check_cpp "$@"
  497. cat > $TMPC
  498. log_file $TMPC
  499. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
  500. }
  501. check_as(){
  502. log check_as "$@"
  503. cat > $TMPC
  504. log_file $TMPC
  505. check_cmd $as $CPPFLAGS $ASFLAGS "$@" -c -o $TMPO $TMPC
  506. }
  507. check_asm(){
  508. log check_asm "$@"
  509. name="$1"
  510. asm="$2"
  511. shift 2
  512. check_as "$@" <<EOF && enable $name || disable $name
  513. void foo(void){ __asm__ volatile($asm); }
  514. EOF
  515. }
  516. check_yasm(){
  517. log check_yasm "$@"
  518. echo "$1" > $TMPS
  519. log_file $TMPS
  520. shift 1
  521. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  522. }
  523. check_ld(){
  524. log check_ld "$@"
  525. check_cc || return
  526. flags=''
  527. libs=''
  528. for f; do
  529. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  530. done
  531. check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
  532. }
  533. check_cppflags(){
  534. log check_cppflags "$@"
  535. set -- $($filter_cppflags "$@")
  536. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  537. int x;
  538. EOF
  539. }
  540. check_cflags(){
  541. log check_cflags "$@"
  542. set -- $($filter_cflags "$@")
  543. check_cc "$@" <<EOF && append CFLAGS "$@"
  544. int x;
  545. EOF
  546. }
  547. check_ldflags(){
  548. log check_ldflags "$@"
  549. check_ld "$@" <<EOF && add_ldflags "$@"
  550. int main(void){ return 0; }
  551. EOF
  552. }
  553. check_header(){
  554. log check_header "$@"
  555. header=$1
  556. shift
  557. disable_safe $header
  558. check_cpp "$@" <<EOF && enable_safe $header
  559. #include <$header>
  560. int x;
  561. EOF
  562. }
  563. check_func(){
  564. log check_func "$@"
  565. func=$1
  566. shift
  567. disable $func
  568. check_ld "$@" <<EOF && enable $func
  569. extern int $func();
  570. int main(void){ $func(); }
  571. EOF
  572. }
  573. check_func_headers(){
  574. log check_func_headers "$@"
  575. headers=$1
  576. func=$2
  577. shift 2
  578. disable $func
  579. incs=""
  580. for hdr in $headers; do
  581. incs="$incs
  582. #include <$hdr>"
  583. done
  584. check_ld "$@" <<EOF && enable $func && enable_safe $headers
  585. $incs
  586. int main(int argc, char **argv){
  587. return (long) $func;
  588. }
  589. EOF
  590. }
  591. check_cpp_condition(){
  592. log check_cpp_condition "$@"
  593. header=$1
  594. condition=$2
  595. check_cpp <<EOF
  596. #include <$header>
  597. #if !($condition)
  598. #error "unsatisfied condition: $condition"
  599. #endif
  600. EOF
  601. }
  602. check_lib(){
  603. log check_lib "$@"
  604. header="$1"
  605. func="$2"
  606. shift 2
  607. temp_extralibs "$@"
  608. check_header $header && check_func $func && add_extralibs "$@"
  609. err=$?
  610. restore_flags
  611. return $err
  612. }
  613. check_lib2(){
  614. log check_lib2 "$@"
  615. headers="$1"
  616. func="$2"
  617. shift 2
  618. temp_extralibs "$@"
  619. check_func_headers "$headers" $func && add_extralibs "$@"
  620. err=$?
  621. restore_flags
  622. return $err
  623. }
  624. check_exec(){
  625. check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  626. }
  627. check_exec_crash(){
  628. code=$(cat)
  629. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  630. # are safe but may not be available everywhere. Thus we use
  631. # raise(SIGTERM) instead. The check is run in a subshell so we
  632. # can redirect the "Terminated" message from the shell. SIGBUS
  633. # is not defined by standard C so it is used conditionally.
  634. (check_exec "$@") >> $logfile 2>&1 <<EOF
  635. #include <signal.h>
  636. static void sighandler(int sig){
  637. raise(SIGTERM);
  638. }
  639. int main(void){
  640. signal(SIGILL, sighandler);
  641. signal(SIGFPE, sighandler);
  642. signal(SIGSEGV, sighandler);
  643. #ifdef SIGBUS
  644. signal(SIGBUS, sighandler);
  645. #endif
  646. { $code }
  647. }
  648. EOF
  649. }
  650. check_type(){
  651. log check_type "$@"
  652. headers=$1
  653. type=$2
  654. shift 2
  655. disable $type
  656. incs=""
  657. for hdr in $headers; do
  658. incs="$incs
  659. #include <$hdr>"
  660. done
  661. check_cc "$@" <<EOF && enable $type
  662. $incs
  663. $type v;
  664. EOF
  665. }
  666. require(){
  667. name="$1"
  668. header="$2"
  669. func="$3"
  670. shift 3
  671. check_lib $header $func "$@" || die "ERROR: $name not found"
  672. }
  673. require2(){
  674. name="$1"
  675. headers="$2"
  676. func="$3"
  677. shift 3
  678. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  679. }
  680. check_foo_config(){
  681. cfg=$1
  682. pkg=$2
  683. header=$3
  684. func=$4
  685. shift 4
  686. disable $cfg
  687. check_cmd ${pkg}-config --version
  688. err=$?
  689. if test "$err" = 0; then
  690. temp_cflags $(${pkg}-config --cflags)
  691. temp_extralibs $(${pkg}-config --libs)
  692. check_lib "$@" $header $func && enable $cfg
  693. fi
  694. return $err
  695. }
  696. apply(){
  697. file=$1
  698. shift
  699. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  700. }
  701. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  702. # system-dependent things.
  703. COMPONENT_LIST="
  704. bsfs
  705. decoders
  706. demuxers
  707. encoders
  708. filters
  709. hwaccels
  710. indevs
  711. muxers
  712. outdevs
  713. parsers
  714. protocols
  715. "
  716. CONFIG_LIST="
  717. $COMPONENT_LIST
  718. aandct
  719. avfilter
  720. avfilter_lavf
  721. avisynth
  722. beos_netserver
  723. bzlib
  724. fastdiv
  725. ffmpeg
  726. ffplay
  727. ffserver
  728. fft
  729. golomb
  730. gpl
  731. gprof
  732. gray
  733. hardcoded_tables
  734. ipv6
  735. libdc1394
  736. libdirac
  737. libfaac
  738. libfaad
  739. libfaadbin
  740. libgsm
  741. libmp3lame
  742. libnut
  743. libopencore_amrnb
  744. libopencore_amrwb
  745. libopenjpeg
  746. libschroedinger
  747. libspeex
  748. libtheora
  749. libvorbis
  750. libx264
  751. libxvid
  752. mdct
  753. memalign_hack
  754. mlib
  755. mpegaudio_hp
  756. network
  757. nonfree
  758. postproc
  759. powerpc_perf
  760. rdft
  761. runtime_cpudetect
  762. shared
  763. small
  764. static
  765. swscale_alpha
  766. vaapi
  767. vdpau
  768. version3
  769. x11grab
  770. zlib
  771. "
  772. THREADS_LIST='
  773. beosthreads
  774. os2threads
  775. pthreads
  776. w32threads
  777. '
  778. ARCH_LIST='
  779. alpha
  780. arm
  781. bfin
  782. ia64
  783. m68k
  784. mips
  785. mips64
  786. parisc
  787. ppc
  788. ppc64
  789. s390
  790. sh4
  791. sparc
  792. sparc64
  793. x86
  794. x86_32
  795. x86_64
  796. '
  797. ARCH_EXT_LIST='
  798. altivec
  799. amd3dnow
  800. amd3dnowext
  801. armv5te
  802. armv6
  803. armv6t2
  804. armvfp
  805. iwmmxt
  806. mmi
  807. mmx
  808. mmx2
  809. neon
  810. ppc4xx
  811. sse
  812. ssse3
  813. vis
  814. '
  815. HAVE_LIST="
  816. $ARCH_EXT_LIST
  817. $THREADS_LIST
  818. alsa_asoundlib_h
  819. altivec_h
  820. arpa_inet_h
  821. attribute_packed
  822. bigendian
  823. bswap
  824. closesocket
  825. cmov
  826. conio_h
  827. dcbzl
  828. dev_bktr_ioctl_bt848_h
  829. dev_bktr_ioctl_meteor_h
  830. dev_ic_bt8xx_h
  831. dev_video_meteor_ioctl_meteor_h
  832. dev_video_bktr_ioctl_bt848_h
  833. dlfcn_h
  834. dlopen
  835. dos_paths
  836. ebp_available
  837. ebx_available
  838. fast_64bit
  839. fast_cmov
  840. fast_unaligned
  841. fork
  842. gethrtime
  843. GetProcessTimes
  844. getrusage
  845. inet_aton
  846. inline_asm
  847. isatty
  848. ldbrx
  849. libdc1394_1
  850. libdc1394_2
  851. llrint
  852. log2
  853. loongson
  854. lrint
  855. lrintf
  856. lzo1x_999_compress
  857. machine_ioctl_bt848_h
  858. machine_ioctl_meteor_h
  859. malloc_h
  860. memalign
  861. mkstemp
  862. pld
  863. posix_memalign
  864. round
  865. roundf
  866. sdl
  867. sdl_video_size
  868. setmode
  869. socklen_t
  870. soundcard_h
  871. poll_h
  872. sys_mman_h
  873. sys_resource_h
  874. sys_select_h
  875. sys_soundcard_h
  876. sys_videoio_h
  877. ten_operands
  878. termios_h
  879. threads
  880. truncf
  881. vfp_args
  882. VirtualAlloc
  883. winsock2_h
  884. xform_asm
  885. yasm
  886. "
  887. # options emitted with CONFIG_ prefix but not available on command line
  888. CONFIG_EXTRA="
  889. gplv3
  890. lgplv3
  891. "
  892. CMDLINE_SELECT="
  893. $ARCH_EXT_LIST
  894. $CONFIG_LIST
  895. $THREADS_LIST
  896. cross_compile
  897. debug
  898. extra_warnings
  899. logging
  900. optimizations
  901. stripping
  902. yasm
  903. "
  904. PATHS_LIST='
  905. bindir
  906. datadir
  907. incdir
  908. libdir
  909. mandir
  910. prefix
  911. shlibdir
  912. '
  913. CMDLINE_SET="
  914. $PATHS_LIST
  915. arch
  916. as
  917. build_suffix
  918. cc
  919. cpu
  920. cross_prefix
  921. dep_cc
  922. extra_version
  923. host_cc
  924. host_cflags
  925. host_ldflags
  926. host_libs
  927. host_os
  928. ld
  929. logfile
  930. nm
  931. source_path
  932. sysinclude
  933. sysroot
  934. target_exec
  935. target_os
  936. target_path
  937. "
  938. CMDLINE_APPEND="
  939. extra_cflags
  940. "
  941. # code dependency declarations
  942. # architecture extensions
  943. altivec_deps="ppc"
  944. amd3dnow_deps="mmx"
  945. amd3dnowext_deps="amd3dnow"
  946. armv5te_deps="arm"
  947. armv6_deps="arm"
  948. armv6t2_deps="arm"
  949. armvfp_deps="arm"
  950. iwmmxt_deps="arm"
  951. mmi_deps="mips"
  952. mmx_deps="x86"
  953. mmx2_deps="mmx"
  954. neon_deps="arm"
  955. ppc4xx_deps="ppc"
  956. sse_deps="mmx"
  957. ssse3_deps="sse"
  958. vis_deps="sparc"
  959. need_memalign="altivec neon sse"
  960. inline_asm_deps="!tms470"
  961. # decoders / encoders / hardware accelerators
  962. aac_decoder_select="fft mdct"
  963. aac_encoder_select="fft mdct"
  964. ac3_decoder_select="fft mdct"
  965. atrac3_decoder_select="fft mdct"
  966. cavs_decoder_select="golomb"
  967. cook_decoder_select="fft mdct"
  968. cscd_decoder_suggest="zlib"
  969. dca_decoder_select="fft mdct"
  970. dnxhd_encoder_select="aandct"
  971. dxa_decoder_select="zlib"
  972. eac3_decoder_select="ac3_decoder"
  973. eamad_decoder_select="aandct"
  974. eatgq_decoder_select="aandct"
  975. eatqi_decoder_select="aandct"
  976. ffv1_decoder_select="golomb"
  977. flac_decoder_select="golomb"
  978. flac_encoder_select="golomb"
  979. flashsv_decoder_select="zlib"
  980. flashsv_encoder_select="zlib"
  981. flv_encoder_select="h263_encoder"
  982. h261_encoder_select="aandct"
  983. h263_encoder_select="aandct"
  984. h263_vaapi_hwaccel_deps="va_va_h"
  985. h263_vaapi_hwaccel_select="vaapi h263_decoder"
  986. h263p_encoder_select="h263_encoder"
  987. h264_decoder_select="golomb"
  988. h264_vaapi_hwaccel_deps="va_va_h"
  989. h264_vaapi_hwaccel_select="vaapi"
  990. h264_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  991. h264_vdpau_decoder_select="vdpau h264_decoder"
  992. imc_decoder_select="fft mdct"
  993. jpegls_decoder_select="golomb"
  994. jpegls_encoder_select="golomb"
  995. ljpeg_encoder_select="aandct"
  996. loco_decoder_select="golomb"
  997. mjpeg_encoder_select="aandct"
  998. mpeg1video_encoder_select="aandct"
  999. mpeg2video_encoder_select="aandct"
  1000. mpeg4_encoder_select="h263_encoder"
  1001. mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1002. mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
  1003. mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1004. mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
  1005. mpeg2_vaapi_hwaccel_deps="va_va_h"
  1006. mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
  1007. mpeg4_vaapi_hwaccel_deps="va_va_h"
  1008. mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
  1009. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1010. mpeg_xvmc_decoder_select="mpegvideo_decoder"
  1011. msmpeg4v1_encoder_select="h263_encoder"
  1012. msmpeg4v2_encoder_select="h263_encoder"
  1013. msmpeg4v3_encoder_select="h263_encoder"
  1014. nellymoser_decoder_select="fft mdct"
  1015. nellymoser_encoder_select="fft mdct"
  1016. png_decoder_select="zlib"
  1017. png_encoder_select="zlib"
  1018. qdm2_decoder_select="fft mdct rdft"
  1019. rv10_encoder_select="h263_encoder"
  1020. rv20_encoder_select="h263_encoder"
  1021. rv30_decoder_select="golomb"
  1022. rv40_decoder_select="golomb"
  1023. shorten_decoder_select="golomb"
  1024. sonic_decoder_select="golomb"
  1025. sonic_encoder_select="golomb"
  1026. sonic_ls_encoder_select="golomb"
  1027. svq3_decoder_select="golomb"
  1028. svq3_decoder_suggest="zlib"
  1029. theora_decoder_select="vp3_decoder"
  1030. tiff_decoder_suggest="zlib"
  1031. tiff_encoder_suggest="zlib"
  1032. tscc_decoder_select="zlib"
  1033. vc1_vaapi_hwaccel_deps="va_va_h"
  1034. vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
  1035. vc1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1036. vc1_vdpau_decoder_select="vdpau vc1_decoder"
  1037. vorbis_decoder_select="fft mdct"
  1038. vorbis_encoder_select="fft mdct"
  1039. vp6a_decoder_select="vp6_decoder"
  1040. vp6f_decoder_select="vp6_decoder"
  1041. wmav1_decoder_select="fft mdct"
  1042. wmav1_encoder_select="fft mdct"
  1043. wmav2_decoder_select="fft mdct"
  1044. wmav2_encoder_select="fft mdct"
  1045. wmv1_encoder_select="h263_encoder"
  1046. wmv2_encoder_select="h263_encoder"
  1047. wmv3_decoder_select="vc1_decoder"
  1048. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1049. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1050. zlib_decoder_select="zlib"
  1051. zlib_encoder_select="zlib"
  1052. zmbv_decoder_select="zlib"
  1053. zmbv_encoder_select="zlib"
  1054. # parsers
  1055. h264_parser_select="golomb"
  1056. # external libraries
  1057. libdirac_decoder_deps="libdirac !libschroedinger"
  1058. libdirac_encoder_deps="libdirac"
  1059. libfaac_encoder_deps="libfaac"
  1060. libfaad_decoder_deps="libfaad"
  1061. libfaadbin_decoder_extralibs='$ldl'
  1062. libgsm_decoder_deps="libgsm"
  1063. libgsm_encoder_deps="libgsm"
  1064. libgsm_ms_decoder_deps="libgsm"
  1065. libgsm_ms_encoder_deps="libgsm"
  1066. libmp3lame_encoder_deps="libmp3lame"
  1067. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1068. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1069. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1070. libopenjpeg_decoder_deps="libopenjpeg"
  1071. libschroedinger_decoder_deps="libschroedinger"
  1072. libschroedinger_encoder_deps="libschroedinger"
  1073. libspeex_decoder_deps="libspeex"
  1074. libtheora_encoder_deps="libtheora"
  1075. libvorbis_encoder_deps="libvorbis"
  1076. libx264_encoder_deps="libx264"
  1077. libxvid_encoder_deps="libxvid"
  1078. # demuxers / muxers
  1079. ac3_demuxer_deps="ac3_parser"
  1080. asf_stream_muxer_select="asf_muxer"
  1081. avisynth_demuxer_deps="avisynth"
  1082. dirac_demuxer_deps="dirac_parser"
  1083. ipod_muxer_select="mov_muxer"
  1084. libnut_demuxer_deps="libnut"
  1085. libnut_muxer_deps="libnut"
  1086. matroska_audio_muxer_select="matroska_muxer"
  1087. matroska_demuxer_suggest="zlib bzlib"
  1088. mov_demuxer_suggest="zlib"
  1089. mp3_demuxer_deps="mpegaudio_parser"
  1090. mp4_muxer_select="mov_muxer"
  1091. mpegtsraw_demuxer_select="mpegts_demuxer"
  1092. mxf_d10_muxer_select="mxf_muxer"
  1093. psp_muxer_select="mov_muxer"
  1094. redir_demuxer_deps="network"
  1095. rtp_muxer_deps="network rtp_protocol"
  1096. rtsp_demuxer_deps="sdp_demuxer"
  1097. sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
  1098. tg2_muxer_select="mov_muxer"
  1099. tgp_muxer_select="mov_muxer"
  1100. # indevs / outdevs
  1101. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1102. alsa_indev_extralibs="-lasound"
  1103. alsa_outdev_deps="alsa_asoundlib_h"
  1104. alsa_outdev_extralibs="-lasound"
  1105. audio_beos_indev_deps="audio_beos"
  1106. audio_beos_indev_extralibs="-lmedia -lbe"
  1107. audio_beos_outdev_deps="audio_beos"
  1108. audio_beos_outdev_extralibs="-lmedia -lbe"
  1109. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1110. dv1394_indev_deps="dv1394 dv_demuxer"
  1111. jack_indev_deps="jack_jack_h"
  1112. jack_indev_extralibs="-ljack"
  1113. libdc1394_indev_deps="libdc1394"
  1114. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1115. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1116. v4l_indev_deps="linux_videodev_h"
  1117. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1118. vfwcap_indev_deps="capCreateCaptureWindow"
  1119. vfwcap_indev_extralibs="-lvfw32"
  1120. x11_grab_device_indev_deps="x11grab XShmCreateImage"
  1121. x11_grab_device_indev_extralibs="-lX11 -lXext"
  1122. # protocols
  1123. gopher_protocol_deps="network"
  1124. http_protocol_deps="network"
  1125. rtmp_protocol_deps="tcp_protocol"
  1126. rtp_protocol_deps="udp_protocol"
  1127. tcp_protocol_deps="network"
  1128. udp_protocol_deps="network"
  1129. # filters
  1130. movie_filter_deps="avfilter_lavf"
  1131. # programs
  1132. ffplay_deps="sdl"
  1133. ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
  1134. ffserver_extralibs='$ldl'
  1135. # default parameters
  1136. logfile="config.err"
  1137. # installation paths
  1138. prefix_default="/usr/local"
  1139. bindir_default='${prefix}/bin'
  1140. datadir_default='${prefix}/share/ffmpeg'
  1141. incdir_default='${prefix}/include'
  1142. libdir_default='${prefix}/lib'
  1143. mandir_default='${prefix}/share/man'
  1144. shlibdir_default="$libdir_default"
  1145. # toolchain
  1146. ar="ar"
  1147. cc_default="gcc"
  1148. host_cc_default="gcc"
  1149. ln_s="ln -sf"
  1150. nm_default="nm"
  1151. objformat="elf"
  1152. ranlib="ranlib"
  1153. strip="strip"
  1154. yasmexe="yasm"
  1155. # machine
  1156. arch=$(uname -m)
  1157. cpu="generic"
  1158. # OS
  1159. target_os=$(tolower $(uname -s))
  1160. host_os=$target_os
  1161. # configurable options
  1162. enable debug
  1163. enable fastdiv
  1164. enable ffmpeg
  1165. enable ffplay
  1166. enable ffserver
  1167. enable ipv6
  1168. enable mpegaudio_hp
  1169. enable network
  1170. enable optimizations
  1171. enable protocols
  1172. enable static
  1173. enable stripping
  1174. enable swscale_alpha
  1175. # build settings
  1176. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1177. FFSERVERLDFLAGS=-Wl,-E
  1178. LIBPREF="lib"
  1179. LIBSUF=".a"
  1180. FULLNAME='$(NAME)$(BUILDSUF)'
  1181. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1182. SLIBPREF="lib"
  1183. SLIBSUF=".so"
  1184. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1185. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1186. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1187. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1188. CC_O='-o $@'
  1189. host_cflags='-O3 -g -Wall'
  1190. host_libs='-lm'
  1191. target_path='.'
  1192. # gcc stupidly only outputs the basename of targets with -MM, but we need the
  1193. # full relative path for objects in subdirectories for non-recursive Make.
  1194. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $@'
  1195. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
  1196. # find source path
  1197. source_path="$(dirname "$0")"
  1198. enable source_path_used
  1199. if test -f configure; then
  1200. source_path="$(pwd)"
  1201. disable source_path_used
  1202. else
  1203. source_path="$(cd "$source_path"; pwd)"
  1204. echo "$source_path" | grep -q '[[:blank:]]' &&
  1205. die "Out of tree builds are impossible with whitespace in source path."
  1206. test -e "$source_path/config.h" &&
  1207. die "Out of tree builds are impossible with config.h in source dir."
  1208. fi
  1209. for v in "$@"; do
  1210. r=${v#*=}
  1211. l=${v%"$r"}
  1212. r=$(sh_quote "$r")
  1213. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1214. done
  1215. find_things(){
  1216. thing=$1
  1217. pattern=$2
  1218. file=$source_path/$3
  1219. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1220. }
  1221. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1222. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1223. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1224. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1225. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1226. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1227. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1228. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1229. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1230. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1231. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1232. enable $ARCH_EXT_LIST \
  1233. $DECODER_LIST \
  1234. $ENCODER_LIST \
  1235. $HWACCEL_LIST \
  1236. $PARSER_LIST \
  1237. $BSF_LIST \
  1238. $DEMUXER_LIST \
  1239. $MUXER_LIST \
  1240. $FILTER_LIST \
  1241. $PROTOCOL_LIST \
  1242. $INDEV_LIST \
  1243. $OUTDEV_LIST \
  1244. die_unknown(){
  1245. echo "Unknown option \"$1\"."
  1246. echo "See $0 --help for available options."
  1247. exit 1
  1248. }
  1249. show_list() {
  1250. suffix=_$1
  1251. shift
  1252. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort
  1253. exit 0
  1254. }
  1255. for opt do
  1256. optval="${opt#*=}"
  1257. case "$opt" in
  1258. --extra-ldflags=*) add_ldflags $optval
  1259. ;;
  1260. --extra-libs=*) add_extralibs $optval
  1261. ;;
  1262. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1263. ;;
  1264. --enable-debug=*) debuglevel="$optval"
  1265. ;;
  1266. --enable-*=*|--disable-*=*)
  1267. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  1268. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  1269. eval list=\$$(toupper $thing)_LIST
  1270. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  1271. $action $(filter "$name" $list)
  1272. ;;
  1273. --enable-?*|--disable-?*)
  1274. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  1275. if is_in $option $COMPONENT_LIST; then
  1276. test $action = disable && action=unset
  1277. eval $action \$$(toupper ${option%s})_LIST
  1278. elif is_in $option $CMDLINE_SELECT; then
  1279. $action $option
  1280. else
  1281. die_unknown $opt
  1282. fi
  1283. ;;
  1284. --list-*)
  1285. NAME="${opt#--list-}"
  1286. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1287. NAME=${NAME%s}
  1288. eval show_list $NAME \$$(toupper $NAME)_LIST
  1289. ;;
  1290. --help|-h) show_help
  1291. ;;
  1292. *)
  1293. optname="${opt%%=*}"
  1294. optname="${optname#--}"
  1295. optname=$(echo "$optname" | sed 's/-/_/g')
  1296. if is_in $optname $CMDLINE_SET; then
  1297. eval $optname='$optval'
  1298. elif is_in $optname $CMDLINE_APPEND; then
  1299. append $optname "$optval"
  1300. else
  1301. die_unknown $opt
  1302. fi
  1303. ;;
  1304. esac
  1305. done
  1306. disabled logging && logfile=/dev/null
  1307. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  1308. set >> $logfile
  1309. test -n "$cross_prefix" && enable cross_compile
  1310. ar="${cross_prefix}${ar}"
  1311. cc_default="${cross_prefix}${cc_default}"
  1312. nm_default="${cross_prefix}${nm_default}"
  1313. ranlib="${cross_prefix}${ranlib}"
  1314. strip="${cross_prefix}${strip}"
  1315. sysinclude_default="${sysroot}/usr/include"
  1316. set_default cc nm sysinclude
  1317. enabled cross_compile || host_cc_default=$cc
  1318. set_default host_cc
  1319. exesuf() {
  1320. case $1 in
  1321. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
  1322. esac
  1323. }
  1324. EXESUF=$(exesuf $target_os)
  1325. HOSTEXESUF=$(exesuf $host_os)
  1326. # set temporary file name
  1327. : ${TMPDIR:=$TEMPDIR}
  1328. : ${TMPDIR:=$TMP}
  1329. : ${TMPDIR:=/tmp}
  1330. if ! check_cmd type mktemp; then
  1331. # simple replacement for missing mktemp
  1332. # NOT SAFE FOR GENERAL USE
  1333. mktemp(){
  1334. echo "${2%XXX*}.${HOSTNAME}.${UID}.$$"
  1335. }
  1336. fi
  1337. tmpfile(){
  1338. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  1339. (set -C; exec > $tmp) 2>/dev/null ||
  1340. die "Unable to create temoporary file in $TMPDIR."
  1341. append TMPFILES $tmp
  1342. eval $1=$tmp
  1343. }
  1344. trap 'rm -f -- $TMPFILES' EXIT
  1345. trap exit HUP INT TERM
  1346. tmpfile TMPC .c
  1347. tmpfile TMPE $EXESUF
  1348. tmpfile TMPH .h
  1349. tmpfile TMPO .o
  1350. tmpfile TMPS .S
  1351. tmpfile TMPSH .sh
  1352. unset -f mktemp
  1353. # make sure we can execute files in $TMPDIR
  1354. cat > $TMPSH 2>> $logfile <<EOF
  1355. #! /bin/sh
  1356. EOF
  1357. chmod +x $TMPSH >> $logfile 2>&1
  1358. if ! $TMPSH >> $logfile 2>&1; then
  1359. cat <<EOF
  1360. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  1361. variable to another directory and make sure that it is not mounted noexec.
  1362. EOF
  1363. die "Sanity test failed."
  1364. fi
  1365. filter_cflags=echo
  1366. filter_cppflags=echo
  1367. filter_asflags=echo
  1368. if $cc --version 2>/dev/null | grep -qi gcc; then
  1369. cc_type=gcc
  1370. elif $cc --version 2>/dev/null | grep -q Intel; then
  1371. cc_type=icc
  1372. elif $cc -v 2>&1 | grep -q xlc; then
  1373. cc_type=xlc
  1374. elif $cc -V 2>/dev/null | grep -q Compaq; then
  1375. cc_type=ccc
  1376. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
  1377. debuglevel=3
  1378. add_ldflags -Wl,-z,now # calls to libots crash without this
  1379. elif $cc --vsn 2>/dev/null | grep -q RVCT; then
  1380. test -d "$sysroot" || die "No valid sysroot specified."
  1381. cc_type=armcc
  1382. armcc_conf="$PWD/armcc.conf"
  1383. $cc --arm_linux_configure \
  1384. --arm_linux_config_file="$armcc_conf" \
  1385. --configure_sysroot="$sysroot" \
  1386. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  1387. die "Error creating armcc configuration file."
  1388. cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
  1389. as_default="${cross_prefix}gcc"
  1390. elif $cc -version 2>/dev/null | grep -q TMS470; then
  1391. cc_type=tms470
  1392. cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
  1393. CC_O='-fr=$(@D)'
  1394. as_default="${cross_prefix}gcc"
  1395. ld_default="${cross_prefix}gcc"
  1396. dep_cc_default="${cross_prefix}gcc"
  1397. TMPO=$(basename $TMPC .c).o
  1398. append TMPFILES $TMPO
  1399. add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
  1400. DEPFLAGS='$(CPPFLAGS) -MM'
  1401. filter_cflags=tms470_flags
  1402. tms470_flags(){
  1403. for flag; do
  1404. case $flag in
  1405. -march=*|-mcpu=*)
  1406. case "${flag#*=}" in
  1407. armv7-a|cortex-a*) echo -mv=7a8 ;;
  1408. armv7-r|cortex-r*) echo -mv=7r4 ;;
  1409. armv7-m|cortex-m*) echo -mv=7m3 ;;
  1410. armv6*|arm11*) echo -mv=6 ;;
  1411. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  1412. echo -mv=5e ;;
  1413. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  1414. esac
  1415. ;;
  1416. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  1417. -mfpu=vfp) echo --float_support=vfpv2 ;;
  1418. -mfpu=softvfp) echo --float_support=vfplib ;;
  1419. -Os) echo -O3 -mf=2 ;;
  1420. -O[0-3]) echo $flag -mf=5 ;;
  1421. -g) echo -g -mn ;;
  1422. esac
  1423. done
  1424. }
  1425. fi
  1426. test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
  1427. : ${as_default:=$cc}
  1428. : ${dep_cc_default:=$cc}
  1429. : ${ld_default:=$cc}
  1430. set_default as dep_cc ld
  1431. add_cflags $extra_cflags
  1432. add_asflags $extra_cflags
  1433. if test -n "$sysroot"; then
  1434. case "$cc_type" in
  1435. gcc)
  1436. add_cppflags --sysroot="$sysroot"
  1437. add_ldflags --sysroot="$sysroot"
  1438. ;;
  1439. tms470)
  1440. add_cppflags -I"$sysinclude"
  1441. add_ldflags --sysroot="$sysroot"
  1442. ;;
  1443. esac
  1444. fi
  1445. if test "$cpu" = host; then
  1446. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  1447. case "$cc_type" in
  1448. gcc)
  1449. check_native(){
  1450. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  1451. awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
  1452. }
  1453. cpu=$(check_native -march || check_native -mcpu)
  1454. ;;
  1455. esac
  1456. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  1457. fi
  1458. # Add processor-specific flags
  1459. case $cpu in
  1460. 601|ppc601|PowerPC601)
  1461. cpuflags="-mcpu=601"
  1462. ;;
  1463. 603*|ppc603*|PowerPC603*)
  1464. cpuflags="-mcpu=603"
  1465. ;;
  1466. 604*|ppc604*|PowerPC604*)
  1467. cpuflags="-mcpu=604"
  1468. ;;
  1469. G3|g3|75*|ppc75*|PowerPC75*)
  1470. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  1471. ;;
  1472. G4|g4|745*|ppc745*|PowerPC745*)
  1473. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  1474. ;;
  1475. 74*|ppc74*|PowerPC74*)
  1476. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  1477. ;;
  1478. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  1479. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  1480. ;;
  1481. Cell|CELL|cell)
  1482. cpuflags="-mcpu=cell"
  1483. enable ldbrx
  1484. ;;
  1485. # targets that do NOT support conditional mov (cmov)
  1486. i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  1487. cpuflags="-march=$cpu"
  1488. disable cmov
  1489. ;;
  1490. # targets that do support conditional mov (cmov)
  1491. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
  1492. cpuflags="-march=$cpu"
  1493. enable cmov
  1494. enable fast_cmov
  1495. ;;
  1496. # targets that do support conditional mov but on which it's slow
  1497. pentium4|pentium4m|prescott|nocona)
  1498. cpuflags="-march=$cpu"
  1499. enable cmov
  1500. disable fast_cmov
  1501. ;;
  1502. sparc64)
  1503. cpuflags="-mcpu=v9"
  1504. ;;
  1505. arm11*|cortex*)
  1506. cpuflags="-mcpu=$cpu"
  1507. enable fast_unaligned
  1508. ;;
  1509. armv[67]*)
  1510. cpuflags="-march=$cpu"
  1511. enable fast_unaligned
  1512. ;;
  1513. armv*)
  1514. cpuflags="-march=$cpu"
  1515. ;;
  1516. arm*)
  1517. cpuflags="-mcpu=$cpu"
  1518. ;;
  1519. ev4|ev45|ev5|ev56|pca56|ev6|ev67)
  1520. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  1521. ;;
  1522. bf*)
  1523. cpuflags="-mcpu=$cpu"
  1524. ;;
  1525. mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef])
  1526. cpuflags="-march=$cpu"
  1527. ;;
  1528. generic)
  1529. ;;
  1530. *)
  1531. echo "WARNING: Unknown CPU \"$cpu\", ignored."
  1532. ;;
  1533. esac
  1534. add_cflags $cpuflags
  1535. add_asflags $cpuflags
  1536. # compiler sanity check
  1537. check_exec <<EOF
  1538. int main(void){ return 0; }
  1539. EOF
  1540. if test "$?" != 0; then
  1541. echo "$cc is unable to create an executable file."
  1542. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  1543. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  1544. echo "Only do this if you know what cross compiling means."
  1545. fi
  1546. die "C compiler test failed."
  1547. fi
  1548. add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
  1549. check_cflags -std=c99
  1550. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  1551. #include <stdlib.h>
  1552. EOF
  1553. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  1554. #include <stdlib.h>
  1555. EOF
  1556. case "$arch" in
  1557. alpha)
  1558. arch="alpha"
  1559. enable fast_64bit
  1560. check_cflags -mieee
  1561. pic=$shared
  1562. ;;
  1563. arm|armv[4567]*l)
  1564. arch="arm"
  1565. ;;
  1566. avr32)
  1567. ;;
  1568. bfin)
  1569. arch="bfin"
  1570. ;;
  1571. ia64)
  1572. arch="ia64"
  1573. enable fast_64bit
  1574. pic=$shared
  1575. ;;
  1576. m68k)
  1577. arch="m68k"
  1578. ;;
  1579. mips|mipsel|IP*)
  1580. arch="mips"
  1581. pic=$shared
  1582. ;;
  1583. mips64)
  1584. arch="mips"
  1585. subarch="mips64"
  1586. enable fast_64bit
  1587. pic=$shared
  1588. ;;
  1589. parisc|hppa)
  1590. arch="parisc"
  1591. pic=$shared
  1592. ;;
  1593. parisc64|hppa64)
  1594. arch="parisc"
  1595. enable fast_64bit
  1596. pic=$shared
  1597. ;;
  1598. "Power Macintosh"|ppc|powerpc)
  1599. arch="ppc"
  1600. enable fast_unaligned
  1601. ;;
  1602. ppc64)
  1603. arch="ppc"
  1604. subarch="ppc64"
  1605. enable fast_64bit
  1606. enable fast_unaligned
  1607. ;;
  1608. s390|s390x)
  1609. arch="s390"
  1610. ;;
  1611. sh4|sh)
  1612. arch="sh4"
  1613. ;;
  1614. sparc)
  1615. arch="sparc"
  1616. pic=$shared
  1617. ;;
  1618. sun4u|sparc64)
  1619. arch="sparc"
  1620. subarch="sparc64"
  1621. enable fast_64bit
  1622. pic=$shared
  1623. ;;
  1624. i386|i486|i586|i686|i86pc|BePC)
  1625. arch="x86"
  1626. subarch="x86_32"
  1627. enable fast_unaligned
  1628. ;;
  1629. x86_64|amd64)
  1630. arch="x86"
  1631. subarch="x86_32"
  1632. enable cmov
  1633. enable fast_cmov
  1634. enable fast_unaligned
  1635. check_cc <<EOF && enable fast_64bit && subarch="x86_64" && pic=$shared
  1636. int test[sizeof(char*) - 7];
  1637. EOF
  1638. ;;
  1639. *)
  1640. arch="unknown"
  1641. ;;
  1642. esac
  1643. enable $arch $subarch
  1644. # OS specific
  1645. case $target_os in
  1646. beos|haiku|zeta)
  1647. prefix_default="$HOME/config"
  1648. # helps building libavcodec
  1649. add_cppflags -DPIC
  1650. add_cflags -fomit-frame-pointer
  1651. # 3 gcc releases known for BeOS, each with ugly bugs
  1652. gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
  1653. case "$gcc_version" in
  1654. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  1655. disable mmx
  1656. ;;
  1657. *20010315*) echo "BeBits gcc"
  1658. add_cflags -fno-expensive-optimizations
  1659. ;;
  1660. esac
  1661. SHFLAGS=-nostart
  1662. # enable BeOS things
  1663. enable audio_beos
  1664. # no need for libm, but the inet stuff
  1665. # Check for BONE
  1666. # XXX: actually should check for NOT net_server
  1667. if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
  1668. network_extralibs="-lbind -lsocket"
  1669. else
  1670. enable beos_netserver
  1671. network_extralibs="-lnet"
  1672. fi ;;
  1673. sunos)
  1674. FFSERVERLDFLAGS=""
  1675. SHFLAGS='-shared -Wl,-h,$$(@F)'
  1676. network_extralibs="-lsocket -lnsl"
  1677. add_cppflags -D__EXTENSIONS__
  1678. ;;
  1679. netbsd)
  1680. oss_indev_extralibs="-lossaudio"
  1681. oss_outdev_extralibs="-lossaudio"
  1682. ;;
  1683. openbsd)
  1684. enable malloc_aligned
  1685. enable pic
  1686. SHFLAGS='-shared'
  1687. oss_indev_extralibs="-lossaudio"
  1688. oss_outdev_extralibs="-lossaudio"
  1689. ;;
  1690. freebsd|dragonfly)
  1691. enable malloc_aligned
  1692. ;;
  1693. bsd/os)
  1694. osextralibs="-lpoll -lgnugetopt"
  1695. strip="strip -d"
  1696. ;;
  1697. darwin)
  1698. enable malloc_aligned
  1699. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
  1700. strip="strip -x"
  1701. FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
  1702. SLIBSUF=".dylib"
  1703. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  1704. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  1705. FFSERVERLDFLAGS=-Wl,-bind_at_load
  1706. objformat="macho"
  1707. enabled x86_64 && objformat="macho64"
  1708. enabled shared || check_cflags -mdynamic-no-pic
  1709. ;;
  1710. mingw32*)
  1711. if test $target_os = "mingw32ce"; then
  1712. disable network
  1713. else
  1714. target_os=mingw32
  1715. fi
  1716. LIBTARGET=i386
  1717. if enabled x86_64; then
  1718. enable malloc_aligned
  1719. LIBTARGET=x64
  1720. elif enabled arm; then
  1721. LIBTARGET=arm
  1722. fi
  1723. shlibdir_default="$bindir_default"
  1724. disable ffserver
  1725. SLIBPREF=""
  1726. SLIBSUF=".dll"
  1727. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1728. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1729. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
  1730. SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
  1731. install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
  1732. install -d "$(LIBDIR)"; \
  1733. install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
  1734. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
  1735. 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'
  1736. objformat="win32"
  1737. enable dos_paths
  1738. check_cflags -fno-common
  1739. if ! enabled x86_64; then
  1740. check_cpp_condition _mingw.h "(__MINGW32_MAJOR_VERSION > 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  1741. die "ERROR: MinGW runtime version must be >= 3.15."
  1742. enabled_any avisynth vfwcap_indev &&
  1743. { check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" ||
  1744. die "ERROR: avisynth and vfwcap_indev require w32api version 3.13 or later."; }
  1745. fi
  1746. ;;
  1747. cygwin*)
  1748. target_os=cygwin
  1749. shlibdir_default="$bindir_default"
  1750. SLIBPREF="cyg"
  1751. SLIBSUF=".dll"
  1752. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1753. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1754. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  1755. objformat="win32"
  1756. enable dos_paths
  1757. check_cflags -fno-common
  1758. ;;
  1759. *-dos|freedos|opendos)
  1760. disable ffplay ffserver
  1761. disable $INDEV_LIST $OUTDEV_LIST
  1762. network_extralibs="-lsocket"
  1763. objformat="coff"
  1764. enable dos_paths
  1765. ;;
  1766. linux)
  1767. enable dv1394
  1768. ;;
  1769. irix*)
  1770. target_os=irix
  1771. ranlib="echo ignoring ranlib"
  1772. ;;
  1773. os/2*)
  1774. strip="lxlite"
  1775. ln_s="cp -f"
  1776. FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
  1777. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  1778. FFSERVERLDFLAGS=""
  1779. LIBSUF="_s.a"
  1780. SLIBPREF=""
  1781. SLIBSUF=".dll"
  1782. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  1783. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  1784. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  1785. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  1786. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  1787. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  1788. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  1789. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  1790. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  1791. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  1792. SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
  1793. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
  1794. enable dos_paths
  1795. ;;
  1796. gnu/kfreebsd)
  1797. ;;
  1798. gnu)
  1799. ;;
  1800. *)
  1801. die "Unknown OS '$target_os'."
  1802. ;;
  1803. esac
  1804. set_default $PATHS_LIST
  1805. add_extralibs $osextralibs
  1806. # Combine FFLDFLAGS and the LDFLAGS environment variable.
  1807. LDFLAGS="$FFLDFLAGS $LDFLAGS"
  1808. # we need to build at least one lib type
  1809. if ! enabled_any static shared; then
  1810. cat <<EOF
  1811. At least one library type must be built.
  1812. Specify --enable-static to build the static libraries or --enable-shared to
  1813. build the shared libraries as well. To only build the shared libraries specify
  1814. --disable-static in addition to --enable-shared.
  1815. EOF
  1816. exit 1;
  1817. fi
  1818. disabled static && LIBNAME=""
  1819. if enabled_any libfaad libfaadbin ; then
  1820. if check_header faad.h; then
  1821. check_cc <<EOF
  1822. #include <faad.h>
  1823. #ifndef FAAD2_VERSION
  1824. ok faad1
  1825. #endif
  1826. int main(void) { return 0; }
  1827. EOF
  1828. test $? = 0 && enable libfaad2
  1829. else
  1830. die "FAAD test failed."
  1831. fi
  1832. fi
  1833. die_license_disabled() {
  1834. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  1835. }
  1836. die_license_disabled gpl libfaad2
  1837. die_license_disabled gpl libx264
  1838. die_license_disabled gpl libxvid
  1839. die_license_disabled gpl postproc
  1840. die_license_disabled gpl x11grab
  1841. die_license_disabled nonfree libfaac
  1842. die_license_disabled version3 libopencore_amrnb
  1843. die_license_disabled version3 libopencore_amrwb
  1844. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  1845. check_deps $ARCH_EXT_LIST
  1846. disabled optimizations || check_cflags -fomit-frame-pointer
  1847. check_cc <<EOF || die "Symbol mangling check failed."
  1848. int ff_extern;
  1849. EOF
  1850. sym=$($nm -P -g $TMPO | grep ff_extern)
  1851. extern_prefix=${sym%%ff_extern*}
  1852. check_cc <<EOF && enable inline_asm
  1853. void foo(void) { __asm__ volatile ("" ::); }
  1854. EOF
  1855. _restrict=
  1856. for restrict_keyword in restrict __restrict__ __restrict; do
  1857. check_cc <<EOF && _restrict=$restrict_keyword && break
  1858. void foo(char * $restrict_keyword p);
  1859. EOF
  1860. done
  1861. check_cc <<EOF && enable attribute_packed
  1862. struct { int x; } __attribute__((packed)) x;
  1863. EOF
  1864. check_cc <<EOF || die "endian test failed"
  1865. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  1866. EOF
  1867. od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  1868. if enabled arm; then
  1869. check_ld <<EOF && enable vfp_args
  1870. __asm__ (".eabi_attribute 28, 1");
  1871. int main(void) { return 0; }
  1872. EOF
  1873. # We have to check if pld is a nop and disable it.
  1874. check_asm pld '"pld [r0]"'
  1875. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  1876. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  1877. enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
  1878. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  1879. enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
  1880. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  1881. elif enabled mips; then
  1882. check_asm loongson '"dmult.g $1, $2, $3"'
  1883. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  1884. elif enabled ppc; then
  1885. check_asm dcbzl '"dcbzl 0, 1"'
  1886. check_asm ppc4xx '"maclhw r10, r11, r12"'
  1887. check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)'
  1888. # AltiVec flags: The FSF version of GCC differs from the Apple version
  1889. if enabled altivec; then
  1890. check_cflags -maltivec -mabi=altivec &&
  1891. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  1892. check_cflags -faltivec
  1893. # check if our compiler supports Motorola AltiVec C API
  1894. check_cc <<EOF || disable altivec
  1895. $inc_altivec_h
  1896. int main(void) {
  1897. vector signed int v1, v2, v3;
  1898. v1 = vec_add(v2,v3);
  1899. return 0;
  1900. }
  1901. EOF
  1902. # check if our compiler supports braces for vector declarations
  1903. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  1904. $inc_altivec_h
  1905. int main (void) { (vector int) {1}; return 0; }
  1906. EOF
  1907. fi
  1908. elif enabled sparc; then
  1909. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  1910. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  1911. elif enabled x86; then
  1912. # check whether EBP is available on x86
  1913. # As 'i' is stored on the stack, this program will crash
  1914. # if the base pointer is used to access it because the
  1915. # base pointer is cleared in the inline assembly code.
  1916. check_exec_crash <<EOF && enable ebp_available
  1917. volatile int i=0;
  1918. __asm__ volatile (
  1919. "xorl %%ebp, %%ebp"
  1920. ::: "%ebp");
  1921. return i;
  1922. EOF
  1923. # check wether EBX is available on x86
  1924. check_asm ebx_available '"":::"%ebx"'
  1925. # check whether more than 10 operands are supported
  1926. check_cc <<EOF && enable ten_operands
  1927. int main(void) {
  1928. int x=0;
  1929. __asm__ volatile(
  1930. ""
  1931. :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
  1932. );
  1933. return 0;
  1934. }
  1935. EOF
  1936. # check whether binutils is new enough to compile SSSE3/MMX2
  1937. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  1938. enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
  1939. check_asm bswap '"bswap %%eax" ::: "%eax"'
  1940. YASMFLAGS="-f $objformat -DARCH_$(toupper $subarch)"
  1941. enabled x86_64 && append YASMFLAGS "-m amd64"
  1942. enabled_all x86_64 shared && append YASMFLAGS "-DPIC"
  1943. case "$objformat" in
  1944. elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
  1945. macho64) append YASMFLAGS "-DPIC -DPREFIX" ;;
  1946. *) append YASMFLAGS "-DPREFIX" ;;
  1947. esac
  1948. disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; }
  1949. fi
  1950. if check_func dlopen; then
  1951. ldl=
  1952. elif check_func dlopen -ldl; then
  1953. ldl=-ldl
  1954. fi
  1955. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  1956. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  1957. check_func fork
  1958. check_func gethrtime
  1959. check_func getrusage
  1960. check_func inet_aton $network_extralibs
  1961. check_func isatty
  1962. check_func memalign
  1963. check_func mkstemp
  1964. check_func posix_memalign
  1965. check_func_headers io.h setmode
  1966. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  1967. check_func_headers windows.h GetProcessTimes
  1968. check_func_headers windows.h VirtualAlloc
  1969. check_header conio.h
  1970. check_header dlfcn.h
  1971. check_header malloc.h
  1972. check_header poll.h
  1973. check_header sys/mman.h
  1974. check_header sys/resource.h
  1975. check_header sys/select.h
  1976. check_header termios.h
  1977. check_header vdpau/vdpau.h
  1978. check_header vdpau/vdpau_x11.h
  1979. check_header X11/extensions/XvMClib.h
  1980. if ! enabled_any memalign memalign_hack posix_memalign malloc_aligned &&
  1981. enabled_any $need_memalign ; then
  1982. die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack."
  1983. fi
  1984. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  1985. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  1986. # check for some common methods of building with pthread support
  1987. # do this before the optional library checks as some of them require pthreads
  1988. if enabled pthreads; then
  1989. if check_func pthread_create; then
  1990. :
  1991. elif check_func pthread_create -pthread; then
  1992. add_cflags -pthread
  1993. add_extralibs -pthread
  1994. elif check_func pthread_create -pthreads; then
  1995. add_cflags -pthreads
  1996. add_extralibs -pthreads
  1997. elif check_func pthread_create -lpthreadGC2; then
  1998. add_extralibs -lpthreadGC2
  1999. elif ! check_lib pthread.h pthread_create -lpthread; then
  2000. die "ERROR: can't find pthreads library"
  2001. fi
  2002. fi
  2003. for thread in $THREADS_LIST; do
  2004. if enabled $thread; then
  2005. test -n "$thread_type" &&
  2006. die "ERROR: Only one thread type must be selected." ||
  2007. thread_type="$thread"
  2008. fi
  2009. done
  2010. check_lib math.h sin -lm
  2011. check_lib va/va.h vaInitialize -lva
  2012. check_func llrint
  2013. check_func log2
  2014. check_func lrint
  2015. check_func lrintf
  2016. check_func round
  2017. check_func roundf
  2018. check_func truncf
  2019. # these are off by default, so fail if requested and not available
  2020. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
  2021. enabled libdirac && add_cflags $(pkg-config --cflags dirac) &&
  2022. require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init -ldirac_decoder &&
  2023. require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init -ldirac_encoder
  2024. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  2025. enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
  2026. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  2027. enabled libmp3lame && require libmp3lame lame/lame.h lame_init -lmp3lame -lm
  2028. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  2029. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb -lm
  2030. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -lm
  2031. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  2032. enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
  2033. require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
  2034. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  2035. enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
  2036. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  2037. enabled libx264 && require libx264 x264.h x264_encoder_open -lx264 -lm &&
  2038. { check_cpp_condition x264.h "X264_BUILD >= 65" ||
  2039. die "ERROR: libx264 version must be >= 0.65."; }
  2040. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  2041. enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
  2042. # libdc1394 check
  2043. if enabled libdc1394; then
  2044. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  2045. enable libdc1394_2; } ||
  2046. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  2047. enable libdc1394_1; } ||
  2048. die "ERROR: No version of libdc1394 found "
  2049. fi
  2050. disable sdl_too_old
  2051. disable sdl
  2052. SDL_CONFIG="${cross_prefix}sdl-config"
  2053. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  2054. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  2055. temp_cflags $sdl_cflags
  2056. temp_extralibs $("${SDL_CONFIG}" --libs)
  2057. if check_lib2 SDL.h SDL_Init; then
  2058. _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g')
  2059. if test "$_sdlversion" -lt 121 ; then
  2060. enable sdl_too_old
  2061. else
  2062. enable sdl
  2063. check_cc $sdl_cflags <<EOF && enable sdl_video_size
  2064. #include <SDL.h>
  2065. int main(int argc, char **argv){
  2066. const SDL_VideoInfo *vi = SDL_GetVideoInfo();
  2067. int w = vi->current_w;
  2068. return 0;
  2069. }
  2070. EOF
  2071. fi
  2072. fi
  2073. restore_flags
  2074. fi
  2075. texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
  2076. if enabled network; then
  2077. check_type "sys/types.h sys/socket.h" socklen_t
  2078. # Prefer arpa/inet.h over winsock2
  2079. if check_header arpa/inet.h ; then
  2080. check_func closesocket
  2081. elif check_header winsock2.h ; then
  2082. check_func_headers winsock2.h closesocket -lws2 && \
  2083. network_extralibs="-lws2" || \
  2084. { check_func_headers winsock2.h closesocket -lws2_32 && \
  2085. network_extralibs="-lws2_32"; }
  2086. check_type ws2tcpip.h socklen_t
  2087. else
  2088. disable network
  2089. fi
  2090. fi
  2091. enabled_all network ipv6 && check_ld <<EOF || disable ipv6
  2092. #include <sys/types.h>
  2093. #include <sys/socket.h>
  2094. #include <netinet/in.h>
  2095. #include <netdb.h>
  2096. int main(void) {
  2097. struct sockaddr_storage saddr;
  2098. struct ipv6_mreq mreq6;
  2099. getaddrinfo(0,0,0,0);
  2100. getnameinfo(0,0,0,0,0,0,0);
  2101. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  2102. }
  2103. EOF
  2104. check_header linux/videodev.h
  2105. check_header linux/videodev2.h
  2106. check_header sys/videoio.h
  2107. check_func_headers "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  2108. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  2109. { check_header dev/bktr/ioctl_meteor.h &&
  2110. check_header dev/bktr/ioctl_bt848.h; } ||
  2111. { check_header machine/ioctl_meteor.h &&
  2112. check_header machine/ioctl_bt848.h; } ||
  2113. { check_header dev/video/meteor/ioctl_meteor.h &&
  2114. check_header dev/video/bktr/ioctl_bt848.h; } ||
  2115. check_header dev/ic/bt8xx.h
  2116. check_header sys/soundcard.h
  2117. check_header soundcard.h
  2118. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  2119. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack
  2120. enabled x11grab &&
  2121. check_header X11/Xlib.h &&
  2122. check_header X11/extensions/XShm.h &&
  2123. check_func XOpenDisplay -lX11 &&
  2124. check_func XShmCreateImage -lX11 -lXext
  2125. enabled debug && add_cflags -g"$debuglevel"
  2126. # add some useful compiler flags if supported
  2127. check_cflags -Wdeclaration-after-statement
  2128. check_cflags -Wall
  2129. check_cflags -Wno-switch
  2130. check_cflags -Wdisabled-optimization
  2131. check_cflags -Wpointer-arith
  2132. check_cflags -Wredundant-decls
  2133. check_cflags -Wno-pointer-sign
  2134. check_cflags -Wcast-qual
  2135. check_cflags -Wwrite-strings
  2136. check_cflags -Wtype-limits
  2137. check_cflags -Wundef
  2138. enabled extra_warnings && check_cflags -Winline
  2139. # add some linker flags
  2140. check_ldflags -Wl,--warn-common
  2141. check_ldflags -Wl,--as-needed
  2142. 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)/libavutil'
  2143. check_ldflags -Wl,-Bsymbolic
  2144. if enabled small; then
  2145. check_cflags -Os # not all compilers support -Os
  2146. optimizations="small"
  2147. elif enabled optimizations; then
  2148. if enabled xlc; then
  2149. add_cflags -O5
  2150. add_ldflags -O5
  2151. elif enabled ccc; then
  2152. add_cflags -fast
  2153. else
  2154. add_cflags -O3
  2155. fi
  2156. fi
  2157. check_cflags -fno-math-errno
  2158. check_cflags -fno-signed-zeros
  2159. if enabled icc; then
  2160. # Just warnings, no remarks
  2161. check_cflags -w1
  2162. # -wd: Disable following warnings
  2163. # 144, 167, 556: -Wno-pointer-sign
  2164. # 10006: ignoring unknown option -fno-signed-zeros
  2165. # 10156: ignoring option '-W'; no argument required
  2166. check_cflags -wd144,167,556,10006,10156
  2167. # 11030: Warning unknown option --as-needed
  2168. # 10156: ignoring option '-export'; no argument required
  2169. check_ldflags -wd10156,11030
  2170. # Allow to compile with optimizations
  2171. check_ldflags -march=$cpu
  2172. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  2173. enable ebp_available
  2174. elif enabled ccc; then
  2175. # disable some annoying warnings
  2176. add_cflags -msg_disable cvtu32to64
  2177. add_cflags -msg_disable embedcomment
  2178. add_cflags -msg_disable needconstext
  2179. add_cflags -msg_disable nomainieee
  2180. add_cflags -msg_disable ptrmismatch1
  2181. add_cflags -msg_disable unreachcode
  2182. elif enabled gcc; then
  2183. check_cflags -fno-tree-vectorize
  2184. fi
  2185. enabled pic && LIBOBJFLAGS='$(PIC)'
  2186. if enabled gprof; then
  2187. add_cflags -p
  2188. add_ldflags -p
  2189. fi
  2190. # Find out if the .align argument is a power of two or not.
  2191. check_asm asmalign_pot '".align 3"'
  2192. enabled_any $DECODER_LIST && enable decoders
  2193. enabled_any $ENCODER_LIST && enable encoders
  2194. enabled_any $HWACCEL_LIST && enable hwaccels
  2195. enabled_any $BSF_LIST && enable bsfs
  2196. enabled_any $DEMUXER_LIST && enable demuxers
  2197. enabled_any $MUXER_LIST && enable muxers
  2198. enabled_any $FILTER_LIST && enable filters
  2199. enabled_any $INDEV_LIST && enable indevs
  2200. enabled_any $OUTDEV_LIST && enable outdevs
  2201. enabled_any $PROTOCOL_LIST && enable protocols
  2202. enabled_any $THREADS_LIST && enable threads
  2203. check_deps $CONFIG_LIST \
  2204. $CONFIG_EXTRA \
  2205. $HAVE_LIST \
  2206. $DECODER_LIST \
  2207. $ENCODER_LIST \
  2208. $HWACCEL_LIST \
  2209. $PARSER_LIST \
  2210. $BSF_LIST \
  2211. $DEMUXER_LIST \
  2212. $MUXER_LIST \
  2213. $FILTER_LIST \
  2214. $INDEV_LIST \
  2215. $OUTDEV_LIST \
  2216. $PROTOCOL_LIST \
  2217. echo "install prefix $prefix"
  2218. echo "source path $source_path"
  2219. echo "C compiler $cc"
  2220. echo ".align is power-of-two $asmalign_pot"
  2221. echo "ARCH $arch ($cpu)"
  2222. if test "$build_suffix" != ""; then
  2223. echo "build suffix $build_suffix"
  2224. fi
  2225. if test "$extra_version" != ""; then
  2226. echo "version string suffix $extra_version"
  2227. fi
  2228. echo "big-endian ${bigendian-no}"
  2229. echo "runtime cpu detection ${runtime_cpudetect-no}"
  2230. if enabled x86; then
  2231. echo "yasm ${yasm-no}"
  2232. echo "MMX enabled ${mmx-no}"
  2233. echo "MMX2 enabled ${mmx2-no}"
  2234. echo "3DNow! enabled ${amd3dnow-no}"
  2235. echo "3DNow! extended enabled ${amd3dnowext-no}"
  2236. echo "SSE enabled ${sse-no}"
  2237. echo "SSSE3 enabled ${ssse3-no}"
  2238. echo "CMOV enabled ${cmov-no}"
  2239. echo "CMOV is fast ${fast_cmov-no}"
  2240. echo "EBX available ${ebx_available-no}"
  2241. echo "EBP available ${ebp_available-no}"
  2242. echo "10 operands supported ${ten_operands-no}"
  2243. fi
  2244. if enabled arm; then
  2245. echo "ARMv5TE enabled ${armv5te-no}"
  2246. echo "ARMv6 enabled ${armv6-no}"
  2247. echo "ARMv6T2 enabled ${armv6t2-no}"
  2248. echo "ARM VFP enabled ${armvfp-no}"
  2249. echo "IWMMXT enabled ${iwmmxt-no}"
  2250. echo "NEON enabled ${neon-no}"
  2251. fi
  2252. if enabled mips; then
  2253. echo "MMI enabled ${mmi-no}"
  2254. fi
  2255. if enabled ppc; then
  2256. echo "AltiVec enabled ${altivec-no}"
  2257. echo "PPC 4xx optimizations ${ppc4xx-no}"
  2258. echo "dcbzl available ${dcbzl-no}"
  2259. echo "performance report ${powerpc_perf-no}"
  2260. fi
  2261. if enabled sparc; then
  2262. echo "VIS enabled ${vis-no}"
  2263. fi
  2264. echo "gprof enabled ${gprof-no}"
  2265. echo "debug symbols ${debug-no}"
  2266. echo "strip symbols ${stripping-no}"
  2267. echo "optimizations ${optimizations-no}"
  2268. echo "static ${static-no}"
  2269. echo "shared ${shared-no}"
  2270. echo "postprocessing support ${postproc-no}"
  2271. echo "new filter support ${avfilter-no}"
  2272. echo "filters using lavformat ${avfilter_lavf-no}"
  2273. echo "network support ${network-no}"
  2274. if enabled network; then
  2275. echo "IPv6 support ${ipv6-no}"
  2276. fi
  2277. echo "threading support ${thread_type-no}"
  2278. echo "SDL support ${sdl-no}"
  2279. if enabled sdl_too_old; then
  2280. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  2281. fi
  2282. echo "Sun medialib support ${mlib-no}"
  2283. echo "AVISynth enabled ${avisynth-no}"
  2284. echo "libdc1394 support ${libdc1394-no}"
  2285. echo "libdirac enabled ${libdirac-no}"
  2286. echo "libfaac enabled ${libfaac-no}"
  2287. echo "libfaad enabled ${libfaad-no}"
  2288. echo "libfaad dlopened ${libfaadbin-no}"
  2289. echo "libgsm enabled ${libgsm-no}"
  2290. echo "libmp3lame enabled ${libmp3lame-no}"
  2291. echo "libnut enabled ${libnut-no}"
  2292. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  2293. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  2294. echo "libopenjpeg enabled ${libopenjpeg-no}"
  2295. echo "libschroedinger enabled ${libschroedinger-no}"
  2296. echo "libspeex enabled ${libspeex-no}"
  2297. echo "libtheora enabled ${libtheora-no}"
  2298. echo "libvorbis enabled ${libvorbis-no}"
  2299. echo "libx264 enabled ${libx264-no}"
  2300. echo "libxvid enabled ${libxvid-no}"
  2301. echo "zlib enabled ${zlib-no}"
  2302. echo "bzlib enabled ${bzlib-no}"
  2303. echo
  2304. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  2305. echo "Enabled ${type}s:"
  2306. eval list=\$$(toupper $type)_LIST
  2307. for part in $list; do
  2308. enabled $part && echo ${part%_*}
  2309. done | sort | pr -3 -t
  2310. echo
  2311. done
  2312. license="LGPL version 2.1 or later"
  2313. if enabled nonfree; then
  2314. license="nonfree and unredistributable"
  2315. elif enabled gplv3; then
  2316. license="GPL version 3 or later"
  2317. elif enabled lgplv3; then
  2318. license="LGPL version 3 or later"
  2319. elif enabled gpl; then
  2320. license="GPL version 2 or later"
  2321. fi
  2322. echo "License: $license"
  2323. echo "Creating config.mak and config.h..."
  2324. echo "# Automatically generated by configure - do not modify!" > config.mak
  2325. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  2326. echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
  2327. echo "#define FFMPEG_CONFIG_H" >> $TMPH
  2328. echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH
  2329. echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH
  2330. echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak
  2331. echo "FFMPEG_CONFIG_MAK=1" >> config.mak
  2332. echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
  2333. echo "prefix=$prefix" >> config.mak
  2334. echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
  2335. echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
  2336. echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
  2337. echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
  2338. echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak
  2339. echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
  2340. echo "SRC_PATH=\"$source_path\"" >> config.mak
  2341. echo "SRC_PATH_BARE=$source_path" >> config.mak
  2342. echo "BUILD_ROOT=\"$PWD\"" >> config.mak
  2343. echo "CC=$cc" >> config.mak
  2344. echo "AS=$as" >> config.mak
  2345. echo "LD=$ld" >> config.mak
  2346. echo "DEPCC=$dep_cc" >> config.mak
  2347. echo "YASM=$yasmexe" >> config.mak
  2348. echo "AR=$ar" >> config.mak
  2349. echo "RANLIB=$ranlib" >> config.mak
  2350. echo "LN_S=$ln_s" >> config.mak
  2351. enabled stripping &&
  2352. echo "STRIP=$strip" >> config.mak ||
  2353. echo "STRIP=echo ignoring strip" >> config.mak
  2354. echo "CPPFLAGS=$CPPFLAGS" >> config.mak
  2355. echo "CFLAGS=$CFLAGS" >> config.mak
  2356. echo "ASFLAGS=$ASFLAGS" >> config.mak
  2357. echo "CC_O=$CC_O" >> config.mak
  2358. echo "LDFLAGS=$LDFLAGS" >> config.mak
  2359. echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
  2360. echo "SHFLAGS=$SHFLAGS" >> config.mak
  2361. echo "YASMFLAGS=$YASMFLAGS" >> config.mak
  2362. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  2363. echo "PIC=-fPIC -DPIC" >> config.mak
  2364. echo "BUILDSUF=$build_suffix" >> config.mak
  2365. echo "FULLNAME=$FULLNAME" >> config.mak
  2366. echo "LIBPREF=$LIBPREF" >> config.mak
  2367. echo "LIBSUF=$LIBSUF" >> config.mak
  2368. echo "LIBNAME=$LIBNAME" >> config.mak
  2369. echo "SLIBPREF=$SLIBPREF" >> config.mak
  2370. echo "SLIBSUF=$SLIBSUF" >> config.mak
  2371. echo "EXESUF=$EXESUF" >> config.mak
  2372. echo "EXTRA_VERSION=$extra_version" >> config.mak
  2373. echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
  2374. echo "DEPFLAGS=$DEPFLAGS" >> config.mak
  2375. echo "HOSTCC=$host_cc" >> config.mak
  2376. echo "HOSTCFLAGS=$host_cflags" >> config.mak
  2377. echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak
  2378. echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
  2379. echo "HOSTLIBS=$host_libs" >> config.mak
  2380. echo "TARGET_EXEC=$target_exec" >> config.mak
  2381. echo "TARGET_PATH=$target_path" >> config.mak
  2382. if enabled sdl; then
  2383. echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
  2384. echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak
  2385. fi
  2386. if enabled texi2html; then
  2387. echo "BUILD_DOC=yes" >> config.mak
  2388. fi
  2389. get_version(){
  2390. name=$1
  2391. file=$source_path/$2
  2392. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  2393. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  2394. lcname=$(tolower $name)
  2395. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  2396. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  2397. }
  2398. get_version LIBSWSCALE libswscale/swscale.h
  2399. get_version LIBPOSTPROC libpostproc/postprocess.h
  2400. get_version LIBAVCODEC libavcodec/avcodec.h
  2401. get_version LIBAVDEVICE libavdevice/avdevice.h
  2402. get_version LIBAVFORMAT libavformat/avformat.h
  2403. get_version LIBAVUTIL libavutil/avutil.h
  2404. get_version LIBAVFILTER libavfilter/avfilter.h
  2405. if enabled shared; then
  2406. echo "LIBTARGET=${LIBTARGET}" >> config.mak
  2407. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  2408. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  2409. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  2410. echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
  2411. echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
  2412. echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
  2413. echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
  2414. fi
  2415. echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
  2416. echo "EXTRALIBS=$extralibs" >> config.mak
  2417. echo "ARCH=$arch" >> config.mak
  2418. print_config ARCH_ $TMPH config.mak $ARCH_LIST
  2419. print_config HAVE_ $TMPH config.mak $HAVE_LIST
  2420. print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
  2421. $CONFIG_EXTRA \
  2422. $DECODER_LIST \
  2423. $ENCODER_LIST \
  2424. $HWACCEL_LIST \
  2425. $PARSER_LIST \
  2426. $BSF_LIST \
  2427. $DEMUXER_LIST \
  2428. $MUXER_LIST \
  2429. $FILTER_LIST \
  2430. $PROTOCOL_LIST \
  2431. $INDEV_LIST \
  2432. $OUTDEV_LIST \
  2433. echo "#define restrict $_restrict" >> $TMPH
  2434. if enabled small || disabled optimizations; then
  2435. echo "#define av_always_inline" >> $TMPH
  2436. fi
  2437. # Apparently it's not possible to portably echo a backslash.
  2438. enabled asmalign_pot &&
  2439. printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
  2440. printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH
  2441. echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
  2442. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  2443. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  2444. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  2445. cmp -s $TMPH config.h &&
  2446. echo "config.h is unchanged" ||
  2447. mv -f $TMPH config.h
  2448. # build tree in object directory if source path is different from current one
  2449. if enabled source_path_used; then
  2450. DIRS="\
  2451. doc \
  2452. libavcodec \
  2453. libavcodec/alpha \
  2454. libavcodec/arm \
  2455. libavcodec/bfin \
  2456. libavcodec/mlib \
  2457. libavcodec/ppc \
  2458. libavcodec/sh4 \
  2459. libavcodec/sparc \
  2460. libavcodec/x86 \
  2461. libavdevice \
  2462. libavfilter \
  2463. libavformat \
  2464. libavutil \
  2465. libpostproc \
  2466. libswscale \
  2467. libswscale/bfin \
  2468. libswscale/mlib \
  2469. libswscale/ppc \
  2470. libswscale/sparc \
  2471. libswscale/x86 \
  2472. tests \
  2473. tools \
  2474. "
  2475. FILES="\
  2476. Makefile \
  2477. common.mak \
  2478. subdir.mak \
  2479. doc/texi2pod.pl \
  2480. libavcodec/Makefile \
  2481. libavdevice/Makefile \
  2482. libavfilter/Makefile \
  2483. libavformat/Makefile \
  2484. libavutil/Makefile \
  2485. libpostproc/Makefile \
  2486. libswscale/Makefile \
  2487. "
  2488. for dir in $DIRS ; do
  2489. mkdir -p $dir
  2490. done
  2491. for f in $FILES ; do
  2492. $ln_s "$source_path/$f" $f
  2493. done
  2494. fi
  2495. # build pkg-config files
  2496. pkgconfig_generate(){
  2497. name=$1
  2498. shortname=${name#lib}${build_suffix}
  2499. comment=$2
  2500. version=$3
  2501. libs=$4
  2502. requires=$5
  2503. cat <<EOF > $name/$name.pc
  2504. prefix=$prefix
  2505. exec_prefix=\${prefix}
  2506. libdir=$libdir
  2507. includedir=$incdir
  2508. Name: $name
  2509. Description: $comment
  2510. Version: $version
  2511. Requires: $(disabled shared && echo $requires)
  2512. Requires.private: $(enabled shared && echo $requires)
  2513. Conflicts:
  2514. Libs: -L\${libdir} -l${shortname} $(disabled shared && echo $libs)
  2515. Libs.private: $(enabled shared && echo $libs)
  2516. Cflags: -I\${includedir}
  2517. EOF
  2518. cat <<EOF > $name/$name-uninstalled.pc
  2519. prefix=
  2520. exec_prefix=
  2521. libdir=\${pcfiledir}
  2522. includedir=${source_path}
  2523. Name: $name
  2524. Description: $comment
  2525. Version: $version
  2526. Requires: $requires
  2527. Conflicts:
  2528. Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
  2529. Cflags: -I\${includedir}
  2530. EOF
  2531. }
  2532. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
  2533. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  2534. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  2535. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
  2536. enabled avfilter &&
  2537. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  2538. enabled postproc &&
  2539. pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
  2540. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"