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

configure.ac 92KB

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