configure 109 KB

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