configure 114 KB

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