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

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