Clone of mesa.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

configure.ac 35KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  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'])])
  6. m4_ifval(mesa_version,[],[
  7. m4_errprint([Error: Failed to get the Mesa version from the output of
  8. running `make -f bin/version.mk version'
  9. ])
  10. m4_exit([1])
  11. ])
  12. dnl Tell the user about autoconf.html in the --help output
  13. m4_divert_once([HELP_END], [
  14. See docs/autoconf.html for more details on the options for Mesa.])
  15. AC_INIT([Mesa],[mesa_version],
  16. [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
  17. AC_CONFIG_AUX_DIR([bin])
  18. AC_CANONICAL_HOST
  19. dnl Versions for external dependencies
  20. LIBDRM_REQUIRED=2.4.3
  21. DRI2PROTO_REQUIRED=1.99.3
  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 We need a POSIX shell for parts of the build. Assume we have one
  30. dnl in most cases.
  31. case "$host_os" in
  32. solaris*)
  33. # Solaris /bin/sh is too old/non-POSIX compliant
  34. AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
  35. SHELL="$POSIX_SHELL"
  36. ;;
  37. esac
  38. MKDEP_OPTIONS=-fdepend
  39. dnl Ask gcc where it's keeping its secret headers
  40. if test "x$GCC" = xyes; then
  41. for dir in include include-fixed; do
  42. GCC_INCLUDES=`$CC -print-file-name=$dir`
  43. if test "x$GCC_INCLUDES" != x && \
  44. test "$GCC_INCLUDES" != "$dir" && \
  45. test -d "$GCC_INCLUDES"; then
  46. MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
  47. fi
  48. done
  49. fi
  50. AC_SUBST([MKDEP_OPTIONS])
  51. dnl Make sure the pkg-config macros are defined
  52. m4_ifdef([PKG_PROG_PKG_CONFIG],[],[
  53. m4_errprint([Error: Could not locate the pkg-config autoconf macros.
  54. These are usually located in /usr/share/aclocal/pkg.m4. If your
  55. macros are in a different location, try setting the environment
  56. variable ACLOCAL="aclocal -I/other/macro/dir" before running
  57. autoreconf.
  58. ])
  59. m4_exit([1])
  60. ])
  61. PKG_PROG_PKG_CONFIG()
  62. dnl LIB_DIR - library basename
  63. LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
  64. AC_SUBST([LIB_DIR])
  65. dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
  66. _SAVE_LDFLAGS="$LDFLAGS"
  67. AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
  68. AC_SUBST([EXTRA_LIB_PATH])
  69. dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
  70. _SAVE_CPPFLAGS="$CPPFLAGS"
  71. AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
  72. AC_SUBST([X11_INCLUDES])
  73. dnl Compiler macros
  74. DEFINES=""
  75. AC_SUBST([DEFINES])
  76. case "$host_os" in
  77. *-gnu*)
  78. DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
  79. ;;
  80. solaris*)
  81. DEFINES="$DEFINES -DPTHREADS -DSVR4"
  82. ;;
  83. esac
  84. dnl Add flags for gcc and g++
  85. if test "x$GCC" = xyes; then
  86. CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
  87. # Work around aliasing bugs - developers should comment this out
  88. CFLAGS="$CFLAGS -fno-strict-aliasing"
  89. fi
  90. if test "x$GXX" = xyes; then
  91. CXXFLAGS="$CXXFLAGS -Wall"
  92. # Work around aliasing bugs - developers should comment this out
  93. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  94. fi
  95. dnl These should be unnecessary, but let the user set them if they want
  96. AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
  97. Default is to use CFLAGS.])
  98. AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
  99. compiler. Default is to use CFLAGS.])
  100. AC_SUBST([OPT_FLAGS])
  101. AC_SUBST([ARCH_FLAGS])
  102. dnl
  103. dnl Hacks to enable 32 or 64 bit build
  104. dnl
  105. AC_ARG_ENABLE([32-bit],
  106. [AS_HELP_STRING([--enable-32-bit],
  107. [build 32-bit libraries @<:@default=auto@:>@])],
  108. [enable_32bit="$enableval"],
  109. [enable_32bit=auto]
  110. )
  111. if test "x$enable_32bit" = xyes; then
  112. if test "x$GCC" = xyes; then
  113. CFLAGS="$CFLAGS -m32"
  114. fi
  115. if test "x$GXX" = xyes; then
  116. CXXFLAGS="$CXXFLAGS -m32"
  117. fi
  118. fi
  119. AC_ARG_ENABLE([64-bit],
  120. [AS_HELP_STRING([--enable-64-bit],
  121. [build 64-bit libraries @<:@default=auto@:>@])],
  122. [enable_64bit="$enableval"],
  123. [enable_64bit=auto]
  124. )
  125. if test "x$enable_64bit" = xyes; then
  126. if test "x$GCC" = xyes; then
  127. CFLAGS="$CFLAGS -m64"
  128. fi
  129. if test "x$GXX" = xyes; then
  130. CXXFLAGS="$CXXFLAGS -m64"
  131. fi
  132. fi
  133. dnl
  134. dnl shared/static libraries, mimic libtool options
  135. dnl
  136. AC_ARG_ENABLE([static],
  137. [AS_HELP_STRING([--enable-static],
  138. [build static libraries @<:@default=disabled@:>@])],
  139. [enable_static="$enableval"],
  140. [enable_static=no]
  141. )
  142. case "x$enable_static" in
  143. xyes|xno ) ;;
  144. x ) enable_static=no ;;
  145. * )
  146. AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
  147. ;;
  148. esac
  149. AC_ARG_ENABLE([shared],
  150. [AS_HELP_STRING([--disable-shared],
  151. [build shared libraries @<:@default=enabled@:>@])],
  152. [enable_shared="$enableval"],
  153. [enable_shared=yes]
  154. )
  155. case "x$enable_shared" in
  156. xyes|xno ) ;;
  157. x ) enable_shared=yes ;;
  158. * )
  159. AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
  160. ;;
  161. esac
  162. dnl Can't have static and shared libraries, default to static if user
  163. dnl explicitly requested. If both disabled, set to static since shared
  164. dnl was explicitly requirested.
  165. case "x$enable_static$enable_shared" in
  166. xyesyes )
  167. AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
  168. enable_shared=no
  169. ;;
  170. xnono )
  171. AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
  172. enable_static=yes
  173. ;;
  174. esac
  175. dnl
  176. dnl mklib options
  177. dnl
  178. AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
  179. if test "$enable_static" = yes; then
  180. MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
  181. fi
  182. AC_SUBST([MKLIB_OPTIONS])
  183. dnl
  184. dnl other compiler options
  185. dnl
  186. AC_ARG_ENABLE([debug],
  187. [AS_HELP_STRING([--enable-debug],
  188. [use debug compiler flags and macros @<:@default=disabled@:>@])],
  189. [enable_debug="$enableval"],
  190. [enable_debug=no]
  191. )
  192. if test "x$enable_debug" = xyes; then
  193. DEFINES="$DEFINES -DDEBUG"
  194. if test "x$GCC" = xyes; then
  195. CFLAGS="$CFLAGS -g"
  196. fi
  197. if test "x$GXX" = xyes; then
  198. CXXFLAGS="$CXXFLAGS -g"
  199. fi
  200. fi
  201. dnl
  202. dnl library names
  203. dnl
  204. if test "$enable_static" = yes; then
  205. LIB_EXTENSION='a'
  206. else
  207. case "$host_os" in
  208. darwin* )
  209. LIB_EXTENSION='dylib' ;;
  210. * )
  211. LIB_EXTENSION='so' ;;
  212. esac
  213. fi
  214. GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
  215. GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
  216. GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
  217. GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
  218. OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
  219. GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
  220. GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
  221. GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
  222. GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
  223. OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
  224. AC_SUBST([GL_LIB_NAME])
  225. AC_SUBST([GLU_LIB_NAME])
  226. AC_SUBST([GLUT_LIB_NAME])
  227. AC_SUBST([GLW_LIB_NAME])
  228. AC_SUBST([OSMESA_LIB_NAME])
  229. AC_SUBST([GL_LIB_GLOB])
  230. AC_SUBST([GLU_LIB_GLOB])
  231. AC_SUBST([GLUT_LIB_GLOB])
  232. AC_SUBST([GLW_LIB_GLOB])
  233. AC_SUBST([OSMESA_LIB_GLOB])
  234. dnl
  235. dnl Arch/platform-specific settings
  236. dnl
  237. AC_ARG_ENABLE([asm],
  238. [AS_HELP_STRING([--disable-asm],
  239. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  240. [enable_asm="$enableval"],
  241. [enable_asm=yes]
  242. )
  243. asm_arch=""
  244. ASM_FLAGS=""
  245. MESA_ASM_SOURCES=""
  246. GLAPI_ASM_SOURCES=""
  247. AC_MSG_CHECKING([whether to enable assembly])
  248. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  249. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  250. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  251. case "$host_cpu" in
  252. i?86 | x86_64)
  253. enable_asm=no
  254. AC_MSG_RESULT([no, cross compiling])
  255. ;;
  256. esac
  257. fi
  258. # check for supported arches
  259. if test "x$enable_asm" = xyes; then
  260. case "$host_cpu" in
  261. i?86)
  262. case "$host_os" in
  263. linux* | *freebsd* | dragonfly*)
  264. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  265. ;;
  266. esac
  267. ;;
  268. x86_64)
  269. case "$host_os" in
  270. linux* | *freebsd* | dragonfly*)
  271. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  272. ;;
  273. esac
  274. ;;
  275. powerpc)
  276. case "$host_os" in
  277. linux*)
  278. asm_arch=ppc
  279. ;;
  280. esac
  281. ;;
  282. esac
  283. case "$asm_arch" in
  284. x86)
  285. ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  286. MESA_ASM_SOURCES='$(X86_SOURCES)'
  287. GLAPI_ASM_SOURCES='$(X86_API)'
  288. AC_MSG_RESULT([yes, x86])
  289. ;;
  290. x86_64)
  291. ASM_FLAGS="-DUSE_X86_64_ASM"
  292. MESA_ASM_SOURCES='$(X86-64_SOURCES)'
  293. GLAPI_ASM_SOURCES='$(X86-64_API)'
  294. AC_MSG_RESULT([yes, x86_64])
  295. ;;
  296. ppc)
  297. ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
  298. MESA_ASM_SOURCES='$(PPC_SOURCES)'
  299. AC_MSG_RESULT([yes, ppc])
  300. ;;
  301. *)
  302. AC_MSG_RESULT([no, platform not supported])
  303. ;;
  304. esac
  305. fi
  306. AC_SUBST([ASM_FLAGS])
  307. AC_SUBST([MESA_ASM_SOURCES])
  308. AC_SUBST([GLAPI_ASM_SOURCES])
  309. dnl PIC code macro
  310. MESA_PIC_FLAGS
  311. dnl Check to see if dlopen is in default libraries (like Solaris, which
  312. dnl has it in libc), or if libdl is needed to get it.
  313. AC_CHECK_FUNC([dlopen], [],
  314. [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
  315. dnl See if posix_memalign is available
  316. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  317. dnl SELinux awareness.
  318. AC_ARG_ENABLE([selinux],
  319. [AS_HELP_STRING([--enable-selinux],
  320. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  321. [MESA_SELINUX="$enableval"],
  322. [MESA_SELINUX=no])
  323. if test "x$enable_selinux" = "xyes"; then
  324. AC_CHECK_HEADER([selinux/selinux.h],[],
  325. [AC_MSG_ERROR([SELinux headers not found])])
  326. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  327. [AC_MSG_ERROR([SELinux library not found])])
  328. SELINUX_LIBS="-lselinux"
  329. DEFINES="$DEFINES -DMESA_SELINUX"
  330. fi
  331. dnl OS-specific libraries
  332. OS_LIBS=""
  333. case "$host_os" in
  334. solaris*)
  335. OS_LIBS="-lc"
  336. if test "x$GXX" != xyes; then
  337. OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS"
  338. fi
  339. ;;
  340. esac
  341. dnl
  342. dnl Driver configuration. Options are xlib, dri and osmesa right now.
  343. dnl More later: directfb, fbdev, ...
  344. dnl
  345. default_driver="xlib"
  346. case "$host_os" in
  347. linux*)
  348. case "$host_cpu" in
  349. i*86|x86_64|powerpc*) default_driver="dri";;
  350. esac
  351. ;;
  352. *freebsd* | dragonfly*)
  353. case "$host_cpu" in
  354. i*86|x86_64) default_driver="dri";;
  355. esac
  356. ;;
  357. esac
  358. AC_ARG_WITH([driver],
  359. [AS_HELP_STRING([--with-driver=DRIVER],
  360. [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
  361. [mesa_driver="$withval"],
  362. [mesa_driver="$default_driver"])
  363. dnl Check for valid option
  364. case "x$mesa_driver" in
  365. xxlib|xdri|xosmesa)
  366. ;;
  367. *)
  368. AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
  369. ;;
  370. esac
  371. dnl
  372. dnl Driver specific build directories
  373. dnl
  374. SRC_DIRS="mesa egl glew"
  375. GLU_DIRS="sgi"
  376. WINDOW_SYSTEM=""
  377. GALLIUM_DIRS="auxiliary drivers state_trackers"
  378. GALLIUM_WINSYS_DIRS=""
  379. GALLIUM_WINSYS_DRM_DIRS=""
  380. GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
  381. GALLIUM_DRIVERS_DIRS="softpipe failover trace"
  382. GALLIUM_STATE_TRACKERS_DIRS=""
  383. case "$mesa_driver" in
  384. xlib)
  385. DRIVER_DIRS="x11"
  386. ;;
  387. dri)
  388. SRC_DIRS="glx/x11 $SRC_DIRS"
  389. DRIVER_DIRS="dri"
  390. WINDOW_SYSTEM="dri"
  391. GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
  392. ;;
  393. osmesa)
  394. DRIVER_DIRS="osmesa"
  395. ;;
  396. esac
  397. AC_SUBST([SRC_DIRS])
  398. AC_SUBST([GLU_DIRS])
  399. AC_SUBST([DRIVER_DIRS])
  400. AC_SUBST([WINDOW_SYSTEM])
  401. AC_SUBST([GALLIUM_DIRS])
  402. AC_SUBST([GALLIUM_WINSYS_DIRS])
  403. AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
  404. AC_SUBST([GALLIUM_DRIVERS_DIRS])
  405. AC_SUBST([GALLIUM_AUXILIARY_DIRS])
  406. AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
  407. dnl
  408. dnl User supplied program configuration
  409. dnl
  410. if test -d "$srcdir/progs/demos"; then
  411. default_demos=yes
  412. else
  413. default_demos=no
  414. fi
  415. AC_ARG_WITH([demos],
  416. [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
  417. [optional comma delimited demo directories to build
  418. @<:@default=auto if source available@:>@])],
  419. [with_demos="$withval"],
  420. [with_demos="$default_demos"])
  421. if test "x$with_demos" = x; then
  422. with_demos=no
  423. fi
  424. dnl If $with_demos is yes, directories will be added as libs available
  425. PROGRAM_DIRS=""
  426. case "$with_demos" in
  427. no) ;;
  428. yes)
  429. # If the driver isn't osmesa, we have libGL and can build xdemos
  430. if test "$mesa_driver" != osmesa; then
  431. PROGRAM_DIRS="xdemos"
  432. fi
  433. ;;
  434. *)
  435. # verify the requested demos directories exist
  436. demos=`IFS=,; echo $with_demos`
  437. for demo in $demos; do
  438. test -d "$srcdir/progs/$demo" || \
  439. AC_MSG_ERROR([Program directory '$demo' doesn't exist])
  440. done
  441. PROGRAM_DIRS="$demos"
  442. ;;
  443. esac
  444. dnl
  445. dnl Find out if X is available. The variable have_x is set if libX11 is
  446. dnl found to mimic AC_PATH_XTRA.
  447. dnl
  448. if test -n "$PKG_CONFIG"; then
  449. AC_MSG_CHECKING([pkg-config files for X11 are available])
  450. PKG_CHECK_EXISTS([x11],[
  451. x11_pkgconfig=yes
  452. have_x=yes
  453. ],[
  454. x11_pkgconfig=no
  455. ])
  456. AC_MSG_RESULT([$x11_pkgconfig])
  457. else
  458. x11_pkgconfig=no
  459. fi
  460. dnl Use the autoconf macro if no pkg-config files
  461. if test "$x11_pkgconfig" = no; then
  462. AC_PATH_XTRA
  463. fi
  464. dnl Try to tell the user that the --x-* options are only used when
  465. dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
  466. m4_divert_once([HELP_BEGIN],
  467. [These options are only used when the X libraries cannot be found by the
  468. pkg-config utility.])
  469. dnl We need X for xlib and dri, so bomb now if it's not found
  470. case "$mesa_driver" in
  471. xlib|dri)
  472. if test "$no_x" = yes; then
  473. AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
  474. fi
  475. ;;
  476. esac
  477. dnl XCB - this is only used for GLX right now
  478. AC_ARG_ENABLE([xcb],
  479. [AS_HELP_STRING([--enable-xcb],
  480. [use XCB for GLX @<:@default=disabled@:>@])],
  481. [enable_xcb="$enableval"],
  482. [enable_xcb=no])
  483. if test "x$enable_xcb" = xyes; then
  484. DEFINES="$DEFINES -DUSE_XCB"
  485. else
  486. enable_xcb=no
  487. fi
  488. dnl
  489. dnl libGL configuration per driver
  490. dnl
  491. case "$mesa_driver" in
  492. xlib)
  493. if test "$x11_pkgconfig" = yes; then
  494. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  495. GL_PC_REQ_PRIV="x11 xext"
  496. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  497. GL_LIB_DEPS="$XLIBGL_LIBS"
  498. else
  499. # should check these...
  500. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  501. GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
  502. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  503. GL_PC_CFLAGS="$X11_INCLUDES"
  504. fi
  505. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
  506. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $OS_LIBS"
  507. # if static, move the external libraries to the programs
  508. # and empty the libraries for libGL
  509. if test "$enable_static" = yes; then
  510. APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
  511. GL_LIB_DEPS=""
  512. fi
  513. ;;
  514. dri)
  515. # DRI must be shared, I think
  516. if test "$enable_static" = yes; then
  517. AC_MSG_ERROR([Can't use static libraries for DRI drivers])
  518. fi
  519. # Check for libdrm
  520. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
  521. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  522. GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
  523. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  524. # find the DRI deps for libGL
  525. if test "$x11_pkgconfig" = yes; then
  526. # add xcb modules if necessary
  527. dri_modules="x11 xext xxf86vm xdamage xfixes"
  528. if test "$enable_xcb" = yes; then
  529. dri_modules="$dri_modules x11-xcb xcb-glx"
  530. fi
  531. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  532. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  533. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  534. GL_LIB_DEPS="$DRIGL_LIBS"
  535. else
  536. # should check these...
  537. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  538. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
  539. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  540. GL_PC_CFLAGS="$X11_INCLUDES"
  541. # XCB can only be used from pkg-config
  542. if test "$enable_xcb" = yes; then
  543. PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
  544. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
  545. X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
  546. GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
  547. fi
  548. fi
  549. # need DRM libs, -lpthread, etc.
  550. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
  551. GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS $OS_LIBS"
  552. ;;
  553. osmesa)
  554. # No libGL for osmesa
  555. GL_LIB_DEPS="$OS_LIBS"
  556. ;;
  557. esac
  558. AC_SUBST([GL_LIB_DEPS])
  559. AC_SUBST([GL_PC_REQ_PRIV])
  560. AC_SUBST([GL_PC_LIB_PRIV])
  561. AC_SUBST([GL_PC_CFLAGS])
  562. AC_SUBST([DRI_PC_REQ_PRIV])
  563. dnl
  564. dnl More X11 setup
  565. dnl
  566. if test "$mesa_driver" = xlib; then
  567. DEFINES="$DEFINES -DUSE_XSHM"
  568. fi
  569. dnl
  570. dnl More DRI setup
  571. dnl
  572. AC_ARG_ENABLE([glx-tls],
  573. [AS_HELP_STRING([--enable-glx-tls],
  574. [enable TLS support in GLX @<:@default=disabled@:>@])],
  575. [GLX_USE_TLS="$enableval"],
  576. [GLX_USE_TLS=no])
  577. dnl Directory for DRI drivers
  578. AC_ARG_WITH([dri-driverdir],
  579. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  580. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  581. [DRI_DRIVER_INSTALL_DIR="$withval"],
  582. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  583. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  584. dnl Direct rendering or just indirect rendering
  585. AC_ARG_ENABLE([driglx-direct],
  586. [AS_HELP_STRING([--disable-driglx-direct],
  587. [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
  588. [driglx_direct="$enableval"],
  589. [driglx_direct="yes"])
  590. dnl Which drivers to build - default is chosen by platform
  591. AC_ARG_WITH([dri-drivers],
  592. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  593. [comma delimited DRI drivers list, e.g.
  594. "swrast,i965,radeon,nouveau" @<:@default=auto@:>@])],
  595. [with_dri_drivers="$withval"],
  596. [with_dri_drivers=yes])
  597. if test "x$with_dri_drivers" = x; then
  598. with_dri_drivers=no
  599. fi
  600. dnl If $with_dri_drivers is yes, directories will be added through
  601. dnl platform checks
  602. DRI_DIRS=""
  603. case "$with_dri_drivers" in
  604. no) ;;
  605. yes)
  606. DRI_DIRS="yes"
  607. ;;
  608. *)
  609. # verify the requested driver directories exist
  610. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  611. for driver in $dri_drivers; do
  612. test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
  613. AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
  614. done
  615. DRI_DIRS="$dri_drivers"
  616. ;;
  617. esac
  618. dnl Just default to no EGL for now
  619. USING_EGL=0
  620. AC_SUBST([USING_EGL])
  621. dnl Set DRI_DIRS, DEFINES and LIB_DEPS
  622. if test "$mesa_driver" = dri; then
  623. # Use TLS in GLX?
  624. if test "x$GLX_USE_TLS" = xyes; then
  625. DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
  626. fi
  627. if test "x$USING_EGL" = x1; then
  628. PROGRAM_DIRS="egl"
  629. fi
  630. # Platform specific settings and drivers to build
  631. case "$host_os" in
  632. linux*)
  633. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  634. if test "x$driglx_direct" = xyes; then
  635. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  636. fi
  637. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
  638. case "$host_cpu" in
  639. x86_64)
  640. # ffb, gamma, and sis are missing because they have not be
  641. # converted to use the new interface. i810 are missing
  642. # because there is no x86-64 system where they could *ever*
  643. # be used.
  644. if test "x$DRI_DIRS" = "xyes"; then
  645. DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
  646. savage tdfx unichrome swrast"
  647. fi
  648. ;;
  649. powerpc*)
  650. # Build only the drivers for cards that exist on PowerPC.
  651. # At some point MGA will be added, but not yet.
  652. if test "x$DRI_DIRS" = "xyes"; then
  653. DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast"
  654. fi
  655. ;;
  656. sparc*)
  657. # Build only the drivers for cards that exist on sparc`
  658. if test "x$DRI_DIRS" = "xyes"; then
  659. DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast"
  660. fi
  661. ;;
  662. esac
  663. ;;
  664. freebsd* | dragonfly*)
  665. DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
  666. DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
  667. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  668. if test "x$driglx_direct" = xyes; then
  669. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  670. fi
  671. if test "x$GXX" = xyes; then
  672. CXXFLAGS="$CXXFLAGS -ansi -pedantic"
  673. fi
  674. # ffb and gamma are missing because they have not been converted
  675. # to use the new interface.
  676. if test "x$DRI_DIRS" = "xyes"; then
  677. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
  678. unichrome savage sis swrast"
  679. fi
  680. ;;
  681. solaris*)
  682. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  683. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  684. if test "x$driglx_direct" = xyes; then
  685. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  686. fi
  687. ;;
  688. esac
  689. # default drivers
  690. if test "x$DRI_DIRS" = "xyes"; then
  691. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
  692. savage sis tdfx trident unichrome ffb swrast"
  693. fi
  694. DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
  695. # Check for expat
  696. EXPAT_INCLUDES=""
  697. EXPAT_LIB=-lexpat
  698. AC_ARG_WITH([expat],
  699. [AS_HELP_STRING([--with-expat=DIR],
  700. [expat install directory])],[
  701. EXPAT_INCLUDES="-I$withval/include"
  702. CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
  703. LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
  704. EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
  705. ])
  706. AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
  707. AC_CHECK_LIB([expat],[XML_ParserCreate],[],
  708. [AC_MSG_ERROR([Expat required for DRI.])])
  709. # put all the necessary libs together
  710. DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
  711. fi
  712. AC_SUBST([DRI_DIRS])
  713. AC_SUBST([EXPAT_INCLUDES])
  714. AC_SUBST([DRI_LIB_DEPS])
  715. dnl
  716. dnl OSMesa configuration
  717. dnl
  718. if test "$mesa_driver" = xlib; then
  719. default_gl_osmesa=yes
  720. else
  721. default_gl_osmesa=no
  722. fi
  723. AC_ARG_ENABLE([gl-osmesa],
  724. [AS_HELP_STRING([--enable-gl-osmesa],
  725. [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
  726. [gl_osmesa="$enableval"],
  727. [gl_osmesa="$default_gl_osmesa"])
  728. if test "x$gl_osmesa" = xyes; then
  729. if test "$mesa_driver" = osmesa; then
  730. AC_MSG_ERROR([libGL is not available for OSMesa driver])
  731. else
  732. DRIVER_DIRS="$DRIVER_DIRS osmesa"
  733. fi
  734. fi
  735. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  736. AC_ARG_WITH([osmesa-bits],
  737. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  738. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  739. [osmesa_bits="$withval"],
  740. [osmesa_bits=8])
  741. if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
  742. AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
  743. osmesa_bits=8
  744. fi
  745. case "x$osmesa_bits" in
  746. x8)
  747. OSMESA_LIB=OSMesa
  748. ;;
  749. x16|x32)
  750. OSMESA_LIB="OSMesa$osmesa_bits"
  751. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  752. ;;
  753. *)
  754. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  755. ;;
  756. esac
  757. AC_SUBST([OSMESA_LIB])
  758. case "$mesa_driver" in
  759. osmesa)
  760. # only link libraries with osmesa if shared
  761. if test "$enable_static" = no; then
  762. OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
  763. else
  764. OSMESA_LIB_DEPS=""
  765. fi
  766. OSMESA_MESA_DEPS=""
  767. OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS"
  768. ;;
  769. *)
  770. # Link OSMesa to libGL otherwise
  771. OSMESA_LIB_DEPS=""
  772. # only link libraries with osmesa if shared
  773. if test "$enable_static" = no; then
  774. OSMESA_MESA_DEPS='-l$(GL_LIB)'
  775. else
  776. OSMESA_MESA_DEPS=""
  777. fi
  778. OSMESA_PC_REQ="gl"
  779. ;;
  780. esac
  781. if test "$enable_static" = no; then
  782. OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
  783. fi
  784. OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $OS_LIBS"
  785. AC_SUBST([OSMESA_LIB_DEPS])
  786. AC_SUBST([OSMESA_MESA_DEPS])
  787. AC_SUBST([OSMESA_PC_REQ])
  788. AC_SUBST([OSMESA_PC_LIB_PRIV])
  789. dnl
  790. dnl GLU configuration
  791. dnl
  792. AC_ARG_ENABLE([glu],
  793. [AS_HELP_STRING([--disable-glu],
  794. [enable OpenGL Utility library @<:@default=enabled@:>@])],
  795. [enable_glu="$enableval"],
  796. [enable_glu=yes])
  797. if test "x$enable_glu" = xyes; then
  798. SRC_DIRS="$SRC_DIRS glu"
  799. case "$mesa_driver" in
  800. osmesa)
  801. # If GLU is available and we have libOSMesa (not 16 or 32),
  802. # we can build the osdemos
  803. if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
  804. PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
  805. fi
  806. # Link libGLU to libOSMesa instead of libGL
  807. GLU_LIB_DEPS=""
  808. GLU_PC_REQ="osmesa"
  809. if test "$enable_static" = no; then
  810. GLU_MESA_DEPS='-l$(OSMESA_LIB)'
  811. else
  812. GLU_MESA_DEPS=""
  813. fi
  814. ;;
  815. *)
  816. # If static, empty GLU_LIB_DEPS and add libs for programs to link
  817. GLU_PC_REQ="gl"
  818. GLU_PC_LIB_PRIV="-lm"
  819. if test "$enable_static" = no; then
  820. GLU_LIB_DEPS="-lm"
  821. GLU_MESA_DEPS='-l$(GL_LIB)'
  822. else
  823. GLU_LIB_DEPS=""
  824. GLU_MESA_DEPS=""
  825. APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
  826. fi
  827. ;;
  828. esac
  829. fi
  830. if test "$enable_static" = no; then
  831. GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
  832. fi
  833. GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
  834. AC_SUBST([GLU_LIB_DEPS])
  835. AC_SUBST([GLU_MESA_DEPS])
  836. AC_SUBST([GLU_PC_REQ])
  837. AC_SUBST([GLU_PC_REQ_PRIV])
  838. AC_SUBST([GLU_PC_LIB_PRIV])
  839. AC_SUBST([GLU_PC_CFLAGS])
  840. dnl
  841. dnl GLw configuration
  842. dnl
  843. AC_ARG_ENABLE([glw],
  844. [AS_HELP_STRING([--disable-glw],
  845. [enable Xt/Motif widget library @<:@default=enabled@:>@])],
  846. [enable_glw="$enableval"],
  847. [enable_glw=yes])
  848. dnl Don't build GLw on osmesa
  849. if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
  850. AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
  851. enable_glw=no
  852. fi
  853. AC_ARG_ENABLE([motif],
  854. [AS_HELP_STRING([--enable-motif],
  855. [use Motif widgets in GLw @<:@default=disabled@:>@])],
  856. [enable_motif="$enableval"],
  857. [enable_motif=no])
  858. if test "x$enable_glw" = xyes; then
  859. SRC_DIRS="$SRC_DIRS glw"
  860. if test "$x11_pkgconfig" = yes; then
  861. PKG_CHECK_MODULES([GLW],[x11 xt])
  862. GLW_PC_REQ_PRIV="x11 xt"
  863. GLW_LIB_DEPS="$GLW_LIBS"
  864. else
  865. # should check these...
  866. GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
  867. GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
  868. GLW_PC_CFLAGS="$X11_INCLUDES"
  869. fi
  870. GLW_SOURCES="GLwDrawA.c"
  871. MOTIF_CFLAGS=
  872. if test "x$enable_motif" = xyes; then
  873. GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
  874. AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
  875. if test "x$MOTIF_CONFIG" != xno; then
  876. MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
  877. MOTIF_LIBS=`$MOTIF_CONFIG --libs`
  878. else
  879. AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
  880. [AC_MSG_ERROR([Can't locate Motif headers])])
  881. AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
  882. [AC_MSG_ERROR([Can't locate Motif Xm library])])
  883. fi
  884. # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
  885. GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
  886. GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
  887. GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
  888. fi
  889. # If static, empty GLW_LIB_DEPS and add libs for programs to link
  890. GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV $OS_LIBS"
  891. if test "$enable_static" = no; then
  892. GLW_MESA_DEPS='-l$(GL_LIB)'
  893. GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
  894. else
  895. APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
  896. GLW_LIB_DEPS=""
  897. GLW_MESA_DEPS=""
  898. fi
  899. fi
  900. AC_SUBST([GLW_LIB_DEPS])
  901. AC_SUBST([GLW_MESA_DEPS])
  902. AC_SUBST([GLW_SOURCES])
  903. AC_SUBST([MOTIF_CFLAGS])
  904. AC_SUBST([GLW_PC_REQ_PRIV])
  905. AC_SUBST([GLW_PC_LIB_PRIV])
  906. AC_SUBST([GLW_PC_CFLAGS])
  907. dnl
  908. dnl GLUT configuration
  909. dnl
  910. if test -f "$srcdir/include/GL/glut.h"; then
  911. default_glut=yes
  912. else
  913. default_glut=no
  914. fi
  915. AC_ARG_ENABLE([glut],
  916. [AS_HELP_STRING([--disable-glut],
  917. [enable GLUT library @<:@default=enabled if source available@:>@])],
  918. [enable_glut="$enableval"],
  919. [enable_glut="$default_glut"])
  920. dnl Can't build glut if GLU not available
  921. if test "x$enable_glu$enable_glut" = xnoyes; then
  922. AC_MSG_WARN([Disabling glut since GLU is disabled])
  923. enable_glut=no
  924. fi
  925. dnl Don't build glut on osmesa
  926. if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
  927. AC_MSG_WARN([Disabling glut since the driver is OSMesa])
  928. enable_glut=no
  929. fi
  930. if test "x$enable_glut" = xyes; then
  931. SRC_DIRS="$SRC_DIRS glut/glx"
  932. GLUT_CFLAGS=""
  933. if test "x$GCC" = xyes; then
  934. GLUT_CFLAGS="-fexceptions"
  935. fi
  936. if test "$x11_pkgconfig" = yes; then
  937. PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
  938. GLUT_PC_REQ_PRIV="x11 xmu xi"
  939. GLUT_LIB_DEPS="$GLUT_LIBS"
  940. else
  941. # should check these...
  942. GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
  943. GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
  944. GLUT_PC_CFLAGS="$X11_INCLUDES"
  945. fi
  946. GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
  947. GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm $OS_LIBS"
  948. # If glut is available, we can build most programs
  949. if test "$with_demos" = yes; then
  950. PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
  951. fi
  952. # If static, empty GLUT_LIB_DEPS and add libs for programs to link
  953. if test "$enable_static" = no; then
  954. GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
  955. else
  956. APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
  957. GLUT_LIB_DEPS=""
  958. GLUT_MESA_DEPS=""
  959. fi
  960. fi
  961. AC_SUBST([GLUT_LIB_DEPS])
  962. AC_SUBST([GLUT_MESA_DEPS])
  963. AC_SUBST([GLUT_CFLAGS])
  964. AC_SUBST([GLUT_PC_REQ_PRIV])
  965. AC_SUBST([GLUT_PC_LIB_PRIV])
  966. AC_SUBST([GLUT_PC_CFLAGS])
  967. dnl
  968. dnl Program library dependencies
  969. dnl Only libm is added here if necessary as the libraries should
  970. dnl be pulled in by the linker
  971. dnl
  972. if test "x$APP_LIB_DEPS" = x; then
  973. case "$host_os" in
  974. solaris*)
  975. APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
  976. ;;
  977. *)
  978. APP_LIB_DEPS="-lm"
  979. ;;
  980. esac
  981. fi
  982. AC_SUBST([APP_LIB_DEPS])
  983. AC_SUBST([PROGRAM_DIRS])
  984. dnl
  985. dnl Gallium configuration
  986. dnl
  987. AC_ARG_ENABLE([gallium],
  988. [AS_HELP_STRING([--disable-gallium],
  989. [build gallium @<:@default=enabled@:>@])],
  990. [enable_gallium="$enableval"],
  991. [enable_gallium=yes])
  992. if test "x$enable_gallium" = xyes; then
  993. SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
  994. fi
  995. dnl
  996. dnl Gallium state trackers configuration
  997. dnl
  998. AC_ARG_WITH([state-trackers],
  999. [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
  1000. [comma delimited state_trackers list, e.g.
  1001. "egl,glx" @<:@default=auto@:>@])],
  1002. [with_state_trackers="$withval"],
  1003. [with_state_trackers=yes])
  1004. case "$with_state_trackers" in
  1005. no)
  1006. GALLIUM_STATE_TRACKERS_DIRS=""
  1007. ;;
  1008. yes)
  1009. # look at what else is built
  1010. case "$mesa_driver" in
  1011. dri)
  1012. GALLIUM_STATE_TRACKERS_DIRS=egl
  1013. ;;
  1014. esac
  1015. ;;
  1016. *)
  1017. # verify the requested state tracker exist
  1018. state_trackers=`IFS=', '; echo $with_state_trackers`
  1019. for tracker in $state_trackers; do
  1020. test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
  1021. AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
  1022. done
  1023. GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
  1024. ;;
  1025. esac
  1026. dnl
  1027. dnl Gallium Intel configuration
  1028. dnl
  1029. AC_ARG_ENABLE([gallium-intel],
  1030. [AS_HELP_STRING([--disable-gallium-intel],
  1031. [build gallium intel @<:@default=enabled@:>@])],
  1032. [enable_gallium_intel="$enableval"],
  1033. [enable_gallium_intel=yes])
  1034. if test "x$enable_gallium_intel" = xyes; then
  1035. GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel"
  1036. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915simple"
  1037. fi
  1038. dnl
  1039. dnl Gallium Radeon configuration
  1040. dnl
  1041. AC_ARG_ENABLE([gallium-radeon],
  1042. [AS_HELP_STRING([--enable-gallium-radeon],
  1043. [build gallium radeon @<:@default=disabled@:>@])],
  1044. [enable_gallium_radeon="$enableval"],
  1045. [enable_gallium_radeon=no])
  1046. if test "x$enable_gallium_radeon" = xyes; then
  1047. GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS radeon"
  1048. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1049. fi
  1050. dnl
  1051. dnl Gallium Radeon configuration
  1052. dnl
  1053. AC_ARG_ENABLE([gallium-nouveau],
  1054. [AS_HELP_STRING([--enable-gallium-nouveau],
  1055. [build gallium nouveau @<:@default=disabled@:>@])],
  1056. [enable_gallium_nouveau="$enableval"],
  1057. [enable_gallium_nouveau=no])
  1058. if test "x$enable_gallium_nouveau" = xyes; then
  1059. GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
  1060. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nv04 nv10 nv20 nv30 nv40 nv50"
  1061. fi
  1062. dnl Restore LDFLAGS and CPPFLAGS
  1063. LDFLAGS="$_SAVE_LDFLAGS"
  1064. CPPFLAGS="$_SAVE_CPPFLAGS"
  1065. dnl Substitute the config
  1066. AC_CONFIG_FILES([configs/autoconf])
  1067. dnl Replace the configs/current symlink
  1068. AC_CONFIG_COMMANDS([configs],[
  1069. if test -f configs/current || test -L configs/current; then
  1070. rm -f configs/current
  1071. fi
  1072. ln -s autoconf configs/current
  1073. ])
  1074. AC_OUTPUT
  1075. dnl
  1076. dnl Output some configuration info for the user
  1077. dnl
  1078. echo ""
  1079. echo " prefix: $prefix"
  1080. echo " exec_prefix: $exec_prefix"
  1081. echo " libdir: $libdir"
  1082. echo " includedir: $includedir"
  1083. dnl Driver info
  1084. echo ""
  1085. echo " Driver: $mesa_driver"
  1086. if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
  1087. echo " OSMesa: lib$OSMESA_LIB"
  1088. else
  1089. echo " OSMesa: no"
  1090. fi
  1091. if test "$mesa_driver" = dri; then
  1092. # cleanup the drivers var
  1093. dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1094. if test "x$DRI_DIRS" = x; then
  1095. echo " DRI drivers: no"
  1096. else
  1097. echo " DRI drivers: $dri_dirs"
  1098. fi
  1099. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1100. fi
  1101. echo " Use XCB: $enable_xcb"
  1102. echo ""
  1103. if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
  1104. echo " Gallium: yes"
  1105. echo " Gallium dirs: $GALLIUM_DIRS"
  1106. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  1107. echo " Winsys drm dirs:$GALLIUM_WINSYS_DRM_DIRS"
  1108. echo " Auxiliary dirs: $GALLIUM_AUXILIARY_DIRS"
  1109. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  1110. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  1111. else
  1112. echo " Gallium: no"
  1113. fi
  1114. dnl Libraries
  1115. echo ""
  1116. echo " Shared libs: $enable_shared"
  1117. echo " Static libs: $enable_static"
  1118. echo " GLU: $enable_glu"
  1119. echo " GLw: $enable_glw (Motif: $enable_motif)"
  1120. echo " glut: $enable_glut"
  1121. dnl Programs
  1122. # cleanup the programs var for display
  1123. program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1124. if test "x$program_dirs" = x; then
  1125. echo " Demos: no"
  1126. else
  1127. echo " Demos: $program_dirs"
  1128. fi
  1129. dnl Compiler options
  1130. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  1131. cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1132. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1133. cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1134. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1135. defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1136. echo ""
  1137. echo " CFLAGS: $cflags"
  1138. echo " CXXFLAGS: $cxxflags"
  1139. echo " Macros: $defines"
  1140. echo ""
  1141. echo " Run '${MAKE-make}' to build Mesa"
  1142. echo ""