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 61KB

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