Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 108KB

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