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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012
  1. dnl Process this file with autoconf to create configure.
  2. AC_PREREQ([2.59])
  3. dnl Versioning - scrape the version from configs/default
  4. m4_define([mesa_version],
  5. [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n' | tr -d '\r'])])
  6. m4_ifval(mesa_version,,
  7. [m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
  8. dnl Tell the user about autoconf.html in the --help output
  9. m4_divert_once([HELP_END], [
  10. See docs/autoconf.html for more details on the options for Mesa.])
  11. AC_INIT([Mesa],[mesa_version],
  12. [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
  13. AC_CONFIG_AUX_DIR([bin])
  14. AC_CANONICAL_HOST
  15. dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
  16. USER_CFLAGS="$CFLAGS"
  17. USER_CXXFLAGS="$CXXFLAGS"
  18. dnl Versions for external dependencies
  19. LIBDRM_REQUIRED=2.4.24
  20. LIBDRM_RADEON_REQUIRED=2.4.24
  21. LIBDRM_INTEL_REQUIRED=2.4.24
  22. LIBDRM_NOUVEAU_REQUIRED=0.6
  23. DRI2PROTO_REQUIRED=2.6
  24. GLPROTO_REQUIRED=1.4.14
  25. LIBDRM_XORG_REQUIRED=2.4.24
  26. LIBKMS_XORG_REQUIRED=1.0.0
  27. dnl Check for progs
  28. AC_PROG_CPP
  29. AC_PROG_CC
  30. AC_PROG_CXX
  31. AC_CHECK_PROGS([MAKE], [gmake make])
  32. AC_CHECK_PROGS([PYTHON2], [python2 python])
  33. AC_PATH_PROG([MKDEP], [makedepend])
  34. AC_PATH_PROG([SED], [sed])
  35. if test "x$MKDEP" = "x"; then
  36. AC_MSG_ERROR([makedepend is required to build Mesa])
  37. fi
  38. AC_PATH_PROG([FLEX], [flex])
  39. test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
  40. AC_PATH_PROG([BISON], [bison])
  41. test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
  42. dnl Our fallback install-sh is a symlink to minstall. Use the existing
  43. dnl configuration in that case.
  44. AC_PROG_INSTALL
  45. test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
  46. dnl We need a POSIX shell for parts of the build. Assume we have one
  47. dnl in most cases.
  48. case "$host_os" in
  49. solaris*)
  50. # Solaris /bin/sh is too old/non-POSIX compliant
  51. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  52. SHELL="$POSIX_SHELL"
  53. ;;
  54. esac
  55. dnl clang is mostly GCC-compatible, but its version is much lower,
  56. dnl so we have to check for it.
  57. AC_MSG_CHECKING([if compiling with clang])
  58. AC_COMPILE_IFELSE(
  59. [AC_LANG_PROGRAM([], [[
  60. #ifndef __clang__
  61. not clang
  62. #endif
  63. ]])],
  64. [CLANG=yes], [CLANG=no])
  65. AC_MSG_RESULT([$CLANG])
  66. dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
  67. dnl versions are explictly not supported.
  68. if test "x$GCC" = xyes -a "x$CLANG" = xno; then
  69. AC_MSG_CHECKING([whether gcc version is sufficient])
  70. major=0
  71. minor=0
  72. GCC_VERSION=`$CC -dumpversion`
  73. if test $? -eq 0; then
  74. major=`echo $GCC_VERSION | cut -d. -f1`
  75. minor=`echo $GCC_VERSION | cut -d. -f2`
  76. fi
  77. if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
  78. AC_MSG_RESULT([no])
  79. AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
  80. else
  81. AC_MSG_RESULT([yes])
  82. fi
  83. fi
  84. MKDEP_OPTIONS=-fdepend
  85. dnl Ask gcc where it's keeping its secret headers
  86. if test "x$GCC" = xyes; then
  87. for dir in include include-fixed; do
  88. GCC_INCLUDES=`$CC -print-file-name=$dir`
  89. if test "x$GCC_INCLUDES" != x && \
  90. test "$GCC_INCLUDES" != "$dir" && \
  91. test -d "$GCC_INCLUDES"; then
  92. MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
  93. fi
  94. done
  95. fi
  96. AC_SUBST([MKDEP_OPTIONS])
  97. dnl Make sure the pkg-config macros are defined
  98. m4_ifndef([PKG_PROG_PKG_CONFIG],
  99. [m4_fatal([Could not locate the pkg-config autoconf macros.
  100. These are usually located in /usr/share/aclocal/pkg.m4. If your macros
  101. are in a different location, try setting the environment variable
  102. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  103. PKG_PROG_PKG_CONFIG()
  104. dnl LIB_DIR - library basename
  105. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  106. AC_SUBST([LIB_DIR])
  107. dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
  108. _SAVE_LDFLAGS="$LDFLAGS"
  109. AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
  110. AC_SUBST([EXTRA_LIB_PATH])
  111. dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
  112. _SAVE_CPPFLAGS="$CPPFLAGS"
  113. AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
  114. AC_SUBST([X11_INCLUDES])
  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 -DPTHREADS"
  121. ;;
  122. solaris*)
  123. DEFINES="$DEFINES -DPTHREADS -DSVR4"
  124. ;;
  125. cygwin*)
  126. DEFINES="$DEFINES -DPTHREADS"
  127. ;;
  128. esac
  129. dnl Add flags for gcc and g++
  130. if test "x$GCC" = xyes; then
  131. CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
  132. if test "x$CLANG" = "xno"; then
  133. CFLAGS="$CFLAGS -ffast-math"
  134. fi
  135. # Enable -fvisibility=hidden if using a gcc that supports it
  136. save_CFLAGS="$CFLAGS"
  137. AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
  138. VISIBILITY_CFLAGS="-fvisibility=hidden"
  139. CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
  140. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  141. [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
  142. # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
  143. CFLAGS=$save_CFLAGS
  144. # Work around aliasing bugs - developers should comment this out
  145. CFLAGS="$CFLAGS -fno-strict-aliasing"
  146. fi
  147. if test "x$GXX" = xyes; then
  148. CXXFLAGS="$CXXFLAGS -Wall"
  149. # Enable -fvisibility=hidden if using a gcc that supports it
  150. save_CXXFLAGS="$CXXFLAGS"
  151. AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
  152. VISIBILITY_CXXFLAGS="-fvisibility=hidden"
  153. CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
  154. AC_LANG_PUSH([C++])
  155. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  156. [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
  157. AC_LANG_POP([C++])
  158. # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
  159. CXXFLAGS=$save_CXXFLAGS
  160. # Work around aliasing bugs - developers should comment this out
  161. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  162. fi
  163. dnl even if the compiler appears to support it, using visibility attributes isn't
  164. dnl going to do anything useful currently on cygwin apart from emit lots of warnings
  165. case "$host_os" in
  166. cygwin*)
  167. VISIBILITY_CFLAGS=""
  168. VISIBILITY_CXXFLAGS=""
  169. ;;
  170. esac
  171. AC_SUBST([VISIBILITY_CFLAGS])
  172. AC_SUBST([VISIBILITY_CXXFLAGS])
  173. dnl These should be unnecessary, but let the user set them if they want
  174. AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
  175. Default is to use CFLAGS.])
  176. AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
  177. compiler. Default is to use CFLAGS.])
  178. AC_SUBST([OPT_FLAGS])
  179. AC_SUBST([ARCH_FLAGS])
  180. dnl
  181. dnl Hacks to enable 32 or 64 bit build
  182. dnl
  183. AC_ARG_ENABLE([32-bit],
  184. [AS_HELP_STRING([--enable-32-bit],
  185. [build 32-bit libraries @<:@default=auto@:>@])],
  186. [enable_32bit="$enableval"],
  187. [enable_32bit=auto]
  188. )
  189. if test "x$enable_32bit" = xyes; then
  190. if test "x$GCC" = xyes; then
  191. CFLAGS="$CFLAGS -m32"
  192. ARCH_FLAGS="$ARCH_FLAGS -m32"
  193. fi
  194. if test "x$GXX" = xyes; then
  195. CXXFLAGS="$CXXFLAGS -m32"
  196. fi
  197. fi
  198. AC_ARG_ENABLE([64-bit],
  199. [AS_HELP_STRING([--enable-64-bit],
  200. [build 64-bit libraries @<:@default=auto@:>@])],
  201. [enable_64bit="$enableval"],
  202. [enable_64bit=auto]
  203. )
  204. if test "x$enable_64bit" = xyes; then
  205. if test "x$GCC" = xyes; then
  206. CFLAGS="$CFLAGS -m64"
  207. fi
  208. if test "x$GXX" = xyes; then
  209. CXXFLAGS="$CXXFLAGS -m64"
  210. fi
  211. fi
  212. dnl
  213. dnl shared/static libraries, mimic libtool options
  214. dnl
  215. AC_ARG_ENABLE([static],
  216. [AS_HELP_STRING([--enable-static],
  217. [build static libraries @<:@default=disabled@:>@])],
  218. [enable_static="$enableval"],
  219. [enable_static=no]
  220. )
  221. case "x$enable_static" in
  222. xyes|xno ) ;;
  223. x ) enable_static=no ;;
  224. * )
  225. AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
  226. ;;
  227. esac
  228. AC_ARG_ENABLE([shared],
  229. [AS_HELP_STRING([--disable-shared],
  230. [build shared libraries @<:@default=enabled@:>@])],
  231. [enable_shared="$enableval"],
  232. [enable_shared=yes]
  233. )
  234. case "x$enable_shared" in
  235. xyes|xno ) ;;
  236. x ) enable_shared=yes ;;
  237. * )
  238. AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
  239. ;;
  240. esac
  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 requirested.
  244. case "x$enable_static$enable_shared" in
  245. xyesyes )
  246. AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
  247. enable_shared=no
  248. ;;
  249. xnono )
  250. AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
  251. enable_static=yes
  252. ;;
  253. esac
  254. dnl
  255. dnl mklib options
  256. dnl
  257. AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
  258. if test "$enable_static" = yes; then
  259. MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
  260. fi
  261. AC_SUBST([MKLIB_OPTIONS])
  262. dnl
  263. dnl other compiler options
  264. dnl
  265. AC_ARG_ENABLE([debug],
  266. [AS_HELP_STRING([--enable-debug],
  267. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  268. [enable_debug="$enableval"],
  269. [enable_debug=no]
  270. )
  271. if test "x$enable_debug" = xyes; then
  272. DEFINES="$DEFINES -DDEBUG"
  273. if test "x$GCC" = xyes; then
  274. CFLAGS="$CFLAGS -g"
  275. fi
  276. if test "x$GXX" = xyes; then
  277. CXXFLAGS="$CXXFLAGS -g"
  278. fi
  279. fi
  280. dnl
  281. dnl library names
  282. dnl
  283. LIB_PREFIX_GLOB='lib'
  284. LIB_VERSION_SEPARATOR='.'
  285. if test "$enable_static" = yes; then
  286. LIB_EXTENSION='a'
  287. else
  288. case "$host_os" in
  289. darwin* )
  290. LIB_EXTENSION='dylib' ;;
  291. cygwin* )
  292. dnl prefix can be 'cyg' or 'lib'
  293. LIB_PREFIX_GLOB='???'
  294. LIB_VERSION_SEPARATOR='-'
  295. LIB_EXTENSION='dll' ;;
  296. aix* )
  297. LIB_EXTENSION='a' ;;
  298. * )
  299. LIB_EXTENSION='so' ;;
  300. esac
  301. fi
  302. dnl
  303. dnl potentially-infringing-but-nobody-knows-for-sure stuff
  304. dnl
  305. AC_ARG_ENABLE([texture-float],
  306. [AS_HELP_STRING([--enable-texture-float],
  307. [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
  308. [enable_texture_float="$enableval"],
  309. [enable_texture_float=no]
  310. )
  311. if test "x$enable_texture_float" = xyes; then
  312. AC_MSG_WARN([Floating-point textures enabled.])
  313. AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
  314. DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
  315. fi
  316. GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
  317. GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
  318. GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
  319. OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
  320. EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
  321. GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
  322. GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
  323. VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
  324. GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
  325. WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
  326. GBM_LIB_NAME='lib$(GBM_LIB).'${LIB_EXTENSION}
  327. GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  328. GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  329. GLUT_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLUT_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  330. OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  331. EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  332. EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  333. GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  334. GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  335. VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  336. GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  337. WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  338. GBM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GBM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  339. AC_SUBST([GL_LIB_NAME])
  340. AC_SUBST([GLU_LIB_NAME])
  341. AC_SUBST([GLUT_LIB_NAME])
  342. AC_SUBST([OSMESA_LIB_NAME])
  343. AC_SUBST([EGL_LIB_NAME])
  344. AC_SUBST([GLESv1_CM_LIB_NAME])
  345. AC_SUBST([GLESv2_LIB_NAME])
  346. AC_SUBST([VG_LIB_NAME])
  347. AC_SUBST([GLAPI_LIB_NAME])
  348. AC_SUBST([WAYLAND_EGL_LIB_NAME])
  349. AC_SUBST([GBM_LIB_NAME])
  350. AC_SUBST([GL_LIB_GLOB])
  351. AC_SUBST([GLU_LIB_GLOB])
  352. AC_SUBST([GLUT_LIB_GLOB])
  353. AC_SUBST([OSMESA_LIB_GLOB])
  354. AC_SUBST([EGL_LIB_GLOB])
  355. AC_SUBST([GLESv1_CM_LIB_GLOB])
  356. AC_SUBST([GLESv2_LIB_GLOB])
  357. AC_SUBST([VG_LIB_GLOB])
  358. AC_SUBST([GLAPI_LIB_GLOB])
  359. AC_SUBST([WAYLAND_EGL_LIB_GLOB])
  360. AC_SUBST([GBM_LIB_GLOB])
  361. dnl
  362. dnl Arch/platform-specific settings
  363. dnl
  364. AC_ARG_ENABLE([asm],
  365. [AS_HELP_STRING([--disable-asm],
  366. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  367. [enable_asm="$enableval"],
  368. [enable_asm=yes]
  369. )
  370. asm_arch=""
  371. ASM_FLAGS=""
  372. MESA_ASM_SOURCES=""
  373. GLAPI_ASM_SOURCES=""
  374. AC_MSG_CHECKING([whether to enable assembly])
  375. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  376. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  377. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  378. case "$host_cpu" in
  379. i?86 | x86_64)
  380. enable_asm=no
  381. AC_MSG_RESULT([no, cross compiling])
  382. ;;
  383. esac
  384. fi
  385. # check for supported arches
  386. if test "x$enable_asm" = xyes; then
  387. case "$host_cpu" in
  388. i?86)
  389. case "$host_os" in
  390. linux* | *freebsd* | dragonfly* | *netbsd*)
  391. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  392. ;;
  393. esac
  394. ;;
  395. x86_64)
  396. case "$host_os" in
  397. linux* | *freebsd* | dragonfly* | *netbsd*)
  398. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  399. ;;
  400. esac
  401. ;;
  402. powerpc)
  403. case "$host_os" in
  404. linux*)
  405. asm_arch=ppc
  406. ;;
  407. esac
  408. ;;
  409. sparc*)
  410. case "$host_os" in
  411. linux*)
  412. asm_arch=sparc
  413. ;;
  414. esac
  415. ;;
  416. esac
  417. case "$asm_arch" in
  418. x86)
  419. ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  420. MESA_ASM_SOURCES='$(X86_SOURCES)'
  421. GLAPI_ASM_SOURCES='$(X86_API)'
  422. AC_MSG_RESULT([yes, x86])
  423. ;;
  424. x86_64)
  425. ASM_FLAGS="-DUSE_X86_64_ASM"
  426. MESA_ASM_SOURCES='$(X86-64_SOURCES)'
  427. GLAPI_ASM_SOURCES='$(X86-64_API)'
  428. AC_MSG_RESULT([yes, x86_64])
  429. ;;
  430. ppc)
  431. ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
  432. MESA_ASM_SOURCES='$(PPC_SOURCES)'
  433. AC_MSG_RESULT([yes, ppc])
  434. ;;
  435. sparc)
  436. ASM_FLAGS="-DUSE_SPARC_ASM"
  437. MESA_ASM_SOURCES='$(SPARC_SOURCES)'
  438. GLAPI_ASM_SOURCES='$(SPARC_API)'
  439. AC_MSG_RESULT([yes, sparc])
  440. ;;
  441. *)
  442. AC_MSG_RESULT([no, platform not supported])
  443. ;;
  444. esac
  445. fi
  446. AC_SUBST([ASM_FLAGS])
  447. AC_SUBST([MESA_ASM_SOURCES])
  448. AC_SUBST([GLAPI_ASM_SOURCES])
  449. dnl PIC code macro
  450. MESA_PIC_FLAGS
  451. dnl Check to see if dlopen is in default libraries (like Solaris, which
  452. dnl has it in libc), or if libdl is needed to get it.
  453. AC_CHECK_FUNC([dlopen], [],
  454. [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
  455. AC_SUBST([DLOPEN_LIBS])
  456. dnl See if posix_memalign is available
  457. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  458. dnl SELinux awareness.
  459. AC_ARG_ENABLE([selinux],
  460. [AS_HELP_STRING([--enable-selinux],
  461. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  462. [MESA_SELINUX="$enableval"],
  463. [MESA_SELINUX=no])
  464. if test "x$enable_selinux" = "xyes"; then
  465. AC_CHECK_HEADER([selinux/selinux.h],[],
  466. [AC_MSG_ERROR([SELinux headers not found])])
  467. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  468. [AC_MSG_ERROR([SELinux library not found])])
  469. SELINUX_LIBS="-lselinux"
  470. DEFINES="$DEFINES -DMESA_SELINUX"
  471. fi
  472. dnl Options for APIs
  473. AC_ARG_ENABLE([opengl],
  474. [AS_HELP_STRING([--disable-opengl],
  475. [disable support for standard OpenGL API @<:@default=no@:>@])],
  476. [enable_opengl="$enableval"],
  477. [enable_opengl=yes])
  478. AC_ARG_ENABLE([gles1],
  479. [AS_HELP_STRING([--enable-gles1],
  480. [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
  481. [enable_gles1="$enableval"],
  482. [enable_gles1=no])
  483. AC_ARG_ENABLE([gles2],
  484. [AS_HELP_STRING([--enable-gles2],
  485. [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
  486. [enable_gles2="$enableval"],
  487. [enable_gles2=no])
  488. AC_ARG_ENABLE([openvg],
  489. [AS_HELP_STRING([--enable-openvg],
  490. [enable support for OpenVG API @<:@default=no@:>@])],
  491. [enable_openvg="$enableval"],
  492. [enable_openvg=no])
  493. AC_ARG_ENABLE([dri],
  494. [AS_HELP_STRING([--enable-dri],
  495. [enable DRI modules @<:@default=auto@:>@])],
  496. [enable_dri="$enableval"],
  497. [enable_dri=auto])
  498. AC_ARG_ENABLE([glx],
  499. [AS_HELP_STRING([--enable-glx],
  500. [enable GLX library @<:@default=auto@:>@])],
  501. [enable_glx="$enableval"],
  502. [enable_glx=auto])
  503. AC_ARG_ENABLE([osmesa],
  504. [AS_HELP_STRING([--enable-osmesa],
  505. [enable OSMesa library @<:@default=auto@:>@])],
  506. [enable_osmesa="$enableval"],
  507. [enable_osmesa=auto])
  508. AC_ARG_ENABLE([egl],
  509. [AS_HELP_STRING([--disable-egl],
  510. [disable EGL library @<:@default=enabled@:>@])],
  511. [enable_egl="$enableval"],
  512. [enable_egl=yes])
  513. AC_ARG_ENABLE([xorg],
  514. [AS_HELP_STRING([--enable-xorg],
  515. [enable support for X.Org DDX API @<:@default=no@:>@])],
  516. [enable_xorg="$enableval"],
  517. [enable_xorg=no])
  518. AC_ARG_ENABLE([xa],
  519. [AS_HELP_STRING([--enable-xa],
  520. [enable build of the XA X Acceleration API @<:@default=no@:>@])],
  521. [enable_xa="$enableval"],
  522. [enable_xa=no])
  523. AC_ARG_ENABLE([d3d1x],
  524. [AS_HELP_STRING([--enable-d3d1x],
  525. [enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
  526. [enable_d3d1x="$enableval"],
  527. [enable_d3d1x=no])
  528. AC_ARG_ENABLE([gbm],
  529. [AS_HELP_STRING([--enable-gbm],
  530. [enable gbm library @<:@default=auto@:>@])],
  531. [enable_gbm="$enableval"],
  532. [enable_gbm=auto])
  533. AC_ARG_ENABLE([xvmc],
  534. [AS_HELP_STRING([--enable-xvmc],
  535. [enable xvmc library @<:@default=auto@:>@])],
  536. [enable_xvmc="$enableval"],
  537. [enable_xvmc=auto])
  538. AC_ARG_ENABLE([vdpau],
  539. [AS_HELP_STRING([--enable-vdpau],
  540. [enable vdpau library @<:@default=auto@:>@])],
  541. [enable_vdpau="$enableval"],
  542. [enable_vdpau=auto])
  543. AC_ARG_ENABLE([va],
  544. [AS_HELP_STRING([--enable-va],
  545. [enable va library @<:@default=auto@:>@])],
  546. [enable_va="$enableval"],
  547. [enable_va=auto])
  548. AC_ARG_ENABLE([xlib_glx],
  549. [AS_HELP_STRING([--enable-xlib-glx],
  550. [make GLX library Xlib-based instead of DRI-based @<:@default=disable@:>@])],
  551. [enable_xlib_glx="$enableval"],
  552. [enable_xlib_glx=auto])
  553. AC_ARG_ENABLE([gallium_egl],
  554. [AS_HELP_STRING([--enable-gallium-egl],
  555. [enable optional EGL state tracker (not required
  556. for EGL support in Gallium with OpenGL and OpenGL ES)
  557. @<:@default=disable@:>@])],
  558. [enable_gallium_egl="$enableval"],
  559. [enable_gallium_egl=no])
  560. AC_ARG_ENABLE([gallium_gbm],
  561. [AS_HELP_STRING([--enable-gallium-gbm],
  562. [enable optional gbm state tracker (not required for
  563. gbm support in Gallium)
  564. @<:@default=auto@:>@])],
  565. [enable_gallium_gbm="$enableval"],
  566. [enable_gallium_gbm=auto])
  567. # Option for Gallium drivers
  568. GALLIUM_DRIVERS_DEFAULT="r300,r600,swrast"
  569. AC_ARG_WITH([gallium-drivers],
  570. [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
  571. [comma delimited Gallium drivers list, e.g.
  572. "i915,i965,nouveau,r300,r600,svga,swrast"
  573. @<:@default=r300,r600,swrast@:>@])],
  574. [with_gallium_drivers="$withval"],
  575. [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
  576. # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
  577. # here so that the script doesn't choke on an unknown driver name later.
  578. case "$with_gallium_drivers" in
  579. yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
  580. no) with_gallium_drivers='' ;;
  581. esac
  582. if test "x$enable_opengl" = xno -a \
  583. "x$enable_gles1" = xno -a \
  584. "x$enable_gles2" = xno -a \
  585. "x$enable_openvg" = xno -a \
  586. "x$enable_xorg" = xno -a \
  587. "x$enable_xa" = xno -a \
  588. "x$enable_d3d1x" = xno -a \
  589. "x$enable_xvmc" = xno -a \
  590. "x$enable_vdpau" = xno -a \
  591. "x$enable_va" = xno; then
  592. AC_MSG_ERROR([at least one API should be enabled])
  593. fi
  594. API_DEFINES=""
  595. if test "x$enable_opengl" = xno; then
  596. API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
  597. else
  598. API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
  599. fi
  600. if test "x$enable_gles1" = xyes; then
  601. API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
  602. fi
  603. if test "x$enable_gles2" = xyes; then
  604. API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
  605. fi
  606. AC_SUBST([API_DEFINES])
  607. AC_ARG_ENABLE([shared-glapi],
  608. [AS_HELP_STRING([--enable-shared-glapi],
  609. [EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
  610. [enable_shared_glapi="$enableval"],
  611. [enable_shared_glapi=no])
  612. SHARED_GLAPI="0"
  613. if test "x$enable_shared_glapi" = xyes; then
  614. SHARED_GLAPI="1"
  615. fi
  616. AC_SUBST([SHARED_GLAPI])
  617. dnl
  618. dnl Driver configuration. Options are xlib, dri and osmesa right now.
  619. dnl More later: fbdev, ...
  620. dnl
  621. default_driver="xlib"
  622. case "$host_os" in
  623. linux*)
  624. case "$host_cpu" in
  625. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  626. esac
  627. ;;
  628. *freebsd* | dragonfly* | *netbsd*)
  629. case "$host_cpu" in
  630. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  631. esac
  632. ;;
  633. esac
  634. if test "x$enable_opengl" = xno; then
  635. default_driver="no"
  636. fi
  637. AC_ARG_WITH([driver],
  638. [AS_HELP_STRING([--with-driver=DRIVER], [DEPRECATED])],
  639. [mesa_driver="$withval"],
  640. [mesa_driver=auto])
  641. dnl Check for valid option
  642. case "x$mesa_driver" in
  643. xxlib|xdri|xosmesa|xno)
  644. if test "x$enable_dri" != xauto -o \
  645. "x$enable_glx" != xauto -o \
  646. "x$enable_osmesa" != xauto -o \
  647. "x$enable_xlib_glx" != xauto; then
  648. AC_MSG_ERROR([--with-driver=$mesa_driver is deprecated])
  649. fi
  650. ;;
  651. xauto)
  652. mesa_driver="$default_driver"
  653. ;;
  654. *)
  655. AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
  656. ;;
  657. esac
  658. # map $mesa_driver to APIs
  659. if test "x$enable_dri" = xauto; then
  660. case "x$mesa_driver" in
  661. xdri) enable_dri=yes ;;
  662. *) enable_dri=no ;;
  663. esac
  664. fi
  665. if test "x$enable_glx" = xauto; then
  666. case "x$mesa_driver" in
  667. xdri|xxlib) enable_glx=yes ;;
  668. *) enable_glx=no ;;
  669. esac
  670. fi
  671. if test "x$enable_osmesa" = xauto; then
  672. case "x$mesa_driver" in
  673. xxlib|xosmesa) enable_osmesa=yes ;;
  674. *) enable_osmesa=no ;;
  675. esac
  676. fi
  677. if test "x$enable_xlib_glx" = xauto; then
  678. case "x$mesa_driver" in
  679. xxlib) enable_xlib_glx=yes ;;
  680. *) enable_xlib_glx=no ;;
  681. esac
  682. fi
  683. if test "x$enable_glx" = xno; then
  684. enable_xlib_glx=no
  685. fi
  686. dnl
  687. dnl Driver specific build directories
  688. dnl
  689. dnl this variable will be prepended to SRC_DIRS and is not exported
  690. CORE_DIRS=""
  691. SRC_DIRS=""
  692. GLU_DIRS="sgi"
  693. GALLIUM_DIRS="auxiliary drivers state_trackers"
  694. GALLIUM_TARGET_DIRS=""
  695. GALLIUM_WINSYS_DIRS="sw"
  696. GALLIUM_DRIVERS_DIRS="failover galahad trace rbug noop identity"
  697. GALLIUM_STATE_TRACKERS_DIRS=""
  698. # build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
  699. case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
  700. x*yes*)
  701. CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
  702. ;;
  703. esac
  704. # build glapi if OpenGL is enabled
  705. if test "x$enable_opengl" = xyes; then
  706. CORE_DIRS="$CORE_DIRS mapi/glapi"
  707. fi
  708. # build es1api if OpenGL ES 1.x is enabled
  709. if test "x$enable_gles1" = xyes; then
  710. CORE_DIRS="$CORE_DIRS mapi/es1api"
  711. fi
  712. # build es2api if OpenGL ES 2.x is enabled
  713. if test "x$enable_gles2" = xyes; then
  714. CORE_DIRS="$CORE_DIRS mapi/es2api"
  715. fi
  716. # build glsl and mesa if OpenGL or OpenGL ES is enabled
  717. case "x$enable_opengl$enable_gles1$enable_gles2" in
  718. x*yes*)
  719. CORE_DIRS="$CORE_DIRS glsl mesa"
  720. ;;
  721. esac
  722. case "x$enable_glx$enable_xlib_glx" in
  723. xyesyes)
  724. DRIVER_DIRS="$DRIVER_DIRS x11"
  725. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  726. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
  727. GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
  728. HAVE_WINSYS_XLIB="yes"
  729. ;;
  730. xyesno)
  731. # DRI-based GLX
  732. SRC_DIRS="$SRC_DIRS glx"
  733. ;;
  734. esac
  735. if test "x$enable_dri" = xyes; then
  736. DRIVER_DIRS="$DRIVER_DIRS dri"
  737. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
  738. GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
  739. HAVE_ST_DRI="yes"
  740. fi
  741. if test "x$enable_osmesa" = xyes; then
  742. # the empty space matters for osmesa... (see src/mesa/Makefile)
  743. if test -n "$DRIVER_DIRS"; then
  744. DRIVER_DIRS="$DRIVER_DIRS osmesa"
  745. else
  746. DRIVER_DIRS="osmesa"
  747. fi
  748. fi
  749. AC_SUBST([SRC_DIRS])
  750. AC_SUBST([GLU_DIRS])
  751. AC_SUBST([DRIVER_DIRS])
  752. AC_SUBST([GALLIUM_DIRS])
  753. AC_SUBST([GALLIUM_TARGET_DIRS])
  754. AC_SUBST([GALLIUM_WINSYS_DIRS])
  755. AC_SUBST([GALLIUM_DRIVERS_DIRS])
  756. AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
  757. AC_SUBST([MESA_LLVM])
  758. # Check for libdrm
  759. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
  760. [have_libdrm=yes], [have_libdrm=no])
  761. if test "x$enable_dri" = xyes; then
  762. # DRI must be shared, I think
  763. if test "$enable_static" = yes; then
  764. AC_MSG_ERROR([Can't use static libraries for DRI drivers])
  765. fi
  766. # not a hard requirement as swrast does not depend on it
  767. if test "x$have_libdrm" = xyes; then
  768. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  769. fi
  770. fi
  771. dnl
  772. dnl Find out if X is available. The variable have_x is set if libX11 is
  773. dnl found to mimic AC_PATH_XTRA.
  774. dnl
  775. if test -n "$PKG_CONFIG"; then
  776. AC_MSG_CHECKING([pkg-config files for X11 are available])
  777. PKG_CHECK_EXISTS([x11],[
  778. x11_pkgconfig=yes
  779. have_x=yes
  780. ],[
  781. x11_pkgconfig=no
  782. ])
  783. AC_MSG_RESULT([$x11_pkgconfig])
  784. else
  785. x11_pkgconfig=no
  786. fi
  787. dnl Use the autoconf macro if no pkg-config files
  788. if test "$x11_pkgconfig" = yes; then
  789. PKG_CHECK_MODULES([X11], [x11])
  790. else
  791. AC_PATH_XTRA
  792. test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
  793. test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
  794. AC_SUBST([X11_CFLAGS])
  795. AC_SUBST([X11_LIBS])
  796. fi
  797. dnl Try to tell the user that the --x-* options are only used when
  798. dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
  799. m4_divert_once([HELP_BEGIN],
  800. [These options are only used when the X libraries cannot be found by the
  801. pkg-config utility.])
  802. dnl We need X for xlib and dri, so bomb now if it's not found
  803. if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then
  804. AC_MSG_ERROR([X11 development libraries needed for GLX])
  805. fi
  806. dnl XCB - this is only used for GLX right now
  807. AC_ARG_ENABLE([xcb],
  808. [AS_HELP_STRING([--enable-xcb],
  809. [use XCB for GLX @<:@default=disabled@:>@])],
  810. [enable_xcb="$enableval"],
  811. [enable_xcb=no])
  812. if test "x$enable_xcb" = xyes; then
  813. DEFINES="$DEFINES -DUSE_XCB"
  814. else
  815. enable_xcb=no
  816. fi
  817. dnl Direct rendering or just indirect rendering
  818. case "$host_os" in
  819. gnu*)
  820. dnl Disable by default on GNU/Hurd
  821. driglx_direct_default="no"
  822. ;;
  823. cygwin*)
  824. dnl Disable by default on cygwin
  825. driglx_direct_default="no"
  826. ;;
  827. *)
  828. driglx_direct_default="yes"
  829. ;;
  830. esac
  831. AC_ARG_ENABLE([driglx-direct],
  832. [AS_HELP_STRING([--disable-driglx-direct],
  833. [enable direct rendering in GLX and EGL for DRI \
  834. @<:@default=auto@:>@])],
  835. [driglx_direct="$enableval"],
  836. [driglx_direct="$driglx_direct_default"])
  837. dnl
  838. dnl libGL configuration per driver
  839. dnl
  840. case "x$enable_glx$enable_xlib_glx" in
  841. xyesyes)
  842. # Xlib-based GLX
  843. if test "$x11_pkgconfig" = yes; then
  844. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  845. GL_PC_REQ_PRIV="x11 xext"
  846. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  847. GL_LIB_DEPS="$XLIBGL_LIBS"
  848. else
  849. # should check these...
  850. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  851. GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
  852. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  853. GL_PC_CFLAGS="$X11_INCLUDES"
  854. fi
  855. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
  856. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
  857. ;;
  858. xyesno)
  859. # DRI-based GLX
  860. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  861. GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
  862. if test x"$driglx_direct" = xyes; then
  863. if test "x$have_libdrm" != xyes; then
  864. AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
  865. fi
  866. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  867. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
  868. fi
  869. # find the DRI deps for libGL
  870. if test "$x11_pkgconfig" = yes; then
  871. dri_modules="x11 xext xdamage xfixes"
  872. # add xf86vidmode if available
  873. PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
  874. if test "$HAVE_XF86VIDMODE" = yes ; then
  875. dri_modules="$dri_modules xxf86vm"
  876. fi
  877. # add xcb modules if necessary
  878. if test "$enable_xcb" = yes; then
  879. dri_modules="$dri_modules x11-xcb xcb-glx"
  880. fi
  881. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  882. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  883. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  884. GL_LIB_DEPS="$DRIGL_LIBS"
  885. else
  886. # should check these...
  887. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  888. if test "x$HAVE_XF86VIDMODE" == xyes; then
  889. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
  890. else
  891. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXdamage -lXfixes"
  892. fi
  893. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  894. GL_PC_CFLAGS="$X11_INCLUDES"
  895. # XCB can only be used from pkg-config
  896. if test "$enable_xcb" = yes; then
  897. PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
  898. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
  899. X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
  900. GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
  901. fi
  902. fi
  903. # need DRM libs, -lpthread, etc.
  904. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  905. GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  906. ;;
  907. esac
  908. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  909. GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  910. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  911. GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  912. AC_SUBST([GL_LIB_DEPS])
  913. AC_SUBST([GL_PC_REQ_PRIV])
  914. AC_SUBST([GL_PC_LIB_PRIV])
  915. AC_SUBST([GL_PC_CFLAGS])
  916. AC_SUBST([DRI_PC_REQ_PRIV])
  917. AC_SUBST([GLESv1_CM_LIB_DEPS])
  918. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  919. AC_SUBST([GLESv2_LIB_DEPS])
  920. AC_SUBST([GLESv2_PC_LIB_PRIV])
  921. GLAPI_LIB_DEPS="-lpthread"
  922. AC_SUBST([GLAPI_LIB_DEPS])
  923. dnl Setup default DRI CFLAGS
  924. DRI_CFLAGS='$(CFLAGS)'
  925. DRI_CXXFLAGS='$(CXXFLAGS)'
  926. DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
  927. MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
  928. AC_ARG_ENABLE([shared-dricore],
  929. [AS_HELP_STRING([--enable-shared-dricore],
  930. [link DRI modules with shared core DRI routines @<:@default=disabled@:>@])],
  931. [enable_dricore="$enableval"],
  932. [enable_dricore=no])
  933. if test "x$enable_dri" = xyes ; then
  934. if test "$enable_dricore" = yes ; then
  935. if test "$GCC$GXX" != yesyes ; then
  936. AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling. Disabling shared dricore])
  937. enable_dricore=no
  938. else
  939. DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
  940. DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
  941. DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
  942. DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
  943. DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
  944. DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
  945. MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
  946. fi
  947. fi
  948. fi
  949. AC_SUBST([DRICORE_LIBS])
  950. AC_SUBST([DRICORE_GLSL_LIBS])
  951. AC_SUBST([DRICORE_LIB_DEPS])
  952. AC_SUBST([DRI_CXXFLAGS])
  953. AC_SUBST([DRI_CFLAGS])
  954. AC_SUBST([MESA_MODULES])
  955. AC_SUBST([HAVE_XF86VIDMODE])
  956. dnl
  957. dnl More GLX setup
  958. dnl
  959. case "x$enable_glx$enable_xlib_glx" in
  960. xyesyes)
  961. DEFINES="$DEFINES -DUSE_XSHM"
  962. ;;
  963. xyesno)
  964. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  965. if test "x$driglx_direct" = xyes; then
  966. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  967. fi
  968. ;;
  969. esac
  970. dnl
  971. dnl TLS detection
  972. dnl
  973. AC_ARG_ENABLE([glx-tls],
  974. [AS_HELP_STRING([--enable-glx-tls],
  975. [enable TLS support in GLX @<:@default=disabled@:>@])],
  976. [GLX_USE_TLS="$enableval"],
  977. [GLX_USE_TLS=no])
  978. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  979. AS_IF([test "x$GLX_USE_TLS" = xyes],
  980. [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
  981. dnl
  982. dnl More DRI setup
  983. dnl
  984. dnl Directory for DRI drivers
  985. AC_ARG_WITH([dri-driverdir],
  986. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  987. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  988. [DRI_DRIVER_INSTALL_DIR="$withval"],
  989. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  990. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  991. dnl Extra search path for DRI drivers
  992. AC_ARG_WITH([dri-searchpath],
  993. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  994. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  995. [DRI_DRIVER_SEARCH_DIR="$withval"],
  996. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  997. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  998. dnl Which drivers to build - default is chosen by platform
  999. AC_ARG_WITH([dri-drivers],
  1000. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  1001. [comma delimited DRI drivers list, e.g.
  1002. "swrast,i965,radeon" @<:@default=auto@:>@])],
  1003. [with_dri_drivers="$withval"],
  1004. [with_dri_drivers=yes])
  1005. if test "x$with_dri_drivers" = x; then
  1006. with_dri_drivers=no
  1007. fi
  1008. dnl If $with_dri_drivers is yes, directories will be added through
  1009. dnl platform checks
  1010. DRI_DIRS=""
  1011. case "$with_dri_drivers" in
  1012. no) ;;
  1013. yes)
  1014. # classic DRI drivers require FEATURE_GL to build
  1015. if test "x$enable_opengl" = xyes; then
  1016. DRI_DIRS="yes"
  1017. fi
  1018. ;;
  1019. *)
  1020. # verify the requested driver directories exist
  1021. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  1022. for driver in $dri_drivers; do
  1023. test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
  1024. AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
  1025. done
  1026. DRI_DIRS="$dri_drivers"
  1027. if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
  1028. AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
  1029. fi
  1030. ;;
  1031. esac
  1032. dnl Set DRI_DIRS, DEFINES and LIB_DEPS
  1033. if test "x$enable_dri" = xyes; then
  1034. # Platform specific settings and drivers to build
  1035. case "$host_os" in
  1036. linux*)
  1037. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1038. DEFINES="$DEFINES -DHAVE_ALIAS"
  1039. case "$host_cpu" in
  1040. x86_64)
  1041. if test "x$DRI_DIRS" = "xyes"; then
  1042. DRI_DIRS="i915 i965 nouveau r200 r300 r600 radeon swrast"
  1043. fi
  1044. ;;
  1045. powerpc*)
  1046. # Build only the drivers for cards that exist on PowerPC.
  1047. if test "x$DRI_DIRS" = "xyes"; then
  1048. DRI_DIRS="r200 r300 r600 radeon swrast"
  1049. fi
  1050. ;;
  1051. sparc*)
  1052. # Build only the drivers for cards that exist on sparc
  1053. if test "x$DRI_DIRS" = "xyes"; then
  1054. DRI_DIRS="r200 r300 r600 radeon swrast"
  1055. fi
  1056. ;;
  1057. esac
  1058. ;;
  1059. freebsd* | dragonfly* | *netbsd*)
  1060. DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
  1061. DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
  1062. if test "x$DRI_DIRS" = "xyes"; then
  1063. DRI_DIRS="i915 i965 nouveau r200 r300 r600 radeon swrast"
  1064. fi
  1065. ;;
  1066. gnu*)
  1067. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1068. DEFINES="$DEFINES -DHAVE_ALIAS"
  1069. ;;
  1070. solaris*)
  1071. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1072. ;;
  1073. cygwin*)
  1074. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1075. if test "x$DRI_DIRS" = "xyes"; then
  1076. DRI_DIRS="swrast"
  1077. fi
  1078. ;;
  1079. esac
  1080. # default drivers
  1081. if test "x$DRI_DIRS" = "xyes"; then
  1082. DRI_DIRS="i915 i965 nouveau r200 r300 r600 radeon swrast"
  1083. fi
  1084. DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
  1085. # Check for expat
  1086. if test "x$enable_dri" = xyes; then
  1087. EXPAT_INCLUDES=""
  1088. EXPAT_LIB=-lexpat
  1089. AC_ARG_WITH([expat],
  1090. [AS_HELP_STRING([--with-expat=DIR],
  1091. [expat install directory])],[
  1092. EXPAT_INCLUDES="-I$withval/include"
  1093. CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
  1094. LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
  1095. EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
  1096. ])
  1097. AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
  1098. AC_CHECK_LIB([expat],[XML_ParserCreate],[],
  1099. [AC_MSG_ERROR([Expat required for DRI.])])
  1100. fi
  1101. # libdrm is required for all except swrast
  1102. if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
  1103. if test "x$have_libdrm" != xyes; then
  1104. AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
  1105. fi
  1106. fi
  1107. # put all the necessary libs together, including possibly libdricore
  1108. DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
  1109. fi
  1110. AC_SUBST([DRI_DIRS])
  1111. AC_SUBST([EXPAT_INCLUDES])
  1112. AC_SUBST([DRI_LIB_DEPS])
  1113. case $DRI_DIRS in
  1114. *i915*|*i965*)
  1115. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1116. ;;
  1117. esac
  1118. case $DRI_DIRS in
  1119. *nouveau*)
  1120. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  1121. ;;
  1122. esac
  1123. case $DRI_DIRS in
  1124. *radeon*|*r200*|*r300*|*r600*)
  1125. PKG_CHECK_MODULES([LIBDRM_RADEON],
  1126. [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
  1127. HAVE_LIBDRM_RADEON=yes,
  1128. HAVE_LIBDRM_RADEON=no)
  1129. if test "x$HAVE_LIBDRM_RADEON" = xyes; then
  1130. RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
  1131. RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
  1132. fi
  1133. ;;
  1134. esac
  1135. AC_SUBST([RADEON_CFLAGS])
  1136. AC_SUBST([RADEON_LDFLAGS])
  1137. dnl
  1138. dnl OSMesa configuration
  1139. dnl
  1140. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  1141. AC_ARG_WITH([osmesa-bits],
  1142. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  1143. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  1144. [osmesa_bits="$withval"],
  1145. [osmesa_bits=8])
  1146. if test "x$osmesa_bits" != x8; then
  1147. if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
  1148. AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
  1149. osmesa_bits=8
  1150. fi
  1151. fi
  1152. case "x$osmesa_bits" in
  1153. x8)
  1154. OSMESA_LIB=OSMesa
  1155. ;;
  1156. x16|x32)
  1157. OSMESA_LIB="OSMesa$osmesa_bits"
  1158. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  1159. ;;
  1160. *)
  1161. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  1162. ;;
  1163. esac
  1164. AC_SUBST([OSMESA_LIB])
  1165. if test "x$enable_osmesa" = xyes; then
  1166. # only link libraries with osmesa if shared
  1167. if test "$enable_static" = no; then
  1168. OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  1169. else
  1170. OSMESA_LIB_DEPS=""
  1171. fi
  1172. OSMESA_MESA_DEPS=""
  1173. OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  1174. fi
  1175. AC_SUBST([OSMESA_LIB_DEPS])
  1176. AC_SUBST([OSMESA_MESA_DEPS])
  1177. AC_SUBST([OSMESA_PC_REQ])
  1178. AC_SUBST([OSMESA_PC_LIB_PRIV])
  1179. dnl
  1180. dnl gbm configuration
  1181. dnl
  1182. if test "x$enable_gbm" = xauto; then
  1183. case "$with_egl_platforms" in
  1184. *drm*)
  1185. enable_gbm=yes ;;
  1186. *)
  1187. enable_gbm=no ;;
  1188. esac
  1189. fi
  1190. if test "x$enable_gbm" = xyes; then
  1191. SRC_DIRS="$SRC_DIRS gbm"
  1192. GBM_BACKEND_DIRS=""
  1193. PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
  1194. AC_MSG_ERROR([gbm needs udev]))
  1195. GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
  1196. if test "x$enable_dri" = xyes; then
  1197. GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
  1198. if test "$SHARED_GLAPI" -eq 0; then
  1199. AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
  1200. fi
  1201. fi
  1202. fi
  1203. AC_SUBST([GBM_LIB_DEPS])
  1204. AC_SUBST([GBM_BACKEND_DIRS])
  1205. GBM_PC_REQ_PRIV="libudev"
  1206. GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
  1207. GBM_PC_CFLAGS=
  1208. AC_SUBST([GBM_PC_REQ_PRIV])
  1209. AC_SUBST([GBM_PC_LIB_PRIV])
  1210. AC_SUBST([GBM_PC_CFLAGS])
  1211. dnl
  1212. dnl EGL configuration
  1213. dnl
  1214. EGL_CLIENT_APIS=""
  1215. if test "x$enable_egl" = xyes; then
  1216. SRC_DIRS="$SRC_DIRS egl"
  1217. EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
  1218. EGL_DRIVERS_DIRS=""
  1219. AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
  1220. if test "$enable_static" != yes; then
  1221. # build egl_glx when libGL is built
  1222. if test "x$enable_glx" = xyes; then
  1223. EGL_DRIVERS_DIRS="glx"
  1224. fi
  1225. PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
  1226. [have_libudev=yes],[have_libudev=no])
  1227. if test "$have_libudev" = yes; then
  1228. DEFINES="$DEFINES -DHAVE_LIBUDEV"
  1229. fi
  1230. if test "x$enable_dri" = xyes; then
  1231. # build egl_dri2 when xcb-dri2 is available
  1232. PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
  1233. [have_xcb_dri2=yes],[have_xcb_dri2=no])
  1234. if test "$have_xcb_dri2" = yes; then
  1235. EGL_DRIVER_DRI2=dri2
  1236. DEFINES="$DEFINES -DHAVE_XCB_DRI2"
  1237. # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
  1238. AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
  1239. [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
  1240. fi
  1241. fi
  1242. EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2"
  1243. fi
  1244. fi
  1245. AC_SUBST([EGL_LIB_DEPS])
  1246. AC_SUBST([EGL_DRIVERS_DIRS])
  1247. dnl
  1248. dnl EGL Gallium configuration
  1249. dnl
  1250. if test "x$enable_gallium_egl" = xyes; then
  1251. if test "x$with_gallium_drivers" = x; then
  1252. AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
  1253. fi
  1254. if test "x$enable_egl" = xno; then
  1255. AC_MSG_ERROR([cannot enable egl_gallium without EGL])
  1256. fi
  1257. if test "x$have_libdrm" != xyes; then
  1258. AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
  1259. fi
  1260. GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
  1261. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
  1262. HAVE_ST_EGL="yes"
  1263. fi
  1264. dnl
  1265. dnl gbm Gallium configuration
  1266. dnl
  1267. if test "x$enable_gallium_gbm" = xauto; then
  1268. case "$enable_gbm$HAVE_ST_EGL$with_egl_platforms" in
  1269. yesyes*drm*)
  1270. enable_gallium_gbm=yes ;;
  1271. *)
  1272. enable_gallium_gbm=no ;;
  1273. esac
  1274. fi
  1275. if test "x$enable_gallium_gbm" = xyes; then
  1276. if test "x$with_gallium_drivers" = x; then
  1277. AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
  1278. fi
  1279. if test "x$enable_gbm" = xno; then
  1280. AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
  1281. fi
  1282. GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
  1283. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
  1284. HAVE_ST_GBM="yes"
  1285. fi
  1286. dnl
  1287. dnl X.Org DDX configuration
  1288. dnl
  1289. if test "x$enable_xorg" = xyes; then
  1290. PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
  1291. PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
  1292. PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
  1293. PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
  1294. HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
  1295. HAVE_XEXTPROTO_71="no")
  1296. GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
  1297. HAVE_ST_XORG=yes
  1298. fi
  1299. dnl
  1300. dnl XA configuration
  1301. dnl
  1302. if test "x$enable_xa" = xyes; then
  1303. GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
  1304. HAVE_ST_XA=yes
  1305. fi
  1306. dnl
  1307. dnl OpenVG configuration
  1308. dnl
  1309. VG_LIB_DEPS=""
  1310. if test "x$enable_openvg" = xyes; then
  1311. if test "x$enable_egl" = xno; then
  1312. AC_MSG_ERROR([cannot enable OpenVG without EGL])
  1313. fi
  1314. if test "x$with_gallium_drivers" = x; then
  1315. AC_MSG_ERROR([cannot enable OpenVG without Gallium])
  1316. fi
  1317. if test "x$enable_gallium_egl" = xno; then
  1318. AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
  1319. fi
  1320. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
  1321. VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
  1322. CORE_DIRS="$CORE_DIRS mapi/vgapi"
  1323. GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
  1324. HAVE_ST_VEGA=yes
  1325. fi
  1326. dnl
  1327. dnl D3D1X configuration
  1328. dnl
  1329. if test "x$enable_d3d1x" = xyes; then
  1330. if test "x$with_gallium_drivers" = x; then
  1331. AC_MSG_ERROR([cannot enable D3D1X without Gallium])
  1332. fi
  1333. GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
  1334. HAVE_ST_D3D1X=yes
  1335. fi
  1336. dnl
  1337. dnl Gallium G3DVL configuration
  1338. dnl
  1339. AC_ARG_ENABLE([gallium-g3dvl],
  1340. [AS_HELP_STRING([--enable-gallium-g3dvl],
  1341. [build gallium g3dvl @<:@default=disabled@:>@])],
  1342. [enable_gallium_g3dvl="$enableval"],
  1343. [enable_gallium_g3dvl=no])
  1344. if test "x$enable_gallium_g3dvl" = xyes; then
  1345. if test "x$with_gallium_drivers" = x; then
  1346. AC_MSG_ERROR([cannot enable G3DVL without Gallium])
  1347. fi
  1348. if test "x$enable_xvmc" = xauto; then
  1349. PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
  1350. fi
  1351. if test "x$enable_vdpau" = xauto; then
  1352. PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
  1353. fi
  1354. if test "x$enable_va" = xauto; then
  1355. #don't enable vaapi state tracker even if package exists
  1356. #PKG_CHECK_EXISTS([libva], [enable_vdpau=yes], [enable_vdpau=no])
  1357. enable_va=no
  1358. fi
  1359. fi
  1360. if test "x$enable_xvmc" = xyes; then
  1361. PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 xorg-server])
  1362. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg/xvmc"
  1363. HAVE_ST_XVMC="yes"
  1364. fi
  1365. if test "x$enable_vdpau" = xyes; then
  1366. PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1])
  1367. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
  1368. HAVE_ST_VDPAU="yes"
  1369. fi
  1370. if test "x$enable_va" = xyes; then
  1371. PKG_CHECK_MODULES([LIBVA], [libva = 0.31.1])
  1372. AC_MSG_WARN([vaapi state tracker currently unmaintained])
  1373. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS va"
  1374. HAVE_ST_VA="yes"
  1375. fi
  1376. dnl
  1377. dnl GLU configuration
  1378. dnl
  1379. AC_ARG_ENABLE([glu],
  1380. [AS_HELP_STRING([--disable-glu],
  1381. [enable OpenGL Utility library @<:@default=enabled@:>@])],
  1382. [enable_glu="$enableval"],
  1383. [enable_glu=yes])
  1384. if test "x$enable_glu" = xyes; then
  1385. if test "x$enable_glx" = xno -a "x$enable_osmesa" = xno; then
  1386. AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
  1387. enable_glu=no
  1388. fi
  1389. fi
  1390. if test "x$enable_glu" = xyes; then
  1391. SRC_DIRS="$SRC_DIRS glu"
  1392. if test "x$enable_glx" = xno; then
  1393. # Link libGLU to libOSMesa instead of libGL
  1394. GLU_LIB_DEPS=""
  1395. GLU_PC_REQ="osmesa"
  1396. if test "$enable_static" = no; then
  1397. GLU_MESA_DEPS='-l$(OSMESA_LIB)'
  1398. else
  1399. GLU_MESA_DEPS=""
  1400. fi
  1401. else
  1402. # If static, empty GLU_LIB_DEPS and add libs for programs to link
  1403. GLU_PC_REQ="gl"
  1404. GLU_PC_LIB_PRIV="-lm"
  1405. if test "$enable_static" = no; then
  1406. GLU_LIB_DEPS="-lm"
  1407. GLU_MESA_DEPS='-l$(GL_LIB)'
  1408. else
  1409. GLU_LIB_DEPS=""
  1410. GLU_MESA_DEPS=""
  1411. fi
  1412. fi
  1413. fi
  1414. if test "$enable_static" = no; then
  1415. GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
  1416. fi
  1417. GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
  1418. AC_SUBST([GLU_LIB_DEPS])
  1419. AC_SUBST([GLU_MESA_DEPS])
  1420. AC_SUBST([GLU_PC_REQ])
  1421. AC_SUBST([GLU_PC_REQ_PRIV])
  1422. AC_SUBST([GLU_PC_LIB_PRIV])
  1423. AC_SUBST([GLU_PC_CFLAGS])
  1424. AC_SUBST([PROGRAM_DIRS])
  1425. dnl
  1426. dnl Gallium configuration
  1427. dnl
  1428. if test "x$with_gallium_drivers" != x; then
  1429. SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
  1430. fi
  1431. AC_SUBST([LLVM_CFLAGS])
  1432. AC_SUBST([LLVM_LIBS])
  1433. AC_SUBST([LLVM_LDFLAGS])
  1434. AC_SUBST([LLVM_VERSION])
  1435. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1436. x*yes*)
  1437. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
  1438. ;;
  1439. esac
  1440. AC_SUBST([VG_LIB_DEPS])
  1441. AC_SUBST([EGL_CLIENT_APIS])
  1442. AC_ARG_WITH([egl-platforms],
  1443. [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
  1444. [comma delimited native platforms libEGL supports, e.g.
  1445. "x11,drm" @<:@default=auto@:>@])],
  1446. [with_egl_platforms="$withval"],
  1447. [with_egl_platforms=yes])
  1448. EGL_PLATFORMS=""
  1449. WAYLAND_EGL_LIB_DEPS=""
  1450. case "$with_egl_platforms" in
  1451. yes)
  1452. if test "x$enable_egl" = xyes; then
  1453. EGL_PLATFORMS="x11"
  1454. fi
  1455. ;;
  1456. *)
  1457. if test "x$enable_egl" != xyes; then
  1458. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1459. fi
  1460. # verify the requested driver directories exist
  1461. egl_platforms=`IFS=', '; echo $with_egl_platforms`
  1462. for plat in $egl_platforms; do
  1463. test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
  1464. AC_MSG_ERROR([EGL platform '$plat' doesn't exist])
  1465. if test "$plat" = "fbdev"; then
  1466. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
  1467. fi
  1468. if test "$plat" = "null"; then
  1469. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
  1470. fi
  1471. if test "$plat" = "wayland"; then
  1472. PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
  1473. [AC_MSG_ERROR([cannot find libwayland-client])])
  1474. WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
  1475. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
  1476. fi
  1477. if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
  1478. AC_MSG_ERROR([EGL platform drm needs gbm])
  1479. fi
  1480. case "$plat$have_libudev" in
  1481. waylandno|drmno)
  1482. AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
  1483. esac
  1484. done
  1485. EGL_PLATFORMS="$egl_platforms"
  1486. ;;
  1487. esac
  1488. AC_SUBST([EGL_PLATFORMS])
  1489. AC_SUBST([WAYLAND_EGL_LIB_DEPS])
  1490. WAYLAND_EGL_PC_REQ_PRIV="wayland-client libdrm"
  1491. WAYLAND_EGL_PC_LIB_PRIV=
  1492. WAYLAND_EGL_PC_CFLAGS=
  1493. AC_SUBST([WAYLAND_EGL_PC_REQ_PRIV])
  1494. AC_SUBST([WAYLAND_EGL_PC_LIB_PRIV])
  1495. AC_SUBST([WAYLAND_EGL_PC_CFLAGS])
  1496. AC_ARG_WITH([egl-driver-dir],
  1497. [AS_HELP_STRING([--with-egl-driver-dir=DIR],
  1498. [directory for EGL drivers [[default=${libdir}/egl]]])],
  1499. [EGL_DRIVER_INSTALL_DIR="$withval"],
  1500. [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
  1501. AC_SUBST([EGL_DRIVER_INSTALL_DIR])
  1502. AC_ARG_WITH([xorg-driver-dir],
  1503. [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
  1504. [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
  1505. [XORG_DRIVER_INSTALL_DIR="$withval"],
  1506. [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
  1507. AC_SUBST([XORG_DRIVER_INSTALL_DIR])
  1508. AC_ARG_WITH([max-width],
  1509. [AS_HELP_STRING([--with-max-width=N],
  1510. [Maximum framebuffer width (4096)])],
  1511. [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
  1512. AS_IF([test "${withval}" -gt "4096"],
  1513. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1514. )
  1515. AC_ARG_WITH([max-height],
  1516. [AS_HELP_STRING([--with-max-height=N],
  1517. [Maximum framebuffer height (4096)])],
  1518. [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
  1519. AS_IF([test "${withval}" -gt "4096"],
  1520. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1521. )
  1522. dnl
  1523. dnl Gallium LLVM
  1524. dnl
  1525. AC_ARG_ENABLE([gallium-llvm],
  1526. [AS_HELP_STRING([--enable-gallium-llvm],
  1527. [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
  1528. [enable_gallium_llvm="$enableval"],
  1529. [enable_gallium_llvm=auto])
  1530. if test "x$with_gallium_drivers" = x; then
  1531. enable_gallium_llvm=no
  1532. fi
  1533. if test "x$enable_gallium_llvm" = xauto; then
  1534. case "$host_cpu" in
  1535. i*86|x86_64) enable_gallium_llvm=yes;;
  1536. esac
  1537. fi
  1538. if test "x$enable_gallium_llvm" = xyes; then
  1539. AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
  1540. if test "x$LLVM_CONFIG" != xno; then
  1541. LLVM_VERSION=`$LLVM_CONFIG --version`
  1542. LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed 's/-DNDEBUG\>//g'`
  1543. LLVM_LIBS="`$LLVM_CONFIG --libs` -lstdc++"
  1544. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  1545. DEFINES="$DEFINES -D__STDC_CONSTANT_MACROS"
  1546. MESA_LLVM=1
  1547. else
  1548. MESA_LLVM=0
  1549. fi
  1550. else
  1551. MESA_LLVM=0
  1552. fi
  1553. dnl Directory for VDPAU libs
  1554. AC_ARG_WITH([vdpau-libdir],
  1555. [AS_HELP_STRING([--with-vdpau-libdir=DIR],
  1556. [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
  1557. [VDPAU_LIB_INSTALL_DIR="$withval"],
  1558. [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
  1559. AC_SUBST([VDPAU_LIB_INSTALL_DIR])
  1560. dnl Directory for VA libs
  1561. AC_ARG_WITH([va-libdir],
  1562. [AS_HELP_STRING([--with-va-libdir=DIR],
  1563. [directory for the VA libraries @<:@default=${libdir}/va@:>@])],
  1564. [VA_LIB_INSTALL_DIR="$withval"],
  1565. [VA_LIB_INSTALL_DIR='${libdir}/va'])
  1566. AC_SUBST([VA_LIB_INSTALL_DIR])
  1567. dnl
  1568. dnl Gallium helper functions
  1569. dnl
  1570. gallium_check_st() {
  1571. if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
  1572. test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
  1573. test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then
  1574. if test "x$have_libdrm" != xyes; then
  1575. AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
  1576. fi
  1577. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
  1578. fi
  1579. if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
  1580. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
  1581. fi
  1582. if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
  1583. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
  1584. fi
  1585. if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then
  1586. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
  1587. fi
  1588. if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
  1589. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
  1590. NEED_G3DVL_DRI="yes"
  1591. fi
  1592. if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
  1593. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
  1594. NEED_G3DVL_DRI="yes"
  1595. fi
  1596. if test "x$HAVE_ST_VA" = xyes && test "x$7" != x; then
  1597. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7"
  1598. NEED_G3DVL_DRI="yes"
  1599. fi
  1600. }
  1601. gallium_require_llvm() {
  1602. if test "x$MESA_LLVM" = x0; then
  1603. case "$host_cpu" in
  1604. i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
  1605. esac
  1606. fi
  1607. }
  1608. dnl Gallium drivers
  1609. dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
  1610. if test "x$with_gallium_drivers" != x; then
  1611. gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
  1612. for driver in $gallium_drivers; do
  1613. case "x$driver" in
  1614. xsvga)
  1615. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
  1616. gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
  1617. ;;
  1618. xi915)
  1619. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1620. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
  1621. if test "x$MESA_LLVM" = x1; then
  1622. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1623. fi
  1624. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
  1625. gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
  1626. ;;
  1627. xi965)
  1628. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1629. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965 softpipe"
  1630. if test "x$MESA_LLVM" = x1; then
  1631. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1632. fi
  1633. gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
  1634. ;;
  1635. xr300)
  1636. gallium_require_llvm "Gallium R300"
  1637. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1638. gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300" "va-r300"
  1639. ;;
  1640. xr600)
  1641. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
  1642. gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
  1643. ;;
  1644. xnouveau)
  1645. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  1646. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
  1647. gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau"
  1648. ;;
  1649. xswrast)
  1650. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
  1651. if test "x$MESA_LLVM" = x1; then
  1652. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1653. fi
  1654. if test "x$HAVE_ST_DRI" = xyes; then
  1655. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
  1656. fi
  1657. if test "x$HAVE_ST_VDPAU" = xyes; then
  1658. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
  1659. fi
  1660. if test "x$HAVE_ST_XVMC" = xyes; then
  1661. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
  1662. fi
  1663. if test "x$HAVE_ST_VA" = xyes; then
  1664. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS va-softpipe"
  1665. fi
  1666. if test "x$HAVE_ST_VDPAU" == xyes ||
  1667. test "x$HAVE_ST_XVMC" == xyes ||
  1668. test "x$HAVE_ST_VA" == xyes; then
  1669. if test "x$HAVE_WINSYS_XLIB" != xyes; then
  1670. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  1671. fi
  1672. fi
  1673. ;;
  1674. *)
  1675. AC_MSG_ERROR([Unknown Gallium driver: $driver])
  1676. ;;
  1677. esac
  1678. done
  1679. fi
  1680. if test "x$NEED_G3DVL_DRI" = xyes; then
  1681. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS g3dvl/dri"
  1682. fi
  1683. dnl prepend CORE_DIRS to SRC_DIRS
  1684. SRC_DIRS="$CORE_DIRS $SRC_DIRS"
  1685. dnl Restore LDFLAGS and CPPFLAGS
  1686. LDFLAGS="$_SAVE_LDFLAGS"
  1687. CPPFLAGS="$_SAVE_CPPFLAGS"
  1688. dnl Add user CFLAGS and CXXFLAGS
  1689. CFLAGS="$CFLAGS $USER_CFLAGS"
  1690. CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
  1691. dnl Substitute the config
  1692. AC_CONFIG_FILES([configs/autoconf])
  1693. dnl Replace the configs/current symlink
  1694. AC_CONFIG_COMMANDS([configs],[
  1695. if test -f configs/current || test -L configs/current; then
  1696. rm -f configs/current
  1697. fi
  1698. ln -s autoconf configs/current
  1699. ])
  1700. dnl Sort the dirs alphabetically
  1701. GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1702. GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1703. GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1704. GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1705. AC_OUTPUT
  1706. dnl
  1707. dnl Output some configuration info for the user
  1708. dnl
  1709. echo ""
  1710. echo " prefix: $prefix"
  1711. echo " exec_prefix: $exec_prefix"
  1712. echo " libdir: $libdir"
  1713. echo " includedir: $includedir"
  1714. dnl API info
  1715. echo ""
  1716. echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
  1717. echo " OpenVG: $enable_openvg"
  1718. dnl Driver info
  1719. echo ""
  1720. if test "x$enable_osmesa" != xno; then
  1721. echo " OSMesa: lib$OSMESA_LIB"
  1722. else
  1723. echo " OSMesa: no"
  1724. fi
  1725. if test "x$enable_dri" != xno; then
  1726. # cleanup the drivers var
  1727. dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1728. if test "x$DRI_DIRS" = x; then
  1729. echo " DRI drivers: no"
  1730. else
  1731. echo " DRI drivers: $dri_dirs"
  1732. fi
  1733. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1734. echo " Shared dricore: $enable_dricore"
  1735. fi
  1736. case "x$enable_glx$enable_xlib_glx" in
  1737. xyesyes)
  1738. echo " GLX: Xlib-based"
  1739. ;;
  1740. xyesno)
  1741. echo " GLX: DRI-based"
  1742. echo " Use XCB: $enable_xcb"
  1743. ;;
  1744. *)
  1745. echo " GLX: $enable_glx"
  1746. ;;
  1747. esac
  1748. echo ""
  1749. echo " GLU: $enable_glu"
  1750. dnl EGL
  1751. echo ""
  1752. echo " EGL: $enable_egl"
  1753. if test "$enable_egl" = yes; then
  1754. echo " EGL platforms: $EGL_PLATFORMS"
  1755. egl_drivers=""
  1756. for d in $EGL_DRIVERS_DIRS; do
  1757. egl_drivers="$egl_drivers builtin:egl_$d"
  1758. done
  1759. if test "x$HAVE_ST_EGL" = xyes; then
  1760. echo " EGL drivers: ${egl_drivers} egl_gallium"
  1761. echo " EGL Gallium STs:$EGL_CLIENT_APIS"
  1762. else
  1763. echo " EGL drivers: $egl_drivers"
  1764. fi
  1765. fi
  1766. echo ""
  1767. if test "x$MESA_LLVM" = x1; then
  1768. echo " llvm: yes"
  1769. echo " llvm-config: $LLVM_CONFIG"
  1770. echo " llvm-version: $LLVM_VERSION"
  1771. else
  1772. echo " llvm: no"
  1773. fi
  1774. echo ""
  1775. if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
  1776. echo " Gallium: yes"
  1777. echo " Gallium dirs: $GALLIUM_DIRS"
  1778. echo " Target dirs: $GALLIUM_TARGET_DIRS"
  1779. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  1780. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  1781. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  1782. else
  1783. echo " Gallium: no"
  1784. fi
  1785. dnl Libraries
  1786. echo ""
  1787. echo " Shared libs: $enable_shared"
  1788. echo " Static libs: $enable_static"
  1789. dnl Compiler options
  1790. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  1791. cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1792. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1793. cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1794. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1795. defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1796. echo ""
  1797. echo " CFLAGS: $cflags"
  1798. echo " CXXFLAGS: $cxxflags"
  1799. echo " Macros: $defines"
  1800. echo ""
  1801. echo " PYTHON2: $PYTHON2"
  1802. echo ""
  1803. echo " Run '${MAKE-make}' to build Mesa"
  1804. echo ""