configure 156 KB

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