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

configure.ac 79KB

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