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

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