Clone of mesa.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

configure.ac 61KB

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