Clone of mesa.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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