Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

configure.ac 60KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037
  1. dnl Process this file with autoconf to create configure.
  2. AC_PREREQ([2.60])
  3. dnl Versioning - scrape the version from configs/default
  4. m4_define([mesa_version],
  5. [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n' | tr -d '\r'])])
  6. m4_ifval(mesa_version,,
  7. [m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
  8. dnl Tell the user about autoconf.html in the --help output
  9. m4_divert_once([HELP_END], [
  10. See docs/autoconf.html for more details on the options for Mesa.])
  11. AC_INIT([Mesa],[mesa_version],
  12. [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
  13. AC_CONFIG_AUX_DIR([bin])
  14. AC_CANONICAL_HOST
  15. AM_INIT_AUTOMAKE([foreign])
  16. # Support silent build rules, requires at least automake-1.11. Disable
  17. # by either passing --disable-silent-rules to configure or passing V=1
  18. # to make
  19. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  20. LT_PREREQ([2.2])
  21. LT_INIT([disable-static])
  22. dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
  23. USER_CFLAGS="$CFLAGS"
  24. USER_CXXFLAGS="$CXXFLAGS"
  25. dnl Versions for external dependencies
  26. LIBDRM_REQUIRED=2.4.24
  27. LIBDRM_RADEON_REQUIRED=2.4.24
  28. LIBDRM_INTEL_REQUIRED=2.4.30
  29. LIBDRM_NOUVEAU_REQUIRED=0.6
  30. DRI2PROTO_REQUIRED=2.6
  31. GLPROTO_REQUIRED=1.4.14
  32. LIBDRM_XORG_REQUIRED=2.4.24
  33. LIBKMS_XORG_REQUIRED=1.0.0
  34. dnl Check for progs
  35. AC_PROG_CPP
  36. AC_PROG_CC
  37. AC_PROG_CXX
  38. AC_CHECK_PROGS([MAKE], [gmake make])
  39. AC_CHECK_PROGS([PYTHON2], [python2 python])
  40. AC_PROG_SED
  41. AC_PATH_PROG([MKDEP], [makedepend])
  42. if test "x$MKDEP" = "x"; then
  43. AC_MSG_ERROR([makedepend is required to build Mesa])
  44. fi
  45. AC_PATH_PROG([FLEX], [flex])
  46. test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
  47. AC_PATH_PROG([BISON], [bison])
  48. test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
  49. dnl Our fallback install-sh is a symlink to minstall. Use the existing
  50. dnl configuration in that case.
  51. AC_PROG_INSTALL
  52. test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
  53. dnl We need a POSIX shell for parts of the build. Assume we have one
  54. dnl in most cases.
  55. case "$host_os" in
  56. solaris*)
  57. # Solaris /bin/sh is too old/non-POSIX compliant
  58. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  59. SHELL="$POSIX_SHELL"
  60. ;;
  61. esac
  62. AC_PATH_PROG([GTESTCONFIG], [gtest-config])
  63. if test "x$GTESTCONFIG" != "x"; then
  64. GTEST_CFLAGS=`gtest-config --cppflags --cxxflags`
  65. GTEST_LIBS=`gtest-config --ldflags --libs`
  66. AC_SUBST([GTEST_CFLAGS])
  67. AC_SUBST([GTEST_LIBS])
  68. HAVE_GTEST=yes
  69. else
  70. HAVE_GTEST=no
  71. fi
  72. AM_CONDITIONAL(HAVE_GTEST, test x$HAVE_GTEST = xyes)
  73. dnl clang is mostly GCC-compatible, but its version is much lower,
  74. dnl so we have to check for it.
  75. AC_MSG_CHECKING([if compiling with clang])
  76. AC_COMPILE_IFELSE(
  77. [AC_LANG_PROGRAM([], [[
  78. #ifndef __clang__
  79. not clang
  80. #endif
  81. ]])],
  82. [CLANG=yes], [CLANG=no])
  83. AC_MSG_RESULT([$CLANG])
  84. dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
  85. dnl versions are explictly not supported.
  86. if test "x$GCC" = xyes -a "x$CLANG" = xno; then
  87. AC_MSG_CHECKING([whether gcc version is sufficient])
  88. major=0
  89. minor=0
  90. GCC_VERSION=`$CC -dumpversion`
  91. if test $? -eq 0; then
  92. major=`echo $GCC_VERSION | cut -d. -f1`
  93. minor=`echo $GCC_VERSION | cut -d. -f2`
  94. fi
  95. if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
  96. AC_MSG_RESULT([no])
  97. AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
  98. else
  99. AC_MSG_RESULT([yes])
  100. fi
  101. fi
  102. MKDEP_OPTIONS=-fdepend
  103. dnl Ask gcc where it's keeping its secret headers
  104. if test "x$GCC" = xyes; then
  105. for dir in include include-fixed; do
  106. GCC_INCLUDES=`$CC -print-file-name=$dir`
  107. if test "x$GCC_INCLUDES" != x && \
  108. test "$GCC_INCLUDES" != "$dir" && \
  109. test -d "$GCC_INCLUDES"; then
  110. MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
  111. fi
  112. done
  113. fi
  114. AC_SUBST([MKDEP_OPTIONS])
  115. dnl Make sure the pkg-config macros are defined
  116. m4_ifndef([PKG_PROG_PKG_CONFIG],
  117. [m4_fatal([Could not locate the pkg-config autoconf macros.
  118. These are usually located in /usr/share/aclocal/pkg.m4. If your macros
  119. are in a different location, try setting the environment variable
  120. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  121. PKG_PROG_PKG_CONFIG()
  122. dnl LIB_DIR - library basename
  123. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  124. AC_SUBST([LIB_DIR])
  125. dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
  126. _SAVE_LDFLAGS="$LDFLAGS"
  127. AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
  128. AC_SUBST([EXTRA_LIB_PATH])
  129. dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
  130. _SAVE_CPPFLAGS="$CPPFLAGS"
  131. AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
  132. AC_SUBST([X11_INCLUDES])
  133. dnl Compiler macros
  134. DEFINES=""
  135. AC_SUBST([DEFINES])
  136. case "$host_os" in
  137. linux*|*-gnu*|gnu*)
  138. DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
  139. ;;
  140. solaris*)
  141. DEFINES="$DEFINES -DPTHREADS -DSVR4"
  142. ;;
  143. cygwin*)
  144. DEFINES="$DEFINES -DPTHREADS"
  145. ;;
  146. esac
  147. dnl Add flags for gcc and g++
  148. if test "x$GCC" = xyes; then
  149. CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
  150. # Enable -fvisibility=hidden if using a gcc that supports it
  151. save_CFLAGS="$CFLAGS"
  152. AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
  153. VISIBILITY_CFLAGS="-fvisibility=hidden"
  154. CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
  155. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  156. [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
  157. # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
  158. CFLAGS=$save_CFLAGS
  159. # Work around aliasing bugs - developers should comment this out
  160. CFLAGS="$CFLAGS -fno-strict-aliasing"
  161. # gcc's builtin memcmp is slower than glibc's
  162. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  163. CFLAGS="$CFLAGS -fno-builtin-memcmp"
  164. fi
  165. if test "x$GXX" = xyes; then
  166. CXXFLAGS="$CXXFLAGS -Wall"
  167. # Enable -fvisibility=hidden if using a gcc that supports it
  168. save_CXXFLAGS="$CXXFLAGS"
  169. AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
  170. VISIBILITY_CXXFLAGS="-fvisibility=hidden"
  171. CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
  172. AC_LANG_PUSH([C++])
  173. AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
  174. [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
  175. AC_LANG_POP([C++])
  176. # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
  177. CXXFLAGS=$save_CXXFLAGS
  178. # Work around aliasing bugs - developers should comment this out
  179. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  180. # gcc's builtin memcmp is slower than glibc's
  181. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  182. CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
  183. fi
  184. dnl even if the compiler appears to support it, using visibility attributes isn't
  185. dnl going to do anything useful currently on cygwin apart from emit lots of warnings
  186. case "$host_os" in
  187. cygwin*)
  188. VISIBILITY_CFLAGS=""
  189. VISIBILITY_CXXFLAGS=""
  190. ;;
  191. esac
  192. AC_SUBST([VISIBILITY_CFLAGS])
  193. AC_SUBST([VISIBILITY_CXXFLAGS])
  194. dnl These should be unnecessary, but let the user set them if they want
  195. AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
  196. Default is to use CFLAGS.])
  197. AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
  198. compiler. Default is to use CFLAGS.])
  199. AC_SUBST([OPT_FLAGS])
  200. AC_SUBST([ARCH_FLAGS])
  201. dnl
  202. dnl Hacks to enable 32 or 64 bit build
  203. dnl
  204. AC_ARG_ENABLE([32-bit],
  205. [AS_HELP_STRING([--enable-32-bit],
  206. [build 32-bit libraries @<:@default=auto@:>@])],
  207. [enable_32bit="$enableval"],
  208. [enable_32bit=auto]
  209. )
  210. if test "x$enable_32bit" = xyes; then
  211. if test "x$GCC" = xyes; then
  212. CFLAGS="$CFLAGS -m32"
  213. ARCH_FLAGS="$ARCH_FLAGS -m32"
  214. fi
  215. if test "x$GXX" = xyes; then
  216. CXXFLAGS="$CXXFLAGS -m32"
  217. fi
  218. fi
  219. AC_ARG_ENABLE([64-bit],
  220. [AS_HELP_STRING([--enable-64-bit],
  221. [build 64-bit libraries @<:@default=auto@:>@])],
  222. [enable_64bit="$enableval"],
  223. [enable_64bit=auto]
  224. )
  225. if test "x$enable_64bit" = xyes; then
  226. if test "x$GCC" = xyes; then
  227. CFLAGS="$CFLAGS -m64"
  228. fi
  229. if test "x$GXX" = xyes; then
  230. CXXFLAGS="$CXXFLAGS -m64"
  231. fi
  232. fi
  233. dnl
  234. dnl shared/static libraries, mimic libtool options
  235. dnl
  236. AC_ARG_ENABLE([static],
  237. [AS_HELP_STRING([--enable-static],
  238. [build static libraries @<:@default=disabled@:>@])],
  239. [enable_static="$enableval"],
  240. [enable_static=no]
  241. )
  242. case "x$enable_static" in
  243. xyes|xno ) ;;
  244. x ) enable_static=no ;;
  245. * )
  246. AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
  247. ;;
  248. esac
  249. AC_ARG_ENABLE([shared],
  250. [AS_HELP_STRING([--disable-shared],
  251. [build shared libraries @<:@default=enabled@:>@])],
  252. [enable_shared="$enableval"],
  253. [enable_shared=yes]
  254. )
  255. case "x$enable_shared" in
  256. xyes|xno ) ;;
  257. x ) enable_shared=yes ;;
  258. * )
  259. AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
  260. ;;
  261. esac
  262. dnl Can't have static and shared libraries, default to static if user
  263. dnl explicitly requested. If both disabled, set to static since shared
  264. dnl was explicitly requirested.
  265. case "x$enable_static$enable_shared" in
  266. xyesyes )
  267. AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
  268. enable_shared=no
  269. ;;
  270. xnono )
  271. AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
  272. enable_static=yes
  273. ;;
  274. esac
  275. dnl
  276. dnl mklib options
  277. dnl
  278. AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
  279. if test "$enable_static" = yes; then
  280. MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
  281. fi
  282. AC_SUBST([MKLIB_OPTIONS])
  283. dnl
  284. dnl other compiler options
  285. dnl
  286. AC_ARG_ENABLE([debug],
  287. [AS_HELP_STRING([--enable-debug],
  288. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  289. [enable_debug="$enableval"],
  290. [enable_debug=no]
  291. )
  292. if test "x$enable_debug" = xyes; then
  293. DEFINES="$DEFINES -DDEBUG"
  294. if test "x$GCC" = xyes; then
  295. CFLAGS="$CFLAGS -g"
  296. fi
  297. if test "x$GXX" = xyes; then
  298. CXXFLAGS="$CXXFLAGS -g"
  299. fi
  300. fi
  301. dnl
  302. dnl library names
  303. dnl
  304. LIB_PREFIX_GLOB='lib'
  305. LIB_VERSION_SEPARATOR='.'
  306. if test "$enable_static" = yes; then
  307. LIB_EXTENSION='a'
  308. else
  309. case "$host_os" in
  310. darwin* )
  311. LIB_EXTENSION='dylib' ;;
  312. cygwin* )
  313. dnl prefix can be 'cyg' or 'lib'
  314. LIB_PREFIX_GLOB='???'
  315. LIB_VERSION_SEPARATOR='-'
  316. LIB_EXTENSION='dll' ;;
  317. aix* )
  318. LIB_EXTENSION='a' ;;
  319. * )
  320. LIB_EXTENSION='so' ;;
  321. esac
  322. fi
  323. dnl
  324. dnl Mangled Mesa support
  325. dnl
  326. AC_ARG_ENABLE([mangling],
  327. [AS_HELP_STRING([--enable-mangling],
  328. [enable mangled symbols and library name @<:@default=disabled@:>@])],
  329. [enable_mangling="${enableval}"],
  330. [enable_mangling=no]
  331. )
  332. GL_LIB="GL"
  333. GLU_LIB="GLU"
  334. OSMESA_LIB="OSMesa"
  335. if test "x${enable_mangling}" = "xyes" ; then
  336. DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
  337. GL_LIB="MangledGL"
  338. GLU_LIB="MangledGLU"
  339. OSMESA_LIB="MangledOSMesa"
  340. fi
  341. AC_SUBST([GL_LIB])
  342. AC_SUBST([GLU_LIB])
  343. AC_SUBST([OSMESA_LIB])
  344. dnl
  345. dnl potentially-infringing-but-nobody-knows-for-sure stuff
  346. dnl
  347. AC_ARG_ENABLE([texture-float],
  348. [AS_HELP_STRING([--enable-texture-float],
  349. [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
  350. [enable_texture_float="$enableval"],
  351. [enable_texture_float=no]
  352. )
  353. if test "x$enable_texture_float" = xyes; then
  354. AC_MSG_WARN([Floating-point textures enabled.])
  355. AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
  356. DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
  357. fi
  358. GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
  359. GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
  360. OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
  361. EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
  362. GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
  363. GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
  364. VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
  365. GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
  366. WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
  367. GBM_LIB_NAME='lib$(GBM_LIB).'${LIB_EXTENSION}
  368. GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  369. GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  370. OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  371. EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  372. EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  373. GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  374. GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  375. VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  376. GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  377. WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  378. GBM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GBM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
  379. AC_SUBST([GL_LIB_NAME])
  380. AC_SUBST([GLU_LIB_NAME])
  381. AC_SUBST([OSMESA_LIB_NAME])
  382. AC_SUBST([EGL_LIB_NAME])
  383. AC_SUBST([GLESv1_CM_LIB_NAME])
  384. AC_SUBST([GLESv2_LIB_NAME])
  385. AC_SUBST([VG_LIB_NAME])
  386. AC_SUBST([GLAPI_LIB_NAME])
  387. AC_SUBST([WAYLAND_EGL_LIB_NAME])
  388. AC_SUBST([GBM_LIB_NAME])
  389. AC_SUBST([GL_LIB_GLOB])
  390. AC_SUBST([GLU_LIB_GLOB])
  391. AC_SUBST([OSMESA_LIB_GLOB])
  392. AC_SUBST([EGL_LIB_GLOB])
  393. AC_SUBST([GLESv1_CM_LIB_GLOB])
  394. AC_SUBST([GLESv2_LIB_GLOB])
  395. AC_SUBST([VG_LIB_GLOB])
  396. AC_SUBST([GLAPI_LIB_GLOB])
  397. AC_SUBST([WAYLAND_EGL_LIB_GLOB])
  398. AC_SUBST([GBM_LIB_GLOB])
  399. dnl
  400. dnl Arch/platform-specific settings
  401. dnl
  402. AC_ARG_ENABLE([asm],
  403. [AS_HELP_STRING([--disable-asm],
  404. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  405. [enable_asm="$enableval"],
  406. [enable_asm=yes]
  407. )
  408. asm_arch=""
  409. ASM_FLAGS=""
  410. MESA_ASM_SOURCES=""
  411. GLAPI_ASM_SOURCES=""
  412. AC_MSG_CHECKING([whether to enable assembly])
  413. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  414. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  415. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  416. case "$host_cpu" in
  417. i?86 | x86_64)
  418. enable_asm=no
  419. AC_MSG_RESULT([no, cross compiling])
  420. ;;
  421. esac
  422. fi
  423. # check for supported arches
  424. if test "x$enable_asm" = xyes; then
  425. case "$host_cpu" in
  426. i?86)
  427. case "$host_os" in
  428. linux* | *freebsd* | dragonfly* | *netbsd*)
  429. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  430. ;;
  431. esac
  432. ;;
  433. x86_64)
  434. case "$host_os" in
  435. linux* | *freebsd* | dragonfly* | *netbsd*)
  436. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  437. ;;
  438. esac
  439. ;;
  440. powerpc)
  441. case "$host_os" in
  442. linux*)
  443. asm_arch=ppc
  444. ;;
  445. esac
  446. ;;
  447. sparc*)
  448. case "$host_os" in
  449. linux*)
  450. asm_arch=sparc
  451. ;;
  452. esac
  453. ;;
  454. esac
  455. case "$asm_arch" in
  456. x86)
  457. ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  458. MESA_ASM_SOURCES='$(X86_SOURCES)'
  459. GLAPI_ASM_SOURCES='$(X86_API)'
  460. AC_MSG_RESULT([yes, x86])
  461. ;;
  462. x86_64)
  463. ASM_FLAGS="-DUSE_X86_64_ASM"
  464. MESA_ASM_SOURCES='$(X86-64_SOURCES)'
  465. GLAPI_ASM_SOURCES='$(X86-64_API)'
  466. AC_MSG_RESULT([yes, x86_64])
  467. ;;
  468. ppc)
  469. ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
  470. MESA_ASM_SOURCES='$(PPC_SOURCES)'
  471. AC_MSG_RESULT([yes, ppc])
  472. ;;
  473. sparc)
  474. ASM_FLAGS="-DUSE_SPARC_ASM"
  475. MESA_ASM_SOURCES='$(SPARC_SOURCES)'
  476. GLAPI_ASM_SOURCES='$(SPARC_API)'
  477. AC_MSG_RESULT([yes, sparc])
  478. ;;
  479. *)
  480. AC_MSG_RESULT([no, platform not supported])
  481. ;;
  482. esac
  483. fi
  484. AC_SUBST([ASM_FLAGS])
  485. AC_SUBST([MESA_ASM_SOURCES])
  486. AC_SUBST([GLAPI_ASM_SOURCES])
  487. dnl PIC code macro
  488. MESA_PIC_FLAGS
  489. dnl Check to see if dlopen is in default libraries (like Solaris, which
  490. dnl has it in libc), or if libdl is needed to get it.
  491. AC_CHECK_FUNC([dlopen], [],
  492. [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
  493. AC_SUBST([DLOPEN_LIBS])
  494. dnl See if posix_memalign is available
  495. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  496. dnl SELinux awareness.
  497. AC_ARG_ENABLE([selinux],
  498. [AS_HELP_STRING([--enable-selinux],
  499. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  500. [MESA_SELINUX="$enableval"],
  501. [MESA_SELINUX=no])
  502. if test "x$enable_selinux" = "xyes"; then
  503. AC_CHECK_HEADER([selinux/selinux.h],[],
  504. [AC_MSG_ERROR([SELinux headers not found])])
  505. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  506. [AC_MSG_ERROR([SELinux library not found])])
  507. SELINUX_LIBS="-lselinux"
  508. DEFINES="$DEFINES -DMESA_SELINUX"
  509. fi
  510. dnl Options for APIs
  511. AC_ARG_ENABLE([opengl],
  512. [AS_HELP_STRING([--disable-opengl],
  513. [disable support for standard OpenGL API @<:@default=no@:>@])],
  514. [enable_opengl="$enableval"],
  515. [enable_opengl=yes])
  516. AC_ARG_ENABLE([gles1],
  517. [AS_HELP_STRING([--enable-gles1],
  518. [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
  519. [enable_gles1="$enableval"],
  520. [enable_gles1=no])
  521. AC_ARG_ENABLE([gles2],
  522. [AS_HELP_STRING([--enable-gles2],
  523. [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
  524. [enable_gles2="$enableval"],
  525. [enable_gles2=no])
  526. AC_ARG_ENABLE([openvg],
  527. [AS_HELP_STRING([--enable-openvg],
  528. [enable support for OpenVG API @<:@default=no@:>@])],
  529. [enable_openvg="$enableval"],
  530. [enable_openvg=no])
  531. AC_ARG_ENABLE([dri],
  532. [AS_HELP_STRING([--enable-dri],
  533. [enable DRI modules @<:@default=auto@:>@])],
  534. [enable_dri="$enableval"],
  535. [enable_dri=auto])
  536. AC_ARG_ENABLE([glx],
  537. [AS_HELP_STRING([--enable-glx],
  538. [enable GLX library @<:@default=auto@:>@])],
  539. [enable_glx="$enableval"],
  540. [enable_glx=auto])
  541. AC_ARG_ENABLE([osmesa],
  542. [AS_HELP_STRING([--enable-osmesa],
  543. [enable OSMesa library @<:@default=auto@:>@])],
  544. [enable_osmesa="$enableval"],
  545. [enable_osmesa=auto])
  546. AC_ARG_ENABLE([egl],
  547. [AS_HELP_STRING([--disable-egl],
  548. [disable EGL library @<:@default=enabled@:>@])],
  549. [enable_egl="$enableval"],
  550. [enable_egl=yes])
  551. AC_ARG_ENABLE([xorg],
  552. [AS_HELP_STRING([--enable-xorg],
  553. [enable support for X.Org DDX API @<:@default=no@:>@])],
  554. [enable_xorg="$enableval"],
  555. [enable_xorg=no])
  556. AC_ARG_ENABLE([xa],
  557. [AS_HELP_STRING([--enable-xa],
  558. [enable build of the XA X Acceleration API @<:@default=no@:>@])],
  559. [enable_xa="$enableval"],
  560. [enable_xa=no])
  561. AC_ARG_ENABLE([d3d1x],
  562. [AS_HELP_STRING([--enable-d3d1x],
  563. [enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
  564. [enable_d3d1x="$enableval"],
  565. [enable_d3d1x=no])
  566. AC_ARG_ENABLE([gbm],
  567. [AS_HELP_STRING([--enable-gbm],
  568. [enable gbm library @<:@default=auto@:>@])],
  569. [enable_gbm="$enableval"],
  570. [enable_gbm=auto])
  571. AC_ARG_ENABLE([xvmc],
  572. [AS_HELP_STRING([--enable-xvmc],
  573. [enable xvmc library @<:@default=auto@:>@])],
  574. [enable_xvmc="$enableval"],
  575. [enable_xvmc=auto])
  576. AC_ARG_ENABLE([vdpau],
  577. [AS_HELP_STRING([--enable-vdpau],
  578. [enable vdpau library @<:@default=auto@:>@])],
  579. [enable_vdpau="$enableval"],
  580. [enable_vdpau=auto])
  581. AC_ARG_ENABLE([va],
  582. [AS_HELP_STRING([--enable-va],
  583. [enable va library @<:@default=auto@:>@])],
  584. [enable_va="$enableval"],
  585. [enable_va=auto])
  586. AC_ARG_ENABLE([xlib_glx],
  587. [AS_HELP_STRING([--enable-xlib-glx],
  588. [make GLX library Xlib-based instead of DRI-based @<:@default=disable@:>@])],
  589. [enable_xlib_glx="$enableval"],
  590. [enable_xlib_glx=auto])
  591. AC_ARG_ENABLE([gallium_egl],
  592. [AS_HELP_STRING([--enable-gallium-egl],
  593. [enable optional EGL state tracker (not required
  594. for EGL support in Gallium with OpenGL and OpenGL ES)
  595. @<:@default=disable@:>@])],
  596. [enable_gallium_egl="$enableval"],
  597. [enable_gallium_egl=no])
  598. AC_ARG_ENABLE([gallium_gbm],
  599. [AS_HELP_STRING([--enable-gallium-gbm],
  600. [enable optional gbm state tracker (not required for
  601. gbm support in Gallium)
  602. @<:@default=auto@:>@])],
  603. [enable_gallium_gbm="$enableval"],
  604. [enable_gallium_gbm=auto])
  605. # Option for Gallium drivers
  606. GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
  607. AC_ARG_WITH([gallium-drivers],
  608. [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
  609. [comma delimited Gallium drivers list, e.g.
  610. "i915,nouveau,r300,r600,svga,swrast"
  611. @<:@default=r300,r600,swrast@:>@])],
  612. [with_gallium_drivers="$withval"],
  613. [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
  614. # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
  615. # here so that the script doesn't choke on an unknown driver name later.
  616. case "$with_gallium_drivers" in
  617. yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
  618. no) with_gallium_drivers='' ;;
  619. esac
  620. if test "x$enable_opengl" = xno -a \
  621. "x$enable_gles1" = xno -a \
  622. "x$enable_gles2" = xno -a \
  623. "x$enable_openvg" = xno -a \
  624. "x$enable_xorg" = xno -a \
  625. "x$enable_xa" = xno -a \
  626. "x$enable_d3d1x" = xno -a \
  627. "x$enable_xvmc" = xno -a \
  628. "x$enable_vdpau" = xno -a \
  629. "x$enable_va" = xno; then
  630. AC_MSG_ERROR([at least one API should be enabled])
  631. fi
  632. API_DEFINES=""
  633. if test "x$enable_opengl" = xno; then
  634. API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
  635. else
  636. API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
  637. fi
  638. if test "x$enable_gles1" = xyes; then
  639. API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
  640. fi
  641. if test "x$enable_gles2" = xyes; then
  642. API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
  643. fi
  644. AC_SUBST([API_DEFINES])
  645. dnl
  646. dnl Driver configuration. Options are xlib, dri and osmesa right now.
  647. dnl More later: fbdev, ...
  648. dnl
  649. default_driver="xlib"
  650. case "$host_os" in
  651. linux*)
  652. case "$host_cpu" in
  653. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  654. esac
  655. ;;
  656. *freebsd* | dragonfly* | *netbsd*)
  657. case "$host_cpu" in
  658. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  659. esac
  660. ;;
  661. esac
  662. if test "x$enable_opengl" = xno; then
  663. default_driver="no"
  664. fi
  665. AC_ARG_WITH([driver],
  666. [AS_HELP_STRING([--with-driver=DRIVER], [DEPRECATED])],
  667. [mesa_driver="$withval"],
  668. [mesa_driver=auto])
  669. dnl Check for valid option
  670. case "x$mesa_driver" in
  671. xxlib|xdri|xosmesa|xno)
  672. if test "x$enable_dri" != xauto -o \
  673. "x$enable_glx" != xauto -o \
  674. "x$enable_osmesa" != xauto -o \
  675. "x$enable_xlib_glx" != xauto; then
  676. AC_MSG_ERROR([--with-driver=$mesa_driver is deprecated])
  677. fi
  678. ;;
  679. xauto)
  680. mesa_driver="$default_driver"
  681. ;;
  682. *)
  683. AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
  684. ;;
  685. esac
  686. # map $mesa_driver to APIs
  687. if test "x$enable_dri" = xauto; then
  688. case "x$mesa_driver" in
  689. xdri) enable_dri=yes ;;
  690. *) enable_dri=no ;;
  691. esac
  692. fi
  693. if test "x$enable_glx" = xauto; then
  694. case "x$mesa_driver" in
  695. xdri|xxlib) enable_glx=yes ;;
  696. *) enable_glx=no ;;
  697. esac
  698. fi
  699. if test "x$enable_osmesa" = xauto; then
  700. case "x$mesa_driver" in
  701. xxlib|xosmesa) enable_osmesa=yes ;;
  702. *) enable_osmesa=no ;;
  703. esac
  704. fi
  705. if test "x$enable_xlib_glx" = xauto; then
  706. case "x$mesa_driver" in
  707. xxlib) enable_xlib_glx=yes ;;
  708. *) enable_xlib_glx=no ;;
  709. esac
  710. fi
  711. if test "x$enable_glx" = xno; then
  712. enable_xlib_glx=no
  713. fi
  714. dnl
  715. dnl Driver specific build directories
  716. dnl
  717. dnl this variable will be prepended to SRC_DIRS and is not exported
  718. CORE_DIRS="mapi/shared-glapi"
  719. SRC_DIRS=""
  720. GLU_DIRS="sgi"
  721. GALLIUM_DIRS="auxiliary drivers state_trackers"
  722. GALLIUM_TARGET_DIRS=""
  723. GALLIUM_WINSYS_DIRS="sw"
  724. GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
  725. GALLIUM_STATE_TRACKERS_DIRS=""
  726. # build glapi if OpenGL is enabled
  727. if test "x$enable_opengl" = xyes; then
  728. CORE_DIRS="$CORE_DIRS mapi/glapi"
  729. fi
  730. # build es1api if OpenGL ES 1.x is enabled
  731. if test "x$enable_gles1" = xyes; then
  732. CORE_DIRS="$CORE_DIRS mapi/es1api"
  733. fi
  734. # build es2api if OpenGL ES 2.x is enabled
  735. if test "x$enable_gles2" = xyes; then
  736. CORE_DIRS="$CORE_DIRS mapi/es2api"
  737. fi
  738. # build glsl and mesa if OpenGL or OpenGL ES is enabled
  739. case "x$enable_opengl$enable_gles1$enable_gles2" in
  740. x*yes*)
  741. CORE_DIRS="$CORE_DIRS glsl mesa"
  742. ;;
  743. esac
  744. case "x$enable_glx$enable_xlib_glx" in
  745. xyesyes)
  746. DRIVER_DIRS="$DRIVER_DIRS x11"
  747. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  748. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
  749. GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
  750. HAVE_WINSYS_XLIB="yes"
  751. ;;
  752. xyesno)
  753. # DRI-based GLX
  754. SRC_DIRS="$SRC_DIRS glx"
  755. ;;
  756. esac
  757. if test "x$enable_dri" = xyes; then
  758. DRIVER_DIRS="$DRIVER_DIRS dri"
  759. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
  760. GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
  761. HAVE_ST_DRI="yes"
  762. fi
  763. if test "x$enable_osmesa" = xyes; then
  764. # the empty space matters for osmesa... (see src/mesa/Makefile)
  765. if test -n "$DRIVER_DIRS"; then
  766. DRIVER_DIRS="$DRIVER_DIRS osmesa"
  767. else
  768. DRIVER_DIRS="osmesa"
  769. fi
  770. fi
  771. AC_SUBST([SRC_DIRS])
  772. AC_SUBST([GLU_DIRS])
  773. AC_SUBST([DRIVER_DIRS])
  774. AC_SUBST([GALLIUM_DIRS])
  775. AC_SUBST([GALLIUM_TARGET_DIRS])
  776. AC_SUBST([GALLIUM_WINSYS_DIRS])
  777. AC_SUBST([GALLIUM_DRIVERS_DIRS])
  778. AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
  779. AC_SUBST([MESA_LLVM])
  780. # Check for libdrm
  781. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
  782. [have_libdrm=yes], [have_libdrm=no])
  783. if test "x$enable_dri" = xyes; then
  784. # DRI must be shared, I think
  785. if test "$enable_static" = yes; then
  786. AC_MSG_ERROR([Can't use static libraries for DRI drivers])
  787. fi
  788. # not a hard requirement as swrast does not depend on it
  789. if test "x$have_libdrm" = xyes; then
  790. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  791. fi
  792. fi
  793. dnl
  794. dnl Find out if X is available. The variable have_x is set if libX11 is
  795. dnl found to mimic AC_PATH_XTRA.
  796. dnl
  797. if test -n "$PKG_CONFIG"; then
  798. AC_MSG_CHECKING([pkg-config files for X11 are available])
  799. PKG_CHECK_EXISTS([x11],[
  800. x11_pkgconfig=yes
  801. have_x=yes
  802. ],[
  803. x11_pkgconfig=no
  804. ])
  805. AC_MSG_RESULT([$x11_pkgconfig])
  806. else
  807. x11_pkgconfig=no
  808. fi
  809. dnl Use the autoconf macro if no pkg-config files
  810. if test "$x11_pkgconfig" = yes; then
  811. PKG_CHECK_MODULES([X11], [x11])
  812. else
  813. AC_PATH_XTRA
  814. test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
  815. test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
  816. AC_SUBST([X11_CFLAGS])
  817. AC_SUBST([X11_LIBS])
  818. fi
  819. dnl Try to tell the user that the --x-* options are only used when
  820. dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
  821. m4_divert_once([HELP_BEGIN],
  822. [These options are only used when the X libraries cannot be found by the
  823. pkg-config utility.])
  824. dnl We need X for xlib and dri, so bomb now if it's not found
  825. if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then
  826. AC_MSG_ERROR([X11 development libraries needed for GLX])
  827. fi
  828. if test "x$enable_glx" = xyes; then
  829. DEFINES="$DEFINES -DUSE_XCB"
  830. fi
  831. dnl Direct rendering or just indirect rendering
  832. case "$host_os" in
  833. gnu*)
  834. dnl Disable by default on GNU/Hurd
  835. driglx_direct_default="no"
  836. ;;
  837. cygwin*)
  838. dnl Disable by default on cygwin
  839. driglx_direct_default="no"
  840. ;;
  841. *)
  842. driglx_direct_default="yes"
  843. ;;
  844. esac
  845. AC_ARG_ENABLE([driglx-direct],
  846. [AS_HELP_STRING([--disable-driglx-direct],
  847. [enable direct rendering in GLX and EGL for DRI \
  848. @<:@default=auto@:>@])],
  849. [driglx_direct="$enableval"],
  850. [driglx_direct="$driglx_direct_default"])
  851. dnl
  852. dnl libGL configuration per driver
  853. dnl
  854. case "x$enable_glx$enable_xlib_glx" in
  855. xyesyes)
  856. # Xlib-based GLX
  857. if test "$x11_pkgconfig" = yes; then
  858. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  859. GL_PC_REQ_PRIV="x11 xext"
  860. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  861. GL_LIB_DEPS="$XLIBGL_LIBS"
  862. else
  863. # should check these...
  864. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  865. GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
  866. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  867. GL_PC_CFLAGS="$X11_INCLUDES"
  868. fi
  869. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
  870. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
  871. ;;
  872. xyesno)
  873. # DRI-based GLX
  874. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  875. GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
  876. if test x"$driglx_direct" = xyes; then
  877. if test "x$have_libdrm" != xyes; then
  878. AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
  879. fi
  880. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  881. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
  882. fi
  883. # find the DRI deps for libGL
  884. if test "$x11_pkgconfig" = yes; then
  885. dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx"
  886. # add xf86vidmode if available
  887. PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
  888. if test "$HAVE_XF86VIDMODE" = yes ; then
  889. dri_modules="$dri_modules xxf86vm"
  890. fi
  891. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  892. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  893. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  894. GL_LIB_DEPS="$DRIGL_LIBS"
  895. else
  896. # should check these...
  897. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  898. if test "x$HAVE_XF86VIDMODE" == xyes; then
  899. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
  900. else
  901. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXdamage -lXfixes"
  902. fi
  903. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  904. GL_PC_CFLAGS="$X11_INCLUDES"
  905. # XCB can only be used from pkg-config
  906. PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
  907. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
  908. X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
  909. GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
  910. fi
  911. # Check to see if the xcb-glx library is new enough to support
  912. # GLX_ARB_create_context. This bit of hackery is necessary until XCB 1.8
  913. # is released.
  914. save_CPPFLAGS="$CPPFLAGS"
  915. save_LDFLAGS="$LDFLAGS"
  916. CPPFLAGS="$CPPFLAGS $X11_INCLUDES"
  917. LDFLAGS="$LDFLAGS $GL_LIB_DEPS"
  918. AC_CHECK_LIB(xcb-glx, xcb_glx_create_context_attribs_arb_checked,
  919. [HAVE_XCB_GLX_CREATE_CONTEXT=yes],
  920. [HAVE_XCB_GLX_CREATE_CONTEXT=no])
  921. CPPFLAGS="$save_CPPFLAGS"
  922. LDFLAGS="$save_LDFLAGS"
  923. if test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes; then
  924. X11_INCLUDES="$X11_INCLUDES -DHAVE_XCB_GLX_CREATE_CONTEXT"
  925. fi
  926. # need DRM libs, -lpthread, etc.
  927. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  928. GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  929. ;;
  930. esac
  931. # This is outside the case (above) so that it is invoked even for non-GLX
  932. # builds.
  933. AM_CONDITIONAL(HAVE_XCB_GLX_CREATE_CONTEXT,
  934. test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes)
  935. GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  936. GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  937. GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  938. GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  939. AC_SUBST([GL_LIB_DEPS])
  940. AC_SUBST([GL_PC_REQ_PRIV])
  941. AC_SUBST([GL_PC_LIB_PRIV])
  942. AC_SUBST([GL_PC_CFLAGS])
  943. AC_SUBST([DRI_PC_REQ_PRIV])
  944. AC_SUBST([GLESv1_CM_LIB_DEPS])
  945. AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
  946. AC_SUBST([GLESv2_LIB_DEPS])
  947. AC_SUBST([GLESv2_PC_LIB_PRIV])
  948. GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS"
  949. AC_SUBST([GLAPI_LIB_DEPS])
  950. dnl Setup default DRI CFLAGS
  951. DRI_CFLAGS='$(CFLAGS)'
  952. DRI_CXXFLAGS='$(CXXFLAGS)'
  953. DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
  954. MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
  955. if test "x$enable_dri" = xyes ; then
  956. DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
  957. DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
  958. DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
  959. DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
  960. DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
  961. DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
  962. MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
  963. fi
  964. AC_SUBST([DRICORE_LIBS])
  965. AC_SUBST([DRICORE_GLSL_LIBS])
  966. AC_SUBST([DRICORE_LIB_DEPS])
  967. AC_SUBST([DRI_CXXFLAGS])
  968. AC_SUBST([DRI_CFLAGS])
  969. AC_SUBST([MESA_MODULES])
  970. AC_SUBST([HAVE_XF86VIDMODE])
  971. dnl
  972. dnl More GLX setup
  973. dnl
  974. case "x$enable_glx$enable_xlib_glx" in
  975. xyesyes)
  976. DEFINES="$DEFINES -DUSE_XSHM"
  977. ;;
  978. xyesno)
  979. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  980. if test "x$driglx_direct" = xyes; then
  981. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  982. fi
  983. ;;
  984. esac
  985. dnl
  986. dnl TLS detection
  987. dnl
  988. AC_ARG_ENABLE([glx-tls],
  989. [AS_HELP_STRING([--enable-glx-tls],
  990. [enable TLS support in GLX @<:@default=disabled@:>@])],
  991. [GLX_USE_TLS="$enableval"],
  992. [GLX_USE_TLS=no])
  993. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  994. AS_IF([test "x$GLX_USE_TLS" = xyes],
  995. [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
  996. dnl
  997. dnl More DRI setup
  998. dnl
  999. dnl Directory for DRI drivers
  1000. AC_ARG_WITH([dri-driverdir],
  1001. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  1002. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  1003. [DRI_DRIVER_INSTALL_DIR="$withval"],
  1004. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  1005. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  1006. dnl Extra search path for DRI drivers
  1007. AC_ARG_WITH([dri-searchpath],
  1008. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  1009. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  1010. [DRI_DRIVER_SEARCH_DIR="$withval"],
  1011. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  1012. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  1013. dnl Which drivers to build - default is chosen by platform
  1014. AC_ARG_WITH([dri-drivers],
  1015. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  1016. [comma delimited DRI drivers list, e.g.
  1017. "swrast,i965,radeon" @<:@default=auto@:>@])],
  1018. [with_dri_drivers="$withval"],
  1019. [with_dri_drivers=yes])
  1020. if test "x$with_dri_drivers" = x; then
  1021. with_dri_drivers=no
  1022. fi
  1023. dnl If $with_dri_drivers is yes, directories will be added through
  1024. dnl platform checks
  1025. DRI_DIRS=""
  1026. case "$with_dri_drivers" in
  1027. no) ;;
  1028. yes)
  1029. # classic DRI drivers require FEATURE_GL to build
  1030. if test "x$enable_opengl" = xyes; then
  1031. DRI_DIRS="yes"
  1032. fi
  1033. ;;
  1034. *)
  1035. # verify the requested driver directories exist
  1036. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  1037. for driver in $dri_drivers; do
  1038. test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
  1039. AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
  1040. done
  1041. DRI_DIRS="$dri_drivers"
  1042. if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
  1043. AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
  1044. fi
  1045. ;;
  1046. esac
  1047. dnl Set DRI_DIRS, DEFINES and LIB_DEPS
  1048. if test "x$enable_dri" = xyes; then
  1049. # Platform specific settings and drivers to build
  1050. case "$host_os" in
  1051. linux*)
  1052. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1053. DEFINES="$DEFINES -DHAVE_ALIAS"
  1054. case "$host_cpu" in
  1055. x86_64)
  1056. if test "x$DRI_DIRS" = "xyes"; then
  1057. DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
  1058. fi
  1059. ;;
  1060. powerpc*)
  1061. # Build only the drivers for cards that exist on PowerPC.
  1062. if test "x$DRI_DIRS" = "xyes"; then
  1063. DRI_DIRS="r200 radeon swrast"
  1064. fi
  1065. ;;
  1066. sparc*)
  1067. # Build only the drivers for cards that exist on sparc
  1068. if test "x$DRI_DIRS" = "xyes"; then
  1069. DRI_DIRS="r200 radeon swrast"
  1070. fi
  1071. ;;
  1072. esac
  1073. ;;
  1074. freebsd* | dragonfly* | *netbsd*)
  1075. DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
  1076. DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
  1077. if test "x$DRI_DIRS" = "xyes"; then
  1078. DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
  1079. fi
  1080. ;;
  1081. gnu*)
  1082. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1083. DEFINES="$DEFINES -DHAVE_ALIAS"
  1084. ;;
  1085. solaris*)
  1086. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1087. ;;
  1088. cygwin*)
  1089. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  1090. if test "x$DRI_DIRS" = "xyes"; then
  1091. DRI_DIRS="swrast"
  1092. fi
  1093. ;;
  1094. esac
  1095. # default drivers
  1096. if test "x$DRI_DIRS" = "xyes"; then
  1097. DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
  1098. fi
  1099. DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
  1100. # Check for expat
  1101. if test "x$enable_dri" = xyes; then
  1102. EXPAT_INCLUDES=""
  1103. EXPAT_LIB=-lexpat
  1104. AC_ARG_WITH([expat],
  1105. [AS_HELP_STRING([--with-expat=DIR],
  1106. [expat install directory])],[
  1107. EXPAT_INCLUDES="-I$withval/include"
  1108. CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
  1109. LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
  1110. EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
  1111. ])
  1112. AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
  1113. AC_CHECK_LIB([expat],[XML_ParserCreate],[],
  1114. [AC_MSG_ERROR([Expat required for DRI.])])
  1115. fi
  1116. # libdrm is required for all except swrast
  1117. if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
  1118. if test "x$have_libdrm" != xyes; then
  1119. AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
  1120. fi
  1121. fi
  1122. # put all the necessary libs together
  1123. DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
  1124. fi
  1125. AC_SUBST([DRI_DIRS])
  1126. AC_SUBST([EXPAT_INCLUDES])
  1127. AC_SUBST([DRI_LIB_DEPS])
  1128. case $DRI_DIRS in
  1129. *i915*|*i965*)
  1130. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1131. case $DRI_DIRS in
  1132. *i965*)
  1133. HAVE_I965_DRI=yes;
  1134. ;;
  1135. esac
  1136. ;;
  1137. esac
  1138. AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
  1139. case $DRI_DIRS in
  1140. *nouveau*)
  1141. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  1142. ;;
  1143. esac
  1144. case $DRI_DIRS in
  1145. *radeon*|*r200*)
  1146. PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
  1147. ;;
  1148. esac
  1149. dnl
  1150. dnl OSMesa configuration
  1151. dnl
  1152. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  1153. AC_ARG_WITH([osmesa-bits],
  1154. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  1155. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  1156. [osmesa_bits="$withval"],
  1157. [osmesa_bits=8])
  1158. if test "x$osmesa_bits" != x8; then
  1159. if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
  1160. AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
  1161. osmesa_bits=8
  1162. fi
  1163. fi
  1164. case "x$osmesa_bits" in
  1165. x8)
  1166. OSMESA_LIB="${OSMESA_LIB}"
  1167. ;;
  1168. x16|x32)
  1169. OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
  1170. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  1171. ;;
  1172. *)
  1173. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  1174. ;;
  1175. esac
  1176. if test "x$enable_osmesa" = xyes; then
  1177. # only link libraries with osmesa if shared
  1178. if test "$enable_static" = no; then
  1179. OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  1180. else
  1181. OSMESA_LIB_DEPS=""
  1182. fi
  1183. OSMESA_MESA_DEPS=""
  1184. OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  1185. fi
  1186. AC_SUBST([OSMESA_LIB_DEPS])
  1187. AC_SUBST([OSMESA_MESA_DEPS])
  1188. AC_SUBST([OSMESA_PC_REQ])
  1189. AC_SUBST([OSMESA_PC_LIB_PRIV])
  1190. dnl
  1191. dnl gbm configuration
  1192. dnl
  1193. if test "x$enable_gbm" = xauto; then
  1194. case "$with_egl_platforms" in
  1195. *drm*)
  1196. enable_gbm=yes ;;
  1197. *)
  1198. enable_gbm=no ;;
  1199. esac
  1200. fi
  1201. if test "x$enable_gbm" = xyes; then
  1202. SRC_DIRS="$SRC_DIRS gbm"
  1203. GBM_BACKEND_DIRS=""
  1204. PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
  1205. AC_MSG_ERROR([gbm needs udev]))
  1206. GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
  1207. if test "x$enable_dri" = xyes; then
  1208. GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
  1209. fi
  1210. fi
  1211. AC_SUBST([GBM_LIB_DEPS])
  1212. AC_SUBST([GBM_BACKEND_DIRS])
  1213. GBM_PC_REQ_PRIV="libudev"
  1214. GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
  1215. GBM_PC_CFLAGS=
  1216. AC_SUBST([GBM_PC_REQ_PRIV])
  1217. AC_SUBST([GBM_PC_LIB_PRIV])
  1218. AC_SUBST([GBM_PC_CFLAGS])
  1219. dnl
  1220. dnl EGL configuration
  1221. dnl
  1222. EGL_CLIENT_APIS=""
  1223. if test "x$enable_egl" = xyes; then
  1224. SRC_DIRS="$SRC_DIRS egl"
  1225. EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
  1226. EGL_DRIVERS_DIRS=""
  1227. AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
  1228. if test "$enable_static" != yes; then
  1229. # build egl_glx when libGL is built
  1230. if test "x$enable_glx" = xyes; then
  1231. EGL_DRIVERS_DIRS="glx"
  1232. fi
  1233. PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
  1234. [have_libudev=yes],[have_libudev=no])
  1235. if test "$have_libudev" = yes; then
  1236. DEFINES="$DEFINES -DHAVE_LIBUDEV"
  1237. fi
  1238. if test "x$enable_dri" = xyes; then
  1239. # build egl_dri2 when xcb-dri2 is available
  1240. PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
  1241. [have_xcb_dri2=yes],[have_xcb_dri2=no])
  1242. if test "$have_xcb_dri2" = yes; then
  1243. EGL_DRIVER_DRI2=dri2
  1244. DEFINES="$DEFINES -DHAVE_XCB_DRI2"
  1245. # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
  1246. AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
  1247. [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
  1248. fi
  1249. fi
  1250. EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2"
  1251. fi
  1252. fi
  1253. AC_SUBST([EGL_LIB_DEPS])
  1254. AC_SUBST([EGL_DRIVERS_DIRS])
  1255. dnl
  1256. dnl EGL Gallium configuration
  1257. dnl
  1258. if test "x$enable_gallium_egl" = xyes; then
  1259. if test "x$with_gallium_drivers" = x; then
  1260. AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
  1261. fi
  1262. if test "x$enable_egl" = xno; then
  1263. AC_MSG_ERROR([cannot enable egl_gallium without EGL])
  1264. fi
  1265. if test "x$have_libdrm" != xyes; then
  1266. AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
  1267. fi
  1268. GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
  1269. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
  1270. HAVE_ST_EGL="yes"
  1271. fi
  1272. dnl
  1273. dnl gbm Gallium configuration
  1274. dnl
  1275. if test "x$enable_gallium_gbm" = xauto; then
  1276. case "$enable_gbm$HAVE_ST_EGL$enable_dri$with_egl_platforms" in
  1277. yesyesyes*drm*)
  1278. enable_gallium_gbm=yes ;;
  1279. *)
  1280. enable_gallium_gbm=no ;;
  1281. esac
  1282. fi
  1283. if test "x$enable_gallium_gbm" = xyes; then
  1284. if test "x$with_gallium_drivers" = x; then
  1285. AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
  1286. fi
  1287. if test "x$enable_gbm" = xno; then
  1288. AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
  1289. fi
  1290. # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
  1291. if test "x$enable_dri" = xno; then
  1292. AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
  1293. fi
  1294. GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
  1295. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
  1296. HAVE_ST_GBM="yes"
  1297. fi
  1298. dnl
  1299. dnl X.Org DDX configuration
  1300. dnl
  1301. if test "x$enable_xorg" = xyes; then
  1302. PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
  1303. PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
  1304. PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
  1305. PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
  1306. HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
  1307. HAVE_XEXTPROTO_71="no")
  1308. GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
  1309. HAVE_ST_XORG=yes
  1310. fi
  1311. dnl
  1312. dnl XA configuration
  1313. dnl
  1314. if test "x$enable_xa" = xyes; then
  1315. AC_PROG_AWK
  1316. AC_PROG_GREP
  1317. AC_CHECK_PROG(NM, nm, "nm")
  1318. if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
  1319. AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
  1320. enable_xa=no
  1321. fi
  1322. fi
  1323. if test "x$enable_xa" = xyes; then
  1324. GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
  1325. HAVE_ST_XA=yes
  1326. AC_SUBST(AWK)
  1327. AC_SUBST(GREP)
  1328. AC_SUBST(NM)
  1329. fi
  1330. dnl
  1331. dnl OpenVG configuration
  1332. dnl
  1333. VG_LIB_DEPS=""
  1334. if test "x$enable_openvg" = xyes; then
  1335. if test "x$enable_egl" = xno; then
  1336. AC_MSG_ERROR([cannot enable OpenVG without EGL])
  1337. fi
  1338. if test "x$with_gallium_drivers" = x; then
  1339. AC_MSG_ERROR([cannot enable OpenVG without Gallium])
  1340. fi
  1341. if test "x$enable_gallium_egl" = xno; then
  1342. AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
  1343. fi
  1344. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
  1345. VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
  1346. CORE_DIRS="$CORE_DIRS mapi/vgapi"
  1347. GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
  1348. HAVE_ST_VEGA=yes
  1349. fi
  1350. dnl
  1351. dnl D3D1X configuration
  1352. dnl
  1353. if test "x$enable_d3d1x" = xyes; then
  1354. if test "x$with_gallium_drivers" = x; then
  1355. AC_MSG_ERROR([cannot enable D3D1X without Gallium])
  1356. fi
  1357. GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
  1358. HAVE_ST_D3D1X=yes
  1359. fi
  1360. dnl
  1361. dnl Gallium G3DVL configuration
  1362. dnl
  1363. AC_ARG_ENABLE([gallium-g3dvl],
  1364. [AS_HELP_STRING([--enable-gallium-g3dvl],
  1365. [build gallium g3dvl @<:@default=disabled@:>@])],
  1366. [enable_gallium_g3dvl="$enableval"],
  1367. [enable_gallium_g3dvl=no])
  1368. if test "x$enable_gallium_g3dvl" = xyes; then
  1369. if test "x$with_gallium_drivers" = x; then
  1370. AC_MSG_ERROR([cannot enable G3DVL without Gallium])
  1371. fi
  1372. if test "x$enable_xvmc" = xauto; then
  1373. PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
  1374. fi
  1375. if test "x$enable_vdpau" = xauto; then
  1376. PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
  1377. fi
  1378. if test "x$enable_va" = xauto; then
  1379. #don't enable vaapi state tracker even if package exists
  1380. #PKG_CHECK_EXISTS([libva], [enable_vdpau=yes], [enable_vdpau=no])
  1381. enable_va=no
  1382. fi
  1383. fi
  1384. if test "x$enable_xvmc" = xyes; then
  1385. PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 xorg-server])
  1386. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg/xvmc"
  1387. HAVE_ST_XVMC="yes"
  1388. fi
  1389. if test "x$enable_vdpau" = xyes; then
  1390. PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1])
  1391. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
  1392. HAVE_ST_VDPAU="yes"
  1393. fi
  1394. if test "x$enable_va" = xyes; then
  1395. PKG_CHECK_MODULES([LIBVA], [libva = 0.31.1])
  1396. AC_MSG_WARN([vaapi state tracker currently unmaintained])
  1397. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS va"
  1398. HAVE_ST_VA="yes"
  1399. fi
  1400. dnl
  1401. dnl GLU configuration
  1402. dnl
  1403. AC_ARG_ENABLE([glu],
  1404. [AS_HELP_STRING([--disable-glu],
  1405. [enable OpenGL Utility library @<:@default=enabled@:>@])],
  1406. [enable_glu="$enableval"],
  1407. [enable_glu=yes])
  1408. if test "x$enable_glu" = xyes; then
  1409. if test "x$enable_glx" = xno -a "x$enable_osmesa" = xno; then
  1410. AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
  1411. enable_glu=no
  1412. fi
  1413. fi
  1414. if test "x$enable_glu" = xyes; then
  1415. SRC_DIRS="$SRC_DIRS glu"
  1416. if test "x$enable_glx" = xno; then
  1417. # Link libGLU to libOSMesa instead of libGL
  1418. GLU_LIB_DEPS=""
  1419. GLU_PC_REQ="osmesa"
  1420. if test "$enable_static" = no; then
  1421. GLU_MESA_DEPS='-l$(OSMESA_LIB)'
  1422. else
  1423. GLU_MESA_DEPS=""
  1424. fi
  1425. else
  1426. # If static, empty GLU_LIB_DEPS and add libs for programs to link
  1427. GLU_PC_REQ="gl"
  1428. GLU_PC_LIB_PRIV="-lm"
  1429. if test "$enable_static" = no; then
  1430. GLU_LIB_DEPS="-lm"
  1431. GLU_MESA_DEPS='-l$(GL_LIB)'
  1432. else
  1433. GLU_LIB_DEPS=""
  1434. GLU_MESA_DEPS=""
  1435. fi
  1436. fi
  1437. fi
  1438. if test "$enable_static" = no; then
  1439. GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
  1440. fi
  1441. GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
  1442. AC_SUBST([GLU_LIB_DEPS])
  1443. AC_SUBST([GLU_MESA_DEPS])
  1444. AC_SUBST([GLU_PC_REQ])
  1445. AC_SUBST([GLU_PC_REQ_PRIV])
  1446. AC_SUBST([GLU_PC_LIB_PRIV])
  1447. AC_SUBST([GLU_PC_CFLAGS])
  1448. AC_SUBST([PROGRAM_DIRS])
  1449. dnl
  1450. dnl Gallium configuration
  1451. dnl
  1452. if test "x$with_gallium_drivers" != x; then
  1453. SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
  1454. fi
  1455. AC_SUBST([LLVM_CFLAGS])
  1456. AC_SUBST([LLVM_LIBS])
  1457. AC_SUBST([LLVM_LDFLAGS])
  1458. AC_SUBST([LLVM_VERSION])
  1459. case "x$enable_opengl$enable_gles1$enable_gles2" in
  1460. x*yes*)
  1461. EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
  1462. ;;
  1463. esac
  1464. AC_SUBST([VG_LIB_DEPS])
  1465. AC_SUBST([EGL_CLIENT_APIS])
  1466. AC_ARG_WITH([egl-platforms],
  1467. [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
  1468. [comma delimited native platforms libEGL supports, e.g.
  1469. "x11,drm" @<:@default=auto@:>@])],
  1470. [with_egl_platforms="$withval"],
  1471. [with_egl_platforms=yes])
  1472. EGL_PLATFORMS=""
  1473. WAYLAND_EGL_LIB_DEPS=""
  1474. case "$with_egl_platforms" in
  1475. yes)
  1476. if test "x$enable_egl" = xyes; then
  1477. EGL_PLATFORMS="x11"
  1478. fi
  1479. ;;
  1480. *)
  1481. if test "x$enable_egl" != xyes; then
  1482. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1483. fi
  1484. # verify the requested driver directories exist
  1485. egl_platforms=`IFS=', '; echo $with_egl_platforms`
  1486. for plat in $egl_platforms; do
  1487. test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
  1488. AC_MSG_ERROR([EGL platform '$plat' doesn't exist])
  1489. if test "$plat" = "fbdev"; then
  1490. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
  1491. fi
  1492. if test "$plat" = "null"; then
  1493. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
  1494. fi
  1495. if test "$plat" = "wayland"; then
  1496. PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
  1497. [AC_MSG_ERROR([cannot find libwayland-client])])
  1498. WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
  1499. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
  1500. fi
  1501. if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
  1502. AC_MSG_ERROR([EGL platform drm needs gbm])
  1503. fi
  1504. case "$plat$have_libudev" in
  1505. waylandno|drmno)
  1506. AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
  1507. esac
  1508. done
  1509. EGL_PLATFORMS="$egl_platforms"
  1510. ;;
  1511. esac
  1512. AC_SUBST([EGL_PLATFORMS])
  1513. AC_SUBST([WAYLAND_EGL_LIB_DEPS])
  1514. WAYLAND_EGL_PC_REQ_PRIV="wayland-client libdrm"
  1515. WAYLAND_EGL_PC_LIB_PRIV=
  1516. WAYLAND_EGL_PC_CFLAGS=
  1517. AC_SUBST([WAYLAND_EGL_PC_REQ_PRIV])
  1518. AC_SUBST([WAYLAND_EGL_PC_LIB_PRIV])
  1519. AC_SUBST([WAYLAND_EGL_PC_CFLAGS])
  1520. AC_ARG_WITH([egl-driver-dir],
  1521. [AS_HELP_STRING([--with-egl-driver-dir=DIR],
  1522. [directory for EGL drivers [[default=${libdir}/egl]]])],
  1523. [EGL_DRIVER_INSTALL_DIR="$withval"],
  1524. [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
  1525. AC_SUBST([EGL_DRIVER_INSTALL_DIR])
  1526. AC_ARG_WITH([xorg-driver-dir],
  1527. [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
  1528. [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
  1529. [XORG_DRIVER_INSTALL_DIR="$withval"],
  1530. [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
  1531. AC_SUBST([XORG_DRIVER_INSTALL_DIR])
  1532. AC_ARG_WITH([max-width],
  1533. [AS_HELP_STRING([--with-max-width=N],
  1534. [Maximum framebuffer width (4096)])],
  1535. [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
  1536. AS_IF([test "${withval}" -gt "4096"],
  1537. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1538. )
  1539. AC_ARG_WITH([max-height],
  1540. [AS_HELP_STRING([--with-max-height=N],
  1541. [Maximum framebuffer height (4096)])],
  1542. [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
  1543. AS_IF([test "${withval}" -gt "4096"],
  1544. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1545. )
  1546. dnl
  1547. dnl Gallium LLVM
  1548. dnl
  1549. AC_ARG_ENABLE([gallium-llvm],
  1550. [AS_HELP_STRING([--enable-gallium-llvm],
  1551. [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
  1552. [enable_gallium_llvm="$enableval"],
  1553. [enable_gallium_llvm=auto])
  1554. if test "x$with_gallium_drivers" = x; then
  1555. enable_gallium_llvm=no
  1556. fi
  1557. if test "x$enable_gallium_llvm" = xauto; then
  1558. case "$host_cpu" in
  1559. i*86|x86_64) enable_gallium_llvm=yes;;
  1560. esac
  1561. fi
  1562. if test "x$enable_gallium_llvm" = xyes; then
  1563. AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
  1564. if test "x$LLVM_CONFIG" != xno; then
  1565. LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
  1566. LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g'`
  1567. LLVM_LIBS="`$LLVM_CONFIG --libs`"
  1568. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  1569. DEFINES="$DEFINES -D__STDC_CONSTANT_MACROS"
  1570. MESA_LLVM=1
  1571. else
  1572. MESA_LLVM=0
  1573. fi
  1574. else
  1575. MESA_LLVM=0
  1576. fi
  1577. dnl Directory for VDPAU libs
  1578. AC_ARG_WITH([vdpau-libdir],
  1579. [AS_HELP_STRING([--with-vdpau-libdir=DIR],
  1580. [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
  1581. [VDPAU_LIB_INSTALL_DIR="$withval"],
  1582. [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
  1583. AC_SUBST([VDPAU_LIB_INSTALL_DIR])
  1584. dnl Directory for VA libs
  1585. AC_ARG_WITH([va-libdir],
  1586. [AS_HELP_STRING([--with-va-libdir=DIR],
  1587. [directory for the VA libraries @<:@default=${libdir}/va@:>@])],
  1588. [VA_LIB_INSTALL_DIR="$withval"],
  1589. [VA_LIB_INSTALL_DIR='${libdir}/va'])
  1590. AC_SUBST([VA_LIB_INSTALL_DIR])
  1591. dnl
  1592. dnl Gallium helper functions
  1593. dnl
  1594. gallium_check_st() {
  1595. if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
  1596. test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
  1597. test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then
  1598. if test "x$have_libdrm" != xyes; then
  1599. AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
  1600. fi
  1601. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
  1602. fi
  1603. if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
  1604. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
  1605. fi
  1606. if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
  1607. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
  1608. fi
  1609. if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then
  1610. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
  1611. fi
  1612. if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
  1613. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
  1614. NEED_G3DVL_DRI="yes"
  1615. fi
  1616. if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
  1617. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
  1618. NEED_G3DVL_DRI="yes"
  1619. fi
  1620. if test "x$HAVE_ST_VA" = xyes && test "x$7" != x; then
  1621. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7"
  1622. NEED_G3DVL_DRI="yes"
  1623. fi
  1624. }
  1625. gallium_require_llvm() {
  1626. if test "x$MESA_LLVM" = x0; then
  1627. case "$host_cpu" in
  1628. i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
  1629. esac
  1630. fi
  1631. }
  1632. dnl Gallium drivers
  1633. dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
  1634. if test "x$with_gallium_drivers" != x; then
  1635. gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
  1636. for driver in $gallium_drivers; do
  1637. case "x$driver" in
  1638. xsvga)
  1639. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
  1640. gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
  1641. ;;
  1642. xi915)
  1643. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
  1644. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
  1645. if test "x$MESA_LLVM" = x1; then
  1646. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1647. fi
  1648. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
  1649. gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
  1650. ;;
  1651. xr300)
  1652. gallium_require_llvm "Gallium R300"
  1653. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1654. gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300" "va-r300"
  1655. ;;
  1656. xr600)
  1657. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
  1658. gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
  1659. ;;
  1660. xnouveau)
  1661. PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
  1662. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
  1663. gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
  1664. ;;
  1665. xswrast)
  1666. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
  1667. if test "x$MESA_LLVM" = x1; then
  1668. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
  1669. fi
  1670. if test "x$HAVE_ST_DRI" = xyes; then
  1671. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
  1672. fi
  1673. if test "x$HAVE_ST_VDPAU" = xyes; then
  1674. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
  1675. fi
  1676. if test "x$HAVE_ST_XVMC" = xyes; then
  1677. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
  1678. fi
  1679. if test "x$HAVE_ST_VA" = xyes; then
  1680. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS va-softpipe"
  1681. fi
  1682. if test "x$HAVE_ST_VDPAU" = xyes ||
  1683. test "x$HAVE_ST_XVMC" = xyes ||
  1684. test "x$HAVE_ST_VA" = xyes; then
  1685. if test "x$HAVE_WINSYS_XLIB" != xyes; then
  1686. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  1687. fi
  1688. fi
  1689. ;;
  1690. *)
  1691. AC_MSG_ERROR([Unknown Gallium driver: $driver])
  1692. ;;
  1693. esac
  1694. done
  1695. fi
  1696. if test "x$NEED_G3DVL_DRI" = xyes; then
  1697. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS g3dvl/dri"
  1698. fi
  1699. dnl prepend CORE_DIRS to SRC_DIRS
  1700. SRC_DIRS="$CORE_DIRS $SRC_DIRS"
  1701. dnl Restore LDFLAGS and CPPFLAGS
  1702. LDFLAGS="$_SAVE_LDFLAGS"
  1703. CPPFLAGS="$_SAVE_CPPFLAGS"
  1704. dnl Add user CFLAGS and CXXFLAGS
  1705. CFLAGS="$CFLAGS $USER_CFLAGS"
  1706. CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
  1707. dnl Substitute the config
  1708. AC_CONFIG_FILES([configs/autoconf
  1709. src/mesa/drivers/dri/i965/Makefile
  1710. tests/Makefile
  1711. tests/glx/Makefile])
  1712. dnl Replace the configs/current symlink
  1713. AC_CONFIG_COMMANDS([configs],[
  1714. if test -f configs/current || test -L configs/current; then
  1715. rm -f configs/current
  1716. fi
  1717. ln -s autoconf configs/current
  1718. ])
  1719. dnl Sort the dirs alphabetically
  1720. GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1721. GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1722. GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1723. GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
  1724. AC_OUTPUT
  1725. dnl
  1726. dnl Output some configuration info for the user
  1727. dnl
  1728. echo ""
  1729. echo " prefix: $prefix"
  1730. echo " exec_prefix: $exec_prefix"
  1731. echo " libdir: $libdir"
  1732. echo " includedir: $includedir"
  1733. dnl API info
  1734. echo ""
  1735. echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
  1736. echo " OpenVG: $enable_openvg"
  1737. dnl Driver info
  1738. echo ""
  1739. if test "x$enable_osmesa" != xno; then
  1740. echo " OSMesa: lib$OSMESA_LIB"
  1741. else
  1742. echo " OSMesa: no"
  1743. fi
  1744. if test "x$enable_dri" != xno; then
  1745. # cleanup the drivers var
  1746. dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1747. if test "x$DRI_DIRS" = x; then
  1748. echo " DRI drivers: no"
  1749. else
  1750. echo " DRI drivers: $dri_dirs"
  1751. fi
  1752. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1753. fi
  1754. case "x$enable_glx$enable_xlib_glx" in
  1755. xyesyes)
  1756. echo " GLX: Xlib-based"
  1757. ;;
  1758. xyesno)
  1759. echo " GLX: DRI-based"
  1760. ;;
  1761. *)
  1762. echo " GLX: $enable_glx"
  1763. ;;
  1764. esac
  1765. echo ""
  1766. echo " GLU: $enable_glu"
  1767. dnl EGL
  1768. echo ""
  1769. echo " EGL: $enable_egl"
  1770. if test "$enable_egl" = yes; then
  1771. echo " EGL platforms: $EGL_PLATFORMS"
  1772. egl_drivers=""
  1773. for d in $EGL_DRIVERS_DIRS; do
  1774. egl_drivers="$egl_drivers builtin:egl_$d"
  1775. done
  1776. if test "x$HAVE_ST_EGL" = xyes; then
  1777. echo " EGL drivers: ${egl_drivers} egl_gallium"
  1778. echo " EGL Gallium STs:$EGL_CLIENT_APIS"
  1779. else
  1780. echo " EGL drivers: $egl_drivers"
  1781. fi
  1782. fi
  1783. echo ""
  1784. if test "x$MESA_LLVM" = x1; then
  1785. echo " llvm: yes"
  1786. echo " llvm-config: $LLVM_CONFIG"
  1787. echo " llvm-version: $LLVM_VERSION"
  1788. else
  1789. echo " llvm: no"
  1790. fi
  1791. echo ""
  1792. if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
  1793. echo " Gallium: yes"
  1794. echo " Gallium dirs: $GALLIUM_DIRS"
  1795. echo " Target dirs: $GALLIUM_TARGET_DIRS"
  1796. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  1797. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  1798. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  1799. else
  1800. echo " Gallium: no"
  1801. fi
  1802. dnl Libraries
  1803. echo ""
  1804. echo " Shared libs: $enable_shared"
  1805. echo " Static libs: $enable_static"
  1806. dnl Compiler options
  1807. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  1808. cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1809. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1810. cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1811. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1812. defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1813. echo ""
  1814. echo " CFLAGS: $cflags"
  1815. echo " CXXFLAGS: $cxxflags"
  1816. echo " Macros: $defines"
  1817. echo ""
  1818. echo " PYTHON2: $PYTHON2"
  1819. echo ""
  1820. echo " Run '${MAKE-make}' to build Mesa"
  1821. echo ""