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

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