Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

configure.ac 109KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305
  1. dnl Copyright © 2011-2014 Intel Corporation
  2. dnl Copyright © 2011-2014 Emil Velikov <emil.l.velikov@gmail.com>
  3. dnl Copyright © 2007-2010 Dan Nicholson
  4. dnl Copyright © 2010-2014 Marek Olšák <maraeo@gmail.com>
  5. dnl Copyright © 2010-2014 Christian König
  6. dnl Copyright © 2012-2014 Tom Stellard <tstellar@gmail.com>
  7. dnl Copyright © 2009-2012 Jakob Bornecrantz
  8. dnl Copyright © 2009-2014 Jon TURNEY
  9. dnl Copyright © 2011-2012 Benjamin Franzke
  10. dnl Copyright © 2008-2014 David Airlie
  11. dnl Copyright © 2009-2013 Brian Paul
  12. dnl
  13. dnl Permission is hereby granted, free of charge, to any person obtaining a
  14. dnl copy of this software and associated documentation files (the "Software"),
  15. dnl to deal in the Software without restriction, including without limitation
  16. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  17. dnl and/or sell copies of the Software, and to permit persons to whom the
  18. dnl Software is furnished to do so, subject to the following conditions:
  19. dnl
  20. dnl The above copyright notice and this permission notice (including the next
  21. dnl paragraph) shall be included in all copies or substantial portions of the
  22. dnl Software.
  23. dnl
  24. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  27. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  29. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  30. dnl DEALINGS IN THE SOFTWARE.
  31. dnl
  32. dnl Process this file with autoconf to create configure.
  33. AC_PREREQ([2.60])
  34. dnl Tell the user about autoconf.html in the --help output
  35. m4_divert_once([HELP_END], [
  36. See docs/autoconf.html for more details on the options for Mesa.])
  37. m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION)))
  38. AC_INIT([Mesa], [MESA_VERSION],
  39. [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
  40. AC_CONFIG_AUX_DIR([bin])
  41. AC_CONFIG_MACRO_DIR([m4])
  42. AC_CANONICAL_SYSTEM
  43. AM_INIT_AUTOMAKE([foreign tar-ustar dist-xz subdir-objects])
  44. dnl We only support native Windows builds (MinGW/MSVC) through SCons.
  45. case "$host_os" in
  46. mingw*)
  47. AC_MSG_ERROR([MinGW build not supported through autoconf/automake, use SCons instead])
  48. ;;
  49. esac
  50. # Support silent build rules, requires at least automake-1.11. Disable
  51. # by either passing --disable-silent-rules to configure or passing V=1
  52. # to make
  53. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  54. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  55. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  56. dnl Set internal versions
  57. OSMESA_VERSION=8
  58. AC_SUBST([OSMESA_VERSION])
  59. OPENCL_VERSION=1
  60. AC_SUBST([OPENCL_VERSION])
  61. # The idea is that libdrm is distributed as one cohesive package, even
  62. # though it is composed of multiple libraries. However some drivers
  63. # may have different version requirements than others. This list
  64. # codifies which drivers need which version of libdrm. Any libdrm
  65. # version dependencies in non-driver-specific code should be reflected
  66. # in the first entry.
  67. LIBDRM_REQUIRED=2.4.75
  68. LIBDRM_RADEON_REQUIRED=2.4.71
  69. LIBDRM_AMDGPU_REQUIRED=2.4.91
  70. LIBDRM_INTEL_REQUIRED=2.4.75
  71. LIBDRM_NVVIEUX_REQUIRED=2.4.66
  72. LIBDRM_NOUVEAU_REQUIRED=2.4.66
  73. LIBDRM_FREEDRENO_REQUIRED=2.4.92
  74. LIBDRM_ETNAVIV_REQUIRED=2.4.89
  75. LIBDRM_VC4_REQUIRED=2.4.89
  76. dnl Versions for external dependencies
  77. DRI2PROTO_REQUIRED=2.8
  78. GLPROTO_REQUIRED=1.4.14
  79. LIBOMXIL_BELLAGIO_REQUIRED=0.0
  80. LIBOMXIL_TIZONIA_REQUIRED=0.10.0
  81. LIBVA_REQUIRED=0.39.0
  82. VDPAU_REQUIRED=1.1
  83. WAYLAND_REQUIRED=1.11
  84. WAYLAND_EGL_BACKEND_REQUIRED=3
  85. WAYLAND_PROTOCOLS_REQUIRED=1.8
  86. XCB_REQUIRED=1.9.3
  87. XCBDRI2_REQUIRED=1.8
  88. XCBDRI3_MODIFIERS_REQUIRED=1.13
  89. XCBGLX_REQUIRED=1.8.1
  90. XCBPRESENT_MODIFIERS_REQUIRED=1.13
  91. XDAMAGE_REQUIRED=1.1
  92. XSHMFENCE_REQUIRED=1.1
  93. XVMC_REQUIRED=1.0.6
  94. PYTHON_MAKO_REQUIRED=0.8.0
  95. LIBSENSORS_REQUIRED=4.0.0
  96. ZLIB_REQUIRED=1.2.3
  97. dnl LLVM versions
  98. LLVM_REQUIRED_GALLIUM=3.3.0
  99. LLVM_REQUIRED_OPENCL=3.9.0
  100. LLVM_REQUIRED_R600=3.9.0
  101. LLVM_REQUIRED_RADEONSI=5.0.0
  102. LLVM_REQUIRED_RADV=5.0.0
  103. LLVM_REQUIRED_SWR=4.0.0
  104. dnl Check for progs
  105. AC_PROG_CPP
  106. AC_PROG_CC
  107. AC_PROG_CXX
  108. dnl add this here, so the help for this environmnet variable is close to
  109. dnl other CC/CXX flags related help
  110. AC_ARG_VAR([CXX11_CXXFLAGS], [Compiler flag to enable C++11 support (only needed if not
  111. enabled by default and different from -std=c++11)])
  112. AM_PROG_CC_C_O
  113. AC_PROG_GREP
  114. AC_PROG_NM
  115. AM_PROG_AS
  116. AX_CHECK_GNU_MAKE
  117. AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
  118. AC_PROG_SED
  119. AC_PROG_MKDIR_P
  120. AC_SYS_LARGEFILE
  121. LT_PREREQ([2.2])
  122. LT_INIT([disable-static])
  123. AC_CHECK_PROG(RM, rm, [rm -f])
  124. AX_PROG_BISON([],
  125. AS_IF([test ! -f "$srcdir/src/compiler/glsl/glcpp/glcpp-parse.c"],
  126. [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
  127. AX_PROG_FLEX([],
  128. AS_IF([test ! -f "$srcdir/src/compiler/glsl/glcpp/glcpp-lex.c"],
  129. [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
  130. AC_CHECK_PROG(INDENT, indent, indent, cat)
  131. if test "x$INDENT" != "xcat"; then
  132. # Only GNU indent is supported
  133. INDENT_VERSION=`indent --version | grep GNU`
  134. if test $? -eq 0; then
  135. AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
  136. else
  137. INDENT="cat"
  138. fi
  139. fi
  140. AX_CHECK_PYTHON_MAKO_MODULE($PYTHON_MAKO_REQUIRED)
  141. if test -z "$PYTHON2"; then
  142. if test ! -f "$srcdir/src/util/format_srgb.c"; then
  143. AC_MSG_ERROR([Python not found - unable to generate sources])
  144. fi
  145. else
  146. if test "x$acv_mako_found" = xno; then
  147. if test ! -f "$srcdir/src/mesa/main/format_unpack.c"; then
  148. AC_MSG_ERROR([Python mako module v$PYTHON_MAKO_REQUIRED or higher not found])
  149. fi
  150. fi
  151. fi
  152. AC_PROG_INSTALL
  153. dnl We need a POSIX shell for parts of the build. Assume we have one
  154. dnl in most cases.
  155. case "$host_os" in
  156. solaris*)
  157. # Solaris /bin/sh is too old/non-POSIX compliant
  158. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  159. SHELL="$POSIX_SHELL"
  160. ;;
  161. esac
  162. dnl clang is mostly GCC-compatible, but its version is much lower,
  163. dnl so we have to check for it.
  164. AC_MSG_CHECKING([if compiling with clang])
  165. AC_COMPILE_IFELSE(
  166. [AC_LANG_PROGRAM([], [[
  167. #ifndef __clang__
  168. not clang
  169. #endif
  170. ]])],
  171. [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
  172. AC_MSG_RESULT([$acv_mesa_CLANG])
  173. dnl If we're using GCC, make sure that it is at least version 4.2.0. Older
  174. dnl versions are explictly not supported.
  175. GEN_ASM_OFFSETS=no
  176. USE_GNU99=no
  177. if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
  178. AC_MSG_CHECKING([whether gcc version is sufficient])
  179. major=0
  180. minor=0
  181. GCC_VERSION=`$CC -dumpversion`
  182. if test $? -eq 0; then
  183. GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
  184. GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
  185. fi
  186. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 2 ; then
  187. AC_MSG_RESULT([no])
  188. AC_MSG_ERROR([If using GCC, version 4.2.0 or later is required.])
  189. else
  190. AC_MSG_RESULT([yes])
  191. fi
  192. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6 ; then
  193. USE_GNU99=yes
  194. fi
  195. if test "x$cross_compiling" = xyes; then
  196. GEN_ASM_OFFSETS=yes
  197. fi
  198. fi
  199. dnl We don't support building Mesa with Sun C compiler
  200. dnl https://bugs.freedesktop.org/show_bug.cgi?id=93189
  201. AC_CHECK_DECL([__SUNPRO_C], [SUNCC=yes], [SUNCC=no])
  202. if test "x$SUNCC" = xyes; then
  203. AC_MSG_ERROR([Building with Sun C compiler is not supported, use GCC instead.])
  204. fi
  205. dnl Check for compiler builtins
  206. AX_GCC_BUILTIN([__builtin_bswap32])
  207. AX_GCC_BUILTIN([__builtin_bswap64])
  208. AX_GCC_BUILTIN([__builtin_clz])
  209. AX_GCC_BUILTIN([__builtin_clzll])
  210. AX_GCC_BUILTIN([__builtin_ctz])
  211. AX_GCC_BUILTIN([__builtin_expect])
  212. AX_GCC_BUILTIN([__builtin_ffs])
  213. AX_GCC_BUILTIN([__builtin_ffsll])
  214. AX_GCC_BUILTIN([__builtin_popcount])
  215. AX_GCC_BUILTIN([__builtin_popcountll])
  216. AX_GCC_BUILTIN([__builtin_unreachable])
  217. AX_GCC_FUNC_ATTRIBUTE([const])
  218. AX_GCC_FUNC_ATTRIBUTE([flatten])
  219. AX_GCC_FUNC_ATTRIBUTE([format])
  220. AX_GCC_FUNC_ATTRIBUTE([malloc])
  221. AX_GCC_FUNC_ATTRIBUTE([packed])
  222. AX_GCC_FUNC_ATTRIBUTE([pure])
  223. AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
  224. AX_GCC_FUNC_ATTRIBUTE([unused])
  225. AX_GCC_FUNC_ATTRIBUTE([visibility])
  226. AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
  227. AX_GCC_FUNC_ATTRIBUTE([weak])
  228. AX_GCC_FUNC_ATTRIBUTE([alias])
  229. AX_GCC_FUNC_ATTRIBUTE([noreturn])
  230. AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
  231. dnl Make sure the pkg-config macros are defined
  232. m4_ifndef([PKG_PROG_PKG_CONFIG],
  233. [m4_fatal([Could not locate the pkg-config autoconf macros.
  234. These are usually located in /usr/share/aclocal/pkg.m4. If your macros
  235. are in a different location, try setting the environment variable
  236. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  237. PKG_PROG_PKG_CONFIG()
  238. dnl LIB_DIR - library basename
  239. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  240. AC_SUBST([LIB_DIR])
  241. dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
  242. _SAVE_LDFLAGS="$LDFLAGS"
  243. _SAVE_CPPFLAGS="$CPPFLAGS"
  244. dnl Compiler macros
  245. DEFINES="-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
  246. AC_SUBST([DEFINES])
  247. android=no
  248. case "$host_os" in
  249. *-android*)
  250. android=yes
  251. ;;
  252. linux*|*-gnu*|gnu*|cygwin*)
  253. DEFINES="$DEFINES -D_GNU_SOURCE"
  254. ;;
  255. solaris*)
  256. DEFINES="$DEFINES -DSVR4"
  257. ;;
  258. esac
  259. AM_CONDITIONAL(HAVE_ANDROID, test "x$android" = xyes)
  260. dnl
  261. dnl Check compiler flags
  262. dnl
  263. AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
  264. AX_CHECK_COMPILE_FLAG([-Werror=implicit-function-declaration], [CFLAGS="$CFLAGS -Werror=implicit-function-declaration"])
  265. AX_CHECK_COMPILE_FLAG([-Werror=missing-prototypes], [CFLAGS="$CFLAGS -Werror=missing-prototypes"])
  266. AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
  267. AX_CHECK_COMPILE_FLAG([-fno-math-errno], [CFLAGS="$CFLAGS -fno-math-errno"])
  268. AX_CHECK_COMPILE_FLAG([-fno-trapping-math], [CFLAGS="$CFLAGS -fno-trapping-math"])
  269. AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"])
  270. dnl
  271. dnl Check C++ compiler flags
  272. dnl
  273. AC_LANG_PUSH([C++])
  274. AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
  275. AX_CHECK_COMPILE_FLAG([-fno-math-errno], [CXXFLAGS="$CXXFLAGS -fno-math-errno"])
  276. AX_CHECK_COMPILE_FLAG([-fno-trapping-math], [CXXFLAGS="$CXXFLAGS -fno-trapping-math"])
  277. AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [VISIBILITY_CXXFLAGS="-fvisibility=hidden"])
  278. AC_LANG_POP([C++])
  279. # Flags to help ensure that certain portions of the code -- and only those
  280. # portions -- can be built with MSVC:
  281. # - src/util, src/gallium/auxiliary, rc/gallium/drivers/llvmpipe, and
  282. # - non-Linux/Posix OpenGL portions needs to build on MSVC 2013 (which
  283. # supports most of C99)
  284. # - the rest has no compiler compiler restrictions
  285. AX_CHECK_COMPILE_FLAG([-Werror=pointer-arith], [MSVC2013_COMPAT_CFLAGS="$MSVC2013_COMPAT_CFLAGS -Werror=pointer-arith"])
  286. AX_CHECK_COMPILE_FLAG([-Werror=vla], [MSVC2013_COMPAT_CFLAGS="$MSVC2013_COMPAT_CFLAGS -Werror=vla"])
  287. AC_LANG_PUSH([C++])
  288. AX_CHECK_COMPILE_FLAG([-Werror=pointer-arith], [MSVC2013_COMPAT_CXXFLAGS="$MSVC2013_COMPAT_CXXFLAGS -Werror=pointer-arith"])
  289. AX_CHECK_COMPILE_FLAG([-Werror=vla], [MSVC2013_COMPAT_CXXFLAGS="$MSVC2013_COMPAT_CXXFLAGS -Werror=vla"])
  290. AC_LANG_POP([C++])
  291. AC_SUBST([MSVC2013_COMPAT_CFLAGS])
  292. AC_SUBST([MSVC2013_COMPAT_CXXFLAGS])
  293. if test "x$GCC" = xyes; then
  294. if test "x$USE_GNU99" = xyes; then
  295. CFLAGS="$CFLAGS -std=gnu99"
  296. else
  297. CFLAGS="$CFLAGS -std=c99"
  298. fi
  299. fi
  300. dnl
  301. dnl Check whether C++11 is supported, if the environment variable
  302. dnl CXX11_CXXFLAGS is set it takes precedence.
  303. dnl
  304. AC_LANG_PUSH([C++])
  305. check_cxx11_available() {
  306. output_support=$1
  307. AC_COMPILE_IFELSE(
  308. [AC_LANG_PROGRAM([
  309. #if !(__cplusplus >= 201103L)
  310. #error
  311. #endif
  312. #include <tuple>
  313. ])
  314. ], [
  315. AC_MSG_RESULT(yes)
  316. cxx11_support=yes
  317. ], AC_MSG_RESULT(no))
  318. eval "$output_support=\$cxx11_support"
  319. }
  320. HAVE_CXX11=no
  321. save_CXXFLAGS="$CXXFLAGS"
  322. dnl If the user provides a flag to enable c++11, then we test only this
  323. if test "x$CXX11_CXXFLAGS" != "x"; then
  324. CXXFLAGS="$CXXFLAGS $CXX11_CXXFLAGS"
  325. AC_MSG_CHECKING(whether c++11 is enabled by via $CXX11_CXXFLAGS)
  326. check_cxx11_available HAVE_CXX11
  327. else
  328. dnl test whether c++11 is enabled by default
  329. AC_MSG_CHECKING(whether c++11 is enabled by default)
  330. check_cxx11_available HAVE_CXX11
  331. dnl C++11 not enabled by default, test whether -std=c++11 does the job
  332. if test "x$HAVE_CXX11" != "xyes"; then
  333. CXX11_CXXFLAGS=-std=c++11
  334. CXXFLAGS="$CXXFLAGS $CXX11_CXXFLAGS"
  335. AC_MSG_CHECKING(whether c++11 is enabled by via $CXX11_CXXFLAGS)
  336. check_cxx11_available HAVE_CXX11
  337. fi
  338. fi
  339. CXXFLAGS="$save_CXXFLAGS"
  340. AM_CONDITIONAL(HAVE_STD_CXX11, test "x$HAVE_CXX11" = "xyes")
  341. AC_SUBST(CXX11_CXXFLAGS)
  342. AC_LANG_POP([C++])
  343. dnl even if the compiler appears to support it, using visibility attributes isn't
  344. dnl going to do anything useful currently on cygwin apart from emit lots of warnings
  345. case "$host_os" in
  346. cygwin*)
  347. VISIBILITY_CFLAGS=""
  348. VISIBILITY_CXXFLAGS=""
  349. ;;
  350. esac
  351. AC_SUBST([VISIBILITY_CFLAGS])
  352. AC_SUBST([VISIBILITY_CXXFLAGS])
  353. dnl For some reason, the test for -Wno-foo always succeeds with gcc, even if the
  354. dnl option is not supported. Hence, check for -Wfoo instead.
  355. AX_CHECK_COMPILE_FLAG([-Woverride-init], [WNO_OVERRIDE_INIT="$WNO_OVERRIDE_INIT -Wno-override-init"]) # gcc
  356. AX_CHECK_COMPILE_FLAG([-Winitializer-overrides], [WNO_OVERRIDE_INIT="$WNO_OVERRIDE_INIT -Wno-initializer-overrides"]) # clang
  357. AC_SUBST([WNO_OVERRIDE_INIT])
  358. dnl
  359. dnl Optional flags, check for compiler support
  360. dnl
  361. SSE41_CFLAGS="-msse4.1"
  362. dnl Code compiled by GCC with -msse* assumes a 16 byte aligned
  363. dnl stack, but on x86-32 such alignment is not guaranteed.
  364. case "$target_cpu" in
  365. i?86)
  366. SSE41_CFLAGS="$SSE41_CFLAGS -mstackrealign"
  367. ;;
  368. esac
  369. save_CFLAGS="$CFLAGS"
  370. CFLAGS="$SSE41_CFLAGS $CFLAGS"
  371. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  372. #include <smmintrin.h>
  373. int param;
  374. int main () {
  375. __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
  376. c = _mm_max_epu32(a, b);
  377. return _mm_cvtsi128_si32(c);
  378. }]])], SSE41_SUPPORTED=1)
  379. CFLAGS="$save_CFLAGS"
  380. if test "x$SSE41_SUPPORTED" = x1; then
  381. DEFINES="$DEFINES -DUSE_SSE41"
  382. fi
  383. AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1])
  384. AC_SUBST([SSE41_CFLAGS], $SSE41_CFLAGS)
  385. dnl Check for new-style atomic builtins. We first check without linking to
  386. dnl -latomic.
  387. AC_MSG_CHECKING(whether __atomic_load_n is supported)
  388. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  389. #include <stdint.h>
  390. int main() {
  391. struct {
  392. uint64_t *v;
  393. } x;
  394. return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) &
  395. (int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL);
  396. }]])], GCC_ATOMIC_BUILTINS_SUPPORTED=yes, GCC_ATOMIC_BUILTINS_SUPPORTED=no)
  397. dnl If that didn't work, we try linking with -latomic, which is needed on some
  398. dnl platforms.
  399. if test "x$GCC_ATOMIC_BUILTINS_SUPPORTED" != xyes; then
  400. save_LDFLAGS=$LDFLAGS
  401. LDFLAGS="$LDFLAGS -latomic"
  402. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  403. #include <stdint.h>
  404. int main() {
  405. struct {
  406. uint64_t *v;
  407. } x;
  408. return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) &
  409. (int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL);
  410. }]])], GCC_ATOMIC_BUILTINS_SUPPORTED=yes LIBATOMIC_LIBS="-latomic",
  411. GCC_ATOMIC_BUILTINS_SUPPORTED=no)
  412. LDFLAGS=$save_LDFLAGS
  413. fi
  414. AC_MSG_RESULT($GCC_ATOMIC_BUILTINS_SUPPORTED)
  415. if test "x$GCC_ATOMIC_BUILTINS_SUPPORTED" = xyes; then
  416. DEFINES="$DEFINES -DUSE_GCC_ATOMIC_BUILTINS"
  417. fi
  418. AC_SUBST([LIBATOMIC_LIBS])
  419. dnl Check if host supports 64-bit atomics
  420. dnl note that lack of support usually results in link (not compile) error
  421. AC_MSG_CHECKING(whether __sync_add_and_fetch_8 is supported)
  422. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  423. #include <stdint.h>
  424. uint64_t v;
  425. int main() {
  426. return __sync_add_and_fetch(&v, (uint64_t)1);
  427. }]])], GCC_64BIT_ATOMICS_SUPPORTED=yes, GCC_64BIT_ATOMICS_SUPPORTED=no)
  428. if test "x$GCC_64BIT_ATOMICS_SUPPORTED" != xyes; then
  429. DEFINES="$DEFINES -DMISSING_64BIT_ATOMICS"
  430. fi
  431. AC_MSG_RESULT($GCC_64BIT_ATOMICS_SUPPORTED)
  432. dnl Check for Endianness
  433. AC_C_BIGENDIAN(
  434. little_endian=no,
  435. little_endian=yes,
  436. little_endian=no,
  437. little_endian=no
  438. )
  439. dnl Check for POWER8 Architecture
  440. PWR8_CFLAGS="-mpower8-vector"
  441. have_pwr8_intrinsics=no
  442. AC_MSG_CHECKING(whether gcc supports -mpower8-vector)
  443. save_CFLAGS=$CFLAGS
  444. CFLAGS="$PWR8_CFLAGS $CFLAGS"
  445. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  446. #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
  447. #error "Need GCC >= 4.8 for sane POWER8 support"
  448. #endif
  449. #include <altivec.h>
  450. int main () {
  451. vector unsigned char r;
  452. vector unsigned int v = vec_splat_u32 (1);
  453. r = __builtin_vec_vgbbd ((vector unsigned char) v);
  454. return 0;
  455. }]])], have_pwr8_intrinsics=yes)
  456. CFLAGS=$save_CFLAGS
  457. AC_ARG_ENABLE(pwr8,
  458. [AS_HELP_STRING([--disable-pwr8],
  459. [disable POWER8-specific instructions])],
  460. [enable_pwr8=$enableval], [enable_pwr8=auto])
  461. if test "x$enable_pwr8" = xno ; then
  462. have_pwr8_intrinsics=disabled
  463. fi
  464. if test $have_pwr8_intrinsics = yes && test $little_endian = yes ; then
  465. DEFINES="$DEFINES -D_ARCH_PWR8"
  466. CXXFLAGS="$CXXFLAGS $PWR8_CFLAGS"
  467. CFLAGS="$CFLAGS $PWR8_CFLAGS"
  468. else
  469. PWR8_CFLAGS=
  470. fi
  471. AC_MSG_RESULT($have_pwr8_intrinsics)
  472. if test "x$enable_pwr8" = xyes && test $have_pwr8_intrinsics = no ; then
  473. AC_MSG_ERROR([POWER8 compiler support not detected])
  474. fi
  475. if test $have_pwr8_intrinsics = yes && test $little_endian = no ; then
  476. AC_MSG_WARN([POWER8 optimization is enabled only on POWER8 Little-Endian])
  477. fi
  478. AC_SUBST([PWR8_CFLAGS], $PWR8_CFLAGS)
  479. dnl Can't have static and shared libraries, default to static if user
  480. dnl explicitly requested. If both disabled, set to static since shared
  481. dnl was explicitly requested.
  482. case "x$enable_static$enable_shared" in
  483. xyesyes)
  484. AC_MSG_ERROR([Cannot enable both static and shared. Building using --enable-shared is strongly recommended])
  485. ;;
  486. xnono)
  487. AC_MSG_ERROR([Cannot disable both static and shared. Building using --enable-shared is strongly recommended])
  488. ;;
  489. esac
  490. AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
  491. dnl
  492. dnl other compiler options
  493. dnl
  494. AC_ARG_ENABLE([debug],
  495. [AS_HELP_STRING([--enable-debug],
  496. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  497. [enable_debug="$enableval"],
  498. [enable_debug=no]
  499. )
  500. AC_ARG_ENABLE([profile],
  501. [AS_HELP_STRING([--enable-profile],
  502. [enable profiling of code @<:@default=disabled@:>@])],
  503. [enable_profile="$enableval"],
  504. [enable_profile=no]
  505. )
  506. AC_ARG_ENABLE([sanitize],
  507. [AS_HELP_STRING([--enable-sanitize@<:@=address|undefined@:>@],
  508. [enable code sanitizer @<:@default=disabled@:>@])],
  509. [enable_sanitize="$enableval"],
  510. [enable_sanitize=no])
  511. if test "x$enable_profile" = xyes; then
  512. DEFINES="$DEFINES -DPROFILE"
  513. if test "x$GCC" = xyes; then
  514. CFLAGS="$CFLAGS -fno-omit-frame-pointer"
  515. fi
  516. if test "x$GXX" = xyes; then
  517. CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
  518. fi
  519. fi
  520. if test "x$enable_debug" = xyes; then
  521. DEFINES="$DEFINES -DDEBUG"
  522. if test "x$enable_profile" = xyes; then
  523. AC_MSG_WARN([Debug and Profile are enabled at the same time])
  524. fi
  525. if test "x$GCC" = xyes; then
  526. if ! echo "$CFLAGS" | grep -q -e '-g'; then
  527. CFLAGS="$CFLAGS -g"
  528. fi
  529. if ! echo "$CFLAGS" | grep -q -e '-O'; then
  530. CFLAGS="$CFLAGS -O0"
  531. fi
  532. fi
  533. if test "x$GXX" = xyes; then
  534. if ! echo "$CXXFLAGS" | grep -q -e '-g'; then
  535. CXXFLAGS="$CXXFLAGS -g"
  536. fi
  537. if ! echo "$CXXFLAGS" | grep -q -e '-O'; then
  538. CXXFLAGS="$CXXFLAGS -O0"
  539. fi
  540. fi
  541. else
  542. DEFINES="$DEFINES -DNDEBUG"
  543. fi
  544. if test "x$enable_sanitize" != xno; then
  545. if test "x$enable_profile" = xyes; then
  546. AC_MSG_WARN([Sanitize and Profile are enabled at the same time])
  547. fi
  548. CFLAGS="$CFLAGS -fsanitize=$enable_sanitize"
  549. CXXFLAGS="$CXXFLAGS -fsanitize=$enable_sanitize"
  550. LDFLAGS="$LDFLAGS -fsanitize=$enable_sanitize"
  551. AC_LINK_IFELSE(
  552. [AC_LANG_SOURCE([int main(){return 0;}])],
  553. [],
  554. [AC_MSG_FAILURE([sanitize flags '$enable_sanitize' not supported])])
  555. fi
  556. dnl
  557. dnl Check if linker supports -Bsymbolic
  558. dnl
  559. save_LDFLAGS=$LDFLAGS
  560. LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
  561. AC_MSG_CHECKING([if ld supports -Bsymbolic])
  562. AC_LINK_IFELSE(
  563. [AC_LANG_SOURCE([int main() { return 0;}])],
  564. [AC_MSG_RESULT([yes])
  565. BSYMBOLIC="-Wl,-Bsymbolic";],
  566. [AC_MSG_RESULT([no])
  567. BSYMBOLIC="";])
  568. LDFLAGS=$save_LDFLAGS
  569. AC_SUBST([BSYMBOLIC])
  570. dnl
  571. dnl Check if linker supports garbage collection
  572. dnl
  573. save_LDFLAGS=$LDFLAGS
  574. LDFLAGS="$LDFLAGS -Wl,--gc-sections"
  575. AC_MSG_CHECKING([whether ld supports --gc-sections])
  576. AC_LINK_IFELSE(
  577. [AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])],
  578. [AC_MSG_RESULT([yes])
  579. GC_SECTIONS="-Wl,--gc-sections";],
  580. [AC_MSG_RESULT([no])
  581. GC_SECTIONS="";])
  582. LDFLAGS=$save_LDFLAGS
  583. AC_SUBST([GC_SECTIONS])
  584. dnl
  585. dnl OpenBSD does not have DT_NEEDED entries for libc by design
  586. dnl so when these flags are passed to ld via libtool the checks will fail
  587. dnl
  588. case "$host_os" in
  589. openbsd* | darwin* )
  590. LD_NO_UNDEFINED="" ;;
  591. *)
  592. if test "x$enable_sanitize" = xno; then
  593. LD_NO_UNDEFINED="-Wl,--no-undefined"
  594. else
  595. LD_NO_UNDEFINED=""
  596. fi
  597. ;;
  598. esac
  599. AC_SUBST([LD_NO_UNDEFINED])
  600. dnl
  601. dnl Check if linker supports version scripts
  602. dnl
  603. AC_MSG_CHECKING([if the linker supports version-scripts])
  604. save_LDFLAGS=$LDFLAGS
  605. LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/build-support/conftest.map"
  606. AC_LINK_IFELSE(
  607. [AC_LANG_SOURCE([int main() { return 0;}])],
  608. [have_ld_version_script=yes;AC_MSG_RESULT(yes)],
  609. [have_ld_version_script=no; AC_MSG_RESULT(no)])
  610. LDFLAGS=$save_LDFLAGS
  611. AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
  612. dnl
  613. dnl Check if linker supports dynamic list files
  614. dnl
  615. AC_MSG_CHECKING([if the linker supports --dynamic-list])
  616. save_LDFLAGS=$LDFLAGS
  617. LDFLAGS="$LDFLAGS -Wl,--dynamic-list=$srcdir/build-support/conftest.dyn"
  618. AC_LINK_IFELSE(
  619. [AC_LANG_SOURCE([int main() { return 0;}])],
  620. [have_ld_dynamic_list=yes;AC_MSG_RESULT(yes)],
  621. [have_ld_dynamic_list=no; AC_MSG_RESULT(no)])
  622. LDFLAGS=$save_LDFLAGS
  623. AM_CONDITIONAL(HAVE_LD_DYNAMIC_LIST, test "$have_ld_dynamic_list" = "yes")
  624. dnl
  625. dnl OSX linker does not support build-id
  626. dnl
  627. case "$host_os" in
  628. darwin*)
  629. LD_BUILD_ID=""
  630. ;;
  631. *)
  632. LD_BUILD_ID="-Wl,--build-id=sha1"
  633. ;;
  634. esac
  635. AC_SUBST([LD_BUILD_ID])
  636. dnl
  637. dnl compatibility symlinks
  638. dnl
  639. case "$host_os" in
  640. linux* )
  641. HAVE_COMPAT_SYMLINKS=yes ;;
  642. * )
  643. HAVE_COMPAT_SYMLINKS=no ;;
  644. esac
  645. AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test "x$HAVE_COMPAT_SYMLINKS" = xyes)
  646. dnl
  647. dnl library names
  648. dnl
  649. dnl Unfortunately we need to do a few things that libtool can't help us with,
  650. dnl so we need some knowledge of shared library filenames:
  651. dnl
  652. dnl LIB_EXT is the extension used when creating symlinks for alternate
  653. dnl filenames for a shared library which will be dynamically loaded
  654. dnl
  655. dnl IMP_LIB_EXT is the extension used when checking for the presence of a
  656. dnl the file for a shared library we wish to link with
  657. dnl
  658. case "$host_os" in
  659. darwin* )
  660. LIB_EXT='dylib'
  661. IMP_LIB_EXT=$LIB_EXT
  662. ;;
  663. cygwin* )
  664. LIB_EXT='dll'
  665. IMP_LIB_EXT='dll.a'
  666. ;;
  667. aix* )
  668. LIB_EXT='a'
  669. IMP_LIB_EXT=$LIB_EXT
  670. ;;
  671. * )
  672. LIB_EXT='so'
  673. IMP_LIB_EXT=$LIB_EXT
  674. ;;
  675. esac
  676. AC_SUBST([LIB_EXT])
  677. dnl
  678. dnl potentially-infringing-but-nobody-knows-for-sure stuff
  679. dnl
  680. AC_ARG_ENABLE([texture-float],
  681. [AS_HELP_STRING([--enable-texture-float],
  682. [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
  683. [enable_texture_float="$enableval"],
  684. [enable_texture_float=no]
  685. )
  686. if test "x$enable_texture_float" = xyes; then
  687. AC_MSG_WARN([Floating-point textures enabled.])
  688. AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
  689. DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
  690. fi
  691. dnl
  692. dnl Arch/platform-specific settings
  693. dnl
  694. AC_ARG_ENABLE([asm],
  695. [AS_HELP_STRING([--disable-asm],
  696. [disable assembly usage @<:@default=enabled on supported platforms@:>@])],
  697. [enable_asm="$enableval"],
  698. [enable_asm=yes]
  699. )
  700. asm_arch=""
  701. AC_MSG_CHECKING([whether to enable assembly])
  702. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  703. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  704. if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then
  705. case "$host_cpu" in
  706. i?86 | x86_64 | amd64)
  707. if test "x$host_cpu" != "x$target_cpu"; then
  708. enable_asm=no
  709. AC_MSG_RESULT([no, cross compiling])
  710. fi
  711. ;;
  712. esac
  713. fi
  714. # check for supported arches
  715. if test "x$enable_asm" = xyes; then
  716. case "$host_cpu" in
  717. i?86)
  718. case "$host_os" in
  719. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd* | gnu*)
  720. asm_arch=x86
  721. ;;
  722. esac
  723. ;;
  724. x86_64|amd64)
  725. case "$host_os" in
  726. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
  727. asm_arch=x86_64
  728. ;;
  729. esac
  730. ;;
  731. sparc*)
  732. case "$host_os" in
  733. linux*)
  734. asm_arch=sparc
  735. ;;
  736. esac
  737. ;;
  738. powerpc64le)
  739. case "$host_os" in
  740. linux*)
  741. asm_arch=ppc64le
  742. ;;
  743. esac
  744. ;;
  745. aarch64)
  746. case "$host_os" in
  747. linux*)
  748. asm_arch=aarch64
  749. ;;
  750. esac
  751. ;;
  752. arm)
  753. case "$host_os" in
  754. linux*)
  755. asm_arch=arm
  756. ;;
  757. esac
  758. ;;
  759. esac
  760. case "$asm_arch" in
  761. x86)
  762. DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  763. AC_MSG_RESULT([yes, x86])
  764. ;;
  765. x86_64|amd64)
  766. DEFINES="$DEFINES -DUSE_X86_64_ASM"
  767. AC_MSG_RESULT([yes, x86_64])
  768. ;;
  769. sparc)
  770. DEFINES="$DEFINES -DUSE_SPARC_ASM"
  771. AC_MSG_RESULT([yes, sparc])
  772. ;;
  773. ppc64le)
  774. DEFINES="$DEFINES -DUSE_PPC64LE_ASM"
  775. AC_MSG_RESULT([yes, ppc64le])
  776. ;;
  777. aarch64)
  778. DEFINES="$DEFINES -DUSE_AARCH64_ASM"
  779. AC_MSG_RESULT([yes, aarch64])
  780. ;;
  781. arm)
  782. DEFINES="$DEFINES -DUSE_ARM_ASM"
  783. AC_MSG_RESULT([yes, arm])
  784. ;;
  785. *)
  786. AC_MSG_RESULT([no, platform not supported])
  787. ;;
  788. esac
  789. fi
  790. AC_HEADER_MAJOR
  791. AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
  792. AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
  793. AC_CHECK_HEADERS([endian.h])
  794. AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
  795. AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
  796. AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])
  797. AC_CHECK_FUNC([memfd_create], [DEFINES="$DEFINES -DHAVE_MEMFD_CREATE"])
  798. AC_MSG_CHECKING([whether strtod has locale support])
  799. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  800. #define _GNU_SOURCE
  801. #include <stdlib.h>
  802. #include <locale.h>
  803. #ifdef HAVE_XLOCALE_H
  804. #include <xlocale.h>
  805. #endif
  806. int main() {
  807. locale_t loc = newlocale(LC_CTYPE_MASK, "C", NULL);
  808. const char *s = "1.0";
  809. char *end;
  810. double d = strtod_l(s, end, loc);
  811. float f = strtof_l(s, end, loc);
  812. freelocale(loc);
  813. return 0;
  814. }]])],
  815. [DEFINES="$DEFINES -DHAVE_STRTOD_L"];
  816. AC_MSG_RESULT([yes]),
  817. AC_MSG_RESULT([no]))
  818. dnl Check to see if dlopen is in default libraries (like Solaris, which
  819. dnl has it in libc), or if libdl is needed to get it.
  820. AC_CHECK_FUNC([dlopen], [],
  821. [AC_CHECK_LIB([dl], [dlopen],
  822. [DLOPEN_LIBS="-ldl"])])
  823. AC_SUBST([DLOPEN_LIBS])
  824. dnl Check if that library also has dladdr
  825. save_LIBS="$LIBS"
  826. LIBS="$LIBS $DLOPEN_LIBS"
  827. AC_CHECK_FUNCS([dladdr])
  828. LIBS="$save_LIBS"
  829. AC_CHECK_FUNC([dl_iterate_phdr], [DEFINES="$DEFINES -DHAVE_DL_ITERATE_PHDR"])
  830. case "$host_os" in
  831. darwin*)
  832. ;;
  833. *)
  834. AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
  835. [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
  836. [AC_MSG_ERROR([Could not find clock_gettime])])])
  837. AC_SUBST([CLOCK_LIB])
  838. ;;
  839. esac
  840. dnl See if posix_memalign is available
  841. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  842. dnl Check for zlib
  843. PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
  844. DEFINES="$DEFINES -DHAVE_ZLIB"
  845. dnl Check for pthreads
  846. AX_PTHREAD
  847. if test "x$ax_pthread_ok" = xno; then
  848. AC_MSG_ERROR([Building mesa on this platform requires pthreads])
  849. fi
  850. dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
  851. dnl to -pthread, which causes problems if we need -lpthread to appear in
  852. dnl pkgconfig files. Since Android doesn't have a pthread lib, this check
  853. dnl is not valid for that platform.
  854. if test "x$android" = xno; then
  855. test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
  856. fi
  857. dnl According to the manual when using pthreads, one should add -pthread to
  858. dnl both compile and link-time arguments.
  859. dnl In practise that should be sufficient for all platforms, since any
  860. dnl platforms build with GCC and Clang support the flag.
  861. PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
  862. dnl pthread-stubs is mandatory on some BSD platforms, due to the nature of the
  863. dnl project. Even then there's a notable issue as described in the project README
  864. case "$host_os" in
  865. linux* | cygwin* | darwin* | solaris* | *-gnu* | gnu* | openbsd*)
  866. pthread_stubs_possible="no"
  867. ;;
  868. * )
  869. pthread_stubs_possible="yes"
  870. ;;
  871. esac
  872. if test "x$pthread_stubs_possible" = xyes; then
  873. PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs >= 0.4)
  874. fi
  875. dnl Check for futex for fast inline simple_mtx_t.
  876. AC_CHECK_HEADER([linux/futex.h], [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"])
  877. dnl SELinux awareness.
  878. AC_ARG_ENABLE([selinux],
  879. [AS_HELP_STRING([--enable-selinux],
  880. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  881. [MESA_SELINUX="$enableval"],
  882. [MESA_SELINUX=no])
  883. if test "x$enable_selinux" = "xyes"; then
  884. PKG_CHECK_MODULES([SELINUX], [libselinux], [],
  885. [AC_CHECK_HEADER([selinux/selinux.h],[],
  886. [AC_MSG_ERROR([SELinux headers not found])])
  887. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  888. [AC_MSG_ERROR([SELinux library not found])])
  889. SELINUX_LIBS="-lselinux"])
  890. DEFINES="$DEFINES -DMESA_SELINUX"
  891. fi
  892. AC_SUBST([SELINUX_CFLAGS])
  893. AC_SUBST([SELINUX_LIBS])
  894. dnl
  895. dnl LLVM
  896. dnl
  897. AC_ARG_ENABLE([llvm-shared-libs],
  898. [AS_HELP_STRING([--enable-llvm-shared-libs],
  899. [link with LLVM shared libraries @<:@default=enabled@:>@])],
  900. [enable_llvm_shared_libs="$enableval"],
  901. [enable_llvm_shared_libs=yes])
  902. AC_ARG_WITH([llvm-prefix],
  903. [AS_HELP_STRING([--with-llvm-prefix],
  904. [Prefix for LLVM installations in non-standard locations])],
  905. [llvm_prefix="$withval"],
  906. [llvm_prefix=''])
  907. PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [have_libelf=no])
  908. if test "x$have_libelf" = xno; then
  909. LIBELF_LIBS=''
  910. LIBELF_CFLAGS=''
  911. AC_CHECK_LIB([elf], [elf_memory], [have_libelf=yes;LIBELF_LIBS=-lelf], [have_libelf=no])
  912. AC_SUBST([LIBELF_LIBS])
  913. AC_SUBST([LIBELF_CFLAGS])
  914. fi
  915. if test -z "$LLVM_CONFIG"; then
  916. if test -n "$llvm_prefix"; then
  917. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
  918. else
  919. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
  920. fi
  921. fi
  922. llvm_add_component() {
  923. new_llvm_component=$1
  924. driver_name=$2
  925. if $LLVM_CONFIG --components | grep -iqw $new_llvm_component ; then
  926. LLVM_COMPONENTS="${LLVM_COMPONENTS} ${new_llvm_component}"
  927. else
  928. AC_MSG_ERROR([LLVM component '$new_llvm_component' not enabled in your LLVM build. Required by $driver_name.])
  929. fi
  930. }
  931. llvm_add_optional_component() {
  932. new_llvm_component=$1
  933. driver_name=$2
  934. if $LLVM_CONFIG --components | grep -iqw $new_llvm_component ; then
  935. LLVM_COMPONENTS="${LLVM_COMPONENTS} ${new_llvm_component}"
  936. fi
  937. }
  938. llvm_add_default_components() {
  939. driver_name=$1
  940. # Required default components
  941. llvm_add_component "bitwriter" $driver_name
  942. llvm_add_component "engine" $driver_name
  943. llvm_add_component "mcdisassembler" $driver_name
  944. llvm_add_component "mcjit" $driver_name
  945. # Optional default components
  946. llvm_add_optional_component "inteljitevents" $driver_name
  947. }
  948. llvm_add_target() {
  949. new_llvm_target=$1
  950. driver_name=$2
  951. if $LLVM_CONFIG --targets-built | grep -iqw $new_llvm_target ; then
  952. llvm_add_component $new_llvm_target $driver_name
  953. else
  954. AC_MSG_ERROR([LLVM target '$new_llvm_target' not enabled in your LLVM build. Required by $driver_name.])
  955. fi
  956. }
  957. # Call this inside ` ` to get the return value.
  958. # $1 is the llvm-config command with arguments.
  959. strip_unwanted_llvm_flags() {
  960. echo " `$1` " | sed -E \
  961. -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
  962. -e 's/[[[:space:]]]+-DNDEBUG[[[:space:]]]/ /g' \
  963. -e 's/[[[:space:]]]+-D_GNU_SOURCE[[[:space:]]]/ /g' \
  964. -e 's/[[[:space:]]]+-pedantic[[[:space:]]]/ /g' \
  965. -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
  966. -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
  967. -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
  968. -e 's/-fno-rtti[[[:space:]]]/-Fno-rtti /g' \
  969. -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
  970. -e 's/-Fno-rtti[[[:space:]]]/-fno-rtti /g' \
  971. -e 's/^[[[:space:]]]//' \
  972. -e 's/[[[:space:]]]$//'
  973. }
  974. llvm_set_environment_variables() {
  975. if test "x$LLVM_CONFIG" != xno; then
  976. LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'`
  977. LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
  978. LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
  979. LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
  980. # We need to respect LLVM_CPPFLAGS when compiling LLVM headers.
  981. save_CFLAGS="$CFLAGS"
  982. CFLAGS="$CFLAGS $LLVM_CPPFLAGS"
  983. AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
  984. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  985. AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
  986. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  987. AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
  988. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  989. CFLAGS="$save_CFLAGS"
  990. # Only needed for LLVM < 3.6.0
  991. if test -z "$LLVM_VERSION_PATCH"; then
  992. LLVM_VERSION_PATCH=0
  993. fi
  994. LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
  995. FOUND_LLVM=yes
  996. else
  997. FOUND_LLVM=no
  998. LLVM_VERSION_INT=0
  999. fi
  1000. }
  1001. require_llvm() {
  1002. if test "x$enable_llvm" != "xyes"; then
  1003. AC_MSG_ERROR([--enable-llvm is required when building $1])
  1004. fi
  1005. }
  1006. llvm_require_version() {
  1007. require_llvm $2
  1008. llvm_target_version_major=`echo $1 | cut -d. -f1 | egrep -o '^[[0-9]]+'`
  1009. llvm_target_version_minor=`echo $1 | cut -d. -f2 | egrep -o '^[[0-9]]+'`
  1010. llvm_target_version_patch=`echo $1 | cut -d. -f3 | egrep -o '^[[0-9]]+'`
  1011. if test "$LLVM_VERSION_MAJOR" -gt "$llvm_target_version_major"; then
  1012. # major > required major
  1013. # --> OK
  1014. return
  1015. fi
  1016. if test "$LLVM_VERSION_MAJOR" -eq "$llvm_target_version_major"; then
  1017. if test "$LLVM_VERSION_MINOR" -gt "$llvm_target_version_minor"; then
  1018. # major = required major and
  1019. # minor > required minor
  1020. # --> OK
  1021. return
  1022. else
  1023. if test "$LLVM_VERSION_MINOR" -eq "$llvm_target_version_minor"; then
  1024. if test "$LLVM_VERSION_PATCH" -ge "$llvm_target_version_patch"; then
  1025. # major = required major and
  1026. # minor = required minor and
  1027. # patch >= required patch
  1028. # --> OK
  1029. return
  1030. fi
  1031. fi
  1032. fi
  1033. fi
  1034. AC_MSG_ERROR([LLVM $1 or newer is required for $2])
  1035. }
  1036. radeon_llvm_check() {
  1037. if test ${LLVM_VERSION_INT} -lt 307; then
  1038. amdgpu_llvm_target_name='r600'
  1039. else
  1040. amdgpu_llvm_target_name='amdgpu'
  1041. fi
  1042. llvm_require_version $*
  1043. llvm_add_target $amdgpu_llvm_target_name $2
  1044. llvm_add_default_components $2
  1045. llvm_add_component "bitreader" $2
  1046. llvm_add_component "ipo" $2
  1047. if test "x$have_libelf" != xyes; then
  1048. AC_MSG_ERROR([$2 requires libelf when using llvm])
  1049. fi
  1050. }
  1051. llvm_set_environment_variables
  1052. AC_SUBST([LLVM_CFLAGS])
  1053. AC_SUBST([LLVM_CXXFLAGS])
  1054. AC_SUBST([LLVM_LIBS])
  1055. AC_SUBST([LLVM_LDFLAGS])
  1056. AC_SUBST([LLVM_INCLUDEDIR])
  1057. dnl
  1058. dnl libunwind
  1059. dnl
  1060. PKG_CHECK_EXISTS(libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
  1061. AC_ARG_ENABLE([libunwind],
  1062. [AS_HELP_STRING([--enable-libunwind],
  1063. [Use libunwind for backtracing (default: auto)])],
  1064. [LIBUNWIND="$enableval"],
  1065. [LIBUNWIND="$HAVE_LIBUNWIND"])
  1066. if test "x$LIBUNWIND" = "xyes"; then
  1067. PKG_CHECK_MODULES(LIBUNWIND, libunwind)
  1068. AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
  1069. fi
  1070. dnl Options for APIs
  1071. AC_ARG_ENABLE([opengl],
  1072. [AS_HELP_STRING([--disable-opengl],
  1073. [disable support for standard OpenGL API @<:@default=enabled@:>@])],
  1074. [enable_opengl="$enableval"],
  1075. [enable_opengl=yes])
  1076. AC_ARG_ENABLE([gles1],
  1077. [AS_HELP_STRING([--disable-gles1],
  1078. [disable support for OpenGL ES 1.x API @<:@default=enabled@:>@])],
  1079. [enable_gles1="$enableval"],
  1080. [enable_gles1=yes])
  1081. AC_ARG_ENABLE([gles2],
  1082. [AS_HELP_STRING([--disable-gles2],
  1083. [disable support for OpenGL ES 2.x API @<:@default=enabled@:>@])],
  1084. [enable_gles2="$enableval"],
  1085. [enable_gles2=yes])
  1086. AC_ARG_ENABLE([dri],
  1087. [AS_HELP_STRING([--enable-dri],
  1088. [enable DRI modules @<:@default=enabled@:>@])],
  1089. [enable_dri="$enableval"],
  1090. [enable_dri=yes])
  1091. AC_ARG_ENABLE([gallium-extra-hud],
  1092. [AS_HELP_STRING([--enable-gallium-extra-hud],
  1093. [enable HUD block/NIC I/O HUD stats support @<:@default=disabled@:>@])],
  1094. [enable_gallium_extra_hud="$enableval"],
  1095. [enable_gallium_extra_hud=no])
  1096. AM_CONDITIONAL(HAVE_GALLIUM_EXTRA_HUD, test "x$enable_gallium_extra_hud" = xyes)
  1097. if test "x$enable_gallium_extra_hud" = xyes ; then
  1098. DEFINES="${DEFINES} -DHAVE_GALLIUM_EXTRA_HUD=1"
  1099. fi
  1100. #TODO: no pkgconfig .pc available for libsensors.
  1101. #PKG_CHECK_MODULES([LIBSENSORS], [libsensors >= $LIBSENSORS_REQUIRED], [enable_lmsensors=yes], [enable_lmsensors=no])
  1102. AC_ARG_ENABLE([lmsensors],
  1103. [AS_HELP_STRING([--enable-lmsensors],
  1104. [enable HUD lmsensor support @<:@default=disabled@:>@])],
  1105. [enable_lmsensors="$enableval"],
  1106. [enable_lmsensors=no])
  1107. AM_CONDITIONAL(HAVE_LIBSENSORS, test "x$enable_lmsensors" = xyes)
  1108. if test "x$enable_lmsensors" = xyes ; then
  1109. DEFINES="${DEFINES} -DHAVE_LIBSENSORS=1"
  1110. LIBSENSORS_LIBS="-lsensors"
  1111. else
  1112. LIBSENSORS_LIBS=""
  1113. fi
  1114. AC_SUBST(LIBSENSORS_LIBS)
  1115. case "$host_os" in
  1116. linux*)
  1117. dri3_default=yes
  1118. ;;
  1119. *)
  1120. dri3_default=no
  1121. ;;
  1122. esac
  1123. if test "x$enable_dri" = xno; then
  1124. dri3_default=no
  1125. fi
  1126. AC_ARG_ENABLE([dri3],
  1127. [AS_HELP_STRING([--enable-dri3],
  1128. [enable DRI3 @<:@default=auto@:>@])],
  1129. [enable_dri3="$enableval"],
  1130. [enable_dri3="$dri3_default"])
  1131. AC_ARG_ENABLE([glx],
  1132. [AS_HELP_STRING([--enable-glx@<:@=dri|xlib|gallium-xlib@:>@],
  1133. [enable the GLX library and choose an implementation @<:@default=auto@:>@])],
  1134. [enable_glx="$enableval"],
  1135. [enable_glx=yes])
  1136. AC_ARG_ENABLE([osmesa],
  1137. [AS_HELP_STRING([--enable-osmesa],
  1138. [enable OSMesa library @<:@default=disabled@:>@])],
  1139. [enable_osmesa="$enableval"],
  1140. [enable_osmesa=no])
  1141. AC_ARG_ENABLE([gallium-osmesa],
  1142. [AS_HELP_STRING([--enable-gallium-osmesa],
  1143. [enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
  1144. [enable_gallium_osmesa="$enableval"],
  1145. [enable_gallium_osmesa=no])
  1146. AC_ARG_ENABLE([egl],
  1147. [AS_HELP_STRING([--disable-egl],
  1148. [disable EGL library @<:@default=enabled@:>@])],
  1149. [enable_egl="$enableval"],
  1150. [enable_egl=yes])
  1151. AC_ARG_ENABLE([xa],
  1152. [AS_HELP_STRING([--enable-xa],
  1153. [enable build of the XA X Acceleration API @<:@default=disabled@:>@])],
  1154. [enable_xa="$enableval"],
  1155. [enable_xa=no])
  1156. AC_ARG_ENABLE([gbm],
  1157. [AS_HELP_STRING([--enable-gbm],
  1158. [enable gbm library @<:@default=yes except cygwin and macOS@:>@])],
  1159. [enable_gbm="$enableval"],
  1160. [case "$host_os" in
  1161. cygwin* | darwin*)
  1162. enable_gbm=no
  1163. ;;
  1164. *)
  1165. enable_gbm=yes
  1166. ;;
  1167. esac])
  1168. AC_ARG_ENABLE([nine],
  1169. [AS_HELP_STRING([--enable-nine],
  1170. [enable build of the nine Direct3D9 API @<:@default=no@:>@])],
  1171. [enable_nine="$enableval"],
  1172. [enable_nine=no])
  1173. AC_ARG_ENABLE([xvmc],
  1174. [AS_HELP_STRING([--enable-xvmc],
  1175. [enable xvmc library @<:@default=auto@:>@])],
  1176. [enable_xvmc="$enableval"],
  1177. [enable_xvmc=auto])
  1178. AC_ARG_ENABLE([vdpau],
  1179. [AS_HELP_STRING([--enable-vdpau],
  1180. [enable vdpau library @<:@default=auto@:>@])],
  1181. [enable_vdpau="$enableval"],
  1182. [enable_vdpau=auto])
  1183. AC_ARG_ENABLE([omx],
  1184. [AS_HELP_STRING([--enable-omx],
  1185. [DEPRECATED: Use --enable-omx-bellagio or --enable-omx-tizonia instead @<:@default=auto@:>@])],
  1186. [AC_MSG_ERROR([--enable-omx is deprecated. Use --enable-omx-bellagio or --enable-omx-tizonia instead.])],
  1187. [])
  1188. AC_ARG_ENABLE([omx-bellagio],
  1189. [AS_HELP_STRING([--enable-omx-bellagio],
  1190. [enable OpenMAX Bellagio library @<:@default=disabled@:>@])],
  1191. [enable_omx_bellagio="$enableval"],
  1192. [enable_omx_bellagio=no])
  1193. AC_ARG_ENABLE([omx-tizonia],
  1194. [AS_HELP_STRING([--enable-omx-tizonia],
  1195. [enable OpenMAX Tizonia library @<:@default=disabled@:>@])],
  1196. [enable_omx_tizonia="$enableval"],
  1197. [enable_omx_tizonia=no])
  1198. AC_ARG_ENABLE([va],
  1199. [AS_HELP_STRING([--enable-va],
  1200. [enable va library @<:@default=auto@:>@])],
  1201. [enable_va="$enableval"],
  1202. [enable_va=auto])
  1203. AC_ARG_ENABLE([opencl],
  1204. [AS_HELP_STRING([--enable-opencl],
  1205. [enable OpenCL library @<:@default=disabled@:>@])],
  1206. [enable_opencl="$enableval"],
  1207. [enable_opencl=no])
  1208. AC_ARG_ENABLE([opencl_icd],
  1209. [AS_HELP_STRING([--enable-opencl-icd],
  1210. [Build an OpenCL ICD library to be loaded by an ICD implementation
  1211. @<:@default=enabled@:>@])],
  1212. [enable_opencl_icd="$enableval"],
  1213. [enable_opencl_icd=yes])
  1214. AC_ARG_ENABLE([gallium-tests],
  1215. [AS_HELP_STRING([--enable-gallium-tests],
  1216. [Enable optional Gallium tests) @<:@default=disabled@:>@])],
  1217. [enable_gallium_tests="$enableval"],
  1218. [enable_gallium_tests=no])
  1219. # Option for Gallium drivers
  1220. # Keep this in sync with the --with-gallium-drivers help string default value
  1221. GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
  1222. AC_ARG_WITH([gallium-drivers],
  1223. [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
  1224. [comma delimited Gallium drivers list, e.g.
  1225. "i915,nouveau,r300,r600,radeonsi,freedreno,pl111,svga,swrast,swr,tegra,v3d,vc4,virgl,etnaviv,imx"
  1226. @<:@default=r300,r600,svga,swrast@:>@])],
  1227. [with_gallium_drivers="$withval"],
  1228. [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
  1229. # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
  1230. # here so that the script doesn't choke on an unknown driver name later.
  1231. case "$with_gallium_drivers" in
  1232. yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
  1233. no) with_gallium_drivers='' ;;
  1234. esac
  1235. if test "x$enable_opengl" = xno -a \
  1236. "x$enable_gles1" = xno -a \
  1237. "x$enable_gles2" = xno -a \
  1238. "x$enable_nine" = xno -a \
  1239. "x$enable_xa" = xno -a \
  1240. "x$enable_xvmc" = xno -a \
  1241. "x$enable_vdpau" = xno -a \
  1242. "x$enable_omx_bellagio" = xno -a \
  1243. "x$enable_omx_tizonia" = xno -a \
  1244. "x$enable_va" = xno -a \
  1245. "x$enable_opencl" = xno; then
  1246. AC_MSG_ERROR([at least one API should be enabled])
  1247. fi
  1248. if test "x$enable_omx_bellagio" = xyes -a \
  1249. "x$enable_omx_tizonia" = xyes; then
  1250. AC_MSG_ERROR([Can't enable both bellagio and tizonia at same time])
  1251. fi
  1252. # Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
  1253. if test "x$enable_opengl" = xno -a \
  1254. "x$enable_gles1" = xyes; then
  1255. AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
  1256. fi
  1257. if test "x$enable_opengl" = xno -a \
  1258. "x$enable_gles2" = xyes; then
  1259. AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
  1260. fi
  1261. AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
  1262. AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
  1263. AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
  1264. AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
  1265. "x$enable_gles1" = xyes -o \
  1266. "x$enable_gles2" = xyes)
  1267. AM_CONDITIONAL(NEED_KHRPLATFORM, test "x$enable_egl" = xyes -o \
  1268. "x$enable_gles1" = xyes -o \
  1269. "x$enable_gles2" = xyes)
  1270. # Validate GLX options
  1271. if test "x$enable_glx" = xyes; then
  1272. if test "x$enable_dri" = xyes; then
  1273. enable_glx=dri
  1274. elif test -n "$with_gallium_drivers"; then
  1275. enable_glx=gallium-xlib
  1276. else
  1277. enable_glx=xlib
  1278. fi
  1279. fi
  1280. case "x$enable_glx" in
  1281. xdri | xxlib | xgallium-xlib)
  1282. # GLX requires OpenGL
  1283. if test "x$enable_opengl" = xno; then
  1284. AC_MSG_ERROR([GLX cannot be built without OpenGL])
  1285. fi
  1286. # Check individual dependencies
  1287. case "x$enable_glx" in
  1288. xdri)
  1289. if test "x$enable_dri" = xno; then
  1290. AC_MSG_ERROR([DRI-based GLX requires DRI to be enabled])
  1291. fi
  1292. ;;
  1293. xxlib)
  1294. if test "x$enable_dri" = xyes; then
  1295. AC_MSG_ERROR([Xlib-based GLX cannot be built with DRI enabled])
  1296. fi
  1297. ;;
  1298. xgallium-xlib )
  1299. if test "x$enable_dri" = xyes; then
  1300. AC_MSG_ERROR([Xlib-based (Gallium) GLX cannot be built with DRI enabled])
  1301. fi
  1302. if test -z "$with_gallium_drivers"; then
  1303. AC_MSG_ERROR([Xlib-based (Gallium) GLX cannot be built without Gallium enabled])
  1304. fi
  1305. ;;
  1306. esac
  1307. ;;
  1308. xno)
  1309. ;;
  1310. *)
  1311. AC_MSG_ERROR([Illegal value for --enable-glx: $enable_glx])
  1312. ;;
  1313. esac
  1314. AM_CONDITIONAL(HAVE_GLX, test "x$enable_glx" != xno)
  1315. AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xdri)
  1316. AM_CONDITIONAL(HAVE_XLIB_GLX, test "x$enable_glx" = xxlib)
  1317. AM_CONDITIONAL(HAVE_GALLIUM_XLIB_GLX, test "x$enable_glx" = xgallium-xlib)
  1318. DEFAULT_GL_LIB_NAME=GL
  1319. dnl
  1320. dnl Libglvnd configuration
  1321. dnl
  1322. AC_ARG_ENABLE([libglvnd],
  1323. [AS_HELP_STRING([--enable-libglvnd],
  1324. [Build GLX and EGL for libglvnd @<:@default=disabled@:>@])],
  1325. [enable_libglvnd="$enableval"],
  1326. [enable_libglvnd=no])
  1327. AM_CONDITIONAL(USE_LIBGLVND, test "x$enable_libglvnd" = xyes)
  1328. if test "x$enable_libglvnd" = xyes ; then
  1329. case "x$enable_glx" in
  1330. xxlib | xgallium-xlib )
  1331. AC_MSG_ERROR([cannot build libgvnd when Xlib-GLX or Gallium-Xlib-GLX is enabled])
  1332. ;;
  1333. esac
  1334. PKG_CHECK_MODULES([GLVND], libglvnd >= 0.2.0)
  1335. LIBGLVND_DATADIR=`$PKG_CONFIG --variable=datadir libglvnd`
  1336. AC_SUBST([LIBGLVND_DATADIR])
  1337. DEFINES="${DEFINES} -DUSE_LIBGLVND=1"
  1338. DEFAULT_GL_LIB_NAME=GLX_mesa
  1339. if test "x$enable_glx" = xno -a "x$enable_egl" = xno; then
  1340. AC_MSG_ERROR([cannot build libglvnd without GLX or EGL])
  1341. fi
  1342. fi
  1343. AC_ARG_WITH([gl-lib-name],
  1344. [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
  1345. [specify GL library name @<:@default=GL@:>@])],
  1346. [GL_LIB=$withval],
  1347. [GL_LIB="$DEFAULT_GL_LIB_NAME"])
  1348. AC_ARG_WITH([osmesa-lib-name],
  1349. [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
  1350. [specify OSMesa library name @<:@default=OSMesa@:>@])],
  1351. [OSMESA_LIB=$withval],
  1352. [OSMESA_LIB=OSMesa])
  1353. AS_IF([test "x$GL_LIB" = xyes], [GL_LIB="$DEFAULT_GL_LIB_NAME"])
  1354. AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
  1355. dnl
  1356. dnl Mangled Mesa support
  1357. dnl
  1358. AC_ARG_ENABLE([mangling],
  1359. [AS_HELP_STRING([--enable-mangling],
  1360. [enable mangled symbols and library name @<:@default=disabled@:>@])],
  1361. [enable_mangling="${enableval}"],
  1362. [enable_mangling=no]
  1363. )
  1364. if test "x${enable_mangling}" = "xyes" ; then
  1365. DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
  1366. GL_LIB="Mangled${GL_LIB}"
  1367. OSMESA_LIB="Mangled${OSMESA_LIB}"
  1368. fi
  1369. AC_SUBST([GL_LIB])
  1370. AC_SUBST([OSMESA_LIB])
  1371. # Check for libdrm
  1372. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
  1373. [have_libdrm=yes], [have_libdrm=no])
  1374. if test "x$have_libdrm" = xyes; then
  1375. DEFINES="$DEFINES -DHAVE_LIBDRM"
  1376. fi
  1377. require_libdrm() {
  1378. if test "x$have_libdrm" != xyes; then
  1379. AC_MSG_ERROR([$1 requires libdrm >= $LIBDRM_REQUIRED])
  1380. fi
  1381. }
  1382. # Select which platform-dependent DRI code gets built
  1383. case "$host_os" in
  1384. darwin*)
  1385. dri_platform='apple' ;;
  1386. cygwin*)
  1387. dri_platform='windows' ;;
  1388. gnu*)
  1389. dri_platform='none' ;;
  1390. *)
  1391. dri_platform='drm' ;;
  1392. esac
  1393. if test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes; then
  1394. have_drisw_kms='yes'
  1395. fi
  1396. AM_CONDITIONAL(HAVE_DRICOMMON, test "x$enable_dri" = xyes )
  1397. AM_CONDITIONAL(HAVE_DRISW, test "x$enable_dri" = xyes )
  1398. AM_CONDITIONAL(HAVE_DRISW_KMS, test "x$have_drisw_kms" = xyes )
  1399. AM_CONDITIONAL(HAVE_DRI2, test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes )
  1400. AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes )
  1401. AM_CONDITIONAL(HAVE_APPLEDRI, test "x$enable_dri" = xyes -a "x$dri_platform" = xapple )
  1402. AM_CONDITIONAL(HAVE_LMSENSORS, test "x$enable_lmsensors" = xyes )
  1403. AM_CONDITIONAL(HAVE_GALLIUM_EXTRA_HUD, test "x$enable_gallium_extra_hud" = xyes )
  1404. AM_CONDITIONAL(HAVE_WINDOWSDRI, test "x$enable_dri" = xyes -a "x$dri_platform" = xwindows )
  1405. AC_ARG_ENABLE([shared-glapi],
  1406. [AS_HELP_STRING([--enable-shared-glapi],
  1407. [Enable shared glapi for OpenGL @<:@default=enabled@:>@])],
  1408. [enable_shared_glapi="$enableval"],
  1409. [enable_shared_glapi=yes])
  1410. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1411. x*yes*yes*)
  1412. if test "x$enable_shared_glapi" = xno; then
  1413. AC_MSG_ERROR([shared GLAPI required when building two or more of
  1414. the following APIs - opengl, gles1 gles2])
  1415. fi
  1416. ;;
  1417. esac
  1418. AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
  1419. # Build the pipe-drivers as separate libraries/modules.
  1420. # Do not touch this unless you know what you are doing.
  1421. # XXX: Expose via configure option ?
  1422. enable_shared_pipe_drivers=no
  1423. dnl
  1424. dnl Driver specific build directories
  1425. dnl
  1426. if test "x$enable_gallium_osmesa" = xyes; then
  1427. if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
  1428. AC_MSG_ERROR([gallium_osmesa requires the gallium swrast driver])
  1429. fi
  1430. if test "x$enable_osmesa" = xyes; then
  1431. AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
  1432. fi
  1433. fi
  1434. require_dri_shared_libs_and_glapi() {
  1435. if test "x$enable_static" = xyes; then
  1436. AC_MSG_ERROR([$1 cannot be build as static library])
  1437. fi
  1438. if test "x$enable_dri" != xyes; then
  1439. # There is only a single backend which won't be build/used otherwise.
  1440. # XXX: Revisit this as the egl/haiku is a thing.
  1441. AC_MSG_ERROR([$1 requires --enable-dri])
  1442. fi
  1443. if test "x$enable_shared_glapi" != xyes; then
  1444. AC_MSG_ERROR([$1 requires --enable-shared-glapi])
  1445. fi
  1446. }
  1447. if test "x$enable_dri" = xyes; then
  1448. require_dri_shared_libs_and_glapi "DRI"
  1449. # not a hard requirement as swrast does not depend on it
  1450. if test "x$have_libdrm" = xyes; then
  1451. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  1452. fi
  1453. fi
  1454. AC_ARG_ENABLE([driglx-direct],
  1455. [AS_HELP_STRING([--disable-driglx-direct],
  1456. [disable direct rendering in GLX and EGL for DRI \
  1457. @<:@default=enabled@:>@])],
  1458. [driglx_direct="$enableval"],
  1459. [driglx_direct="yes"])
  1460. dnl
  1461. dnl libGL configuration per driver
  1462. dnl
  1463. if test "x$enable_glx" != xno; then
  1464. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  1465. fi
  1466. case "x$enable_glx" in
  1467. xxlib | xgallium-xlib)
  1468. # Xlib-based GLX
  1469. dri_modules="x11 xext xcb"
  1470. PKG_CHECK_MODULES([XLIBGL], [$dri_modules])
  1471. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  1472. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  1473. GL_LIB_DEPS="$XLIBGL_LIBS"
  1474. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1475. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
  1476. ;;
  1477. xdri)
  1478. # DRI-based GLX
  1479. # find the DRI deps for libGL
  1480. dri_modules="x11 xext xdamage >= $XDAMAGE_REQUIRED xfixes x11-xcb xcb xcb-glx >= $XCBGLX_REQUIRED"
  1481. if test x"$driglx_direct" = xyes; then
  1482. if test x"$dri_platform" = xdrm ; then
  1483. DEFINES="$DEFINES -DGLX_USE_DRM"
  1484. require_libdrm "Direct rendering"
  1485. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  1486. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
  1487. if test x"$enable_dri" = xyes; then
  1488. dri_modules="$dri_modules xcb-dri2 >= $XCBDRI2_REQUIRED"
  1489. fi
  1490. fi
  1491. if test x"$dri_platform" = xapple ; then
  1492. DEFINES="$DEFINES -DGLX_USE_APPLEGL"
  1493. fi
  1494. if test x"$dri_platform" = xwindows ; then
  1495. DEFINES="$DEFINES -DGLX_USE_WINDOWSGL"
  1496. fi
  1497. fi
  1498. # add xf86vidmode if available
  1499. PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
  1500. if test "$HAVE_XF86VIDMODE" = yes ; then
  1501. dri_modules="$dri_modules xxf86vm"
  1502. fi
  1503. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  1504. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  1505. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  1506. GL_LIB_DEPS="$DRIGL_LIBS"
  1507. # need DRM libs, $PTHREAD_LIBS, etc.
  1508. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1509. GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1510. ;;
  1511. esac
  1512. # This is outside the case (above) so that it is invoked even for non-GLX
  1513. # builds.
  1514. AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
  1515. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1516. GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1517. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1518. GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1519. AC_SUBST([X11_INCLUDES])
  1520. AC_SUBST([GL_LIB_DEPS])
  1521. AC_SUBST([GL_PC_REQ_PRIV])
  1522. AC_SUBST([GL_PC_LIB_PRIV])
  1523. AC_SUBST([GL_PC_CFLAGS])
  1524. AC_SUBST([DRI_PC_REQ_PRIV])
  1525. AC_SUBST([GLESv1_CM_LIB_DEPS])
  1526. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  1527. AC_SUBST([GLESv2_LIB_DEPS])
  1528. AC_SUBST([GLESv2_PC_LIB_PRIV])
  1529. AC_SUBST([HAVE_XF86VIDMODE])
  1530. dnl
  1531. dnl More GLX setup
  1532. dnl
  1533. case "x$enable_glx" in
  1534. xxlib | xgallium-xlib)
  1535. DEFINES="$DEFINES -DUSE_XSHM"
  1536. ;;
  1537. xdri)
  1538. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  1539. if test "x$driglx_direct" = xyes; then
  1540. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  1541. fi
  1542. ;;
  1543. esac
  1544. dnl
  1545. dnl TLS detection
  1546. dnl
  1547. AC_ARG_ENABLE([glx-tls],
  1548. [AS_HELP_STRING([--enable-glx-tls],
  1549. [enable TLS support in GLX @<:@default=enabled@:>@])],
  1550. [GLX_USE_TLS="$enableval"],
  1551. [GLX_USE_TLS=yes])
  1552. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  1553. if test "x$GLX_USE_TLS" = xyes; then
  1554. DEFINES="$DEFINES -DGLX_USE_TLS"
  1555. fi
  1556. dnl Read-only text section on x86 hardened platforms
  1557. AC_ARG_ENABLE([glx-read-only-text],
  1558. [AS_HELP_STRING([--enable-glx-read-only-text],
  1559. [Disable writable .text section on x86 (decreases performance) @<:@default=disabled@:>@])],
  1560. [enable_glx_read_only_text="$enableval"],
  1561. [enable_glx_read_only_text=no])
  1562. if test "x$enable_glx_read_only_text" = xyes; then
  1563. DEFINES="$DEFINES -DGLX_X86_READONLY_TEXT"
  1564. fi
  1565. dnl
  1566. dnl DEPRECATED: EGL Platforms configuration
  1567. dnl
  1568. AC_ARG_WITH([egl-platforms],
  1569. [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
  1570. [DEPRECATED: use --with-platforms instead@<:@default=auto@:>@])],
  1571. [with_egl_platforms="$withval"],
  1572. [with_egl_platforms=auto])
  1573. if test "x$with_egl_platforms" = xauto; then
  1574. with_egl_platforms="x11,surfaceless"
  1575. if test "x$enable_gbm" = xyes; then
  1576. with_egl_platforms="$with_egl_platforms,drm"
  1577. fi
  1578. else
  1579. AC_MSG_WARN([--with-egl-platforms is deprecated. Use --with-platforms instead.])
  1580. fi
  1581. dnl
  1582. dnl Platforms configuration
  1583. dnl
  1584. AC_ARG_WITH([platforms],
  1585. [AS_HELP_STRING([--with-platforms@<:@=DIRS...@:>@],
  1586. [comma delimited native platforms libEGL/Vulkan/other supports, e.g.
  1587. "x11,drm,wayland,surfaceless..." @<:@default=auto@:>@])],
  1588. [with_platforms="$withval"],
  1589. [with_platforms=auto])
  1590. # Reuse the autodetection rather than duplicating it.
  1591. if test "x$with_platforms" = xauto; then
  1592. with_platforms=$with_egl_platforms
  1593. fi
  1594. # Do per platform setups and checks
  1595. platforms=`IFS=', '; echo $with_platforms`
  1596. for plat in $platforms; do
  1597. case "$plat" in
  1598. wayland)
  1599. PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= $WAYLAND_REQUIRED])
  1600. PKG_CHECK_MODULES([WAYLAND_SERVER], [wayland-server >= $WAYLAND_REQUIRED])
  1601. PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= $WAYLAND_PROTOCOLS_REQUIRED])
  1602. if test "x$enable_egl" = xyes; then
  1603. PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl-backend >= $WAYLAND_EGL_BACKEND_REQUIRED])
  1604. fi
  1605. WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
  1606. PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
  1607. WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
  1608. WAYLAND_SCANNER='')
  1609. if test "x$WAYLAND_SCANNER" = x; then
  1610. AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
  1611. fi
  1612. if test "x$WAYLAND_SCANNER" = "x:"; then
  1613. AC_MSG_ERROR([wayland-scanner is needed to compile the wayland platform])
  1614. fi
  1615. DEFINES="$DEFINES -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED"
  1616. ;;
  1617. x11)
  1618. PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes])
  1619. DEFINES="$DEFINES -DHAVE_X11_PLATFORM"
  1620. ;;
  1621. drm)
  1622. test "x$enable_gbm" = "xno" &&
  1623. AC_MSG_ERROR([EGL platform drm needs gbm])
  1624. DEFINES="$DEFINES -DHAVE_DRM_PLATFORM"
  1625. ;;
  1626. surfaceless)
  1627. DEFINES="$DEFINES -DHAVE_SURFACELESS_PLATFORM"
  1628. ;;
  1629. android)
  1630. PKG_CHECK_MODULES([ANDROID], [cutils hardware sync])
  1631. DEFINES="$DEFINES -DHAVE_ANDROID_PLATFORM"
  1632. ;;
  1633. *)
  1634. AC_MSG_ERROR([platform '$plat' does not exist])
  1635. ;;
  1636. esac
  1637. case "$plat" in
  1638. wayland|drm|surfaceless)
  1639. require_libdrm "Platform $plat"
  1640. ;;
  1641. esac
  1642. done
  1643. AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
  1644. if test "x$enable_glx" != xno; then
  1645. if ! echo "$platforms" | grep -q 'x11'; then
  1646. AC_MSG_ERROR([Building GLX without the x11 platform is not supported])
  1647. fi
  1648. fi
  1649. if test x"$enable_dri3" = xyes; then
  1650. DEFINES="$DEFINES -DHAVE_DRI3"
  1651. dri3_modules="x11-xcb xcb >= $XCB_REQUIRED xcb-dri3 xcb-xfixes xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
  1652. PKG_CHECK_MODULES([XCB_DRI3], [$dri3_modules])
  1653. dri3_modifier_modules="xcb-dri3 >= $XCBDRI3_MODIFIERS_REQUIRED xcb-present >= $XCBPRESENT_MODIFIERS_REQUIRED"
  1654. PKG_CHECK_MODULES([XCB_DRI3_MODIFIERS], [$dri3_modifier_modules], [have_dri3_modifiers=yes], [have_dri3_modifiers=no])
  1655. if test "x$have_dri3_modifiers" == xyes; then
  1656. DEFINES="$DEFINES -DHAVE_DRI3_MODIFIERS"
  1657. fi
  1658. fi
  1659. AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
  1660. AM_CONDITIONAL(HAVE_PLATFORM_WAYLAND, echo "$platforms" | grep -q 'wayland')
  1661. AM_CONDITIONAL(HAVE_PLATFORM_DRM, echo "$platforms" | grep -q 'drm')
  1662. AM_CONDITIONAL(HAVE_PLATFORM_SURFACELESS, echo "$platforms" | grep -q 'surfaceless')
  1663. AM_CONDITIONAL(HAVE_PLATFORM_ANDROID, echo "$platforms" | grep -q 'android')
  1664. dnl
  1665. dnl More DRI setup
  1666. dnl
  1667. dnl Directory for DRI drivers
  1668. AC_ARG_WITH([dri-driverdir],
  1669. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  1670. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  1671. [DRI_DRIVER_INSTALL_DIR="$withval"],
  1672. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  1673. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  1674. dnl Extra search path for DRI drivers
  1675. AC_ARG_WITH([dri-searchpath],
  1676. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  1677. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  1678. [DRI_DRIVER_SEARCH_DIR="$withval"],
  1679. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  1680. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  1681. dnl Which drivers to build - default is chosen by platform
  1682. AC_ARG_WITH([dri-drivers],
  1683. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  1684. [comma delimited classic DRI drivers list, e.g.
  1685. "i915,i965,nouveau,radeon,r200,swrast" @<:@default=auto@:>@])],
  1686. [with_dri_drivers="$withval"],
  1687. [with_dri_drivers=auto])
  1688. if test "x$with_dri_drivers" = xauto; then
  1689. if test "x$enable_opengl" = xyes -a "x$enable_dri" = xyes; then
  1690. with_dri_drivers="yes"
  1691. else
  1692. with_dri_drivers="no"
  1693. fi
  1694. fi
  1695. if test "x$with_dri_drivers" = xno; then
  1696. with_dri_drivers=''
  1697. fi
  1698. # Check for expat
  1699. PKG_CHECK_MODULES([EXPAT], [expat],,
  1700. [PKG_CHECK_MODULES([EXPAT], [expat21])]
  1701. )
  1702. dnl If $with_dri_drivers is yes, drivers will be added through
  1703. dnl platform checks. Set DEFINES and LIB_DEPS
  1704. if test "x$enable_dri" = xyes; then
  1705. # Platform specific settings and drivers to build
  1706. case "$host_os" in
  1707. linux*)
  1708. case "$host_cpu" in
  1709. powerpc* | sparc*)
  1710. # Build only the drivers for cards that exist on PowerPC/sparc
  1711. if test "x$with_dri_drivers" = "xyes"; then
  1712. with_dri_drivers="r200 radeon swrast"
  1713. fi
  1714. ;;
  1715. esac
  1716. ;;
  1717. cygwin*)
  1718. if test "x$with_dri_drivers" = "xyes"; then
  1719. with_dri_drivers="swrast"
  1720. fi
  1721. ;;
  1722. darwin*)
  1723. DEFINES="$DEFINES -DBUILDING_MESA"
  1724. if test "x$with_dri_drivers" = "xyes"; then
  1725. with_dri_drivers="swrast"
  1726. fi
  1727. ;;
  1728. esac
  1729. # default drivers
  1730. if test "x$with_dri_drivers" = "xyes"; then
  1731. with_dri_drivers="i915 i965 nouveau r200 radeon swrast"
  1732. fi
  1733. # put all the necessary libs together
  1734. DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1735. fi
  1736. AC_SUBST([DRI_LIB_DEPS])
  1737. DRI_DIRS=''
  1738. dnl Duplicates in DRI_DIRS are removed by sorting it at the end of this block
  1739. if test -n "$with_dri_drivers"; then
  1740. if test "x$enable_opengl" != xyes; then
  1741. AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
  1742. fi
  1743. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  1744. for driver in $dri_drivers; do
  1745. DRI_DIRS="$DRI_DIRS $driver"
  1746. case "x$driver" in
  1747. xi915)
  1748. require_libdrm "i915"
  1749. HAVE_I915_DRI=yes
  1750. PKG_CHECK_MODULES([I915], [libdrm >= $LIBDRM_INTEL_REQUIRED libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1751. ;;
  1752. xi965)
  1753. require_libdrm "i965"
  1754. HAVE_I965_DRI=yes
  1755. ;;
  1756. xnouveau)
  1757. require_libdrm "nouveau"
  1758. HAVE_NOUVEAU_DRI=yes
  1759. PKG_CHECK_MODULES([NVVIEUX], [libdrm >= $LIBDRM_NVVIEUX_REQUIRED libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
  1760. ;;
  1761. xradeon)
  1762. require_libdrm "radeon"
  1763. HAVE_RADEON_DRI=yes;
  1764. PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1765. ;;
  1766. xr200)
  1767. require_libdrm "r200"
  1768. HAVE_R200_DRI=yes
  1769. PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1770. ;;
  1771. xswrast)
  1772. HAVE_SWRAST_DRI=yes
  1773. ;;
  1774. *)
  1775. AC_MSG_ERROR([classic DRI driver '$driver' does not exist])
  1776. ;;
  1777. esac
  1778. done
  1779. DRI_DIRS=`echo $DRI_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1780. fi
  1781. dnl
  1782. dnl Gallium LLVM
  1783. dnl Deprecated: kept for backwards compatibility
  1784. dnl
  1785. AC_ARG_ENABLE([gallium-llvm],
  1786. [AS_HELP_STRING([--enable-gallium-llvm],
  1787. [DEPRECATED: use --enable-llvm instead])],
  1788. [enable_gallium_llvm="$enableval"],
  1789. [enable_gallium_llvm=auto])
  1790. if test "x$enable_gallium_llvm" != xauto; then
  1791. AC_MSG_WARN([The --enable-gallium-llvm option has been deprecated. Use --enable-llvm instead.])
  1792. enable_llvm=$enable_gallium_llvm
  1793. fi
  1794. dnl
  1795. dnl LLVM
  1796. dnl
  1797. AC_ARG_ENABLE([llvm],
  1798. [AS_HELP_STRING([--enable-llvm],
  1799. [build with LLVM support @<:@default=enabled on x86/x86_64@:>@])],
  1800. [enable_llvm="$enableval"],
  1801. [enable_llvm=auto])
  1802. if test "x$enable_llvm" = xauto -a "x$FOUND_LLVM" = xyes; then
  1803. if test "x$FOUND_LLVM" = xyes; then
  1804. case "$host_cpu" in
  1805. i*86|x86_64|amd64) enable_llvm=yes;;
  1806. *) enable_llvm=no;;
  1807. esac
  1808. else
  1809. enable_llvm=no
  1810. fi
  1811. fi
  1812. if test "x$enable_llvm" = xyes -a "x$FOUND_LLVM" = xno; then
  1813. AC_MSG_ERROR([--enable-llvm selected but llvm-config is not found])
  1814. fi
  1815. #
  1816. # Vulkan driver configuration
  1817. #
  1818. AC_ARG_WITH([vulkan-drivers],
  1819. [AS_HELP_STRING([--with-vulkan-drivers@<:@=DIRS...@:>@],
  1820. [comma delimited Vulkan drivers list, e.g.
  1821. "intel,radeon"
  1822. @<:@default=no@:>@])],
  1823. [with_vulkan_drivers="$withval"],
  1824. [with_vulkan_drivers="no"])
  1825. # Doing '--without-vulkan-drivers' will set this variable to 'no'. Clear it
  1826. # here so that the script doesn't choke on an unknown driver name later.
  1827. case "x$with_vulkan_drivers" in
  1828. xyes) with_vulkan_drivers="$VULKAN_DRIVERS_DEFAULT" ;;
  1829. xno) with_vulkan_drivers='' ;;
  1830. esac
  1831. AC_ARG_WITH([vulkan-icddir],
  1832. [AS_HELP_STRING([--with-vulkan-icddir=DIR],
  1833. [directory for the Vulkan driver icd files @<:@${datarootdir}/vulkan/icd.d@:>@])],
  1834. [VULKAN_ICD_INSTALL_DIR="$withval"],
  1835. [VULKAN_ICD_INSTALL_DIR='${datarootdir}/vulkan/icd.d'])
  1836. AC_SUBST([VULKAN_ICD_INSTALL_DIR])
  1837. require_x11_dri3() {
  1838. if echo "$platforms" | grep -q 'x11'; then
  1839. if test "x$enable_dri3" != xyes; then
  1840. AC_MSG_ERROR([$1 Vulkan driver requires DRI3 when built with X11])
  1841. fi
  1842. fi
  1843. }
  1844. if test -n "$with_vulkan_drivers"; then
  1845. if test "x$ac_cv_func_dl_iterate_phdr" = xno; then
  1846. AC_MSG_ERROR([Vulkan drivers require the dl_iterate_phdr function])
  1847. fi
  1848. VULKAN_DRIVERS=`IFS=', '; echo $with_vulkan_drivers`
  1849. for driver in $VULKAN_DRIVERS; do
  1850. case "x$driver" in
  1851. xintel)
  1852. require_libdrm "ANV"
  1853. require_x11_dri3 "ANV"
  1854. HAVE_INTEL_VULKAN=yes
  1855. ;;
  1856. xradeon)
  1857. require_libdrm "radv"
  1858. PKG_CHECK_MODULES([AMDGPU], [libdrm >= $LIBDRM_AMDGPU_REQUIRED libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
  1859. radeon_llvm_check $LLVM_REQUIRED_RADV "radv"
  1860. require_x11_dri3 "radv"
  1861. if test "x$acv_mako_found" = xno; then
  1862. AC_MSG_ERROR([Python mako module v$PYTHON_MAKO_REQUIRED or higher not found])
  1863. fi
  1864. HAVE_RADEON_VULKAN=yes
  1865. ;;
  1866. *)
  1867. AC_MSG_ERROR([Vulkan driver '$driver' does not exist])
  1868. ;;
  1869. esac
  1870. done
  1871. VULKAN_DRIVERS=`echo $VULKAN_DRIVERS|tr " " "\n"|sort -u|tr "\n" " "`
  1872. fi
  1873. DEFINES="$DEFINES -DENABLE_SHADER_CACHE"
  1874. AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
  1875. AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_glx" = xxlib -o \
  1876. "x$enable_osmesa" = xyes -o \
  1877. -n "$DRI_DIRS")
  1878. dnl
  1879. dnl OSMesa configuration
  1880. dnl
  1881. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  1882. AC_ARG_WITH([osmesa-bits],
  1883. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  1884. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  1885. [osmesa_bits="$withval"],
  1886. [osmesa_bits=8])
  1887. if test "x$osmesa_bits" != x8; then
  1888. if test "x$enable_dri" = xyes -o "x$enable_glx" != xno; then
  1889. AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
  1890. osmesa_bits=8
  1891. fi
  1892. fi
  1893. case "x$osmesa_bits" in
  1894. x8)
  1895. OSMESA_LIB="${OSMESA_LIB}"
  1896. ;;
  1897. x16|x32)
  1898. OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
  1899. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  1900. ;;
  1901. *)
  1902. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  1903. ;;
  1904. esac
  1905. if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
  1906. # only link libraries with osmesa if shared
  1907. if test "$enable_static" = no; then
  1908. OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1909. else
  1910. OSMESA_LIB_DEPS=""
  1911. fi
  1912. OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1913. fi
  1914. AC_SUBST([OSMESA_LIB_DEPS])
  1915. AC_SUBST([OSMESA_PC_REQ])
  1916. AC_SUBST([OSMESA_PC_LIB_PRIV])
  1917. dnl
  1918. dnl gbm configuration
  1919. dnl
  1920. if test "x$enable_gbm" = xyes; then
  1921. require_dri_shared_libs_and_glapi "gbm"
  1922. fi
  1923. AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
  1924. # FINISHME: GBM has a number of dependencies which we should add below
  1925. GBM_PC_REQ_PRIV=""
  1926. GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
  1927. AC_SUBST([GBM_PC_REQ_PRIV])
  1928. AC_SUBST([GBM_PC_LIB_PRIV])
  1929. dnl
  1930. dnl EGL configuration
  1931. dnl
  1932. if test "x$enable_egl" = xyes; then
  1933. EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
  1934. AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
  1935. require_dri_shared_libs_and_glapi "egl"
  1936. fi
  1937. AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
  1938. AC_SUBST([EGL_LIB_DEPS])
  1939. gallium_st="mesa"
  1940. dnl
  1941. dnl XA configuration
  1942. dnl
  1943. if test "x$enable_xa" = xyes; then
  1944. if test "x$with_gallium_drivers" = xswrast; then
  1945. AC_MSG_ERROR([
  1946. Building xa requires at least one non swrast gallium driver.
  1947. If you are looking to use libxatracker.so with the VMware driver,
  1948. make sure to include svga in the gallium drivers list, apart from
  1949. enabling XA.
  1950. Example: ./configure --enable-xa --with-gallium-drivers=svga...])
  1951. fi
  1952. gallium_st="$gallium_st xa"
  1953. fi
  1954. AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
  1955. if echo $platforms | grep -q "x11"; then
  1956. have_xvmc_platform=yes
  1957. else
  1958. have_xvmc_platform=no
  1959. fi
  1960. if echo $platforms | grep -q "x11"; then
  1961. have_vdpau_platform=yes
  1962. else
  1963. have_vdpau_platform=no
  1964. fi
  1965. if echo $platforms | grep -q "x11\|drm"; then
  1966. have_omx_platform=yes
  1967. else
  1968. have_omx_platform=no
  1969. fi
  1970. if echo $platforms | grep -q "x11\|drm\|wayland"; then
  1971. have_va_platform=yes
  1972. else
  1973. have_va_platform=no
  1974. fi
  1975. dnl
  1976. dnl Gallium G3DVL configuration
  1977. dnl
  1978. if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then
  1979. if test "x$enable_xvmc" = xauto -a "x$have_xvmc_platform" = xyes; then
  1980. PKG_CHECK_EXISTS([xvmc >= $XVMC_REQUIRED], [enable_xvmc=yes], [enable_xvmc=no])
  1981. fi
  1982. if test "x$enable_vdpau" = xauto -a "x$have_vdpau_platform" = xyes; then
  1983. PKG_CHECK_EXISTS([vdpau >= $VDPAU_REQUIRED], [enable_vdpau=yes], [enable_vdpau=no])
  1984. fi
  1985. if test "x$enable_omx_bellagio" = xauto -a "x$have_omx_platform" = xyes; then
  1986. PKG_CHECK_EXISTS([libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED], [enable_omx_bellagio=yes], [enable_omx_bellagio=no])
  1987. fi
  1988. if test "x$enable_omx_tizonia" = xauto -a "x$have_omx_platform" = xyes; then
  1989. PKG_CHECK_EXISTS([libtizonia >= $LIBOMXIL_TIZONIA_REQUIRED], [enable_omx_tizonia=yes], [enable_omx_tizonia=no])
  1990. fi
  1991. if test "x$enable_va" = xauto -a "x$have_va_platform" = xyes; then
  1992. PKG_CHECK_EXISTS([libva >= $LIBVA_REQUIRED], [enable_va=yes], [enable_va=no])
  1993. fi
  1994. fi
  1995. if test "x$enable_dri" = xyes -o \
  1996. "x$enable_xvmc" = xyes -o \
  1997. "x$enable_vdpau" = xyes -o \
  1998. "x$enable_omx_bellagio" = xyes -o \
  1999. "x$enable_omx_tizonia" = xyes -o \
  2000. "x$enable_va" = xyes; then
  2001. need_gallium_vl=yes
  2002. fi
  2003. AM_CONDITIONAL(NEED_GALLIUM_VL, test "x$need_gallium_vl" = xyes)
  2004. if test "x$enable_xvmc" = xyes -o \
  2005. "x$enable_vdpau" = xyes -o \
  2006. "x$enable_omx_bellagio" = xyes -o \
  2007. "x$enable_omx_tizonia" = xyes -o \
  2008. "x$enable_va" = xyes; then
  2009. if echo $platforms | grep -q "x11"; then
  2010. PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
  2011. fi
  2012. need_gallium_vl_winsys=yes
  2013. fi
  2014. AM_CONDITIONAL(NEED_GALLIUM_VL_WINSYS, test "x$need_gallium_vl_winsys" = xyes)
  2015. if test "x$enable_xvmc" = xyes; then
  2016. if test "x$have_xvmc_platform" != xyes; then
  2017. AC_MSG_ERROR([XVMC requires the x11 platforms])
  2018. fi
  2019. PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED])
  2020. gallium_st="$gallium_st xvmc"
  2021. fi
  2022. AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
  2023. if test "x$enable_vdpau" = xyes; then
  2024. if test "x$have_vdpau_platform" != xyes; then
  2025. AC_MSG_ERROR([VDPAU requires the x11 platforms])
  2026. fi
  2027. PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED])
  2028. gallium_st="$gallium_st vdpau"
  2029. DEFINES="$DEFINES -DHAVE_ST_VDPAU"
  2030. fi
  2031. AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
  2032. if test "x$enable_omx_bellagio" = xyes; then
  2033. if test "x$have_omx_platform" != xyes; then
  2034. AC_MSG_ERROR([OMX requires at least one of the x11 or drm platforms])
  2035. fi
  2036. PKG_CHECK_MODULES([OMX_BELLAGIO], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED])
  2037. gallium_st="$gallium_st omx_bellagio"
  2038. AC_DEFINE([ENABLE_ST_OMX_BELLAGIO], 1, [Use Bellagio for OMX IL])
  2039. else
  2040. AC_DEFINE([ENABLE_ST_OMX_BELLAGIO], 0)
  2041. fi
  2042. AM_CONDITIONAL(HAVE_ST_OMX_BELLAGIO, test "x$enable_omx_bellagio" = xyes)
  2043. if test "x$enable_omx_tizonia" = xyes; then
  2044. if test "x$have_omx_platform" != xyes; then
  2045. AC_MSG_ERROR([OMX requires at least one of the x11 or drm platforms])
  2046. fi
  2047. PKG_CHECK_MODULES([OMX_TIZONIA],
  2048. [libtizonia >= $LIBOMXIL_TIZONIA_REQUIRED
  2049. tizilheaders >= $LIBOMXIL_TIZONIA_REQUIRED
  2050. libtizplatform >= $LIBOMXIL_TIZONIA_REQUIRED])
  2051. gallium_st="$gallium_st omx_tizonia"
  2052. AC_DEFINE([ENABLE_ST_OMX_TIZONIA], 1, [Use Tizoina for OMX IL])
  2053. else
  2054. AC_DEFINE([ENABLE_ST_OMX_TIZONIA], 0)
  2055. fi
  2056. AM_CONDITIONAL(HAVE_ST_OMX_TIZONIA, test "x$enable_omx_tizonia" = xyes)
  2057. if test "x$enable_va" = xyes; then
  2058. if test "x$have_va_platform" != xyes; then
  2059. AC_MSG_ERROR([VA requires at least one of the x11 drm or wayland platforms])
  2060. fi
  2061. PKG_CHECK_MODULES([VA], [libva >= $LIBVA_REQUIRED])
  2062. gallium_st="$gallium_st va"
  2063. fi
  2064. AM_CONDITIONAL(HAVE_ST_VA, test "x$enable_va" = xyes)
  2065. dnl
  2066. dnl Nine Direct3D9 configuration
  2067. dnl
  2068. if test "x$enable_nine" = xyes; then
  2069. if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
  2070. AC_MSG_ERROR([nine requires the gallium swrast driver])
  2071. fi
  2072. if test "x$with_gallium_drivers" = xswrast; then
  2073. AC_MSG_ERROR([nine requires at least one non-swrast gallium driver])
  2074. fi
  2075. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
  2076. AC_MSG_ERROR([gcc >= 4.6 is required to build nine])
  2077. fi
  2078. if test "x$enable_dri3" = xno; then
  2079. AC_MSG_WARN([using nine together with wine requires DRI3 enabled system])
  2080. fi
  2081. gallium_st="$gallium_st nine"
  2082. fi
  2083. AM_CONDITIONAL(HAVE_ST_NINE, test "x$enable_nine" = xyes)
  2084. dnl
  2085. dnl OpenCL configuration
  2086. dnl
  2087. AC_ARG_WITH([clang-libdir],
  2088. [AS_HELP_STRING([--with-clang-libdir],
  2089. [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
  2090. [CLANG_LIBDIR="$withval"],
  2091. [CLANG_LIBDIR=''])
  2092. PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
  2093. if test "x$enable_opencl" = xyes; then
  2094. if test -z "$with_gallium_drivers"; then
  2095. AC_MSG_ERROR([cannot enable OpenCL without Gallium])
  2096. fi
  2097. if test "x$HAVE_CXX11" != "xyes"; then
  2098. AC_MSG_ERROR([clover requires c++11 support])
  2099. fi
  2100. if test "x$have_libclc" = xno; then
  2101. AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
  2102. Make sure the directory containing libclc.pc is specified in your
  2103. PKG_CONFIG_PATH environment variable.
  2104. By default libclc.pc is installed to /usr/local/share/pkgconfig/])
  2105. else
  2106. LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
  2107. LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
  2108. AC_SUBST([LIBCLC_INCLUDEDIR])
  2109. AC_SUBST([LIBCLC_LIBEXECDIR])
  2110. fi
  2111. gallium_st="$gallium_st clover"
  2112. if test "x$enable_opencl_icd" = xyes; then
  2113. OPENCL_LIBNAME="MesaOpenCL"
  2114. else
  2115. OPENCL_LIBNAME="OpenCL"
  2116. fi
  2117. if test "x$have_libelf" != xyes; then
  2118. AC_MSG_ERROR([Clover requires libelf])
  2119. fi
  2120. if test "x${ac_cv_cxx_compiler_gnu}" = xyes; then
  2121. altivec_enabled=no
  2122. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  2123. #if !defined(__VEC__) || !defined(__ALTIVEC__)
  2124. #error "AltiVec not enabled"
  2125. #endif
  2126. ])], altivec_enabled=yes)
  2127. if test "$altivec_enabled" = yes; then
  2128. CLOVER_STD_OVERRIDE="-std=gnu++11"
  2129. fi
  2130. AC_SUBST([CLOVER_STD_OVERRIDE])
  2131. fi
  2132. llvm_require_version $LLVM_REQUIRED_OPENCL "opencl"
  2133. llvm_add_default_components "opencl"
  2134. llvm_add_component "all-targets" "opencl"
  2135. llvm_add_component "coverage" "opencl"
  2136. llvm_add_component "linker" "opencl"
  2137. llvm_add_component "instrumentation" "opencl"
  2138. llvm_add_component "ipo" "opencl"
  2139. llvm_add_component "irreader" "opencl"
  2140. llvm_add_component "lto" "opencl"
  2141. llvm_add_component "option" "opencl"
  2142. llvm_add_component "objcarcopts" "opencl"
  2143. llvm_add_component "profiledata" "opencl"
  2144. llvm_add_optional_component "coroutines" "opencl"
  2145. dnl Check for Clang internal headers
  2146. if test -z "$CLANG_LIBDIR"; then
  2147. CLANG_LIBDIR=${LLVM_LIBDIR}
  2148. fi
  2149. CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
  2150. AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
  2151. [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
  2152. fi
  2153. AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
  2154. AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
  2155. AC_SUBST([OPENCL_LIBNAME])
  2156. AC_SUBST([CLANG_RESOURCE_DIR])
  2157. dnl
  2158. dnl Gallium configuration
  2159. dnl
  2160. AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
  2161. # libEGL wants to default to the first platform specified in
  2162. # ./configure. parse that here.
  2163. if test "x$platforms" != "x"; then
  2164. FIRST_PLATFORM_CAPS=`echo $platforms | sed 's| .*||' | tr '[[a-z]]' '[[A-Z]]'`
  2165. EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
  2166. else
  2167. EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
  2168. fi
  2169. AC_SUBST([EGL_NATIVE_PLATFORM])
  2170. AC_SUBST([EGL_CFLAGS])
  2171. # If we don't have the X11 platform, set this define so we don't try to include
  2172. # the X11 headers.
  2173. if ! echo "$platforms" | grep -q 'x11'; then
  2174. DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
  2175. GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
  2176. fi
  2177. dnl Directory for XVMC libs
  2178. AC_ARG_WITH([xvmc-libdir],
  2179. [AS_HELP_STRING([--with-xvmc-libdir=DIR],
  2180. [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
  2181. [XVMC_LIB_INSTALL_DIR="$withval"],
  2182. [XVMC_LIB_INSTALL_DIR='${libdir}'])
  2183. AC_SUBST([XVMC_LIB_INSTALL_DIR])
  2184. dnl
  2185. dnl Gallium Tests
  2186. dnl
  2187. AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
  2188. dnl Directory for VDPAU libs
  2189. AC_ARG_WITH([vdpau-libdir],
  2190. [AS_HELP_STRING([--with-vdpau-libdir=DIR],
  2191. [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
  2192. [VDPAU_LIB_INSTALL_DIR="$withval"],
  2193. [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
  2194. AC_SUBST([VDPAU_LIB_INSTALL_DIR])
  2195. dnl Directory for OMX_BELLAGIO libs
  2196. AC_ARG_WITH([omx-bellagio-libdir],
  2197. [AS_HELP_STRING([--with-omx-bellagio-libdir=DIR],
  2198. [directory for the OMX_BELLAGIO libraries])],
  2199. [OMX_BELLAGIO_LIB_INSTALL_DIR="$withval"],
  2200. [OMX_BELLAGIO_LIB_INSTALL_DIR=`$PKG_CONFIG --exists libomxil-bellagio && \
  2201. $PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libomxil-bellagio`])
  2202. AC_SUBST([OMX_BELLAGIO_LIB_INSTALL_DIR])
  2203. dnl Directory for OMX_TIZONIA libs
  2204. AC_ARG_WITH([omx-tizonia-libdir],
  2205. [AS_HELP_STRING([--with-omx-tizonia-libdir=DIR],
  2206. [directory for the OMX_TIZONIA libraries])],
  2207. [OMX_TIZONIA_LIB_INSTALL_DIR="$withval"],
  2208. [OMX_TIZONIA_LIB_INSTALL_DIR=`$PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libtizcore`])
  2209. AC_SUBST([OMX_TIZONIA_LIB_INSTALL_DIR])
  2210. dnl Directory for VA libs
  2211. AC_ARG_WITH([va-libdir],
  2212. [AS_HELP_STRING([--with-va-libdir=DIR],
  2213. [directory for the VA libraries @<:@${libdir}/dri@:>@])],
  2214. [VA_LIB_INSTALL_DIR="$withval"],
  2215. [VA_LIB_INSTALL_DIR="${libdir}/dri"])
  2216. AC_SUBST([VA_LIB_INSTALL_DIR])
  2217. AC_ARG_WITH([d3d-libdir],
  2218. [AS_HELP_STRING([--with-d3d-libdir=DIR],
  2219. [directory for the D3D modules @<:@${libdir}/d3d@:>@])],
  2220. [D3D_DRIVER_INSTALL_DIR="$withval"],
  2221. [D3D_DRIVER_INSTALL_DIR="${libdir}/d3d"])
  2222. AC_SUBST([D3D_DRIVER_INSTALL_DIR])
  2223. dnl Architectures to build SWR library for
  2224. AC_ARG_WITH([swr-archs],
  2225. [AS_HELP_STRING([--with-swr-archs@<:@=DIRS...@:>@],
  2226. [comma delimited swr architectures list, e.g.
  2227. "avx,avx2,knl,skx" @<:@default="avx,avx2"@:>@])],
  2228. [with_swr_archs="$withval"],
  2229. [with_swr_archs="avx,avx2"])
  2230. dnl
  2231. dnl r300 doesn't strictly require LLVM, but for performance reasons we
  2232. dnl highly recommend LLVM usage. So require it at least on x86 and x86_64
  2233. dnl architectures.
  2234. dnl
  2235. r300_require_llvm() {
  2236. case "$host" in *gnux32) return;; esac
  2237. case "$host_cpu" in
  2238. i*86|x86_64|amd64) require_llvm $1
  2239. ;;
  2240. esac
  2241. }
  2242. dnl
  2243. dnl DRM is needed by X, Wayland, and offscreen rendering.
  2244. dnl Surfaceless is an alternative for the last one.
  2245. dnl
  2246. require_basic_egl() {
  2247. case "$with_platforms" in
  2248. *drm*|*surfaceless*|*android*)
  2249. ;;
  2250. *)
  2251. AC_MSG_ERROR([$1 requires one of these:
  2252. 1) --with-platforms=drm (X, Wayland, offscreen rendering based on DRM)
  2253. 2) --with-platforms=surfaceless (offscreen only)
  2254. 3) --with-platforms=android (Android only)
  2255. Recommended options: drm,x11])
  2256. ;;
  2257. esac
  2258. }
  2259. swr_require_cxx_feature_flags() {
  2260. feature_name="$1"
  2261. preprocessor_test="$2"
  2262. option_list="$3"
  2263. output_var="$4"
  2264. AC_MSG_CHECKING([whether $CXX supports $feature_name])
  2265. AC_LANG_PUSH([C++])
  2266. save_CXXFLAGS="$CXXFLAGS"
  2267. save_IFS="$IFS"
  2268. IFS=","
  2269. found=0
  2270. for opts in $option_list
  2271. do
  2272. unset IFS
  2273. CXXFLAGS="$opts $save_CXXFLAGS"
  2274. AC_COMPILE_IFELSE(
  2275. [AC_LANG_PROGRAM(
  2276. [ #if !($preprocessor_test)
  2277. #error
  2278. #endif
  2279. ])],
  2280. [found=1; break],
  2281. [])
  2282. IFS=","
  2283. done
  2284. IFS="$save_IFS"
  2285. CXXFLAGS="$save_CXXFLAGS"
  2286. AC_LANG_POP([C++])
  2287. if test $found -eq 1; then
  2288. AC_MSG_RESULT([$opts])
  2289. eval "$output_var=\$opts"
  2290. return 0
  2291. fi
  2292. AC_MSG_RESULT([no])
  2293. AC_MSG_ERROR([swr requires $feature_name support])
  2294. return 1
  2295. }
  2296. dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
  2297. if test -n "$with_gallium_drivers"; then
  2298. gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
  2299. for driver in $gallium_drivers; do
  2300. case "x$driver" in
  2301. xsvga)
  2302. HAVE_GALLIUM_SVGA=yes
  2303. require_libdrm "svga"
  2304. ;;
  2305. xi915)
  2306. HAVE_GALLIUM_I915=yes
  2307. PKG_CHECK_MODULES([I915], [libdrm >= $LIBDRM_INTEL_REQUIRED libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  2308. require_libdrm "Gallium i915"
  2309. ;;
  2310. xr300)
  2311. HAVE_GALLIUM_R300=yes
  2312. PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  2313. require_libdrm "r300"
  2314. r300_require_llvm "r300"
  2315. ;;
  2316. xr600)
  2317. HAVE_GALLIUM_R600=yes
  2318. PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  2319. require_libdrm "r600"
  2320. if test "x$enable_llvm" = xyes; then
  2321. radeon_llvm_check $LLVM_REQUIRED_R600 "r600"
  2322. llvm_add_component "asmparser" "r600"
  2323. llvm_add_component "bitreader" "r600"
  2324. fi
  2325. ;;
  2326. xradeonsi)
  2327. HAVE_GALLIUM_RADEONSI=yes
  2328. PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  2329. PKG_CHECK_MODULES([AMDGPU], [libdrm >= $LIBDRM_AMDGPU_REQUIRED libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
  2330. require_libdrm "radeonsi"
  2331. radeon_llvm_check $LLVM_REQUIRED_RADEONSI "radeonsi"
  2332. if test "x$enable_egl" = xyes; then
  2333. require_basic_egl "radeonsi"
  2334. fi
  2335. ;;
  2336. xnouveau)
  2337. HAVE_GALLIUM_NOUVEAU=yes
  2338. PKG_CHECK_MODULES([NOUVEAU], [libdrm >= $LIBDRM_NOUVEAU_REQUIRED libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  2339. require_libdrm "nouveau"
  2340. ;;
  2341. xfreedreno)
  2342. HAVE_GALLIUM_FREEDRENO=yes
  2343. PKG_CHECK_MODULES([FREEDRENO], [libdrm >= $LIBDRM_FREEDRENO_REQUIRED libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
  2344. require_libdrm "freedreno"
  2345. ;;
  2346. xetnaviv)
  2347. HAVE_GALLIUM_ETNAVIV=yes
  2348. PKG_CHECK_MODULES([ETNAVIV], [libdrm >= $LIBDRM_ETNAVIV_REQUIRED libdrm_etnaviv >= $LIBDRM_ETNAVIV_REQUIRED])
  2349. require_libdrm "etnaviv"
  2350. ;;
  2351. ximx)
  2352. HAVE_GALLIUM_IMX=yes
  2353. ;;
  2354. xtegra)
  2355. HAVE_GALLIUM_TEGRA=yes
  2356. require_libdrm "tegra"
  2357. ;;
  2358. xswrast)
  2359. HAVE_GALLIUM_SOFTPIPE=yes
  2360. if test "x$enable_llvm" = xyes; then
  2361. HAVE_GALLIUM_LLVMPIPE=yes
  2362. fi
  2363. ;;
  2364. xswr)
  2365. llvm_require_version $LLVM_REQUIRED_SWR "swr"
  2366. if test "x$HAVE_CXX11" != "xyes"; then
  2367. AC_MSG_ERROR([swr requires c++11 support])
  2368. fi
  2369. swr_require_cxx_feature_flags "AVX" "defined(__AVX__)" \
  2370. ",-target-cpu=sandybridge,-mavx,-march=core-avx,-tp=sandybridge" \
  2371. SWR_AVX_CXXFLAGS
  2372. AC_SUBST([SWR_AVX_CXXFLAGS])
  2373. swr_archs=`IFS=', '; echo $with_swr_archs`
  2374. for arch in $swr_archs; do
  2375. case "x$arch" in
  2376. xavx)
  2377. HAVE_SWR_AVX=yes
  2378. ;;
  2379. xavx2)
  2380. swr_require_cxx_feature_flags "AVX2" "defined(__AVX2__)" \
  2381. ",-target-cpu=haswell,-mavx2 -mfma -mbmi2 -mf16c,-march=core-avx2,-tp=haswell" \
  2382. SWR_AVX2_CXXFLAGS
  2383. AC_SUBST([SWR_AVX2_CXXFLAGS])
  2384. HAVE_SWR_AVX2=yes
  2385. ;;
  2386. xknl)
  2387. swr_require_cxx_feature_flags "KNL" "defined(__AVX512F__) && defined(__AVX512ER__)" \
  2388. ",-target-cpu=mic-knl,-march=knl,-xMIC-AVX512" \
  2389. SWR_KNL_CXXFLAGS
  2390. AC_SUBST([SWR_KNL_CXXFLAGS])
  2391. HAVE_SWR_KNL=yes
  2392. ;;
  2393. xskx)
  2394. swr_require_cxx_feature_flags "SKX" "defined(__AVX512F__) && defined(__AVX512BW__)" \
  2395. ",-target-cpu=x86-skylake,-march=skylake-avx512,-xCORE-AVX512" \
  2396. SWR_SKX_CXXFLAGS
  2397. AC_SUBST([SWR_SKX_CXXFLAGS])
  2398. HAVE_SWR_SKX=yes
  2399. ;;
  2400. *)
  2401. AC_MSG_ERROR([unknown SWR build architecture '$arch'])
  2402. ;;
  2403. esac
  2404. done
  2405. if test "x$HAVE_SWR_AVX" != xyes -a \
  2406. "x$HAVE_SWR_AVX2" != xyes -a \
  2407. "x$HAVE_SWR_KNL" != xyes -a \
  2408. "x$HAVE_SWR_SKX" != xyes; then
  2409. AC_MSG_ERROR([swr enabled but no swr architectures selected])
  2410. fi
  2411. # test if more than one swr arch configured
  2412. if test `echo $swr_archs | wc -w` -eq 1; then
  2413. HAVE_SWR_BUILTIN=yes
  2414. fi
  2415. HAVE_GALLIUM_SWR=yes
  2416. ;;
  2417. xvc4)
  2418. HAVE_GALLIUM_VC4=yes
  2419. PKG_CHECK_MODULES([VC4], [libdrm >= $LIBDRM_VC4_REQUIRED])
  2420. PKG_CHECK_MODULES([SIMPENROSE], [simpenrose],
  2421. [USE_VC4_SIMULATOR=yes;
  2422. DEFINES="$DEFINES -DUSE_VC4_SIMULATOR"],
  2423. [USE_VC4_SIMULATOR=no])
  2424. ;;
  2425. xv3d)
  2426. HAVE_GALLIUM_V3D=yes
  2427. PKG_CHECK_MODULES([V3D_SIMULATOR], [v3dv3],
  2428. [USE_V3D_SIMULATOR=yes;
  2429. DEFINES="$DEFINES -DUSE_V3D_SIMULATOR"],
  2430. [USE_V3D_SIMULATOR=no])
  2431. ;;
  2432. xpl111)
  2433. HAVE_GALLIUM_PL111=yes
  2434. ;;
  2435. xvirgl)
  2436. HAVE_GALLIUM_VIRGL=yes
  2437. require_libdrm "virgl"
  2438. if test "x$enable_egl" = xyes; then
  2439. require_basic_egl "virgl"
  2440. fi
  2441. ;;
  2442. *)
  2443. AC_MSG_ERROR([Unknown Gallium driver: $driver])
  2444. ;;
  2445. esac
  2446. done
  2447. fi
  2448. # XXX: Keep in sync with LLVM_REQUIRED_SWR
  2449. AM_CONDITIONAL(SWR_INVALID_LLVM_VERSION, test "x$LLVM_VERSION" != x4.0.0 -a \
  2450. "x$LLVM_VERSION" != x4.0.1)
  2451. if test "x$enable_llvm" = "xyes" -a "$with_gallium_drivers"; then
  2452. llvm_require_version $LLVM_REQUIRED_GALLIUM "gallium"
  2453. llvm_add_default_components "gallium"
  2454. fi
  2455. AM_CONDITIONAL(HAVE_SWR_AVX, test "x$HAVE_SWR_AVX" = xyes)
  2456. AM_CONDITIONAL(HAVE_SWR_AVX2, test "x$HAVE_SWR_AVX2" = xyes)
  2457. AM_CONDITIONAL(HAVE_SWR_KNL, test "x$HAVE_SWR_KNL" = xyes)
  2458. AM_CONDITIONAL(HAVE_SWR_SKX, test "x$HAVE_SWR_SKX" = xyes)
  2459. AM_CONDITIONAL(HAVE_SWR_BUILTIN, test "x$HAVE_SWR_BUILTIN" = xyes)
  2460. dnl We need to validate some needed dependencies for renderonly drivers.
  2461. if test "x$HAVE_GALLIUM_ETNAVIV" != xyes -a "x$HAVE_GALLIUM_IMX" = xyes ; then
  2462. AC_MSG_ERROR([Building with imx requires etnaviv])
  2463. fi
  2464. if test "x$HAVE_GALLIUM_VC4" != xyes -a "x$HAVE_GALLIUM_PL111" = xyes ; then
  2465. AC_MSG_ERROR([Building with pl111 requires vc4])
  2466. fi
  2467. if test "x$HAVE_GALLIUM_NOUVEAU" != xyes -a "x$HAVE_GALLIUM_TEGRA" = xyes; then
  2468. AC_MSG_ERROR([Building with tegra requires nouveau])
  2469. fi
  2470. detect_old_buggy_llvm() {
  2471. dnl llvm-config may not give the right answer when llvm is a built as a
  2472. dnl single shared library, so we must work the library name out for
  2473. dnl ourselves.
  2474. dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
  2475. dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
  2476. LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
  2477. AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
  2478. if test "x$llvm_have_one_so" = xyes; then
  2479. dnl LLVM was built using auto*, so there is only one shared object.
  2480. LLVM_LIBS="-l$LLVM_SO_NAME"
  2481. else
  2482. dnl If LLVM was built with CMake, there will be one shared object per
  2483. dnl component.
  2484. AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
  2485. [AC_MSG_ERROR([Could not find llvm shared libraries:
  2486. Please make sure you have built llvm with the --enable-shared option
  2487. and that your llvm libraries are installed in $LLVM_LIBDIR
  2488. If you have installed your llvm libraries to a different directory you
  2489. can use the --with-llvm-prefix= configure flag to specify this directory.
  2490. NOTE: Mesa is attempting to use llvm shared libraries by default.
  2491. If you do not want to build with llvm shared libraries and instead want to
  2492. use llvm static libraries then add --disable-llvm-shared-libs to your configure
  2493. invocation and rebuild.])])
  2494. dnl We don't need to update LLVM_LIBS in this case because the LLVM
  2495. dnl install uses a shared object for each component and we have
  2496. dnl already added all of these objects to LLVM_LIBS.
  2497. fi
  2498. }
  2499. dnl
  2500. dnl Set defines and buildtime variables only when using LLVM.
  2501. dnl
  2502. if test "x$enable_llvm" = xyes; then
  2503. DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
  2504. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  2505. LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
  2506. LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
  2507. dnl Set LLVM_LIBS - This is done after the driver configuration so
  2508. dnl that drivers can add additional components to LLVM_COMPONENTS.
  2509. dnl Previously, gallium drivers were updating LLVM_LIBS directly
  2510. dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
  2511. dnl this was causing the same libraries to be appear multiple times
  2512. dnl in LLVM_LIBS.
  2513. if test $LLVM_VERSION_MAJOR -ge 4 -o $LLVM_VERSION_MAJOR -eq 3 -a $LLVM_VERSION_MINOR -ge 9; then
  2514. if test "x$enable_llvm_shared_libs" = xyes; then
  2515. LLVM_LIBS="`$LLVM_CONFIG --link-shared --libs ${LLVM_COMPONENTS}`"
  2516. else
  2517. dnl Invoking llvm-config with both -libs and --system-libs produces the
  2518. dnl two separate lines - each for the set of libraries.
  2519. dnl Call the program twice, effectively folding them into a single line.
  2520. LLVM_LIBS="`$LLVM_CONFIG --link-static --libs ${LLVM_COMPONENTS}`"
  2521. dnl We need to link to llvm system libs when using static libs
  2522. LLVM_LIBS="$LLVM_LIBS `$LLVM_CONFIG --link-static --system-libs`"
  2523. fi
  2524. else
  2525. LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
  2526. if test "x$enable_llvm_shared_libs" = xyes; then
  2527. detect_old_buggy_llvm
  2528. else
  2529. AC_MSG_WARN([Building mesa with statically linked LLVM may cause compilation issues])
  2530. dnl We need to link to llvm system libs when using static libs
  2531. dnl However, only llvm 3.5+ provides --system-libs
  2532. if test $LLVM_VERSION_MAJOR -ge 4 -o $LLVM_VERSION_MAJOR -eq 3 -a $LLVM_VERSION_MINOR -ge 5; then
  2533. LLVM_LIBS="$LLVM_LIBS `$LLVM_CONFIG --system-libs`"
  2534. fi
  2535. fi
  2536. fi
  2537. dnl The gallium-xlib GLX and gallium OSMesa targets directly embed the
  2538. dnl swr/llvmpipe driver into the final binary. Adding LLVM_LIBS results in
  2539. dnl the LLVM library propagated in the Libs.private of the respective .pc
  2540. dnl file which ensures complete dependency information when statically
  2541. dnl linking.
  2542. if test "x$enable_glx" == xgallium-xlib; then
  2543. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $LLVM_LIBS"
  2544. fi
  2545. if test "x$enable_gallium_osmesa" = xyes; then
  2546. OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $LLVM_LIBS"
  2547. fi
  2548. fi
  2549. AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
  2550. AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
  2551. AM_CONDITIONAL(HAVE_GALLIUM_PL111, test "x$HAVE_GALLIUM_PL111" = xyes)
  2552. AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
  2553. AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
  2554. AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
  2555. AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
  2556. AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
  2557. AM_CONDITIONAL(HAVE_GALLIUM_ETNAVIV, test "x$HAVE_GALLIUM_ETNAVIV" = xyes)
  2558. AM_CONDITIONAL(HAVE_GALLIUM_IMX, test "x$HAVE_GALLIUM_IMX" = xyes)
  2559. AM_CONDITIONAL(HAVE_GALLIUM_TEGRA, test "x$HAVE_GALLIUM_TEGRA" = xyes)
  2560. AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  2561. AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
  2562. AM_CONDITIONAL(HAVE_GALLIUM_SWR, test "x$HAVE_GALLIUM_SWR" = xyes)
  2563. AM_CONDITIONAL(HAVE_GALLIUM_SWRAST, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes -o \
  2564. "x$HAVE_GALLIUM_LLVMPIPE" = xyes -o \
  2565. "x$HAVE_GALLIUM_SWR" = xyes)
  2566. AM_CONDITIONAL(HAVE_GALLIUM_V3D, test "x$HAVE_GALLIUM_V3D" = xyes)
  2567. AM_CONDITIONAL(HAVE_GALLIUM_VC4, test "x$HAVE_GALLIUM_VC4" = xyes)
  2568. AM_CONDITIONAL(HAVE_GALLIUM_VIRGL, test "x$HAVE_GALLIUM_VIRGL" = xyes)
  2569. AM_CONDITIONAL(HAVE_GALLIUM_STATIC_TARGETS, test "x$enable_shared_pipe_drivers" = xno)
  2570. if test "x$enable_dri" = xyes; then
  2571. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI"
  2572. fi
  2573. if test "x$have_drisw_kms" = xyes; then
  2574. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_KMS"
  2575. fi
  2576. AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
  2577. AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
  2578. AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
  2579. AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
  2580. AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
  2581. AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
  2582. AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
  2583. AM_CONDITIONAL(HAVE_RADEON_VULKAN, test "x$HAVE_RADEON_VULKAN" = xyes)
  2584. AM_CONDITIONAL(HAVE_INTEL_VULKAN, test "x$HAVE_INTEL_VULKAN" = xyes)
  2585. AM_CONDITIONAL(HAVE_AMD_DRIVERS, test "x$HAVE_GALLIUM_RADEONSI" = xyes -o \
  2586. "x$HAVE_RADEON_VULKAN" = xyes)
  2587. AM_CONDITIONAL(HAVE_BROADCOM_DRIVERS, test "x$HAVE_GALLIUM_VC4" = xyes -o \
  2588. "x$HAVE_GALLIUM_V3D" = xyes)
  2589. AM_CONDITIONAL(HAVE_INTEL_DRIVERS, test "x$HAVE_INTEL_VULKAN" = xyes -o \
  2590. "x$HAVE_I965_DRI" = xyes)
  2591. AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$HAVE_GALLIUM_R300" = xyes -o \
  2592. "x$HAVE_GALLIUM_R600" = xyes -o \
  2593. "x$HAVE_GALLIUM_RADEONSI" = xyes)
  2594. AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$enable_glx" = xgallium-xlib)
  2595. AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
  2596. AM_CONDITIONAL(HAVE_GALLIUM_LLVM, test "x$enable_llvm" = xyes)
  2597. AM_CONDITIONAL(USE_V3D_SIMULATOR, test x$USE_V3D_SIMULATOR = xyes)
  2598. AM_CONDITIONAL(USE_VC4_SIMULATOR, test x$USE_VC4_SIMULATOR = xyes)
  2599. AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes)
  2600. AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
  2601. AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
  2602. AM_CONDITIONAL(HAVE_COMMON_OSMESA, test "x$enable_osmesa" = xyes -o \
  2603. "x$enable_gallium_osmesa" = xyes)
  2604. AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64)
  2605. AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64)
  2606. AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc)
  2607. AM_CONDITIONAL(HAVE_PPC64LE_ASM, test "x$asm_arch" = xppc64le)
  2608. AM_CONDITIONAL(HAVE_AARCH64_ASM, test "x$asm_arch" = xaarch64)
  2609. AM_CONDITIONAL(HAVE_ARM_ASM, test "x$asm_arch" = xarm)
  2610. AC_SUBST([NINE_MAJOR], 1)
  2611. AC_SUBST([NINE_MINOR], 0)
  2612. AC_SUBST([NINE_PATCH], 0)
  2613. AC_SUBST([NINE_VERSION], "$NINE_MAJOR.$NINE_MINOR.$NINE_PATCH")
  2614. AC_SUBST([VDPAU_MAJOR], 1)
  2615. AC_SUBST([VDPAU_MINOR], 0)
  2616. if test "x$enable_va" = xyes; then
  2617. VA_MAJOR=`$PKG_CONFIG --modversion libva | $SED -n 's/\([[^\.]]*\)\..*$/\1/p'`
  2618. VA_MINOR=`$PKG_CONFIG --modversion libva | $SED -n 's/.*\.\(.*\)\..*$/\1/p'`
  2619. fi
  2620. AC_SUBST([VA_MAJOR], $VA_MAJOR)
  2621. AC_SUBST([VA_MINOR], $VA_MINOR)
  2622. AM_CONDITIONAL(HAVE_VULKAN_COMMON, test "x$VULKAN_DRIVERS" != "x")
  2623. AC_SUBST([XVMC_MAJOR], 1)
  2624. AC_SUBST([XVMC_MINOR], 0)
  2625. AC_SUBST([XA_MAJOR], 2)
  2626. AC_SUBST([XA_MINOR], 4)
  2627. AC_SUBST([XA_PATCH], 0)
  2628. AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_PATCH")
  2629. AC_ARG_ENABLE(valgrind,
  2630. [AS_HELP_STRING([--enable-valgrind],
  2631. [Build mesa with valgrind support (default: auto)])],
  2632. [VALGRIND=$enableval], [VALGRIND=auto])
  2633. if test "x$VALGRIND" != xno; then
  2634. PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
  2635. fi
  2636. AC_MSG_CHECKING([whether to enable Valgrind support])
  2637. if test "x$VALGRIND" = xauto; then
  2638. VALGRIND="$have_valgrind"
  2639. fi
  2640. if test "x$VALGRIND" = "xyes"; then
  2641. if ! test "x$have_valgrind" = xyes; then
  2642. AC_MSG_ERROR([Valgrind support required but not present])
  2643. fi
  2644. AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
  2645. fi
  2646. AC_MSG_RESULT([$VALGRIND])
  2647. dnl Restore LDFLAGS and CPPFLAGS
  2648. LDFLAGS="$_SAVE_LDFLAGS"
  2649. CPPFLAGS="$_SAVE_CPPFLAGS"
  2650. dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
  2651. if test "x$acv_mesa_CLANG" = xyes; then
  2652. CFLAGS="$CFLAGS -Qunused-arguments"
  2653. CXXFLAGS="$CXXFLAGS -Qunused-arguments"
  2654. fi
  2655. dnl Add user CFLAGS and CXXFLAGS
  2656. CFLAGS="$CFLAGS $USER_CFLAGS"
  2657. CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
  2658. dnl Substitute the config
  2659. AC_CONFIG_FILES([Makefile
  2660. src/Makefile
  2661. src/amd/Makefile
  2662. src/amd/vulkan/Makefile
  2663. src/broadcom/Makefile
  2664. src/compiler/Makefile
  2665. src/egl/Makefile
  2666. src/egl/main/egl.pc
  2667. src/egl/wayland/wayland-drm/Makefile
  2668. src/gallium/Makefile
  2669. src/gallium/auxiliary/Makefile
  2670. src/gallium/auxiliary/pipe-loader/Makefile
  2671. src/gallium/drivers/freedreno/Makefile
  2672. src/gallium/drivers/i915/Makefile
  2673. src/gallium/drivers/llvmpipe/Makefile
  2674. src/gallium/drivers/nouveau/Makefile
  2675. src/gallium/drivers/pl111/Makefile
  2676. src/gallium/drivers/r300/Makefile
  2677. src/gallium/drivers/r600/Makefile
  2678. src/gallium/drivers/radeonsi/Makefile
  2679. src/gallium/drivers/softpipe/Makefile
  2680. src/gallium/drivers/svga/Makefile
  2681. src/gallium/drivers/swr/Makefile
  2682. src/gallium/drivers/tegra/Makefile
  2683. src/gallium/drivers/etnaviv/Makefile
  2684. src/gallium/drivers/imx/Makefile
  2685. src/gallium/drivers/v3d/Makefile
  2686. src/gallium/drivers/vc4/Makefile
  2687. src/gallium/drivers/virgl/Makefile
  2688. src/gallium/state_trackers/clover/Makefile
  2689. src/gallium/state_trackers/dri/Makefile
  2690. src/gallium/state_trackers/glx/xlib/Makefile
  2691. src/gallium/state_trackers/nine/Makefile
  2692. src/gallium/state_trackers/omx/Makefile
  2693. src/gallium/state_trackers/omx/bellagio/Makefile
  2694. src/gallium/state_trackers/omx/tizonia/Makefile
  2695. src/gallium/state_trackers/osmesa/Makefile
  2696. src/gallium/state_trackers/va/Makefile
  2697. src/gallium/state_trackers/vdpau/Makefile
  2698. src/gallium/state_trackers/xa/Makefile
  2699. src/gallium/state_trackers/xa/xa_tracker.h
  2700. src/gallium/state_trackers/xvmc/Makefile
  2701. src/gallium/targets/d3dadapter9/Makefile
  2702. src/gallium/targets/d3dadapter9/d3d.pc
  2703. src/gallium/targets/dri/Makefile
  2704. src/gallium/targets/libgl-xlib/Makefile
  2705. src/gallium/targets/omx/Makefile
  2706. src/gallium/targets/opencl/Makefile
  2707. src/gallium/targets/opencl/mesa.icd
  2708. src/gallium/targets/osmesa/Makefile
  2709. src/gallium/targets/osmesa/osmesa.pc
  2710. src/gallium/targets/pipe-loader/Makefile
  2711. src/gallium/targets/va/Makefile
  2712. src/gallium/targets/vdpau/Makefile
  2713. src/gallium/targets/xa/Makefile
  2714. src/gallium/targets/xa/xatracker.pc
  2715. src/gallium/targets/xvmc/Makefile
  2716. src/gallium/tests/trivial/Makefile
  2717. src/gallium/tests/unit/Makefile
  2718. src/gallium/winsys/etnaviv/drm/Makefile
  2719. src/gallium/winsys/imx/drm/Makefile
  2720. src/gallium/winsys/freedreno/drm/Makefile
  2721. src/gallium/winsys/i915/drm/Makefile
  2722. src/gallium/winsys/nouveau/drm/Makefile
  2723. src/gallium/winsys/pl111/drm/Makefile
  2724. src/gallium/winsys/radeon/drm/Makefile
  2725. src/gallium/winsys/amdgpu/drm/Makefile
  2726. src/gallium/winsys/svga/drm/Makefile
  2727. src/gallium/winsys/sw/dri/Makefile
  2728. src/gallium/winsys/sw/kms-dri/Makefile
  2729. src/gallium/winsys/sw/null/Makefile
  2730. src/gallium/winsys/sw/wrapper/Makefile
  2731. src/gallium/winsys/sw/xlib/Makefile
  2732. src/gallium/winsys/tegra/drm/Makefile
  2733. src/gallium/winsys/v3d/drm/Makefile
  2734. src/gallium/winsys/vc4/drm/Makefile
  2735. src/gallium/winsys/virgl/drm/Makefile
  2736. src/gallium/winsys/virgl/vtest/Makefile
  2737. src/gbm/Makefile
  2738. src/gbm/main/gbm.pc
  2739. src/glx/Makefile
  2740. src/glx/apple/Makefile
  2741. src/glx/tests/Makefile
  2742. src/glx/windows/Makefile
  2743. src/glx/windows/windowsdriproto.pc
  2744. src/gtest/Makefile
  2745. src/intel/Makefile
  2746. src/loader/Makefile
  2747. src/mapi/Makefile
  2748. src/mapi/es1api/glesv1_cm.pc
  2749. src/mapi/es2api/glesv2.pc
  2750. src/mapi/glapi/gen/Makefile
  2751. src/mesa/Makefile
  2752. src/mesa/gl.pc
  2753. src/mesa/drivers/dri/dri.pc
  2754. src/mesa/drivers/dri/common/Makefile
  2755. src/mesa/drivers/dri/i915/Makefile
  2756. src/mesa/drivers/dri/i965/Makefile
  2757. src/mesa/drivers/dri/Makefile
  2758. src/mesa/drivers/dri/nouveau/Makefile
  2759. src/mesa/drivers/dri/r200/Makefile
  2760. src/mesa/drivers/dri/radeon/Makefile
  2761. src/mesa/drivers/dri/swrast/Makefile
  2762. src/mesa/drivers/osmesa/Makefile
  2763. src/mesa/drivers/osmesa/osmesa.pc
  2764. src/mesa/drivers/x11/Makefile
  2765. src/mesa/main/tests/Makefile
  2766. src/mesa/state_tracker/tests/Makefile
  2767. src/util/Makefile
  2768. src/util/tests/hash_table/Makefile
  2769. src/util/tests/string_buffer/Makefile
  2770. src/util/tests/vma/Makefile
  2771. src/util/xmlpool/Makefile
  2772. src/vulkan/Makefile])
  2773. AC_OUTPUT
  2774. # Fix up dependencies in *.Plo files, where we changed the extension of a
  2775. # source file
  2776. $SED -i -e 's/brw_blorp.cpp/brw_blorp.c/' src/mesa/drivers/dri/i965/.deps/brw_blorp.Plo
  2777. rm -f src/compiler/spirv/spirv_info.lo
  2778. echo "# dummy" > src/compiler/spirv/.deps/spirv_info.Plo
  2779. rm -f src/compiler/nir/.deps/nir_intrinsics.Plo
  2780. echo "# dummy" > src/compiler/nir/.deps/nir_intrinsics.Plo
  2781. dnl
  2782. dnl Output some configuration info for the user
  2783. dnl
  2784. echo ""
  2785. echo " prefix: $prefix"
  2786. echo " exec_prefix: $exec_prefix"
  2787. echo " libdir: $libdir"
  2788. echo " includedir: $includedir"
  2789. dnl API info
  2790. echo ""
  2791. echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
  2792. dnl Driver info
  2793. echo ""
  2794. case "x$enable_osmesa$enable_gallium_osmesa" in
  2795. xnoyes)
  2796. echo " OSMesa: lib$OSMESA_LIB (Gallium)"
  2797. ;;
  2798. xyesno)
  2799. echo " OSMesa: lib$OSMESA_LIB"
  2800. ;;
  2801. xnono)
  2802. echo " OSMesa: no"
  2803. ;;
  2804. esac
  2805. echo ""
  2806. if test "x$enable_dri" != xno; then
  2807. echo " DRI platform: $dri_platform"
  2808. if test -z "$DRI_DIRS"; then
  2809. echo " DRI drivers: no"
  2810. else
  2811. echo " DRI drivers: $DRI_DIRS"
  2812. fi
  2813. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  2814. fi
  2815. case "x$enable_glx" in
  2816. xdri)
  2817. echo " GLX: DRI-based"
  2818. ;;
  2819. xxlib)
  2820. echo " GLX: Xlib-based"
  2821. ;;
  2822. xgallium-xlib)
  2823. echo " GLX: Xlib-based (Gallium)"
  2824. ;;
  2825. *)
  2826. echo " GLX: $enable_glx"
  2827. ;;
  2828. esac
  2829. dnl EGL
  2830. echo ""
  2831. echo " EGL: $enable_egl"
  2832. if test "$enable_egl" = yes; then
  2833. egl_drivers=""
  2834. if test "x$enable_dri" != "xno"; then
  2835. egl_drivers="$egl_drivers builtin:egl_dri2"
  2836. fi
  2837. if test "x$enable_dri3" != "xno"; then
  2838. egl_drivers="$egl_drivers builtin:egl_dri3"
  2839. fi
  2840. echo " EGL drivers: $egl_drivers"
  2841. fi
  2842. if test "x$enable_gbm" = xyes; then
  2843. echo " GBM: yes"
  2844. else
  2845. echo " GBM: no"
  2846. fi
  2847. echo " EGL/Vulkan/VL platforms: $platforms"
  2848. # Vulkan
  2849. echo ""
  2850. if test "x$VULKAN_DRIVERS" != x; then
  2851. echo " Vulkan drivers: $VULKAN_DRIVERS"
  2852. echo " Vulkan ICD dir: $VULKAN_ICD_INSTALL_DIR"
  2853. else
  2854. echo " Vulkan drivers: no"
  2855. fi
  2856. echo ""
  2857. if test "x$enable_llvm" = xyes; then
  2858. echo " llvm: yes"
  2859. echo " llvm-config: $LLVM_CONFIG"
  2860. echo " llvm-version: $LLVM_VERSION"
  2861. else
  2862. echo " llvm: no"
  2863. fi
  2864. echo ""
  2865. if test -n "$with_gallium_drivers"; then
  2866. echo " Gallium drivers: $gallium_drivers"
  2867. echo " Gallium st: $gallium_st"
  2868. else
  2869. echo " Gallium: no"
  2870. fi
  2871. echo ""
  2872. if test "x$enable_gallium_extra_hud" != xyes; then
  2873. echo " HUD extra stats: no"
  2874. else
  2875. echo " HUD extra stats: yes"
  2876. fi
  2877. if test "x$enable_lmsensors" != xyes; then
  2878. echo " HUD lmsensors: no"
  2879. else
  2880. echo " HUD lmsensors: yes"
  2881. fi
  2882. echo ""
  2883. if test "x$HAVE_GALLIUM_SWR" != x; then
  2884. if test "x$HAVE_SWR_BUILTIN" = xyes; then
  2885. echo " SWR archs: $swr_archs (builtin)"
  2886. else
  2887. echo " SWR archs: $swr_archs"
  2888. fi
  2889. fi
  2890. dnl Libraries
  2891. echo ""
  2892. echo " Shared libs: $enable_shared"
  2893. echo " Static libs: $enable_static"
  2894. echo " Shared-glapi: $enable_shared_glapi"
  2895. dnl Compiler options
  2896. # cleanup the CFLAGS/CXXFLAGS/LDFLAGS/DEFINES vars
  2897. cflags=`echo $CFLAGS | \
  2898. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2899. cxxflags=`echo $CXXFLAGS | \
  2900. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2901. ldflags=`echo $LDFLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  2902. defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
  2903. echo ""
  2904. echo " CFLAGS: $cflags"
  2905. echo " CXXFLAGS: $cxxflags"
  2906. echo " CXX11_CXXFLAGS: $CXX11_CXXFLAGS"
  2907. echo " LDFLAGS: $ldflags"
  2908. echo " Macros: $defines"
  2909. echo ""
  2910. if test "x$enable_llvm" = xyes; then
  2911. echo " LLVM_CFLAGS: $LLVM_CFLAGS"
  2912. echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
  2913. echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
  2914. echo " LLVM_LDFLAGS: $LLVM_LDFLAGS"
  2915. echo ""
  2916. fi
  2917. echo " PYTHON2: $PYTHON2"
  2918. echo ""
  2919. echo " Run '${MAKE-make}' to build Mesa"
  2920. echo ""