configure 148 KB

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