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

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