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

configure.ac 113KB

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