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

configure.ac 58KB

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