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

configure.ac 33KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  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. GL_LIB_NAME='lib$(GL_LIB).a'
  206. GLU_LIB_NAME='lib$(GLU_LIB).a'
  207. GLUT_LIB_NAME='lib$(GLUT_LIB).a'
  208. GLW_LIB_NAME='lib$(GLW_LIB).a'
  209. OSMESA_LIB_NAME='lib$(OSMESA_LIB).a'
  210. else
  211. case "$host_os" in
  212. darwin* )
  213. LIB_EXTENSION='dylib' ;;
  214. * )
  215. LIB_EXTENSION='so' ;;
  216. esac
  217. GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
  218. GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
  219. GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
  220. GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
  221. OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
  222. GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
  223. GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
  224. GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
  225. GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
  226. OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
  227. fi
  228. AC_SUBST([GL_LIB_NAME])
  229. AC_SUBST([GLU_LIB_NAME])
  230. AC_SUBST([GLUT_LIB_NAME])
  231. AC_SUBST([GLW_LIB_NAME])
  232. AC_SUBST([OSMESA_LIB_NAME])
  233. AC_SUBST([GL_LIB_GLOB])
  234. AC_SUBST([GLU_LIB_GLOB])
  235. AC_SUBST([GLUT_LIB_GLOB])
  236. AC_SUBST([GLW_LIB_GLOB])
  237. AC_SUBST([OSMESA_LIB_GLOB])
  238. dnl
  239. dnl Arch/platform-specific settings
  240. dnl
  241. AC_ARG_ENABLE([asm],
  242. [AS_HELP_STRING([--disable-asm],
  243. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  244. [enable_asm="$enableval"],
  245. [enable_asm=yes]
  246. )
  247. asm_arch=""
  248. ASM_FLAGS=""
  249. ASM_SOURCES=""
  250. ASM_API=""
  251. AC_MSG_CHECKING([whether to enable assembly])
  252. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  253. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  254. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  255. case "$host_cpu" in
  256. i?86 | x86_64)
  257. enable_asm=no
  258. AC_MSG_RESULT([no, cross compiling])
  259. ;;
  260. esac
  261. fi
  262. # check for supported arches
  263. if test "x$enable_asm" = xyes; then
  264. case "$host_cpu" in
  265. i?86)
  266. case "$host_os" in
  267. linux* | *freebsd* | dragonfly*)
  268. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  269. ;;
  270. esac
  271. ;;
  272. x86_64)
  273. case "$host_os" in
  274. linux* | *freebsd* | dragonfly*)
  275. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  276. ;;
  277. esac
  278. ;;
  279. powerpc)
  280. case "$host_os" in
  281. linux*)
  282. asm_arch=ppc
  283. ;;
  284. esac
  285. ;;
  286. esac
  287. case "$asm_arch" in
  288. x86)
  289. ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  290. ASM_SOURCES='$(X86_SOURCES)'
  291. ASM_API='$(X86_API)'
  292. AC_MSG_RESULT([yes, x86])
  293. ;;
  294. x86_64)
  295. ASM_FLAGS="-DUSE_X86_64_ASM"
  296. ASM_SOURCES='$(X86-64_SOURCES)'
  297. ASM_API='$(X86-64_API)'
  298. AC_MSG_RESULT([yes, x86_64])
  299. ;;
  300. ppc)
  301. ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
  302. ASM_SOURCES='$(PPC_SOURCES)'
  303. AC_MSG_RESULT([yes, ppc])
  304. ;;
  305. *)
  306. AC_MSG_RESULT([no, platform not supported])
  307. ;;
  308. esac
  309. fi
  310. AC_SUBST([ASM_FLAGS])
  311. AC_SUBST([ASM_SOURCES])
  312. AC_SUBST([ASM_API])
  313. dnl PIC code macro
  314. MESA_PIC_FLAGS
  315. dnl Check to see if dlopen is in default libraries (like Solaris, which
  316. dnl has it in libc), or if libdl is needed to get it.
  317. AC_CHECK_FUNC([dlopen], [],
  318. [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
  319. dnl See if posix_memalign is available
  320. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  321. dnl SELinux awareness.
  322. AC_ARG_ENABLE([selinux],
  323. [AS_HELP_STRING([--enable-selinux],
  324. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  325. [MESA_SELINUX="$enableval"],
  326. [MESA_SELINUX=no])
  327. if test "x$enable_selinux" = "xyes"; then
  328. AC_CHECK_HEADER([selinux/selinux.h],[],
  329. [AC_MSG_ERROR([SELinux headers not found])])
  330. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  331. [AC_MSG_ERROR([SELinux library not found])])
  332. SELINUX_LIBS="-lselinux"
  333. DEFINES="$DEFINES -DMESA_SELINUX"
  334. fi
  335. dnl OS-specific libraries
  336. OS_LIBS=""
  337. case "$host_os" in
  338. solaris*)
  339. OS_LIBS="-lc"
  340. if test "x$GXX" != xyes; then
  341. OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS"
  342. fi
  343. ;;
  344. esac
  345. dnl
  346. dnl Driver configuration. Options are xlib, dri and osmesa right now.
  347. dnl More later: directfb, fbdev, ...
  348. dnl
  349. default_driver="xlib"
  350. case "$host_os" in
  351. linux*)
  352. case "$host_cpu" in
  353. i*86|x86_64|powerpc*) default_driver="dri";;
  354. esac
  355. ;;
  356. *freebsd* | dragonfly*)
  357. case "$host_cpu" in
  358. i*86|x86_64) default_driver="dri";;
  359. esac
  360. ;;
  361. esac
  362. AC_ARG_WITH([driver],
  363. [AS_HELP_STRING([--with-driver=DRIVER],
  364. [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
  365. [mesa_driver="$withval"],
  366. [mesa_driver="$default_driver"])
  367. dnl Check for valid option
  368. case "x$mesa_driver" in
  369. xxlib|xdri|xosmesa)
  370. ;;
  371. *)
  372. AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
  373. ;;
  374. esac
  375. dnl
  376. dnl Driver specific build directories
  377. dnl
  378. SRC_DIRS="mesa egl"
  379. GLU_DIRS="sgi"
  380. WINDOW_SYSTEM=""
  381. GALLIUM_DIRS="auxiliary drivers state_trackers"
  382. GALLIUM_WINSYS_DIRS=""
  383. GALLIUM_WINSYS_DRM_DIRS=""
  384. GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
  385. GALLIUM_DRIVER_DIRS="softpipe failover trace"
  386. GALLIUM_STATE_TRACKERS_DIRS=""
  387. case "$mesa_driver" in
  388. xlib)
  389. DRIVER_DIRS="x11"
  390. ;;
  391. dri)
  392. SRC_DIRS="glx/x11 $SRC_DIRS"
  393. DRIVER_DIRS="dri"
  394. WINDOW_SYSTEM="dri"
  395. GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
  396. GALLIUM_WINSYS_DRM_DIRS="intel"
  397. GALLIUM_DRIVER_DIRS="$GALLIUM_DRIVER_DIRS i915simple i965simple"
  398. GALLIUM_STATE_TRACKERS_DIRS="egl"
  399. ;;
  400. osmesa)
  401. DRIVER_DIRS="osmesa"
  402. ;;
  403. esac
  404. AC_SUBST([SRC_DIRS])
  405. AC_SUBST([GLU_DIRS])
  406. AC_SUBST([DRIVER_DIRS])
  407. AC_SUBST([WINDOW_SYSTEM])
  408. AC_SUBST([GALLIUM_DIRS])
  409. AC_SUBST([GALLIUM_WINSYS_DIRS])
  410. AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
  411. AC_SUBST([GALLIUM_DRIVER_DIRS])
  412. AC_SUBST([GALLIUM_AUXILIARY_DIRS])
  413. AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
  414. dnl
  415. dnl User supplied program configuration
  416. dnl
  417. if test -d "$srcdir/progs/demos"; then
  418. default_demos=yes
  419. else
  420. default_demos=no
  421. fi
  422. AC_ARG_WITH([demos],
  423. [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
  424. [optional comma delimited demo directories to build
  425. @<:@default=auto if source available@:>@])],
  426. [with_demos="$withval"],
  427. [with_demos="$default_demos"])
  428. if test "x$with_demos" = x; then
  429. with_demos=no
  430. fi
  431. dnl If $with_demos is yes, directories will be added as libs available
  432. PROGRAM_DIRS=""
  433. case "$with_demos" in
  434. no) ;;
  435. yes)
  436. # If the driver isn't osmesa, we have libGL and can build xdemos
  437. if test "$mesa_driver" != osmesa; then
  438. PROGRAM_DIRS="xdemos"
  439. fi
  440. ;;
  441. *)
  442. # verify the requested demos directories exist
  443. demos=`IFS=,; echo $with_demos`
  444. for demo in $demos; do
  445. test -d "$srcdir/progs/$demo" || \
  446. AC_MSG_ERROR([Program directory '$demo' doesn't exist])
  447. done
  448. PROGRAM_DIRS="$demos"
  449. ;;
  450. esac
  451. dnl
  452. dnl Find out if X is available. The variable have_x is set if libX11 is
  453. dnl found to mimic AC_PATH_XTRA.
  454. dnl
  455. if test -n "$PKG_CONFIG"; then
  456. AC_MSG_CHECKING([pkg-config files for X11 are available])
  457. PKG_CHECK_EXISTS([x11],[
  458. x11_pkgconfig=yes
  459. have_x=yes
  460. ],[
  461. x11_pkgconfig=no
  462. ])
  463. AC_MSG_RESULT([$x11_pkgconfig])
  464. else
  465. x11_pkgconfig=no
  466. fi
  467. dnl Use the autoconf macro if no pkg-config files
  468. if test "$x11_pkgconfig" = no; then
  469. AC_PATH_XTRA
  470. fi
  471. dnl Try to tell the user that the --x-* options are only used when
  472. dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
  473. m4_divert_once([HELP_BEGIN],
  474. [These options are only used when the X libraries cannot be found by the
  475. pkg-config utility.])
  476. dnl We need X for xlib and dri, so bomb now if it's not found
  477. case "$mesa_driver" in
  478. xlib|dri)
  479. if test "$no_x" = yes; then
  480. AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
  481. fi
  482. ;;
  483. esac
  484. dnl XCB - this is only used for GLX right now
  485. AC_ARG_ENABLE([xcb],
  486. [AS_HELP_STRING([--enable-xcb],
  487. [use XCB for GLX @<:@default=disabled@:>@])],
  488. [enable_xcb="$enableval"],
  489. [enable_xcb=no])
  490. if test "x$enable_xcb" = xyes; then
  491. DEFINES="$DEFINES -DUSE_XCB"
  492. else
  493. enable_xcb=no
  494. fi
  495. dnl
  496. dnl libGL configuration per driver
  497. dnl
  498. case "$mesa_driver" in
  499. xlib)
  500. if test "$x11_pkgconfig" = yes; then
  501. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  502. GL_PC_REQ_PRIV="x11 xext"
  503. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  504. GL_LIB_DEPS="$XLIBGL_LIBS"
  505. else
  506. # should check these...
  507. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  508. GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
  509. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  510. GL_PC_CFLAGS="$X11_INCLUDES"
  511. fi
  512. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
  513. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $OS_LIBS"
  514. # if static, move the external libraries to the programs
  515. # and empty the libraries for libGL
  516. if test "$enable_static" = yes; then
  517. APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
  518. GL_LIB_DEPS=""
  519. fi
  520. ;;
  521. dri)
  522. # DRI must be shared, I think
  523. if test "$enable_static" = yes; then
  524. AC_MSG_ERROR([Can't use static libraries for DRI drivers])
  525. fi
  526. # Check for libdrm
  527. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
  528. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  529. GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
  530. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  531. # find the DRI deps for libGL
  532. if test "$x11_pkgconfig" = yes; then
  533. # add xcb modules if necessary
  534. dri_modules="x11 xext xxf86vm xdamage xfixes"
  535. if test "$enable_xcb" = yes; then
  536. dri_modules="$dri_modules x11-xcb xcb-glx"
  537. fi
  538. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  539. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  540. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  541. GL_LIB_DEPS="$DRIGL_LIBS"
  542. else
  543. # should check these...
  544. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  545. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
  546. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  547. GL_PC_CFLAGS="$X11_INCLUDES"
  548. # XCB can only be used from pkg-config
  549. if test "$enable_xcb" = yes; then
  550. PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
  551. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
  552. X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
  553. GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
  554. fi
  555. fi
  556. # need DRM libs, -lpthread, etc.
  557. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
  558. GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS $OS_LIBS"
  559. ;;
  560. osmesa)
  561. # No libGL for osmesa
  562. GL_LIB_DEPS="$OS_LIBS"
  563. ;;
  564. esac
  565. AC_SUBST([GL_LIB_DEPS])
  566. AC_SUBST([GL_PC_REQ_PRIV])
  567. AC_SUBST([GL_PC_LIB_PRIV])
  568. AC_SUBST([GL_PC_CFLAGS])
  569. AC_SUBST([DRI_PC_REQ_PRIV])
  570. dnl
  571. dnl More X11 setup
  572. dnl
  573. if test "$mesa_driver" = xlib; then
  574. DEFINES="$DEFINES -DUSE_XSHM"
  575. fi
  576. dnl
  577. dnl More DRI setup
  578. dnl
  579. AC_ARG_ENABLE([glx-tls],
  580. [AS_HELP_STRING([--enable-glx-tls],
  581. [enable TLS support in GLX @<:@default=disabled@:>@])],
  582. [GLX_USE_TLS="$enableval"],
  583. [GLX_USE_TLS=no])
  584. dnl Directory for DRI drivers
  585. AC_ARG_WITH([dri-driverdir],
  586. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  587. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  588. [DRI_DRIVER_INSTALL_DIR="$withval"],
  589. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  590. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  591. dnl Direct rendering or just indirect rendering
  592. AC_ARG_ENABLE([driglx-direct],
  593. [AS_HELP_STRING([--disable-driglx-direct],
  594. [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
  595. [driglx_direct="$enableval"],
  596. [driglx_direct="yes"])
  597. dnl Which drivers to build - default is chosen by platform
  598. AC_ARG_WITH([dri-drivers],
  599. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  600. [comma delimited DRI drivers list, e.g.
  601. "swrast,i965,radeon,nouveau" @<:@default=auto@:>@])],
  602. [with_dri_drivers="$withval"],
  603. [with_dri_drivers=yes])
  604. if test "x$with_dri_drivers" = x; then
  605. with_dri_drivers=no
  606. fi
  607. dnl If $with_dri_drivers is yes, directories will be added through
  608. dnl platform checks
  609. DRI_DIRS=""
  610. case "$with_dri_drivers" in
  611. no) ;;
  612. yes)
  613. DRI_DIRS="yes"
  614. ;;
  615. *)
  616. # verify the requested driver directories exist
  617. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  618. for driver in $dri_drivers; do
  619. test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
  620. AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
  621. done
  622. DRI_DIRS="$dri_drivers"
  623. ;;
  624. esac
  625. dnl Just default to no EGL for now
  626. USING_EGL=0
  627. AC_SUBST([USING_EGL])
  628. dnl Set DRI_DIRS, DEFINES and LIB_DEPS
  629. if test "$mesa_driver" = dri; then
  630. # Use TLS in GLX?
  631. if test "x$GLX_USE_TLS" = xyes; then
  632. DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
  633. fi
  634. if test "x$USING_EGL" = x1; then
  635. PROGRAM_DIRS="egl"
  636. fi
  637. # Platform specific settings and drivers to build
  638. case "$host_os" in
  639. linux*)
  640. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  641. if test "x$driglx_direct" = xyes; then
  642. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  643. fi
  644. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
  645. case "$host_cpu" in
  646. x86_64)
  647. # ffb, gamma, and sis are missing because they have not be
  648. # converted to use the new interface. i810 are missing
  649. # because there is no x86-64 system where they could *ever*
  650. # be used.
  651. if test "x$DRI_DIRS" = "xyes"; then
  652. DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
  653. savage tdfx unichrome swrast"
  654. fi
  655. ;;
  656. powerpc*)
  657. # Build only the drivers for cards that exist on PowerPC.
  658. # At some point MGA will be added, but not yet.
  659. if test "x$DRI_DIRS" = "xyes"; then
  660. DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast"
  661. fi
  662. ;;
  663. sparc*)
  664. # Build only the drivers for cards that exist on sparc`
  665. if test "x$DRI_DIRS" = "xyes"; then
  666. DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast"
  667. fi
  668. ;;
  669. esac
  670. ;;
  671. freebsd* | dragonfly*)
  672. DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
  673. DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
  674. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  675. if test "x$driglx_direct" = xyes; then
  676. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  677. fi
  678. if test "x$GXX" = xyes; then
  679. CXXFLAGS="$CXXFLAGS -ansi -pedantic"
  680. fi
  681. # ffb and gamma are missing because they have not been converted
  682. # to use the new interface.
  683. if test "x$DRI_DIRS" = "xyes"; then
  684. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
  685. unichrome savage sis swrast"
  686. fi
  687. ;;
  688. solaris*)
  689. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  690. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  691. if test "x$driglx_direct" = xyes; then
  692. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  693. fi
  694. ;;
  695. esac
  696. # default drivers
  697. if test "x$DRI_DIRS" = "xyes"; then
  698. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
  699. savage sis tdfx trident unichrome ffb swrast"
  700. fi
  701. DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
  702. # Check for expat
  703. EXPAT_INCLUDES=""
  704. EXPAT_LIB=-lexpat
  705. AC_ARG_WITH([expat],
  706. [AS_HELP_STRING([--with-expat=DIR],
  707. [expat install directory])],[
  708. EXPAT_INCLUDES="-I$withval/include"
  709. CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
  710. LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
  711. EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
  712. ])
  713. AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
  714. AC_CHECK_LIB([expat],[XML_ParserCreate],[],
  715. [AC_MSG_ERROR([Expat required for DRI.])])
  716. # put all the necessary libs together
  717. DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
  718. fi
  719. AC_SUBST([DRI_DIRS])
  720. AC_SUBST([EXPAT_INCLUDES])
  721. AC_SUBST([DRI_LIB_DEPS])
  722. dnl
  723. dnl OSMesa configuration
  724. dnl
  725. if test "$mesa_driver" = xlib; then
  726. default_gl_osmesa=yes
  727. else
  728. default_gl_osmesa=no
  729. fi
  730. AC_ARG_ENABLE([gl-osmesa],
  731. [AS_HELP_STRING([--enable-gl-osmesa],
  732. [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
  733. [gl_osmesa="$enableval"],
  734. [gl_osmesa="$default_gl_osmesa"])
  735. if test "x$gl_osmesa" = xyes; then
  736. if test "$mesa_driver" = osmesa; then
  737. AC_MSG_ERROR([libGL is not available for OSMesa driver])
  738. else
  739. DRIVER_DIRS="$DRIVER_DIRS osmesa"
  740. fi
  741. fi
  742. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  743. AC_ARG_WITH([osmesa-bits],
  744. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  745. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  746. [osmesa_bits="$withval"],
  747. [osmesa_bits=8])
  748. if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
  749. AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
  750. osmesa_bits=8
  751. fi
  752. case "x$osmesa_bits" in
  753. x8)
  754. OSMESA_LIB=OSMesa
  755. ;;
  756. x16|x32)
  757. OSMESA_LIB="OSMesa$osmesa_bits"
  758. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  759. ;;
  760. *)
  761. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  762. ;;
  763. esac
  764. AC_SUBST([OSMESA_LIB])
  765. case "$mesa_driver" in
  766. osmesa)
  767. # only link libraries with osmesa if shared
  768. if test "$enable_static" = no; then
  769. OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
  770. else
  771. OSMESA_LIB_DEPS=""
  772. fi
  773. OSMESA_MESA_DEPS=""
  774. OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS"
  775. ;;
  776. *)
  777. # Link OSMesa to libGL otherwise
  778. OSMESA_LIB_DEPS=""
  779. # only link libraries with osmesa if shared
  780. if test "$enable_static" = no; then
  781. OSMESA_MESA_DEPS='-l$(GL_LIB)'
  782. else
  783. OSMESA_MESA_DEPS=""
  784. fi
  785. OSMESA_PC_REQ="gl"
  786. ;;
  787. esac
  788. if test "$enable_static" = no; then
  789. OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
  790. fi
  791. OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $OS_LIBS"
  792. AC_SUBST([OSMESA_LIB_DEPS])
  793. AC_SUBST([OSMESA_MESA_DEPS])
  794. AC_SUBST([OSMESA_PC_REQ])
  795. AC_SUBST([OSMESA_PC_LIB_PRIV])
  796. dnl
  797. dnl GLU configuration
  798. dnl
  799. AC_ARG_ENABLE([glu],
  800. [AS_HELP_STRING([--disable-glu],
  801. [enable OpenGL Utility library @<:@default=enabled@:>@])],
  802. [enable_glu="$enableval"],
  803. [enable_glu=yes])
  804. if test "x$enable_glu" = xyes; then
  805. SRC_DIRS="$SRC_DIRS glu"
  806. case "$mesa_driver" in
  807. osmesa)
  808. # If GLU is available and we have libOSMesa (not 16 or 32),
  809. # we can build the osdemos
  810. if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
  811. PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
  812. fi
  813. # Link libGLU to libOSMesa instead of libGL
  814. GLU_LIB_DEPS=""
  815. GLU_PC_REQ="osmesa"
  816. if test "$enable_static" = no; then
  817. GLU_MESA_DEPS='-l$(OSMESA_LIB)'
  818. else
  819. GLU_MESA_DEPS=""
  820. fi
  821. ;;
  822. *)
  823. # If static, empty GLU_LIB_DEPS and add libs for programs to link
  824. GLU_PC_REQ="gl"
  825. GLU_PC_LIB_PRIV="-lm"
  826. if test "$enable_static" = no; then
  827. GLU_LIB_DEPS="-lm"
  828. GLU_MESA_DEPS='-l$(GL_LIB)'
  829. else
  830. GLU_LIB_DEPS=""
  831. GLU_MESA_DEPS=""
  832. APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
  833. fi
  834. ;;
  835. esac
  836. fi
  837. if test "$enable_static" = no; then
  838. GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
  839. fi
  840. GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
  841. AC_SUBST([GLU_LIB_DEPS])
  842. AC_SUBST([GLU_MESA_DEPS])
  843. AC_SUBST([GLU_PC_REQ])
  844. AC_SUBST([GLU_PC_REQ_PRIV])
  845. AC_SUBST([GLU_PC_LIB_PRIV])
  846. AC_SUBST([GLU_PC_CFLAGS])
  847. dnl
  848. dnl GLw configuration
  849. dnl
  850. AC_ARG_ENABLE([glw],
  851. [AS_HELP_STRING([--disable-glw],
  852. [enable Xt/Motif widget library @<:@default=enabled@:>@])],
  853. [enable_glw="$enableval"],
  854. [enable_glw=yes])
  855. dnl Don't build GLw on osmesa
  856. if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
  857. AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
  858. enable_glw=no
  859. fi
  860. AC_ARG_ENABLE([motif],
  861. [AS_HELP_STRING([--enable-motif],
  862. [use Motif widgets in GLw @<:@default=disabled@:>@])],
  863. [enable_motif="$enableval"],
  864. [enable_motif=no])
  865. if test "x$enable_glw" = xyes; then
  866. SRC_DIRS="$SRC_DIRS glw"
  867. if test "$x11_pkgconfig" = yes; then
  868. PKG_CHECK_MODULES([GLW],[x11 xt])
  869. GLW_PC_REQ_PRIV="x11 xt"
  870. GLW_LIB_DEPS="$GLW_LIBS"
  871. else
  872. # should check these...
  873. GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
  874. GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
  875. GLW_PC_CFLAGS="$X11_INCLUDES"
  876. fi
  877. GLW_SOURCES="GLwDrawA.c"
  878. MOTIF_CFLAGS=
  879. if test "x$enable_motif" = xyes; then
  880. GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
  881. AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
  882. if test "x$MOTIF_CONFIG" != xno; then
  883. MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
  884. MOTIF_LIBS=`$MOTIF_CONFIG --libs`
  885. else
  886. AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
  887. [AC_MSG_ERROR([Can't locate Motif headers])])
  888. AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
  889. [AC_MSG_ERROR([Can't locate Motif Xm library])])
  890. fi
  891. # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
  892. GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
  893. GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
  894. GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
  895. fi
  896. # If static, empty GLW_LIB_DEPS and add libs for programs to link
  897. GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV $OS_LIBS"
  898. if test "$enable_static" = no; then
  899. GLW_MESA_DEPS='-l$(GL_LIB)'
  900. GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
  901. else
  902. APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
  903. GLW_LIB_DEPS=""
  904. GLW_MESA_DEPS=""
  905. fi
  906. fi
  907. AC_SUBST([GLW_LIB_DEPS])
  908. AC_SUBST([GLW_MESA_DEPS])
  909. AC_SUBST([GLW_SOURCES])
  910. AC_SUBST([MOTIF_CFLAGS])
  911. AC_SUBST([GLW_PC_REQ_PRIV])
  912. AC_SUBST([GLW_PC_LIB_PRIV])
  913. AC_SUBST([GLW_PC_CFLAGS])
  914. dnl
  915. dnl GLUT configuration
  916. dnl
  917. if test -f "$srcdir/include/GL/glut.h"; then
  918. default_glut=yes
  919. else
  920. default_glut=no
  921. fi
  922. AC_ARG_ENABLE([glut],
  923. [AS_HELP_STRING([--disable-glut],
  924. [enable GLUT library @<:@default=enabled if source available@:>@])],
  925. [enable_glut="$enableval"],
  926. [enable_glut="$default_glut"])
  927. dnl Can't build glut if GLU not available
  928. if test "x$enable_glu$enable_glut" = xnoyes; then
  929. AC_MSG_WARN([Disabling glut since GLU is disabled])
  930. enable_glut=no
  931. fi
  932. dnl Don't build glut on osmesa
  933. if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
  934. AC_MSG_WARN([Disabling glut since the driver is OSMesa])
  935. enable_glut=no
  936. fi
  937. if test "x$enable_glut" = xyes; then
  938. SRC_DIRS="$SRC_DIRS glut/glx"
  939. GLUT_CFLAGS=""
  940. if test "x$GCC" = xyes; then
  941. GLUT_CFLAGS="-fexceptions"
  942. fi
  943. if test "$x11_pkgconfig" = yes; then
  944. PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
  945. GLUT_PC_REQ_PRIV="x11 xmu xi"
  946. GLUT_LIB_DEPS="$GLUT_LIBS"
  947. else
  948. # should check these...
  949. GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
  950. GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
  951. GLUT_PC_CFLAGS="$X11_INCLUDES"
  952. fi
  953. GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
  954. GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm $OS_LIBS"
  955. # If glut is available, we can build most programs
  956. if test "$with_demos" = yes; then
  957. PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
  958. fi
  959. # If static, empty GLUT_LIB_DEPS and add libs for programs to link
  960. if test "$enable_static" = no; then
  961. GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
  962. else
  963. APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
  964. GLUT_LIB_DEPS=""
  965. GLUT_MESA_DEPS=""
  966. fi
  967. fi
  968. AC_SUBST([GLUT_LIB_DEPS])
  969. AC_SUBST([GLUT_MESA_DEPS])
  970. AC_SUBST([GLUT_CFLAGS])
  971. AC_SUBST([GLUT_PC_REQ_PRIV])
  972. AC_SUBST([GLUT_PC_LIB_PRIV])
  973. AC_SUBST([GLUT_PC_CFLAGS])
  974. dnl
  975. dnl Program library dependencies
  976. dnl Only libm is added here if necessary as the libraries should
  977. dnl be pulled in by the linker
  978. dnl
  979. if test "x$APP_LIB_DEPS" = x; then
  980. case "$host_os" in
  981. solaris*)
  982. APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
  983. ;;
  984. *)
  985. APP_LIB_DEPS="-lm"
  986. ;;
  987. esac
  988. fi
  989. AC_SUBST([APP_LIB_DEPS])
  990. AC_SUBST([PROGRAM_DIRS])
  991. dnl
  992. dnl Gallium configuration
  993. dnl
  994. AC_ARG_ENABLE([gallium],
  995. [AS_HELP_STRING([--disable-gallium],
  996. [build gallium @<:@default=enabled@:>@])],
  997. [enable_gallium="$enableval"],
  998. [enable_gallium=yes])
  999. if test "x$enable_gallium" = xyes; then
  1000. SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
  1001. fi
  1002. dnl Restore LDFLAGS and CPPFLAGS
  1003. LDFLAGS="$_SAVE_LDFLAGS"
  1004. CPPFLAGS="$_SAVE_CPPFLAGS"
  1005. dnl Substitute the config
  1006. AC_CONFIG_FILES([configs/autoconf])
  1007. dnl Replace the configs/current symlink
  1008. AC_CONFIG_COMMANDS([configs],[
  1009. if test -f configs/current || test -L configs/current; then
  1010. rm -f configs/current
  1011. fi
  1012. ln -s autoconf configs/current
  1013. ])
  1014. AC_OUTPUT
  1015. dnl
  1016. dnl Output some configuration info for the user
  1017. dnl
  1018. echo ""
  1019. echo " prefix: $prefix"
  1020. echo " exec_prefix: $exec_prefix"
  1021. echo " libdir: $libdir"
  1022. echo " includedir: $includedir"
  1023. dnl Driver info
  1024. echo ""
  1025. echo " Driver: $mesa_driver"
  1026. if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
  1027. echo " OSMesa: lib$OSMESA_LIB"
  1028. else
  1029. echo " OSMesa: no"
  1030. fi
  1031. if test "$mesa_driver" = dri; then
  1032. # cleanup the drivers var
  1033. dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1034. if test "x$DRI_DIRS" = x; then
  1035. echo " DRI drivers: no"
  1036. else
  1037. echo " DRI drivers: $dri_dirs"
  1038. fi
  1039. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1040. fi
  1041. echo " Use XCB: $enable_xcb"
  1042. echo ""
  1043. if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
  1044. echo " Gallium: yes"
  1045. echo " Gallium dirs: $GALLIUM_DIRS"
  1046. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  1047. echo " Winsys drm dirs: $GALLIUM_WINSYS_DRM_DIRS"
  1048. echo " Auxiliary dirs: $GALLIUM_AUXILIARY_DIRS"
  1049. echo " Driver dirs: $GALLIUM_DRIVER_DIRS"
  1050. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  1051. else
  1052. echo " Gallium: no"
  1053. fi
  1054. dnl Libraries
  1055. echo ""
  1056. echo " Shared libs: $enable_shared"
  1057. echo " Static libs: $enable_static"
  1058. echo " GLU: $enable_glu"
  1059. echo " GLw: $enable_glw (Motif: $enable_motif)"
  1060. echo " glut: $enable_glut"
  1061. dnl Programs
  1062. # cleanup the programs var for display
  1063. program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1064. if test "x$program_dirs" = x; then
  1065. echo " Demos: no"
  1066. else
  1067. echo " Demos: $program_dirs"
  1068. fi
  1069. dnl Compiler options
  1070. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  1071. cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1072. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1073. cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1074. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1075. defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1076. echo ""
  1077. echo " CFLAGS: $cflags"
  1078. echo " CXXFLAGS: $cxxflags"
  1079. echo " Macros: $defines"
  1080. echo ""
  1081. echo " Run '${MAKE-make}' to build Mesa"
  1082. echo ""