configure 127 KB

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