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 92KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873
  1. dnl Copyright © 2011-2014 Intel Corporation
  2. dnl Copyright © 2011-2014 Emil Velikov <emil.l.velikov@gmail.com>
  3. dnl Copyright © 2007-2010 Dan Nicholson
  4. dnl Copyright © 2010-2014 Marek Olšák <maraeo@gmail.com>
  5. dnl Copyright © 2010-2014 Christian König
  6. dnl Copyright © 2012-2014 Tom Stellard <tstellar@gmail.com>
  7. dnl Copyright © 2009-2012 Jakob Bornecrantz
  8. dnl Copyright © 2009-2014 Jon TURNEY
  9. dnl Copyright © 2011-2012 Benjamin Franzke
  10. dnl Copyright © 2008-2014 David Airlie
  11. dnl Copyright © 2009-2013 Brian Paul
  12. dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
  13. dnl
  14. dnl Permission is hereby granted, free of charge, to any person obtaining a
  15. dnl copy of this software and associated documentation files (the "Software"),
  16. dnl to deal in the Software without restriction, including without limitation
  17. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  18. dnl and/or sell copies of the Software, and to permit persons to whom the
  19. dnl Software is furnished to do so, subject to the following conditions:
  20. dnl
  21. dnl The above copyright notice and this permission notice (including the next
  22. dnl paragraph) shall be included in all copies or substantial portions of the
  23. dnl Software.
  24. dnl
  25. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  26. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  27. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  28. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  29. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  30. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  31. dnl DEALINGS IN THE SOFTWARE.
  32. dnl
  33. dnl Process this file with autoconf to create configure.
  34. AC_PREREQ([2.60])
  35. dnl Tell the user about autoconf.html in the --help output
  36. m4_divert_once([HELP_END], [
  37. See docs/autoconf.html for more details on the options for Mesa.])
  38. m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION)))
  39. AC_INIT([Mesa], [MESA_VERSION],
  40. [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
  41. AC_CONFIG_AUX_DIR([bin])
  42. AC_CONFIG_MACRO_DIR([m4])
  43. AC_CANONICAL_SYSTEM
  44. AM_INIT_AUTOMAKE([foreign tar-ustar dist-xz subdir-objects])
  45. dnl We only support native Windows builds (MinGW/MSVC) through SCons.
  46. case "$host_os" in
  47. mingw*)
  48. AC_MSG_ERROR([MinGW build not supported through autoconf/automake, use SCons instead])
  49. ;;
  50. esac
  51. # Support silent build rules, requires at least automake-1.11. Disable
  52. # by either passing --disable-silent-rules to configure or passing V=1
  53. # to make
  54. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  55. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  56. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  57. dnl Set internal versions
  58. OSMESA_VERSION=8
  59. AC_SUBST([OSMESA_VERSION])
  60. OPENCL_VERSION=1
  61. AC_SUBST([OPENCL_VERSION])
  62. dnl Versions for external dependencies
  63. LIBDRM_REQUIRED=2.4.66
  64. LIBDRM_RADEON_REQUIRED=2.4.56
  65. LIBDRM_AMDGPU_REQUIRED=2.4.63
  66. LIBDRM_INTEL_REQUIRED=2.4.61
  67. LIBDRM_NVVIEUX_REQUIRED=2.4.66
  68. LIBDRM_NOUVEAU_REQUIRED=2.4.66
  69. LIBDRM_FREEDRENO_REQUIRED=2.4.67
  70. DRI2PROTO_REQUIRED=2.6
  71. DRI3PROTO_REQUIRED=1.0
  72. PRESENTPROTO_REQUIRED=1.0
  73. LIBUDEV_REQUIRED=151
  74. GLPROTO_REQUIRED=1.4.14
  75. LIBOMXIL_BELLAGIO_REQUIRED=0.0
  76. LIBVA_REQUIRED=0.38.0
  77. VDPAU_REQUIRED=1.1
  78. WAYLAND_REQUIRED=1.2.0
  79. XCB_REQUIRED=1.9.3
  80. XCBDRI2_REQUIRED=1.8
  81. XCBGLX_REQUIRED=1.8.1
  82. XSHMFENCE_REQUIRED=1.1
  83. XVMC_REQUIRED=1.0.6
  84. PYTHON_MAKO_REQUIRED=0.3.4
  85. dnl Check for progs
  86. AC_PROG_CPP
  87. AC_PROG_CC
  88. AC_PROG_CXX
  89. AM_PROG_CC_C_O
  90. AM_PROG_AS
  91. AX_CHECK_GNU_MAKE
  92. AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
  93. AC_PROG_SED
  94. AC_PROG_MKDIR_P
  95. AC_SYS_LARGEFILE
  96. LT_PREREQ([2.2])
  97. LT_INIT([disable-static])
  98. AC_CHECK_PROG(RM, rm, [rm -f])
  99. AX_PROG_BISON([],
  100. AS_IF([test ! -f "$srcdir/src/compiler/glsl/glcpp/glcpp-parse.c"],
  101. [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
  102. AX_PROG_FLEX([],
  103. AS_IF([test ! -f "$srcdir/src/compiler/glsl/glcpp/glcpp-lex.c"],
  104. [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
  105. AC_CHECK_PROG(INDENT, indent, indent, cat)
  106. if test "x$INDENT" != "xcat"; then
  107. # Only GNU indent is supported
  108. INDENT_VERSION=`indent --version | grep GNU`
  109. if test $? -eq 0; then
  110. AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
  111. else
  112. INDENT="cat"
  113. fi
  114. fi
  115. AX_CHECK_PYTHON_MAKO_MODULE($PYTHON_MAKO_REQUIRED)
  116. if test -z "$PYTHON2"; then
  117. if test ! -f "$srcdir/src/util/format_srgb.c"; then
  118. AC_MSG_ERROR([Python not found - unable to generate sources])
  119. fi
  120. else
  121. if test "x$acv_mako_found" = xno; then
  122. if test ! -f "$srcdir/src/mesa/main/format_unpack.c"; then
  123. AC_MSG_ERROR([Python mako module v$PYTHON_MAKO_REQUIRED or higher not found])
  124. fi
  125. fi
  126. fi
  127. AC_PROG_INSTALL
  128. dnl We need a POSIX shell for parts of the build. Assume we have one
  129. dnl in most cases.
  130. case "$host_os" in
  131. solaris*)
  132. # Solaris /bin/sh is too old/non-POSIX compliant
  133. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  134. SHELL="$POSIX_SHELL"
  135. ;;
  136. esac
  137. dnl clang is mostly GCC-compatible, but its version is much lower,
  138. dnl so we have to check for it.
  139. AC_MSG_CHECKING([if compiling with clang])
  140. AC_COMPILE_IFELSE(
  141. [AC_LANG_PROGRAM([], [[
  142. #ifndef __clang__
  143. not clang
  144. #endif
  145. ]])],
  146. [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
  147. AC_MSG_RESULT([$acv_mesa_CLANG])
  148. dnl If we're using GCC, make sure that it is at least version 4.2.0. Older
  149. dnl versions are explictly not supported.
  150. GEN_ASM_OFFSETS=no
  151. USE_GNU99=no
  152. if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
  153. AC_MSG_CHECKING([whether gcc version is sufficient])
  154. major=0
  155. minor=0
  156. GCC_VERSION=`$CC -dumpversion`
  157. if test $? -eq 0; then
  158. GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
  159. GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
  160. fi
  161. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 2 ; then
  162. AC_MSG_RESULT([no])
  163. AC_MSG_ERROR([If using GCC, version 4.2.0 or later is required.])
  164. else
  165. AC_MSG_RESULT([yes])
  166. fi
  167. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6 ; then
  168. USE_GNU99=yes
  169. fi
  170. if test "x$cross_compiling" = xyes; then
  171. GEN_ASM_OFFSETS=yes
  172. fi
  173. fi
  174. dnl We don't support building Mesa with Sun C compiler
  175. dnl https://bugs.freedesktop.org/show_bug.cgi?id=93189
  176. AC_CHECK_DECL([__SUNPRO_C], [SUNCC=yes], [SUNCC=no])
  177. if test "x$SUNCC" = xyes; then
  178. AC_MSG_ERROR([Building with Sun C compiler is not supported, use GCC instead.])
  179. fi
  180. dnl Check for compiler builtins
  181. AX_GCC_BUILTIN([__builtin_bswap32])
  182. AX_GCC_BUILTIN([__builtin_bswap64])
  183. AX_GCC_BUILTIN([__builtin_clz])
  184. AX_GCC_BUILTIN([__builtin_clzll])
  185. AX_GCC_BUILTIN([__builtin_ctz])
  186. AX_GCC_BUILTIN([__builtin_expect])
  187. AX_GCC_BUILTIN([__builtin_ffs])
  188. AX_GCC_BUILTIN([__builtin_ffsll])
  189. AX_GCC_BUILTIN([__builtin_popcount])
  190. AX_GCC_BUILTIN([__builtin_popcountll])
  191. AX_GCC_BUILTIN([__builtin_unreachable])
  192. AX_GCC_FUNC_ATTRIBUTE([const])
  193. AX_GCC_FUNC_ATTRIBUTE([flatten])
  194. AX_GCC_FUNC_ATTRIBUTE([format])
  195. AX_GCC_FUNC_ATTRIBUTE([malloc])
  196. AX_GCC_FUNC_ATTRIBUTE([packed])
  197. AX_GCC_FUNC_ATTRIBUTE([pure])
  198. AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
  199. AX_GCC_FUNC_ATTRIBUTE([unused])
  200. AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
  201. AX_GCC_FUNC_ATTRIBUTE([weak])
  202. AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
  203. dnl Make sure the pkg-config macros are defined
  204. m4_ifndef([PKG_PROG_PKG_CONFIG],
  205. [m4_fatal([Could not locate the pkg-config autoconf macros.
  206. These are usually located in /usr/share/aclocal/pkg.m4. If your macros
  207. are in a different location, try setting the environment variable
  208. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  209. PKG_PROG_PKG_CONFIG()
  210. dnl LIB_DIR - library basename
  211. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  212. AC_SUBST([LIB_DIR])
  213. dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
  214. _SAVE_LDFLAGS="$LDFLAGS"
  215. _SAVE_CPPFLAGS="$CPPFLAGS"
  216. dnl Compiler macros
  217. DEFINES="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
  218. AC_SUBST([DEFINES])
  219. android=no
  220. case "$host_os" in
  221. *-android)
  222. android=yes
  223. ;;
  224. linux*|*-gnu*|gnu*)
  225. DEFINES="$DEFINES -D_GNU_SOURCE"
  226. ;;
  227. solaris*)
  228. DEFINES="$DEFINES -DSVR4"
  229. ;;
  230. cygwin*)
  231. DEFINES="$DEFINES -D_XOPEN_SOURCE=700"
  232. ;;
  233. esac
  234. AM_CONDITIONAL(HAVE_ANDROID, test "x$android" = xyes)
  235. dnl Add flags for gcc and g++
  236. if test "x$GCC" = xyes; then
  237. CFLAGS="$CFLAGS -Wall"
  238. if test "x$USE_GNU99" = xyes; then
  239. CFLAGS="$CFLAGS -std=gnu99"
  240. else
  241. CFLAGS="$CFLAGS -std=c99"
  242. fi
  243. # Enable -Werror=implicit-function-declaration and
  244. # -Werror=missing-prototypes, if available, or otherwise, just
  245. # -Wmissing-prototypes. This is particularly useful to avoid
  246. # generating a loadable driver module that has undefined symbols.
  247. save_CFLAGS="$CFLAGS"
  248. AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
  249. CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
  250. CFLAGS="$CFLAGS -Werror=missing-prototypes"
  251. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  252. AC_MSG_RESULT([yes]),
  253. [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
  254. AC_MSG_RESULT([no])]);
  255. # Enable -fvisibility=hidden if using a gcc that supports it
  256. save_CFLAGS="$CFLAGS"
  257. AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
  258. VISIBILITY_CFLAGS="-fvisibility=hidden"
  259. CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
  260. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  261. [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
  262. # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
  263. CFLAGS=$save_CFLAGS
  264. # Work around aliasing bugs - developers should comment this out
  265. CFLAGS="$CFLAGS -fno-strict-aliasing"
  266. # We don't want floating-point math functions to set errno or trap
  267. CFLAGS="$CFLAGS -fno-math-errno -fno-trapping-math"
  268. # gcc's builtin memcmp is slower than glibc's
  269. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  270. CFLAGS="$CFLAGS -fno-builtin-memcmp"
  271. # Flags to help ensure that certain portions of the code -- and only those
  272. # portions -- can be built with MSVC:
  273. # - src/util, src/gallium/auxiliary, rc/gallium/drivers/llvmpipe, and
  274. # - non-Linux/Posix OpenGL portions needs to build on MSVC 2013 (which
  275. # supports most of C99)
  276. # - the rest has no compiler compiler restrictions
  277. MSVC2013_COMPAT_CFLAGS="-Werror=pointer-arith"
  278. MSVC2013_COMPAT_CXXFLAGS="-Werror=pointer-arith"
  279. # Enable -Werror=vla if compiler supports it
  280. save_CFLAGS="$CFLAGS"
  281. AC_MSG_CHECKING([whether $CC supports -Werror=vla])
  282. CFLAGS="$CFLAGS -Werror=vla"
  283. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  284. [MSVC2013_COMPAT_CFLAGS="$MSVC2013_COMPAT_CFLAGS -Werror=vla";
  285. MSVC2013_COMPAT_CXXFLAGS="$MSVC2013_COMPAT_CXXFLAGS -Werror=vla";
  286. AC_MSG_RESULT([yes])],
  287. AC_MSG_RESULT([no]));
  288. CFLAGS="$save_CFLAGS"
  289. fi
  290. if test "x$GXX" = xyes; then
  291. CXXFLAGS="$CXXFLAGS -Wall"
  292. # Enable -fvisibility=hidden if using a gcc that supports it
  293. save_CXXFLAGS="$CXXFLAGS"
  294. AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
  295. VISIBILITY_CXXFLAGS="-fvisibility=hidden"
  296. CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
  297. AC_LANG_PUSH([C++])
  298. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  299. [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
  300. AC_LANG_POP([C++])
  301. # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
  302. CXXFLAGS=$save_CXXFLAGS
  303. # Work around aliasing bugs - developers should comment this out
  304. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  305. # gcc's builtin memcmp is slower than glibc's
  306. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  307. CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
  308. fi
  309. AC_SUBST([MSVC2013_COMPAT_CFLAGS])
  310. AC_SUBST([MSVC2013_COMPAT_CXXFLAGS])
  311. dnl even if the compiler appears to support it, using visibility attributes isn't
  312. dnl going to do anything useful currently on cygwin apart from emit lots of warnings
  313. case "$host_os" in
  314. cygwin*)
  315. VISIBILITY_CFLAGS=""
  316. VISIBILITY_CXXFLAGS=""
  317. ;;
  318. esac
  319. AC_SUBST([VISIBILITY_CFLAGS])
  320. AC_SUBST([VISIBILITY_CXXFLAGS])
  321. dnl
  322. dnl Optional flags, check for compiler support
  323. dnl
  324. SSE41_CFLAGS="-msse4.1"
  325. dnl Code compiled by GCC with -msse* assumes a 16 byte aligned
  326. dnl stack, but on x86-32 such alignment is not guaranteed.
  327. case "$target_cpu" in
  328. i?86)
  329. SSE41_CFLAGS="$SSE41_CFLAGS -mstackrealign"
  330. ;;
  331. esac
  332. save_CFLAGS="$CFLAGS"
  333. CFLAGS="$SSE41_CFLAGS $CFLAGS"
  334. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  335. #include <smmintrin.h>
  336. int param;
  337. int main () {
  338. __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
  339. c = _mm_max_epu32(a, b);
  340. return _mm_cvtsi128_si32(c);
  341. }]])], SSE41_SUPPORTED=1)
  342. CFLAGS="$save_CFLAGS"
  343. if test "x$SSE41_SUPPORTED" = x1; then
  344. DEFINES="$DEFINES -DUSE_SSE41"
  345. fi
  346. AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1])
  347. AC_SUBST([SSE41_CFLAGS], $SSE41_CFLAGS)
  348. dnl Check for Endianness
  349. AC_C_BIGENDIAN(
  350. little_endian=no,
  351. little_endian=yes,
  352. little_endian=no,
  353. little_endian=no
  354. )
  355. dnl Check for POWER8 Architecture
  356. PWR8_CFLAGS="-mpower8-vector"
  357. have_pwr8_intrinsics=no
  358. AC_MSG_CHECKING(whether gcc supports -mpower8-vector)
  359. save_CFLAGS=$CFLAGS
  360. CFLAGS="$PWR8_CFLAGS $CFLAGS"
  361. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  362. #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
  363. #error "Need GCC >= 4.8 for sane POWER8 support"
  364. #endif
  365. #include <altivec.h>
  366. int main () {
  367. vector unsigned char r;
  368. vector unsigned int v = vec_splat_u32 (1);
  369. r = __builtin_vec_vgbbd ((vector unsigned char) v);
  370. return 0;
  371. }]])], have_pwr8_intrinsics=yes)
  372. CFLAGS=$save_CFLAGS
  373. AC_ARG_ENABLE(pwr8,
  374. [AC_HELP_STRING([--disable-pwr8-inst],
  375. [disable POWER8-specific instructions])],
  376. [enable_pwr8=$enableval], [enable_pwr8=auto])
  377. if test "x$enable_pwr8" = xno ; then
  378. have_pwr8_intrinsics=disabled
  379. fi
  380. if test $have_pwr8_intrinsics = yes && test $little_endian = yes ; then
  381. DEFINES="$DEFINES -D_ARCH_PWR8"
  382. CXXFLAGS="$CXXFLAGS $PWR8_CFLAGS"
  383. CFLAGS="$CFLAGS $PWR8_CFLAGS"
  384. else
  385. PWR8_CFLAGS=
  386. fi
  387. AC_MSG_RESULT($have_pwr8_intrinsics)
  388. if test "x$enable_pwr8" = xyes && test $have_pwr8_intrinsics = no ; then
  389. AC_MSG_ERROR([POWER8 compiler support not detected])
  390. fi
  391. if test $have_pwr8_intrinsics = yes && test $little_endian = no ; then
  392. AC_MSG_WARN([POWER8 optimization is enabled only on POWER8 Little-Endian])
  393. fi
  394. AC_SUBST([PWR8_CFLAGS], $PWR8_CFLAGS)
  395. dnl Can't have static and shared libraries, default to static if user
  396. dnl explicitly requested. If both disabled, set to static since shared
  397. dnl was explicitly requested.
  398. case "x$enable_static$enable_shared" in
  399. xyesyes)
  400. AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
  401. enable_shared=no
  402. ;;
  403. xnono)
  404. AC_MSG_WARN([Cannot disable both static and shared libraries, enabling shared])
  405. enable_shared=yes
  406. ;;
  407. esac
  408. AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
  409. dnl
  410. dnl other compiler options
  411. dnl
  412. AC_ARG_ENABLE([debug],
  413. [AS_HELP_STRING([--enable-debug],
  414. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  415. [enable_debug="$enableval"],
  416. [enable_debug=no]
  417. )
  418. AC_ARG_ENABLE([profile],
  419. [AS_HELP_STRING([--enable-profile],
  420. [enable profiling of code @<:@default=disabled@:>@])],
  421. [enable_profile="$enableval"],
  422. [enable_profile=no]
  423. )
  424. if test "x$enable_profile" = xyes; then
  425. DEFINES="$DEFINES -DPROFILE"
  426. if test "x$GCC" = xyes; then
  427. CFLAGS="$CFLAGS -fno-omit-frame-pointer"
  428. fi
  429. if test "x$GXX" = xyes; then
  430. CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
  431. fi
  432. fi
  433. if test "x$enable_debug" = xyes; then
  434. DEFINES="$DEFINES -DDEBUG"
  435. if test "x$enable_profile" = xyes; then
  436. AC_MSG_WARN([Debug and Profile are enabled at the same time])
  437. fi
  438. if test "x$GCC" = xyes; then
  439. if ! echo "$CFLAGS" | grep -q -e '-g'; then
  440. CFLAGS="$CFLAGS -g"
  441. fi
  442. if ! echo "$CFLAGS" | grep -q -e '-O'; then
  443. CFLAGS="$CFLAGS -O0"
  444. fi
  445. fi
  446. if test "x$GXX" = xyes; then
  447. if ! echo "$CXXFLAGS" | grep -q -e '-g'; then
  448. CXXFLAGS="$CXXFLAGS -g"
  449. fi
  450. if ! echo "$CXXFLAGS" | grep -q -e '-O'; then
  451. CXXFLAGS="$CXXFLAGS -O0"
  452. fi
  453. fi
  454. else
  455. DEFINES="$DEFINES -DNDEBUG"
  456. fi
  457. DEFAULT_GL_LIB_NAME=GL
  458. dnl
  459. dnl Check if linker supports -Bsymbolic
  460. dnl
  461. save_LDFLAGS=$LDFLAGS
  462. LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
  463. AC_MSG_CHECKING([if ld supports -Bsymbolic])
  464. AC_LINK_IFELSE(
  465. [AC_LANG_SOURCE([int main() { return 0;}])],
  466. [AC_MSG_RESULT([yes])
  467. BSYMBOLIC="-Wl,-Bsymbolic";],
  468. [AC_MSG_RESULT([no])
  469. BSYMBOLIC="";])
  470. LDFLAGS=$save_LDFLAGS
  471. AC_SUBST([BSYMBOLIC])
  472. dnl
  473. dnl Check if linker supports garbage collection
  474. dnl
  475. save_LDFLAGS=$LDFLAGS
  476. LDFLAGS="$LDFLAGS -Wl,--gc-sections"
  477. AC_MSG_CHECKING([whether ld supports --gc-sections])
  478. AC_LINK_IFELSE(
  479. [AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])],
  480. [AC_MSG_RESULT([yes])
  481. GC_SECTIONS="-Wl,--gc-sections";],
  482. [AC_MSG_RESULT([no])
  483. GC_SECTIONS="";])
  484. LDFLAGS=$save_LDFLAGS
  485. AC_SUBST([GC_SECTIONS])
  486. dnl
  487. dnl OpenBSD does not have DT_NEEDED entries for libc by design
  488. dnl so when these flags are passed to ld via libtool the checks will fail
  489. dnl
  490. case "$host_os" in
  491. openbsd* | darwin* )
  492. LD_NO_UNDEFINED="" ;;
  493. *)
  494. LD_NO_UNDEFINED="-Wl,--no-undefined" ;;
  495. esac
  496. AC_SUBST([LD_NO_UNDEFINED])
  497. dnl
  498. dnl Check if linker supports version scripts
  499. dnl
  500. AC_MSG_CHECKING([if the linker supports version-scripts])
  501. save_LDFLAGS=$LDFLAGS
  502. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  503. cat > conftest.map <<EOF
  504. VERSION_1 {
  505. global:
  506. main;
  507. local:
  508. *;
  509. };
  510. EOF
  511. AC_LINK_IFELSE(
  512. [AC_LANG_SOURCE([int main() { return 0;}])],
  513. [have_ld_version_script=yes;AC_MSG_RESULT(yes)],
  514. [have_ld_version_script=no; AC_MSG_RESULT(no)])
  515. LDFLAGS=$save_LDFLAGS
  516. AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
  517. dnl
  518. dnl Check if linker supports dynamic list files
  519. dnl
  520. AC_MSG_CHECKING([if the linker supports --dynamic-list])
  521. save_LDFLAGS=$LDFLAGS
  522. LDFLAGS="$LDFLAGS -Wl,--dynamic-list=conftest.dyn"
  523. cat > conftest.dyn <<EOF
  524. {
  525. radeon_drm_winsys_create;
  526. };
  527. EOF
  528. AC_LINK_IFELSE(
  529. [AC_LANG_SOURCE([int main() { return 0;}])],
  530. [have_ld_dynamic_list=yes;AC_MSG_RESULT(yes)],
  531. [have_ld_dynamic_list=no; AC_MSG_RESULT(no)])
  532. LDFLAGS=$save_LDFLAGS
  533. AM_CONDITIONAL(HAVE_LD_DYNAMIC_LIST, test "$have_ld_dynamic_list" = "yes")
  534. dnl
  535. dnl compatibility symlinks
  536. dnl
  537. case "$host_os" in
  538. linux* )
  539. HAVE_COMPAT_SYMLINKS=yes ;;
  540. * )
  541. HAVE_COMPAT_SYMLINKS=no ;;
  542. esac
  543. AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test "x$HAVE_COMPAT_SYMLINKS" = xyes)
  544. DEFAULT_GL_LIB_NAME=GL
  545. dnl
  546. dnl Libglvnd configuration
  547. dnl
  548. AC_ARG_ENABLE([libglvnd],
  549. [AS_HELP_STRING([--enable-libglvnd],
  550. [Build for libglvnd @<:@default=disabled@:>@])],
  551. [enable_libglvnd="$enableval"],
  552. [enable_libglvnd=no])
  553. AM_CONDITIONAL(USE_LIBGLVND_GLX, test "x$enable_libglvnd" = xyes)
  554. #AM_COND_IF([USE_LIBGLVND_GLX], [DEFINES="${DEFINES} -DUSE_LIBGLVND_GLX=1"])
  555. if test "x$enable_libglvnd" = xyes ; then
  556. DEFINES="${DEFINES} -DUSE_LIBGLVND_GLX=1"
  557. DEFAULT_GL_LIB_NAME=GLX_mesa
  558. fi
  559. dnl
  560. dnl library names
  561. dnl
  562. dnl Unfortunately we need to do a few things that libtool can't help us with,
  563. dnl so we need some knowledge of shared library filenames:
  564. dnl
  565. dnl LIB_EXT is the extension used when creating symlinks for alternate
  566. dnl filenames for a shared library which will be dynamically loaded
  567. dnl
  568. dnl IMP_LIB_EXT is the extension used when checking for the presence of a
  569. dnl the file for a shared library we wish to link with
  570. dnl
  571. case "$host_os" in
  572. darwin* )
  573. LIB_EXT='dylib'
  574. IMP_LIB_EXT=$LIB_EXT
  575. ;;
  576. cygwin* )
  577. LIB_EXT='dll'
  578. IMP_LIB_EXT='dll.a'
  579. ;;
  580. aix* )
  581. LIB_EXT='a'
  582. IMP_LIB_EXT=$LIB_EXT
  583. ;;
  584. * )
  585. LIB_EXT='so'
  586. IMP_LIB_EXT=$LIB_EXT
  587. ;;
  588. esac
  589. AC_SUBST([LIB_EXT])
  590. AC_ARG_WITH([gl-lib-name],
  591. [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
  592. [specify GL library name @<:@default=GL@:>@])],
  593. [GL_LIB=$withval],
  594. [GL_LIB="$DEFAULT_GL_LIB_NAME"])
  595. AC_ARG_WITH([osmesa-lib-name],
  596. [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
  597. [specify OSMesa library name @<:@default=OSMesa@:>@])],
  598. [OSMESA_LIB=$withval],
  599. [OSMESA_LIB=OSMesa])
  600. AS_IF([test "x$GL_LIB" = xyes], [GL_LIB="$DEFAULT_GL_LIB_NAME"])
  601. AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
  602. dnl
  603. dnl Mangled Mesa support
  604. dnl
  605. AC_ARG_ENABLE([mangling],
  606. [AS_HELP_STRING([--enable-mangling],
  607. [enable mangled symbols and library name @<:@default=disabled@:>@])],
  608. [enable_mangling="${enableval}"],
  609. [enable_mangling=no]
  610. )
  611. if test "x${enable_mangling}" = "xyes" ; then
  612. DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
  613. GL_LIB="Mangled${GL_LIB}"
  614. OSMESA_LIB="Mangled${OSMESA_LIB}"
  615. fi
  616. AC_SUBST([GL_LIB])
  617. AC_SUBST([OSMESA_LIB])
  618. dnl
  619. dnl potentially-infringing-but-nobody-knows-for-sure stuff
  620. dnl
  621. AC_ARG_ENABLE([texture-float],
  622. [AS_HELP_STRING([--enable-texture-float],
  623. [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
  624. [enable_texture_float="$enableval"],
  625. [enable_texture_float=no]
  626. )
  627. if test "x$enable_texture_float" = xyes; then
  628. AC_MSG_WARN([Floating-point textures enabled.])
  629. AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
  630. DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
  631. fi
  632. dnl
  633. dnl Arch/platform-specific settings
  634. dnl
  635. AC_ARG_ENABLE([asm],
  636. [AS_HELP_STRING([--disable-asm],
  637. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  638. [enable_asm="$enableval"],
  639. [enable_asm=yes]
  640. )
  641. asm_arch=""
  642. AC_MSG_CHECKING([whether to enable assembly])
  643. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  644. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  645. if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then
  646. case "$host_cpu" in
  647. i?86 | x86_64 | amd64)
  648. if test "x$host_cpu" != "x$target_cpu"; then
  649. enable_asm=no
  650. AC_MSG_RESULT([no, cross compiling])
  651. fi
  652. ;;
  653. esac
  654. fi
  655. # check for supported arches
  656. if test "x$enable_asm" = xyes; then
  657. case "$host_cpu" in
  658. i?86)
  659. case "$host_os" in
  660. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd* | gnu*)
  661. asm_arch=x86
  662. ;;
  663. esac
  664. ;;
  665. x86_64|amd64)
  666. case "$host_os" in
  667. linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
  668. asm_arch=x86_64
  669. ;;
  670. esac
  671. ;;
  672. sparc*)
  673. case "$host_os" in
  674. linux*)
  675. asm_arch=sparc
  676. ;;
  677. esac
  678. ;;
  679. esac
  680. case "$asm_arch" in
  681. x86)
  682. DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  683. AC_MSG_RESULT([yes, x86])
  684. ;;
  685. x86_64|amd64)
  686. DEFINES="$DEFINES -DUSE_X86_64_ASM"
  687. AC_MSG_RESULT([yes, x86_64])
  688. ;;
  689. sparc)
  690. DEFINES="$DEFINES -DUSE_SPARC_ASM"
  691. AC_MSG_RESULT([yes, sparc])
  692. ;;
  693. *)
  694. AC_MSG_RESULT([no, platform not supported])
  695. ;;
  696. esac
  697. fi
  698. AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
  699. AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
  700. AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
  701. AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
  702. dnl Check to see if dlopen is in default libraries (like Solaris, which
  703. dnl has it in libc), or if libdl is needed to get it.
  704. AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
  705. [AC_CHECK_LIB([dl], [dlopen],
  706. [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
  707. AC_SUBST([DLOPEN_LIBS])
  708. dnl Check if that library also has dladdr
  709. save_LIBS="$LIBS"
  710. LIBS="$LIBS $DLOPEN_LIBS"
  711. AC_CHECK_FUNCS([dladdr])
  712. LIBS="$save_LIBS"
  713. case "$host_os" in
  714. darwin*)
  715. ;;
  716. *)
  717. AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
  718. [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
  719. [AC_MSG_ERROR([Could not find clock_gettime])])])
  720. AC_SUBST([CLOCK_LIB])
  721. ;;
  722. esac
  723. dnl See if posix_memalign is available
  724. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  725. dnl Check for pthreads
  726. AX_PTHREAD
  727. if test "x$ax_pthread_ok" = xno; then
  728. AC_MSG_ERROR([Building mesa on this platform requires pthreads])
  729. fi
  730. dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
  731. dnl to -pthread, which causes problems if we need -lpthread to appear in
  732. dnl pkgconfig files.
  733. test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
  734. PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
  735. AC_SUBST(PTHREADSTUBS_CFLAGS)
  736. AC_SUBST(PTHREADSTUBS_LIBS)
  737. dnl SELinux awareness.
  738. AC_ARG_ENABLE([selinux],
  739. [AS_HELP_STRING([--enable-selinux],
  740. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  741. [MESA_SELINUX="$enableval"],
  742. [MESA_SELINUX=no])
  743. if test "x$enable_selinux" = "xyes"; then
  744. PKG_CHECK_MODULES([SELINUX], [libselinux], [],
  745. [AC_CHECK_HEADER([selinux/selinux.h],[],
  746. [AC_MSG_ERROR([SELinux headers not found])])
  747. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  748. [AC_MSG_ERROR([SELinux library not found])])
  749. SELINUX_LIBS="-lselinux"])
  750. DEFINES="$DEFINES -DMESA_SELINUX"
  751. fi
  752. AC_SUBST([SELINUX_CFLAGS])
  753. AC_SUBST([SELINUX_LIBS])
  754. dnl Options for APIs
  755. AC_ARG_ENABLE([opengl],
  756. [AS_HELP_STRING([--disable-opengl],
  757. [disable support for standard OpenGL API @<:@default=enabled@:>@])],
  758. [enable_opengl="$enableval"],
  759. [enable_opengl=yes])
  760. AC_ARG_ENABLE([gles1],
  761. [AS_HELP_STRING([--disable-gles1],
  762. [disable support for OpenGL ES 1.x API @<:@default=enabled@:>@])],
  763. [enable_gles1="$enableval"],
  764. [enable_gles1=yes])
  765. AC_ARG_ENABLE([gles2],
  766. [AS_HELP_STRING([--disable-gles2],
  767. [disable support for OpenGL ES 2.x API @<:@default=enabled@:>@])],
  768. [enable_gles2="$enableval"],
  769. [enable_gles2=yes])
  770. AC_ARG_ENABLE([dri],
  771. [AS_HELP_STRING([--enable-dri],
  772. [enable DRI modules @<:@default=enabled@:>@])],
  773. [enable_dri="$enableval"],
  774. [enable_dri=yes])
  775. case "$host_os" in
  776. linux*)
  777. dri3_default=yes
  778. ;;
  779. *)
  780. dri3_default=no
  781. ;;
  782. esac
  783. if test "x$enable_dri" = xno; then
  784. dri3_default=no
  785. fi
  786. AC_ARG_ENABLE([dri3],
  787. [AS_HELP_STRING([--enable-dri3],
  788. [enable DRI3 @<:@default=auto@:>@])],
  789. [enable_dri3="$enableval"],
  790. [enable_dri3="$dri3_default"])
  791. AC_ARG_ENABLE([glx],
  792. [AS_HELP_STRING([--enable-glx@<:@=dri|xlib|gallium-xlib@:>@],
  793. [enable the GLX library and choose an implementation @<:@default=auto@:>@])],
  794. [enable_glx="$enableval"],
  795. [enable_glx=yes])
  796. AC_ARG_ENABLE([osmesa],
  797. [AS_HELP_STRING([--enable-osmesa],
  798. [enable OSMesa library @<:@default=disabled@:>@])],
  799. [enable_osmesa="$enableval"],
  800. [enable_osmesa=no])
  801. AC_ARG_ENABLE([gallium-osmesa],
  802. [AS_HELP_STRING([--enable-gallium-osmesa],
  803. [enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
  804. [enable_gallium_osmesa="$enableval"],
  805. [enable_gallium_osmesa=no])
  806. AC_ARG_ENABLE([egl],
  807. [AS_HELP_STRING([--disable-egl],
  808. [disable EGL library @<:@default=enabled@:>@])],
  809. [enable_egl="$enableval"],
  810. [enable_egl=yes])
  811. AC_ARG_ENABLE([xa],
  812. [AS_HELP_STRING([--enable-xa],
  813. [enable build of the XA X Acceleration API @<:@default=disabled@:>@])],
  814. [enable_xa="$enableval"],
  815. [enable_xa=no])
  816. AC_ARG_ENABLE([gbm],
  817. [AS_HELP_STRING([--enable-gbm],
  818. [enable gbm library @<:@default=auto@:>@])],
  819. [enable_gbm="$enableval"],
  820. [enable_gbm=auto])
  821. AC_ARG_ENABLE([nine],
  822. [AS_HELP_STRING([--enable-nine],
  823. [enable build of the nine Direct3D9 API @<:@default=no@:>@])],
  824. [enable_nine="$enableval"],
  825. [enable_nine=no])
  826. AC_ARG_ENABLE([xvmc],
  827. [AS_HELP_STRING([--enable-xvmc],
  828. [enable xvmc library @<:@default=auto@:>@])],
  829. [enable_xvmc="$enableval"],
  830. [enable_xvmc=auto])
  831. AC_ARG_ENABLE([vdpau],
  832. [AS_HELP_STRING([--enable-vdpau],
  833. [enable vdpau library @<:@default=auto@:>@])],
  834. [enable_vdpau="$enableval"],
  835. [enable_vdpau=auto])
  836. AC_ARG_ENABLE([omx],
  837. [AS_HELP_STRING([--enable-omx],
  838. [enable OpenMAX library @<:@default=disabled@:>@])],
  839. [enable_omx="$enableval"],
  840. [enable_omx=no])
  841. AC_ARG_ENABLE([va],
  842. [AS_HELP_STRING([--enable-va],
  843. [enable va library @<:@default=auto@:>@])],
  844. [enable_va="$enableval"],
  845. [enable_va=auto])
  846. AC_ARG_ENABLE([opencl],
  847. [AS_HELP_STRING([--enable-opencl],
  848. [enable OpenCL library @<:@default=disabled@:>@])],
  849. [enable_opencl="$enableval"],
  850. [enable_opencl=no])
  851. AC_ARG_ENABLE([opencl_icd],
  852. [AS_HELP_STRING([--enable-opencl-icd],
  853. [Build an OpenCL ICD library to be loaded by an ICD implementation
  854. @<:@default=disabled@:>@])],
  855. [enable_opencl_icd="$enableval"],
  856. [enable_opencl_icd=no])
  857. AC_ARG_ENABLE([gallium-tests],
  858. [AS_HELP_STRING([--enable-gallium-tests],
  859. [Enable optional Gallium tests) @<:@default=disabled@:>@])],
  860. [enable_gallium_tests="$enableval"],
  861. [enable_gallium_tests=no])
  862. # Option for Gallium drivers
  863. # Keep this in sync with the --with-gallium-drivers help string default value
  864. GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
  865. AC_ARG_WITH([gallium-drivers],
  866. [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
  867. [comma delimited Gallium drivers list, e.g.
  868. "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl"
  869. @<:@default=r300,r600,svga,swrast@:>@])],
  870. [with_gallium_drivers="$withval"],
  871. [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
  872. # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
  873. # here so that the script doesn't choke on an unknown driver name later.
  874. case "$with_gallium_drivers" in
  875. yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
  876. no) with_gallium_drivers='' ;;
  877. esac
  878. if test "x$enable_opengl" = xno -a \
  879. "x$enable_gles1" = xno -a \
  880. "x$enable_gles2" = xno -a \
  881. "x$enable_nine" = xno -a \
  882. "x$enable_xa" = xno -a \
  883. "x$enable_xvmc" = xno -a \
  884. "x$enable_vdpau" = xno -a \
  885. "x$enable_omx" = xno -a \
  886. "x$enable_va" = xno -a \
  887. "x$enable_opencl" = xno; then
  888. AC_MSG_ERROR([at least one API should be enabled])
  889. fi
  890. # Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
  891. if test "x$enable_opengl" = xno -a \
  892. "x$enable_gles1" = xyes; then
  893. AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
  894. fi
  895. if test "x$enable_opengl" = xno -a \
  896. "x$enable_gles2" = xyes; then
  897. AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
  898. fi
  899. AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
  900. AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
  901. AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
  902. AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
  903. "x$enable_gles1" = xyes -o \
  904. "x$enable_gles2" = xyes)
  905. # Validate GLX options
  906. if test "x$enable_glx" = xyes; then
  907. if test "x$enable_dri" = xyes; then
  908. enable_glx=dri
  909. elif test -n "$with_gallium_drivers"; then
  910. enable_glx=gallium-xlib
  911. else
  912. enable_glx=xlib
  913. fi
  914. fi
  915. case "x$enable_glx" in
  916. xdri | xxlib | xgallium-xlib)
  917. # GLX requires OpenGL
  918. if test "x$enable_opengl" = xno; then
  919. AC_MSG_ERROR([GLX cannot be built without OpenGL])
  920. fi
  921. # Check individual dependencies
  922. case "x$enable_glx" in
  923. xdri)
  924. if test "x$enable_dri" = xno; then
  925. AC_MSG_ERROR([DRI-based GLX requires DRI to be enabled])
  926. fi
  927. ;;
  928. xxlib)
  929. if test "x$enable_dri" = xyes; then
  930. AC_MSG_ERROR([Xlib-based GLX cannot be built with DRI enabled])
  931. fi
  932. ;;
  933. xgallium-xlib )
  934. if test "x$enable_dri" = xyes; then
  935. AC_MSG_ERROR([Xlib-based (Gallium) GLX cannot be built with DRI enabled])
  936. fi
  937. if test -z "$with_gallium_drivers"; then
  938. AC_MSG_ERROR([Xlib-based (Gallium) GLX cannot be built without Gallium enabled])
  939. fi
  940. ;;
  941. esac
  942. ;;
  943. xno)
  944. ;;
  945. *)
  946. AC_MSG_ERROR([Illegal value for --enable-glx: $enable_glx])
  947. ;;
  948. esac
  949. AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xdri)
  950. AM_CONDITIONAL(HAVE_XLIB_GLX, test "x$enable_glx" = xxlib)
  951. AM_CONDITIONAL(HAVE_GALLIUM_XLIB_GLX, test "x$enable_glx" = xgallium-xlib)
  952. dnl
  953. dnl Libglvnd configuration
  954. dnl
  955. AC_ARG_ENABLE([libglvnd],
  956. [AS_HELP_STRING([--enable-libglvnd],
  957. [Build for libglvnd @<:@default=disabled@:>@])],
  958. [enable_libglvnd="$enableval"],
  959. [enable_libglvnd=no])
  960. AM_CONDITIONAL(USE_LIBGLVND_GLX, test "x$enable_libglvnd" = xyes)
  961. if test "x$enable_libglvnd" = xyes ; then
  962. dnl XXX: update once we can handle more than libGL/glx.
  963. dnl Namely: we should error out if neither of the glvnd enabled libraries
  964. dnl are built
  965. case "x$enable_glx" in
  966. xno)
  967. AC_MSG_ERROR([cannot build libglvnd without GLX])
  968. ;;
  969. xxlib | xgallium-xlib )
  970. AC_MSG_ERROR([cannot build libgvnd when Xlib-GLX or Gallium-Xlib-GLX is enabled])
  971. ;;
  972. xdri)
  973. ;;
  974. esac
  975. PKG_CHECK_MODULES([GLVND], libglvnd >= 0.1.0)
  976. DEFINES="${DEFINES} -DUSE_LIBGLVND_GLX=1"
  977. DEFAULT_GL_LIB_NAME=GLX_mesa
  978. fi
  979. # Check for libdrm
  980. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
  981. [have_libdrm=yes], [have_libdrm=no])
  982. if test "x$have_libdrm" = xyes; then
  983. DEFINES="$DEFINES -DHAVE_LIBDRM"
  984. fi
  985. # Select which platform-dependent DRI code gets built
  986. case "$host_os" in
  987. darwin*)
  988. dri_platform='apple' ;;
  989. gnu*|cygwin*)
  990. dri_platform='none' ;;
  991. *)
  992. dri_platform='drm' ;;
  993. esac
  994. if test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes; then
  995. have_drisw_kms='yes'
  996. fi
  997. AM_CONDITIONAL(HAVE_DRICOMMON, test "x$enable_dri" = xyes )
  998. AM_CONDITIONAL(HAVE_DRISW, test "x$enable_dri" = xyes )
  999. AM_CONDITIONAL(HAVE_DRISW_KMS, test "x$have_drisw_kms" = xyes )
  1000. AM_CONDITIONAL(HAVE_DRI2, test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes )
  1001. AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes )
  1002. AM_CONDITIONAL(HAVE_APPLEDRI, test "x$enable_dri" = xyes -a "x$dri_platform" = xapple )
  1003. AC_ARG_ENABLE([shared-glapi],
  1004. [AS_HELP_STRING([--enable-shared-glapi],
  1005. [Enable shared glapi for OpenGL @<:@default=enabled@:>@])],
  1006. [enable_shared_glapi="$enableval"],
  1007. [enable_shared_glapi=yes])
  1008. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1009. x*yes*yes*)
  1010. if test "x$enable_shared_glapi" = xno; then
  1011. AC_MSG_ERROR([shared GLAPI required when building two or more of
  1012. the following APIs - opengl, gles1 gles2])
  1013. fi
  1014. ;;
  1015. esac
  1016. AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
  1017. # Build the pipe-drivers as separate libraries/modules.
  1018. # Do not touch this unless you know what you are doing.
  1019. # XXX: Expose via configure option ?
  1020. enable_shared_pipe_drivers=no
  1021. dnl
  1022. dnl Driver specific build directories
  1023. dnl
  1024. if test "x$enable_gallium_osmesa" = xyes; then
  1025. if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
  1026. AC_MSG_ERROR([gallium_osmesa requires the gallium swrast driver])
  1027. fi
  1028. if test "x$enable_osmesa" = xyes; then
  1029. AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
  1030. fi
  1031. fi
  1032. AC_SUBST([MESA_LLVM])
  1033. # SHA1 hashing
  1034. AC_ARG_WITH([sha1],
  1035. [AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
  1036. [choose SHA1 implementation])])
  1037. case "x$with_sha1" in
  1038. x | xlibc | xlibmd | xlibnettle | xlibgcrypt | xlibcrypto | xlibsha1 | xCommonCrypto | xCryptoAPI)
  1039. ;;
  1040. *)
  1041. AC_MSG_ERROR([Illegal value for --with-sha1: $with_sha1])
  1042. esac
  1043. AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
  1044. if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
  1045. with_sha1=libc
  1046. fi
  1047. if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then
  1048. AC_MSG_ERROR([sha1 in libc requested but not found])
  1049. fi
  1050. if test "x$with_sha1" = xlibc; then
  1051. AC_DEFINE([HAVE_SHA1_IN_LIBC], [1],
  1052. [Use libc SHA1 functions])
  1053. SHA1_LIBS=""
  1054. fi
  1055. AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes])
  1056. if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then
  1057. with_sha1=CommonCrypto
  1058. fi
  1059. if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then
  1060. AC_MSG_ERROR([CommonCrypto requested but not found])
  1061. fi
  1062. if test "x$with_sha1" = xCommonCrypto; then
  1063. AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1],
  1064. [Use CommonCrypto SHA1 functions])
  1065. SHA1_LIBS=""
  1066. fi
  1067. dnl stdcall functions cannot be tested with AC_CHECK_LIB
  1068. AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include <windows.h>])
  1069. if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then
  1070. with_sha1=CryptoAPI
  1071. fi
  1072. if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then
  1073. AC_MSG_ERROR([CryptoAPI requested but not found])
  1074. fi
  1075. if test "x$with_sha1" = xCryptoAPI; then
  1076. AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1],
  1077. [Use CryptoAPI SHA1 functions])
  1078. SHA1_LIBS=""
  1079. fi
  1080. AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
  1081. if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
  1082. with_sha1=libmd
  1083. fi
  1084. if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then
  1085. AC_MSG_ERROR([libmd requested but not found])
  1086. fi
  1087. if test "x$with_sha1" = xlibmd; then
  1088. AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
  1089. [Use libmd SHA1 functions])
  1090. SHA1_LIBS=-lmd
  1091. fi
  1092. PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no])
  1093. if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
  1094. with_sha1=libsha1
  1095. fi
  1096. if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then
  1097. AC_MSG_ERROR([libsha1 requested but not found])
  1098. fi
  1099. if test "x$with_sha1" = xlibsha1; then
  1100. AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
  1101. [Use libsha1 for SHA1])
  1102. SHA1_LIBS=-lsha1
  1103. fi
  1104. AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
  1105. if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
  1106. with_sha1=libnettle
  1107. fi
  1108. if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then
  1109. AC_MSG_ERROR([libnettle requested but not found])
  1110. fi
  1111. if test "x$with_sha1" = xlibnettle; then
  1112. AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
  1113. [Use libnettle SHA1 functions])
  1114. SHA1_LIBS=-lnettle
  1115. fi
  1116. AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
  1117. if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
  1118. with_sha1=libgcrypt
  1119. fi
  1120. if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then
  1121. AC_MSG_ERROR([libgcrypt requested but not found])
  1122. fi
  1123. if test "x$with_sha1" = xlibgcrypt; then
  1124. AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1],
  1125. [Use libgcrypt SHA1 functions])
  1126. SHA1_LIBS=-lgcrypt
  1127. fi
  1128. # We don't need all of the OpenSSL libraries, just libcrypto
  1129. AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes])
  1130. PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],
  1131. [HAVE_OPENSSL_PKC=no])
  1132. if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then
  1133. if test "x$with_sha1" = x; then
  1134. with_sha1=libcrypto
  1135. fi
  1136. else
  1137. if test "x$with_sha1" = xlibcrypto; then
  1138. AC_MSG_ERROR([OpenSSL libcrypto requested but not found])
  1139. fi
  1140. fi
  1141. if test "x$with_sha1" = xlibcrypto; then
  1142. if test "x$HAVE_LIBCRYPTO" = xyes; then
  1143. SHA1_LIBS=-lcrypto
  1144. else
  1145. SHA1_LIBS="$OPENSSL_LIBS"
  1146. SHA1_CFLAGS="$OPENSSL_CFLAGS"
  1147. fi
  1148. fi
  1149. AC_MSG_CHECKING([for SHA1 implementation])
  1150. AC_MSG_RESULT([$with_sha1])
  1151. AC_SUBST(SHA1_LIBS)
  1152. AC_SUBST(SHA1_CFLAGS)
  1153. # Enable a define for SHA1
  1154. if test "x$with_sha1" != "x"; then
  1155. DEFINES="$DEFINES -DHAVE_SHA1"
  1156. fi
  1157. # Allow user to configure out the shader-cache feature
  1158. AC_ARG_ENABLE([shader-cache],
  1159. AS_HELP_STRING([--disable-shader-cache], [Disable binary shader cache]),
  1160. [enable_shader_cache="$enableval"],
  1161. [if test "x$with_sha1" != "x"; then
  1162. enable_shader_cache=yes
  1163. else
  1164. enable_shader_cache=no
  1165. fi])
  1166. if test "x$with_sha1" = "x"; then
  1167. if test "x$enable_shader_cache" = "xyes"; then
  1168. AC_MSG_ERROR([Cannot enable shader cache (no SHA-1 implementation found)])
  1169. fi
  1170. fi
  1171. AM_CONDITIONAL([ENABLE_SHADER_CACHE], [test x$enable_shader_cache = xyes])
  1172. case "$host_os" in
  1173. linux*)
  1174. need_pci_id=yes ;;
  1175. *)
  1176. need_pci_id=no ;;
  1177. esac
  1178. PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED],
  1179. have_libudev=yes, have_libudev=no)
  1180. AC_ARG_ENABLE([sysfs],
  1181. [AS_HELP_STRING([--enable-sysfs],
  1182. [enable /sys PCI identification @<:@default=disabled@:>@])],
  1183. [have_sysfs="$enableval"],
  1184. [have_sysfs=no]
  1185. )
  1186. if test "x$enable_dri" = xyes; then
  1187. if test "$enable_static" = yes; then
  1188. AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
  1189. fi
  1190. # not a hard requirement as swrast does not depend on it
  1191. if test "x$have_libdrm" = xyes; then
  1192. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  1193. fi
  1194. fi
  1195. AC_ARG_ENABLE([driglx-direct],
  1196. [AS_HELP_STRING([--disable-driglx-direct],
  1197. [disable direct rendering in GLX and EGL for DRI \
  1198. @<:@default=auto@:>@])],
  1199. [driglx_direct="$enableval"],
  1200. [driglx_direct="yes"])
  1201. dnl
  1202. dnl libGL configuration per driver
  1203. dnl
  1204. case "x$enable_glx" in
  1205. xxlib | xgallium-xlib)
  1206. # Xlib-based GLX
  1207. dri_modules="x11 xext xcb"
  1208. PKG_CHECK_MODULES([XLIBGL], [$dri_modules])
  1209. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  1210. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  1211. GL_LIB_DEPS="$XLIBGL_LIBS"
  1212. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1213. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
  1214. ;;
  1215. xdri)
  1216. # DRI-based GLX
  1217. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  1218. # find the DRI deps for libGL
  1219. dri_modules="x11 xext xdamage xfixes x11-xcb xcb xcb-glx >= $XCBGLX_REQUIRED"
  1220. if test x"$driglx_direct" = xyes; then
  1221. if test x"$dri_platform" = xdrm ; then
  1222. DEFINES="$DEFINES -DGLX_USE_DRM"
  1223. if test "x$have_libdrm" != xyes; then
  1224. AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
  1225. fi
  1226. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  1227. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
  1228. if test x"$enable_dri3" = xyes; then
  1229. PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED])
  1230. PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED])
  1231. fi
  1232. if test x"$enable_dri" = xyes; then
  1233. dri_modules="$dri_modules xcb-dri2 >= $XCBDRI2_REQUIRED"
  1234. fi
  1235. if test x"$enable_dri3" = xyes; then
  1236. PKG_CHECK_EXISTS([xcb >= $XCB_REQUIRED], [], AC_MSG_ERROR([DRI3 requires xcb >= $XCB_REQUIRED]))
  1237. dri3_modules="xcb xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
  1238. PKG_CHECK_MODULES([XCB_DRI3], [$dri3_modules])
  1239. fi
  1240. fi
  1241. if test x"$dri_platform" = xapple ; then
  1242. DEFINES="$DEFINES -DGLX_USE_APPLEGL"
  1243. fi
  1244. fi
  1245. # add xf86vidmode if available
  1246. PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
  1247. if test "$HAVE_XF86VIDMODE" = yes ; then
  1248. dri_modules="$dri_modules xxf86vm"
  1249. fi
  1250. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  1251. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  1252. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  1253. GL_LIB_DEPS="$DRIGL_LIBS"
  1254. # need DRM libs, $PTHREAD_LIBS, etc.
  1255. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1256. GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1257. ;;
  1258. esac
  1259. have_pci_id=no
  1260. if test "$have_libudev" = yes; then
  1261. DEFINES="$DEFINES -DHAVE_LIBUDEV"
  1262. have_pci_id=yes
  1263. fi
  1264. if test "$have_sysfs" = yes; then
  1265. DEFINES="$DEFINES -DHAVE_SYSFS"
  1266. have_pci_id=yes
  1267. fi
  1268. # This is outside the case (above) so that it is invoked even for non-GLX
  1269. # builds.
  1270. AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
  1271. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1272. GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1273. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1274. GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1275. AC_SUBST([X11_INCLUDES])
  1276. AC_SUBST([GL_LIB_DEPS])
  1277. AC_SUBST([GL_PC_REQ_PRIV])
  1278. AC_SUBST([GL_PC_LIB_PRIV])
  1279. AC_SUBST([GL_PC_CFLAGS])
  1280. AC_SUBST([DRI_PC_REQ_PRIV])
  1281. AC_SUBST([GLESv1_CM_LIB_DEPS])
  1282. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  1283. AC_SUBST([GLESv2_LIB_DEPS])
  1284. AC_SUBST([GLESv2_PC_LIB_PRIV])
  1285. AC_SUBST([HAVE_XF86VIDMODE])
  1286. dnl
  1287. dnl More GLX setup
  1288. dnl
  1289. case "x$enable_glx" in
  1290. xxlib | xgallium-xlib)
  1291. DEFINES="$DEFINES -DUSE_XSHM"
  1292. ;;
  1293. xdri)
  1294. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  1295. if test "x$driglx_direct" = xyes; then
  1296. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  1297. fi
  1298. ;;
  1299. esac
  1300. dnl
  1301. dnl TLS detection
  1302. dnl
  1303. AC_ARG_ENABLE([glx-tls],
  1304. [AS_HELP_STRING([--enable-glx-tls],
  1305. [enable TLS support in GLX @<:@default=disabled@:>@])],
  1306. [GLX_USE_TLS="$enableval"],
  1307. [GLX_USE_TLS=no])
  1308. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  1309. AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
  1310. [DEFINES="${DEFINES} -DGLX_USE_TLS"])
  1311. dnl Read-only text section on x86 hardened platforms
  1312. AC_ARG_ENABLE([glx-read-only-text],
  1313. [AS_HELP_STRING([--enable-glx-read-only-text],
  1314. [Disable writable .text section on x86 (decreases performance) @<:@default=disabled@:>@])],
  1315. [enable_glx_read_only_text="$enableval"],
  1316. [enable_glx_read_only_text=no])
  1317. if test "x$enable_glx_read_only_text" = xyes; then
  1318. DEFINES="$DEFINES -DGLX_X86_READONLY_TEXT"
  1319. fi
  1320. dnl
  1321. dnl More DRI setup
  1322. dnl
  1323. dnl Directory for DRI drivers
  1324. AC_ARG_WITH([dri-driverdir],
  1325. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  1326. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  1327. [DRI_DRIVER_INSTALL_DIR="$withval"],
  1328. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  1329. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  1330. dnl Extra search path for DRI drivers
  1331. AC_ARG_WITH([dri-searchpath],
  1332. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  1333. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  1334. [DRI_DRIVER_SEARCH_DIR="$withval"],
  1335. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  1336. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  1337. dnl Which drivers to build - default is chosen by platform
  1338. AC_ARG_WITH([dri-drivers],
  1339. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  1340. [comma delimited classic DRI drivers list, e.g.
  1341. "swrast,i965,radeon" @<:@default=auto@:>@])],
  1342. [with_dri_drivers="$withval"],
  1343. [with_dri_drivers=auto])
  1344. if test "x$with_dri_drivers" = xauto; then
  1345. if test "x$enable_opengl" = xyes -a "x$enable_dri" = xyes; then
  1346. with_dri_drivers="yes"
  1347. else
  1348. with_dri_drivers="no"
  1349. fi
  1350. fi
  1351. if test "x$with_dri_drivers" = xno; then
  1352. with_dri_drivers=''
  1353. fi
  1354. dnl If $with_dri_drivers is yes, drivers will be added through
  1355. dnl platform checks. Set DEFINES and LIB_DEPS
  1356. if test "x$enable_dri" = xyes; then
  1357. # Platform specific settings and drivers to build
  1358. case "$host_os" in
  1359. linux*)
  1360. DEFINES="$DEFINES -DHAVE_ALIAS"
  1361. if test "x$enable_dri3" = xyes; then
  1362. DEFINES="$DEFINES -DHAVE_DRI3"
  1363. fi
  1364. if test "x$have_pci_id" != xyes; then
  1365. AC_MSG_ERROR([libudev-dev or sysfs required for building DRI])
  1366. fi
  1367. case "$host_cpu" in
  1368. powerpc* | sparc*)
  1369. # Build only the drivers for cards that exist on PowerPC/sparc
  1370. if test "x$with_dri_drivers" = "xyes"; then
  1371. with_dri_drivers="r200 radeon swrast"
  1372. fi
  1373. ;;
  1374. esac
  1375. ;;
  1376. *freebsd* | dragonfly* | *netbsd* | openbsd*)
  1377. DEFINES="$DEFINES -DHAVE_ALIAS"
  1378. ;;
  1379. gnu*)
  1380. DEFINES="$DEFINES -DHAVE_ALIAS"
  1381. ;;
  1382. cygwin*)
  1383. if test "x$with_dri_drivers" = "xyes"; then
  1384. with_dri_drivers="swrast"
  1385. fi
  1386. ;;
  1387. darwin*)
  1388. DEFINES="$DEFINES -DGLX_ALIAS_UNSUPPORTED -DBUILDING_MESA"
  1389. if test "x$with_dri_drivers" = "xyes"; then
  1390. with_dri_drivers="swrast"
  1391. fi
  1392. ;;
  1393. esac
  1394. # default drivers
  1395. if test "x$with_dri_drivers" = "xyes"; then
  1396. with_dri_drivers="i915 i965 nouveau r200 radeon swrast"
  1397. fi
  1398. # Check for expat
  1399. PKG_CHECK_MODULES([EXPAT], [expat], [],
  1400. # expat version 2.0 and earlier do not provide expat.pc
  1401. [AC_CHECK_HEADER([expat.h],[],
  1402. [AC_MSG_ERROR([Expat headers required for DRI not found])])
  1403. AC_CHECK_LIB([expat],[XML_ParserCreate],[],
  1404. [AC_MSG_ERROR([Expat library required for DRI not found])])
  1405. EXPAT_LIBS="-lexpat"])
  1406. # put all the necessary libs together
  1407. DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1408. fi
  1409. AC_SUBST([DRI_LIB_DEPS])
  1410. DRI_DIRS=''
  1411. dnl Duplicates in DRI_DIRS are removed by sorting it at the end of this block
  1412. if test -n "$with_dri_drivers"; then
  1413. if test "x$enable_opengl" != xyes; then
  1414. AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
  1415. fi
  1416. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  1417. for driver in $dri_drivers; do
  1418. DRI_DIRS="$DRI_DIRS $driver"
  1419. case "x$driver" in
  1420. xi915)
  1421. HAVE_I915_DRI=yes;
  1422. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1423. ;;
  1424. xi965)
  1425. HAVE_I965_DRI=yes;
  1426. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1427. ;;
  1428. xnouveau)
  1429. HAVE_NOUVEAU_DRI=yes;
  1430. PKG_CHECK_MODULES([NVVIEUX], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
  1431. ;;
  1432. xradeon)
  1433. HAVE_RADEON_DRI=yes;
  1434. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1435. ;;
  1436. xr200)
  1437. HAVE_R200_DRI=yes;
  1438. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1439. ;;
  1440. xswrast)
  1441. HAVE_SWRAST_DRI=yes;
  1442. ;;
  1443. *)
  1444. AC_MSG_ERROR([classic DRI driver '$driver' does not exist])
  1445. ;;
  1446. esac
  1447. done
  1448. DRI_DIRS=`echo $DRI_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1449. fi
  1450. #
  1451. # Vulkan driver configuration
  1452. #
  1453. AC_ARG_WITH([vulkan-drivers],
  1454. [AS_HELP_STRING([--with-vulkan-drivers@<:@=DIRS...@:>@],
  1455. [comma delimited Vulkan drivers list, e.g.
  1456. "intel"
  1457. @<:@default=no@:>@])],
  1458. [with_vulkan_drivers="$withval"],
  1459. [with_vulkan_drivers="no"])
  1460. # Doing '--without-vulkan-drivers' will set this variable to 'no'. Clear it
  1461. # here so that the script doesn't choke on an unknown driver name later.
  1462. case "x$with_vulkan_drivers" in
  1463. xyes) with_vulkan_drivers="$VULKAN_DRIVERS_DEFAULT" ;;
  1464. xno) with_vulkan_drivers='' ;;
  1465. esac
  1466. AC_ARG_WITH([vulkan-icddir],
  1467. [AS_HELP_STRING([--with-vulkan-icddir=DIR],
  1468. [directory for the Vulkan driver icd files @<:@${sysconfdir}/vulkan/icd.d@:>@])],
  1469. [VULKAN_ICD_INSTALL_DIR="$withval"],
  1470. [VULKAN_ICD_INSTALL_DIR='${sysconfdir}/vulkan/icd.d'])
  1471. AC_SUBST([VULKAN_ICD_INSTALL_DIR])
  1472. if test -n "$with_vulkan_drivers"; then
  1473. VULKAN_DRIVERS=`IFS=', '; echo $with_vulkan_drivers`
  1474. for driver in $VULKAN_DRIVERS; do
  1475. case "x$driver" in
  1476. xintel)
  1477. if test "x$HAVE_I965_DRI" != xyes; then
  1478. AC_MSG_ERROR([Intel Vulkan driver requires the i965 dri driver])
  1479. fi
  1480. if test "x$with_sha1" == "x"; then
  1481. AC_MSG_ERROR([Intel Vulkan driver requires SHA1])
  1482. fi
  1483. HAVE_INTEL_VULKAN=yes;
  1484. ;;
  1485. *)
  1486. AC_MSG_ERROR([Vulkan driver '$driver' does not exist])
  1487. ;;
  1488. esac
  1489. done
  1490. VULKAN_DRIVERS=`echo $VULKAN_DRIVERS|tr " " "\n"|sort -u|tr "\n" " "`
  1491. fi
  1492. AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
  1493. AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_glx" = xxlib -o \
  1494. "x$enable_osmesa" = xyes -o \
  1495. -n "$DRI_DIRS")
  1496. dnl
  1497. dnl OSMesa configuration
  1498. dnl
  1499. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  1500. AC_ARG_WITH([osmesa-bits],
  1501. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  1502. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  1503. [osmesa_bits="$withval"],
  1504. [osmesa_bits=8])
  1505. if test "x$osmesa_bits" != x8; then
  1506. if test "x$enable_dri" = xyes -o "x$enable_glx" != xno; then
  1507. AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
  1508. osmesa_bits=8
  1509. fi
  1510. fi
  1511. case "x$osmesa_bits" in
  1512. x8)
  1513. OSMESA_LIB="${OSMESA_LIB}"
  1514. ;;
  1515. x16|x32)
  1516. OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
  1517. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  1518. ;;
  1519. *)
  1520. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  1521. ;;
  1522. esac
  1523. if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
  1524. # only link libraries with osmesa if shared
  1525. if test "$enable_static" = no; then
  1526. OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1527. else
  1528. OSMESA_LIB_DEPS=""
  1529. fi
  1530. OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1531. fi
  1532. AC_SUBST([OSMESA_LIB_DEPS])
  1533. AC_SUBST([OSMESA_PC_REQ])
  1534. AC_SUBST([OSMESA_PC_LIB_PRIV])
  1535. dnl
  1536. dnl gbm configuration
  1537. dnl
  1538. if test "x$enable_gbm" = xauto; then
  1539. case "$with_egl_platforms" in
  1540. *drm*)
  1541. enable_gbm=yes ;;
  1542. *)
  1543. enable_gbm=no ;;
  1544. esac
  1545. fi
  1546. if test "x$enable_gbm" = xyes; then
  1547. if test "x$need_pci_id$have_pci_id" = xyesno; then
  1548. AC_MSG_ERROR([gbm requires udev >= $LIBUDEV_REQUIRED or sysfs])
  1549. fi
  1550. if test "x$enable_dri" = xyes; then
  1551. if test "x$enable_shared_glapi" = xno; then
  1552. AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
  1553. fi
  1554. else
  1555. # Strictly speaking libgbm does not require --enable-dri, although
  1556. # both of its backends do. Thus one can build libgbm without any
  1557. # backends if --disable-dri is set.
  1558. # To avoid unnecessary complexity of checking if at least one backend
  1559. # is available when building, just mandate --enable-dri.
  1560. AC_MSG_ERROR([gbm requires --enable-dri])
  1561. fi
  1562. fi
  1563. AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
  1564. if test "x$need_pci_id$have_libudev" = xyesyes; then
  1565. GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED"
  1566. else
  1567. GBM_PC_REQ_PRIV=""
  1568. fi
  1569. GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
  1570. AC_SUBST([GBM_PC_REQ_PRIV])
  1571. AC_SUBST([GBM_PC_LIB_PRIV])
  1572. dnl
  1573. dnl EGL configuration
  1574. dnl
  1575. EGL_CLIENT_APIS=""
  1576. if test "x$enable_egl" = xyes; then
  1577. EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
  1578. AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
  1579. if test "$enable_static" != yes; then
  1580. if test "x$enable_dri" = xyes; then
  1581. HAVE_EGL_DRIVER_DRI2=1
  1582. if test "x$enable_shared_glapi" = xno; then
  1583. AC_MSG_ERROR([egl_dri2 requires --enable-shared-glapi])
  1584. fi
  1585. if test "x$enable_dri3" = xyes; then
  1586. HAVE_EGL_DRIVER_DRI3=1
  1587. if test "x$enable_shared_glapi" = xno; then
  1588. AC_MSG_ERROR([egl_dri3 requires --enable-shared-glapi])
  1589. fi
  1590. fi
  1591. else
  1592. # Avoid building an "empty" libEGL. Drop/update this
  1593. # when other backends (haiku?) come along.
  1594. AC_MSG_ERROR([egl requires --enable-dri])
  1595. fi
  1596. fi
  1597. fi
  1598. AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
  1599. AC_SUBST([EGL_LIB_DEPS])
  1600. gallium_st="mesa"
  1601. dnl
  1602. dnl XA configuration
  1603. dnl
  1604. if test "x$enable_xa" = xyes; then
  1605. if test "x$with_gallium_drivers" = xswrast; then
  1606. AC_MSG_ERROR([
  1607. Building xa requires at least one non swrast gallium driver.
  1608. If you are looking to use libxatracker.so with the VMware driver,
  1609. make sure to include svga in the gallium drivers list, apart from
  1610. enabling XA.
  1611. Example: ./configure --enable-xa --with-gallium-drivers=svga...])
  1612. fi
  1613. gallium_st="$gallium_st xa"
  1614. fi
  1615. AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
  1616. dnl
  1617. dnl Gallium G3DVL configuration
  1618. dnl
  1619. if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then
  1620. if test "x$enable_xvmc" = xauto; then
  1621. PKG_CHECK_EXISTS([xvmc >= $XVMC_REQUIRED], [enable_xvmc=yes], [enable_xvmc=no])
  1622. fi
  1623. if test "x$enable_vdpau" = xauto; then
  1624. PKG_CHECK_EXISTS([vdpau >= $VDPAU_REQUIRED], [enable_vdpau=yes], [enable_vdpau=no])
  1625. fi
  1626. if test "x$enable_omx" = xauto; then
  1627. PKG_CHECK_EXISTS([libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED], [enable_omx=yes], [enable_omx=no])
  1628. fi
  1629. if test "x$enable_va" = xauto; then
  1630. PKG_CHECK_EXISTS([libva >= $LIBVA_REQUIRED], [enable_va=yes], [enable_va=no])
  1631. fi
  1632. fi
  1633. if test "x$enable_dri" = xyes -o \
  1634. "x$enable_xvmc" = xyes -o \
  1635. "x$enable_vdpau" = xyes -o \
  1636. "x$enable_omx" = xyes -o \
  1637. "x$enable_va" = xyes; then
  1638. need_gallium_vl=yes
  1639. fi
  1640. AM_CONDITIONAL(NEED_GALLIUM_VL, test "x$need_gallium_vl" = xyes)
  1641. if test "x$enable_xvmc" = xyes -o \
  1642. "x$enable_vdpau" = xyes -o \
  1643. "x$enable_omx" = xyes -o \
  1644. "x$enable_va" = xyes; then
  1645. if test x"$enable_dri3" = xyes; then
  1646. PKG_CHECK_MODULES([VL], [xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED
  1647. x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
  1648. else
  1649. PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
  1650. fi
  1651. need_gallium_vl_winsys=yes
  1652. fi
  1653. AM_CONDITIONAL(NEED_GALLIUM_VL_WINSYS, test "x$need_gallium_vl_winsys" = xyes)
  1654. if test "x$enable_xvmc" = xyes; then
  1655. PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED])
  1656. gallium_st="$gallium_st xvmc"
  1657. fi
  1658. AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
  1659. if test "x$enable_vdpau" = xyes; then
  1660. PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED])
  1661. gallium_st="$gallium_st vdpau"
  1662. DEFINES="$DEFINES -DHAVE_ST_VDPAU"
  1663. fi
  1664. AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
  1665. if test "x$enable_omx" = xyes; then
  1666. PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED])
  1667. gallium_st="$gallium_st omx"
  1668. fi
  1669. AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
  1670. if test "x$enable_va" = xyes; then
  1671. PKG_CHECK_MODULES([VA], [libva >= $LIBVA_REQUIRED])
  1672. gallium_st="$gallium_st va"
  1673. fi
  1674. AM_CONDITIONAL(HAVE_ST_VA, test "x$enable_va" = xyes)
  1675. dnl
  1676. dnl Nine Direct3D9 configuration
  1677. dnl
  1678. if test "x$enable_nine" = xyes; then
  1679. if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
  1680. AC_MSG_ERROR([nine requires the gallium swrast driver])
  1681. fi
  1682. if test "x$with_gallium_drivers" = xswrast; then
  1683. AC_MSG_ERROR([nine requires at least one non-swrast gallium driver])
  1684. fi
  1685. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
  1686. AC_MSG_ERROR([gcc >= 4.6 is required to build nine])
  1687. fi
  1688. if test "x$enable_dri3" = xno; then
  1689. AC_MSG_WARN([using nine together with wine requires DRI3 enabled system])
  1690. fi
  1691. gallium_st="$gallium_st nine"
  1692. fi
  1693. AM_CONDITIONAL(HAVE_ST_NINE, test "x$enable_nine" = xyes)
  1694. dnl
  1695. dnl OpenCL configuration
  1696. dnl
  1697. AC_ARG_WITH([clang-libdir],
  1698. [AS_HELP_STRING([--with-clang-libdir],
  1699. [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
  1700. [CLANG_LIBDIR="$withval"],
  1701. [CLANG_LIBDIR=''])
  1702. PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
  1703. PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [have_libelf=no])
  1704. if test "x$have_libelf" = xno; then
  1705. LIBELF_LIBS=''
  1706. LIBELF_CFLAGS=''
  1707. AC_CHECK_LIB([elf], [elf_memory], [have_libelf=yes;LIBELF_LIBS=-lelf], [have_libelf=no])
  1708. AC_SUBST([LIBELF_LIBS])
  1709. AC_SUBST([LIBELF_CFLAGS])
  1710. fi
  1711. if test "x$enable_opencl" = xyes; then
  1712. if test -z "$with_gallium_drivers"; then
  1713. AC_MSG_ERROR([cannot enable OpenCL without Gallium])
  1714. fi
  1715. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
  1716. AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
  1717. fi
  1718. if test "x$have_libclc" = xno; then
  1719. AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
  1720. Make sure the directory containing libclc.pc is specified in your
  1721. PKG_CONFIG_PATH environment variable.
  1722. By default libclc.pc is installed to /usr/local/share/pkgconfig/])
  1723. else
  1724. LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
  1725. LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
  1726. AC_SUBST([LIBCLC_INCLUDEDIR])
  1727. AC_SUBST([LIBCLC_LIBEXECDIR])
  1728. fi
  1729. gallium_st="$gallium_st clover"
  1730. if test "x$enable_opencl_icd" = xyes; then
  1731. OPENCL_LIBNAME="MesaOpenCL"
  1732. else
  1733. OPENCL_LIBNAME="OpenCL"
  1734. fi
  1735. if test "x$have_libelf" != xyes; then
  1736. AC_MSG_ERROR([Clover requires libelf])
  1737. fi
  1738. fi
  1739. AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
  1740. AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
  1741. AC_SUBST([OPENCL_LIBNAME])
  1742. dnl
  1743. dnl Gallium configuration
  1744. dnl
  1745. AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
  1746. AC_SUBST([LLVM_BINDIR])
  1747. AC_SUBST([LLVM_CFLAGS])
  1748. AC_SUBST([LLVM_CPPFLAGS])
  1749. AC_SUBST([LLVM_CXXFLAGS])
  1750. AC_SUBST([LLVM_LIBDIR])
  1751. AC_SUBST([LLVM_LIBS])
  1752. AC_SUBST([LLVM_LDFLAGS])
  1753. AC_SUBST([LLVM_INCLUDEDIR])
  1754. AC_SUBST([LLVM_VERSION])
  1755. AC_SUBST([CLANG_RESOURCE_DIR])
  1756. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1757. x*yes*)
  1758. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
  1759. ;;
  1760. esac
  1761. AC_SUBST([VG_LIB_DEPS])
  1762. AC_SUBST([EGL_CLIENT_APIS])
  1763. dnl
  1764. dnl EGL Platforms configuration
  1765. dnl
  1766. AC_ARG_WITH([egl-platforms],
  1767. [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
  1768. [comma delimited native platforms libEGL supports, e.g.
  1769. "x11,drm" @<:@default=auto@:>@])],
  1770. [with_egl_platforms="$withval"],
  1771. [if test "x$enable_egl" = xyes; then
  1772. with_egl_platforms="x11"
  1773. else
  1774. with_egl_platforms=""
  1775. fi])
  1776. if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
  1777. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1778. fi
  1779. PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland_scanner],
  1780. WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland_scanner`,
  1781. WAYLAND_SCANNER='')
  1782. if test "x$WAYLAND_SCANNER" = x; then
  1783. AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
  1784. fi
  1785. # Do per-EGL platform setups and checks
  1786. egl_platforms=`IFS=', '; echo $with_egl_platforms`
  1787. for plat in $egl_platforms; do
  1788. case "$plat" in
  1789. wayland)
  1790. test "x$have_libdrm" != xyes &&
  1791. AC_MSG_ERROR([EGL platform wayland requires libdrm >= $LIBDRM_REQUIRED])
  1792. PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED])
  1793. if test "x$WAYLAND_SCANNER" = x; then
  1794. AC_MSG_ERROR([wayland-scanner is needed to compile the wayland egl platform])
  1795. fi
  1796. ;;
  1797. x11)
  1798. PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes])
  1799. ;;
  1800. drm)
  1801. test "x$enable_gbm" = "xno" &&
  1802. AC_MSG_ERROR([EGL platform drm needs gbm])
  1803. test "x$have_libdrm" != xyes &&
  1804. AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
  1805. ;;
  1806. surfaceless)
  1807. test "x$have_libdrm" != xyes &&
  1808. AC_MSG_ERROR([EGL platform surfaceless requires libdrm >= $LIBDRM_REQUIRED])
  1809. ;;
  1810. android)
  1811. ;;
  1812. *)
  1813. AC_MSG_ERROR([EGL platform '$plat' does not exist])
  1814. ;;
  1815. esac
  1816. case "$plat$need_pci_id$have_pci_id" in
  1817. waylandyesno|drmyesno)
  1818. AC_MSG_ERROR([cannot build $plat platform without udev >= $LIBUDEV_REQUIRED or sysfs]) ;;
  1819. esac
  1820. done
  1821. # libEGL wants to default to the first platform specified in
  1822. # ./configure. parse that here.
  1823. if test "x$egl_platforms" != "x"; then
  1824. FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr '[[a-z]]' '[[A-Z]]'`
  1825. EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
  1826. else
  1827. EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
  1828. fi
  1829. AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11')
  1830. AM_CONDITIONAL(HAVE_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland')
  1831. AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
  1832. AM_CONDITIONAL(HAVE_EGL_PLATFORM_SURFACELESS, echo "$egl_platforms" | grep -q 'surfaceless')
  1833. AM_CONDITIONAL(HAVE_EGL_PLATFORM_ANDROID, echo "$egl_platforms" | grep -q 'android')
  1834. AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
  1835. AC_SUBST([EGL_NATIVE_PLATFORM])
  1836. AC_SUBST([EGL_CFLAGS])
  1837. # If we don't have the X11 platform, set this define so we don't try to include
  1838. # the X11 headers.
  1839. if ! echo "$egl_platforms" | grep -q 'x11'; then
  1840. DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
  1841. GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
  1842. fi
  1843. dnl
  1844. dnl Gallium LLVM
  1845. dnl
  1846. AC_ARG_ENABLE([gallium-llvm],
  1847. [AS_HELP_STRING([--enable-gallium-llvm],
  1848. [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
  1849. [enable_gallium_llvm="$enableval"],
  1850. [enable_gallium_llvm=auto])
  1851. AC_ARG_ENABLE([llvm-shared-libs],
  1852. [AS_HELP_STRING([--enable-llvm-shared-libs],
  1853. [link with LLVM shared libraries @<:@default=enabled@:>@])],
  1854. [enable_llvm_shared_libs="$enableval"],
  1855. [enable_llvm_shared_libs=yes])
  1856. AC_ARG_WITH([llvm-prefix],
  1857. [AS_HELP_STRING([--with-llvm-prefix],
  1858. [Prefix for LLVM installations in non-standard locations])],
  1859. [llvm_prefix="$withval"],
  1860. [llvm_prefix=''])
  1861. # Call this inside ` ` to get the return value.
  1862. # $1 is the llvm-config command with arguments.
  1863. strip_unwanted_llvm_flags() {
  1864. # Use \> (marks the end of the word)
  1865. echo `$1` | sed \
  1866. -e 's/-DNDEBUG\>//g' \
  1867. -e 's/-D_GNU_SOURCE\>//g' \
  1868. -e 's/-pedantic\>//g' \
  1869. -e 's/-Wcovered-switch-default\>//g' \
  1870. -e 's/-O.\>//g' \
  1871. -e 's/-g\>//g' \
  1872. -e 's/-Wall\>//g' \
  1873. -e 's/-Wcast-qual\>//g' \
  1874. -e 's/-Woverloaded-virtual\>//g' \
  1875. -e 's/-fcolor-diagnostics\>//g' \
  1876. -e 's/-fdata-sections\>//g' \
  1877. -e 's/-ffunction-sections\>//g' \
  1878. -e 's/-fno-exceptions\>//g' \
  1879. -e 's/-fomit-frame-pointer\>//g' \
  1880. -e 's/-fvisibility-inlines-hidden\>//g' \
  1881. -e 's/-fPIC\>//g' \
  1882. -e 's/-fstack-protector-strong\>//g'
  1883. }
  1884. llvm_check_version_for() {
  1885. if test "${LLVM_VERSION_INT}${LLVM_VERSION_PATCH}" -lt "${1}0${2}${3}"; then
  1886. AC_MSG_ERROR([LLVM $1.$2.$3 or newer is required for $4])
  1887. fi
  1888. }
  1889. if test -z "$with_gallium_drivers"; then
  1890. enable_gallium_llvm=no
  1891. fi
  1892. if test "x$enable_gallium_llvm" = xauto; then
  1893. case "$host_cpu" in
  1894. i*86|x86_64|amd64) enable_gallium_llvm=yes;;
  1895. esac
  1896. fi
  1897. if test "x$enable_gallium_llvm" = xyes; then
  1898. if test -n "$llvm_prefix"; then
  1899. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
  1900. else
  1901. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
  1902. fi
  1903. if test "x$LLVM_CONFIG" != xno; then
  1904. LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'`
  1905. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  1906. LLVM_BINDIR=`$LLVM_CONFIG --bindir`
  1907. LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
  1908. LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
  1909. LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
  1910. LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
  1911. LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
  1912. AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
  1913. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1914. AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
  1915. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1916. LLVM_VERSION_PATCH=`echo $LLVM_VERSION | cut -d. -f3 | egrep -o '^[[0-9]]+'`
  1917. if test -z "$LLVM_VERSION_PATCH"; then
  1918. LLVM_VERSION_PATCH=0
  1919. fi
  1920. if test -n "${LLVM_VERSION_MAJOR}"; then
  1921. LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
  1922. else
  1923. LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
  1924. fi
  1925. LLVM_REQUIRED_VERSION_MAJOR="3"
  1926. LLVM_REQUIRED_VERSION_MINOR="3"
  1927. if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
  1928. AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required])
  1929. fi
  1930. LLVM_COMPONENTS="engine bitwriter mcjit mcdisassembler"
  1931. if test "x$enable_opencl" = xyes; then
  1932. llvm_check_version_for "3" "5" "0" "opencl"
  1933. LLVM_COMPONENTS="${LLVM_COMPONENTS} all-targets ipo linker instrumentation"
  1934. LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader option objcarcopts profiledata"
  1935. fi
  1936. DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
  1937. MESA_LLVM=1
  1938. dnl Check for Clang internal headers
  1939. if test "x$enable_opencl" = xyes; then
  1940. if test -z "$CLANG_LIBDIR"; then
  1941. CLANG_LIBDIR=${LLVM_LIBDIR}
  1942. fi
  1943. CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
  1944. AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
  1945. [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.])])
  1946. fi
  1947. else
  1948. MESA_LLVM=0
  1949. LLVM_VERSION_INT=0
  1950. fi
  1951. else
  1952. MESA_LLVM=0
  1953. LLVM_VERSION_INT=0
  1954. if test "x$enable_opencl" = xyes; then
  1955. AC_MSG_ERROR([cannot enable OpenCL without LLVM])
  1956. fi
  1957. fi
  1958. dnl Directory for XVMC libs
  1959. AC_ARG_WITH([xvmc-libdir],
  1960. [AS_HELP_STRING([--with-xvmc-libdir=DIR],
  1961. [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
  1962. [XVMC_LIB_INSTALL_DIR="$withval"],
  1963. [XVMC_LIB_INSTALL_DIR='${libdir}'])
  1964. AC_SUBST([XVMC_LIB_INSTALL_DIR])
  1965. dnl
  1966. dnl Gallium Tests
  1967. dnl
  1968. AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
  1969. dnl Directory for VDPAU libs
  1970. AC_ARG_WITH([vdpau-libdir],
  1971. [AS_HELP_STRING([--with-vdpau-libdir=DIR],
  1972. [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
  1973. [VDPAU_LIB_INSTALL_DIR="$withval"],
  1974. [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
  1975. AC_SUBST([VDPAU_LIB_INSTALL_DIR])
  1976. dnl Directory for OMX libs
  1977. AC_ARG_WITH([omx-libdir],
  1978. [AS_HELP_STRING([--with-omx-libdir=DIR],
  1979. [directory for the OMX libraries])],
  1980. [OMX_LIB_INSTALL_DIR="$withval"],
  1981. [OMX_LIB_INSTALL_DIR=`$PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libomxil-bellagio`])
  1982. AC_SUBST([OMX_LIB_INSTALL_DIR])
  1983. dnl Directory for VA libs
  1984. AC_ARG_WITH([va-libdir],
  1985. [AS_HELP_STRING([--with-va-libdir=DIR],
  1986. [directory for the VA libraries @<:@${libdir}/dri@:>@])],
  1987. [VA_LIB_INSTALL_DIR="$withval"],
  1988. [VA_LIB_INSTALL_DIR="${libdir}/dri"])
  1989. AC_SUBST([VA_LIB_INSTALL_DIR])
  1990. AC_ARG_WITH([d3d-libdir],
  1991. [AS_HELP_STRING([--with-d3d-libdir=DIR],
  1992. [directory for the D3D modules @<:@${libdir}/d3d@:>@])],
  1993. [D3D_DRIVER_INSTALL_DIR="$withval"],
  1994. [D3D_DRIVER_INSTALL_DIR="${libdir}/d3d"])
  1995. AC_SUBST([D3D_DRIVER_INSTALL_DIR])
  1996. dnl
  1997. dnl Gallium helper functions
  1998. dnl
  1999. gallium_require_drm() {
  2000. if test "x$have_libdrm" != xyes; then
  2001. AC_MSG_ERROR([$1 requires libdrm >= $LIBDRM_REQUIRED])
  2002. fi
  2003. }
  2004. gallium_require_llvm() {
  2005. if test "x$MESA_LLVM" = x0; then
  2006. case "$host" in *gnux32) return;; esac
  2007. case "$host_cpu" in
  2008. i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
  2009. esac
  2010. fi
  2011. }
  2012. gallium_require_drm_loader() {
  2013. if test "x$need_pci_id$have_pci_id" = xyesno; then
  2014. AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED or sysfs])
  2015. fi
  2016. }
  2017. dnl This is for Glamor. Skip this if OpenGL is disabled.
  2018. require_egl_drm() {
  2019. if test "x$enable_opengl" = xno; then
  2020. return 0
  2021. fi
  2022. case "$with_egl_platforms" in
  2023. *drm*)
  2024. ;;
  2025. *)
  2026. AC_MSG_ERROR([--with-egl-platforms=drm is required to build the $1 driver.])
  2027. ;;
  2028. esac
  2029. if test "x$enable_gbm" != xyes; then
  2030. AC_MSG_ERROR([--enable-gbm is required to build the $1 driver.])
  2031. fi
  2032. }
  2033. radeon_llvm_check() {
  2034. if test ${LLVM_VERSION_INT} -lt 307; then
  2035. amdgpu_llvm_target_name='r600'
  2036. else
  2037. amdgpu_llvm_target_name='amdgpu'
  2038. fi
  2039. if test "x$enable_gallium_llvm" != "xyes"; then
  2040. AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
  2041. fi
  2042. llvm_check_version_for "3" "6" "0" $1
  2043. if test true && $LLVM_CONFIG --targets-built | grep -iqvw $amdgpu_llvm_target_name ; then
  2044. AC_MSG_ERROR([LLVM $amdgpu_llvm_target_name not enabled in your LLVM build.])
  2045. fi
  2046. LLVM_COMPONENTS="${LLVM_COMPONENTS} $amdgpu_llvm_target_name bitreader ipo"
  2047. NEED_RADEON_LLVM=yes
  2048. if test "x$have_libelf" != xyes; then
  2049. AC_MSG_ERROR([$1 requires libelf when using llvm])
  2050. fi
  2051. }
  2052. swr_llvm_check() {
  2053. gallium_require_llvm $1
  2054. if test ${LLVM_VERSION_INT} -lt 306; then
  2055. AC_MSG_ERROR([LLVM version 3.6 or later required when building $1])
  2056. fi
  2057. if test "x$enable_gallium_llvm" != "xyes"; then
  2058. AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
  2059. fi
  2060. }
  2061. dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
  2062. if test -n "$with_gallium_drivers"; then
  2063. gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
  2064. for driver in $gallium_drivers; do
  2065. case "x$driver" in
  2066. xsvga)
  2067. HAVE_GALLIUM_SVGA=yes
  2068. gallium_require_drm "svga"
  2069. gallium_require_drm_loader
  2070. ;;
  2071. xi915)
  2072. HAVE_GALLIUM_I915=yes
  2073. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  2074. gallium_require_drm "Gallium i915"
  2075. gallium_require_drm_loader
  2076. ;;
  2077. xilo)
  2078. HAVE_GALLIUM_ILO=yes
  2079. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  2080. gallium_require_drm "Gallium i965/ilo"
  2081. gallium_require_drm_loader
  2082. ;;
  2083. xr300)
  2084. HAVE_GALLIUM_R300=yes
  2085. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  2086. gallium_require_drm "Gallium R300"
  2087. gallium_require_drm_loader
  2088. gallium_require_llvm "Gallium R300"
  2089. ;;
  2090. xr600)
  2091. HAVE_GALLIUM_R600=yes
  2092. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  2093. gallium_require_drm "Gallium R600"
  2094. gallium_require_drm_loader
  2095. if test "x$enable_opencl" = xyes; then
  2096. radeon_llvm_check "r600g"
  2097. LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
  2098. fi
  2099. ;;
  2100. xradeonsi)
  2101. HAVE_GALLIUM_RADEONSI=yes
  2102. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  2103. PKG_CHECK_MODULES([AMDGPU], [libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
  2104. gallium_require_drm "radeonsi"
  2105. gallium_require_drm_loader
  2106. radeon_llvm_check "radeonsi"
  2107. require_egl_drm "radeonsi"
  2108. ;;
  2109. xnouveau)
  2110. HAVE_GALLIUM_NOUVEAU=yes
  2111. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  2112. gallium_require_drm "nouveau"
  2113. gallium_require_drm_loader
  2114. ;;
  2115. xfreedreno)
  2116. HAVE_GALLIUM_FREEDRENO=yes
  2117. PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
  2118. gallium_require_drm "freedreno"
  2119. gallium_require_drm_loader
  2120. ;;
  2121. xswrast)
  2122. HAVE_GALLIUM_SOFTPIPE=yes
  2123. if test "x$MESA_LLVM" = x1; then
  2124. HAVE_GALLIUM_LLVMPIPE=yes
  2125. fi
  2126. ;;
  2127. xswr)
  2128. swr_llvm_check "swr"
  2129. AC_MSG_CHECKING([whether $CXX supports c++11/AVX/AVX2])
  2130. AVX_CXXFLAGS="-march=core-avx-i"
  2131. AVX2_CXXFLAGS="-march=core-avx2"
  2132. AC_LANG_PUSH([C++])
  2133. save_CXXFLAGS="$CXXFLAGS"
  2134. CXXFLAGS="-std=c++11 $CXXFLAGS"
  2135. AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],[],
  2136. [AC_MSG_ERROR([c++11 compiler support not detected])])
  2137. CXXFLAGS="$save_CXXFLAGS"
  2138. save_CXXFLAGS="$CXXFLAGS"
  2139. CXXFLAGS="$AVX_CXXFLAGS $CXXFLAGS"
  2140. AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],[],
  2141. [AC_MSG_ERROR([AVX compiler support not detected])])
  2142. CXXFLAGS="$save_CXXFLAGS"
  2143. save_CFLAGS="$CXXFLAGS"
  2144. CXXFLAGS="$AVX2_CXXFLAGS $CXXFLAGS"
  2145. AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],[],
  2146. [AC_MSG_ERROR([AVX2 compiler support not detected])])
  2147. CXXFLAGS="$save_CXXFLAGS"
  2148. AC_LANG_POP([C++])
  2149. HAVE_GALLIUM_SWR=yes
  2150. ;;
  2151. xvc4)
  2152. HAVE_GALLIUM_VC4=yes
  2153. gallium_require_drm "vc4"
  2154. gallium_require_drm_loader
  2155. PKG_CHECK_MODULES([SIMPENROSE], [simpenrose],
  2156. [USE_VC4_SIMULATOR=yes;
  2157. DEFINES="$DEFINES -DUSE_VC4_SIMULATOR"],
  2158. [USE_VC4_SIMULATOR=no])
  2159. ;;
  2160. xvirgl)
  2161. HAVE_GALLIUM_VIRGL=yes
  2162. gallium_require_drm "virgl"
  2163. gallium_require_drm_loader
  2164. require_egl_drm "virgl"
  2165. ;;
  2166. *)
  2167. AC_MSG_ERROR([Unknown Gallium driver: $driver])
  2168. ;;
  2169. esac
  2170. done
  2171. fi
  2172. dnl Set LLVM_LIBS - This is done after the driver configuration so
  2173. dnl that drivers can add additional components to LLVM_COMPONENTS.
  2174. dnl Previously, gallium drivers were updating LLVM_LIBS directly
  2175. dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
  2176. dnl this was causing the same libraries to be appear multiple times
  2177. dnl in LLVM_LIBS.
  2178. if test "x$MESA_LLVM" != x0; then
  2179. if ! $LLVM_CONFIG --libs ${LLVM_COMPONENTS} >/dev/null; then
  2180. AC_MSG_ERROR([Calling ${LLVM_CONFIG} failed])
  2181. fi
  2182. LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
  2183. dnl llvm-config may not give the right answer when llvm is a built as a
  2184. dnl single shared library, so we must work the library name out for
  2185. dnl ourselves.
  2186. dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
  2187. if test "x$enable_llvm_shared_libs" = xyes; then
  2188. dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
  2189. LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
  2190. AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
  2191. if test "x$llvm_have_one_so" = xyes; then
  2192. dnl LLVM was built using auto*, so there is only one shared object.
  2193. LLVM_LIBS="-l$LLVM_SO_NAME"
  2194. else
  2195. dnl If LLVM was built with CMake, there will be one shared object per
  2196. dnl component.
  2197. AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
  2198. [AC_MSG_ERROR([Could not find llvm shared libraries:
  2199. Please make sure you have built llvm with the --enable-shared option
  2200. and that your llvm libraries are installed in $LLVM_LIBDIR
  2201. If you have installed your llvm libraries to a different directory you
  2202. can use the --with-llvm-prefix= configure flag to specify this directory.
  2203. NOTE: Mesa is attempting to use llvm shared libraries by default.
  2204. If you do not want to build with llvm shared libraries and instead want to
  2205. use llvm static libraries then add --disable-llvm-shared-libs to your configure
  2206. invocation and rebuild.])])
  2207. dnl We don't need to update LLVM_LIBS in this case because the LLVM
  2208. dnl install uses a shared object for each component and we have
  2209. dnl already added all of these objects to LLVM_LIBS.
  2210. fi
  2211. else
  2212. AC_MSG_WARN([Building mesa with statically linked LLVM may cause compilation issues])
  2213. dnl We need to link to llvm system libs when using static libs
  2214. dnl However, only llvm 3.5+ provides --system-libs
  2215. if test $LLVM_VERSION_MAJOR -eq 3 -a $LLVM_VERSION_MINOR -ge 5; then
  2216. LLVM_LIBS="$LLVM_LIBS `$LLVM_CONFIG --system-libs`"
  2217. fi
  2218. fi
  2219. fi
  2220. AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
  2221. AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
  2222. AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
  2223. AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
  2224. AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
  2225. AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
  2226. AM_CONDITIONAL(HAVE_GALLIUM_RADEON_COMMON, test "x$HAVE_GALLIUM_R600" = xyes -o \
  2227. "x$HAVE_GALLIUM_RADEONSI" = xyes)
  2228. AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
  2229. AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
  2230. AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  2231. AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
  2232. AM_CONDITIONAL(HAVE_GALLIUM_SWR, test "x$HAVE_GALLIUM_SWR" = xyes)
  2233. AM_CONDITIONAL(HAVE_GALLIUM_SWRAST, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes -o \
  2234. "x$HAVE_GALLIUM_LLVMPIPE" = xyes -o \
  2235. "x$HAVE_GALLIUM_SWR" = xyes)
  2236. AM_CONDITIONAL(HAVE_GALLIUM_VC4, test "x$HAVE_GALLIUM_VC4" = xyes)
  2237. AM_CONDITIONAL(HAVE_GALLIUM_VIRGL, test "x$HAVE_GALLIUM_VIRGL" = xyes)
  2238. AM_CONDITIONAL(HAVE_GALLIUM_STATIC_TARGETS, test "x$enable_shared_pipe_drivers" = xno)
  2239. if test "x$enable_dri" = xyes; then
  2240. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI"
  2241. fi
  2242. if test "x$have_drisw_kms" = xyes; then
  2243. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_KMS"
  2244. fi
  2245. AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
  2246. AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
  2247. AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
  2248. AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
  2249. AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
  2250. AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
  2251. AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
  2252. AM_CONDITIONAL(HAVE_INTEL_VULKAN, test "x$HAVE_INTEL_VULKAN" = xyes)
  2253. AM_CONDITIONAL(HAVE_INTEL_DRIVERS, test "x$HAVE_INTEL_VULKAN" = xyes -o \
  2254. "x$HAVE_I965_DRI" = xyes)
  2255. AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$HAVE_GALLIUM_R300" = xyes -o \
  2256. "x$HAVE_GALLIUM_R600" = xyes -o \
  2257. "x$HAVE_GALLIUM_RADEONSI" = xyes)
  2258. AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$enable_glx" = xgallium-xlib)
  2259. AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
  2260. AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
  2261. AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
  2262. AM_CONDITIONAL(USE_VC4_SIMULATOR, test x$USE_VC4_SIMULATOR = xyes)
  2263. if test "x$USE_VC4_SIMULATOR" = xyes -a "x$HAVE_GALLIUM_ILO" = xyes; then
  2264. AC_MSG_ERROR([VC4 simulator on x86 replaces i965 driver build, so ilo must be disabled.])
  2265. fi
  2266. AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes)
  2267. AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
  2268. AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
  2269. AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64)
  2270. AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64)
  2271. AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc)
  2272. AC_SUBST([NINE_MAJOR], 1)
  2273. AC_SUBST([NINE_MINOR], 0)
  2274. AC_SUBST([NINE_TINY], 0)
  2275. AC_SUBST([NINE_VERSION], "$NINE_MAJOR.$NINE_MINOR.$NINE_TINY")
  2276. AC_SUBST([VDPAU_MAJOR], 1)
  2277. AC_SUBST([VDPAU_MINOR], 0)
  2278. VA_MAJOR=`$PKG_CONFIG --modversion libva | $SED -n 's/\([[^\.]]*\)\..*$/\1/p'`
  2279. VA_MINOR=`$PKG_CONFIG --modversion libva | $SED -n 's/.*\.\(.*\)\..*$/\1/p'`
  2280. AC_SUBST([VA_MAJOR], $VA_MAJOR)
  2281. AC_SUBST([VA_MINOR], $VA_MINOR)
  2282. AC_SUBST([XVMC_MAJOR], 1)
  2283. AC_SUBST([XVMC_MINOR], 0)
  2284. XA_HEADER="$srcdir/src/gallium/state_trackers/xa/xa_tracker.h"
  2285. XA_MAJOR=`grep "#define XA_TRACKER_VERSION_MAJOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MAJOR //'`
  2286. XA_MINOR=`grep "#define XA_TRACKER_VERSION_MINOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MINOR //'`
  2287. XA_TINY=`grep "#define XA_TRACKER_VERSION_PATCH" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_PATCH //'`
  2288. AC_SUBST([XA_MAJOR], $XA_MAJOR)
  2289. AC_SUBST([XA_MINOR], $XA_MINOR)
  2290. AC_SUBST([XA_TINY], $XA_TINY)
  2291. AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
  2292. AC_ARG_ENABLE(valgrind,
  2293. [AS_HELP_STRING([--enable-valgrind],
  2294. [Build mesa with valgrind support (default: auto)])],
  2295. [VALGRIND=$enableval], [VALGRIND=auto])
  2296. if test "x$VALGRIND" != xno; then
  2297. PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
  2298. fi
  2299. AC_MSG_CHECKING([whether to enable Valgrind support])
  2300. if test "x$VALGRIND" = xauto; then
  2301. VALGRIND="$have_valgrind"
  2302. fi
  2303. if test "x$VALGRIND" = "xyes"; then
  2304. if ! test "x$have_valgrind" = xyes; then
  2305. AC_MSG_ERROR([Valgrind support required but not present])
  2306. fi
  2307. AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
  2308. fi
  2309. AC_MSG_RESULT([$VALGRIND])
  2310. dnl Restore LDFLAGS and CPPFLAGS
  2311. LDFLAGS="$_SAVE_LDFLAGS"
  2312. CPPFLAGS="$_SAVE_CPPFLAGS"
  2313. dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
  2314. if test "x$acv_mesa_CLANG" = xyes; then
  2315. CFLAGS="$CFLAGS -Qunused-arguments"
  2316. CXXFLAGS="$CXXFLAGS -Qunused-arguments"
  2317. fi
  2318. dnl Add user CFLAGS and CXXFLAGS
  2319. CFLAGS="$CFLAGS $USER_CFLAGS"
  2320. CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
  2321. dnl Substitute the config
  2322. AC_CONFIG_FILES([Makefile
  2323. src/Makefile
  2324. src/compiler/Makefile
  2325. src/egl/Makefile
  2326. src/egl/main/egl.pc
  2327. src/egl/wayland/wayland-drm/Makefile
  2328. src/egl/wayland/wayland-egl/Makefile
  2329. src/egl/wayland/wayland-egl/wayland-egl.pc
  2330. src/gallium/Makefile
  2331. src/gallium/auxiliary/Makefile
  2332. src/gallium/auxiliary/pipe-loader/Makefile
  2333. src/gallium/drivers/freedreno/Makefile
  2334. src/gallium/drivers/ddebug/Makefile
  2335. src/gallium/drivers/i915/Makefile
  2336. src/gallium/drivers/ilo/Makefile
  2337. src/gallium/drivers/llvmpipe/Makefile
  2338. src/gallium/drivers/noop/Makefile
  2339. src/gallium/drivers/nouveau/Makefile
  2340. src/gallium/drivers/r300/Makefile
  2341. src/gallium/drivers/r600/Makefile
  2342. src/gallium/drivers/radeon/Makefile
  2343. src/gallium/drivers/radeonsi/Makefile
  2344. src/gallium/drivers/rbug/Makefile
  2345. src/gallium/drivers/softpipe/Makefile
  2346. src/gallium/drivers/svga/Makefile
  2347. src/gallium/drivers/swr/Makefile
  2348. src/gallium/drivers/trace/Makefile
  2349. src/gallium/drivers/vc4/Makefile
  2350. src/gallium/drivers/virgl/Makefile
  2351. src/gallium/state_trackers/clover/Makefile
  2352. src/gallium/state_trackers/dri/Makefile
  2353. src/gallium/state_trackers/glx/xlib/Makefile
  2354. src/gallium/state_trackers/nine/Makefile
  2355. src/gallium/state_trackers/omx/Makefile
  2356. src/gallium/state_trackers/osmesa/Makefile
  2357. src/gallium/state_trackers/va/Makefile
  2358. src/gallium/state_trackers/vdpau/Makefile
  2359. src/gallium/state_trackers/xa/Makefile
  2360. src/gallium/state_trackers/xvmc/Makefile
  2361. src/gallium/targets/d3dadapter9/Makefile
  2362. src/gallium/targets/d3dadapter9/d3d.pc
  2363. src/gallium/targets/dri/Makefile
  2364. src/gallium/targets/libgl-xlib/Makefile
  2365. src/gallium/targets/omx/Makefile
  2366. src/gallium/targets/opencl/Makefile
  2367. src/gallium/targets/opencl/mesa.icd
  2368. src/gallium/targets/osmesa/Makefile
  2369. src/gallium/targets/osmesa/osmesa.pc
  2370. src/gallium/targets/pipe-loader/Makefile
  2371. src/gallium/targets/va/Makefile
  2372. src/gallium/targets/vdpau/Makefile
  2373. src/gallium/targets/xa/Makefile
  2374. src/gallium/targets/xa/xatracker.pc
  2375. src/gallium/targets/xvmc/Makefile
  2376. src/gallium/tests/trivial/Makefile
  2377. src/gallium/tests/unit/Makefile
  2378. src/gallium/winsys/freedreno/drm/Makefile
  2379. src/gallium/winsys/i915/drm/Makefile
  2380. src/gallium/winsys/intel/drm/Makefile
  2381. src/gallium/winsys/nouveau/drm/Makefile
  2382. src/gallium/winsys/radeon/drm/Makefile
  2383. src/gallium/winsys/amdgpu/drm/Makefile
  2384. src/gallium/winsys/svga/drm/Makefile
  2385. src/gallium/winsys/sw/dri/Makefile
  2386. src/gallium/winsys/sw/kms-dri/Makefile
  2387. src/gallium/winsys/sw/null/Makefile
  2388. src/gallium/winsys/sw/wrapper/Makefile
  2389. src/gallium/winsys/sw/xlib/Makefile
  2390. src/gallium/winsys/vc4/drm/Makefile
  2391. src/gallium/winsys/virgl/drm/Makefile
  2392. src/gallium/winsys/virgl/vtest/Makefile
  2393. src/gbm/Makefile
  2394. src/gbm/main/gbm.pc
  2395. src/glx/Makefile
  2396. src/glx/apple/Makefile
  2397. src/glx/tests/Makefile
  2398. src/gtest/Makefile
  2399. src/intel/Makefile
  2400. src/intel/genxml/Makefile
  2401. src/intel/isl/Makefile
  2402. src/intel/vulkan/Makefile
  2403. src/loader/Makefile
  2404. src/mapi/Makefile
  2405. src/mapi/es1api/glesv1_cm.pc
  2406. src/mapi/es2api/glesv2.pc
  2407. src/mapi/glapi/gen/Makefile
  2408. src/mesa/Makefile
  2409. src/mesa/gl.pc
  2410. src/mesa/drivers/dri/dri.pc
  2411. src/mesa/drivers/dri/common/Makefile
  2412. src/mesa/drivers/dri/common/xmlpool/Makefile
  2413. src/mesa/drivers/dri/i915/Makefile
  2414. src/mesa/drivers/dri/i965/Makefile
  2415. src/mesa/drivers/dri/Makefile
  2416. src/mesa/drivers/dri/nouveau/Makefile
  2417. src/mesa/drivers/dri/r200/Makefile
  2418. src/mesa/drivers/dri/radeon/Makefile
  2419. src/mesa/drivers/dri/swrast/Makefile
  2420. src/mesa/drivers/osmesa/Makefile
  2421. src/mesa/drivers/osmesa/osmesa.pc
  2422. src/mesa/drivers/x11/Makefile
  2423. src/mesa/main/tests/Makefile
  2424. src/util/Makefile
  2425. src/util/tests/hash_table/Makefile])
  2426. AC_OUTPUT
  2427. # Fix up dependencies in *.Plo files, where we changed the extension of a
  2428. # source file
  2429. $SED -i -e 's/brw_blorp.cpp/brw_blorp.c/' src/mesa/drivers/dri/i965/.deps/brw_blorp.Plo
  2430. $SED -i -e 's/gen6_blorp.cpp/gen6_blorp.c/' src/mesa/drivers/dri/i965/.deps/gen6_blorp.Plo
  2431. $SED -i -e 's/gen7_blorp.cpp/gen7_blorp.c/' src/mesa/drivers/dri/i965/.deps/gen7_blorp.Plo
  2432. $SED -i -e 's/gen8_blorp.cpp/gen8_blorp.c/' src/mesa/drivers/dri/i965/.deps/gen8_blorp.Plo
  2433. dnl
  2434. dnl Output some configuration info for the user
  2435. dnl
  2436. echo ""
  2437. echo " prefix: $prefix"
  2438. echo " exec_prefix: $exec_prefix"
  2439. echo " libdir: $libdir"
  2440. echo " includedir: $includedir"
  2441. dnl API info
  2442. echo ""
  2443. echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
  2444. dnl Driver info
  2445. echo ""
  2446. case "x$enable_osmesa$enable_gallium_osmesa" in
  2447. xnoyes)
  2448. echo " OSMesa: lib$OSMESA_LIB (Gallium)"
  2449. ;;
  2450. xyesno)
  2451. echo " OSMesa: lib$OSMESA_LIB"
  2452. ;;
  2453. xnono)
  2454. echo " OSMesa: no"
  2455. ;;
  2456. esac
  2457. echo ""
  2458. if test "x$enable_dri" != xno; then
  2459. echo " DRI platform: $dri_platform"
  2460. if test -z "$DRI_DIRS"; then
  2461. echo " DRI drivers: no"
  2462. else
  2463. echo " DRI drivers: $DRI_DIRS"
  2464. fi
  2465. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  2466. fi
  2467. case "x$enable_glx" in
  2468. xdri)
  2469. echo " GLX: DRI-based"
  2470. ;;
  2471. xxlib)
  2472. echo " GLX: Xlib-based"
  2473. ;;
  2474. xgallium-xlib)
  2475. echo " GLX: Xlib-based (Gallium)"
  2476. ;;
  2477. *)
  2478. echo " GLX: $enable_glx"
  2479. ;;
  2480. esac
  2481. dnl EGL
  2482. echo ""
  2483. echo " EGL: $enable_egl"
  2484. if test "$enable_egl" = yes; then
  2485. echo " EGL platforms: $egl_platforms"
  2486. egl_drivers=""
  2487. if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
  2488. egl_drivers="$egl_drivers builtin:egl_dri2"
  2489. fi
  2490. if test "x$HAVE_EGL_DRIVER_DRI3" != "x"; then
  2491. egl_drivers="$egl_drivers builtin:egl_dri3"
  2492. fi
  2493. echo " EGL drivers: $egl_drivers"
  2494. fi
  2495. # Vulkan
  2496. echo ""
  2497. if test "x$VULKAN_DRIVERS" != x; then
  2498. echo " Vulkan drivers: $VULKAN_DRIVERS"
  2499. echo " Vulkan ICD dir: $VULKAN_ICD_INSTALL_DIR"
  2500. else
  2501. echo " Vulkan drivers: no"
  2502. fi
  2503. echo ""
  2504. if test "x$MESA_LLVM" = x1; then
  2505. echo " llvm: yes"
  2506. echo " llvm-config: $LLVM_CONFIG"
  2507. echo " llvm-version: $LLVM_VERSION"
  2508. else
  2509. echo " llvm: no"
  2510. fi
  2511. echo ""
  2512. if test -n "$with_gallium_drivers"; then
  2513. echo " Gallium drivers: $gallium_drivers"
  2514. echo " Gallium st: $gallium_st"
  2515. else
  2516. echo " Gallium: no"
  2517. fi
  2518. dnl Shader cache
  2519. echo ""
  2520. echo " Shader cache: $enable_shader_cache"
  2521. if test "x$enable_shader_cache" = "xyes"; then
  2522. echo " With SHA1 from: $with_sha1"
  2523. fi
  2524. dnl Libraries
  2525. echo ""
  2526. echo " Shared libs: $enable_shared"
  2527. echo " Static libs: $enable_static"
  2528. echo " Shared-glapi: $enable_shared_glapi"
  2529. dnl Compiler options
  2530. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  2531. cflags=`echo $CFLAGS | \
  2532. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2533. cxxflags=`echo $CXXFLAGS | \
  2534. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2535. defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
  2536. echo ""
  2537. echo " CFLAGS: $cflags"
  2538. echo " CXXFLAGS: $cxxflags"
  2539. echo " Macros: $defines"
  2540. echo ""
  2541. if test "x$MESA_LLVM" = x1; then
  2542. echo " LLVM_CFLAGS: $LLVM_CFLAGS"
  2543. echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
  2544. echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
  2545. echo " LLVM_LDFLAGS: $LLVM_LDFLAGS"
  2546. echo ""
  2547. fi
  2548. echo " PYTHON2: $PYTHON2"
  2549. echo ""
  2550. echo " Run '${MAKE-make}' to build Mesa"
  2551. echo ""