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

configure.ac 48KB

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