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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424
  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_pci_id=yes ;;
  773. *)
  774. need_pci_id=no ;;
  775. esac
  776. PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED],
  777. have_libudev=yes, have_libudev=no)
  778. AC_ARG_ENABLE([sysfs],
  779. [AS_HELP_STRING([--enable-sysfs],
  780. [enable /sys PCI identification @<:@default=disabled@:>@])],
  781. [have_sysfs="$enableval"],
  782. [have_sysfs=no]
  783. )
  784. if test "x$enable_dri" = xyes; then
  785. if test "$enable_static" = yes; then
  786. AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
  787. fi
  788. # not a hard requirement as swrast does not depend on it
  789. if test "x$have_libdrm" = xyes; then
  790. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  791. fi
  792. fi
  793. dnl Direct rendering or just indirect rendering
  794. case "$host_os" in
  795. gnu*)
  796. dnl Disable by default on GNU/Hurd
  797. driglx_direct_default="no"
  798. ;;
  799. cygwin*)
  800. dnl Disable by default on cygwin
  801. driglx_direct_default="no"
  802. ;;
  803. *)
  804. driglx_direct_default="yes"
  805. ;;
  806. esac
  807. AC_ARG_ENABLE([driglx-direct],
  808. [AS_HELP_STRING([--disable-driglx-direct],
  809. [disable direct rendering in GLX and EGL for DRI \
  810. @<:@default=auto@:>@])],
  811. [driglx_direct="$enableval"],
  812. [driglx_direct="$driglx_direct_default"])
  813. dnl
  814. dnl libGL configuration per driver
  815. dnl
  816. case "x$enable_glx$enable_xlib_glx" in
  817. xyesyes)
  818. # Xlib-based GLX
  819. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  820. GL_PC_REQ_PRIV="x11 xext"
  821. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  822. GL_LIB_DEPS="$XLIBGL_LIBS"
  823. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  824. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
  825. ;;
  826. xyesno)
  827. # DRI-based GLX
  828. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  829. # find the DRI deps for libGL
  830. dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= $XCBGLX_REQUIRED"
  831. if test x"$driglx_direct" = xyes; then
  832. if test x"$dri_platform" = xdrm ; then
  833. if test "x$have_libdrm" != xyes; then
  834. AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
  835. fi
  836. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  837. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
  838. if test x"$enable_dri3" = xyes; then
  839. PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED])
  840. PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED])
  841. fi
  842. if test x"$enable_dri" = xyes; then
  843. dri_modules="$dri_modules xcb-dri2 >= $XCBDRI2_REQUIRED"
  844. fi
  845. if test x"$enable_dri3" = xyes; then
  846. dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
  847. fi
  848. fi
  849. if test x"$dri_platform" = xapple ; then
  850. DEFINES="$DEFINES -DGLX_USE_APPLEGL"
  851. fi
  852. fi
  853. # add xf86vidmode if available
  854. PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
  855. if test "$HAVE_XF86VIDMODE" = yes ; then
  856. dri_modules="$dri_modules xxf86vm"
  857. fi
  858. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  859. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  860. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  861. GL_LIB_DEPS="$DRIGL_LIBS"
  862. # need DRM libs, $PTHREAD_LIBS, etc.
  863. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  864. GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  865. ;;
  866. esac
  867. have_pci_id=no
  868. if test "$have_libudev" = yes; then
  869. DEFINES="$DEFINES -DHAVE_LIBUDEV"
  870. have_pci_id=yes
  871. fi
  872. if test "$have_sysfs" = yes; then
  873. DEFINES="$DEFINES -DHAVE_SYSFS"
  874. have_pci_id=yes
  875. fi
  876. # This is outside the case (above) so that it is invoked even for non-GLX
  877. # builds.
  878. AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
  879. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  880. GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  881. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  882. GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
  883. AC_SUBST([X11_INCLUDES])
  884. AC_SUBST([GL_LIB_DEPS])
  885. AC_SUBST([GL_PC_REQ_PRIV])
  886. AC_SUBST([GL_PC_LIB_PRIV])
  887. AC_SUBST([GL_PC_CFLAGS])
  888. AC_SUBST([DRI_PC_REQ_PRIV])
  889. AC_SUBST([GLESv1_CM_LIB_DEPS])
  890. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  891. AC_SUBST([GLESv2_LIB_DEPS])
  892. AC_SUBST([GLESv2_PC_LIB_PRIV])
  893. AC_SUBST([HAVE_XF86VIDMODE])
  894. dnl
  895. dnl More GLX setup
  896. dnl
  897. case "x$enable_glx$enable_xlib_glx" in
  898. xyesyes)
  899. DEFINES="$DEFINES -DUSE_XSHM"
  900. ;;
  901. xyesno)
  902. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  903. if test "x$driglx_direct" = xyes; then
  904. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  905. fi
  906. ;;
  907. esac
  908. dnl
  909. dnl TLS detection
  910. dnl
  911. AC_ARG_ENABLE([glx-tls],
  912. [AS_HELP_STRING([--enable-glx-tls],
  913. [enable TLS support in GLX @<:@default=disabled@:>@])],
  914. [GLX_USE_TLS="$enableval"],
  915. [GLX_USE_TLS=no])
  916. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  917. AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
  918. [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
  919. dnl
  920. dnl More DRI setup
  921. dnl
  922. dnl Directory for DRI drivers
  923. AC_ARG_WITH([dri-driverdir],
  924. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  925. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  926. [DRI_DRIVER_INSTALL_DIR="$withval"],
  927. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  928. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  929. dnl Extra search path for DRI drivers
  930. AC_ARG_WITH([dri-searchpath],
  931. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  932. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  933. [DRI_DRIVER_SEARCH_DIR="$withval"],
  934. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  935. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  936. dnl Which drivers to build - default is chosen by platform
  937. AC_ARG_WITH([dri-drivers],
  938. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  939. [comma delimited classic DRI drivers list, e.g.
  940. "swrast,i965,radeon" @<:@default=auto@:>@])],
  941. [with_dri_drivers="$withval"],
  942. [with_dri_drivers=auto])
  943. if test "x$with_dri_drivers" = xauto; then
  944. if test "x$enable_opengl" = xyes -a "x$enable_dri" = xyes; then
  945. with_dri_drivers="yes"
  946. else
  947. with_dri_drivers="no"
  948. fi
  949. fi
  950. if test "x$with_dri_drivers" = xno; then
  951. with_dri_drivers=''
  952. fi
  953. dnl If $with_dri_drivers is yes, drivers will be added through
  954. dnl platform checks. Set DEFINES and LIB_DEPS
  955. if test "x$enable_dri" = xyes; then
  956. # Platform specific settings and drivers to build
  957. case "$host_os" in
  958. linux*)
  959. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  960. DEFINES="$DEFINES -DHAVE_ALIAS"
  961. if test "x$enable_dri3" = xyes; then
  962. DEFINES="$DEFINES -DHAVE_DRI3"
  963. fi
  964. if test "x$have_pci_id" != xyes; then
  965. AC_MSG_ERROR([libudev-dev or sysfs required for building DRI])
  966. fi
  967. case "$host_cpu" in
  968. powerpc* | sparc*)
  969. # Build only the drivers for cards that exist on PowerPC/sparc
  970. if test "x$with_dri_drivers" = "xyes"; then
  971. with_dri_drivers="r200 radeon swrast"
  972. fi
  973. ;;
  974. esac
  975. ;;
  976. *freebsd* | dragonfly* | *netbsd* | openbsd*)
  977. DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
  978. DEFINES="$DEFINES -DHAVE_ALIAS"
  979. ;;
  980. gnu*)
  981. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  982. DEFINES="$DEFINES -DHAVE_ALIAS"
  983. ;;
  984. solaris*)
  985. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  986. ;;
  987. cygwin*)
  988. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
  989. if test "x$with_dri_drivers" = "xyes"; then
  990. with_dri_drivers="swrast"
  991. fi
  992. ;;
  993. darwin*)
  994. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DGLX_ALIAS_UNSUPPORTED"
  995. if test "x$with_dri_drivers" = "xyes"; then
  996. with_dri_drivers="swrast"
  997. fi
  998. ;;
  999. esac
  1000. # default drivers
  1001. if test "x$with_dri_drivers" = "xyes"; then
  1002. with_dri_drivers="i915 i965 nouveau r200 radeon swrast"
  1003. fi
  1004. # Check for expat
  1005. PKG_CHECK_EXISTS([expat], [have_expat=yes], [have_expat=no])
  1006. if test "x$have_expat" = "xyes"; then
  1007. PKG_CHECK_MODULES([EXPAT], [expat], [],
  1008. AC_MSG_ERROR([Expat required for DRI.]))
  1009. else
  1010. # expat version 2.0 and earlier do not provide expat.pc
  1011. EXPAT_LIBS=-lexpat
  1012. fi
  1013. # If we are building any DRI driver other than swrast.
  1014. if test -n "$with_dri_drivers"; then
  1015. if test "x$with_dri_drivers" != xswrast; then
  1016. # ... libdrm is required
  1017. if test "x$have_libdrm" != xyes; then
  1018. AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
  1019. fi
  1020. DRICOMMON_NEED_LIBDRM=yes
  1021. else
  1022. DRICOMMON_NEED_LIBDRM=no
  1023. fi
  1024. fi
  1025. # put all the necessary libs together
  1026. DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
  1027. fi
  1028. AC_SUBST([DRI_LIB_DEPS])
  1029. DRI_DIRS=''
  1030. dnl Duplicates in DRI_DIRS are removed by sorting it at the end of this block
  1031. if test -n "$with_dri_drivers"; then
  1032. if test "x$enable_opengl" != xyes; then
  1033. AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
  1034. fi
  1035. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  1036. for driver in $dri_drivers; do
  1037. DRI_DIRS="$DRI_DIRS $driver"
  1038. case "x$driver" in
  1039. xi915)
  1040. HAVE_I915_DRI=yes;
  1041. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1042. ;;
  1043. xi965)
  1044. HAVE_I965_DRI=yes;
  1045. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1046. ;;
  1047. xnouveau)
  1048. HAVE_NOUVEAU_DRI=yes;
  1049. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
  1050. ;;
  1051. xradeon)
  1052. HAVE_RADEON_DRI=yes;
  1053. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1054. ;;
  1055. xr200)
  1056. HAVE_R200_DRI=yes;
  1057. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1058. ;;
  1059. xswrast)
  1060. HAVE_SWRAST_DRI=yes;
  1061. ;;
  1062. *)
  1063. AC_MSG_ERROR([classic DRI driver '$driver' does not exist])
  1064. ;;
  1065. esac
  1066. done
  1067. DRI_DIRS=`echo $DRI_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1068. fi
  1069. AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
  1070. AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
  1071. "x$enable_osmesa" = xyes -o \
  1072. -n "$DRI_DIRS")
  1073. dnl
  1074. dnl OSMesa configuration
  1075. dnl
  1076. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  1077. AC_ARG_WITH([osmesa-bits],
  1078. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  1079. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  1080. [osmesa_bits="$withval"],
  1081. [osmesa_bits=8])
  1082. if test "x$osmesa_bits" != x8; then
  1083. if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
  1084. AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
  1085. osmesa_bits=8
  1086. fi
  1087. fi
  1088. case "x$osmesa_bits" in
  1089. x8)
  1090. OSMESA_LIB="${OSMESA_LIB}"
  1091. ;;
  1092. x16|x32)
  1093. OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
  1094. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  1095. ;;
  1096. *)
  1097. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  1098. ;;
  1099. esac
  1100. if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
  1101. # only link libraries with osmesa if shared
  1102. if test "$enable_static" = no; then
  1103. OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1104. else
  1105. OSMESA_LIB_DEPS=""
  1106. fi
  1107. OSMESA_MESA_DEPS=""
  1108. OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
  1109. fi
  1110. AC_SUBST([OSMESA_LIB_DEPS])
  1111. AC_SUBST([OSMESA_MESA_DEPS])
  1112. AC_SUBST([OSMESA_PC_REQ])
  1113. AC_SUBST([OSMESA_PC_LIB_PRIV])
  1114. dnl
  1115. dnl gbm configuration
  1116. dnl
  1117. if test "x$enable_gbm" = xauto; then
  1118. case "$with_egl_platforms" in
  1119. *drm*)
  1120. enable_gbm=yes ;;
  1121. *)
  1122. enable_gbm=no ;;
  1123. esac
  1124. fi
  1125. if test "x$enable_gbm" = xyes; then
  1126. if test "x$need_pci_id$have_pci_id" = xyesno; then
  1127. AC_MSG_ERROR([gbm requires udev >= $LIBUDEV_REQUIRED or sysfs])
  1128. fi
  1129. if test "x$enable_dri" = xyes; then
  1130. GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
  1131. if test "x$enable_shared_glapi" = xno; then
  1132. AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
  1133. fi
  1134. else
  1135. # Strictly speaking libgbm does not require --enable-dri, although
  1136. # both of its backends do. Thus one can build libgbm without any
  1137. # backends if --disable-dri is set.
  1138. # To avoid unnecessary complexity of checking if at least one backend
  1139. # is available when building, just mandate --enable-dri.
  1140. AC_MSG_ERROR([gbm requires --enable-dri])
  1141. fi
  1142. fi
  1143. AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
  1144. if test "x$need_pci_id$have_libudev" = xyesyes; then
  1145. GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED"
  1146. else
  1147. GBM_PC_REQ_PRIV=""
  1148. fi
  1149. GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
  1150. AC_SUBST([GBM_PC_REQ_PRIV])
  1151. AC_SUBST([GBM_PC_LIB_PRIV])
  1152. dnl
  1153. dnl EGL configuration
  1154. dnl
  1155. EGL_CLIENT_APIS=""
  1156. if test "x$enable_egl" = xyes; then
  1157. EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
  1158. AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
  1159. if test "$enable_static" != yes; then
  1160. if test "x$enable_dri" = xyes; then
  1161. HAVE_EGL_DRIVER_DRI2=1
  1162. fi
  1163. fi
  1164. fi
  1165. AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
  1166. AC_SUBST([EGL_LIB_DEPS])
  1167. dnl
  1168. dnl EGL Gallium configuration
  1169. dnl
  1170. if test "x$enable_gallium_egl" = xyes; then
  1171. if test -z "$with_gallium_drivers"; then
  1172. AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
  1173. fi
  1174. if test "x$enable_egl" = xno; then
  1175. AC_MSG_ERROR([cannot enable egl_gallium without EGL])
  1176. fi
  1177. if test "x$have_libdrm" != xyes; then
  1178. AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
  1179. fi
  1180. GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
  1181. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
  1182. fi
  1183. AM_CONDITIONAL(HAVE_GALLIUM_EGL, test "x$enable_gallium_egl" = xyes)
  1184. dnl
  1185. dnl gbm Gallium configuration
  1186. dnl
  1187. if test "x$enable_gallium_gbm" = xauto; then
  1188. case "$enable_gbm$enable_gallium_egl$enable_dri$with_egl_platforms" in
  1189. yesyesyes*drm*)
  1190. enable_gallium_gbm=yes ;;
  1191. *)
  1192. enable_gallium_gbm=no ;;
  1193. esac
  1194. fi
  1195. if test "x$enable_gallium_gbm" = xyes; then
  1196. if test -z "$with_gallium_drivers"; then
  1197. AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
  1198. fi
  1199. if test "x$enable_gbm" = xno; then
  1200. AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
  1201. fi
  1202. # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
  1203. if test "x$enable_dri" = xno; then
  1204. AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
  1205. fi
  1206. GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
  1207. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
  1208. enable_gallium_loader=yes
  1209. fi
  1210. AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes)
  1211. dnl
  1212. dnl XA configuration
  1213. dnl
  1214. if test "x$enable_xa" = xyes; then
  1215. if test "x$with_gallium_drivers" = xswrast; then
  1216. AC_MSG_ERROR([
  1217. Building xa requires at least one non swrast gallium driver.
  1218. If you are looking to use libxatracker.so with vmware's virtual gpu,
  1219. make sure to include svga in the gallium drivers list, apart from
  1220. enabling XA.
  1221. Example: ./configure --enable-xa --with-gallium-drivers=svga...])
  1222. fi
  1223. GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
  1224. enable_gallium_loader=yes
  1225. fi
  1226. AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
  1227. dnl
  1228. dnl OpenVG configuration
  1229. dnl
  1230. VG_LIB_DEPS=""
  1231. if test "x$enable_openvg" = xyes; then
  1232. if test "x$enable_egl" = xno; then
  1233. AC_MSG_ERROR([cannot enable OpenVG without EGL])
  1234. fi
  1235. if test -z "$with_gallium_drivers"; then
  1236. AC_MSG_ERROR([cannot enable OpenVG without Gallium])
  1237. fi
  1238. if test "x$enable_gallium_egl" = xno; then
  1239. AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
  1240. fi
  1241. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
  1242. VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
  1243. GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
  1244. VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
  1245. AC_SUBST([VG_PC_LIB_PRIV])
  1246. fi
  1247. AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
  1248. dnl
  1249. dnl Gallium G3DVL configuration
  1250. dnl
  1251. if test -n "$with_gallium_drivers" && ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
  1252. if test "x$enable_xvmc" = xauto; then
  1253. PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
  1254. fi
  1255. if test "x$enable_vdpau" = xauto; then
  1256. PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
  1257. fi
  1258. if test "x$enable_omx" = xauto; then
  1259. PKG_CHECK_EXISTS([libomxil-bellagio], [enable_omx=yes], [enable_omx=no])
  1260. fi
  1261. fi
  1262. if test "x$enable_xvmc" = xyes; then
  1263. PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
  1264. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
  1265. fi
  1266. AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
  1267. if test "x$enable_vdpau" = xyes; then
  1268. PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED],
  1269. [VDPAU_LIBS="`$PKG_CONFIG --libs x11-xcb xcb-dri2`"])
  1270. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
  1271. fi
  1272. AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
  1273. if test "x$enable_omx" = xyes; then
  1274. PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
  1275. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS omx"
  1276. fi
  1277. AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
  1278. dnl
  1279. dnl OpenCL configuration
  1280. dnl
  1281. AC_ARG_WITH([libclc-path],
  1282. [AS_HELP_STRING([--with-libclc-path],
  1283. [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
  1284. [LIBCLC_PATH="$withval"],
  1285. [LIBCLC_PATH=''])
  1286. if test -n "$LIBCLC_PATH"; then
  1287. AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
  1288. Please review the updated build instructions for clover:
  1289. http://dri.freedesktop.org/wiki/GalliumCompute])
  1290. fi
  1291. AC_ARG_WITH([clang-libdir],
  1292. [AS_HELP_STRING([--with-clang-libdir],
  1293. [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
  1294. [CLANG_LIBDIR="$withval"],
  1295. [CLANG_LIBDIR=''])
  1296. PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
  1297. if test "x$enable_opencl" = xyes; then
  1298. if test -z "$with_gallium_drivers"; then
  1299. AC_MSG_ERROR([cannot enable OpenCL without Gallium])
  1300. fi
  1301. if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
  1302. AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
  1303. fi
  1304. if test "x$have_libclc" = xno; then
  1305. AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
  1306. Make sure the directory containing libclc.pc is specified in your
  1307. PKG_CONFIG_PATH environment variable.
  1308. By default libclc.pc is installed to /usr/local/share/pkgconfig/])
  1309. else
  1310. LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
  1311. LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
  1312. AC_SUBST([LIBCLC_INCLUDEDIR])
  1313. AC_SUBST([LIBCLC_LIBEXECDIR])
  1314. fi
  1315. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
  1316. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
  1317. enable_gallium_loader=yes
  1318. if test "x$enable_opencl_icd" = xyes; then
  1319. OPENCL_LIBNAME="MesaOpenCL"
  1320. else
  1321. OPENCL_LIBNAME="OpenCL"
  1322. fi
  1323. fi
  1324. AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
  1325. AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
  1326. AC_SUBST([OPENCL_LIBNAME])
  1327. dnl
  1328. dnl Gallium configuration
  1329. dnl
  1330. AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
  1331. AC_SUBST([LLVM_BINDIR])
  1332. AC_SUBST([LLVM_CFLAGS])
  1333. AC_SUBST([LLVM_CPPFLAGS])
  1334. AC_SUBST([LLVM_CXXFLAGS])
  1335. AC_SUBST([LLVM_LIBDIR])
  1336. AC_SUBST([LLVM_LIBS])
  1337. AC_SUBST([LLVM_LDFLAGS])
  1338. AC_SUBST([LLVM_INCLUDEDIR])
  1339. AC_SUBST([LLVM_VERSION])
  1340. AC_SUBST([CLANG_RESOURCE_DIR])
  1341. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1342. x*yes*)
  1343. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
  1344. ;;
  1345. esac
  1346. AC_SUBST([VG_LIB_DEPS])
  1347. AC_SUBST([EGL_CLIENT_APIS])
  1348. dnl
  1349. dnl EGL Platforms configuration
  1350. dnl
  1351. AC_ARG_WITH([egl-platforms],
  1352. [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
  1353. [comma delimited native platforms libEGL supports, e.g.
  1354. "x11,drm" @<:@default=auto@:>@])],
  1355. [with_egl_platforms="$withval"],
  1356. [if test "x$enable_egl" = xyes; then
  1357. with_egl_platforms="x11"
  1358. else
  1359. with_egl_platforms=""
  1360. fi])
  1361. if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
  1362. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1363. fi
  1364. # Do per-EGL platform setups and checks
  1365. egl_platforms=`IFS=', '; echo $with_egl_platforms`
  1366. for plat in $egl_platforms; do
  1367. case "$plat" in
  1368. wayland)
  1369. PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED])
  1370. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
  1371. WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
  1372. AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
  1373. [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
  1374. ;;
  1375. x11)
  1376. PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes])
  1377. ;;
  1378. drm)
  1379. test "x$enable_gbm" = "xno" &&
  1380. AC_MSG_ERROR([EGL platform drm needs gbm])
  1381. test "x$have_libdrm" != xyes &&
  1382. AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
  1383. ;;
  1384. android|fbdev|gdi|null)
  1385. ;;
  1386. *)
  1387. AC_MSG_ERROR([EGL platform '$plat' does not exist])
  1388. ;;
  1389. esac
  1390. case "$plat$need_pci_id$have_pci_id" in
  1391. waylandyesno|drmyesno)
  1392. AC_MSG_ERROR([cannot build $plat platform without udev >= $LIBUDEV_REQUIRED or sysfs]) ;;
  1393. esac
  1394. done
  1395. # libEGL wants to default to the first platform specified in
  1396. # ./configure. parse that here.
  1397. if test "x$egl_platforms" != "x"; then
  1398. FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
  1399. EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
  1400. else
  1401. EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
  1402. fi
  1403. if echo "$egl_platforms" | grep -q 'x11'; then
  1404. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  1405. NEED_WINSYS_XLIB=yes
  1406. fi
  1407. AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11')
  1408. AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland')
  1409. AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
  1410. AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep -q 'fbdev')
  1411. AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep -q 'null')
  1412. AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
  1413. AC_SUBST([EGL_NATIVE_PLATFORM])
  1414. AC_SUBST([EGL_CFLAGS])
  1415. # If we don't have the X11 platform, set this define so we don't try to include
  1416. # the X11 headers.
  1417. if ! echo "$egl_platforms" | grep -q 'x11'; then
  1418. DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
  1419. GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
  1420. fi
  1421. AC_ARG_WITH([egl-driver-dir],
  1422. [AS_HELP_STRING([--with-egl-driver-dir=DIR],
  1423. [directory for EGL drivers [[default=${libdir}/egl]]])],
  1424. [EGL_DRIVER_INSTALL_DIR="$withval"],
  1425. [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
  1426. AC_SUBST([EGL_DRIVER_INSTALL_DIR])
  1427. AC_ARG_WITH([max-width],
  1428. [AS_HELP_STRING([--with-max-width=N],
  1429. [Maximum framebuffer width (4096)])],
  1430. [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
  1431. AS_IF([test "${withval}" -gt "4096"],
  1432. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1433. )
  1434. AC_ARG_WITH([max-height],
  1435. [AS_HELP_STRING([--with-max-height=N],
  1436. [Maximum framebuffer height (4096)])],
  1437. [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
  1438. AS_IF([test "${withval}" -gt "4096"],
  1439. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1440. )
  1441. dnl
  1442. dnl Gallium LLVM
  1443. dnl
  1444. AC_ARG_ENABLE([gallium-llvm],
  1445. [AS_HELP_STRING([--enable-gallium-llvm],
  1446. [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
  1447. [enable_gallium_llvm="$enableval"],
  1448. [enable_gallium_llvm=auto])
  1449. AC_ARG_ENABLE([llvm-shared-libs],
  1450. [AS_HELP_STRING([--enable-llvm-shared-libs],
  1451. [link with LLVM shared libraries @<:@default=enabled@:>@])],
  1452. [enable_llvm_shared_libs="$enableval"],
  1453. [enable_llvm_shared_libs=yes])
  1454. AC_ARG_WITH([llvm-prefix],
  1455. [AS_HELP_STRING([--with-llvm-prefix],
  1456. [Prefix for LLVM installations in non-standard locations])],
  1457. [llvm_prefix="$withval"],
  1458. [llvm_prefix=''])
  1459. # Call this inside ` ` to get the return value.
  1460. # $1 is the llvm-config command with arguments.
  1461. strip_unwanted_llvm_flags() {
  1462. # Use \> (marks the end of the word)
  1463. echo `$1` | sed \
  1464. -e 's/-DNDEBUG\>//g' \
  1465. -e 's/-pedantic\>//g' \
  1466. -e 's/-Wcovered-switch-default\>//g' \
  1467. -e 's/-O.\>//g' \
  1468. -e 's/-g\>//g' \
  1469. -e 's/-Wall\>//g' \
  1470. -e 's/-Wcast-qual\>//g' \
  1471. -e 's/-Woverloaded-virtual\>//g' \
  1472. -e 's/-fcolor-diagnostics\>//g' \
  1473. -e 's/-fdata-sections\>//g' \
  1474. -e 's/-ffunction-sections\>//g' \
  1475. -e 's/-fno-exceptions\>//g' \
  1476. -e 's/-fomit-frame-pointer\>//g' \
  1477. -e 's/-fvisibility-inlines-hidden\>//g' \
  1478. -e 's/-fPIC\>//g' \
  1479. -e 's/-fstack-protector-strong\>//g'
  1480. }
  1481. if test -z "$with_gallium_drivers"; then
  1482. enable_gallium_llvm=no
  1483. fi
  1484. if test "x$enable_gallium_llvm" = xauto; then
  1485. case "$host_cpu" in
  1486. i*86|x86_64|amd64) enable_gallium_llvm=yes;;
  1487. esac
  1488. fi
  1489. if test "x$enable_gallium_llvm" = xyes; then
  1490. if test -n "$llvm_prefix"; then
  1491. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
  1492. else
  1493. AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
  1494. fi
  1495. if test "x$LLVM_CONFIG" != xno; then
  1496. LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
  1497. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  1498. LLVM_BINDIR=`$LLVM_CONFIG --bindir`
  1499. LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
  1500. LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
  1501. LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
  1502. LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
  1503. LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
  1504. AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
  1505. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1506. AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
  1507. [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
  1508. dnl In LLVM 3.4.1 patch level was defined in config.h and not
  1509. dnl llvm-config.h
  1510. AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
  1511. [#include "${LLVM_INCLUDEDIR}/llvm/Config/config.h"],
  1512. LLVM_VERSION_PATCH=0) dnl Default if LLVM_VERSION_PATCH not found
  1513. if test -n "${LLVM_VERSION_MAJOR}"; then
  1514. LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
  1515. else
  1516. LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
  1517. fi
  1518. LLVM_REQUIRED_VERSION_MAJOR="3"
  1519. LLVM_REQUIRED_VERSION_MINOR="1"
  1520. if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
  1521. AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required])
  1522. fi
  1523. LLVM_COMPONENTS="engine bitwriter"
  1524. if $LLVM_CONFIG --components | grep -qw 'mcjit'; then
  1525. LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
  1526. fi
  1527. if test "x$enable_opencl" = xyes; then
  1528. LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
  1529. # LLVM 3.3 >= 177971 requires IRReader
  1530. if $LLVM_CONFIG --components | grep -qw 'irreader'; then
  1531. LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader"
  1532. fi
  1533. # LLVM 3.4 requires Option
  1534. if $LLVM_CONFIG --components | grep -qw 'option'; then
  1535. LLVM_COMPONENTS="${LLVM_COMPONENTS} option"
  1536. fi
  1537. # Current OpenCL/Clover and LLVM 3.5 require ObjCARCOpts and ProfileData
  1538. if $LLVM_CONFIG --components | grep -qw 'objcarcopts'; then
  1539. LLVM_COMPONENTS="${LLVM_COMPONENTS} objcarcopts"
  1540. fi
  1541. if $LLVM_CONFIG --components | grep -qw 'profiledata'; then
  1542. LLVM_COMPONENTS="${LLVM_COMPONENTS} profiledata"
  1543. fi
  1544. fi
  1545. DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DLLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
  1546. MESA_LLVM=1
  1547. dnl Check for Clang internal headers
  1548. if test "x$enable_opencl" = xyes; then
  1549. if test -z "$CLANG_LIBDIR"; then
  1550. CLANG_LIBDIR=${LLVM_LIBDIR}
  1551. fi
  1552. CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
  1553. AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
  1554. [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.])])
  1555. fi
  1556. else
  1557. MESA_LLVM=0
  1558. LLVM_VERSION_INT=0
  1559. fi
  1560. else
  1561. MESA_LLVM=0
  1562. LLVM_VERSION_INT=0
  1563. fi
  1564. dnl Directory for XVMC libs
  1565. AC_ARG_WITH([xvmc-libdir],
  1566. [AS_HELP_STRING([--with-xvmc-libdir=DIR],
  1567. [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
  1568. [XVMC_LIB_INSTALL_DIR="$withval"],
  1569. [XVMC_LIB_INSTALL_DIR='${libdir}'])
  1570. AC_SUBST([XVMC_LIB_INSTALL_DIR])
  1571. dnl
  1572. dnl Gallium Tests
  1573. dnl
  1574. if test "x$enable_gallium_tests" = xyes; then
  1575. enable_gallium_loader=yes
  1576. fi
  1577. AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
  1578. if test "x$enable_gallium_loader" = xyes; then
  1579. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
  1580. fi
  1581. AM_CONDITIONAL(NEED_GALLIUM_LOADER, test "x$enable_gallium_loader" = xyes)
  1582. dnl Directory for VDPAU libs
  1583. AC_ARG_WITH([vdpau-libdir],
  1584. [AS_HELP_STRING([--with-vdpau-libdir=DIR],
  1585. [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
  1586. [VDPAU_LIB_INSTALL_DIR="$withval"],
  1587. [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
  1588. AC_SUBST([VDPAU_LIB_INSTALL_DIR])
  1589. OMX_LIB_INSTALL_DIR_DEFAULT=''
  1590. if test "x$enable_omx" = xyes; then
  1591. OMX_LIB_INSTALL_DIR_DEFAULT=`$PKG_CONFIG --variable=pluginsdir libomxil-bellagio`
  1592. fi
  1593. AC_ARG_WITH([omx-libdir],
  1594. [AS_HELP_STRING([--with-omx-libdir=DIR],
  1595. [directory for the OMX libraries])],
  1596. [OMX_LIB_INSTALL_DIR="$withval"],
  1597. [OMX_LIB_INSTALL_DIR="$OMX_LIB_INSTALL_DIR_DEFAULT"])
  1598. AC_SUBST([OMX_LIB_INSTALL_DIR])
  1599. dnl Directory for OpenCL libs
  1600. AC_ARG_WITH([opencl-libdir],
  1601. [AS_HELP_STRING([--with-opencl-libdir=DIR],
  1602. [directory for auxiliary libraries used by the OpenCL implementation @<:@default=${libdir}/opencl@:>@])],
  1603. [OPENCL_LIB_INSTALL_DIR="$withval"],
  1604. [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
  1605. AC_SUBST([OPENCL_LIB_INSTALL_DIR])
  1606. dnl
  1607. dnl Gallium helper functions
  1608. dnl
  1609. gallium_check_st() {
  1610. if test "x$NEED_NONNULL_WINSYS" = xyes; then
  1611. if test "x$have_libdrm" != xyes; then
  1612. AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
  1613. fi
  1614. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
  1615. fi
  1616. if test "x$enable_dri" = xyes && test -n "$2"; then
  1617. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
  1618. fi
  1619. if test "x$enable_xa" = xyes && test -n "$3"; then
  1620. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
  1621. fi
  1622. if test "x$enable_xvmc" = xyes && test -n "$4"; then
  1623. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
  1624. fi
  1625. if test "x$enable_vdpau" = xyes && test -n "$5"; then
  1626. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
  1627. fi
  1628. if test "x$enable_omx" = xyes && test "x$6" != x; then
  1629. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
  1630. fi
  1631. }
  1632. gallium_require_llvm() {
  1633. if test "x$MESA_LLVM" = x0; then
  1634. case "$host_cpu" in
  1635. i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
  1636. esac
  1637. fi
  1638. }
  1639. gallium_require_drm_loader() {
  1640. if test "x$enable_gallium_loader" = xyes; then
  1641. if test "x$need_pci_id$have_pci_id" = xyesno; then
  1642. AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED or sysfs])
  1643. fi
  1644. if test "x$have_libdrm" != xyes; then
  1645. AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
  1646. fi
  1647. enable_gallium_drm_loader=yes
  1648. fi
  1649. }
  1650. require_egl_drm() {
  1651. case "$with_egl_platforms" in
  1652. *drm*)
  1653. ;;
  1654. *)
  1655. AC_MSG_ERROR([--with-egl-platforms=drm is required to build the $1 driver.])
  1656. ;;
  1657. esac
  1658. if test "x$enable_gbm" != xyes; then
  1659. AC_MSG_ERROR([--enable-gbm is required to build the $1 driver.])
  1660. fi
  1661. }
  1662. radeon_llvm_check() {
  1663. if test "x$enable_gallium_llvm" != "xyes"; then
  1664. AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
  1665. fi
  1666. LLVM_REQUIRED_VERSION_MAJOR="3"
  1667. LLVM_REQUIRED_VERSION_MINOR="3"
  1668. if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
  1669. AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required for $1])
  1670. fi
  1671. if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
  1672. AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
  1673. sources with the --enable-experimental-targets=R600
  1674. configure flag])
  1675. fi
  1676. LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
  1677. NEED_RADEON_LLVM=yes
  1678. AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
  1679. [AC_MSG_ERROR([$1 requires libelf when using LLVM])])
  1680. }
  1681. dnl Gallium drivers
  1682. if test "x$enable_dri" = xyes -o "x$enable_xa" = xyes -o \
  1683. "x$enable_xvmc" = xyes -o "x$enable_vdpau" = xyes; then
  1684. NEED_NONNULL_WINSYS=yes
  1685. fi
  1686. AM_CONDITIONAL(NEED_NONNULL_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes)
  1687. dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
  1688. if test -n "$with_gallium_drivers"; then
  1689. gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
  1690. for driver in $gallium_drivers; do
  1691. case "x$driver" in
  1692. xsvga)
  1693. HAVE_GALLIUM_SVGA=yes
  1694. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
  1695. gallium_require_drm_loader
  1696. gallium_check_st "svga/drm" "dri-vmwgfx" ""
  1697. ;;
  1698. xi915)
  1699. HAVE_GALLIUM_I915=yes
  1700. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1701. gallium_require_drm_loader
  1702. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
  1703. if test "x$MESA_LLVM" = x1; then
  1704. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1705. fi
  1706. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
  1707. gallium_check_st "i915/drm" "dri-i915"
  1708. DRICOMMON_NEED_LIBDRM=yes
  1709. ;;
  1710. xilo)
  1711. HAVE_GALLIUM_ILO=yes
  1712. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1713. gallium_require_drm_loader
  1714. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
  1715. gallium_check_st "intel/drm" "dri-ilo"
  1716. DRICOMMON_NEED_LIBDRM=yes
  1717. ;;
  1718. xr300)
  1719. HAVE_GALLIUM_R300=yes
  1720. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1721. gallium_require_drm_loader
  1722. gallium_require_llvm "Gallium R300"
  1723. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1724. gallium_check_st "radeon/drm" "r300/dri" "" "" ""
  1725. DRICOMMON_NEED_LIBDRM=yes
  1726. ;;
  1727. xr600)
  1728. HAVE_GALLIUM_R600=yes
  1729. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1730. gallium_require_drm_loader
  1731. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
  1732. if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
  1733. radeon_llvm_check "r600g"
  1734. LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
  1735. fi
  1736. if test "x$enable_r600_llvm" = xyes; then
  1737. USE_R600_LLVM_COMPILER=yes;
  1738. fi
  1739. if test "x$enable_opencl" = xyes; then
  1740. LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
  1741. fi
  1742. gallium_check_st "radeon/drm" "r600/dri" "" "r600/xvmc" "r600/vdpau" "r600/omx"
  1743. DRICOMMON_NEED_LIBDRM=yes
  1744. ;;
  1745. xradeonsi)
  1746. HAVE_GALLIUM_RADEONSI=yes
  1747. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1748. gallium_require_drm_loader
  1749. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
  1750. radeon_llvm_check "radeonsi"
  1751. require_egl_drm "radeonsi"
  1752. gallium_check_st "radeon/drm" "radeonsi/dri" "" "" "radeonsi/vdpau" "radeonsi/omx"
  1753. DRICOMMON_NEED_LIBDRM=yes
  1754. ;;
  1755. xnouveau)
  1756. HAVE_GALLIUM_NOUVEAU=yes
  1757. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  1758. gallium_require_drm_loader
  1759. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau"
  1760. gallium_check_st "nouveau/drm" "dri-nouveau" "" "xvmc-nouveau" "vdpau-nouveau" "omx-nouveau"
  1761. DRICOMMON_NEED_LIBDRM=yes
  1762. ;;
  1763. xfreedreno)
  1764. HAVE_GALLIUM_FREEDRENO=yes
  1765. PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
  1766. gallium_require_drm_loader
  1767. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
  1768. gallium_check_st "freedreno/drm" "dri-freedreno" "" "" ""
  1769. DRICOMMON_NEED_LIBDRM=yes
  1770. ;;
  1771. xswrast)
  1772. HAVE_GALLIUM_SOFTPIPE=yes
  1773. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
  1774. if test "x$MESA_LLVM" = x1; then
  1775. HAVE_GALLIUM_LLVMPIPE=yes
  1776. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1777. fi
  1778. if test "x$enable_dri" = xyes; then
  1779. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
  1780. fi
  1781. ;;
  1782. *)
  1783. AC_MSG_ERROR([Unknown Gallium driver: $driver])
  1784. ;;
  1785. esac
  1786. done
  1787. fi
  1788. dnl Set LLVM_LIBS - This is done after the driver configuration so
  1789. dnl that drivers can add additonal components to LLVM_COMPONENTS.
  1790. dnl Previously, gallium drivers were updating LLVM_LIBS directly
  1791. dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
  1792. dnl this was causing the same libraries to be appear multiple times
  1793. dnl in LLVM_LIBS.
  1794. if test "x$MESA_LLVM" != x0; then
  1795. LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
  1796. if test "x$enable_llvm_shared_libs" = xyes; then
  1797. dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
  1798. LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
  1799. AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
  1800. if test "x$llvm_have_one_so" = xyes; then
  1801. dnl LLVM was built using auto*, so there is only one shared object.
  1802. LLVM_LIBS="-l$LLVM_SO_NAME"
  1803. else
  1804. dnl If LLVM was built with CMake, there will be one shared object per
  1805. dnl component.
  1806. AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
  1807. [AC_MSG_ERROR([Could not find llvm shared libraries:
  1808. Please make sure you have built llvm with the --enable-shared option
  1809. and that your llvm libraries are installed in $LLVM_LIBDIR
  1810. If you have installed your llvm libraries to a different directory you
  1811. can use the --with-llvm-prefix= configure flag to specify this directory.
  1812. NOTE: Mesa is attempting to use llvm shared libraries by default.
  1813. If you do not want to build with llvm shared libraries and instead want to
  1814. use llvm static libraries then add --disable-llvm-shared-libs to your configure
  1815. invocation and rebuild.])])
  1816. dnl We don't need to update LLVM_LIBS in this case because the LLVM
  1817. dnl install uses a shared object for each compoenent and we have
  1818. dnl already added all of these objects to LLVM_LIBS.
  1819. fi
  1820. else
  1821. AC_MSG_WARN([Building mesa with staticly linked LLVM may cause compilation issues])
  1822. fi
  1823. fi
  1824. AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
  1825. AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
  1826. AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
  1827. AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
  1828. AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
  1829. AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
  1830. AM_CONDITIONAL(HAVE_GALLIUM_RADEON_COMMON, test "x$HAVE_GALLIUM_R600" = xyes -o \
  1831. "x$HAVE_GALLIUM_RADEONSI" = xyes)
  1832. AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
  1833. AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
  1834. AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  1835. AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
  1836. AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -o \
  1837. "x$HAVE_GALLIUM_I915" = xyes -o \
  1838. "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
  1839. AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
  1840. "x$HAVE_GALLIUM_SOFTPIPE" = xyes \
  1841. && test "x$MESA_LLVM" = x1)
  1842. # NOTE: anything using xcb or other client side libs ends up in separate
  1843. # _CLIENT variables. The pipe loader is built in two variants,
  1844. # one that is standalone and does not link any x client libs (for
  1845. # use by XA tracker in particular, but could be used in any case
  1846. # where communication with xserver is not desired).
  1847. if test "x$enable_gallium_loader" = xyes; then
  1848. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
  1849. if test "x$NEED_WINSYS_XLIB" = xyes; then
  1850. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
  1851. fi
  1852. if test "x$enable_dri" = xyes; then
  1853. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI"
  1854. fi
  1855. if test "x$enable_gallium_drm_loader" = xyes; then
  1856. GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
  1857. PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
  1858. pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
  1859. if test "x$pipe_loader_have_xcb" = xyes; then
  1860. GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES -DHAVE_PIPE_LOADER_XCB"
  1861. GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
  1862. fi
  1863. fi
  1864. GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES $GALLIUM_PIPE_LOADER_DEFINES"
  1865. GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_LIBS"
  1866. AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
  1867. AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
  1868. AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES])
  1869. AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS])
  1870. fi
  1871. AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
  1872. AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
  1873. AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
  1874. AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
  1875. AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
  1876. AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
  1877. AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes -a \
  1878. "x$HAVE_GALLIUM_R300" = xyes -o \
  1879. "x$HAVE_GALLIUM_R600" = xyes -o \
  1880. "x$HAVE_GALLIUM_RADEONSI" = xyes)
  1881. AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
  1882. "x$HAVE_GALLIUM_SVGA" = xyes)
  1883. AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
  1884. AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
  1885. AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
  1886. AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
  1887. AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
  1888. AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
  1889. AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
  1890. AC_SUBST([ELF_LIB])
  1891. AM_CONDITIONAL(DRICOMMON_NEED_LIBDRM, test "x$DRICOMMON_NEED_LIBDRM" = xyes)
  1892. AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes)
  1893. AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
  1894. AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
  1895. AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
  1896. AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64)
  1897. AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64)
  1898. AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc)
  1899. AC_SUBST([VDPAU_MAJOR], 1)
  1900. AC_SUBST([VDPAU_MINOR], 0)
  1901. AC_SUBST([XVMC_MAJOR], 1)
  1902. AC_SUBST([XVMC_MINOR], 0)
  1903. XA_HEADER="$srcdir/src/gallium/state_trackers/xa/xa_tracker.h"
  1904. XA_MAJOR=`grep "#define XA_TRACKER_VERSION_MAJOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MAJOR //'`
  1905. XA_MINOR=`grep "#define XA_TRACKER_VERSION_MINOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MINOR //'`
  1906. XA_TINY=`grep "#define XA_TRACKER_VERSION_PATCH" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_PATCH //'`
  1907. AC_SUBST([XA_MAJOR], $XA_MAJOR)
  1908. AC_SUBST([XA_MINOR], $XA_MINOR)
  1909. AC_SUBST([XA_TINY], $XA_TINY)
  1910. AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
  1911. dnl Restore LDFLAGS and CPPFLAGS
  1912. LDFLAGS="$_SAVE_LDFLAGS"
  1913. CPPFLAGS="$_SAVE_CPPFLAGS"
  1914. dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
  1915. if test "x$acv_mesa_CLANG" = xyes; then
  1916. CFLAGS="$CFLAGS -Qunused-arguments"
  1917. CXXFLAGS="$CXXFLAGS -Qunused-arguments"
  1918. fi
  1919. dnl Add user CFLAGS and CXXFLAGS
  1920. CFLAGS="$CFLAGS $USER_CFLAGS"
  1921. CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
  1922. dnl Substitute the config
  1923. AC_CONFIG_FILES([Makefile
  1924. src/Makefile
  1925. src/egl/drivers/dri2/Makefile
  1926. src/egl/main/Makefile
  1927. src/egl/main/egl.pc
  1928. src/egl/wayland/Makefile
  1929. src/egl/wayland/wayland-drm/Makefile
  1930. src/egl/wayland/wayland-egl/Makefile
  1931. src/egl/wayland/wayland-egl/wayland-egl.pc
  1932. src/gallium/auxiliary/Makefile
  1933. src/gallium/auxiliary/pipe-loader/Makefile
  1934. src/gallium/drivers/Makefile
  1935. src/gallium/drivers/freedreno/Makefile
  1936. src/gallium/drivers/galahad/Makefile
  1937. src/gallium/drivers/i915/Makefile
  1938. src/gallium/drivers/identity/Makefile
  1939. src/gallium/drivers/ilo/Makefile
  1940. src/gallium/drivers/llvmpipe/Makefile
  1941. src/gallium/drivers/noop/Makefile
  1942. src/gallium/drivers/nouveau/Makefile
  1943. src/gallium/drivers/r300/Makefile
  1944. src/gallium/drivers/r600/Makefile
  1945. src/gallium/drivers/radeon/Makefile
  1946. src/gallium/drivers/radeonsi/Makefile
  1947. src/gallium/drivers/rbug/Makefile
  1948. src/gallium/drivers/softpipe/Makefile
  1949. src/gallium/drivers/svga/Makefile
  1950. src/gallium/drivers/trace/Makefile
  1951. src/gallium/state_trackers/Makefile
  1952. src/gallium/state_trackers/clover/Makefile
  1953. src/gallium/state_trackers/dri/Makefile
  1954. src/gallium/state_trackers/dri/drm/Makefile
  1955. src/gallium/state_trackers/dri/sw/Makefile
  1956. src/gallium/state_trackers/egl/Makefile
  1957. src/gallium/state_trackers/gbm/Makefile
  1958. src/gallium/state_trackers/glx/xlib/Makefile
  1959. src/gallium/state_trackers/omx/Makefile
  1960. src/gallium/state_trackers/osmesa/Makefile
  1961. src/gallium/state_trackers/vdpau/Makefile
  1962. src/gallium/state_trackers/vega/Makefile
  1963. src/gallium/state_trackers/xa/Makefile
  1964. src/gallium/state_trackers/xvmc/Makefile
  1965. src/gallium/targets/Makefile
  1966. src/gallium/targets/dri-freedreno/Makefile
  1967. src/gallium/targets/dri-i915/Makefile
  1968. src/gallium/targets/dri-ilo/Makefile
  1969. src/gallium/targets/dri-nouveau/Makefile
  1970. src/gallium/targets/dri-swrast/Makefile
  1971. src/gallium/targets/dri-vmwgfx/Makefile
  1972. src/gallium/targets/egl-static/Makefile
  1973. src/gallium/targets/gbm/Makefile
  1974. src/gallium/targets/opencl/Makefile
  1975. src/gallium/targets/xa/Makefile
  1976. src/gallium/targets/xa/xatracker.pc
  1977. src/gallium/targets/omx-nouveau/Makefile
  1978. src/gallium/targets/osmesa/Makefile
  1979. src/gallium/targets/osmesa/osmesa.pc
  1980. src/gallium/targets/pipe-loader/Makefile
  1981. src/gallium/targets/radeonsi/dri/Makefile
  1982. src/gallium/targets/radeonsi/omx/Makefile
  1983. src/gallium/targets/radeonsi/vdpau/Makefile
  1984. src/gallium/targets/r300/dri/Makefile
  1985. src/gallium/targets/r600/dri/Makefile
  1986. src/gallium/targets/r600/omx/Makefile
  1987. src/gallium/targets/r600/vdpau/Makefile
  1988. src/gallium/targets/r600/xvmc/Makefile
  1989. src/gallium/targets/libgl-xlib/Makefile
  1990. src/gallium/targets/vdpau-nouveau/Makefile
  1991. src/gallium/targets/xvmc-nouveau/Makefile
  1992. src/gallium/tests/trivial/Makefile
  1993. src/gallium/tests/unit/Makefile
  1994. src/gallium/winsys/Makefile
  1995. src/gallium/winsys/freedreno/drm/Makefile
  1996. src/gallium/winsys/i915/drm/Makefile
  1997. src/gallium/winsys/i915/sw/Makefile
  1998. src/gallium/winsys/intel/drm/Makefile
  1999. src/gallium/winsys/nouveau/drm/Makefile
  2000. src/gallium/winsys/radeon/drm/Makefile
  2001. src/gallium/winsys/svga/drm/Makefile
  2002. src/gallium/winsys/sw/dri/Makefile
  2003. src/gallium/winsys/sw/fbdev/Makefile
  2004. src/gallium/winsys/sw/null/Makefile
  2005. src/gallium/winsys/sw/wayland/Makefile
  2006. src/gallium/winsys/sw/wrapper/Makefile
  2007. src/gallium/winsys/sw/xlib/Makefile
  2008. src/gbm/Makefile
  2009. src/gbm/main/gbm.pc
  2010. src/glsl/Makefile
  2011. src/glx/Makefile
  2012. src/glx/apple/Makefile
  2013. src/glx/tests/Makefile
  2014. src/gtest/Makefile
  2015. src/loader/Makefile
  2016. src/mapi/Makefile
  2017. src/mapi/es1api/Makefile
  2018. src/mapi/es1api/glesv1_cm.pc
  2019. src/mapi/es2api/Makefile
  2020. src/mapi/es2api/glesv2.pc
  2021. src/mapi/glapi/Makefile
  2022. src/mapi/glapi/gen/Makefile
  2023. src/mapi/glapi/tests/Makefile
  2024. src/mapi/shared-glapi/Makefile
  2025. src/mapi/shared-glapi/tests/Makefile
  2026. src/mapi/vgapi/Makefile
  2027. src/mapi/vgapi/vg.pc
  2028. src/mesa/Makefile
  2029. src/mesa/gl.pc
  2030. src/mesa/drivers/dri/dri.pc
  2031. src/mesa/drivers/dri/common/Makefile
  2032. src/mesa/drivers/dri/common/xmlpool/Makefile
  2033. src/mesa/drivers/dri/i915/Makefile
  2034. src/mesa/drivers/dri/i965/Makefile
  2035. src/mesa/drivers/dri/Makefile
  2036. src/mesa/drivers/dri/nouveau/Makefile
  2037. src/mesa/drivers/dri/r200/Makefile
  2038. src/mesa/drivers/dri/radeon/Makefile
  2039. src/mesa/drivers/dri/swrast/Makefile
  2040. src/mesa/drivers/osmesa/Makefile
  2041. src/mesa/drivers/osmesa/osmesa.pc
  2042. src/mesa/drivers/x11/Makefile
  2043. src/mesa/main/tests/Makefile
  2044. src/mesa/main/tests/hash_table/Makefile])
  2045. dnl Sort the dirs alphabetically
  2046. GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  2047. GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  2048. GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  2049. GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  2050. AC_OUTPUT
  2051. dnl
  2052. dnl Output some configuration info for the user
  2053. dnl
  2054. echo ""
  2055. echo " prefix: $prefix"
  2056. echo " exec_prefix: $exec_prefix"
  2057. echo " libdir: $libdir"
  2058. echo " includedir: $includedir"
  2059. dnl API info
  2060. echo ""
  2061. echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
  2062. echo " OpenVG: $enable_openvg"
  2063. dnl Driver info
  2064. echo ""
  2065. case "x$enable_osmesa$enable_gallium_osmesa" in
  2066. xnoyes)
  2067. echo " OSMesa: lib$OSMESA_LIB (Gallium)"
  2068. ;;
  2069. xyesno)
  2070. echo " OSMesa: lib$OSMESA_LIB"
  2071. ;;
  2072. xnono)
  2073. echo " OSMesa: no"
  2074. ;;
  2075. esac
  2076. echo ""
  2077. if test "x$enable_dri" != xno; then
  2078. echo " DRI platform: $dri_platform"
  2079. if test -z "$DRI_DIRS"; then
  2080. echo " DRI drivers: no"
  2081. else
  2082. echo " DRI drivers: $DRI_DIRS"
  2083. fi
  2084. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  2085. fi
  2086. case "x$enable_glx$enable_xlib_glx" in
  2087. xyesyes)
  2088. echo " GLX: Xlib-based"
  2089. ;;
  2090. xyesno)
  2091. echo " GLX: DRI-based"
  2092. ;;
  2093. *)
  2094. echo " GLX: $enable_glx"
  2095. ;;
  2096. esac
  2097. dnl EGL
  2098. echo ""
  2099. echo " EGL: $enable_egl"
  2100. if test "$enable_egl" = yes; then
  2101. echo " EGL platforms: $egl_platforms"
  2102. egl_drivers=""
  2103. if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
  2104. egl_drivers="$egl_drivers builtin:egl_dri2"
  2105. fi
  2106. if test "x$enable_gallium_egl" = xyes; then
  2107. echo " EGL drivers: ${egl_drivers} egl_gallium"
  2108. echo " EGL Gallium STs:$EGL_CLIENT_APIS"
  2109. else
  2110. echo " EGL drivers: $egl_drivers"
  2111. fi
  2112. fi
  2113. echo ""
  2114. if test "x$MESA_LLVM" = x1; then
  2115. echo " llvm: yes"
  2116. echo " llvm-config: $LLVM_CONFIG"
  2117. echo " llvm-version: $LLVM_VERSION"
  2118. else
  2119. echo " llvm: no"
  2120. fi
  2121. echo ""
  2122. if test -n "$with_gallium_drivers"; then
  2123. echo " Gallium: yes"
  2124. echo " Target dirs: $GALLIUM_TARGET_DIRS"
  2125. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  2126. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  2127. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  2128. else
  2129. echo " Gallium: no"
  2130. fi
  2131. dnl Libraries
  2132. echo ""
  2133. echo " Shared libs: $enable_shared"
  2134. echo " Static libs: $enable_static"
  2135. echo " Shared-glapi: $enable_shared_glapi"
  2136. dnl Compiler options
  2137. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  2138. cflags=`echo $CFLAGS | \
  2139. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2140. cxxflags=`echo $CXXFLAGS | \
  2141. $SED 's/^ *//;s/ */ /;s/ *$//'`
  2142. defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
  2143. echo ""
  2144. echo " CFLAGS: $cflags"
  2145. echo " CXXFLAGS: $cxxflags"
  2146. echo " Macros: $defines"
  2147. echo ""
  2148. if test "x$MESA_LLVM" = x1; then
  2149. echo " LLVM_CFLAGS: $LLVM_CFLAGS"
  2150. echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
  2151. echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
  2152. echo ""
  2153. fi
  2154. echo " PYTHON2: $PYTHON2"
  2155. echo ""
  2156. echo " Run '${MAKE-make}' to build Mesa"
  2157. echo ""