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.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296
  1. dnl Process this file with autoconf to create configure.
  2. AC_PREREQ([2.60])
  3. dnl Tell the user about autoconf.html in the --help output
  4. m4_divert_once([HELP_END], [
  5. See docs/autoconf.html for more details on the options for Mesa.])
  6. m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION)))
  7. AC_INIT([Mesa], [MESA_VERSION],
  8. [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
  9. AC_CONFIG_AUX_DIR([bin])
  10. AC_CONFIG_MACRO_DIR([m4])
  11. AC_CANONICAL_SYSTEM
  12. AM_INIT_AUTOMAKE([foreign])
  13. # Support silent build rules, requires at least automake-1.11. Disable
  14. # by either passing --disable-silent-rules to configure or passing V=1
  15. # to make
  16. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  17. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  18. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  19. dnl Set internal versions
  20. OSMESA_VERSION=8
  21. AC_SUBST([OSMESA_VERSION])
  22. dnl Versions for external dependencies
  23. LIBDRM_REQUIRED=2.4.38
  24. LIBDRM_RADEON_REQUIRED=2.4.54
  25. LIBDRM_INTEL_REQUIRED=2.4.52
  26. LIBDRM_NVVIEUX_REQUIRED=2.4.33
  27. LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
  28. LIBDRM_FREEDRENO_REQUIRED=2.4.51
  29. DRI2PROTO_REQUIRED=2.6
  30. DRI3PROTO_REQUIRED=1.0
  31. PRESENTPROTO_REQUIRED=1.0
  32. LIBUDEV_REQUIRED=151
  33. GLPROTO_REQUIRED=1.4.14
  34. LIBOMXIL_BELLAGIO_REQUIRED=0.0
  35. VDPAU_REQUIRED=0.4.1
  36. WAYLAND_REQUIRED=1.2.0
  37. XCBDRI2_REQUIRED=1.8
  38. XCBGLX_REQUIRED=1.8.1
  39. XSHMFENCE_REQUIRED=1.1
  40. XVMC_REQUIRED=1.0.6
  41. dnl Check for progs
  42. AC_PROG_CPP
  43. AC_PROG_CC
  44. AC_PROG_CXX
  45. AM_PROG_CC_C_O
  46. AM_PROG_AS
  47. AC_CHECK_PROGS([MAKE], [gmake make])
  48. AC_CHECK_PROGS([PYTHON2], [python2 python])
  49. AC_PROG_SED
  50. AC_PROG_MKDIR_P
  51. LT_PREREQ([2.2])
  52. LT_INIT([disable-static])
  53. AX_PROG_BISON([],
  54. AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
  55. [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
  56. AX_PROG_FLEX([],
  57. AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
  58. [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
  59. AC_PATH_PROG([PERL], [perl])
  60. AC_CHECK_PROG(INDENT, indent, indent, cat)
  61. if test "x$INDENT" != "xcat"; then
  62. AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
  63. fi
  64. AC_PROG_INSTALL
  65. dnl We need a POSIX shell for parts of the build. Assume we have one
  66. dnl in most cases.
  67. case "$host_os" in
  68. solaris*)
  69. # Solaris /bin/sh is too old/non-POSIX compliant
  70. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  71. SHELL="$POSIX_SHELL"
  72. ;;
  73. esac
  74. dnl clang is mostly GCC-compatible, but its version is much lower,
  75. dnl so we have to check for it.
  76. AC_MSG_CHECKING([if compiling with clang])
  77. AC_COMPILE_IFELSE(
  78. [AC_LANG_PROGRAM([], [[
  79. #ifndef __clang__
  80. not clang
  81. #endif
  82. ]])],
  83. [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
  84. AC_MSG_RESULT([$acv_mesa_CLANG])
  85. dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
  86. dnl versions are explictly not supported.
  87. GEN_ASM_OFFSETS=no
  88. if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
  89. AC_MSG_CHECKING([whether gcc version is sufficient])
  90. major=0
  91. minor=0
  92. GCC_VERSION=`$CC -dumpversion`
  93. if test $? -eq 0; then
  94. GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
  95. GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
  96. fi
  97. if test $GCC_VERSION_MAJOR -lt 3 -o $GCC_VERSION_MAJOR -eq 3 -a $GCC_VERSION_MINOR -lt 3 ; then
  98. AC_MSG_RESULT([no])
  99. AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
  100. else
  101. AC_MSG_RESULT([yes])
  102. fi
  103. if test "x$cross_compiling" = xyes; then
  104. GEN_ASM_OFFSETS=yes
  105. fi
  106. fi
  107. dnl Check for compiler builtins
  108. AX_GCC_BUILTIN([__builtin_bswap32])
  109. AX_GCC_BUILTIN([__builtin_bswap64])
  110. AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
  111. dnl Make sure the pkg-config macros are defined
  112. m4_ifndef([PKG_PROG_PKG_CONFIG],
  113. [m4_fatal([Could not locate the pkg-config autoconf macros.
  114. These are usually located in /usr/share/aclocal/pkg.m4. If your macros
  115. are in a different location, try setting the environment variable
  116. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  117. PKG_PROG_PKG_CONFIG()
  118. dnl LIB_DIR - library basename
  119. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  120. AC_SUBST([LIB_DIR])
  121. dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
  122. _SAVE_LDFLAGS="$LDFLAGS"
  123. _SAVE_CPPFLAGS="$CPPFLAGS"
  124. dnl Compiler macros
  125. DEFINES=""
  126. AC_SUBST([DEFINES])
  127. case "$host_os" in
  128. linux*|*-gnu*|gnu*)
  129. DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
  130. ;;
  131. solaris*)
  132. DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
  133. ;;
  134. cygwin*)
  135. DEFINES="$DEFINES -DHAVE_PTHREAD"
  136. ;;
  137. esac
  138. dnl Add flags for gcc and g++
  139. if test "x$GCC" = xyes; then
  140. case "$host_os" in
  141. cygwin*)
  142. CFLAGS="$CFLAGS -Wall -std=gnu99"
  143. ;;
  144. *)
  145. CFLAGS="$CFLAGS -Wall -std=c99"
  146. ;;
  147. esac
  148. # Enable -Werror=implicit-function-declaration and
  149. # -Werror=missing-prototypes, if available, or otherwise, just
  150. # -Wmissing-prototypes. This is particularly useful to avoid
  151. # generating a loadable driver module that has undefined symbols.
  152. save_CFLAGS="$CFLAGS"
  153. AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
  154. CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
  155. CFLAGS="$CFLAGS -Werror=missing-prototypes"
  156. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  157. AC_MSG_RESULT([yes]),
  158. [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
  159. AC_MSG_RESULT([no])]);
  160. # Enable -fvisibility=hidden if using a gcc that supports it
  161. save_CFLAGS="$CFLAGS"
  162. AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
  163. VISIBILITY_CFLAGS="-fvisibility=hidden"
  164. CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
  165. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  166. [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
  167. # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
  168. CFLAGS=$save_CFLAGS
  169. # Work around aliasing bugs - developers should comment this out
  170. CFLAGS="$CFLAGS -fno-strict-aliasing"
  171. # gcc's builtin memcmp is slower than glibc's
  172. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  173. CFLAGS="$CFLAGS -fno-builtin-memcmp"
  174. fi
  175. if test "x$GXX" = xyes; then
  176. CXXFLAGS="$CXXFLAGS -Wall"
  177. # Enable -fvisibility=hidden if using a gcc that supports it
  178. save_CXXFLAGS="$CXXFLAGS"
  179. AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
  180. VISIBILITY_CXXFLAGS="-fvisibility=hidden"
  181. CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
  182. AC_LANG_PUSH([C++])
  183. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  184. [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
  185. AC_LANG_POP([C++])
  186. # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
  187. CXXFLAGS=$save_CXXFLAGS
  188. # Work around aliasing bugs - developers should comment this out
  189. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  190. # gcc's builtin memcmp is slower than glibc's
  191. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  192. CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
  193. fi
  194. dnl even if the compiler appears to support it, using visibility attributes isn't
  195. dnl going to do anything useful currently on cygwin apart from emit lots of warnings
  196. case "$host_os" in
  197. cygwin*)
  198. VISIBILITY_CFLAGS=""
  199. VISIBILITY_CXXFLAGS=""
  200. ;;
  201. esac
  202. AC_SUBST([VISIBILITY_CFLAGS])
  203. AC_SUBST([VISIBILITY_CXXFLAGS])
  204. dnl
  205. dnl Optional flags, check for compiler support
  206. dnl
  207. AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_SUPPORTED=1], [SSE41_SUPPORTED=0])
  208. AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1])
  209. dnl
  210. dnl Hacks to enable 32 or 64 bit build
  211. dnl
  212. AC_ARG_ENABLE([32-bit],
  213. [AS_HELP_STRING([--enable-32-bit],
  214. [build 32-bit libraries @<:@default=auto@:>@])],
  215. [enable_32bit="$enableval"],
  216. [enable_32bit=auto]
  217. )
  218. if test "x$enable_32bit" = xyes; then
  219. if test "x$GCC" = xyes; then
  220. CFLAGS="$CFLAGS -m32"
  221. CCASFLAGS="$CCASFLAGS -m32"
  222. fi
  223. if test "x$GXX" = xyes; then
  224. CXXFLAGS="$CXXFLAGS -m32"
  225. fi
  226. fi
  227. AC_ARG_ENABLE([64-bit],
  228. [AS_HELP_STRING([--enable-64-bit],
  229. [build 64-bit libraries @<:@default=auto@:>@])],
  230. [enable_64bit="$enableval"],
  231. [enable_64bit=auto]
  232. )
  233. if test "x$enable_64bit" = xyes; then
  234. if test "x$GCC" = xyes; then
  235. CFLAGS="$CFLAGS -m64"
  236. fi
  237. if test "x$GXX" = xyes; then
  238. CXXFLAGS="$CXXFLAGS -m64"
  239. fi
  240. fi
  241. dnl Can't have static and shared libraries, default to static if user
  242. dnl explicitly requested. If both disabled, set to static since shared
  243. dnl was explicitly requested.
  244. case "x$enable_static$enable_shared" in
  245. xyesyes)
  246. AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
  247. enable_shared=no
  248. ;;
  249. xnono)
  250. AC_MSG_WARN([Cannot disable both static and shared libraries, enabling shared])
  251. enable_shared=yes
  252. ;;
  253. esac
  254. AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
  255. dnl
  256. dnl other compiler options
  257. dnl
  258. AC_ARG_ENABLE([debug],
  259. [AS_HELP_STRING([--enable-debug],
  260. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  261. [enable_debug="$enableval"],
  262. [enable_debug=no]
  263. )
  264. if test "x$enable_debug" = xyes; then
  265. DEFINES="$DEFINES -DDEBUG"
  266. if test "x$GCC" = xyes; then
  267. CFLAGS="$CFLAGS -g -O0"
  268. fi
  269. if test "x$GXX" = xyes; then
  270. CXXFLAGS="$CXXFLAGS -g -O0"
  271. fi
  272. fi
  273. dnl
  274. dnl Check if linker supports garbage collection
  275. dnl
  276. save_LDFLAGS=$LDFLAGS
  277. LDFLAGS="$LDFLAGS -Wl,--gc-sections"
  278. AC_MSG_CHECKING([whether ld supports --gc-sections])
  279. AC_LINK_IFELSE(
  280. [AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])],
  281. [AC_MSG_RESULT([yes])
  282. GC_SECTIONS="-Wl,--gc-sections";],
  283. [AC_MSG_RESULT([no])
  284. GC_SECTIONS="";])
  285. LDFLAGS=$save_LDFLAGS
  286. AC_SUBST([GC_SECTIONS])
  287. dnl
  288. dnl compatibility symlinks
  289. dnl
  290. case "$host_os" in
  291. linux* )
  292. HAVE_COMPAT_SYMLINKS=yes ;;
  293. * )
  294. HAVE_COMPAT_SYMLINKS=no ;;
  295. esac
  296. AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test "x$HAVE_COMPAT_SYMLINKS" = xyes)
  297. dnl
  298. dnl library names
  299. dnl
  300. case "$host_os" in
  301. darwin* )
  302. LIB_EXT='dylib' ;;
  303. cygwin* )
  304. LIB_EXT='dll' ;;
  305. aix* )
  306. LIB_EXT='a' ;;
  307. * )
  308. LIB_EXT='so' ;;
  309. esac
  310. AC_SUBST([LIB_EXT])
  311. AC_ARG_WITH([gl-lib-name],
  312. [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
  313. [specify GL library name @<:@default=GL@:>@])],
  314. [GL_LIB=$withval],
  315. [GL_LIB=GL])
  316. AC_ARG_WITH([osmesa-lib-name],
  317. [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
  318. [specify OSMesa library name @<:@default=OSMesa@:>@])],
  319. [OSMESA_LIB=$withval],
  320. [OSMESA_LIB=OSMesa])
  321. AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
  322. AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
  323. dnl
  324. dnl Mangled Mesa support
  325. dnl
  326. AC_ARG_ENABLE([mangling],
  327. [AS_HELP_STRING([--enable-mangling],
  328. [enable mangled symbols and library name @<:@default=disabled@:>@])],
  329. [enable_mangling="${enableval}"],
  330. [enable_mangling=no]
  331. )
  332. if test "x${enable_mangling}" = "xyes" ; then
  333. DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
  334. GL_LIB="Mangled${GL_LIB}"
  335. OSMESA_LIB="Mangled${OSMESA_LIB}"
  336. fi
  337. AC_SUBST([GL_LIB])
  338. AC_SUBST([OSMESA_LIB])
  339. dnl
  340. dnl potentially-infringing-but-nobody-knows-for-sure stuff
  341. dnl
  342. AC_ARG_ENABLE([texture-float],
  343. [AS_HELP_STRING([--enable-texture-float],
  344. [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
  345. [enable_texture_float="$enableval"],
  346. [enable_texture_float=no]
  347. )
  348. if test "x$enable_texture_float" = xyes; then
  349. AC_MSG_WARN([Floating-point textures enabled.])
  350. AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
  351. DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
  352. fi
  353. dnl
  354. dnl Arch/platform-specific settings
  355. dnl
  356. AC_ARG_ENABLE([asm],
  357. [AS_HELP_STRING([--disable-asm],
  358. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  359. [enable_asm="$enableval"],
  360. [enable_asm=yes]
  361. )
  362. asm_arch=""
  363. AC_MSG_CHECKING([whether to enable assembly])
  364. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  365. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  366. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  367. case "$host_cpu" in
  368. i?86 | x86_64 | amd64)
  369. enable_asm=no
  370. AC_MSG_RESULT([no, cross compiling])
  371. ;;
  372. esac
  373. fi
  374. # check for supported arches
  375. if test "x$enable_asm" = xyes; then
  376. case "$host_cpu" in
  377. i?86)
  378. case "$host_os" in
  379. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
  380. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  381. ;;
  382. gnu*)
  383. asm_arch=x86
  384. ;;
  385. esac
  386. ;;
  387. x86_64|amd64)
  388. case "$host_os" in
  389. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
  390. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  391. ;;
  392. esac
  393. ;;
  394. sparc*)
  395. case "$host_os" in
  396. linux*)
  397. asm_arch=sparc
  398. ;;
  399. esac
  400. ;;
  401. esac
  402. case "$asm_arch" in
  403. x86)
  404. DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  405. AC_MSG_RESULT([yes, x86])
  406. ;;
  407. x86_64|amd64)
  408. DEFINES="$DEFINES -DUSE_X86_64_ASM"
  409. AC_MSG_RESULT([yes, x86_64])
  410. ;;
  411. sparc)
  412. DEFINES="$DEFINES -DUSE_SPARC_ASM"
  413. AC_MSG_RESULT([yes, sparc])
  414. ;;
  415. *)
  416. AC_MSG_RESULT([no, platform not supported])
  417. ;;
  418. esac
  419. fi
  420. dnl Check to see if dlopen is in default libraries (like Solaris, which
  421. dnl has it in libc), or if libdl is needed to get it.
  422. AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
  423. [AC_CHECK_LIB([dl], [dlopen],
  424. [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
  425. AC_SUBST([DLOPEN_LIBS])
  426. dnl Check if that library also has dladdr
  427. save_LDFLAGS="$LDFLAGS"
  428. LDFLAGS="$LDFLAGS $DLOPEN_LIBS"
  429. AC_CHECK_FUNCS([dladdr])
  430. LDFLAGS="$save_LDFLAGS"
  431. case "$host_os" in
  432. darwin*|mingw*)
  433. ;;
  434. *)
  435. AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
  436. [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
  437. [AC_MSG_ERROR([Couldn't find clock_gettime])])])
  438. AC_SUBST([CLOCK_LIB])
  439. ;;
  440. esac
  441. dnl See if posix_memalign is available
  442. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  443. dnl Check for pthreads
  444. AX_PTHREAD
  445. dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
  446. dnl to -pthread, which causes problems if we need -lpthread to appear in
  447. dnl pkgconfig files.
  448. test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
  449. dnl SELinux awareness.
  450. AC_ARG_ENABLE([selinux],
  451. [AS_HELP_STRING([--enable-selinux],
  452. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  453. [MESA_SELINUX="$enableval"],
  454. [MESA_SELINUX=no])
  455. if test "x$enable_selinux" = "xyes"; then
  456. PKG_CHECK_MODULES([SELINUX], [libselinux], [],
  457. [AC_CHECK_HEADER([selinux/selinux.h],[],
  458. [AC_MSG_ERROR([SELinux headers not found])])
  459. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  460. [AC_MSG_ERROR([SELinux library not found])])
  461. SELINUX_LIBS="-lselinux"])
  462. DEFINES="$DEFINES -DMESA_SELINUX"
  463. fi
  464. AC_SUBST([SELINUX_CFLAGS])
  465. AC_SUBST([SELINUX_LIBS])
  466. dnl Options for APIs
  467. AC_ARG_ENABLE([opengl],
  468. [AS_HELP_STRING([--disable-opengl],
  469. [disable support for standard OpenGL API @<:@default=no@:>@])],
  470. [enable_opengl="$enableval"],
  471. [enable_opengl=yes])
  472. AC_ARG_ENABLE([gles1],
  473. [AS_HELP_STRING([--enable-gles1],
  474. [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
  475. [enable_gles1="$enableval"],
  476. [enable_gles1=no])
  477. AC_ARG_ENABLE([gles2],
  478. [AS_HELP_STRING([--enable-gles2],
  479. [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
  480. [enable_gles2="$enableval"],
  481. [enable_gles2=no])
  482. AC_ARG_ENABLE([openvg],
  483. [AS_HELP_STRING([--enable-openvg],
  484. [enable support for OpenVG API @<:@default=no@:>@])],
  485. [enable_openvg="$enableval"],
  486. [enable_openvg=no])
  487. AC_ARG_ENABLE([dri],
  488. [AS_HELP_STRING([--enable-dri],
  489. [enable DRI modules @<:@default=enabled@:>@])],
  490. [enable_dri="$enableval"],
  491. [enable_dri=yes])
  492. case "$host_os" in
  493. linux*)
  494. dri3_default=yes
  495. ;;
  496. *)
  497. dri3_default=no
  498. ;;
  499. esac
  500. AC_ARG_ENABLE([dri3],
  501. [AS_HELP_STRING([--enable-dri3],
  502. [enable DRI3 @<:@default=auto@:>@])],
  503. [enable_dri3="$enableval"],
  504. [enable_dri3="$dri3_default"])
  505. AC_ARG_ENABLE([glx],
  506. [AS_HELP_STRING([--enable-glx],
  507. [enable GLX library @<:@default=enabled@:>@])],
  508. [enable_glx="$enableval"],
  509. [enable_glx=yes])
  510. AC_ARG_ENABLE([osmesa],
  511. [AS_HELP_STRING([--enable-osmesa],
  512. [enable OSMesa library @<:@default=disabled@:>@])],
  513. [enable_osmesa="$enableval"],
  514. [enable_osmesa=no])
  515. AC_ARG_ENABLE([gallium-osmesa],
  516. [AS_HELP_STRING([--enable-gallium-osmesa],
  517. [enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
  518. [enable_gallium_osmesa="$enableval"],
  519. [enable_gallium_osmesa=no])
  520. AC_ARG_ENABLE([egl],
  521. [AS_HELP_STRING([--disable-egl],
  522. [disable EGL library @<:@default=enabled@:>@])],
  523. [enable_egl="$enableval"],
  524. [enable_egl=yes])
  525. AC_ARG_ENABLE([xa],
  526. [AS_HELP_STRING([--enable-xa],
  527. [enable build of the XA X Acceleration API @<:@default=no@:>@])],
  528. [enable_xa="$enableval"],
  529. [enable_xa=no])
  530. AC_ARG_ENABLE([gbm],
  531. [AS_HELP_STRING([--enable-gbm],
  532. [enable gbm library @<:@default=auto@:>@])],
  533. [enable_gbm="$enableval"],
  534. [enable_gbm=auto])
  535. AC_ARG_ENABLE([xvmc],
  536. [AS_HELP_STRING([--enable-xvmc],
  537. [enable xvmc library @<:@default=auto@:>@])],
  538. [enable_xvmc="$enableval"],
  539. [enable_xvmc=no])
  540. AC_ARG_ENABLE([vdpau],
  541. [AS_HELP_STRING([--enable-vdpau],
  542. [enable vdpau library @<:@default=auto@:>@])],
  543. [enable_vdpau="$enableval"],
  544. [enable_vdpau=auto])
  545. AC_ARG_ENABLE([omx],
  546. [AS_HELP_STRING([--enable-omx],
  547. [enable OpenMAX library @<:@default=no@:>@])],
  548. [enable_omx="$enableval"],
  549. [enable_omx=no])
  550. AC_ARG_ENABLE([opencl],
  551. [AS_HELP_STRING([--enable-opencl],
  552. [enable OpenCL library @<:@default=no@:>@])],
  553. [enable_opencl="$enableval"],
  554. [enable_opencl=no])
  555. AC_ARG_ENABLE([opencl_icd],
  556. [AS_HELP_STRING([--enable-opencl-icd],
  557. [Build an OpenCL ICD library to be loaded by an ICD implementation
  558. @<:@default=no@:>@])],
  559. [enable_opencl_icd="$enableval"],
  560. [enable_opencl_icd=no])
  561. AC_ARG_ENABLE([xlib-glx],
  562. [AS_HELP_STRING([--enable-xlib-glx],
  563. [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
  564. [enable_xlib_glx="$enableval"],
  565. [enable_xlib_glx=no])
  566. AC_ARG_ENABLE([gallium-egl],
  567. [AS_HELP_STRING([--enable-gallium-egl],
  568. [enable optional EGL state tracker (not required
  569. for EGL support in Gallium with OpenGL and OpenGL ES)
  570. @<:@default=disable@:>@])],
  571. [enable_gallium_egl="$enableval"],
  572. [enable_gallium_egl=no])
  573. AC_ARG_ENABLE([gallium-gbm],
  574. [AS_HELP_STRING([--enable-gallium-gbm],
  575. [enable optional gbm state tracker (not required for
  576. gbm support in Gallium)
  577. @<:@default=auto@:>@])],
  578. [enable_gallium_gbm="$enableval"],
  579. [enable_gallium_gbm=auto])
  580. AC_ARG_ENABLE([r600-llvm-compiler],
  581. [AS_HELP_STRING([--enable-r600-llvm-compiler],
  582. [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])],
  583. [enable_r600_llvm="$enableval"],
  584. [enable_r600_llvm=no])
  585. AC_ARG_ENABLE([gallium-tests],
  586. [AS_HELP_STRING([--enable-gallium-tests],
  587. [Enable optional Gallium tests) @<:@default=disable@:>@])],
  588. [enable_gallium_tests="$enableval"],
  589. [enable_gallium_tests=no])
  590. # Option for Gallium drivers
  591. # Keep this in sync with the --with-gallium-drivers help string default value
  592. GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
  593. AC_ARG_WITH([gallium-drivers],
  594. [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
  595. [comma delimited Gallium drivers list, e.g.
  596. "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast"
  597. @<:@default=r300,r600,svga,swrast@:>@])],
  598. [with_gallium_drivers="$withval"],
  599. [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
  600. # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
  601. # here so that the script doesn't choke on an unknown driver name later.
  602. case "$with_gallium_drivers" in
  603. yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
  604. no) with_gallium_drivers='' ;;
  605. esac
  606. if test "x$enable_opengl" = xno -a \
  607. "x$enable_gles1" = xno -a \
  608. "x$enable_gles2" = xno -a \
  609. "x$enable_openvg" = xno -a \
  610. "x$enable_xa" = xno -a \
  611. "x$enable_xvmc" = xno -a \
  612. "x$enable_vdpau" = xno -a \
  613. "x$enable_omx" = xno -a \
  614. "x$enable_opencl" = xno; then
  615. AC_MSG_ERROR([at least one API should be enabled])
  616. fi
  617. # Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
  618. if test "x$enable_opengl" = xno -a \
  619. "x$enable_gles1" = xyes; then
  620. AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
  621. fi
  622. if test "x$enable_opengl" = xno -a \
  623. "x$enable_gles2" = xyes; then
  624. AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
  625. fi
  626. AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
  627. AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
  628. AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
  629. AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
  630. "x$enable_gles1" = xyes -o \
  631. "x$enable_gles2" = xyes)
  632. if test "x$enable_glx" = xno; then
  633. AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
  634. enable_xlib_glx=no
  635. fi
  636. if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
  637. AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
  638. fi
  639. if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
  640. AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
  641. fi
  642. # Disable GLX if OpenGL is not enabled
  643. if test "x$enable_glx$enable_opengl" = xyesno; then
  644. AC_MSG_WARN([OpenGL not enabled, disabling GLX])
  645. enable_glx=no
  646. fi
  647. # Disable GLX if DRI and Xlib-GLX are not enabled
  648. if test "x$enable_glx" = xyes -a \
  649. "x$enable_dri" = xno -a \
  650. "x$enable_xlib_glx" = xno; then
  651. AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
  652. enable_glx=no
  653. fi
  654. AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \
  655. "x$enable_dri" = xyes)
  656. AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
  657. AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes)
  658. AC_ARG_ENABLE([shared-glapi],
  659. [AS_HELP_STRING([--enable-shared-glapi],
  660. [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
  661. [enable_shared_glapi="$enableval"],
  662. [enable_shared_glapi=yes])
  663. case "x$enable_opengl$enable_gles1$enable_gles2" in
  664. x*yes*yes*)
  665. if test "x$enable_shared_glapi" = xno; then
  666. AC_MSG_ERROR([shared GLAPI required when building two or more of
  667. the following APIs - opengl, gles1 gles2])
  668. fi
  669. ;;
  670. esac
  671. # Building Xlib-GLX requires shared glapi to be disabled.
  672. if test "x$enable_xlib_glx" = xyes; then
  673. AC_MSG_NOTICE([Shared GLAPI should not used with Xlib-GLX, disabling])
  674. enable_shared_glapi=no
  675. fi
  676. AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
  677. dnl
  678. dnl Driver specific build directories
  679. dnl
  680. GALLIUM_TARGET_DIRS=""
  681. GALLIUM_WINSYS_DIRS="sw"
  682. GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
  683. GALLIUM_STATE_TRACKERS_DIRS=""
  684. case "x$enable_glx$enable_xlib_glx" in
  685. xyesyes)
  686. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  687. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
  688. GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
  689. NEED_WINSYS_XLIB="yes"
  690. ;;
  691. esac
  692. if test "x$enable_dri" = xyes; then
  693. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
  694. GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
  695. fi
  696. if test "x$enable_gallium_osmesa" = xyes; then
  697. if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
  698. AC_MSG_ERROR([gallium_osmesa requires the gallium swrast driver])
  699. fi
  700. if test "x$enable_osmesa" = xyes; then
  701. AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
  702. fi
  703. GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS"
  704. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
  705. fi
  706. AC_SUBST([MESA_LLVM])
  707. # Check for libdrm
  708. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
  709. [have_libdrm=yes], [have_libdrm=no])
  710. if test "x$have_libdrm" = xyes; then
  711. DEFINES="$DEFINES -DHAVE_LIBDRM"
  712. fi
  713. case "$host_os" in
  714. linux*)
  715. need_libudev=yes ;;
  716. *)
  717. need_libudev=no ;;
  718. esac
  719. PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED],
  720. have_libudev=yes, have_libudev=no)
  721. if test "x$enable_dri" = xyes; then
  722. if test "$enable_static" = yes; then
  723. AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
  724. fi
  725. # not a hard requirement as swrast does not depend on it
  726. if test "x$have_libdrm" = xyes; then
  727. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  728. fi
  729. fi
  730. dnl Direct rendering or just indirect rendering
  731. case "$host_os" in
  732. gnu*)
  733. dnl Disable by default on GNU/Hurd
  734. driglx_direct_default="no"
  735. ;;
  736. cygwin*)
  737. dnl Disable by default on cygwin
  738. driglx_direct_default="no"
  739. ;;
  740. *)
  741. driglx_direct_default="yes"
  742. ;;
  743. esac
  744. AC_ARG_ENABLE([driglx-direct],
  745. [AS_HELP_STRING([--disable-driglx-direct],
  746. [disable direct rendering in GLX and EGL for DRI \
  747. @<:@default=auto@:>@])],
  748. [driglx_direct="$enableval"],
  749. [driglx_direct="$driglx_direct_default"])
  750. dnl
  751. dnl libGL configuration per driver
  752. dnl
  753. case "x$enable_glx$enable_xlib_glx" in
  754. xyesyes)
  755. # Xlib-based GLX
  756. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  757. GL_PC_REQ_PRIV="x11 xext"
  758. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  759. GL_LIB_DEPS="$XLIBGL_LIBS"
  760. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  761. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
  762. ;;
  763. xyesno)
  764. # DRI-based GLX
  765. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  766. if test x"$driglx_direct" = xyes; then
  767. if test "x$have_libdrm" != xyes; then
  768. AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
  769. fi
  770. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  771. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
  772. if test x"$enable_dri3" = xyes; then
  773. PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED])
  774. PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED])
  775. fi
  776. fi
  777. # find the DRI deps for libGL
  778. dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= $XCBGLX_REQUIRED xcb-dri2 >= $XCBDRI2_REQUIRED"
  779. if test x"$enable_dri3" = xyes; then
  780. dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
  781. fi
  782. # add xf86vidmode if available
  783. PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
  784. if test "$HAVE_XF86VIDMODE" = yes ; then
  785. dri_modules="$dri_modules xxf86vm"
  786. fi
  787. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  788. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  789. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  790. GL_LIB_DEPS="$DRIGL_LIBS"
  791. # need DRM libs, $PTHREAD_LIBS, etc.
  792. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  793. GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  794. ;;
  795. esac
  796. if test "$have_libudev" = yes; then
  797. DEFINES="$DEFINES -DHAVE_LIBUDEV"
  798. fi
  799. # This is outside the case (above) so that it is invoked even for non-GLX
  800. # builds.
  801. AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
  802. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  803. GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  804. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  805. GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  806. AC_SUBST([X11_INCLUDES])
  807. AC_SUBST([GL_LIB_DEPS])
  808. AC_SUBST([GL_PC_REQ_PRIV])
  809. AC_SUBST([GL_PC_LIB_PRIV])
  810. AC_SUBST([GL_PC_CFLAGS])
  811. AC_SUBST([DRI_PC_REQ_PRIV])
  812. AC_SUBST([GLESv1_CM_LIB_DEPS])
  813. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  814. AC_SUBST([GLESv2_LIB_DEPS])
  815. AC_SUBST([GLESv2_PC_LIB_PRIV])
  816. AC_SUBST([HAVE_XF86VIDMODE])
  817. dnl
  818. dnl More GLX setup
  819. dnl
  820. case "x$enable_glx$enable_xlib_glx" in
  821. xyesyes)
  822. DEFINES="$DEFINES -DUSE_XSHM"
  823. ;;
  824. xyesno)
  825. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  826. if test "x$driglx_direct" = xyes; then
  827. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  828. fi
  829. ;;
  830. esac
  831. dnl
  832. dnl TLS detection
  833. dnl
  834. AC_ARG_ENABLE([glx-tls],
  835. [AS_HELP_STRING([--enable-glx-tls],
  836. [enable TLS support in GLX @<:@default=disabled@:>@])],
  837. [GLX_USE_TLS="$enableval"],
  838. [GLX_USE_TLS=no])
  839. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  840. AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
  841. [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
  842. dnl
  843. dnl More DRI setup
  844. dnl
  845. dnl Directory for DRI drivers
  846. AC_ARG_WITH([dri-driverdir],
  847. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  848. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  849. [DRI_DRIVER_INSTALL_DIR="$withval"],
  850. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  851. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  852. dnl Extra search path for DRI drivers
  853. AC_ARG_WITH([dri-searchpath],
  854. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  855. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  856. [DRI_DRIVER_SEARCH_DIR="$withval"],
  857. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  858. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  859. dnl Which drivers to build - default is chosen by platform
  860. AC_ARG_WITH([dri-drivers],
  861. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  862. [comma delimited classic DRI drivers list, e.g.
  863. "swrast,i965,radeon" @<:@default=auto@:>@])],
  864. [with_dri_drivers="$withval"],
  865. [with_dri_drivers=auto])
  866. if test "x$with_dri_drivers" = xauto; then
  867. if test "x$enable_opengl" = xyes -a "x$enable_dri" = xyes; then
  868. with_dri_drivers="yes"
  869. else
  870. with_dri_drivers="no"
  871. fi
  872. fi
  873. if test "x$with_dri_drivers" = xno; then
  874. with_dri_drivers=''
  875. fi
  876. dnl If $with_dri_drivers is yes, drivers will be added through
  877. dnl platform checks. Set DEFINES and LIB_DEPS
  878. if test "x$enable_dri" = xyes; then
  879. # Platform specific settings and drivers to build
  880. case "$host_os" in
  881. linux*)
  882. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  883. DEFINES="$DEFINES -DHAVE_ALIAS"
  884. if test "x$enable_dri3" = xyes; then
  885. DEFINES="$DEFINES -DHAVE_DRI3"
  886. fi
  887. if test "x$have_libudev" != xyes; then
  888. AC_MSG_ERROR([libudev-dev required for building DRI])
  889. fi
  890. case "$host_cpu" in
  891. powerpc* | sparc*)
  892. # Build only the drivers for cards that exist on PowerPC/sparc
  893. if test "x$with_dri_drivers" = "xyes"; then
  894. with_dri_drivers="r200 radeon swrast"
  895. fi
  896. ;;
  897. esac
  898. ;;
  899. *freebsd* | dragonfly* | *netbsd* | openbsd*)
  900. DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
  901. DEFINES="$DEFINES -DHAVE_ALIAS"
  902. ;;
  903. gnu*)
  904. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  905. DEFINES="$DEFINES -DHAVE_ALIAS"
  906. ;;
  907. solaris*)
  908. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  909. ;;
  910. cygwin*)
  911. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  912. if test "x$with_dri_drivers" = "xyes"; then
  913. with_dri_drivers="swrast"
  914. fi
  915. ;;
  916. esac
  917. # default drivers
  918. if test "x$with_dri_drivers" = "xyes"; then
  919. with_dri_drivers="i915 i965 nouveau r200 radeon swrast"
  920. fi
  921. # Check for expat
  922. PKG_CHECK_EXISTS([expat], [have_expat=yes], [have_expat=no])
  923. if test "x$have_expat" = "xyes"; then
  924. PKG_CHECK_MODULES([EXPAT], [expat], [],
  925. AC_MSG_ERROR([Expat required for DRI.]))
  926. else
  927. # expat version 2.0 and earlier do not provide expat.pc
  928. EXPAT_LIBS=-lexpat
  929. fi
  930. # If we are building any DRI driver other than swrast.
  931. if test -n "$with_dri_drivers"; then
  932. if test "x$with_dri_drivers" != xswrast; then
  933. # ... libdrm is required
  934. if test "x$have_libdrm" != xyes; then
  935. AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
  936. fi
  937. DRICOMMON_NEED_LIBDRM=yes
  938. else
  939. DRICOMMON_NEED_LIBDRM=no
  940. fi
  941. fi
  942. # put all the necessary libs together
  943. DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  944. fi
  945. AC_SUBST([DRI_LIB_DEPS])
  946. DRI_DIRS=''
  947. dnl Duplicates in DRI_DIRS are removed by sorting it at the end of this block
  948. if test -n "$with_dri_drivers"; then
  949. if test "x$enable_opengl" != xyes; then
  950. AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
  951. fi
  952. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  953. for driver in $dri_drivers; do
  954. DRI_DIRS="$DRI_DIRS $driver"
  955. case "x$driver" in
  956. xi915)
  957. HAVE_I915_DRI=yes;
  958. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  959. ;;
  960. xi965)
  961. HAVE_I965_DRI=yes;
  962. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  963. ;;
  964. xnouveau)
  965. HAVE_NOUVEAU_DRI=yes;
  966. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
  967. ;;
  968. xradeon)
  969. HAVE_RADEON_DRI=yes;
  970. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  971. ;;
  972. xr200)
  973. HAVE_R200_DRI=yes;
  974. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  975. ;;
  976. xswrast)
  977. HAVE_SWRAST_DRI=yes;
  978. ;;
  979. *)
  980. AC_MSG_ERROR([classic DRI driver '$driver' does not exist])
  981. ;;
  982. esac
  983. done
  984. DRI_DIRS=`echo $DRI_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  985. fi
  986. AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
  987. AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
  988. "x$enable_osmesa" = xyes -o \
  989. -n "$DRI_DIRS")
  990. dnl
  991. dnl OSMesa configuration
  992. dnl
  993. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  994. AC_ARG_WITH([osmesa-bits],
  995. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  996. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  997. [osmesa_bits="$withval"],
  998. [osmesa_bits=8])
  999. if test "x$osmesa_bits" != x8; then
  1000. if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
  1001. AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
  1002. osmesa_bits=8
  1003. fi
  1004. fi
  1005. case "x$osmesa_bits" in
  1006. x8)
  1007. OSMESA_LIB="${OSMESA_LIB}"
  1008. ;;
  1009. x16|x32)
  1010. OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
  1011. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  1012. ;;
  1013. *)
  1014. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  1015. ;;
  1016. esac
  1017. if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
  1018. # only link libraries with osmesa if shared
  1019. if test "$enable_static" = no; then
  1020. OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1021. else
  1022. OSMESA_LIB_DEPS=""
  1023. fi
  1024. OSMESA_MESA_DEPS=""
  1025. OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1026. fi
  1027. AC_SUBST([OSMESA_LIB_DEPS])
  1028. AC_SUBST([OSMESA_MESA_DEPS])
  1029. AC_SUBST([OSMESA_PC_REQ])
  1030. AC_SUBST([OSMESA_PC_LIB_PRIV])
  1031. dnl
  1032. dnl gbm configuration
  1033. dnl
  1034. if test "x$enable_gbm" = xauto; then
  1035. case "$with_egl_platforms" in
  1036. *drm*)
  1037. enable_gbm=yes ;;
  1038. *)
  1039. enable_gbm=no ;;
  1040. esac
  1041. fi
  1042. if test "x$enable_gbm" = xyes; then
  1043. if test "x$need_libudev$have_libudev" = xyesno; then
  1044. AC_MSG_ERROR([gbm requires udev >= $LIBUDEV_REQUIRED])
  1045. fi
  1046. if test "x$enable_dri" = xyes; then
  1047. GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
  1048. if test "x$enable_shared_glapi" = xno; then
  1049. AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
  1050. fi
  1051. fi
  1052. fi
  1053. AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
  1054. if test "x$need_libudev" = xyes; then
  1055. GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED"
  1056. else
  1057. GBM_PC_REQ_PRIV=""
  1058. fi
  1059. GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
  1060. AC_SUBST([GBM_PC_REQ_PRIV])
  1061. AC_SUBST([GBM_PC_LIB_PRIV])
  1062. dnl
  1063. dnl EGL configuration
  1064. dnl
  1065. EGL_CLIENT_APIS=""
  1066. if test "x$enable_egl" = xyes; then
  1067. EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
  1068. AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
  1069. if test "$enable_static" != yes; then
  1070. if test "x$enable_dri" = xyes; then
  1071. HAVE_EGL_DRIVER_DRI2=1
  1072. fi
  1073. fi
  1074. fi
  1075. AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
  1076. AC_SUBST([EGL_LIB_DEPS])
  1077. dnl
  1078. dnl EGL Gallium configuration
  1079. dnl
  1080. if test "x$enable_gallium_egl" = xyes; then
  1081. if test -z "$with_gallium_drivers"; then
  1082. AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
  1083. fi
  1084. if test "x$enable_egl" = xno; then
  1085. AC_MSG_ERROR([cannot enable egl_gallium without EGL])
  1086. fi
  1087. if test "x$have_libdrm" != xyes; then
  1088. AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
  1089. fi
  1090. GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
  1091. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
  1092. fi
  1093. AM_CONDITIONAL(HAVE_GALLIUM_EGL, test "x$enable_gallium_egl" = xyes)
  1094. dnl
  1095. dnl gbm Gallium configuration
  1096. dnl
  1097. if test "x$enable_gallium_gbm" = xauto; then
  1098. case "$enable_gbm$enable_gallium_egl$enable_dri$with_egl_platforms" in
  1099. yesyesyes*drm*)
  1100. enable_gallium_gbm=yes ;;
  1101. *)
  1102. enable_gallium_gbm=no ;;
  1103. esac
  1104. fi
  1105. if test "x$enable_gallium_gbm" = xyes; then
  1106. if test -z "$with_gallium_drivers"; then
  1107. AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
  1108. fi
  1109. if test "x$enable_gbm" = xno; then
  1110. AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
  1111. fi
  1112. # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
  1113. if test "x$enable_dri" = xno; then
  1114. AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
  1115. fi
  1116. GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
  1117. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
  1118. enable_gallium_loader=yes
  1119. fi
  1120. AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes)
  1121. dnl
  1122. dnl XA configuration
  1123. dnl
  1124. if test "x$enable_xa" = xyes; then
  1125. if test "x$with_gallium_drivers" = xswrast; then
  1126. AC_MSG_ERROR([
  1127. Building xa requires at least one non swrast gallium driver.
  1128. If you are looking to use libxatracker.so with vmware's virtual gpu,
  1129. make sure to include svga in the gallium drivers list, apart from
  1130. enabling XA.
  1131. Example: ./configure --enable-xa --with-gallium-drivers=svga...])
  1132. fi
  1133. GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
  1134. enable_gallium_loader=yes
  1135. fi
  1136. AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
  1137. dnl
  1138. dnl OpenVG configuration
  1139. dnl
  1140. VG_LIB_DEPS=""
  1141. if test "x$enable_openvg" = xyes; then
  1142. if test "x$enable_egl" = xno; then
  1143. AC_MSG_ERROR([cannot enable OpenVG without EGL])
  1144. fi
  1145. if test -z "$with_gallium_drivers"; then
  1146. AC_MSG_ERROR([cannot enable OpenVG without Gallium])
  1147. fi
  1148. if test "x$enable_gallium_egl" = xno; then
  1149. AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
  1150. fi
  1151. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
  1152. VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
  1153. GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
  1154. VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
  1155. AC_SUBST([VG_PC_LIB_PRIV])
  1156. fi
  1157. AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
  1158. dnl
  1159. dnl Gallium G3DVL configuration
  1160. dnl
  1161. if test -n "$with_gallium_drivers" && ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
  1162. if test "x$enable_xvmc" = xauto; then
  1163. PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
  1164. fi
  1165. if test "x$enable_vdpau" = xauto; then
  1166. PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
  1167. fi
  1168. if test "x$enable_omx" = xauto; then
  1169. PKG_CHECK_EXISTS([libomxil-bellagio], [enable_omx=yes], [enable_omx=no])
  1170. fi
  1171. fi
  1172. if test "x$enable_xvmc" = xyes; then
  1173. PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
  1174. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
  1175. fi
  1176. AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
  1177. if test "x$enable_vdpau" = xyes; then
  1178. PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED],
  1179. [VDPAU_LIBS="`$PKG_CONFIG --libs x11-xcb xcb-dri2`"])
  1180. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
  1181. fi
  1182. AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
  1183. if test "x$enable_omx" = xyes; then
  1184. PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
  1185. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS omx"
  1186. fi
  1187. AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
  1188. dnl
  1189. dnl OpenCL configuration
  1190. dnl
  1191. AC_ARG_WITH([libclc-path],
  1192. [AS_HELP_STRING([--with-libclc-path],
  1193. [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
  1194. [LIBCLC_PATH="$withval"],
  1195. [LIBCLC_PATH=''])
  1196. if test -n "$LIBCLC_PATH"; then
  1197. AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
  1198. Please review the updated build instructions for clover:
  1199. http://dri.freedesktop.org/wiki/GalliumCompute])
  1200. fi
  1201. AC_ARG_WITH([clang-libdir],
  1202. [AS_HELP_STRING([--with-clang-libdir],
  1203. [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
  1204. [CLANG_LIBDIR="$withval"],
  1205. [CLANG_LIBDIR=''])
  1206. PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
  1207. if test "x$enable_opencl" = xyes; then
  1208. if test -z "$with_gallium_drivers"; then
  1209. AC_MSG_ERROR([cannot enable OpenCL without Gallium])
  1210. fi
  1211. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
  1212. AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
  1213. fi
  1214. if test "x$have_libclc" = xno; then
  1215. AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
  1216. Make sure the directory containing libclc.pc is specified in your
  1217. PKG_CONFIG_PATH environment variable.
  1218. By default libclc.pc is installed to /usr/local/share/pkgconfig/])
  1219. else
  1220. LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
  1221. LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
  1222. AC_SUBST([LIBCLC_INCLUDEDIR])
  1223. AC_SUBST([LIBCLC_LIBEXECDIR])
  1224. fi
  1225. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
  1226. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
  1227. enable_gallium_loader=yes
  1228. if test "x$enable_opencl_icd" = xyes; then
  1229. OPENCL_LIBNAME="MesaOpenCL"
  1230. else
  1231. OPENCL_LIBNAME="OpenCL"
  1232. fi
  1233. fi
  1234. AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
  1235. AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
  1236. AC_SUBST([OPENCL_LIBNAME])
  1237. dnl
  1238. dnl Gallium configuration
  1239. dnl
  1240. AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
  1241. AC_SUBST([LLVM_BINDIR])
  1242. AC_SUBST([LLVM_CFLAGS])
  1243. AC_SUBST([LLVM_CPPFLAGS])
  1244. AC_SUBST([LLVM_CXXFLAGS])
  1245. AC_SUBST([LLVM_LIBDIR])
  1246. AC_SUBST([LLVM_LIBS])
  1247. AC_SUBST([LLVM_LDFLAGS])
  1248. AC_SUBST([LLVM_INCLUDEDIR])
  1249. AC_SUBST([LLVM_VERSION])
  1250. AC_SUBST([CLANG_RESOURCE_DIR])
  1251. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1252. x*yes*)
  1253. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
  1254. ;;
  1255. esac
  1256. AC_SUBST([VG_LIB_DEPS])
  1257. AC_SUBST([EGL_CLIENT_APIS])
  1258. dnl
  1259. dnl EGL Platforms configuration
  1260. dnl
  1261. AC_ARG_WITH([egl-platforms],
  1262. [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
  1263. [comma delimited native platforms libEGL supports, e.g.
  1264. "x11,drm" @<:@default=auto@:>@])],
  1265. [with_egl_platforms="$withval"],
  1266. [if test "x$enable_egl" = xyes; then
  1267. with_egl_platforms="x11"
  1268. else
  1269. with_egl_platforms=""
  1270. fi])
  1271. if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
  1272. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1273. fi
  1274. # Do per-EGL platform setups and checks
  1275. egl_platforms=`IFS=', '; echo $with_egl_platforms`
  1276. for plat in $egl_platforms; do
  1277. case "$plat" in
  1278. wayland)
  1279. PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED])
  1280. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
  1281. WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
  1282. AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
  1283. [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
  1284. ;;
  1285. x11)
  1286. PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes])
  1287. ;;
  1288. drm)
  1289. test "x$enable_gbm" = "xno" &&
  1290. AC_MSG_ERROR([EGL platform drm needs gbm])
  1291. test "x$have_libdrm" != xyes &&
  1292. AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
  1293. ;;
  1294. android|fbdev|gdi|null)
  1295. ;;
  1296. *)
  1297. AC_MSG_ERROR([EGL platform '$plat' does not exist])
  1298. ;;
  1299. esac
  1300. case "$plat$need_libudev$have_libudev" in
  1301. waylandyesno|drmyesno)
  1302. AC_MSG_ERROR([cannot build $plat platform without udev >= $LIBUDEV_REQUIRED]) ;;
  1303. esac
  1304. done
  1305. # libEGL wants to default to the first platform specified in
  1306. # ./configure. parse that here.
  1307. if test "x$egl_platforms" != "x"; then
  1308. FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
  1309. EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
  1310. else
  1311. EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
  1312. fi
  1313. if echo "$egl_platforms" | grep -q 'x11'; then
  1314. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  1315. NEED_WINSYS_XLIB=yes
  1316. fi
  1317. AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11')
  1318. AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland')
  1319. AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
  1320. AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep -q 'fbdev')
  1321. AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep -q 'null')
  1322. AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
  1323. AC_SUBST([EGL_NATIVE_PLATFORM])
  1324. AC_SUBST([EGL_CFLAGS])
  1325. # If we don't have the X11 platform, set this define so we don't try to include
  1326. # the X11 headers.
  1327. if ! echo "$egl_platforms" | grep -q 'x11'; then
  1328. DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
  1329. GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
  1330. fi
  1331. AC_ARG_WITH([egl-driver-dir],
  1332. [AS_HELP_STRING([--with-egl-driver-dir=DIR],
  1333. [directory for EGL drivers [[default=${libdir}/egl]]])],
  1334. [EGL_DRIVER_INSTALL_DIR="$withval"],
  1335. [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
  1336. AC_SUBST([EGL_DRIVER_INSTALL_DIR])
  1337. AC_ARG_WITH([max-width],
  1338. [AS_HELP_STRING([--with-max-width=N],
  1339. [Maximum framebuffer width (4096)])],
  1340. [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
  1341. AS_IF([test "${withval}" -gt "4096"],
  1342. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1343. )
  1344. AC_ARG_WITH([max-height],
  1345. [AS_HELP_STRING([--with-max-height=N],
  1346. [Maximum framebuffer height (4096)])],
  1347. [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
  1348. AS_IF([test "${withval}" -gt "4096"],
  1349. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1350. )
  1351. dnl
  1352. dnl Gallium LLVM
  1353. dnl
  1354. AC_ARG_ENABLE([gallium-llvm],
  1355. [AS_HELP_STRING([--enable-gallium-llvm],
  1356. [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
  1357. [enable_gallium_llvm="$enableval"],
  1358. [enable_gallium_llvm=auto])
  1359. AC_ARG_ENABLE([llvm-shared-libs],
  1360. [AS_HELP_STRING([--enable-llvm-shared-libs],
  1361. [link with LLVM shared libraries @<:@default=enabled@:>@])],
  1362. [enable_llvm_shared_libs="$enableval"],
  1363. [enable_llvm_shared_libs=yes])
  1364. AC_ARG_WITH([llvm-prefix],
  1365. [AS_HELP_STRING([--with-llvm-prefix],
  1366. [Prefix for LLVM installations in non-standard locations])],
  1367. [llvm_prefix="$withval"],
  1368. [llvm_prefix=''])
  1369. # Call this inside ` ` to get the return value.
  1370. # $1 is the llvm-config command with arguments.
  1371. strip_unwanted_llvm_flags() {
  1372. # Use \> (marks the end of the word)
  1373. echo `$1` | sed \
  1374. -e 's/-DNDEBUG\>//g' \
  1375. -e 's/-pedantic\>//g' \
  1376. -e 's/-Wcovered-switch-default\>//g' \
  1377. -e 's/-O.\>//g' \
  1378. -e 's/-g\>//g' \
  1379. -e 's/-Wall\>//g' \
  1380. -e 's/-Wcast-qual\>//g' \
  1381. -e 's/-Woverloaded-virtual\>//g' \
  1382. -e 's/-fcolor-diagnostics\>//g' \
  1383. -e 's/-fdata-sections\>//g' \
  1384. -e 's/-ffunction-sections\>//g' \
  1385. -e 's/-fno-exceptions\>//g' \
  1386. -e 's/-fomit-frame-pointer\>//g' \
  1387. -e 's/-fvisibility-inlines-hidden\>//g' \
  1388. -e 's/-fPIC\>//g'
  1389. }
  1390. if test -z "$with_gallium_drivers"; then
  1391. enable_gallium_llvm=no
  1392. fi
  1393. if test "x$enable_gallium_llvm" = xauto; then
  1394. case "$host_cpu" in
  1395. i*86|x86_64|amd64) enable_gallium_llvm=yes;;
  1396. esac
  1397. fi
  1398. if test "x$enable_gallium_llvm" = xyes; then
  1399. if test -n "$llvm_prefix"; then
  1400. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
  1401. else
  1402. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
  1403. fi
  1404. if test "x$LLVM_CONFIG" != xno; then
  1405. LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
  1406. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  1407. LLVM_BINDIR=`$LLVM_CONFIG --bindir`
  1408. LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
  1409. LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
  1410. LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
  1411. LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
  1412. LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
  1413. AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
  1414. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1415. AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
  1416. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1417. if test -n "${LLVM_VERSION_MAJOR}"; then
  1418. LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
  1419. else
  1420. LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
  1421. fi
  1422. LLVM_COMPONENTS="engine bitwriter"
  1423. if $LLVM_CONFIG --components | grep -qw 'mcjit'; then
  1424. LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
  1425. fi
  1426. if test "x$enable_opencl" = xyes; then
  1427. LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
  1428. # LLVM 3.3 >= 177971 requires IRReader
  1429. if $LLVM_CONFIG --components | grep -qw 'irreader'; then
  1430. LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader"
  1431. fi
  1432. # LLVM 3.4 requires Option
  1433. if $LLVM_CONFIG --components | grep -qw 'option'; then
  1434. LLVM_COMPONENTS="${LLVM_COMPONENTS} option"
  1435. fi
  1436. fi
  1437. DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
  1438. MESA_LLVM=1
  1439. dnl Check for Clang internal headers
  1440. if test "x$enable_opencl" = xyes; then
  1441. if test -z "$CLANG_LIBDIR"; then
  1442. CLANG_LIBDIR=${LLVM_LIBDIR}
  1443. fi
  1444. CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
  1445. AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
  1446. [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
  1447. fi
  1448. else
  1449. MESA_LLVM=0
  1450. LLVM_VERSION_INT=0
  1451. fi
  1452. else
  1453. MESA_LLVM=0
  1454. LLVM_VERSION_INT=0
  1455. fi
  1456. dnl Directory for XVMC libs
  1457. AC_ARG_WITH([xvmc-libdir],
  1458. [AS_HELP_STRING([--with-xvmc-libdir=DIR],
  1459. [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
  1460. [XVMC_LIB_INSTALL_DIR="$withval"],
  1461. [XVMC_LIB_INSTALL_DIR='${libdir}'])
  1462. AC_SUBST([XVMC_LIB_INSTALL_DIR])
  1463. dnl
  1464. dnl Gallium Tests
  1465. dnl
  1466. if test "x$enable_gallium_tests" = xyes; then
  1467. enable_gallium_loader=yes
  1468. fi
  1469. AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
  1470. if test "x$enable_gallium_loader" = xyes; then
  1471. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
  1472. fi
  1473. AM_CONDITIONAL(NEED_GALLIUM_LOADER, test "x$enable_gallium_loader" = xyes)
  1474. dnl Directory for VDPAU libs
  1475. AC_ARG_WITH([vdpau-libdir],
  1476. [AS_HELP_STRING([--with-vdpau-libdir=DIR],
  1477. [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
  1478. [VDPAU_LIB_INSTALL_DIR="$withval"],
  1479. [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
  1480. AC_SUBST([VDPAU_LIB_INSTALL_DIR])
  1481. OMX_LIB_INSTALL_DIR_DEFAULT=''
  1482. if test "x$enable_omx" = xyes; then
  1483. OMX_LIB_INSTALL_DIR_DEFAULT=`$PKG_CONFIG --variable=pluginsdir libomxil-bellagio`
  1484. fi
  1485. AC_ARG_WITH([omx-libdir],
  1486. [AS_HELP_STRING([--with-omx-libdir=DIR],
  1487. [directory for the OMX libraries])],
  1488. [OMX_LIB_INSTALL_DIR="$withval"],
  1489. [OMX_LIB_INSTALL_DIR="$OMX_LIB_INSTALL_DIR_DEFAULT"])
  1490. AC_SUBST([OMX_LIB_INSTALL_DIR])
  1491. dnl Directory for OpenCL libs
  1492. AC_ARG_WITH([opencl-libdir],
  1493. [AS_HELP_STRING([--with-opencl-libdir=DIR],
  1494. [directory for auxiliary libraries used by the OpenCL implementation @<:@default=${libdir}/opencl@:>@])],
  1495. [OPENCL_LIB_INSTALL_DIR="$withval"],
  1496. [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
  1497. AC_SUBST([OPENCL_LIB_INSTALL_DIR])
  1498. dnl
  1499. dnl Gallium helper functions
  1500. dnl
  1501. gallium_check_st() {
  1502. if test "x$NEED_NONNULL_WINSYS" = xyes; then
  1503. if test "x$have_libdrm" != xyes; then
  1504. AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
  1505. fi
  1506. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
  1507. fi
  1508. if test "x$enable_dri" = xyes && test -n "$2"; then
  1509. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
  1510. fi
  1511. if test "x$enable_xa" = xyes && test -n "$3"; then
  1512. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
  1513. fi
  1514. if test "x$enable_xvmc" = xyes && test -n "$4"; then
  1515. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
  1516. fi
  1517. if test "x$enable_vdpau" = xyes && test -n "$5"; then
  1518. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
  1519. fi
  1520. if test "x$enable_omx" = xyes && test "x$6" != x; then
  1521. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
  1522. fi
  1523. }
  1524. gallium_require_llvm() {
  1525. if test "x$MESA_LLVM" = x0; then
  1526. case "$host_cpu" in
  1527. i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
  1528. esac
  1529. fi
  1530. }
  1531. gallium_require_drm_loader() {
  1532. if test "x$enable_gallium_loader" = xyes; then
  1533. if test "x$need_libudev$have_libudev" = xyesno; then
  1534. AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED])
  1535. fi
  1536. if test "x$have_libdrm" != xyes; then
  1537. AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
  1538. fi
  1539. enable_gallium_drm_loader=yes
  1540. fi
  1541. }
  1542. require_egl_drm() {
  1543. case "$with_egl_platforms" in
  1544. *drm*)
  1545. ;;
  1546. *)
  1547. AC_MSG_ERROR([--with-egl-platforms=drm is required to build the $1 driver.])
  1548. ;;
  1549. esac
  1550. if test "x$enable_gbm" != xyes; then
  1551. AC_MSG_ERROR([--enable-gbm is required to build the $1 driver.])
  1552. fi
  1553. }
  1554. radeon_llvm_check() {
  1555. if test "x$enable_gallium_llvm" != "xyes"; then
  1556. AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
  1557. fi
  1558. LLVM_REQUIRED_VERSION_MAJOR="3"
  1559. LLVM_REQUIRED_VERSION_MINOR="3"
  1560. if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
  1561. AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required for $1])
  1562. fi
  1563. if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
  1564. AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
  1565. sources with the --enable-experimental-targets=R600
  1566. configure flag])
  1567. fi
  1568. LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
  1569. NEED_RADEON_LLVM=yes
  1570. AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
  1571. [AC_MSG_ERROR([$1 requires libelf when using LLVM])])
  1572. }
  1573. dnl Gallium drivers
  1574. if test "x$enable_dri" = xyes -o "x$enable_xa" = xyes -o \
  1575. "x$enable_xvmc" = xyes -o "x$enable_vdpau" = xyes; then
  1576. NEED_NONNULL_WINSYS=yes
  1577. fi
  1578. AM_CONDITIONAL(NEED_NONNULL_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes)
  1579. dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
  1580. if test -n "$with_gallium_drivers"; then
  1581. gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
  1582. for driver in $gallium_drivers; do
  1583. case "x$driver" in
  1584. xsvga)
  1585. HAVE_GALLIUM_SVGA=yes
  1586. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
  1587. gallium_require_drm_loader
  1588. gallium_check_st "svga/drm" "dri-vmwgfx" ""
  1589. ;;
  1590. xi915)
  1591. HAVE_GALLIUM_I915=yes
  1592. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1593. gallium_require_drm_loader
  1594. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
  1595. if test "x$MESA_LLVM" = x1; then
  1596. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1597. fi
  1598. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
  1599. gallium_check_st "i915/drm" "dri-i915"
  1600. DRICOMMON_NEED_LIBDRM=yes
  1601. ;;
  1602. xilo)
  1603. HAVE_GALLIUM_ILO=yes
  1604. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1605. gallium_require_drm_loader
  1606. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
  1607. gallium_check_st "intel/drm" "dri-ilo"
  1608. DRICOMMON_NEED_LIBDRM=yes
  1609. ;;
  1610. xr300)
  1611. HAVE_GALLIUM_R300=yes
  1612. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1613. gallium_require_drm_loader
  1614. gallium_require_llvm "Gallium R300"
  1615. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1616. gallium_check_st "radeon/drm" "r300/dri" "" "" ""
  1617. DRICOMMON_NEED_LIBDRM=yes
  1618. ;;
  1619. xr600)
  1620. HAVE_GALLIUM_R600=yes
  1621. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1622. gallium_require_drm_loader
  1623. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
  1624. if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
  1625. radeon_llvm_check "r600g"
  1626. LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
  1627. fi
  1628. if test "x$enable_r600_llvm" = xyes; then
  1629. USE_R600_LLVM_COMPILER=yes;
  1630. fi
  1631. if test "x$enable_opencl" = xyes; then
  1632. LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
  1633. fi
  1634. gallium_check_st "radeon/drm" "r600/dri" "" "r600/xvmc" "r600/vdpau" "r600/omx"
  1635. DRICOMMON_NEED_LIBDRM=yes
  1636. ;;
  1637. xradeonsi)
  1638. HAVE_GALLIUM_RADEONSI=yes
  1639. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1640. gallium_require_drm_loader
  1641. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
  1642. radeon_llvm_check "radeonsi"
  1643. require_egl_drm "radeonsi"
  1644. gallium_check_st "radeon/drm" "radeonsi/dri" "" "" "radeonsi/vdpau" "radeonsi/omx"
  1645. DRICOMMON_NEED_LIBDRM=yes
  1646. ;;
  1647. xnouveau)
  1648. HAVE_GALLIUM_NOUVEAU=yes
  1649. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  1650. gallium_require_drm_loader
  1651. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau"
  1652. gallium_check_st "nouveau/drm" "dri-nouveau" "" "xvmc-nouveau" "vdpau-nouveau" "omx-nouveau"
  1653. DRICOMMON_NEED_LIBDRM=yes
  1654. ;;
  1655. xfreedreno)
  1656. HAVE_GALLIUM_FREEDRENO=yes
  1657. PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
  1658. gallium_require_drm_loader
  1659. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
  1660. gallium_check_st "freedreno/drm" "dri-freedreno" "" "" ""
  1661. DRICOMMON_NEED_LIBDRM=yes
  1662. ;;
  1663. xswrast)
  1664. HAVE_GALLIUM_SOFTPIPE=yes
  1665. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
  1666. if test "x$MESA_LLVM" = x1; then
  1667. HAVE_GALLIUM_LLVMPIPE=yes
  1668. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1669. fi
  1670. if test "x$enable_dri" = xyes; then
  1671. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
  1672. fi
  1673. ;;
  1674. *)
  1675. AC_MSG_ERROR([Unknown Gallium driver: $driver])
  1676. ;;
  1677. esac
  1678. done
  1679. fi
  1680. dnl Set LLVM_LIBS - This is done after the driver configuration so
  1681. dnl that drivers can add additonal components to LLVM_COMPONENTS.
  1682. dnl Previously, gallium drivers were updating LLVM_LIBS directly
  1683. dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
  1684. dnl this was causing the same libraries to be appear multiple times
  1685. dnl in LLVM_LIBS.
  1686. if test "x$MESA_LLVM" != x0; then
  1687. LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
  1688. if test "x$enable_llvm_shared_libs" = xyes; then
  1689. dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
  1690. LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
  1691. AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
  1692. if test "x$llvm_have_one_so" = xyes; then
  1693. dnl LLVM was built using auto*, so there is only one shared object.
  1694. LLVM_LIBS="-l$LLVM_SO_NAME"
  1695. else
  1696. dnl If LLVM was built with CMake, there will be one shared object per
  1697. dnl component.
  1698. AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
  1699. [AC_MSG_ERROR([Could not find llvm shared libraries:
  1700. Please make sure you have built llvm with the --enable-shared option
  1701. and that your llvm libraries are installed in $LLVM_LIBDIR
  1702. If you have installed your llvm libraries to a different directory you
  1703. can use the --with-llvm-prefix= configure flag to specify this directory.
  1704. NOTE: Mesa is attempting to use llvm shared libraries by default.
  1705. If you do not want to build with llvm shared libraries and instead want to
  1706. use llvm static libraries then add --disable-llvm-shared-libs to your configure
  1707. invocation and rebuild.])])
  1708. dnl We don't need to update LLVM_LIBS in this case because the LLVM
  1709. dnl install uses a shared object for each compoenent and we have
  1710. dnl already added all of these objects to LLVM_LIBS.
  1711. fi
  1712. else
  1713. AC_MSG_WARN([Building mesa with staticly linked LLVM may cause compilation issues])
  1714. fi
  1715. fi
  1716. AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
  1717. AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
  1718. AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
  1719. AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
  1720. AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
  1721. AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
  1722. AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
  1723. AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
  1724. AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  1725. AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
  1726. AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -o \
  1727. "x$HAVE_GALLIUM_I915" = xyes -o \
  1728. "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  1729. AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
  1730. "x$HAVE_GALLIUM_SOFTPIPE" = xyes \
  1731. && test "x$MESA_LLVM" = x1)
  1732. # NOTE: anything using xcb or other client side libs ends up in separate
  1733. # _CLIENT variables. The pipe loader is built in two variants,
  1734. # one that is standalone and does not link any x client libs (for
  1735. # use by XA tracker in particular, but could be used in any case
  1736. # where communication with xserver is not desired).
  1737. if test "x$enable_gallium_loader" = xyes; then
  1738. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
  1739. if test "x$NEED_WINSYS_XLIB" = xyes; then
  1740. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
  1741. fi
  1742. if test "x$enable_dri" = xyes; then
  1743. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI"
  1744. fi
  1745. if test "x$enable_gallium_drm_loader" = xyes; then
  1746. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
  1747. PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
  1748. pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
  1749. if test "x$pipe_loader_have_xcb" = xyes; then
  1750. GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES -DHAVE_PIPE_LOADER_XCB"
  1751. GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
  1752. fi
  1753. fi
  1754. GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES $GALLIUM_PIPE_LOADER_DEFINES"
  1755. GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_LIBS"
  1756. AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
  1757. AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
  1758. AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES])
  1759. AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS])
  1760. fi
  1761. AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
  1762. AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
  1763. AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
  1764. AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
  1765. AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
  1766. AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
  1767. AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes -a \
  1768. "x$HAVE_GALLIUM_R300" = xyes -o \
  1769. "x$HAVE_GALLIUM_R600" = xyes -o \
  1770. "x$HAVE_GALLIUM_RADEONSI" = xyes)
  1771. AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
  1772. "x$HAVE_GALLIUM_SVGA" = xyes)
  1773. AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
  1774. AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
  1775. AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
  1776. AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
  1777. AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
  1778. AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
  1779. AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
  1780. AC_SUBST([ELF_LIB])
  1781. AM_CONDITIONAL(DRICOMMON_NEED_LIBDRM, test "x$DRICOMMON_NEED_LIBDRM" = xyes)
  1782. AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes)
  1783. AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
  1784. AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
  1785. AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
  1786. AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64)
  1787. AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64)
  1788. AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc)
  1789. AC_SUBST([VDPAU_MAJOR], 1)
  1790. AC_SUBST([VDPAU_MINOR], 0)
  1791. AC_SUBST([XVMC_MAJOR], 1)
  1792. AC_SUBST([XVMC_MINOR], 0)
  1793. XA_HEADER="$srcdir/src/gallium/state_trackers/xa/xa_tracker.h"
  1794. XA_MAJOR=`grep "#define XA_TRACKER_VERSION_MAJOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MAJOR //'`
  1795. XA_MINOR=`grep "#define XA_TRACKER_VERSION_MINOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MINOR //'`
  1796. XA_TINY=`grep "#define XA_TRACKER_VERSION_PATCH" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_PATCH //'`
  1797. AC_SUBST([XA_MAJOR], $XA_MAJOR)
  1798. AC_SUBST([XA_MINOR], $XA_MINOR)
  1799. AC_SUBST([XA_TINY], $XA_TINY)
  1800. AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
  1801. dnl Restore LDFLAGS and CPPFLAGS
  1802. LDFLAGS="$_SAVE_LDFLAGS"
  1803. CPPFLAGS="$_SAVE_CPPFLAGS"
  1804. dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
  1805. if test "x$acv_mesa_CLANG" = xyes; then
  1806. CFLAGS="$CFLAGS -Qunused-arguments"
  1807. CXXFLAGS="$CXXFLAGS -Qunused-arguments"
  1808. fi
  1809. dnl Add user CFLAGS and CXXFLAGS
  1810. CFLAGS="$CFLAGS $USER_CFLAGS"
  1811. CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
  1812. dnl Substitute the config
  1813. AC_CONFIG_FILES([Makefile
  1814. src/Makefile
  1815. src/egl/drivers/dri2/Makefile
  1816. src/egl/main/Makefile
  1817. src/egl/main/egl.pc
  1818. src/egl/wayland/Makefile
  1819. src/egl/wayland/wayland-drm/Makefile
  1820. src/egl/wayland/wayland-egl/Makefile
  1821. src/egl/wayland/wayland-egl/wayland-egl.pc
  1822. src/gallium/auxiliary/Makefile
  1823. src/gallium/auxiliary/pipe-loader/Makefile
  1824. src/gallium/drivers/Makefile
  1825. src/gallium/drivers/freedreno/Makefile
  1826. src/gallium/drivers/galahad/Makefile
  1827. src/gallium/drivers/i915/Makefile
  1828. src/gallium/drivers/identity/Makefile
  1829. src/gallium/drivers/ilo/Makefile
  1830. src/gallium/drivers/llvmpipe/Makefile
  1831. src/gallium/drivers/noop/Makefile
  1832. src/gallium/drivers/nouveau/Makefile
  1833. src/gallium/drivers/r300/Makefile
  1834. src/gallium/drivers/r600/Makefile
  1835. src/gallium/drivers/radeon/Makefile
  1836. src/gallium/drivers/radeonsi/Makefile
  1837. src/gallium/drivers/rbug/Makefile
  1838. src/gallium/drivers/softpipe/Makefile
  1839. src/gallium/drivers/svga/Makefile
  1840. src/gallium/drivers/trace/Makefile
  1841. src/gallium/state_trackers/Makefile
  1842. src/gallium/state_trackers/clover/Makefile
  1843. src/gallium/state_trackers/dri/Makefile
  1844. src/gallium/state_trackers/dri/drm/Makefile
  1845. src/gallium/state_trackers/dri/sw/Makefile
  1846. src/gallium/state_trackers/egl/Makefile
  1847. src/gallium/state_trackers/gbm/Makefile
  1848. src/gallium/state_trackers/glx/xlib/Makefile
  1849. src/gallium/state_trackers/omx/Makefile
  1850. src/gallium/state_trackers/osmesa/Makefile
  1851. src/gallium/state_trackers/vdpau/Makefile
  1852. src/gallium/state_trackers/vega/Makefile
  1853. src/gallium/state_trackers/xa/Makefile
  1854. src/gallium/state_trackers/xvmc/Makefile
  1855. src/gallium/targets/Makefile
  1856. src/gallium/targets/dri-freedreno/Makefile
  1857. src/gallium/targets/dri-i915/Makefile
  1858. src/gallium/targets/dri-ilo/Makefile
  1859. src/gallium/targets/dri-nouveau/Makefile
  1860. src/gallium/targets/dri-swrast/Makefile
  1861. src/gallium/targets/dri-vmwgfx/Makefile
  1862. src/gallium/targets/egl-static/Makefile
  1863. src/gallium/targets/gbm/Makefile
  1864. src/gallium/targets/opencl/Makefile
  1865. src/gallium/targets/xa/Makefile
  1866. src/gallium/targets/xa/xatracker.pc
  1867. src/gallium/targets/omx-nouveau/Makefile
  1868. src/gallium/targets/osmesa/Makefile
  1869. src/gallium/targets/osmesa/osmesa.pc
  1870. src/gallium/targets/pipe-loader/Makefile
  1871. src/gallium/targets/radeonsi/dri/Makefile
  1872. src/gallium/targets/radeonsi/omx/Makefile
  1873. src/gallium/targets/radeonsi/vdpau/Makefile
  1874. src/gallium/targets/r300/dri/Makefile
  1875. src/gallium/targets/r600/dri/Makefile
  1876. src/gallium/targets/r600/omx/Makefile
  1877. src/gallium/targets/r600/vdpau/Makefile
  1878. src/gallium/targets/r600/xvmc/Makefile
  1879. src/gallium/targets/libgl-xlib/Makefile
  1880. src/gallium/targets/vdpau-nouveau/Makefile
  1881. src/gallium/targets/xvmc-nouveau/Makefile
  1882. src/gallium/tests/trivial/Makefile
  1883. src/gallium/tests/unit/Makefile
  1884. src/gallium/winsys/Makefile
  1885. src/gallium/winsys/freedreno/drm/Makefile
  1886. src/gallium/winsys/i915/drm/Makefile
  1887. src/gallium/winsys/i915/sw/Makefile
  1888. src/gallium/winsys/intel/drm/Makefile
  1889. src/gallium/winsys/nouveau/drm/Makefile
  1890. src/gallium/winsys/radeon/drm/Makefile
  1891. src/gallium/winsys/svga/drm/Makefile
  1892. src/gallium/winsys/sw/dri/Makefile
  1893. src/gallium/winsys/sw/fbdev/Makefile
  1894. src/gallium/winsys/sw/null/Makefile
  1895. src/gallium/winsys/sw/wayland/Makefile
  1896. src/gallium/winsys/sw/wrapper/Makefile
  1897. src/gallium/winsys/sw/xlib/Makefile
  1898. src/gbm/Makefile
  1899. src/gbm/main/gbm.pc
  1900. src/glsl/Makefile
  1901. src/glx/Makefile
  1902. src/glx/tests/Makefile
  1903. src/gtest/Makefile
  1904. src/loader/Makefile
  1905. src/mapi/Makefile
  1906. src/mapi/es1api/Makefile
  1907. src/mapi/es1api/glesv1_cm.pc
  1908. src/mapi/es2api/Makefile
  1909. src/mapi/es2api/glesv2.pc
  1910. src/mapi/glapi/Makefile
  1911. src/mapi/glapi/gen/Makefile
  1912. src/mapi/glapi/tests/Makefile
  1913. src/mapi/shared-glapi/Makefile
  1914. src/mapi/shared-glapi/tests/Makefile
  1915. src/mapi/vgapi/Makefile
  1916. src/mapi/vgapi/vg.pc
  1917. src/mesa/Makefile
  1918. src/mesa/gl.pc
  1919. src/mesa/drivers/dri/dri.pc
  1920. src/mesa/drivers/dri/common/Makefile
  1921. src/mesa/drivers/dri/common/xmlpool/Makefile
  1922. src/mesa/drivers/dri/i915/Makefile
  1923. src/mesa/drivers/dri/i965/Makefile
  1924. src/mesa/drivers/dri/Makefile
  1925. src/mesa/drivers/dri/nouveau/Makefile
  1926. src/mesa/drivers/dri/r200/Makefile
  1927. src/mesa/drivers/dri/radeon/Makefile
  1928. src/mesa/drivers/dri/swrast/Makefile
  1929. src/mesa/drivers/osmesa/Makefile
  1930. src/mesa/drivers/osmesa/osmesa.pc
  1931. src/mesa/drivers/x11/Makefile
  1932. src/mesa/main/tests/Makefile
  1933. src/mesa/main/tests/hash_table/Makefile])
  1934. dnl Sort the dirs alphabetically
  1935. GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1936. GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1937. GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1938. GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1939. AC_OUTPUT
  1940. dnl
  1941. dnl Output some configuration info for the user
  1942. dnl
  1943. echo ""
  1944. echo " prefix: $prefix"
  1945. echo " exec_prefix: $exec_prefix"
  1946. echo " libdir: $libdir"
  1947. echo " includedir: $includedir"
  1948. dnl API info
  1949. echo ""
  1950. echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
  1951. echo " OpenVG: $enable_openvg"
  1952. dnl Driver info
  1953. echo ""
  1954. case "x$enable_osmesa$enable_gallium_osmesa" in
  1955. xnoyes)
  1956. echo " OSMesa: lib$OSMESA_LIB (Gallium)"
  1957. ;;
  1958. xyesno)
  1959. echo " OSMesa: lib$OSMESA_LIB"
  1960. ;;
  1961. xnono)
  1962. echo " OSMesa: no"
  1963. ;;
  1964. esac
  1965. if test "x$enable_dri" != xno; then
  1966. if test -z "$DRI_DIRS"; then
  1967. echo " DRI drivers: no"
  1968. else
  1969. echo " DRI drivers: $DRI_DIRS"
  1970. fi
  1971. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1972. fi
  1973. case "x$enable_glx$enable_xlib_glx" in
  1974. xyesyes)
  1975. echo " GLX: Xlib-based"
  1976. ;;
  1977. xyesno)
  1978. echo " GLX: DRI-based"
  1979. ;;
  1980. *)
  1981. echo " GLX: $enable_glx"
  1982. ;;
  1983. esac
  1984. dnl EGL
  1985. echo ""
  1986. echo " EGL: $enable_egl"
  1987. if test "$enable_egl" = yes; then
  1988. echo " EGL platforms: $egl_platforms"
  1989. egl_drivers=""
  1990. if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
  1991. egl_drivers="$egl_drivers builtin:egl_dri2"
  1992. fi
  1993. if test "x$enable_gallium_egl" = xyes; then
  1994. echo " EGL drivers: ${egl_drivers} egl_gallium"
  1995. echo " EGL Gallium STs:$EGL_CLIENT_APIS"
  1996. else
  1997. echo " EGL drivers: $egl_drivers"
  1998. fi
  1999. fi
  2000. echo ""
  2001. if test "x$MESA_LLVM" = x1; then
  2002. echo " llvm: yes"
  2003. echo " llvm-config: $LLVM_CONFIG"
  2004. echo " llvm-version: $LLVM_VERSION"
  2005. else
  2006. echo " llvm: no"
  2007. fi
  2008. echo ""
  2009. if test -n "$with_gallium_drivers"; then
  2010. echo " Gallium: yes"
  2011. echo " Target dirs: $GALLIUM_TARGET_DIRS"
  2012. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  2013. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  2014. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  2015. else
  2016. echo " Gallium: no"
  2017. fi
  2018. dnl Libraries
  2019. echo ""
  2020. echo " Shared libs: $enable_shared"
  2021. echo " Static libs: $enable_static"
  2022. echo " Shared-glapi: $enable_shared_glapi"
  2023. dnl Compiler options
  2024. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  2025. cflags=`echo $CFLAGS | \
  2026. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2027. cxxflags=`echo $CXXFLAGS | \
  2028. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2029. defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
  2030. echo ""
  2031. echo " CFLAGS: $cflags"
  2032. echo " CXXFLAGS: $cxxflags"
  2033. echo " Macros: $defines"
  2034. echo ""
  2035. if test "x$MESA_LLVM" = x1; then
  2036. echo " LLVM_CFLAGS: $LLVM_CFLAGS"
  2037. echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
  2038. echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
  2039. echo ""
  2040. fi
  2041. echo " PYTHON2: $PYTHON2"
  2042. echo ""
  2043. echo " Run '${MAKE-make}' to build Mesa"
  2044. echo ""