configure 119 KB

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