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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510
  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_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' ;;
  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. GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
  253. GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
  254. GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
  255. GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
  256. OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
  257. EGL_LIB_GLOB='lib$(EGL_LIB).*'${LIB_EXTENSION}'*'
  258. AC_SUBST([GL_LIB_NAME])
  259. AC_SUBST([GLU_LIB_NAME])
  260. AC_SUBST([GLUT_LIB_NAME])
  261. AC_SUBST([GLW_LIB_NAME])
  262. AC_SUBST([OSMESA_LIB_NAME])
  263. AC_SUBST([EGL_LIB_NAME])
  264. AC_SUBST([GL_LIB_GLOB])
  265. AC_SUBST([GLU_LIB_GLOB])
  266. AC_SUBST([GLUT_LIB_GLOB])
  267. AC_SUBST([GLW_LIB_GLOB])
  268. AC_SUBST([OSMESA_LIB_GLOB])
  269. AC_SUBST([EGL_LIB_GLOB])
  270. dnl
  271. dnl Arch/platform-specific settings
  272. dnl
  273. AC_ARG_ENABLE([asm],
  274. [AS_HELP_STRING([--disable-asm],
  275. [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
  276. [enable_asm="$enableval"],
  277. [enable_asm=yes]
  278. )
  279. asm_arch=""
  280. ASM_FLAGS=""
  281. MESA_ASM_SOURCES=""
  282. GLAPI_ASM_SOURCES=""
  283. AC_MSG_CHECKING([whether to enable assembly])
  284. test "x$enable_asm" = xno && AC_MSG_RESULT([no])
  285. # disable if cross compiling on x86/x86_64 since we must run gen_matypes
  286. if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
  287. case "$host_cpu" in
  288. i?86 | x86_64)
  289. enable_asm=no
  290. AC_MSG_RESULT([no, cross compiling])
  291. ;;
  292. esac
  293. fi
  294. # check for supported arches
  295. if test "x$enable_asm" = xyes; then
  296. case "$host_cpu" in
  297. i?86)
  298. case "$host_os" in
  299. linux* | *freebsd* | dragonfly*)
  300. test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
  301. ;;
  302. esac
  303. ;;
  304. x86_64)
  305. case "$host_os" in
  306. linux* | *freebsd* | dragonfly*)
  307. test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
  308. ;;
  309. esac
  310. ;;
  311. powerpc)
  312. case "$host_os" in
  313. linux*)
  314. asm_arch=ppc
  315. ;;
  316. esac
  317. ;;
  318. sparc*)
  319. case "$host_os" in
  320. linux*)
  321. asm_arch=sparc
  322. ;;
  323. esac
  324. ;;
  325. esac
  326. case "$asm_arch" in
  327. x86)
  328. ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
  329. MESA_ASM_SOURCES='$(X86_SOURCES)'
  330. GLAPI_ASM_SOURCES='$(X86_API)'
  331. AC_MSG_RESULT([yes, x86])
  332. ;;
  333. x86_64)
  334. ASM_FLAGS="-DUSE_X86_64_ASM"
  335. MESA_ASM_SOURCES='$(X86-64_SOURCES)'
  336. GLAPI_ASM_SOURCES='$(X86-64_API)'
  337. AC_MSG_RESULT([yes, x86_64])
  338. ;;
  339. ppc)
  340. ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
  341. MESA_ASM_SOURCES='$(PPC_SOURCES)'
  342. AC_MSG_RESULT([yes, ppc])
  343. ;;
  344. sparc)
  345. ASM_FLAGS="-DUSE_SPARC_ASM"
  346. MESA_ASM_SOURCES='$(SPARC_SOURCES)'
  347. GLAPI_ASM_SOURCES='$(SPARC_API)'
  348. AC_MSG_RESULT([yes, sparc])
  349. ;;
  350. *)
  351. AC_MSG_RESULT([no, platform not supported])
  352. ;;
  353. esac
  354. fi
  355. AC_SUBST([ASM_FLAGS])
  356. AC_SUBST([MESA_ASM_SOURCES])
  357. AC_SUBST([GLAPI_ASM_SOURCES])
  358. dnl PIC code macro
  359. MESA_PIC_FLAGS
  360. dnl Check to see if dlopen is in default libraries (like Solaris, which
  361. dnl has it in libc), or if libdl is needed to get it.
  362. AC_CHECK_FUNC([dlopen], [],
  363. [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
  364. dnl See if posix_memalign is available
  365. AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
  366. dnl SELinux awareness.
  367. AC_ARG_ENABLE([selinux],
  368. [AS_HELP_STRING([--enable-selinux],
  369. [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
  370. [MESA_SELINUX="$enableval"],
  371. [MESA_SELINUX=no])
  372. if test "x$enable_selinux" = "xyes"; then
  373. AC_CHECK_HEADER([selinux/selinux.h],[],
  374. [AC_MSG_ERROR([SELinux headers not found])])
  375. AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
  376. [AC_MSG_ERROR([SELinux library not found])])
  377. SELINUX_LIBS="-lselinux"
  378. DEFINES="$DEFINES -DMESA_SELINUX"
  379. fi
  380. dnl
  381. dnl Driver configuration. Options are xlib, dri and osmesa right now.
  382. dnl More later: fbdev, ...
  383. dnl
  384. default_driver="xlib"
  385. case "$host_os" in
  386. linux*)
  387. case "$host_cpu" in
  388. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  389. esac
  390. ;;
  391. *freebsd* | dragonfly*)
  392. case "$host_cpu" in
  393. i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
  394. esac
  395. ;;
  396. esac
  397. AC_ARG_WITH([driver],
  398. [AS_HELP_STRING([--with-driver=DRIVER],
  399. [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
  400. [mesa_driver="$withval"],
  401. [mesa_driver="$default_driver"])
  402. dnl Check for valid option
  403. case "x$mesa_driver" in
  404. xxlib|xdri|xosmesa)
  405. ;;
  406. *)
  407. AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
  408. ;;
  409. esac
  410. dnl
  411. dnl Driver specific build directories
  412. dnl
  413. dnl this variable will be prepended to SRC_DIRS and is not exported
  414. CORE_DIRS="glsl mesa"
  415. SRC_DIRS="glew"
  416. GLU_DIRS="sgi"
  417. GALLIUM_DIRS="auxiliary drivers state_trackers"
  418. GALLIUM_TARGET_DIRS=""
  419. GALLIUM_WINSYS_DIRS="sw"
  420. GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
  421. GALLIUM_STATE_TRACKERS_DIRS=""
  422. case "$mesa_driver" in
  423. xlib)
  424. DRIVER_DIRS="x11"
  425. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
  426. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
  427. ;;
  428. dri)
  429. SRC_DIRS="$SRC_DIRS glx"
  430. DRIVER_DIRS="dri"
  431. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri sw/drm"
  432. ;;
  433. osmesa)
  434. DRIVER_DIRS="osmesa"
  435. ;;
  436. esac
  437. AC_SUBST([SRC_DIRS])
  438. AC_SUBST([GLU_DIRS])
  439. AC_SUBST([DRIVER_DIRS])
  440. AC_SUBST([GALLIUM_DIRS])
  441. AC_SUBST([GALLIUM_TARGET_DIRS])
  442. AC_SUBST([GALLIUM_WINSYS_DIRS])
  443. AC_SUBST([GALLIUM_DRIVERS_DIRS])
  444. AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
  445. dnl
  446. dnl User supplied program configuration
  447. dnl
  448. if test -d "$srcdir/progs/demos"; then
  449. default_demos=yes
  450. else
  451. default_demos=no
  452. fi
  453. AC_ARG_WITH([demos],
  454. [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
  455. [optional comma delimited demo directories to build
  456. @<:@default=auto if source available@:>@])],
  457. [with_demos="$withval"],
  458. [with_demos="$default_demos"])
  459. if test "x$with_demos" = x; then
  460. with_demos=no
  461. fi
  462. dnl If $with_demos is yes, directories will be added as libs available
  463. PROGRAM_DIRS=""
  464. case "$with_demos" in
  465. no) ;;
  466. yes)
  467. # If the driver isn't osmesa, we have libGL and can build xdemos
  468. if test "$mesa_driver" != osmesa; then
  469. PROGRAM_DIRS="xdemos"
  470. fi
  471. ;;
  472. *)
  473. # verify the requested demos directories exist
  474. demos=`IFS=,; echo $with_demos`
  475. for demo in $demos; do
  476. test -d "$srcdir/progs/$demo" || \
  477. AC_MSG_ERROR([Program directory '$demo' doesn't exist])
  478. done
  479. PROGRAM_DIRS="$demos"
  480. ;;
  481. esac
  482. dnl
  483. dnl Find out if X is available. The variable have_x is set if libX11 is
  484. dnl found to mimic AC_PATH_XTRA.
  485. dnl
  486. if test -n "$PKG_CONFIG"; then
  487. AC_MSG_CHECKING([pkg-config files for X11 are available])
  488. PKG_CHECK_EXISTS([x11],[
  489. x11_pkgconfig=yes
  490. have_x=yes
  491. ],[
  492. x11_pkgconfig=no
  493. ])
  494. AC_MSG_RESULT([$x11_pkgconfig])
  495. else
  496. x11_pkgconfig=no
  497. fi
  498. dnl Use the autoconf macro if no pkg-config files
  499. if test "$x11_pkgconfig" = yes; then
  500. PKG_CHECK_MODULES([X11], [x11])
  501. else
  502. AC_PATH_XTRA
  503. test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
  504. test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
  505. AC_SUBST([X11_CFLAGS])
  506. AC_SUBST([X11_LIBS])
  507. fi
  508. dnl Try to tell the user that the --x-* options are only used when
  509. dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
  510. m4_divert_once([HELP_BEGIN],
  511. [These options are only used when the X libraries cannot be found by the
  512. pkg-config utility.])
  513. dnl We need X for xlib and dri, so bomb now if it's not found
  514. case "$mesa_driver" in
  515. xlib|dri)
  516. if test "$no_x" = yes; then
  517. AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
  518. fi
  519. ;;
  520. esac
  521. dnl XCB - this is only used for GLX right now
  522. AC_ARG_ENABLE([xcb],
  523. [AS_HELP_STRING([--enable-xcb],
  524. [use XCB for GLX @<:@default=disabled@:>@])],
  525. [enable_xcb="$enableval"],
  526. [enable_xcb=no])
  527. if test "x$enable_xcb" = xyes; then
  528. DEFINES="$DEFINES -DUSE_XCB"
  529. else
  530. enable_xcb=no
  531. fi
  532. dnl
  533. dnl libGL configuration per driver
  534. dnl
  535. case "$mesa_driver" in
  536. xlib)
  537. if test "$x11_pkgconfig" = yes; then
  538. PKG_CHECK_MODULES([XLIBGL], [x11 xext])
  539. GL_PC_REQ_PRIV="x11 xext"
  540. X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
  541. GL_LIB_DEPS="$XLIBGL_LIBS"
  542. else
  543. # should check these...
  544. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  545. GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
  546. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  547. GL_PC_CFLAGS="$X11_INCLUDES"
  548. fi
  549. GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
  550. GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
  551. # if static, move the external libraries to the programs
  552. # and empty the libraries for libGL
  553. if test "$enable_static" = yes; then
  554. APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
  555. GL_LIB_DEPS=""
  556. fi
  557. ;;
  558. dri)
  559. # DRI must be shared, I think
  560. if test "$enable_static" = yes; then
  561. AC_MSG_ERROR([Can't use static libraries for DRI drivers])
  562. fi
  563. # Check for libdrm
  564. PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
  565. PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
  566. PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
  567. GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
  568. DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
  569. # find the DRI deps for libGL
  570. if test "$x11_pkgconfig" = yes; then
  571. # add xcb modules if necessary
  572. dri_modules="x11 xext xxf86vm xdamage xfixes"
  573. if test "$enable_xcb" = yes; then
  574. dri_modules="$dri_modules x11-xcb xcb-glx"
  575. fi
  576. PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  577. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
  578. X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
  579. GL_LIB_DEPS="$DRIGL_LIBS"
  580. else
  581. # should check these...
  582. X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
  583. GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
  584. GL_PC_LIB_PRIV="$GL_LIB_DEPS"
  585. GL_PC_CFLAGS="$X11_INCLUDES"
  586. # XCB can only be used from pkg-config
  587. if test "$enable_xcb" = yes; then
  588. PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
  589. GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
  590. X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
  591. GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
  592. fi
  593. fi
  594. # need DRM libs, -lpthread, etc.
  595. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
  596. GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
  597. ;;
  598. osmesa)
  599. # No libGL for osmesa
  600. GL_LIB_DEPS=""
  601. ;;
  602. esac
  603. AC_SUBST([GL_LIB_DEPS])
  604. AC_SUBST([GL_PC_REQ_PRIV])
  605. AC_SUBST([GL_PC_LIB_PRIV])
  606. AC_SUBST([GL_PC_CFLAGS])
  607. AC_SUBST([DRI_PC_REQ_PRIV])
  608. dnl
  609. dnl More X11 setup
  610. dnl
  611. if test "$mesa_driver" = xlib; then
  612. DEFINES="$DEFINES -DUSE_XSHM"
  613. fi
  614. dnl
  615. dnl More DRI setup
  616. dnl
  617. AC_ARG_ENABLE([glx-tls],
  618. [AS_HELP_STRING([--enable-glx-tls],
  619. [enable TLS support in GLX @<:@default=disabled@:>@])],
  620. [GLX_USE_TLS="$enableval"],
  621. [GLX_USE_TLS=no])
  622. dnl Directory for DRI drivers
  623. AC_ARG_WITH([dri-driverdir],
  624. [AS_HELP_STRING([--with-dri-driverdir=DIR],
  625. [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
  626. [DRI_DRIVER_INSTALL_DIR="$withval"],
  627. [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
  628. AC_SUBST([DRI_DRIVER_INSTALL_DIR])
  629. dnl Extra search path for DRI drivers
  630. AC_ARG_WITH([dri-searchpath],
  631. [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
  632. [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
  633. [DRI_DRIVER_SEARCH_DIR="$withval"],
  634. [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
  635. AC_SUBST([DRI_DRIVER_SEARCH_DIR])
  636. dnl Direct rendering or just indirect rendering
  637. AC_ARG_ENABLE([driglx-direct],
  638. [AS_HELP_STRING([--disable-driglx-direct],
  639. [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
  640. [driglx_direct="$enableval"],
  641. [driglx_direct="yes"])
  642. dnl Which drivers to build - default is chosen by platform
  643. AC_ARG_WITH([dri-drivers],
  644. [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
  645. [comma delimited DRI drivers list, e.g.
  646. "swrast,i965,radeon" @<:@default=auto@:>@])],
  647. [with_dri_drivers="$withval"],
  648. [with_dri_drivers=yes])
  649. if test "x$with_dri_drivers" = x; then
  650. with_dri_drivers=no
  651. fi
  652. dnl If $with_dri_drivers is yes, directories will be added through
  653. dnl platform checks
  654. DRI_DIRS=""
  655. case "$with_dri_drivers" in
  656. no) ;;
  657. yes)
  658. DRI_DIRS="yes"
  659. ;;
  660. *)
  661. # verify the requested driver directories exist
  662. dri_drivers=`IFS=', '; echo $with_dri_drivers`
  663. for driver in $dri_drivers; do
  664. test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
  665. AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
  666. done
  667. DRI_DIRS="$dri_drivers"
  668. ;;
  669. esac
  670. dnl Set DRI_DIRS, DEFINES and LIB_DEPS
  671. if test "$mesa_driver" = dri; then
  672. # Use TLS in GLX?
  673. if test "x$GLX_USE_TLS" = xyes; then
  674. DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
  675. fi
  676. # Platform specific settings and drivers to build
  677. case "$host_os" in
  678. linux*)
  679. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  680. if test "x$driglx_direct" = xyes; then
  681. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  682. fi
  683. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
  684. case "$host_cpu" in
  685. x86_64)
  686. # sis is missing because they have not be converted to use
  687. # the new interface. i810 are missing because there is no
  688. # x86-64 system where they could *ever* be used.
  689. if test "x$DRI_DIRS" = "xyes"; then
  690. DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \
  691. savage tdfx unichrome swrast"
  692. fi
  693. ;;
  694. powerpc*)
  695. # Build only the drivers for cards that exist on PowerPC.
  696. # At some point MGA will be added, but not yet.
  697. if test "x$DRI_DIRS" = "xyes"; then
  698. DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
  699. fi
  700. ;;
  701. sparc*)
  702. # Build only the drivers for cards that exist on sparc`
  703. if test "x$DRI_DIRS" = "xyes"; then
  704. DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
  705. fi
  706. ;;
  707. esac
  708. ;;
  709. freebsd* | dragonfly*)
  710. DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
  711. DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
  712. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  713. if test "x$driglx_direct" = xyes; then
  714. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  715. fi
  716. if test "x$GXX" = xyes; then
  717. CXXFLAGS="$CXXFLAGS -ansi -pedantic"
  718. fi
  719. if test "x$DRI_DIRS" = "xyes"; then
  720. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
  721. unichrome savage sis swrast"
  722. fi
  723. ;;
  724. gnu*)
  725. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  726. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
  727. ;;
  728. solaris*)
  729. DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
  730. DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
  731. if test "x$driglx_direct" = xyes; then
  732. DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
  733. fi
  734. ;;
  735. esac
  736. # default drivers
  737. if test "x$DRI_DIRS" = "xyes"; then
  738. DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
  739. savage sis tdfx unichrome swrast"
  740. fi
  741. DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
  742. # Check for expat
  743. EXPAT_INCLUDES=""
  744. EXPAT_LIB=-lexpat
  745. AC_ARG_WITH([expat],
  746. [AS_HELP_STRING([--with-expat=DIR],
  747. [expat install directory])],[
  748. EXPAT_INCLUDES="-I$withval/include"
  749. CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
  750. LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
  751. EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
  752. ])
  753. AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
  754. AC_CHECK_LIB([expat],[XML_ParserCreate],[],
  755. [AC_MSG_ERROR([Expat required for DRI.])])
  756. # put all the necessary libs together
  757. DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
  758. fi
  759. AC_SUBST([DRI_DIRS])
  760. AC_SUBST([EXPAT_INCLUDES])
  761. AC_SUBST([DRI_LIB_DEPS])
  762. case $DRI_DIRS in
  763. *i915*|*i965*)
  764. PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.19])
  765. ;;
  766. esac
  767. case $DRI_DIRS in
  768. *radeon*|*r200*|*r300*|*r600*)
  769. PKG_CHECK_MODULES([LIBDRM_RADEON],
  770. [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
  771. HAVE_LIBDRM_RADEON=yes,
  772. HAVE_LIBDRM_RADEON=no)
  773. if test "$HAVE_LIBDRM_RADEON" = yes; then
  774. RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
  775. RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
  776. fi
  777. ;;
  778. esac
  779. AC_SUBST([RADEON_CFLAGS])
  780. AC_SUBST([RADEON_LDFLAGS])
  781. dnl
  782. dnl OSMesa configuration
  783. dnl
  784. if test "$mesa_driver" = xlib; then
  785. default_gl_osmesa=yes
  786. else
  787. default_gl_osmesa=no
  788. fi
  789. AC_ARG_ENABLE([gl-osmesa],
  790. [AS_HELP_STRING([--enable-gl-osmesa],
  791. [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
  792. [gl_osmesa="$enableval"],
  793. [gl_osmesa="$default_gl_osmesa"])
  794. if test "x$gl_osmesa" = xyes; then
  795. if test "$mesa_driver" = osmesa; then
  796. AC_MSG_ERROR([libGL is not available for OSMesa driver])
  797. else
  798. DRIVER_DIRS="$DRIVER_DIRS osmesa"
  799. fi
  800. fi
  801. dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
  802. AC_ARG_WITH([osmesa-bits],
  803. [AS_HELP_STRING([--with-osmesa-bits=BITS],
  804. [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
  805. [osmesa_bits="$withval"],
  806. [osmesa_bits=8])
  807. if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
  808. AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
  809. osmesa_bits=8
  810. fi
  811. case "x$osmesa_bits" in
  812. x8)
  813. OSMESA_LIB=OSMesa
  814. ;;
  815. x16|x32)
  816. OSMESA_LIB="OSMesa$osmesa_bits"
  817. DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
  818. ;;
  819. *)
  820. AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
  821. ;;
  822. esac
  823. AC_SUBST([OSMESA_LIB])
  824. case "$mesa_driver" in
  825. osmesa)
  826. # only link libraries with osmesa if shared
  827. if test "$enable_static" = no; then
  828. OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  829. else
  830. OSMESA_LIB_DEPS=""
  831. fi
  832. OSMESA_MESA_DEPS=""
  833. OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
  834. ;;
  835. *)
  836. # Link OSMesa to libGL otherwise
  837. OSMESA_LIB_DEPS=""
  838. # only link libraries with osmesa if shared
  839. if test "$enable_static" = no; then
  840. OSMESA_MESA_DEPS='-l$(GL_LIB)'
  841. else
  842. OSMESA_MESA_DEPS=""
  843. fi
  844. OSMESA_PC_REQ="gl"
  845. ;;
  846. esac
  847. OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
  848. AC_SUBST([OSMESA_LIB_DEPS])
  849. AC_SUBST([OSMESA_MESA_DEPS])
  850. AC_SUBST([OSMESA_PC_REQ])
  851. AC_SUBST([OSMESA_PC_LIB_PRIV])
  852. dnl
  853. dnl EGL configuration
  854. dnl
  855. AC_ARG_ENABLE([egl],
  856. [AS_HELP_STRING([--disable-egl],
  857. [disable EGL library @<:@default=enabled@:>@])],
  858. [enable_egl="$enableval"],
  859. [enable_egl=yes])
  860. if test "x$enable_egl" = xyes; then
  861. SRC_DIRS="$SRC_DIRS egl"
  862. EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
  863. EGL_DRIVERS_DIRS=""
  864. if test "$enable_static" != yes; then
  865. # build egl_glx when libGL is built
  866. if test "$mesa_driver" != osmesa; then
  867. EGL_DRIVERS_DIRS="glx"
  868. fi
  869. # build egl_dri2 when xcb-dri2 is available
  870. PKG_CHECK_MODULES([EGL_DRI2], [x11-xcb xcb-dri2 xcb-xfixes libdrm],
  871. [have_xcb_dri2=yes],[have_xcb_dri2=no])
  872. if test "$have_xcb_dri2" = yes; then
  873. EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2"
  874. fi
  875. fi
  876. if test "$with_demos" = yes; then
  877. PROGRAM_DIRS="$PROGRAM_DIRS egl/opengl"
  878. fi
  879. fi
  880. AC_SUBST([EGL_LIB_DEPS])
  881. AC_SUBST([EGL_DRIVERS_DIRS])
  882. dnl
  883. dnl GLU configuration
  884. dnl
  885. AC_ARG_ENABLE([glu],
  886. [AS_HELP_STRING([--disable-glu],
  887. [enable OpenGL Utility library @<:@default=enabled@:>@])],
  888. [enable_glu="$enableval"],
  889. [enable_glu=yes])
  890. if test "x$enable_glu" = xyes; then
  891. SRC_DIRS="$SRC_DIRS glu"
  892. case "$mesa_driver" in
  893. osmesa)
  894. # If GLU is available and we have libOSMesa (not 16 or 32),
  895. # we can build the osdemos
  896. if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
  897. PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
  898. fi
  899. # Link libGLU to libOSMesa instead of libGL
  900. GLU_LIB_DEPS=""
  901. GLU_PC_REQ="osmesa"
  902. if test "$enable_static" = no; then
  903. GLU_MESA_DEPS='-l$(OSMESA_LIB)'
  904. else
  905. GLU_MESA_DEPS=""
  906. fi
  907. ;;
  908. *)
  909. # If static, empty GLU_LIB_DEPS and add libs for programs to link
  910. GLU_PC_REQ="gl"
  911. GLU_PC_LIB_PRIV="-lm"
  912. if test "$enable_static" = no; then
  913. GLU_LIB_DEPS="-lm"
  914. GLU_MESA_DEPS='-l$(GL_LIB)'
  915. else
  916. GLU_LIB_DEPS=""
  917. GLU_MESA_DEPS=""
  918. APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
  919. fi
  920. ;;
  921. esac
  922. fi
  923. if test "$enable_static" = no; then
  924. GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
  925. fi
  926. GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
  927. AC_SUBST([GLU_LIB_DEPS])
  928. AC_SUBST([GLU_MESA_DEPS])
  929. AC_SUBST([GLU_PC_REQ])
  930. AC_SUBST([GLU_PC_REQ_PRIV])
  931. AC_SUBST([GLU_PC_LIB_PRIV])
  932. AC_SUBST([GLU_PC_CFLAGS])
  933. dnl
  934. dnl GLw configuration
  935. dnl
  936. AC_ARG_ENABLE([glw],
  937. [AS_HELP_STRING([--disable-glw],
  938. [enable Xt/Motif widget library @<:@default=enabled@:>@])],
  939. [enable_glw="$enableval"],
  940. [enable_glw=yes])
  941. dnl Don't build GLw on osmesa
  942. if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
  943. AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
  944. enable_glw=no
  945. fi
  946. AC_ARG_ENABLE([motif],
  947. [AS_HELP_STRING([--enable-motif],
  948. [use Motif widgets in GLw @<:@default=disabled@:>@])],
  949. [enable_motif="$enableval"],
  950. [enable_motif=no])
  951. if test "x$enable_glw" = xyes; then
  952. SRC_DIRS="$SRC_DIRS glw"
  953. if test "$x11_pkgconfig" = yes; then
  954. PKG_CHECK_MODULES([GLW],[x11 xt])
  955. GLW_PC_REQ_PRIV="x11 xt"
  956. GLW_LIB_DEPS="$GLW_LIBS"
  957. else
  958. # should check these...
  959. GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
  960. GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
  961. GLW_PC_CFLAGS="$X11_INCLUDES"
  962. fi
  963. GLW_SOURCES="GLwDrawA.c"
  964. MOTIF_CFLAGS=
  965. if test "x$enable_motif" = xyes; then
  966. GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
  967. AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
  968. if test "x$MOTIF_CONFIG" != xno; then
  969. MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
  970. MOTIF_LIBS=`$MOTIF_CONFIG --libs`
  971. else
  972. AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
  973. [AC_MSG_ERROR([Can't locate Motif headers])])
  974. AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
  975. [AC_MSG_ERROR([Can't locate Motif Xm library])])
  976. fi
  977. # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
  978. GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
  979. GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
  980. GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
  981. fi
  982. # If static, empty GLW_LIB_DEPS and add libs for programs to link
  983. GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV"
  984. if test "$enable_static" = no; then
  985. GLW_MESA_DEPS='-l$(GL_LIB)'
  986. GLW_LIB_DEPS="$GLW_LIB_DEPS"
  987. else
  988. APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
  989. GLW_LIB_DEPS=""
  990. GLW_MESA_DEPS=""
  991. fi
  992. fi
  993. AC_SUBST([GLW_LIB_DEPS])
  994. AC_SUBST([GLW_MESA_DEPS])
  995. AC_SUBST([GLW_SOURCES])
  996. AC_SUBST([MOTIF_CFLAGS])
  997. AC_SUBST([GLW_PC_REQ_PRIV])
  998. AC_SUBST([GLW_PC_LIB_PRIV])
  999. AC_SUBST([GLW_PC_CFLAGS])
  1000. dnl
  1001. dnl GLUT configuration
  1002. dnl
  1003. if test -f "$srcdir/include/GL/glut.h"; then
  1004. default_glut=yes
  1005. else
  1006. default_glut=no
  1007. fi
  1008. AC_ARG_ENABLE([glut],
  1009. [AS_HELP_STRING([--disable-glut],
  1010. [enable GLUT library @<:@default=enabled if source available@:>@])],
  1011. [enable_glut="$enableval"],
  1012. [enable_glut="$default_glut"])
  1013. dnl Can't build glut if GLU not available
  1014. if test "x$enable_glu$enable_glut" = xnoyes; then
  1015. AC_MSG_WARN([Disabling glut since GLU is disabled])
  1016. enable_glut=no
  1017. fi
  1018. dnl Don't build glut on osmesa
  1019. if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
  1020. AC_MSG_WARN([Disabling glut since the driver is OSMesa])
  1021. enable_glut=no
  1022. fi
  1023. if test "x$enable_glut" = xyes; then
  1024. SRC_DIRS="$SRC_DIRS glut/glx"
  1025. GLUT_CFLAGS=""
  1026. if test "x$GCC" = xyes; then
  1027. GLUT_CFLAGS="-fexceptions"
  1028. fi
  1029. if test "$x11_pkgconfig" = yes; then
  1030. PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
  1031. GLUT_PC_REQ_PRIV="x11 xmu xi"
  1032. GLUT_LIB_DEPS="$GLUT_LIBS"
  1033. else
  1034. # should check these...
  1035. GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
  1036. GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
  1037. GLUT_PC_CFLAGS="$X11_INCLUDES"
  1038. fi
  1039. GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
  1040. GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
  1041. # If glut is available, we can build most programs
  1042. if test "$with_demos" = yes; then
  1043. PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
  1044. fi
  1045. # If static, empty GLUT_LIB_DEPS and add libs for programs to link
  1046. if test "$enable_static" = no; then
  1047. GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
  1048. else
  1049. APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
  1050. GLUT_LIB_DEPS=""
  1051. GLUT_MESA_DEPS=""
  1052. fi
  1053. fi
  1054. AC_SUBST([GLUT_LIB_DEPS])
  1055. AC_SUBST([GLUT_MESA_DEPS])
  1056. AC_SUBST([GLUT_CFLAGS])
  1057. AC_SUBST([GLUT_PC_REQ_PRIV])
  1058. AC_SUBST([GLUT_PC_LIB_PRIV])
  1059. AC_SUBST([GLUT_PC_CFLAGS])
  1060. dnl
  1061. dnl Program library dependencies
  1062. dnl Only libm is added here if necessary as the libraries should
  1063. dnl be pulled in by the linker
  1064. dnl
  1065. if test "x$APP_LIB_DEPS" = x; then
  1066. case "$host_os" in
  1067. solaris*)
  1068. APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
  1069. ;;
  1070. cygwin*)
  1071. APP_LIB_DEPS="-lX11"
  1072. ;;
  1073. *)
  1074. APP_LIB_DEPS="-lm"
  1075. ;;
  1076. esac
  1077. fi
  1078. AC_SUBST([APP_LIB_DEPS])
  1079. AC_SUBST([PROGRAM_DIRS])
  1080. dnl
  1081. dnl Gallium configuration
  1082. dnl
  1083. AC_ARG_ENABLE([gallium],
  1084. [AS_HELP_STRING([--disable-gallium],
  1085. [build gallium @<:@default=enabled@:>@])],
  1086. [enable_gallium="$enableval"],
  1087. [enable_gallium=yes])
  1088. if test "x$enable_gallium" = xyes; then
  1089. SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
  1090. fi
  1091. dnl
  1092. dnl Gallium state trackers configuration
  1093. dnl
  1094. AC_ARG_WITH([state-trackers],
  1095. [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
  1096. [comma delimited state_trackers list, e.g.
  1097. "egl,glx" @<:@default=auto@:>@])],
  1098. [with_state_trackers="$withval"],
  1099. [with_state_trackers=yes])
  1100. case "$with_state_trackers" in
  1101. no)
  1102. GALLIUM_STATE_TRACKERS_DIRS=""
  1103. ;;
  1104. yes)
  1105. # look at what else is built
  1106. case "$mesa_driver" in
  1107. xlib)
  1108. GALLIUM_STATE_TRACKERS_DIRS=glx
  1109. ;;
  1110. dri)
  1111. GALLIUM_STATE_TRACKERS_DIRS="dri"
  1112. HAVE_ST_DRI="yes"
  1113. if test "x$enable_egl" = xyes; then
  1114. GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
  1115. HAVE_ST_EGL="yes"
  1116. fi
  1117. # Have only tested st/xorg on 1.6.0 servers
  1118. PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
  1119. HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
  1120. HAVE_ST_XORG="no")
  1121. ;;
  1122. esac
  1123. ;;
  1124. *)
  1125. # verify the requested state tracker exist
  1126. state_trackers=`IFS=', '; echo $with_state_trackers`
  1127. for tracker in $state_trackers; do
  1128. test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
  1129. AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
  1130. case "$tracker" in
  1131. dri)
  1132. if test "x$mesa_driver" != xdri; then
  1133. AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri])
  1134. fi
  1135. HAVE_ST_DRI="yes"
  1136. ;;
  1137. egl)
  1138. if test "x$enable_egl" != xyes; then
  1139. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1140. fi
  1141. HAVE_ST_EGL="yes"
  1142. ;;
  1143. xorg)
  1144. PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
  1145. PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
  1146. HAVE_ST_XORG="yes"
  1147. ;;
  1148. es)
  1149. # mesa/es is required to build es state tracker
  1150. CORE_DIRS="$CORE_DIRS mesa/es"
  1151. ;;
  1152. esac
  1153. done
  1154. GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
  1155. ;;
  1156. esac
  1157. if test "x$HAVE_ST_XORG" = xyes; then
  1158. PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
  1159. HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
  1160. HAVE_XEXTPROTO_71="no")
  1161. fi
  1162. AC_ARG_WITH([egl-displays],
  1163. [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
  1164. [comma delimited native displays libEGL supports, e.g.
  1165. "x11,kms" @<:@default=auto@:>@])],
  1166. [with_egl_displays="$withval"],
  1167. [with_egl_displays=yes])
  1168. EGL_DISPLAYS=""
  1169. case "$with_egl_displays" in
  1170. yes)
  1171. if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
  1172. EGL_DISPLAYS="x11"
  1173. fi
  1174. ;;
  1175. *)
  1176. if test "x$enable_egl" != xyes; then
  1177. AC_MSG_ERROR([cannot build egl state tracker without EGL library])
  1178. fi
  1179. # verify the requested driver directories exist
  1180. egl_displays=`IFS=', '; echo $with_egl_displays`
  1181. for dpy in $egl_displays; do
  1182. test -d "$srcdir/src/gallium/state_trackers/egl/$dpy" || \
  1183. AC_MSG_ERROR([EGL display '$dpy' does't exist])
  1184. done
  1185. EGL_DISPLAYS="$egl_displays"
  1186. ;;
  1187. esac
  1188. AC_SUBST([EGL_DISPLAYS])
  1189. AC_ARG_WITH([egl-driver-dir],
  1190. [AS_HELP_STRING([--with-egl-driver-dir=DIR],
  1191. [directory for EGL drivers [[default=${libdir}/egl]]])],
  1192. [EGL_DRIVER_INSTALL_DIR="$withval"],
  1193. [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
  1194. AC_SUBST([EGL_DRIVER_INSTALL_DIR])
  1195. AC_ARG_WITH([xorg-driver-dir],
  1196. [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
  1197. [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
  1198. [XORG_DRIVER_INSTALL_DIR="$withval"],
  1199. [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
  1200. AC_SUBST([XORG_DRIVER_INSTALL_DIR])
  1201. AC_ARG_WITH([max-width],
  1202. [AS_HELP_STRING([--with-max-width=N],
  1203. [Maximum framebuffer width (4096)])],
  1204. [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
  1205. AS_IF([test "${withval}" -gt "4096"],
  1206. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1207. )
  1208. AC_ARG_WITH([max-height],
  1209. [AS_HELP_STRING([--with-max-height=N],
  1210. [Maximum framebuffer height (4096)])],
  1211. [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
  1212. AS_IF([test "${withval}" -gt "4096"],
  1213. [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
  1214. )
  1215. dnl
  1216. dnl Gallium helper functions
  1217. dnl
  1218. gallium_check_st() {
  1219. if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_EGL" = xyes || test "x$HAVE_ST_XORG" = xyes; then
  1220. GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
  1221. fi
  1222. if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
  1223. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
  1224. fi
  1225. if test "x$HAVE_ST_EGL" = xyes && test "x$3" != x; then
  1226. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
  1227. fi
  1228. if test "x$HAVE_ST_XORG" = xyes && test "x$4" != x; then
  1229. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
  1230. fi
  1231. }
  1232. dnl
  1233. dnl Gallium SVGA configuration
  1234. dnl
  1235. AC_ARG_ENABLE([gallium-svga],
  1236. [AS_HELP_STRING([--enable-gallium-svga],
  1237. [build gallium SVGA @<:@default=disabled@:>@])],
  1238. [enable_gallium_svga="$enableval"],
  1239. [enable_gallium_svga=auto])
  1240. if test "x$enable_gallium_svga" = xyes; then
  1241. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
  1242. gallium_check_st "svga/drm" "dri-vmwgfx" "egl-vmwgfx" "xorg-vmwgfx"
  1243. elif test "x$enable_gallium_svga" = xauto; then
  1244. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
  1245. fi
  1246. dnl
  1247. dnl Gallium Intel configuration
  1248. dnl
  1249. AC_ARG_ENABLE([gallium-intel],
  1250. [AS_HELP_STRING([--enable-gallium-intel],
  1251. [build gallium intel @<:@default=disabled@:>@])],
  1252. [enable_gallium_intel="$enableval"],
  1253. [enable_gallium_intel=auto])
  1254. if test "x$enable_gallium_intel" = xyes; then
  1255. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
  1256. gallium_check_st "i915/drm i965/drm" "dri-i915 dri-i965" "egl-i915 egl-i965" "xorg-i915 xorg-i965"
  1257. elif test "x$enable_gallium_intel" = xauto; then
  1258. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
  1259. fi
  1260. dnl
  1261. dnl Gallium Radeon configuration
  1262. dnl
  1263. AC_ARG_ENABLE([gallium-radeon],
  1264. [AS_HELP_STRING([--enable-gallium-radeon],
  1265. [build gallium radeon @<:@default=disabled@:>@])],
  1266. [enable_gallium_radeon="$enableval"],
  1267. [enable_gallium_radeon=auto])
  1268. if test "x$enable_gallium_radeon" = xyes; then
  1269. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1270. gallium_check_st "radeon/drm" "dri-radeong" "egl-radeon" "xorg-radeon"
  1271. elif test "x$enable_gallium_radeon" = xauto; then
  1272. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
  1273. fi
  1274. dnl
  1275. dnl Gallium Nouveau configuration
  1276. dnl
  1277. AC_ARG_ENABLE([gallium-nouveau],
  1278. [AS_HELP_STRING([--enable-gallium-nouveau],
  1279. [build gallium nouveau @<:@default=disabled@:>@])],
  1280. [enable_gallium_nouveau="$enableval"],
  1281. [enable_gallium_nouveau=no])
  1282. if test "x$enable_gallium_nouveau" = xyes; then
  1283. GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
  1284. gallium_check_st "nouveau/drm" "dri-nouveau" "egl-nouveau" "xorg-nouveau"
  1285. fi
  1286. dnl
  1287. dnl Gallium swrast configuration
  1288. dnl
  1289. AC_ARG_ENABLE([gallium-swrast],
  1290. [AS_HELP_STRING([--enable-gallium-swrast],
  1291. [build gallium swrast @<:@default=auto@:>@])],
  1292. [enable_gallium_swrast="$enableval"],
  1293. [enable_gallium_swrast=auto])
  1294. if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then
  1295. if test "x$HAVE_ST_DRI" = xyes; then
  1296. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
  1297. fi
  1298. if test "x$HAVE_ST_EGL" = xyes; then
  1299. GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-swrast"
  1300. fi
  1301. fi
  1302. dnl prepend CORE_DIRS to SRC_DIRS
  1303. SRC_DIRS="$CORE_DIRS $SRC_DIRS"
  1304. dnl Restore LDFLAGS and CPPFLAGS
  1305. LDFLAGS="$_SAVE_LDFLAGS"
  1306. CPPFLAGS="$_SAVE_CPPFLAGS"
  1307. dnl Substitute the config
  1308. AC_CONFIG_FILES([configs/autoconf])
  1309. dnl Replace the configs/current symlink
  1310. AC_CONFIG_COMMANDS([configs],[
  1311. if test -f configs/current || test -L configs/current; then
  1312. rm -f configs/current
  1313. fi
  1314. ln -s autoconf configs/current
  1315. ])
  1316. AC_OUTPUT
  1317. dnl
  1318. dnl Output some configuration info for the user
  1319. dnl
  1320. echo ""
  1321. echo " prefix: $prefix"
  1322. echo " exec_prefix: $exec_prefix"
  1323. echo " libdir: $libdir"
  1324. echo " includedir: $includedir"
  1325. dnl Driver info
  1326. echo ""
  1327. echo " Driver: $mesa_driver"
  1328. if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
  1329. echo " OSMesa: lib$OSMESA_LIB"
  1330. else
  1331. echo " OSMesa: no"
  1332. fi
  1333. if test "$mesa_driver" = dri; then
  1334. # cleanup the drivers var
  1335. dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1336. if test "x$DRI_DIRS" = x; then
  1337. echo " DRI drivers: no"
  1338. else
  1339. echo " DRI drivers: $dri_dirs"
  1340. fi
  1341. echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
  1342. fi
  1343. echo " Use XCB: $enable_xcb"
  1344. echo ""
  1345. if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
  1346. echo " Gallium: yes"
  1347. echo " Gallium dirs: $GALLIUM_DIRS"
  1348. echo " Target dirs: $GALLIUM_TARGET_DIRS"
  1349. echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
  1350. echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
  1351. echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
  1352. else
  1353. echo " Gallium: no"
  1354. fi
  1355. dnl Libraries
  1356. echo ""
  1357. echo " Shared libs: $enable_shared"
  1358. echo " Static libs: $enable_static"
  1359. if test "$enable_egl" = yes; then
  1360. echo " EGL: $EGL_DRIVERS_DIRS"
  1361. else
  1362. echo " EGL: no"
  1363. fi
  1364. echo " GLU: $enable_glu"
  1365. echo " GLw: $enable_glw (Motif: $enable_motif)"
  1366. echo " glut: $enable_glut"
  1367. dnl Programs
  1368. # cleanup the programs var for display
  1369. program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1370. if test "x$program_dirs" = x; then
  1371. echo " Demos: no"
  1372. else
  1373. echo " Demos: $program_dirs"
  1374. fi
  1375. dnl Compiler options
  1376. # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
  1377. cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1378. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1379. cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
  1380. $SED 's/^ *//;s/ */ /;s/ *$//'`
  1381. defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
  1382. echo ""
  1383. echo " CFLAGS: $cflags"
  1384. echo " CXXFLAGS: $cxxflags"
  1385. echo " Macros: $defines"
  1386. echo ""
  1387. echo " Run '${MAKE-make}' to build Mesa"
  1388. echo ""