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

configure.ac 78KB

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