Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 60KB

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