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.

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