configure 117 KB

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