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

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