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

configure.ac 47KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613
  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 Versions for external dependencies
  16. LIBDRM_REQUIRED=2.4.15
  17. LIBDRM_RADEON_REQUIRED=2.4.17
  18. DRI2PROTO_REQUIRED=2.1
  19. GLPROTO_REQUIRED=1.4.11
  20. LIBDRM_XORG_REQUIRED=2.4.17
  21. LIBKMS_XORG_REQUIRED=1.0.0
  22. dnl Check for progs
  23. AC_PROG_CPP
  24. AC_PROG_CC
  25. AC_PROG_CXX
  26. AC_CHECK_PROGS([MAKE], [gmake make])
  27. AC_PATH_PROG([MKDEP], [makedepend])
  28. AC_PATH_PROG([SED], [sed])
  29. dnl Our fallback install-sh is a symlink to minstall. Use the existing
  30. dnl configuration in that case.
  31. AC_PROG_INSTALL
  32. test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
  33. dnl We need a POSIX shell for parts of the build. Assume we have one
  34. dnl in most cases.
  35. case "$host_os" in
  36. solaris*)
  37. # Solaris /bin/sh is too old/non-POSIX compliant
  38. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  39. SHELL="$POSIX_SHELL"
  40. ;;
  41. esac
  42. dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
  43. dnl versions are explictly not supported.
  44. if test "x$GCC" = xyes; then
  45. AC_MSG_CHECKING([whether gcc version is sufficient])
  46. major=0
  47. minor=0
  48. GCC_VERSION=`$CC -dumpversion`
  49. if test $? -eq 0; then
  50. major=`echo $GCC_VERSION | cut -d. -f1`
  51. minor=`echo $GCC_VERSION | cut -d. -f1`
  52. fi
  53. if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
  54. AC_MSG_RESULT([no])
  55. AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
  56. else
  57. AC_MSG_RESULT([yes])
  58. fi
  59. fi
  60. MKDEP_OPTIONS=-fdepend
  61. dnl Ask gcc where it's keeping its secret headers
  62. if test "x$GCC" = xyes; then
  63. for dir in include include-fixed; do
  64. GCC_INCLUDES=`$CC -print-file-name=$dir`
  65. if test "x$GCC_INCLUDES" != x && \
  66. test "$GCC_INCLUDES" != "$dir" && \
  67. test -d "$GCC_INCLUDES"; then
  68. MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
  69. fi
  70. done
  71. fi
  72. AC_SUBST([MKDEP_OPTIONS])
  73. dnl Make sure the pkg-config macros are defined
  74. m4_ifndef([PKG_PROG_PKG_CONFIG],
  75. [m4_fatal([Could not locate the pkg-config autoconf macros.
  76. These are usually located in /usr/share/aclocal/pkg.m4. If your macros
  77. are in a different location, try setting the environment variable
  78. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  79. PKG_PROG_PKG_CONFIG()
  80. dnl LIB_DIR - library basename
  81. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  82. AC_SUBST([LIB_DIR])
  83. dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
  84. _SAVE_LDFLAGS="$LDFLAGS"
  85. AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
  86. AC_SUBST([EXTRA_LIB_PATH])
  87. dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
  88. _SAVE_CPPFLAGS="$CPPFLAGS"
  89. AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
  90. AC_SUBST([X11_INCLUDES])
  91. dnl Compiler macros
  92. DEFINES=""
  93. AC_SUBST([DEFINES])
  94. case "$host_os" in
  95. linux*|*-gnu*|gnu*)
  96. DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
  97. ;;
  98. solaris*)
  99. DEFINES="$DEFINES -DPTHREADS -DSVR4"
  100. ;;
  101. cygwin*)
  102. DEFINES="$DEFINES -DPTHREADS"
  103. ;;
  104. esac
  105. dnl Add flags for gcc and g++
  106. if test "x$GCC" = xyes; then
  107. CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
  108. # Enable -fvisibility=hidden if using a gcc that supports it
  109. save_CFLAGS="$CFLAGS"
  110. AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
  111. CFLAGS="$CFLAGS -fvisibility=hidden"
  112. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  113. [CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]);
  114. # Work around aliasing bugs - developers should comment this out
  115. CFLAGS="$CFLAGS -fno-strict-aliasing"
  116. fi
  117. if test "x$GXX" = xyes; then
  118. CXXFLAGS="$CXXFLAGS -Wall"
  119. # Work around aliasing bugs - developers should comment this out
  120. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  121. fi
  122. dnl These should be unnecessary, but let the user set them if they want
  123. AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
  124. Default is to use CFLAGS.])
  125. AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
  126. compiler. Default is to use CFLAGS.])
  127. AC_SUBST([OPT_FLAGS])
  128. AC_SUBST([ARCH_FLAGS])
  129. dnl
  130. dnl Hacks to enable 32 or 64 bit build
  131. dnl
  132. AC_ARG_ENABLE([32-bit],
  133. [AS_HELP_STRING([--enable-32-bit],
  134. [build 32-bit libraries @<:@default=auto@:>@])],
  135. [enable_32bit="$enableval"],
  136. [enable_32bit=auto]
  137. )
  138. if test "x$enable_32bit" = xyes; then
  139. if test "x$GCC" = xyes; then
  140. CFLAGS="$CFLAGS -m32"
  141. ARCH_FLAGS="$ARCH_FLAGS -m32"
  142. fi
  143. if test "x$GXX" = xyes; then
  144. CXXFLAGS="$CXXFLAGS -m32"
  145. fi
  146. fi
  147. AC_ARG_ENABLE([64-bit],
  148. [AS_HELP_STRING([--enable-64-bit],
  149. [build 64-bit libraries @<:@default=auto@:>@])],
  150. [enable_64bit="$enableval"],
  151. [enable_64bit=auto]
  152. )
  153. if test "x$enable_64bit" = xyes; then
  154. if test "x$GCC" = xyes; then
  155. CFLAGS="$CFLAGS -m64"
  156. fi
  157. if test "x$GXX" = xyes; then
  158. CXXFLAGS="$CXXFLAGS -m64"
  159. fi
  160. fi
  161. dnl
  162. dnl shared/static libraries, mimic libtool options
  163. dnl
  164. AC_ARG_ENABLE([static],
  165. [AS_HELP_STRING([--enable-static],
  166. [build static libraries @<:@default=disabled@:>@])],
  167. [enable_static="$enableval"],
  168. [enable_static=no]
  169. )
  170. case "x$enable_static" in
  171. xyes|xno ) ;;
  172. x ) enable_static=no ;;
  173. * )
  174. AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
  175. ;;
  176. esac
  177. AC_ARG_ENABLE([shared],
  178. [AS_HELP_STRING([--disable-shared],
  179. [build shared libraries @<:@default=enabled@:>@])],
  180. [enable_shared="$enableval"],
  181. [enable_shared=yes]
  182. )
  183. case "x$enable_shared" in
  184. xyes|xno ) ;;
  185. x ) enable_shared=yes ;;
  186. * )
  187. AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
  188. ;;
  189. esac
  190. dnl Can't have static and shared libraries, default to static if user
  191. dnl explicitly requested. If both disabled, set to static since shared
  192. dnl was explicitly requirested.
  193. case "x$enable_static$enable_shared" in
  194. xyesyes )
  195. AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
  196. enable_shared=no
  197. ;;
  198. xnono )
  199. AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
  200. enable_static=yes
  201. ;;
  202. esac
  203. dnl
  204. dnl mklib options
  205. dnl
  206. AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
  207. if test "$enable_static" = yes; then
  208. MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
  209. fi
  210. AC_SUBST([MKLIB_OPTIONS])
  211. dnl
  212. dnl other compiler options
  213. dnl
  214. AC_ARG_ENABLE([debug],
  215. [AS_HELP_STRING([--enable-debug],
  216. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  217. [enable_debug="$enableval"],
  218. [enable_debug=no]
  219. )
  220. if test "x$enable_debug" = xyes; then
  221. DEFINES="$DEFINES -DDEBUG"
  222. if test "x$GCC" = xyes; then
  223. CFLAGS="$CFLAGS -g"
  224. fi
  225. if test "x$GXX" = xyes; then
  226. CXXFLAGS="$CXXFLAGS -g"
  227. fi
  228. fi
  229. dnl
  230. dnl library names
  231. dnl
  232. if test "$enable_static" = yes; then
  233. LIB_EXTENSION='a'
  234. else
  235. case "$host_os" in
  236. darwin* )
  237. LIB_EXTENSION='dylib' ;;
  238. cygwin* )
  239. LIB_EXTENSION='dll.a' ;;
  240. aix* )
  241. LIB_EXTENSION='a' ;;
  242. * )
  243. LIB_EXTENSION='so' ;;
  244. esac
  245. fi
  246. GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
  247. GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
  248. GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
  249. GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
  250. OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
  251. EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
  252. GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
  253. GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
  254. VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
  255. GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
  256. GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
  257. GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
  258. GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
  259. OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
  260. EGL_LIB_GLOB='lib$(EGL_LIB).*'${LIB_EXTENSION}'*'
  261. GLESv1_CM_LIB_GLOB='lib$(GLESv1_CM_LIB).*'${LIB_EXTENSION}'*'
  262. GLESv2_LIB_GLOB='lib$(GLESv2_LIB).*'${LIB_EXTENSION}'*'
  263. VG_LIB_GLOB='lib$(VG_LIB).*'${LIB_EXTENSION}'*'
  264. AC_SUBST([GL_LIB_NAME])
  265. AC_SUBST([GLU_LIB_NAME])
  266. AC_SUBST([GLUT_LIB_NAME])
  267. AC_SUBST([GLW_LIB_NAME])
  268. AC_SUBST([OSMESA_LIB_NAME])
  269. AC_SUBST([EGL_LIB_NAME])
  270. AC_SUBST([GLESv1_CM_LIB_NAME])
  271. AC_SUBST([GLESv2_LIB_NAME])
  272. AC_SUBST([VG_LIB_NAME])
  273. AC_SUBST([GL_LIB_GLOB])
  274. AC_SUBST([GLU_LIB_GLOB])
  275. AC_SUBST([GLUT_LIB_GLOB])
  276. AC_SUBST([GLW_LIB_GLOB])
  277. AC_SUBST([OSMESA_LIB_GLOB])
  278. AC_SUBST([EGL_LIB_GLOB])
  279. AC_SUBST([GLESv1_CM_LIB_GLOB])
  280. AC_SUBST([GLESv2_LIB_GLOB])
  281. AC_SUBST([VG_LIB_GLOB])
  282. dnl
  283. dnl Arch/platform-specific settings
  284. dnl
  285. AC_ARG_ENABLE([asm],
  286. [AS_HELP_STRING([--disable-asm],
  287. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  288. [enable_asm="$enableval"],
  289. [enable_asm=yes]
  290. )
  291. asm_arch=""
  292. ASM_FLAGS=""
  293. MESA_ASM_SOURCES=""
  294. GLAPI_ASM_SOURCES=""
  295. AC_MSG_CHECKING([whether to enable assembly])
  296. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  297. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  298. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  299. case "$host_cpu" in
  300. i?86 | x86_64)
  301. enable_asm=no
  302. AC_MSG_RESULT([no, cross compiling])
  303. ;;
  304. esac
  305. fi
  306. # check for supported arches
  307. if test "x$enable_asm" = xyes; then
  308. case "$host_cpu" in
  309. i?86)
  310. case "$host_os" in
  311. linux* | *freebsd* | dragonfly*)
  312. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  313. ;;
  314. esac
  315. ;;
  316. x86_64)
  317. case "$host_os" in
  318. linux* | *freebsd* | dragonfly*)
  319. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  320. ;;
  321. esac
  322. ;;
  323. powerpc)
  324. case "$host_os" in
  325. linux*)
  326. asm_arch=ppc
  327. ;;
  328. esac
  329. ;;
  330. sparc*)
  331. case "$host_os" in
  332. linux*)
  333. asm_arch=sparc
  334. ;;
  335. esac
  336. ;;
  337. esac
  338. case "$asm_arch" in
  339. x86)
  340. ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  341. MESA_ASM_SOURCES='$(X86_SOURCES)'
  342. GLAPI_ASM_SOURCES='$(X86_API)'
  343. AC_MSG_RESULT([yes, x86])
  344. ;;
  345. x86_64)
  346. ASM_FLAGS="-DUSE_X86_64_ASM"
  347. MESA_ASM_SOURCES='$(X86-64_SOURCES)'
  348. GLAPI_ASM_SOURCES='$(X86-64_API)'
  349. AC_MSG_RESULT([yes, x86_64])
  350. ;;
  351. ppc)
  352. ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
  353. MESA_ASM_SOURCES='$(PPC_SOURCES)'
  354. AC_MSG_RESULT([yes, ppc])
  355. ;;
  356. sparc)
  357. ASM_FLAGS="-DUSE_SPARC_ASM"
  358. MESA_ASM_SOURCES='$(SPARC_SOURCES)'
  359. GLAPI_ASM_SOURCES='$(SPARC_API)'
  360. AC_MSG_RESULT([yes, sparc])
  361. ;;
  362. *)
  363. AC_MSG_RESULT([no, platform not supported])
  364. ;;
  365. esac
  366. fi
  367. AC_SUBST([ASM_FLAGS])
  368. AC_SUBST([MESA_ASM_SOURCES])
  369. AC_SUBST([GLAPI_ASM_SOURCES])
  370. dnl PIC code macro
  371. MESA_PIC_FLAGS
  372. dnl Check to see if dlopen is in default libraries (like Solaris, which
  373. dnl has it in libc), or if libdl is needed to get it.
  374. AC_CHECK_FUNC([dlopen], [],
  375. [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
  376. dnl See if posix_memalign is available
  377. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  378. dnl SELinux awareness.
  379. AC_ARG_ENABLE([selinux],
  380. [AS_HELP_STRING([--enable-selinux],
  381. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  382. [MESA_SELINUX="$enableval"],
  383. [MESA_SELINUX=no])
  384. if test "x$enable_selinux" = "xyes"; then
  385. AC_CHECK_HEADER([selinux/selinux.h],[],
  386. [AC_MSG_ERROR([SELinux headers not found])])
  387. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  388. [AC_MSG_ERROR([SELinux library not found])])
  389. SELINUX_LIBS="-lselinux"
  390. DEFINES="$DEFINES -DMESA_SELINUX"
  391. fi
  392. dnl
  393. dnl Driver configuration. Options are xlib, dri and osmesa right now.
  394. dnl More later: fbdev, ...
  395. dnl
  396. default_driver="xlib"
  397. case "$host_os" in
  398. linux*)
  399. case "$host_cpu" in
  400. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  401. esac
  402. ;;
  403. *freebsd* | dragonfly*)
  404. case "$host_cpu" in
  405. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  406. esac
  407. ;;
  408. esac
  409. AC_ARG_WITH([driver],
  410. [AS_HELP_STRING([--with-driver=DRIVER],
  411. [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
  412. [mesa_driver="$withval"],
  413. [mesa_driver="$default_driver"])
  414. dnl Check for valid option
  415. case "x$mesa_driver" in
  416. xxlib|xdri|xosmesa)
  417. ;;
  418. *)
  419. AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
  420. ;;
  421. esac
  422. dnl
  423. dnl Driver specific build directories
  424. dnl
  425. dnl this variable will be prepended to SRC_DIRS and is not exported
  426. CORE_DIRS="mapi/glapi glsl mesa"
  427. SRC_DIRS=""
  428. GLU_DIRS="sgi"
  429. GALLIUM_DIRS="auxiliary drivers state_trackers"
  430. GALLIUM_TARGET_DIRS=""
  431. GALLIUM_WINSYS_DIRS="sw"
  432. GALLIUM_DRIVERS_DIRS="softpipe failover trace rbug identity"
  433. GALLIUM_STATE_TRACKERS_DIRS=""
  434. case "$mesa_driver" in
  435. xlib)
  436. DRIVER_DIRS="x11"
  437. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  438. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
  439. ;;
  440. dri)
  441. SRC_DIRS="$SRC_DIRS glx"
  442. DRIVER_DIRS="dri"
  443. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri sw/drm"
  444. ;;
  445. osmesa)
  446. DRIVER_DIRS="osmesa"
  447. ;;
  448. esac
  449. AC_SUBST([SRC_DIRS])
  450. AC_SUBST([GLU_DIRS])
  451. AC_SUBST([DRIVER_DIRS])
  452. AC_SUBST([GALLIUM_DIRS])
  453. AC_SUBST([GALLIUM_TARGET_DIRS])
  454. AC_SUBST([GALLIUM_WINSYS_DIRS])
  455. AC_SUBST([GALLIUM_DRIVERS_DIRS])
  456. AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
  457. AC_SUBST([MESA_LLVM])
  458. dnl
  459. dnl Find out if X is available. The variable have_x is set if libX11 is
  460. dnl found to mimic AC_PATH_XTRA.
  461. dnl
  462. if test -n "$PKG_CONFIG"; then
  463. AC_MSG_CHECKING([pkg-config files for X11 are available])
  464. PKG_CHECK_EXISTS([x11],[
  465. x11_pkgconfig=yes
  466. have_x=yes
  467. ],[
  468. x11_pkgconfig=no
  469. ])
  470. AC_MSG_RESULT([$x11_pkgconfig])
  471. else
  472. x11_pkgconfig=no
  473. fi
  474. dnl Use the autoconf macro if no pkg-config files
  475. if test "$x11_pkgconfig" = yes; then
  476. PKG_CHECK_MODULES([X11], [x11])
  477. else
  478. AC_PATH_XTRA
  479. test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
  480. test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
  481. AC_SUBST([X11_CFLAGS])
  482. AC_SUBST([X11_LIBS])
  483. fi
  484. dnl Try to tell the user that the --x-* options are only used when
  485. dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
  486. m4_divert_once([HELP_BEGIN],
  487. [These options are only used when the X libraries cannot be found by the
  488. pkg-config utility.])
  489. dnl We need X for xlib and dri, so bomb now if it's not found
  490. case "$mesa_driver" in
  491. xlib|dri)
  492. if test "$no_x" = yes; then
  493. AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
  494. fi
  495. ;;
  496. esac
  497. dnl XCB - this is only used for GLX right now
  498. AC_ARG_ENABLE([xcb],
  499. [AS_HELP_STRING([--enable-xcb],
  500. [use XCB for GLX @<:@default=disabled@:>@])],
  501. [enable_xcb="$enableval"],
  502. [enable_xcb=no])
  503. if test "x$enable_xcb" = xyes; then
  504. DEFINES="$DEFINES -DUSE_XCB"
  505. else
  506. enable_xcb=no
  507. fi
  508. dnl
  509. dnl libGL configuration per driver
  510. dnl
  511. case "$mesa_driver" in
  512. xlib)
  513. if test "$x11_pkgconfig" = yes; then
  514. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  515. GL_PC_REQ_PRIV="x11 xext"
  516. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  517. GL_LIB_DEPS="$XLIBGL_LIBS"
  518. else
  519. # should check these...
  520. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  521. GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
  522. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  523. GL_PC_CFLAGS="$X11_INCLUDES"
  524. fi
  525. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
  526. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
  527. # if static, move the external libraries to the programs
  528. # and empty the libraries for libGL
  529. if test "$enable_static" = yes; then
  530. APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
  531. GL_LIB_DEPS=""
  532. fi
  533. ;;
  534. dri)
  535. # DRI must be shared, I think
  536. if test "$enable_static" = yes; then
  537. AC_MSG_ERROR([Can't use static libraries for DRI drivers])
  538. fi
  539. # Check for libdrm
  540. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
  541. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  542. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  543. GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
  544. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  545. # find the DRI deps for libGL
  546. if test "$x11_pkgconfig" = yes; then
  547. # add xcb modules if necessary
  548. dri_modules="x11 xext xxf86vm xdamage xfixes"
  549. if test "$enable_xcb" = yes; then
  550. dri_modules="$dri_modules x11-xcb xcb-glx"
  551. fi
  552. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  553. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  554. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  555. GL_LIB_DEPS="$DRIGL_LIBS"
  556. else
  557. # should check these...
  558. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  559. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
  560. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  561. GL_PC_CFLAGS="$X11_INCLUDES"
  562. # XCB can only be used from pkg-config
  563. if test "$enable_xcb" = yes; then
  564. PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
  565. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
  566. X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
  567. GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
  568. fi
  569. fi
  570. # need DRM libs, -lpthread, etc.
  571. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  572. GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  573. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  574. GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  575. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  576. GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  577. ;;
  578. osmesa)
  579. # No libGL for osmesa
  580. GL_LIB_DEPS=""
  581. ;;
  582. esac
  583. AC_SUBST([GL_LIB_DEPS])
  584. AC_SUBST([GL_PC_REQ_PRIV])
  585. AC_SUBST([GL_PC_LIB_PRIV])
  586. AC_SUBST([GL_PC_CFLAGS])
  587. AC_SUBST([DRI_PC_REQ_PRIV])
  588. AC_SUBST([GLESv1_LIB_DEPS])
  589. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  590. AC_SUBST([GLESv2_LIB_DEPS])
  591. AC_SUBST([GLESv2_PC_LIB_PRIV])
  592. dnl
  593. dnl More X11 setup
  594. dnl
  595. if test "$mesa_driver" = xlib; then
  596. DEFINES="$DEFINES -DUSE_XSHM"
  597. fi
  598. dnl
  599. dnl More DRI setup
  600. dnl
  601. AC_ARG_ENABLE([glx-tls],
  602. [AS_HELP_STRING([--enable-glx-tls],
  603. [enable TLS support in GLX @<:@default=disabled@:>@])],
  604. [GLX_USE_TLS="$enableval"],
  605. [GLX_USE_TLS=no])
  606. dnl Directory for DRI drivers
  607. AC_ARG_WITH([dri-driverdir],
  608. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  609. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  610. [DRI_DRIVER_INSTALL_DIR="$withval"],
  611. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  612. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  613. dnl Extra search path for DRI drivers
  614. AC_ARG_WITH([dri-searchpath],
  615. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  616. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  617. [DRI_DRIVER_SEARCH_DIR="$withval"],
  618. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  619. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  620. dnl Direct rendering or just indirect rendering
  621. AC_ARG_ENABLE([driglx-direct],
  622. [AS_HELP_STRING([--disable-driglx-direct],
  623. [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
  624. [driglx_direct="$enableval"],
  625. [driglx_direct="yes"])
  626. dnl Which drivers to build - default is chosen by platform
  627. AC_ARG_WITH([dri-drivers],
  628. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  629. [comma delimited DRI drivers list, e.g.
  630. "swrast,i965,radeon" @<:@default=auto@:>@])],
  631. [with_dri_drivers="$withval"],
  632. [with_dri_drivers=yes])
  633. if test "x$with_dri_drivers" = x; then
  634. with_dri_drivers=no
  635. fi
  636. dnl Determine which APIs to support
  637. AC_ARG_ENABLE([opengl],
  638. [AS_HELP_STRING([--disable-opengl],
  639. [disable support for standard OpenGL API @<:@default=no@:>@])],
  640. [enable_opengl="$enableval"],
  641. [enable_opengl=yes])
  642. AC_ARG_ENABLE([gles1],
  643. [AS_HELP_STRING([--enable-gles1],
  644. [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
  645. [enable_gles1="$enableval"],
  646. [enable_gles1=no])
  647. AC_ARG_ENABLE([gles2],
  648. [AS_HELP_STRING([--enable-gles2],
  649. [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
  650. [enable_gles2="$enableval"],
  651. [enable_gles2=no])
  652. AC_ARG_ENABLE([gles-overlay],
  653. [AS_HELP_STRING([--enable-gles-overlay],
  654. [build separate OpenGL ES only libraries @<:@default=no@:>@])],
  655. [enable_gles_overlay="$enableval"],
  656. [enable_gles_overlay=no])
  657. API_DEFINES=""
  658. GLES_OVERLAY=0
  659. if test "x$enable_opengl" = xno; then
  660. API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
  661. else
  662. API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
  663. fi
  664. if test "x$enable_gles1" = xyes; then
  665. API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
  666. fi
  667. if test "x$enable_gles2" = xyes; then
  668. API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
  669. fi
  670. if test "x$enable_gles_overlay" = xyes -o \
  671. "x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
  672. CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
  673. if test "x$enable_gles_overlay" = xyes; then
  674. GLES_OVERLAY=1
  675. fi
  676. fi
  677. AC_SUBST([API_DEFINES])
  678. AC_SUBST([GLES_OVERLAY])
  679. dnl If $with_dri_drivers is yes, directories will be added through
  680. dnl platform checks
  681. DRI_DIRS=""
  682. case "$with_dri_drivers" in
  683. no) ;;
  684. yes)
  685. DRI_DIRS="yes"
  686. ;;
  687. *)
  688. # verify the requested driver directories exist
  689. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  690. for driver in $dri_drivers; do
  691. test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
  692. AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
  693. done
  694. DRI_DIRS="$dri_drivers"
  695. ;;
  696. esac
  697. dnl Set DRI_DIRS, DEFINES and LIB_DEPS
  698. if test "$mesa_driver" = dri; then
  699. # Use TLS in GLX?
  700. if test "x$GLX_USE_TLS" = xyes; then
  701. DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
  702. fi
  703. # Platform specific settings and drivers to build
  704. case "$host_os" in
  705. linux*)
  706. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  707. if test "x$driglx_direct" = xyes; then
  708. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  709. fi
  710. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
  711. case "$host_cpu" in
  712. x86_64)
  713. # sis is missing because they have not be converted to use
  714. # the new interface. i810 are missing because there is no
  715. # x86-64 system where they could *ever* be used.
  716. if test "x$DRI_DIRS" = "xyes"; then
  717. DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \
  718. savage tdfx unichrome swrast"
  719. fi
  720. ;;
  721. powerpc*)
  722. # Build only the drivers for cards that exist on PowerPC.
  723. # At some point MGA will be added, but not yet.
  724. if test "x$DRI_DIRS" = "xyes"; then
  725. DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
  726. fi
  727. ;;
  728. sparc*)
  729. # Build only the drivers for cards that exist on sparc`
  730. if test "x$DRI_DIRS" = "xyes"; then
  731. DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
  732. fi
  733. ;;
  734. esac
  735. ;;
  736. freebsd* | dragonfly*)
  737. DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
  738. DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
  739. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  740. if test "x$driglx_direct" = xyes; then
  741. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  742. fi
  743. if test "x$GXX" = xyes; then
  744. CXXFLAGS="$CXXFLAGS -ansi -pedantic"
  745. fi
  746. if test "x$DRI_DIRS" = "xyes"; then
  747. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
  748. unichrome savage sis swrast"
  749. fi
  750. ;;
  751. gnu*)
  752. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  753. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
  754. ;;
  755. solaris*)
  756. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  757. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  758. if test "x$driglx_direct" = xyes; then
  759. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  760. fi
  761. ;;
  762. esac
  763. # default drivers
  764. if test "x$DRI_DIRS" = "xyes"; then
  765. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
  766. savage sis tdfx unichrome swrast"
  767. fi
  768. DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
  769. # Check for expat
  770. EXPAT_INCLUDES=""
  771. EXPAT_LIB=-lexpat
  772. AC_ARG_WITH([expat],
  773. [AS_HELP_STRING([--with-expat=DIR],
  774. [expat install directory])],[
  775. EXPAT_INCLUDES="-I$withval/include"
  776. CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
  777. LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
  778. EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
  779. ])
  780. AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
  781. AC_CHECK_LIB([expat],[XML_ParserCreate],[],
  782. [AC_MSG_ERROR([Expat required for DRI.])])
  783. # put all the necessary libs together
  784. DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
  785. fi
  786. AC_SUBST([DRI_DIRS])
  787. AC_SUBST([EXPAT_INCLUDES])
  788. AC_SUBST([DRI_LIB_DEPS])
  789. case $DRI_DIRS in
  790. *i915*|*i965*)
  791. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.19])
  792. ;;
  793. esac
  794. case $DRI_DIRS in
  795. *radeon*|*r200*|*r300*|*r600*)
  796. PKG_CHECK_MODULES([LIBDRM_RADEON],
  797. [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
  798. HAVE_LIBDRM_RADEON=yes,
  799. HAVE_LIBDRM_RADEON=no)
  800. if test "$HAVE_LIBDRM_RADEON" = yes; then
  801. RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
  802. RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
  803. fi
  804. ;;
  805. esac
  806. AC_SUBST([RADEON_CFLAGS])
  807. AC_SUBST([RADEON_LDFLAGS])
  808. dnl
  809. dnl OSMesa configuration
  810. dnl
  811. if test "$mesa_driver" = xlib; then
  812. default_gl_osmesa=yes
  813. else
  814. default_gl_osmesa=no
  815. fi
  816. AC_ARG_ENABLE([gl-osmesa],
  817. [AS_HELP_STRING([--enable-gl-osmesa],
  818. [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
  819. [gl_osmesa="$enableval"],
  820. [gl_osmesa="$default_gl_osmesa"])
  821. if test "x$gl_osmesa" = xyes; then
  822. if test "$mesa_driver" = osmesa; then
  823. AC_MSG_ERROR([libGL is not available for OSMesa driver])
  824. else
  825. DRIVER_DIRS="$DRIVER_DIRS osmesa"
  826. fi
  827. fi
  828. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  829. AC_ARG_WITH([osmesa-bits],
  830. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  831. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  832. [osmesa_bits="$withval"],
  833. [osmesa_bits=8])
  834. if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
  835. AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
  836. osmesa_bits=8
  837. fi
  838. case "x$osmesa_bits" in
  839. x8)
  840. OSMESA_LIB=OSMesa
  841. ;;
  842. x16|x32)
  843. OSMESA_LIB="OSMesa$osmesa_bits"
  844. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  845. ;;
  846. *)
  847. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  848. ;;
  849. esac
  850. AC_SUBST([OSMESA_LIB])
  851. case "$mesa_driver" in
  852. osmesa)
  853. # only link libraries with osmesa if shared
  854. if test "$enable_static" = no; then
  855. OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  856. else
  857. OSMESA_LIB_DEPS=""
  858. fi
  859. OSMESA_MESA_DEPS=""
  860. OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  861. ;;
  862. *)
  863. # Link OSMesa to libGL otherwise
  864. OSMESA_LIB_DEPS=""
  865. # only link libraries with osmesa if shared
  866. if test "$enable_static" = no; then
  867. OSMESA_MESA_DEPS='-l$(GL_LIB)'
  868. else
  869. OSMESA_MESA_DEPS=""
  870. fi
  871. OSMESA_PC_REQ="gl"
  872. ;;
  873. esac
  874. OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
  875. AC_SUBST([OSMESA_LIB_DEPS])
  876. AC_SUBST([OSMESA_MESA_DEPS])
  877. AC_SUBST([OSMESA_PC_REQ])
  878. AC_SUBST([OSMESA_PC_LIB_PRIV])
  879. dnl
  880. dnl EGL configuration
  881. dnl
  882. AC_ARG_ENABLE([egl],
  883. [AS_HELP_STRING([--disable-egl],
  884. [disable EGL library @<:@default=enabled@:>@])],
  885. [enable_egl="$enableval"],
  886. [enable_egl=yes])
  887. if test "x$enable_egl" = xyes; then
  888. SRC_DIRS="$SRC_DIRS egl"
  889. EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
  890. EGL_DRIVERS_DIRS=""
  891. if test "$enable_static" != yes; then
  892. # build egl_glx when libGL is built
  893. if test "$mesa_driver" != osmesa; then
  894. EGL_DRIVERS_DIRS="glx"
  895. fi
  896. # build egl_dri2 when xcb-dri2 is available
  897. PKG_CHECK_MODULES([EGL_DRI2], [x11-xcb xcb-dri2 xcb-xfixes libdrm],
  898. [have_xcb_dri2=yes],[have_xcb_dri2=no])
  899. if test "$have_xcb_dri2" = yes; then
  900. EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2"
  901. fi
  902. fi
  903. fi
  904. AC_SUBST([EGL_LIB_DEPS])
  905. AC_SUBST([EGL_DRIVERS_DIRS])
  906. dnl
  907. dnl GLU configuration
  908. dnl
  909. AC_ARG_ENABLE([glu],
  910. [AS_HELP_STRING([--disable-glu],
  911. [enable OpenGL Utility library @<:@default=enabled@:>@])],
  912. [enable_glu="$enableval"],
  913. [enable_glu=yes])
  914. if test "x$enable_glu" = xyes; then
  915. SRC_DIRS="$SRC_DIRS glu"
  916. case "$mesa_driver" in
  917. osmesa)
  918. # Link libGLU to libOSMesa instead of libGL
  919. GLU_LIB_DEPS=""
  920. GLU_PC_REQ="osmesa"
  921. if test "$enable_static" = no; then
  922. GLU_MESA_DEPS='-l$(OSMESA_LIB)'
  923. else
  924. GLU_MESA_DEPS=""
  925. fi
  926. ;;
  927. *)
  928. # If static, empty GLU_LIB_DEPS and add libs for programs to link
  929. GLU_PC_REQ="gl"
  930. GLU_PC_LIB_PRIV="-lm"
  931. if test "$enable_static" = no; then
  932. GLU_LIB_DEPS="-lm"
  933. GLU_MESA_DEPS='-l$(GL_LIB)'
  934. else
  935. GLU_LIB_DEPS=""
  936. GLU_MESA_DEPS=""
  937. APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
  938. fi
  939. ;;
  940. esac
  941. fi
  942. if test "$enable_static" = no; then
  943. GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
  944. fi
  945. GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
  946. AC_SUBST([GLU_LIB_DEPS])
  947. AC_SUBST([GLU_MESA_DEPS])
  948. AC_SUBST([GLU_PC_REQ])
  949. AC_SUBST([GLU_PC_REQ_PRIV])
  950. AC_SUBST([GLU_PC_LIB_PRIV])
  951. AC_SUBST([GLU_PC_CFLAGS])
  952. dnl
  953. dnl GLw configuration
  954. dnl
  955. AC_ARG_ENABLE([glw],
  956. [AS_HELP_STRING([--disable-glw],
  957. [enable Xt/Motif widget library @<:@default=enabled@:>@])],
  958. [enable_glw="$enableval"],
  959. [enable_glw=yes])
  960. dnl Don't build GLw on osmesa
  961. if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
  962. AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
  963. enable_glw=no
  964. fi
  965. AC_ARG_ENABLE([motif],
  966. [AS_HELP_STRING([--enable-motif],
  967. [use Motif widgets in GLw @<:@default=disabled@:>@])],
  968. [enable_motif="$enableval"],
  969. [enable_motif=no])
  970. if test "x$enable_glw" = xyes; then
  971. SRC_DIRS="$SRC_DIRS glw"
  972. if test "$x11_pkgconfig" = yes; then
  973. PKG_CHECK_MODULES([GLW],[x11 xt])
  974. GLW_PC_REQ_PRIV="x11 xt"
  975. GLW_LIB_DEPS="$GLW_LIBS"
  976. else
  977. # should check these...
  978. GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
  979. GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
  980. GLW_PC_CFLAGS="$X11_INCLUDES"
  981. fi
  982. GLW_SOURCES="GLwDrawA.c"
  983. MOTIF_CFLAGS=
  984. if test "x$enable_motif" = xyes; then
  985. GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
  986. AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
  987. if test "x$MOTIF_CONFIG" != xno; then
  988. MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
  989. MOTIF_LIBS=`$MOTIF_CONFIG --libs`
  990. else
  991. AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
  992. [AC_MSG_ERROR([Can't locate Motif headers])])
  993. AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
  994. [AC_MSG_ERROR([Can't locate Motif Xm library])])
  995. fi
  996. # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
  997. GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
  998. GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
  999. GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
  1000. fi
  1001. # If static, empty GLW_LIB_DEPS and add libs for programs to link
  1002. GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV"
  1003. if test "$enable_static" = no; then
  1004. GLW_MESA_DEPS='-l$(GL_LIB)'
  1005. GLW_LIB_DEPS="$GLW_LIB_DEPS"
  1006. else
  1007. APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
  1008. GLW_LIB_DEPS=""
  1009. GLW_MESA_DEPS=""
  1010. fi
  1011. fi
  1012. AC_SUBST([GLW_LIB_DEPS])
  1013. AC_SUBST([GLW_MESA_DEPS])
  1014. AC_SUBST([GLW_SOURCES])
  1015. AC_SUBST([MOTIF_CFLAGS])
  1016. AC_SUBST([GLW_PC_REQ_PRIV])
  1017. AC_SUBST([GLW_PC_LIB_PRIV])
  1018. AC_SUBST([GLW_PC_CFLAGS])
  1019. dnl
  1020. dnl GLUT configuration
  1021. dnl
  1022. if test -f "$srcdir/include/GL/glut.h"; then
  1023. default_glut=yes
  1024. else
  1025. default_glut=no
  1026. fi
  1027. AC_ARG_ENABLE([glut],
  1028. [AS_HELP_STRING([--disable-glut],
  1029. [enable GLUT library @<:@default=enabled if source available@:>@])],
  1030. [enable_glut="$enableval"],
  1031. [enable_glut="$default_glut"])
  1032. dnl Can't build glut if GLU not available
  1033. if test "x$enable_glu$enable_glut" = xnoyes; then
  1034. AC_MSG_WARN([Disabling glut since GLU is disabled])
  1035. enable_glut=no
  1036. fi
  1037. dnl Don't build glut on osmesa
  1038. if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
  1039. AC_MSG_WARN([Disabling glut since the driver is OSMesa])
  1040. enable_glut=no
  1041. fi
  1042. if test "x$enable_glut" = xyes; then
  1043. SRC_DIRS="$SRC_DIRS glut/glx"
  1044. GLUT_CFLAGS=""
  1045. if test "x$GCC" = xyes; then
  1046. GLUT_CFLAGS="-fexceptions"
  1047. fi
  1048. if test "$x11_pkgconfig" = yes; then
  1049. PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
  1050. GLUT_PC_REQ_PRIV="x11 xmu xi"
  1051. GLUT_LIB_DEPS="$GLUT_LIBS"
  1052. else
  1053. # should check these...
  1054. GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
  1055. GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
  1056. GLUT_PC_CFLAGS="$X11_INCLUDES"
  1057. fi
  1058. GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
  1059. GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
  1060. # If static, empty GLUT_LIB_DEPS and add libs for programs to link
  1061. if test "$enable_static" = no; then
  1062. GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
  1063. else
  1064. APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
  1065. GLUT_LIB_DEPS=""
  1066. GLUT_MESA_DEPS=""
  1067. fi
  1068. fi
  1069. AC_SUBST([GLUT_LIB_DEPS])
  1070. AC_SUBST([GLUT_MESA_DEPS])
  1071. AC_SUBST([GLUT_CFLAGS])
  1072. AC_SUBST([GLUT_PC_REQ_PRIV])
  1073. AC_SUBST([GLUT_PC_LIB_PRIV])
  1074. AC_SUBST([GLUT_PC_CFLAGS])
  1075. dnl
  1076. dnl Program library dependencies
  1077. dnl Only libm is added here if necessary as the libraries should
  1078. dnl be pulled in by the linker
  1079. dnl
  1080. if test "x$APP_LIB_DEPS" = x; then
  1081. case "$host_os" in
  1082. solaris*)
  1083. APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
  1084. ;;
  1085. cygwin*)
  1086. APP_LIB_DEPS="-lX11"
  1087. ;;
  1088. *)
  1089. APP_LIB_DEPS="-lm"
  1090. ;;
  1091. esac
  1092. fi
  1093. AC_SUBST([APP_LIB_DEPS])
  1094. AC_SUBST([PROGRAM_DIRS])
  1095. dnl
  1096. dnl Gallium configuration
  1097. dnl
  1098. AC_ARG_ENABLE([gallium],
  1099. [AS_HELP_STRING([--disable-gallium],
  1100. [build gallium @<:@default=enabled@:>@])],
  1101. [enable_gallium="$enableval"],
  1102. [enable_gallium=yes])
  1103. if test "x$enable_gallium" = xyes; then
  1104. SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
  1105. AC_CHECK_HEADER([udis86.h], [HAS_UDIS86="yes"],
  1106. [HAS_UDIS86="no"])
  1107. AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
  1108. fi
  1109. AC_SUBST([LLVM_CFLAGS])
  1110. AC_SUBST([LLVM_LIBS])
  1111. AC_SUBST([LLVM_LDFLAGS])
  1112. AC_SUBST([LLVM_VERSION])
  1113. VG_LIB_DEPS=""
  1114. EGL_CLIENT_APIS='$(GL_LIB)'
  1115. if test "x$enable_gles_overlay" = xyes; then
  1116. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
  1117. fi
  1118. dnl
  1119. dnl Gallium state trackers configuration
  1120. dnl
  1121. AC_ARG_WITH([state-trackers],
  1122. [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
  1123. [comma delimited state_trackers list, e.g.
  1124. "egl,glx" @<:@default=auto@:>@])],
  1125. [with_state_trackers="$withval"],
  1126. [with_state_trackers=yes])
  1127. case "$with_state_trackers" in
  1128. no)
  1129. GALLIUM_STATE_TRACKERS_DIRS=""
  1130. ;;
  1131. yes)
  1132. # look at what else is built
  1133. case "$mesa_driver" in
  1134. xlib)
  1135. GALLIUM_STATE_TRACKERS_DIRS=glx
  1136. ;;
  1137. dri)
  1138. GALLIUM_STATE_TRACKERS_DIRS="dri"
  1139. HAVE_ST_DRI="yes"
  1140. if test "x$enable_egl" = xyes; then
  1141. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
  1142. HAVE_ST_EGL="yes"
  1143. fi
  1144. # Have only tested st/xorg on 1.6.0 servers
  1145. PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
  1146. HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
  1147. HAVE_ST_XORG="no")
  1148. ;;
  1149. esac
  1150. ;;
  1151. *)
  1152. # verify the requested state tracker exist
  1153. state_trackers=""
  1154. _state_trackers=`IFS=', '; echo $with_state_trackers`
  1155. for tracker in $_state_trackers; do
  1156. case "$tracker" in
  1157. dri)
  1158. if test "x$mesa_driver" != xdri; then
  1159. AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri])
  1160. fi
  1161. HAVE_ST_DRI="yes"
  1162. ;;
  1163. egl)
  1164. if test "x$enable_egl" != xyes; then
  1165. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1166. fi
  1167. HAVE_ST_EGL="yes"
  1168. ;;
  1169. xorg)
  1170. PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
  1171. PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
  1172. HAVE_ST_XORG="yes"
  1173. ;;
  1174. es)
  1175. AC_MSG_WARN([state tracker 'es' has been replaced by --enable-gles-overlay])
  1176. if test "x$enable_gles_overlay" != xyes; then
  1177. if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
  1178. CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
  1179. fi
  1180. GLES_OVERLAY=1
  1181. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
  1182. fi
  1183. tracker=""
  1184. ;;
  1185. vega)
  1186. CORE_DIRS="$CORE_DIRS mapi/vgapi"
  1187. VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
  1188. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
  1189. ;;
  1190. esac
  1191. if test -n "$tracker"; then
  1192. test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
  1193. AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
  1194. if test -n "$state_trackers"; then
  1195. state_trackers="$state_trackers $tracker"
  1196. else
  1197. state_trackers="$tracker"
  1198. fi
  1199. fi
  1200. done
  1201. GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
  1202. ;;
  1203. esac
  1204. AC_SUBST([VG_LIB_DEPS])
  1205. AC_SUBST([EGL_CLIENT_APIS])
  1206. if test "x$HAVE_ST_EGL" = xyes; then
  1207. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-apis"
  1208. fi
  1209. if test "x$HAVE_ST_XORG" = xyes; then
  1210. PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
  1211. HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
  1212. HAVE_XEXTPROTO_71="no")
  1213. fi
  1214. AC_ARG_WITH([egl-displays],
  1215. [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
  1216. [comma delimited native displays libEGL supports, e.g.
  1217. "x11,kms" @<:@default=auto@:>@])],
  1218. [with_egl_displays="$withval"],
  1219. [with_egl_displays=yes])
  1220. EGL_DISPLAYS=""
  1221. case "$with_egl_displays" in
  1222. yes)
  1223. if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
  1224. EGL_DISPLAYS="x11"
  1225. fi
  1226. ;;
  1227. *)
  1228. if test "x$enable_egl" != xyes; then
  1229. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1230. fi
  1231. # verify the requested driver directories exist
  1232. egl_displays=`IFS=', '; echo $with_egl_displays`
  1233. for dpy in $egl_displays; do
  1234. test -d "$srcdir/src/gallium/state_trackers/egl/$dpy" || \
  1235. AC_MSG_ERROR([EGL display '$dpy' does't exist])
  1236. done
  1237. EGL_DISPLAYS="$egl_displays"
  1238. ;;
  1239. esac
  1240. AC_SUBST([EGL_DISPLAYS])
  1241. AC_ARG_WITH([egl-driver-dir],
  1242. [AS_HELP_STRING([--with-egl-driver-dir=DIR],
  1243. [directory for EGL drivers [[default=${libdir}/egl]]])],
  1244. [EGL_DRIVER_INSTALL_DIR="$withval"],
  1245. [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
  1246. AC_SUBST([EGL_DRIVER_INSTALL_DIR])
  1247. AC_ARG_WITH([xorg-driver-dir],
  1248. [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
  1249. [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
  1250. [XORG_DRIVER_INSTALL_DIR="$withval"],
  1251. [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
  1252. AC_SUBST([XORG_DRIVER_INSTALL_DIR])
  1253. AC_ARG_WITH([max-width],
  1254. [AS_HELP_STRING([--with-max-width=N],
  1255. [Maximum framebuffer width (4096)])],
  1256. [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
  1257. AS_IF([test "${withval}" -gt "4096"],
  1258. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1259. )
  1260. AC_ARG_WITH([max-height],
  1261. [AS_HELP_STRING([--with-max-height=N],
  1262. [Maximum framebuffer height (4096)])],
  1263. [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
  1264. AS_IF([test "${withval}" -gt "4096"],
  1265. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1266. )
  1267. dnl
  1268. dnl Gallium LLVM
  1269. dnl
  1270. AC_ARG_ENABLE([gallium-llvm],
  1271. [AS_HELP_STRING([--enable-gallium-llvm],
  1272. [build gallium LLVM support @<:@default=disabled@:>@])],
  1273. [enable_gallium_llvm="$enableval"],
  1274. [enable_gallium_llvm=auto])
  1275. if test "x$enable_gallium_llvm" = xyes; then
  1276. if test "x$LLVM_CONFIG" != xno; then
  1277. LLVM_VERSION=`$LLVM_CONFIG --version`
  1278. LLVM_CFLAGS=`$LLVM_CONFIG --cflags`
  1279. LLVM_LIBS="`$LLVM_CONFIG --libs jit interpreter nativecodegen bitwriter` -lstdc++"
  1280. if test "x$HAS_UDIS86" != xno; then
  1281. LLVM_LIBS="$LLVM_LIBS -ludis86"
  1282. DEFINES="$DEFINES -DHAVE_UDIS86"
  1283. fi
  1284. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  1285. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1286. DEFINES="$DEFINES -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS"
  1287. MESA_LLVM=1
  1288. else
  1289. MESA_LLVM=0
  1290. fi
  1291. else
  1292. MESA_LLVM=0
  1293. fi
  1294. dnl
  1295. dnl Gallium helper functions
  1296. dnl
  1297. gallium_check_st() {
  1298. if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_EGL" = xyes || test "x$HAVE_ST_XORG" = xyes; then
  1299. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
  1300. fi
  1301. if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
  1302. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
  1303. fi
  1304. if test "x$HAVE_ST_EGL" = xyes && test "x$3" != x; then
  1305. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
  1306. fi
  1307. if test "x$HAVE_ST_XORG" = xyes && test "x$4" != x; then
  1308. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
  1309. fi
  1310. }
  1311. dnl
  1312. dnl Gallium SVGA configuration
  1313. dnl
  1314. AC_ARG_ENABLE([gallium-svga],
  1315. [AS_HELP_STRING([--enable-gallium-svga],
  1316. [build gallium SVGA @<:@default=disabled@:>@])],
  1317. [enable_gallium_svga="$enableval"],
  1318. [enable_gallium_svga=auto])
  1319. if test "x$enable_gallium_svga" = xyes; then
  1320. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
  1321. gallium_check_st "svga/drm" "dri-vmwgfx" "egl-vmwgfx" "xorg-vmwgfx"
  1322. elif test "x$enable_gallium_svga" = xauto; then
  1323. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
  1324. fi
  1325. dnl
  1326. dnl Gallium Intel configuration
  1327. dnl
  1328. AC_ARG_ENABLE([gallium-intel],
  1329. [AS_HELP_STRING([--enable-gallium-intel],
  1330. [build gallium intel @<:@default=disabled@:>@])],
  1331. [enable_gallium_intel="$enableval"],
  1332. [enable_gallium_intel=auto])
  1333. if test "x$enable_gallium_intel" = xyes; then
  1334. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
  1335. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
  1336. gallium_check_st "i915/drm i965/drm" "dri-i915 dri-i965" "egl-i915 egl-i965" "xorg-i915 xorg-i965"
  1337. elif test "x$enable_gallium_intel" = xauto; then
  1338. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
  1339. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
  1340. fi
  1341. dnl
  1342. dnl Gallium Radeon configuration
  1343. dnl
  1344. AC_ARG_ENABLE([gallium-radeon],
  1345. [AS_HELP_STRING([--enable-gallium-radeon],
  1346. [build gallium radeon @<:@default=disabled@:>@])],
  1347. [enable_gallium_radeon="$enableval"],
  1348. [enable_gallium_radeon=auto])
  1349. if test "x$enable_gallium_radeon" = xyes; then
  1350. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1351. gallium_check_st "radeon/drm" "dri-radeong" "egl-radeon" "xorg-radeon"
  1352. elif test "x$enable_gallium_radeon" = xauto; then
  1353. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1354. fi
  1355. dnl
  1356. dnl Gallium Radeon r600g configuration
  1357. dnl
  1358. AC_ARG_ENABLE([gallium-r600],
  1359. [AS_HELP_STRING([--enable-gallium-r600],
  1360. [build gallium radeon @<:@default=disabled@:>@])],
  1361. [enable_gallium_r600="$enableval"],
  1362. [enable_gallium_r600=auto])
  1363. if test "x$enable_gallium_r600" = xyes; then
  1364. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
  1365. gallium_check_st "r600/drm" "dri-r600"
  1366. fi
  1367. dnl
  1368. dnl Gallium Nouveau configuration
  1369. dnl
  1370. AC_ARG_ENABLE([gallium-nouveau],
  1371. [AS_HELP_STRING([--enable-gallium-nouveau],
  1372. [build gallium nouveau @<:@default=disabled@:>@])],
  1373. [enable_gallium_nouveau="$enableval"],
  1374. [enable_gallium_nouveau=no])
  1375. if test "x$enable_gallium_nouveau" = xyes; then
  1376. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
  1377. gallium_check_st "nouveau/drm" "dri-nouveau" "egl-nouveau" "xorg-nouveau"
  1378. fi
  1379. dnl
  1380. dnl Gallium swrast configuration
  1381. dnl
  1382. AC_ARG_ENABLE([gallium-swrast],
  1383. [AS_HELP_STRING([--enable-gallium-swrast],
  1384. [build gallium swrast @<:@default=auto@:>@])],
  1385. [enable_gallium_swrast="$enableval"],
  1386. [enable_gallium_swrast=auto])
  1387. if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then
  1388. if test "x$HAVE_ST_DRI" = xyes; then
  1389. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
  1390. fi
  1391. if test "x$HAVE_ST_EGL" = xyes; then
  1392. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-swrast"
  1393. fi
  1394. fi
  1395. dnl prepend CORE_DIRS to SRC_DIRS
  1396. SRC_DIRS="$CORE_DIRS $SRC_DIRS"
  1397. dnl Restore LDFLAGS and CPPFLAGS
  1398. LDFLAGS="$_SAVE_LDFLAGS"
  1399. CPPFLAGS="$_SAVE_CPPFLAGS"
  1400. dnl Substitute the config
  1401. AC_CONFIG_FILES([configs/autoconf])
  1402. dnl Replace the configs/current symlink
  1403. AC_CONFIG_COMMANDS([configs],[
  1404. if test -f configs/current || test -L configs/current; then
  1405. rm -f configs/current
  1406. fi
  1407. ln -s autoconf configs/current
  1408. ])
  1409. AC_OUTPUT
  1410. dnl
  1411. dnl Output some configuration info for the user
  1412. dnl
  1413. echo ""
  1414. echo " prefix: $prefix"
  1415. echo " exec_prefix: $exec_prefix"
  1416. echo " libdir: $libdir"
  1417. echo " includedir: $includedir"
  1418. dnl Driver info
  1419. echo ""
  1420. echo " Driver: $mesa_driver"
  1421. if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
  1422. echo " OSMesa: lib$OSMESA_LIB"
  1423. else
  1424. echo " OSMesa: no"
  1425. fi
  1426. if test "$mesa_driver" = dri; then
  1427. # cleanup the drivers var
  1428. dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1429. if test "x$DRI_DIRS" = x; then
  1430. echo " DRI drivers: no"
  1431. else
  1432. echo " DRI drivers: $dri_dirs"
  1433. fi
  1434. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1435. fi
  1436. echo " Use XCB: $enable_xcb"
  1437. echo ""
  1438. if test "x$MESA_LLVM" = x1; then
  1439. echo " llvm: yes"
  1440. echo " llvm-config: $LLVM_CONFIG"
  1441. echo " llvm-version: $LLVM_VERSION"
  1442. else
  1443. echo " llvm: no"
  1444. fi
  1445. echo ""
  1446. if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
  1447. echo " Gallium: yes"
  1448. echo " Gallium dirs: $GALLIUM_DIRS"
  1449. echo " Target dirs: $GALLIUM_TARGET_DIRS"
  1450. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  1451. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  1452. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  1453. if test "x$HAVE_ST_EGL" = xyes; then
  1454. echo " EGL client APIs: $EGL_CLIENT_APIS"
  1455. fi
  1456. else
  1457. echo " Gallium: no"
  1458. fi
  1459. dnl Libraries
  1460. echo ""
  1461. echo " Shared libs: $enable_shared"
  1462. echo " Static libs: $enable_static"
  1463. if test "$enable_egl" = yes; then
  1464. echo " EGL: $EGL_DRIVERS_DIRS"
  1465. echo " EGL displays: $EGL_DISPLAYS"
  1466. else
  1467. echo " EGL: no"
  1468. fi
  1469. echo " GLU: $enable_glu"
  1470. echo " GLw: $enable_glw (Motif: $enable_motif)"
  1471. echo " glut: $enable_glut"
  1472. dnl Compiler options
  1473. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  1474. cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1475. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1476. cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1477. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1478. defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1479. echo ""
  1480. echo " CFLAGS: $cflags"
  1481. echo " CXXFLAGS: $cxxflags"
  1482. echo " Macros: $defines"
  1483. echo ""
  1484. echo " Run '${MAKE-make}' to build Mesa"
  1485. echo ""