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 73KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243
  1. dnl Process this file with autoconf to create configure.
  2. AC_PREREQ([2.60])
  3. dnl Tell the user about autoconf.html in the --help output
  4. m4_divert_once([HELP_END], [
  5. See docs/autoconf.html for more details on the options for Mesa.])
  6. m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION)))
  7. AC_INIT([Mesa], [MESA_VERSION],
  8. [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
  9. AC_CONFIG_AUX_DIR([bin])
  10. AC_CONFIG_MACRO_DIR([m4])
  11. AC_CANONICAL_SYSTEM
  12. AM_INIT_AUTOMAKE([foreign])
  13. # Support silent build rules, requires at least automake-1.11. Disable
  14. # by either passing --disable-silent-rules to configure or passing V=1
  15. # to make
  16. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  17. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  18. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  19. dnl Set internal versions
  20. OSMESA_VERSION=8
  21. AC_SUBST([OSMESA_VERSION])
  22. dnl Versions for external dependencies
  23. LIBDRM_REQUIRED=2.4.24
  24. LIBDRM_RADEON_REQUIRED=2.4.50
  25. LIBDRM_INTEL_REQUIRED=2.4.52
  26. LIBDRM_NVVIEUX_REQUIRED=2.4.33
  27. LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
  28. LIBDRM_FREEDRENO_REQUIRED=2.4.51
  29. DRI2PROTO_REQUIRED=2.6
  30. DRI3PROTO_REQUIRED=1.0
  31. PRESENTPROTO_REQUIRED=1.0
  32. LIBUDEV_REQUIRED=151
  33. GLPROTO_REQUIRED=1.4.14
  34. dnl Check for progs
  35. AC_PROG_CPP
  36. AC_PROG_CC
  37. AC_PROG_CXX
  38. AM_PROG_CC_C_O
  39. AM_PROG_AS
  40. AC_CHECK_PROGS([MAKE], [gmake make])
  41. AC_CHECK_PROGS([PYTHON2], [python2 python])
  42. AX_PYTHON_MODULE([libxml2], [needed])
  43. AC_PROG_SED
  44. AC_PROG_MKDIR_P
  45. LT_PREREQ([2.2])
  46. LT_INIT([disable-static])
  47. AX_PROG_BISON([],
  48. AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
  49. [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
  50. AX_PROG_FLEX([],
  51. AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
  52. [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
  53. AC_PATH_PROG([PERL], [perl])
  54. AC_CHECK_PROG(INDENT, indent, indent, cat)
  55. if test "x$INDENT" != "xcat"; then
  56. AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
  57. fi
  58. AC_PROG_INSTALL
  59. dnl We need a POSIX shell for parts of the build. Assume we have one
  60. dnl in most cases.
  61. case "$host_os" in
  62. solaris*)
  63. # Solaris /bin/sh is too old/non-POSIX compliant
  64. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  65. SHELL="$POSIX_SHELL"
  66. ;;
  67. esac
  68. dnl clang is mostly GCC-compatible, but its version is much lower,
  69. dnl so we have to check for it.
  70. AC_MSG_CHECKING([if compiling with clang])
  71. AC_COMPILE_IFELSE(
  72. [AC_LANG_PROGRAM([], [[
  73. #ifndef __clang__
  74. not clang
  75. #endif
  76. ]])],
  77. [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
  78. AC_MSG_RESULT([$acv_mesa_CLANG])
  79. dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
  80. dnl versions are explictly not supported.
  81. GEN_ASM_OFFSETS=no
  82. if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
  83. AC_MSG_CHECKING([whether gcc version is sufficient])
  84. major=0
  85. minor=0
  86. GCC_VERSION=`$CC -dumpversion`
  87. if test $? -eq 0; then
  88. GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
  89. GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
  90. fi
  91. if test $GCC_VERSION_MAJOR -lt 3 -o $GCC_VERSION_MAJOR -eq 3 -a $GCC_VERSION_MINOR -lt 3 ; then
  92. AC_MSG_RESULT([no])
  93. AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
  94. else
  95. AC_MSG_RESULT([yes])
  96. fi
  97. if test "x$cross_compiling" = xyes; then
  98. GEN_ASM_OFFSETS=yes
  99. fi
  100. fi
  101. AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
  102. dnl Make sure the pkg-config macros are defined
  103. m4_ifndef([PKG_PROG_PKG_CONFIG],
  104. [m4_fatal([Could not locate the pkg-config autoconf macros.
  105. These are usually located in /usr/share/aclocal/pkg.m4. If your macros
  106. are in a different location, try setting the environment variable
  107. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  108. PKG_PROG_PKG_CONFIG()
  109. dnl LIB_DIR - library basename
  110. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  111. AC_SUBST([LIB_DIR])
  112. dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
  113. _SAVE_LDFLAGS="$LDFLAGS"
  114. _SAVE_CPPFLAGS="$CPPFLAGS"
  115. dnl Compiler macros
  116. DEFINES=""
  117. AC_SUBST([DEFINES])
  118. case "$host_os" in
  119. linux*|*-gnu*|gnu*)
  120. DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
  121. ;;
  122. solaris*)
  123. DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
  124. ;;
  125. cygwin*)
  126. DEFINES="$DEFINES -DHAVE_PTHREAD"
  127. ;;
  128. esac
  129. dnl Add flags for gcc and g++
  130. if test "x$GCC" = xyes; then
  131. case "$host_os" in
  132. cygwin*)
  133. CFLAGS="$CFLAGS -Wall -std=gnu99"
  134. ;;
  135. *)
  136. CFLAGS="$CFLAGS -Wall -std=c99"
  137. ;;
  138. esac
  139. # Enable -Werror=implicit-function-declaration and
  140. # -Werror=missing-prototypes, if available, or otherwise, just
  141. # -Wmissing-prototypes. This is particularly useful to avoid
  142. # generating a loadable driver module that has undefined symbols.
  143. save_CFLAGS="$CFLAGS"
  144. AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
  145. CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
  146. CFLAGS="$CFLAGS -Werror=missing-prototypes"
  147. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  148. AC_MSG_RESULT([yes]),
  149. [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
  150. AC_MSG_RESULT([no])]);
  151. # Enable -fvisibility=hidden if using a gcc that supports it
  152. save_CFLAGS="$CFLAGS"
  153. AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
  154. VISIBILITY_CFLAGS="-fvisibility=hidden"
  155. CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
  156. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  157. [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
  158. # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
  159. CFLAGS=$save_CFLAGS
  160. # Work around aliasing bugs - developers should comment this out
  161. CFLAGS="$CFLAGS -fno-strict-aliasing"
  162. # gcc's builtin memcmp is slower than glibc's
  163. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  164. CFLAGS="$CFLAGS -fno-builtin-memcmp"
  165. fi
  166. if test "x$GXX" = xyes; then
  167. CXXFLAGS="$CXXFLAGS -Wall"
  168. # Enable -fvisibility=hidden if using a gcc that supports it
  169. save_CXXFLAGS="$CXXFLAGS"
  170. AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
  171. VISIBILITY_CXXFLAGS="-fvisibility=hidden"
  172. CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
  173. AC_LANG_PUSH([C++])
  174. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  175. [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
  176. AC_LANG_POP([C++])
  177. # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
  178. CXXFLAGS=$save_CXXFLAGS
  179. # Work around aliasing bugs - developers should comment this out
  180. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  181. # gcc's builtin memcmp is slower than glibc's
  182. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  183. CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
  184. fi
  185. dnl even if the compiler appears to support it, using visibility attributes isn't
  186. dnl going to do anything useful currently on cygwin apart from emit lots of warnings
  187. case "$host_os" in
  188. cygwin*)
  189. VISIBILITY_CFLAGS=""
  190. VISIBILITY_CXXFLAGS=""
  191. ;;
  192. esac
  193. AC_SUBST([VISIBILITY_CFLAGS])
  194. AC_SUBST([VISIBILITY_CXXFLAGS])
  195. dnl
  196. dnl Optional flags, check for compiler support
  197. dnl
  198. AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_SUPPORTED=1], [SSE41_SUPPORTED=0])
  199. AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1])
  200. dnl
  201. dnl Hacks to enable 32 or 64 bit build
  202. dnl
  203. AC_ARG_ENABLE([32-bit],
  204. [AS_HELP_STRING([--enable-32-bit],
  205. [build 32-bit libraries @<:@default=auto@:>@])],
  206. [enable_32bit="$enableval"],
  207. [enable_32bit=auto]
  208. )
  209. if test "x$enable_32bit" = xyes; then
  210. if test "x$GCC" = xyes; then
  211. CFLAGS="$CFLAGS -m32"
  212. CCASFLAGS="$CCASFLAGS -m32"
  213. fi
  214. if test "x$GXX" = xyes; then
  215. CXXFLAGS="$CXXFLAGS -m32"
  216. fi
  217. fi
  218. AC_ARG_ENABLE([64-bit],
  219. [AS_HELP_STRING([--enable-64-bit],
  220. [build 64-bit libraries @<:@default=auto@:>@])],
  221. [enable_64bit="$enableval"],
  222. [enable_64bit=auto]
  223. )
  224. if test "x$enable_64bit" = xyes; then
  225. if test "x$GCC" = xyes; then
  226. CFLAGS="$CFLAGS -m64"
  227. fi
  228. if test "x$GXX" = xyes; then
  229. CXXFLAGS="$CXXFLAGS -m64"
  230. fi
  231. fi
  232. dnl Can't have static and shared libraries, default to static if user
  233. dnl explicitly requested. If both disabled, set to static since shared
  234. dnl was explicitly requested.
  235. case "x$enable_static$enable_shared" in
  236. xyesyes )
  237. AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
  238. enable_shared=no
  239. ;;
  240. xnono )
  241. AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
  242. enable_static=yes
  243. ;;
  244. esac
  245. AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
  246. dnl
  247. dnl other compiler options
  248. dnl
  249. AC_ARG_ENABLE([debug],
  250. [AS_HELP_STRING([--enable-debug],
  251. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  252. [enable_debug="$enableval"],
  253. [enable_debug=no]
  254. )
  255. if test "x$enable_debug" = xyes; then
  256. DEFINES="$DEFINES -DDEBUG"
  257. if test "x$GCC" = xyes; then
  258. CFLAGS="$CFLAGS -g -O0"
  259. fi
  260. if test "x$GXX" = xyes; then
  261. CXXFLAGS="$CXXFLAGS -g -O0"
  262. fi
  263. fi
  264. dnl
  265. dnl library names
  266. dnl
  267. LIB_PREFIX_GLOB='lib'
  268. LIB_VERSION_SEPARATOR='.'
  269. if test "$enable_static" = yes; then
  270. LIB_EXTENSION='a'
  271. else
  272. case "$host_os" in
  273. darwin* )
  274. LIB_EXTENSION='dylib' ;;
  275. cygwin* )
  276. dnl prefix can be 'cyg' or 'lib'
  277. LIB_PREFIX_GLOB='???'
  278. LIB_VERSION_SEPARATOR='-'
  279. LIB_EXTENSION='dll' ;;
  280. aix* )
  281. LIB_EXTENSION='a' ;;
  282. * )
  283. LIB_EXTENSION='so' ;;
  284. esac
  285. fi
  286. AC_ARG_WITH([gl-lib-name],
  287. [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
  288. [specify GL library name @<:@default=GL@:>@])],
  289. [GL_LIB=$withval],
  290. [GL_LIB=GL])
  291. AC_ARG_WITH([osmesa-lib-name],
  292. [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
  293. [specify OSMesa library name @<:@default=OSMesa@:>@])],
  294. [OSMESA_LIB=$withval],
  295. [OSMESA_LIB=OSMesa])
  296. AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
  297. AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
  298. dnl
  299. dnl Mangled Mesa support
  300. dnl
  301. AC_ARG_ENABLE([mangling],
  302. [AS_HELP_STRING([--enable-mangling],
  303. [enable mangled symbols and library name @<:@default=disabled@:>@])],
  304. [enable_mangling="${enableval}"],
  305. [enable_mangling=no]
  306. )
  307. if test "x${enable_mangling}" = "xyes" ; then
  308. DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
  309. GL_LIB="Mangled${GL_LIB}"
  310. OSMESA_LIB="Mangled${OSMESA_LIB}"
  311. fi
  312. AC_SUBST([GL_LIB])
  313. AC_SUBST([OSMESA_LIB])
  314. dnl
  315. dnl potentially-infringing-but-nobody-knows-for-sure stuff
  316. dnl
  317. AC_ARG_ENABLE([texture-float],
  318. [AS_HELP_STRING([--enable-texture-float],
  319. [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
  320. [enable_texture_float="$enableval"],
  321. [enable_texture_float=no]
  322. )
  323. if test "x$enable_texture_float" = xyes; then
  324. AC_MSG_WARN([Floating-point textures enabled.])
  325. AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
  326. DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
  327. fi
  328. GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
  329. OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
  330. EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
  331. GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
  332. GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
  333. VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
  334. GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
  335. GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  336. EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  337. EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  338. GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  339. GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  340. VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  341. GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  342. AC_SUBST([GL_LIB_NAME])
  343. AC_SUBST([OSMESA_LIB_NAME])
  344. AC_SUBST([EGL_LIB_NAME])
  345. AC_SUBST([GLESv1_CM_LIB_NAME])
  346. AC_SUBST([GLESv2_LIB_NAME])
  347. AC_SUBST([VG_LIB_NAME])
  348. AC_SUBST([GLAPI_LIB_NAME])
  349. AC_SUBST([GL_LIB_GLOB])
  350. AC_SUBST([EGL_LIB_GLOB])
  351. AC_SUBST([GLESv1_CM_LIB_GLOB])
  352. AC_SUBST([GLESv2_LIB_GLOB])
  353. AC_SUBST([VG_LIB_GLOB])
  354. AC_SUBST([GLAPI_LIB_GLOB])
  355. dnl
  356. dnl Arch/platform-specific settings
  357. dnl
  358. AC_ARG_ENABLE([asm],
  359. [AS_HELP_STRING([--disable-asm],
  360. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  361. [enable_asm="$enableval"],
  362. [enable_asm=yes]
  363. )
  364. asm_arch=""
  365. AC_MSG_CHECKING([whether to enable assembly])
  366. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  367. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  368. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  369. case "$host_cpu" in
  370. i?86 | x86_64 | amd64)
  371. enable_asm=no
  372. AC_MSG_RESULT([no, cross compiling])
  373. ;;
  374. esac
  375. fi
  376. # check for supported arches
  377. if test "x$enable_asm" = xyes; then
  378. case "$host_cpu" in
  379. i?86)
  380. case "$host_os" in
  381. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
  382. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  383. ;;
  384. gnu*)
  385. asm_arch=x86
  386. ;;
  387. esac
  388. ;;
  389. x86_64|amd64)
  390. case "$host_os" in
  391. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
  392. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  393. ;;
  394. esac
  395. ;;
  396. sparc*)
  397. case "$host_os" in
  398. linux*)
  399. asm_arch=sparc
  400. ;;
  401. esac
  402. ;;
  403. esac
  404. case "$asm_arch" in
  405. x86)
  406. DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  407. AC_MSG_RESULT([yes, x86])
  408. ;;
  409. x86_64|amd64)
  410. DEFINES="$DEFINES -DUSE_X86_64_ASM"
  411. AC_MSG_RESULT([yes, x86_64])
  412. ;;
  413. sparc)
  414. DEFINES="$DEFINES -DUSE_SPARC_ASM"
  415. AC_MSG_RESULT([yes, sparc])
  416. ;;
  417. *)
  418. AC_MSG_RESULT([no, platform not supported])
  419. ;;
  420. esac
  421. fi
  422. dnl Check to see if dlopen is in default libraries (like Solaris, which
  423. dnl has it in libc), or if libdl is needed to get it.
  424. AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
  425. [AC_CHECK_LIB([dl], [dlopen],
  426. [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
  427. AC_SUBST([DLOPEN_LIBS])
  428. case "$host_os" in
  429. darwin*|mingw*)
  430. ;;
  431. *)
  432. AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
  433. [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
  434. [AC_MSG_ERROR([Couldn't find clock_gettime])])])
  435. AC_SUBST([CLOCK_LIB])
  436. ;;
  437. esac
  438. dnl See if posix_memalign is available
  439. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  440. dnl Check for pthreads
  441. AX_PTHREAD
  442. dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
  443. dnl to -pthread, which causes problems if we need -lpthread to appear in
  444. dnl pkgconfig files.
  445. test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
  446. dnl SELinux awareness.
  447. AC_ARG_ENABLE([selinux],
  448. [AS_HELP_STRING([--enable-selinux],
  449. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  450. [MESA_SELINUX="$enableval"],
  451. [MESA_SELINUX=no])
  452. if test "x$enable_selinux" = "xyes"; then
  453. AC_CHECK_HEADER([selinux/selinux.h],[],
  454. [AC_MSG_ERROR([SELinux headers not found])])
  455. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  456. [AC_MSG_ERROR([SELinux library not found])])
  457. SELINUX_LIBS="-lselinux"
  458. DEFINES="$DEFINES -DMESA_SELINUX"
  459. fi
  460. AC_SUBST([SELINUX_LIBS])
  461. dnl Options for APIs
  462. AC_ARG_ENABLE([opengl],
  463. [AS_HELP_STRING([--disable-opengl],
  464. [disable support for standard OpenGL API @<:@default=no@:>@])],
  465. [enable_opengl="$enableval"],
  466. [enable_opengl=yes])
  467. AC_ARG_ENABLE([gles1],
  468. [AS_HELP_STRING([--enable-gles1],
  469. [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
  470. [enable_gles1="$enableval"],
  471. [enable_gles1=no])
  472. AC_ARG_ENABLE([gles2],
  473. [AS_HELP_STRING([--enable-gles2],
  474. [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
  475. [enable_gles2="$enableval"],
  476. [enable_gles2=no])
  477. AC_ARG_ENABLE([openvg],
  478. [AS_HELP_STRING([--enable-openvg],
  479. [enable support for OpenVG API @<:@default=no@:>@])],
  480. [enable_openvg="$enableval"],
  481. [enable_openvg=no])
  482. AC_ARG_ENABLE([dri],
  483. [AS_HELP_STRING([--enable-dri],
  484. [enable DRI modules @<:@default=enabled@:>@])],
  485. [enable_dri="$enableval"],
  486. [enable_dri=yes])
  487. AC_ARG_ENABLE([dri3],
  488. [AS_HELP_STRING([--enable-dri3],
  489. [enable DRI3 @<:@default=enabled@:>@])],
  490. [enable_dri3="$enableval"],
  491. [enable_dri3=yes])
  492. AC_ARG_ENABLE([glx],
  493. [AS_HELP_STRING([--enable-glx],
  494. [enable GLX library @<:@default=enabled@:>@])],
  495. [enable_glx="$enableval"],
  496. [enable_glx=yes])
  497. AC_ARG_ENABLE([osmesa],
  498. [AS_HELP_STRING([--enable-osmesa],
  499. [enable OSMesa library @<:@default=disabled@:>@])],
  500. [enable_osmesa="$enableval"],
  501. [enable_osmesa=no])
  502. AC_ARG_ENABLE([gallium-osmesa],
  503. [AS_HELP_STRING([--enable-gallium-osmesa],
  504. [enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
  505. [enable_gallium_osmesa="$enableval"],
  506. [enable_gallium_osmesa=no])
  507. AC_ARG_ENABLE([egl],
  508. [AS_HELP_STRING([--disable-egl],
  509. [disable EGL library @<:@default=enabled@:>@])],
  510. [enable_egl="$enableval"],
  511. [enable_egl=yes])
  512. AC_ARG_ENABLE([xa],
  513. [AS_HELP_STRING([--enable-xa],
  514. [enable build of the XA X Acceleration API @<:@default=no@:>@])],
  515. [enable_xa="$enableval"],
  516. [enable_xa=no])
  517. AC_ARG_ENABLE([gbm],
  518. [AS_HELP_STRING([--enable-gbm],
  519. [enable gbm library @<:@default=auto@:>@])],
  520. [enable_gbm="$enableval"],
  521. [enable_gbm=auto])
  522. AC_ARG_ENABLE([xvmc],
  523. [AS_HELP_STRING([--enable-xvmc],
  524. [enable xvmc library @<:@default=auto@:>@])],
  525. [enable_xvmc="$enableval"],
  526. [enable_xvmc=no])
  527. AC_ARG_ENABLE([vdpau],
  528. [AS_HELP_STRING([--enable-vdpau],
  529. [enable vdpau library @<:@default=auto@:>@])],
  530. [enable_vdpau="$enableval"],
  531. [enable_vdpau=auto])
  532. AC_ARG_ENABLE([omx],
  533. [AS_HELP_STRING([--enable-omx],
  534. [enable OpenMAX library @<:@default=no@:>@])],
  535. [enable_omx="$enableval"],
  536. [enable_omx=no])
  537. AC_ARG_ENABLE([opencl],
  538. [AS_HELP_STRING([--enable-opencl],
  539. [enable OpenCL library NOTE: Enabling this option will also enable
  540. --with-llvm-shared-libs
  541. @<:@default=no@:>@])],
  542. [],
  543. [enable_opencl=no])
  544. AC_ARG_ENABLE([opencl_icd],
  545. [AS_HELP_STRING([--enable-opencl-icd],
  546. [Build an OpenCL ICD library to be loaded by an ICD implementation
  547. @<:@default=no@:>@])],
  548. [enable_opencl_icd="$enableval"],
  549. [enable_opencl_icd=no])
  550. AC_ARG_ENABLE([xlib-glx],
  551. [AS_HELP_STRING([--enable-xlib-glx],
  552. [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
  553. [enable_xlib_glx="$enableval"],
  554. [enable_xlib_glx=no])
  555. AC_ARG_ENABLE([gallium-egl],
  556. [AS_HELP_STRING([--enable-gallium-egl],
  557. [enable optional EGL state tracker (not required
  558. for EGL support in Gallium with OpenGL and OpenGL ES)
  559. @<:@default=disable@:>@])],
  560. [enable_gallium_egl="$enableval"],
  561. [enable_gallium_egl=no])
  562. AC_ARG_ENABLE([gallium-gbm],
  563. [AS_HELP_STRING([--enable-gallium-gbm],
  564. [enable optional gbm state tracker (not required for
  565. gbm support in Gallium)
  566. @<:@default=auto@:>@])],
  567. [enable_gallium_gbm="$enableval"],
  568. [enable_gallium_gbm=auto])
  569. AC_ARG_ENABLE([r600-llvm-compiler],
  570. [AS_HELP_STRING([--enable-r600-llvm-compiler],
  571. [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])],
  572. [enable_r600_llvm="$enableval"],
  573. [enable_r600_llvm=no])
  574. AC_ARG_ENABLE([gallium-tests],
  575. [AS_HELP_STRING([--enable-gallium-tests],
  576. [Enable optional Gallium tests) @<:@default=disable@:>@])],
  577. [enable_gallium_tests="$enableval"],
  578. [enable_gallium_tests=no])
  579. # Option for Gallium drivers
  580. # Keep this in sync with the --with-gallium-drivers help string default value
  581. GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
  582. AC_ARG_WITH([gallium-drivers],
  583. [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
  584. [comma delimited Gallium drivers list, e.g.
  585. "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast"
  586. @<:@default=r300,r600,svga,swrast@:>@])],
  587. [with_gallium_drivers="$withval"],
  588. [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
  589. # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
  590. # here so that the script doesn't choke on an unknown driver name later.
  591. case "$with_gallium_drivers" in
  592. yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
  593. no) with_gallium_drivers='' ;;
  594. esac
  595. if test "x$enable_opengl" = xno -a \
  596. "x$enable_gles1" = xno -a \
  597. "x$enable_gles2" = xno -a \
  598. "x$enable_openvg" = xno -a \
  599. "x$enable_xa" = xno -a \
  600. "x$enable_xvmc" = xno -a \
  601. "x$enable_vdpau" = xno -a \
  602. "x$enable_omx" = xno -a \
  603. "x$enable_opencl" = xno; then
  604. AC_MSG_ERROR([at least one API should be enabled])
  605. fi
  606. # Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
  607. if test "x$enable_opengl" = xno -a \
  608. "x$enable_gles1" = xyes; then
  609. AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
  610. fi
  611. if test "x$enable_opengl" = xno -a \
  612. "x$enable_gles2" = xyes; then
  613. AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
  614. fi
  615. AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
  616. AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
  617. AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
  618. AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
  619. "x$enable_gles1" = xyes -o \
  620. "x$enable_gles2" = xyes)
  621. if test "x$enable_glx" = xno; then
  622. AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
  623. enable_xlib_glx=no
  624. fi
  625. if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
  626. AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
  627. fi
  628. if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
  629. AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
  630. fi
  631. # Disable GLX if OpenGL is not enabled
  632. if test "x$enable_glx$enable_opengl" = xyesno; then
  633. AC_MSG_WARN([OpenGL not enabled, disabling GLX])
  634. enable_glx=no
  635. fi
  636. # Disable GLX if DRI and Xlib-GLX are not enabled
  637. if test "x$enable_glx" = xyes -a \
  638. "x$enable_dri" = xno -a \
  639. "x$enable_xlib_glx" = xno; then
  640. AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
  641. enable_glx=no
  642. fi
  643. AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \
  644. "x$enable_dri" = xyes)
  645. AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
  646. AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes)
  647. AC_ARG_ENABLE([shared-glapi],
  648. [AS_HELP_STRING([--enable-shared-glapi],
  649. [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
  650. [enable_shared_glapi="$enableval"],
  651. [enable_shared_glapi="$enable_dri"])
  652. # Shared GLAPI is only useful for DRI
  653. if test "x$enable_dri" = xno; then
  654. AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
  655. enable_shared_glapi=no
  656. fi
  657. AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
  658. dnl
  659. dnl Driver specific build directories
  660. dnl
  661. GALLIUM_TARGET_DIRS=""
  662. GALLIUM_WINSYS_DIRS="sw"
  663. GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
  664. GALLIUM_STATE_TRACKERS_DIRS=""
  665. case "x$enable_glx$enable_xlib_glx" in
  666. xyesyes)
  667. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  668. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
  669. GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
  670. NEED_WINSYS_XLIB="yes"
  671. ;;
  672. esac
  673. if test "x$enable_dri" = xyes; then
  674. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
  675. GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
  676. fi
  677. if test "x$enable_gallium_osmesa" = xyes; then
  678. if test -z "$with_gallium_drivers"; then
  679. AC_MSG_ERROR([Cannot enable gallium_osmesa without Gallium])
  680. fi
  681. if test "x$enable_osmesa" = xyes; then
  682. AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
  683. fi
  684. GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS"
  685. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
  686. fi
  687. AC_SUBST([MESA_LLVM])
  688. # Check for libdrm
  689. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
  690. [have_libdrm=yes], [have_libdrm=no])
  691. if test "x$have_libdrm" = xyes; then
  692. DEFINES="$DEFINES -DHAVE_LIBDRM"
  693. fi
  694. PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED],
  695. have_libudev=yes, have_libudev=no)
  696. if test "x$enable_dri" = xyes; then
  697. # DRI must be shared, I think
  698. if test "$enable_static" = yes; then
  699. AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
  700. fi
  701. # not a hard requirement as swrast does not depend on it
  702. if test "x$have_libdrm" = xyes; then
  703. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  704. fi
  705. fi
  706. dnl Direct rendering or just indirect rendering
  707. case "$host_os" in
  708. gnu*)
  709. dnl Disable by default on GNU/Hurd
  710. driglx_direct_default="no"
  711. ;;
  712. cygwin*)
  713. dnl Disable by default on cygwin
  714. driglx_direct_default="no"
  715. ;;
  716. *)
  717. driglx_direct_default="yes"
  718. ;;
  719. esac
  720. AC_ARG_ENABLE([driglx-direct],
  721. [AS_HELP_STRING([--disable-driglx-direct],
  722. [disable direct rendering in GLX and EGL for DRI \
  723. @<:@default=auto@:>@])],
  724. [driglx_direct="$enableval"],
  725. [driglx_direct="$driglx_direct_default"])
  726. dnl
  727. dnl libGL configuration per driver
  728. dnl
  729. case "x$enable_glx$enable_xlib_glx" in
  730. xyesyes)
  731. # Xlib-based GLX
  732. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  733. GL_PC_REQ_PRIV="x11 xext"
  734. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  735. GL_LIB_DEPS="$XLIBGL_LIBS"
  736. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  737. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
  738. ;;
  739. xyesno)
  740. # DRI-based GLX
  741. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  742. if test x"$driglx_direct" = xyes; then
  743. if test "x$have_libdrm" != xyes; then
  744. AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
  745. fi
  746. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  747. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
  748. if test x"$enable_dri3" = xyes; then
  749. if test x"$have_libudev" != xyes; then
  750. AC_MSG_ERROR([DRI3 requires libudev >= $LIBUDEV_REQUIRED])
  751. fi
  752. PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED])
  753. PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED])
  754. fi
  755. fi
  756. # find the DRI deps for libGL
  757. dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
  758. if test x"$enable_dri3" = xyes; then
  759. dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= 1.1"
  760. fi
  761. # add xf86vidmode if available
  762. PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
  763. if test "$HAVE_XF86VIDMODE" = yes ; then
  764. dri_modules="$dri_modules xxf86vm"
  765. fi
  766. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  767. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  768. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  769. GL_LIB_DEPS="$DRIGL_LIBS"
  770. if test x"$enable_dri3$have_libudev" = xyesyes; then
  771. X11_INCLUDES="$X11_INCLUDES $LIBUDEV_CFLAGS"
  772. GL_LIB_DEPS="$GL_LIB_DEPS"
  773. fi
  774. # need DRM libs, $PTHREAD_LIBS, etc.
  775. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  776. GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  777. ;;
  778. esac
  779. if test "$have_libudev" = yes; then
  780. DEFINES="$DEFINES -DHAVE_LIBUDEV"
  781. fi
  782. # This is outside the case (above) so that it is invoked even for non-GLX
  783. # builds.
  784. AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
  785. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  786. GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  787. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  788. GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  789. AC_SUBST([X11_INCLUDES])
  790. AC_SUBST([GL_LIB_DEPS])
  791. AC_SUBST([GL_PC_REQ_PRIV])
  792. AC_SUBST([GL_PC_LIB_PRIV])
  793. AC_SUBST([GL_PC_CFLAGS])
  794. AC_SUBST([DRI_PC_REQ_PRIV])
  795. AC_SUBST([GLESv1_CM_LIB_DEPS])
  796. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  797. AC_SUBST([GLESv2_LIB_DEPS])
  798. AC_SUBST([GLESv2_PC_LIB_PRIV])
  799. AC_SUBST([HAVE_XF86VIDMODE])
  800. dnl
  801. dnl More GLX setup
  802. dnl
  803. case "x$enable_glx$enable_xlib_glx" in
  804. xyesyes)
  805. DEFINES="$DEFINES -DUSE_XSHM"
  806. ;;
  807. xyesno)
  808. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  809. if test "x$driglx_direct" = xyes; then
  810. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  811. fi
  812. ;;
  813. esac
  814. dnl
  815. dnl TLS detection
  816. dnl
  817. AC_ARG_ENABLE([glx-tls],
  818. [AS_HELP_STRING([--enable-glx-tls],
  819. [enable TLS support in GLX @<:@default=disabled@:>@])],
  820. [GLX_USE_TLS="$enableval"],
  821. [GLX_USE_TLS=no])
  822. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  823. AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
  824. [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
  825. dnl
  826. dnl More DRI setup
  827. dnl
  828. dnl Directory for DRI drivers
  829. AC_ARG_WITH([dri-driverdir],
  830. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  831. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  832. [DRI_DRIVER_INSTALL_DIR="$withval"],
  833. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  834. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  835. dnl Extra search path for DRI drivers
  836. AC_ARG_WITH([dri-searchpath],
  837. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  838. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  839. [DRI_DRIVER_SEARCH_DIR="$withval"],
  840. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  841. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  842. dnl Which drivers to build - default is chosen by platform
  843. AC_ARG_WITH([dri-drivers],
  844. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  845. [comma delimited DRI drivers list, e.g.
  846. "swrast,i965,radeon" @<:@default=auto@:>@])],
  847. [with_dri_drivers="$withval"],
  848. [with_dri_drivers=yes])
  849. if test "x$with_dri_drivers" = x; then
  850. with_dri_drivers=no
  851. fi
  852. dnl If $with_dri_drivers is yes, directories will be added through
  853. dnl platform checks
  854. DRI_DIRS=""
  855. case "$with_dri_drivers" in
  856. no) ;;
  857. yes)
  858. # classic DRI drivers
  859. if test "x$enable_opengl" = xyes; then
  860. DRI_DIRS="yes"
  861. fi
  862. ;;
  863. *)
  864. # verify the requested driver directories exist
  865. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  866. for driver in $dri_drivers; do
  867. test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
  868. AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
  869. done
  870. DRI_DIRS="$dri_drivers"
  871. if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
  872. AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
  873. fi
  874. ;;
  875. esac
  876. dnl Set DRI_DIRS, DEFINES and LIB_DEPS
  877. if test "x$enable_dri" = xyes; then
  878. # Platform specific settings and drivers to build
  879. case "$host_os" in
  880. linux*)
  881. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  882. DEFINES="$DEFINES -DHAVE_ALIAS"
  883. if test "x$enable_dri3" = xyes; then
  884. DEFINES="$DEFINES -DHAVE_DRI3"
  885. fi
  886. case "$host_cpu" in
  887. x86_64|amd64)
  888. if test "x$DRI_DIRS" = "xyes"; then
  889. DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
  890. fi
  891. ;;
  892. powerpc*)
  893. # Build only the drivers for cards that exist on PowerPC.
  894. if test "x$DRI_DIRS" = "xyes"; then
  895. DRI_DIRS="r200 radeon swrast"
  896. fi
  897. ;;
  898. sparc*)
  899. # Build only the drivers for cards that exist on sparc
  900. if test "x$DRI_DIRS" = "xyes"; then
  901. DRI_DIRS="r200 radeon swrast"
  902. fi
  903. ;;
  904. esac
  905. ;;
  906. *freebsd* | dragonfly* | *netbsd* | openbsd*)
  907. DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
  908. DEFINES="$DEFINES -DHAVE_ALIAS"
  909. if test "x$DRI_DIRS" = "xyes"; then
  910. DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
  911. fi
  912. ;;
  913. gnu*)
  914. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  915. DEFINES="$DEFINES -DHAVE_ALIAS"
  916. ;;
  917. solaris*)
  918. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  919. ;;
  920. cygwin*)
  921. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  922. if test "x$DRI_DIRS" = "xyes"; then
  923. DRI_DIRS="swrast"
  924. fi
  925. ;;
  926. esac
  927. # default drivers
  928. if test "x$DRI_DIRS" = "xyes"; then
  929. DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
  930. fi
  931. DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
  932. # Check for expat
  933. PKG_CHECK_EXISTS([EXPAT], [have_expat=yes], [have_expat=no])
  934. if test "x$have_expat" = "xyes"; then
  935. PKG_CHECK_MODULES([EXPAT], [expat], [],
  936. AC_MSG_ERROR([Expat required for DRI.]))
  937. else
  938. # expat version 2.0 and earlier do not provide expat.pc
  939. EXPAT_LIBS=-lexpat
  940. fi
  941. # If we are building any DRI driver other than swrast.
  942. if test -n "$DRI_DIRS"; then
  943. if test x"$DRI_DIRS" != xswrast; then
  944. # ... libdrm is required
  945. if test "x$have_libdrm" != xyes; then
  946. AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
  947. fi
  948. DRICOMMON_NEED_LIBDRM=yes
  949. else
  950. DRICOMMON_NEED_LIBDRM=no
  951. fi
  952. fi
  953. # put all the necessary libs together
  954. DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  955. GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
  956. fi
  957. AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
  958. AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
  959. "x$enable_osmesa" = xyes -o \
  960. -n "$DRI_DIRS")
  961. AC_SUBST([DRI_LIB_DEPS])
  962. AC_SUBST([GALLIUM_DRI_LIB_DEPS])
  963. case $DRI_DIRS in
  964. *i915*|*i965*)
  965. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  966. for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
  967. case $d in
  968. i915)
  969. HAVE_I915_DRI=yes;
  970. ;;
  971. i965)
  972. HAVE_I965_DRI=yes;
  973. ;;
  974. esac
  975. done
  976. ;;
  977. esac
  978. case $DRI_DIRS in
  979. *nouveau*)
  980. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
  981. HAVE_NOUVEAU_DRI=yes;
  982. ;;
  983. esac
  984. case $DRI_DIRS in
  985. *radeon*|*r200*)
  986. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  987. for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
  988. case $d in
  989. radeon)
  990. HAVE_RADEON_DRI=yes;
  991. ;;
  992. r200)
  993. HAVE_R200_DRI=yes;
  994. ;;
  995. esac
  996. done
  997. ;;
  998. esac
  999. case $DRI_DIRS in
  1000. *swrast*)
  1001. HAVE_SWRAST_DRI=yes;
  1002. ;;
  1003. esac
  1004. dnl
  1005. dnl OSMesa configuration
  1006. dnl
  1007. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  1008. AC_ARG_WITH([osmesa-bits],
  1009. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  1010. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  1011. [osmesa_bits="$withval"],
  1012. [osmesa_bits=8])
  1013. if test "x$osmesa_bits" != x8; then
  1014. if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
  1015. AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
  1016. osmesa_bits=8
  1017. fi
  1018. fi
  1019. case "x$osmesa_bits" in
  1020. x8)
  1021. OSMESA_LIB="${OSMESA_LIB}"
  1022. ;;
  1023. x16|x32)
  1024. OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
  1025. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  1026. ;;
  1027. *)
  1028. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  1029. ;;
  1030. esac
  1031. if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
  1032. # only link libraries with osmesa if shared
  1033. if test "$enable_static" = no; then
  1034. OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1035. else
  1036. OSMESA_LIB_DEPS=""
  1037. fi
  1038. OSMESA_MESA_DEPS=""
  1039. OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1040. fi
  1041. AC_SUBST([OSMESA_LIB_DEPS])
  1042. AC_SUBST([OSMESA_MESA_DEPS])
  1043. AC_SUBST([OSMESA_PC_REQ])
  1044. AC_SUBST([OSMESA_PC_LIB_PRIV])
  1045. dnl
  1046. dnl gbm configuration
  1047. dnl
  1048. if test "x$enable_gbm" = xauto; then
  1049. case "$with_egl_platforms" in
  1050. *drm*)
  1051. enable_gbm=yes ;;
  1052. *)
  1053. enable_gbm=no ;;
  1054. esac
  1055. fi
  1056. if test "x$enable_gbm" = xyes; then
  1057. if test x"$have_libudev" != xyes; then
  1058. AC_MSG_ERROR([gbm needs udev])
  1059. fi
  1060. if test "x$enable_dri" = xyes; then
  1061. GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
  1062. if test "x$enable_shared_glapi" = xno; then
  1063. AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
  1064. fi
  1065. fi
  1066. fi
  1067. AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
  1068. GBM_PC_REQ_PRIV="libudev"
  1069. GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
  1070. AC_SUBST([GBM_PC_REQ_PRIV])
  1071. AC_SUBST([GBM_PC_LIB_PRIV])
  1072. dnl
  1073. dnl EGL configuration
  1074. dnl
  1075. EGL_CLIENT_APIS=""
  1076. if test "x$enable_egl" = xyes; then
  1077. EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
  1078. AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
  1079. if test "$enable_static" != yes; then
  1080. if test "x$enable_dri" = xyes; then
  1081. HAVE_EGL_DRIVER_DRI2=1
  1082. fi
  1083. fi
  1084. fi
  1085. AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
  1086. AC_SUBST([EGL_LIB_DEPS])
  1087. dnl
  1088. dnl EGL Gallium configuration
  1089. dnl
  1090. if test "x$enable_gallium_egl" = xyes; then
  1091. if test "x$with_gallium_drivers" = x; then
  1092. AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
  1093. fi
  1094. if test "x$enable_egl" = xno; then
  1095. AC_MSG_ERROR([cannot enable egl_gallium without EGL])
  1096. fi
  1097. if test "x$have_libdrm" != xyes; then
  1098. AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
  1099. fi
  1100. GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
  1101. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
  1102. fi
  1103. AM_CONDITIONAL(HAVE_GALLIUM_EGL, test "x$enable_gallium_egl" = xyes)
  1104. dnl
  1105. dnl gbm Gallium configuration
  1106. dnl
  1107. if test "x$enable_gallium_gbm" = xauto; then
  1108. case "$enable_gbm$enable_gallium_egl$enable_dri$with_egl_platforms" in
  1109. yesyesyes*drm*)
  1110. enable_gallium_gbm=yes ;;
  1111. *)
  1112. enable_gallium_gbm=no ;;
  1113. esac
  1114. fi
  1115. if test "x$enable_gallium_gbm" = xyes; then
  1116. if test "x$with_gallium_drivers" = x; then
  1117. AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
  1118. fi
  1119. if test "x$enable_gbm" = xno; then
  1120. AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
  1121. fi
  1122. # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
  1123. if test "x$enable_dri" = xno; then
  1124. AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
  1125. fi
  1126. GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
  1127. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
  1128. enable_gallium_loader=yes
  1129. fi
  1130. AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes)
  1131. dnl
  1132. dnl XA configuration
  1133. dnl
  1134. if test "x$enable_xa" = xyes; then
  1135. GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
  1136. fi
  1137. AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
  1138. dnl
  1139. dnl OpenVG configuration
  1140. dnl
  1141. VG_LIB_DEPS=""
  1142. if test "x$enable_openvg" = xyes; then
  1143. if test "x$enable_egl" = xno; then
  1144. AC_MSG_ERROR([cannot enable OpenVG without EGL])
  1145. fi
  1146. if test "x$with_gallium_drivers" = x; then
  1147. AC_MSG_ERROR([cannot enable OpenVG without Gallium])
  1148. fi
  1149. if test "x$enable_gallium_egl" = xno; then
  1150. AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
  1151. fi
  1152. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
  1153. VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
  1154. GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
  1155. VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
  1156. AC_SUBST([VG_PC_LIB_PRIV])
  1157. fi
  1158. AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
  1159. dnl
  1160. dnl Gallium G3DVL configuration
  1161. dnl
  1162. if test -n "$with_gallium_drivers"; then
  1163. if test "x$enable_xvmc" = xauto; then
  1164. PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
  1165. fi
  1166. if test "x$enable_vdpau" = xauto; then
  1167. PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
  1168. fi
  1169. if test "x$enable_omx" = xauto; then
  1170. PKG_CHECK_EXISTS([libomxil-bellagio], [enable_omx=yes], [enable_omx=no])
  1171. fi
  1172. fi
  1173. if test "x$enable_xvmc" = xyes; then
  1174. PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8])
  1175. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
  1176. fi
  1177. AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
  1178. if test "x$enable_vdpau" = xyes; then
  1179. PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8])
  1180. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
  1181. fi
  1182. AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
  1183. if test "x$enable_omx" = xyes; then
  1184. PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= 0.0 x11-xcb xcb-dri2 >= 1.8])
  1185. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS omx"
  1186. fi
  1187. AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
  1188. dnl
  1189. dnl OpenCL configuration
  1190. dnl
  1191. AC_ARG_WITH([libclc-path],
  1192. [AS_HELP_STRING([--with-libclc-path],
  1193. [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
  1194. [LIBCLC_PATH="$withval"],
  1195. [LIBCLC_PATH=""])
  1196. if test "x$LIBCLC_PATH" != x; then
  1197. AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
  1198. Please review the updated build instructions for clover:
  1199. http://dri.freedesktop.org/wiki/GalliumCompute])
  1200. fi
  1201. AC_ARG_WITH([clang-libdir],
  1202. [AS_HELP_STRING([--with-clang-libdir],
  1203. [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
  1204. [CLANG_LIBDIR="$withval"],
  1205. [CLANG_LIBDIR=""])
  1206. PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
  1207. if test "x$enable_opencl" = xyes; then
  1208. if test "x$with_gallium_drivers" = x; then
  1209. AC_MSG_ERROR([cannot enable OpenCL without Gallium])
  1210. fi
  1211. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
  1212. AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
  1213. fi
  1214. if test "x$have_libclc" = xno; then
  1215. AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
  1216. Make sure the directory containing libclc.pc is specified in your
  1217. PKG_CONFIG_PATH environment variable.
  1218. By default libclc.pc is installed to /usr/local/share/pkgconfig/])
  1219. else
  1220. LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
  1221. LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
  1222. AC_SUBST([LIBCLC_INCLUDEDIR])
  1223. AC_SUBST([LIBCLC_LIBEXECDIR])
  1224. fi
  1225. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
  1226. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
  1227. enable_gallium_loader=yes
  1228. if test "x$enable_opencl_icd" = xyes; then
  1229. OPENCL_LIBNAME="MesaOpenCL"
  1230. else
  1231. OPENCL_LIBNAME="OpenCL"
  1232. fi
  1233. fi
  1234. AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
  1235. AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
  1236. AC_SUBST([OPENCL_LIBNAME])
  1237. dnl
  1238. dnl Gallium configuration
  1239. dnl
  1240. AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
  1241. AC_SUBST([LLVM_BINDIR])
  1242. AC_SUBST([LLVM_CFLAGS])
  1243. AC_SUBST([LLVM_CPPFLAGS])
  1244. AC_SUBST([LLVM_CXXFLAGS])
  1245. AC_SUBST([LLVM_LIBDIR])
  1246. AC_SUBST([LLVM_LIBS])
  1247. AC_SUBST([LLVM_LDFLAGS])
  1248. AC_SUBST([LLVM_INCLUDEDIR])
  1249. AC_SUBST([LLVM_VERSION])
  1250. AC_SUBST([CLANG_RESOURCE_DIR])
  1251. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1252. x*yes*)
  1253. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
  1254. ;;
  1255. esac
  1256. AC_SUBST([VG_LIB_DEPS])
  1257. AC_SUBST([EGL_CLIENT_APIS])
  1258. dnl
  1259. dnl EGL Platforms configuration
  1260. dnl
  1261. AC_ARG_WITH([egl-platforms],
  1262. [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
  1263. [comma delimited native platforms libEGL supports, e.g.
  1264. "x11,drm" @<:@default=auto@:>@])],
  1265. [with_egl_platforms="$withval"],
  1266. [if test "x$enable_egl" = xyes; then
  1267. with_egl_platforms="x11"
  1268. else
  1269. with_egl_platforms=""
  1270. fi])
  1271. if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
  1272. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1273. fi
  1274. # Do per-EGL platform setups and checks
  1275. egl_platforms=`IFS=', '; echo $with_egl_platforms`
  1276. for plat in $egl_platforms; do
  1277. case "$plat" in
  1278. wayland)
  1279. PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.2.0 wayland-server >= 1.2.0])
  1280. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
  1281. WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
  1282. AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
  1283. [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
  1284. ;;
  1285. x11)
  1286. PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= 1.8 xcb-xfixes])
  1287. ;;
  1288. drm)
  1289. test "x$enable_gbm" = "xno" &&
  1290. AC_MSG_ERROR([EGL platform drm needs gbm])
  1291. test "x$have_libdrm" != xyes &&
  1292. AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
  1293. ;;
  1294. android|fbdev|gdi|null)
  1295. ;;
  1296. *)
  1297. AC_MSG_ERROR([EGL platform '$plat' does not exist])
  1298. ;;
  1299. esac
  1300. case "$plat$have_libudev" in
  1301. waylandno|drmno)
  1302. AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
  1303. esac
  1304. done
  1305. # libEGL wants to default to the first platform specified in
  1306. # ./configure. parse that here.
  1307. if test "x$egl_platforms" != "x"; then
  1308. FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
  1309. EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
  1310. else
  1311. EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
  1312. fi
  1313. if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
  1314. NEED_WINSYS_XLIB=yes
  1315. fi
  1316. AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
  1317. AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
  1318. AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
  1319. AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
  1320. AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
  1321. AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
  1322. AC_SUBST([EGL_NATIVE_PLATFORM])
  1323. AC_SUBST([EGL_CFLAGS])
  1324. # If we don't have the X11 platform, set this define so we don't try to include
  1325. # the X11 headers.
  1326. if ! echo "$egl_platforms" | grep -q 'x11'; then
  1327. DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
  1328. GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
  1329. fi
  1330. AC_ARG_WITH([egl-driver-dir],
  1331. [AS_HELP_STRING([--with-egl-driver-dir=DIR],
  1332. [directory for EGL drivers [[default=${libdir}/egl]]])],
  1333. [EGL_DRIVER_INSTALL_DIR="$withval"],
  1334. [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
  1335. AC_SUBST([EGL_DRIVER_INSTALL_DIR])
  1336. AC_ARG_WITH([max-width],
  1337. [AS_HELP_STRING([--with-max-width=N],
  1338. [Maximum framebuffer width (4096)])],
  1339. [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
  1340. AS_IF([test "${withval}" -gt "4096"],
  1341. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1342. )
  1343. AC_ARG_WITH([max-height],
  1344. [AS_HELP_STRING([--with-max-height=N],
  1345. [Maximum framebuffer height (4096)])],
  1346. [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
  1347. AS_IF([test "${withval}" -gt "4096"],
  1348. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1349. )
  1350. dnl
  1351. dnl Gallium LLVM
  1352. dnl
  1353. AC_ARG_ENABLE([gallium-llvm],
  1354. [AS_HELP_STRING([--enable-gallium-llvm],
  1355. [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
  1356. [enable_gallium_llvm="$enableval"],
  1357. [enable_gallium_llvm=auto])
  1358. AC_ARG_WITH([llvm-shared-libs],
  1359. [AS_HELP_STRING([--with-llvm-shared-libs],
  1360. [link with LLVM shared libraries @<:@default=disabled@:>@])],
  1361. [],
  1362. [with_llvm_shared_libs=no])
  1363. AC_ARG_WITH([llvm-prefix],
  1364. [AS_HELP_STRING([--with-llvm-prefix],
  1365. [Prefix for LLVM installations in non-standard locations])],
  1366. [llvm_prefix="$withval"],
  1367. [llvm_prefix=""])
  1368. # Call this inside ` ` to get the return value.
  1369. # $1 is the llvm-config command with arguments.
  1370. strip_unwanted_llvm_flags() {
  1371. # Use \> (marks the end of the word)
  1372. echo `$1` | sed \
  1373. -e 's/-DNDEBUG\>//g' \
  1374. -e 's/-pedantic\>//g' \
  1375. -e 's/-Wcovered-switch-default\>//g' \
  1376. -e 's/-O.\>//g' \
  1377. -e 's/-g\>//g' \
  1378. -e 's/-Wall\>//g' \
  1379. -e 's/-fcolor-diagnostics\>//g' \
  1380. -e 's/-fomit-frame-pointer\>//g'
  1381. }
  1382. if test "x$with_gallium_drivers" = x; then
  1383. enable_gallium_llvm=no
  1384. fi
  1385. if test "x$enable_gallium_llvm" = xauto; then
  1386. case "$host_cpu" in
  1387. i*86|x86_64|amd64) enable_gallium_llvm=yes;;
  1388. esac
  1389. fi
  1390. if test "x$enable_gallium_llvm" = xyes; then
  1391. if test "x$llvm_prefix" != x; then
  1392. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
  1393. else
  1394. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
  1395. fi
  1396. if test "x$LLVM_CONFIG" != xno; then
  1397. LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
  1398. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  1399. LLVM_BINDIR=`$LLVM_CONFIG --bindir`
  1400. LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
  1401. LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
  1402. LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
  1403. LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
  1404. LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
  1405. AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
  1406. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1407. AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
  1408. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1409. if test "x${LLVM_VERSION_MAJOR}" != x; then
  1410. LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
  1411. else
  1412. LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
  1413. fi
  1414. LLVM_COMPONENTS="engine bitwriter"
  1415. if $LLVM_CONFIG --components | grep -qw 'mcjit'; then
  1416. LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
  1417. fi
  1418. if test "x$enable_opencl" = xyes; then
  1419. LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
  1420. # LLVM 3.3 >= 177971 requires IRReader
  1421. if $LLVM_CONFIG --components | grep -qw 'irreader'; then
  1422. LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader"
  1423. fi
  1424. # LLVM 3.4 requires Option
  1425. if $LLVM_CONFIG --components | grep -qw 'option'; then
  1426. LLVM_COMPONENTS="${LLVM_COMPONENTS} option"
  1427. fi
  1428. fi
  1429. DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
  1430. MESA_LLVM=1
  1431. dnl Check for Clang internal headers
  1432. if test "x$enable_opencl" = xyes; then
  1433. if test "x$CLANG_LIBDIR" = x; then
  1434. CLANG_LIBDIR=${LLVM_LIBDIR}
  1435. fi
  1436. CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
  1437. AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
  1438. [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.])])
  1439. fi
  1440. else
  1441. MESA_LLVM=0
  1442. LLVM_VERSION_INT=0
  1443. fi
  1444. else
  1445. MESA_LLVM=0
  1446. LLVM_VERSION_INT=0
  1447. fi
  1448. dnl Directory for XVMC libs
  1449. AC_ARG_WITH([xvmc-libdir],
  1450. [AS_HELP_STRING([--with-xvmc-libdir=DIR],
  1451. [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
  1452. [XVMC_LIB_INSTALL_DIR="$withval"],
  1453. [XVMC_LIB_INSTALL_DIR='${libdir}'])
  1454. AC_SUBST([XVMC_LIB_INSTALL_DIR])
  1455. dnl
  1456. dnl Gallium Tests
  1457. dnl
  1458. if test "x$enable_gallium_tests" = xyes; then
  1459. enable_gallium_loader=yes
  1460. fi
  1461. AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
  1462. if test "x$enable_gallium_loader" = xyes; then
  1463. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
  1464. fi
  1465. AM_CONDITIONAL(NEED_GALLIUM_LOADER, test "x$enable_gallium_loader" = xyes)
  1466. dnl Directory for VDPAU libs
  1467. AC_ARG_WITH([vdpau-libdir],
  1468. [AS_HELP_STRING([--with-vdpau-libdir=DIR],
  1469. [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
  1470. [VDPAU_LIB_INSTALL_DIR="$withval"],
  1471. [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
  1472. AC_SUBST([VDPAU_LIB_INSTALL_DIR])
  1473. AC_ARG_WITH([omx-libdir],
  1474. [AS_HELP_STRING([--with-omx-libdir=DIR],
  1475. [directory for the OMX libraries])],
  1476. [OMX_LIB_INSTALL_DIR="$withval"],
  1477. [OMX_LIB_INSTALL_DIR=`$PKG_CONFIG --variable=pluginsdir libomxil-bellagio`])
  1478. AC_SUBST([OMX_LIB_INSTALL_DIR])
  1479. dnl Directory for OpenCL libs
  1480. AC_ARG_WITH([opencl-libdir],
  1481. [AS_HELP_STRING([--with-opencl-libdir=DIR],
  1482. [directory for auxiliary libraries used by the OpenCL implementation @<:@default=${libdir}/opencl@:>@])],
  1483. [OPENCL_LIB_INSTALL_DIR="$withval"],
  1484. [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
  1485. AC_SUBST([OPENCL_LIB_INSTALL_DIR])
  1486. dnl
  1487. dnl Gallium helper functions
  1488. dnl
  1489. gallium_check_st() {
  1490. if test "x$NEED_NONNULL_WINSYS" = xyes; then
  1491. if test "x$have_libdrm" != xyes; then
  1492. AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
  1493. fi
  1494. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
  1495. fi
  1496. if test "x$enable_dri" = xyes && test "x$2" != x; then
  1497. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
  1498. fi
  1499. if test "x$enable_xa" = xyes && test "x$3" != x; then
  1500. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
  1501. fi
  1502. if test "x$enable_xvmc" = xyes && test "x$4" != x; then
  1503. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
  1504. fi
  1505. if test "x$enable_vdpau" = xyes && test "x$5" != x; then
  1506. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
  1507. fi
  1508. if test "x$enable_omx" = xyes && test "x$6" != x; then
  1509. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
  1510. fi
  1511. }
  1512. gallium_require_llvm() {
  1513. if test "x$MESA_LLVM" = x0; then
  1514. case "$host_cpu" in
  1515. i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
  1516. esac
  1517. fi
  1518. }
  1519. gallium_require_drm_loader() {
  1520. if test "x$enable_gallium_loader" = xyes; then
  1521. PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
  1522. AC_MSG_ERROR([Gallium drm loader requires libudev]))
  1523. if test "x$have_libdrm" != xyes; then
  1524. AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
  1525. fi
  1526. enable_gallium_drm_loader=yes
  1527. fi
  1528. }
  1529. radeon_llvm_check() {
  1530. LLVM_REQUIRED_VERSION_MAJOR="3"
  1531. LLVM_REQUIRED_VERSION_MINOR="3"
  1532. if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
  1533. AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required for r600g and radeonsi.])
  1534. fi
  1535. if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
  1536. AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
  1537. sources with the --enable-experimental-targets=R600
  1538. configure flag])
  1539. fi
  1540. LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
  1541. NEED_RADEON_LLVM=yes
  1542. AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
  1543. [AC_MSG_ERROR([radeonsi and r600g require libelf when using LLVM])])
  1544. }
  1545. dnl Gallium drivers
  1546. if test "x$enable_dri" = xyes -o "x$enable_xa" = xyes -o \
  1547. "x$enable_xvmc" = xyes -o "x$enable_vdpau" = xyes; then
  1548. NEED_NONNULL_WINSYS=yes
  1549. fi
  1550. AM_CONDITIONAL(NEED_NONNULL_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes)
  1551. dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
  1552. if test "x$with_gallium_drivers" != x; then
  1553. gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
  1554. for driver in $gallium_drivers; do
  1555. case "x$driver" in
  1556. xsvga)
  1557. HAVE_GALLIUM_SVGA=yes
  1558. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
  1559. gallium_check_st "svga/drm" "dri-vmwgfx" "xa-vmwgfx"
  1560. ;;
  1561. xi915)
  1562. HAVE_GALLIUM_I915=yes
  1563. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1564. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
  1565. if test "x$MESA_LLVM" = x1; then
  1566. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1567. fi
  1568. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
  1569. gallium_check_st "i915/drm" "dri-i915"
  1570. DRICOMMON_NEED_LIBDRM=yes
  1571. ;;
  1572. xilo)
  1573. HAVE_GALLIUM_ILO=yes
  1574. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1575. gallium_require_drm_loader
  1576. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
  1577. gallium_check_st "intel/drm" "dri-ilo"
  1578. DRICOMMON_NEED_LIBDRM=yes
  1579. ;;
  1580. xr300)
  1581. HAVE_GALLIUM_R300=yes
  1582. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1583. gallium_require_llvm "Gallium R300"
  1584. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1585. gallium_check_st "radeon/drm" "r300/dri" "" "" ""
  1586. DRICOMMON_NEED_LIBDRM=yes
  1587. ;;
  1588. xr600)
  1589. HAVE_GALLIUM_R600=yes
  1590. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1591. gallium_require_drm_loader
  1592. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
  1593. if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
  1594. radeon_llvm_check
  1595. LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
  1596. fi
  1597. if test "x$enable_r600_llvm" = xyes; then
  1598. USE_R600_LLVM_COMPILER=yes;
  1599. fi
  1600. if test "x$enable_opencl" = xyes; then
  1601. LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
  1602. fi
  1603. gallium_check_st "radeon/drm" "r600/dri" "" "r600/xvmc" "r600/vdpau" "r600/omx"
  1604. DRICOMMON_NEED_LIBDRM=yes
  1605. ;;
  1606. xradeonsi)
  1607. HAVE_GALLIUM_RADEONSI=yes
  1608. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1609. gallium_require_drm_loader
  1610. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
  1611. radeon_llvm_check
  1612. gallium_check_st "radeon/drm" "radeonsi/dri" "" "" "radeonsi/vdpau" "radeonsi/omx"
  1613. DRICOMMON_NEED_LIBDRM=yes
  1614. ;;
  1615. xnouveau)
  1616. HAVE_GALLIUM_NOUVEAU=yes
  1617. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  1618. gallium_require_drm_loader
  1619. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau"
  1620. gallium_check_st "nouveau/drm" "dri-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
  1621. DRICOMMON_NEED_LIBDRM=yes
  1622. ;;
  1623. xfreedreno)
  1624. HAVE_GALLIUM_FREEDRENO=yes
  1625. PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
  1626. gallium_require_drm_loader
  1627. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
  1628. gallium_check_st "freedreno/drm" "dri-freedreno" "" "" ""
  1629. DRICOMMON_NEED_LIBDRM=yes
  1630. ;;
  1631. xswrast)
  1632. HAVE_GALLIUM_SOFTPIPE=yes
  1633. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
  1634. if test "x$MESA_LLVM" = x1; then
  1635. HAVE_GALLIUM_LLVMPIPE=yes
  1636. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1637. fi
  1638. if test "x$enable_dri" = xyes; then
  1639. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
  1640. fi
  1641. ;;
  1642. *)
  1643. AC_MSG_ERROR([Unknown Gallium driver: $driver])
  1644. ;;
  1645. esac
  1646. done
  1647. fi
  1648. dnl Set LLVM_LIBS - This is done after the driver configuration so
  1649. dnl that drivers can add additonal components to LLVM_COMPONENTS.
  1650. dnl Previously, gallium drivers were updating LLVM_LIBS directly
  1651. dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
  1652. dnl this was causing the same libraries to be appear multiple times
  1653. dnl in LLVM_LIBS.
  1654. if test "x$MESA_LLVM" != x0; then
  1655. LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
  1656. if test "x$with_llvm_shared_libs" = xyes; then
  1657. dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
  1658. LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
  1659. AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
  1660. if test "x$llvm_have_one_so" = xyes; then
  1661. dnl LLVM was built using auto*, so there is only one shared object.
  1662. LLVM_LIBS="-l$LLVM_SO_NAME"
  1663. else
  1664. dnl If LLVM was built with CMake, there will be one shared object per
  1665. dnl component.
  1666. AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
  1667. [AC_MSG_ERROR([Could not find llvm shared libraries:
  1668. Please make sure you have built llvm with the --enable-shared option
  1669. and that your llvm libraries are installed in $LLVM_LIBDIR
  1670. If you have installed your llvm libraries to a different directory you
  1671. can use the --with-llvm-prefix= configure flag to specify this directory.
  1672. NOTE: Mesa is attempting to use llvm shared libraries because you have
  1673. passed one of the following options to configure:
  1674. --with-llvm-shared-libs
  1675. --enable-opencl
  1676. If you do not want to build with llvm shared libraries and instead want to
  1677. use llvm static libraries then remove these options from your configure
  1678. invocation and reconfigure.])])
  1679. dnl We don't need to update LLVM_LIBS in this case because the LLVM
  1680. dnl install uses a shared object for each compoenent and we have
  1681. dnl already added all of these objects to LLVM_LIBS.
  1682. fi
  1683. fi
  1684. fi
  1685. AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
  1686. AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
  1687. AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
  1688. AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
  1689. AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
  1690. AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
  1691. AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
  1692. AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
  1693. AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  1694. AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
  1695. AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -o \
  1696. "x$HAVE_GALLIUM_I915" = xyes -o \
  1697. "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  1698. AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
  1699. "x$HAVE_GALLIUM_SOFTPIPE" = xyes \
  1700. && test "x$MESA_LLVM" = x1)
  1701. if test "x$enable_gallium_loader" = xyes; then
  1702. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
  1703. if test "x$enable_gallium_drm_loader" = xyes; then
  1704. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
  1705. PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
  1706. pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
  1707. if test "x$pipe_loader_have_xcb" = xyes; then
  1708. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XCB"
  1709. GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
  1710. fi
  1711. fi
  1712. AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
  1713. AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
  1714. fi
  1715. AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
  1716. AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
  1717. AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
  1718. AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
  1719. AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
  1720. AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
  1721. AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes -a \
  1722. "x$HAVE_GALLIUM_R300" = xyes -o \
  1723. "x$HAVE_GALLIUM_R600" = xyes -o \
  1724. "x$HAVE_GALLIUM_RADEONSI" = xyes)
  1725. AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
  1726. "x$HAVE_GALLIUM_SVGA" = xyes)
  1727. AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
  1728. AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
  1729. AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
  1730. AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
  1731. AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
  1732. AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
  1733. AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
  1734. AC_SUBST([ELF_LIB])
  1735. AM_CONDITIONAL(DRICOMMON_NEED_LIBDRM, test "x$DRICOMMON_NEED_LIBDRM" = xyes)
  1736. AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes)
  1737. AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
  1738. AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
  1739. AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
  1740. AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64)
  1741. AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64)
  1742. AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc)
  1743. AC_SUBST([VDPAU_MAJOR], 1)
  1744. AC_SUBST([VDPAU_MINOR], 0)
  1745. AC_SUBST([XVMC_MAJOR], 1)
  1746. AC_SUBST([XVMC_MINOR], 0)
  1747. AC_SUBST([XA_MAJOR], 2)
  1748. AC_SUBST([XA_MINOR], 1)
  1749. AC_SUBST([XA_TINY], 0)
  1750. AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
  1751. dnl Restore LDFLAGS and CPPFLAGS
  1752. LDFLAGS="$_SAVE_LDFLAGS"
  1753. CPPFLAGS="$_SAVE_CPPFLAGS"
  1754. dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
  1755. if test "x$acv_mesa_CLANG" = xyes; then
  1756. CFLAGS="$CFLAGS -Qunused-arguments"
  1757. CXXFLAGS="$CXXFLAGS -Qunused-arguments"
  1758. fi
  1759. dnl Add user CFLAGS and CXXFLAGS
  1760. CFLAGS="$CFLAGS $USER_CFLAGS"
  1761. CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
  1762. dnl Substitute the config
  1763. AC_CONFIG_FILES([Makefile
  1764. src/Makefile
  1765. src/egl/Makefile
  1766. src/egl/drivers/Makefile
  1767. src/egl/drivers/dri2/Makefile
  1768. src/egl/main/Makefile
  1769. src/egl/main/egl.pc
  1770. src/egl/wayland/Makefile
  1771. src/egl/wayland/wayland-drm/Makefile
  1772. src/egl/wayland/wayland-egl/Makefile
  1773. src/egl/wayland/wayland-egl/wayland-egl.pc
  1774. src/gallium/auxiliary/Makefile
  1775. src/gallium/auxiliary/pipe-loader/Makefile
  1776. src/gallium/drivers/Makefile
  1777. src/gallium/drivers/freedreno/Makefile
  1778. src/gallium/drivers/galahad/Makefile
  1779. src/gallium/drivers/i915/Makefile
  1780. src/gallium/drivers/identity/Makefile
  1781. src/gallium/drivers/ilo/Makefile
  1782. src/gallium/drivers/llvmpipe/Makefile
  1783. src/gallium/drivers/noop/Makefile
  1784. src/gallium/drivers/nouveau/Makefile
  1785. src/gallium/drivers/r300/Makefile
  1786. src/gallium/drivers/r600/Makefile
  1787. src/gallium/drivers/radeon/Makefile
  1788. src/gallium/drivers/radeonsi/Makefile
  1789. src/gallium/drivers/rbug/Makefile
  1790. src/gallium/drivers/softpipe/Makefile
  1791. src/gallium/drivers/svga/Makefile
  1792. src/gallium/drivers/trace/Makefile
  1793. src/gallium/state_trackers/Makefile
  1794. src/gallium/state_trackers/clover/Makefile
  1795. src/gallium/state_trackers/dri/Makefile
  1796. src/gallium/state_trackers/dri/drm/Makefile
  1797. src/gallium/state_trackers/dri/sw/Makefile
  1798. src/gallium/state_trackers/egl/Makefile
  1799. src/gallium/state_trackers/gbm/Makefile
  1800. src/gallium/state_trackers/glx/xlib/Makefile
  1801. src/gallium/state_trackers/omx/Makefile
  1802. src/gallium/state_trackers/osmesa/Makefile
  1803. src/gallium/state_trackers/vdpau/Makefile
  1804. src/gallium/state_trackers/vega/Makefile
  1805. src/gallium/state_trackers/xa/Makefile
  1806. src/gallium/state_trackers/xvmc/Makefile
  1807. src/gallium/targets/Makefile
  1808. src/gallium/targets/dri-freedreno/Makefile
  1809. src/gallium/targets/dri-i915/Makefile
  1810. src/gallium/targets/dri-ilo/Makefile
  1811. src/gallium/targets/dri-nouveau/Makefile
  1812. src/gallium/targets/dri-swrast/Makefile
  1813. src/gallium/targets/dri-vmwgfx/Makefile
  1814. src/gallium/targets/egl-static/Makefile
  1815. src/gallium/targets/gbm/Makefile
  1816. src/gallium/targets/opencl/Makefile
  1817. src/gallium/targets/osmesa/Makefile
  1818. src/gallium/targets/osmesa/osmesa.pc
  1819. src/gallium/targets/pipe-loader/Makefile
  1820. src/gallium/targets/radeonsi/dri/Makefile
  1821. src/gallium/targets/radeonsi/omx/Makefile
  1822. src/gallium/targets/radeonsi/vdpau/Makefile
  1823. src/gallium/targets/r300/dri/Makefile
  1824. src/gallium/targets/r600/dri/Makefile
  1825. src/gallium/targets/r600/omx/Makefile
  1826. src/gallium/targets/r600/vdpau/Makefile
  1827. src/gallium/targets/r600/xvmc/Makefile
  1828. src/gallium/targets/libgl-xlib/Makefile
  1829. src/gallium/targets/vdpau-nouveau/Makefile
  1830. src/gallium/targets/xa-vmwgfx/Makefile
  1831. src/gallium/targets/xa-vmwgfx/xatracker.pc
  1832. src/gallium/targets/xvmc-nouveau/Makefile
  1833. src/gallium/tests/trivial/Makefile
  1834. src/gallium/tests/unit/Makefile
  1835. src/gallium/winsys/Makefile
  1836. src/gallium/winsys/freedreno/drm/Makefile
  1837. src/gallium/winsys/i915/drm/Makefile
  1838. src/gallium/winsys/i915/sw/Makefile
  1839. src/gallium/winsys/intel/drm/Makefile
  1840. src/gallium/winsys/nouveau/drm/Makefile
  1841. src/gallium/winsys/radeon/drm/Makefile
  1842. src/gallium/winsys/svga/drm/Makefile
  1843. src/gallium/winsys/sw/dri/Makefile
  1844. src/gallium/winsys/sw/fbdev/Makefile
  1845. src/gallium/winsys/sw/null/Makefile
  1846. src/gallium/winsys/sw/wayland/Makefile
  1847. src/gallium/winsys/sw/wrapper/Makefile
  1848. src/gallium/winsys/sw/xlib/Makefile
  1849. src/gbm/Makefile
  1850. src/gbm/main/gbm.pc
  1851. src/glsl/Makefile
  1852. src/glx/Makefile
  1853. src/glx/tests/Makefile
  1854. src/gtest/Makefile
  1855. src/loader/Makefile
  1856. src/mapi/Makefile
  1857. src/mapi/es1api/Makefile
  1858. src/mapi/es1api/glesv1_cm.pc
  1859. src/mapi/es2api/Makefile
  1860. src/mapi/es2api/glesv2.pc
  1861. src/mapi/glapi/Makefile
  1862. src/mapi/glapi/gen/Makefile
  1863. src/mapi/glapi/tests/Makefile
  1864. src/mapi/shared-glapi/Makefile
  1865. src/mapi/shared-glapi/tests/Makefile
  1866. src/mapi/vgapi/Makefile
  1867. src/mapi/vgapi/vg.pc
  1868. src/mesa/Makefile
  1869. src/mesa/gl.pc
  1870. src/mesa/drivers/dri/dri.pc
  1871. src/mesa/drivers/dri/common/Makefile
  1872. src/mesa/drivers/dri/common/xmlpool/Makefile
  1873. src/mesa/drivers/dri/i915/Makefile
  1874. src/mesa/drivers/dri/i965/Makefile
  1875. src/mesa/drivers/dri/Makefile
  1876. src/mesa/drivers/dri/nouveau/Makefile
  1877. src/mesa/drivers/dri/r200/Makefile
  1878. src/mesa/drivers/dri/radeon/Makefile
  1879. src/mesa/drivers/dri/swrast/Makefile
  1880. src/mesa/drivers/osmesa/Makefile
  1881. src/mesa/drivers/osmesa/osmesa.pc
  1882. src/mesa/drivers/x11/Makefile
  1883. src/mesa/main/tests/Makefile
  1884. src/mesa/main/tests/hash_table/Makefile])
  1885. dnl Sort the dirs alphabetically
  1886. GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1887. GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1888. GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1889. GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1890. AC_OUTPUT
  1891. dnl
  1892. dnl Output some configuration info for the user
  1893. dnl
  1894. echo ""
  1895. echo " prefix: $prefix"
  1896. echo " exec_prefix: $exec_prefix"
  1897. echo " libdir: $libdir"
  1898. echo " includedir: $includedir"
  1899. dnl API info
  1900. echo ""
  1901. echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
  1902. echo " OpenVG: $enable_openvg"
  1903. dnl Driver info
  1904. echo ""
  1905. case "x$enable_osmesa$enable_gallium_osmesa" in
  1906. xnoyes)
  1907. echo " OSMesa: lib$OSMESA_LIB (Gallium)"
  1908. ;;
  1909. xyesno)
  1910. echo " OSMesa: lib$OSMESA_LIB"
  1911. ;;
  1912. xnono)
  1913. echo " OSMesa: no"
  1914. ;;
  1915. esac
  1916. if test "x$enable_dri" != xno; then
  1917. # cleanup the drivers var
  1918. dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1919. if test "x$DRI_DIRS" = x; then
  1920. echo " DRI drivers: no"
  1921. else
  1922. echo " DRI drivers: $dri_dirs"
  1923. fi
  1924. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1925. fi
  1926. case "x$enable_glx$enable_xlib_glx" in
  1927. xyesyes)
  1928. echo " GLX: Xlib-based"
  1929. ;;
  1930. xyesno)
  1931. echo " GLX: DRI-based"
  1932. ;;
  1933. *)
  1934. echo " GLX: $enable_glx"
  1935. ;;
  1936. esac
  1937. dnl EGL
  1938. echo ""
  1939. echo " EGL: $enable_egl"
  1940. if test "$enable_egl" = yes; then
  1941. echo " EGL platforms: $egl_platforms"
  1942. egl_drivers=""
  1943. if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
  1944. egl_drivers="$egl_drivers builtin:egl_dri2"
  1945. fi
  1946. if test "x$enable_gallium_egl" = xyes; then
  1947. echo " EGL drivers: ${egl_drivers} egl_gallium"
  1948. echo " EGL Gallium STs:$EGL_CLIENT_APIS"
  1949. else
  1950. echo " EGL drivers: $egl_drivers"
  1951. fi
  1952. fi
  1953. echo ""
  1954. if test "x$MESA_LLVM" = x1; then
  1955. echo " llvm: yes"
  1956. echo " llvm-config: $LLVM_CONFIG"
  1957. echo " llvm-version: $LLVM_VERSION"
  1958. else
  1959. echo " llvm: no"
  1960. fi
  1961. echo ""
  1962. if test -n "$with_gallium_drivers"; then
  1963. echo " Gallium: yes"
  1964. echo " Target dirs: $GALLIUM_TARGET_DIRS"
  1965. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  1966. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  1967. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  1968. else
  1969. echo " Gallium: no"
  1970. fi
  1971. dnl Libraries
  1972. echo ""
  1973. echo " Shared libs: $enable_shared"
  1974. echo " Static libs: $enable_static"
  1975. echo " Shared-glapi: $enable_shared_glapi"
  1976. dnl Compiler options
  1977. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  1978. cflags=`echo $CFLAGS | \
  1979. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1980. cxxflags=`echo $CXXFLAGS | \
  1981. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1982. defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1983. echo ""
  1984. echo " CFLAGS: $cflags"
  1985. echo " CXXFLAGS: $cxxflags"
  1986. echo " Macros: $defines"
  1987. echo ""
  1988. if test "x$MESA_LLVM" = x1; then
  1989. echo " LLVM_CFLAGS: $LLVM_CFLAGS"
  1990. echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
  1991. echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
  1992. echo ""
  1993. fi
  1994. echo " PYTHON2: $PYTHON2"
  1995. echo ""
  1996. echo " Run '${MAKE-make}' to build Mesa"
  1997. echo ""