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

configure.ac 79KB

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