Clone of mesa.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

configure.ac 79KB

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