Home | History | Annotate | Download | only in libdrm
      1 #  Copyright 2005 Adam Jackson.
      2 #
      3 #  Permission is hereby granted, free of charge, to any person obtaining a
      4 #  copy of this software and associated documentation files (the "Software"),
      5 #  to deal in the Software without restriction, including without limitation
      6 #  on the rights to use, copy, modify, merge, publish, distribute, sub
      7 #  license, and/or sell copies of the Software, and to permit persons to whom
      8 #  the Software is furnished to do so, subject to the following conditions:
      9 #
     10 #  The above copyright notice and this permission notice (including the next
     11 #  paragraph) shall be included in all copies or substantial portions of the
     12 #  Software.
     13 #
     14 #  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15 #  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16 #  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
     17 #  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
     18 #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     19 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     20 
     21 AC_PREREQ([2.63])
     22 AC_INIT([libdrm],
     23         [2.4.75],
     24         [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
     25         [libdrm])
     26 
     27 AC_CONFIG_HEADERS([config.h])
     28 AC_CONFIG_SRCDIR([Makefile.am])
     29 AC_CONFIG_MACRO_DIR([m4])
     30 AC_CONFIG_AUX_DIR([build-aux])
     31 
     32 # Require xorg-macros minimum of 1.12 for XORG_WITH_XSLTPROC
     33 m4_ifndef([XORG_MACROS_VERSION],
     34           [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
     35 XORG_MACROS_VERSION(1.12)
     36 XORG_WITH_XSLTPROC
     37 XORG_MANPAGE_SECTIONS
     38 
     39 AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2])
     40 
     41 # Enable quiet compiles on automake 1.11.
     42 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
     43 
     44 # Check for programs
     45 AC_PROG_CC
     46 AC_PROG_CC_C99
     47 
     48 if test "x$ac_cv_prog_cc_c99" = xno; then
     49 	AC_MSG_ERROR([Building libdrm requires C99 enabled compiler])
     50 fi
     51 
     52 AC_USE_SYSTEM_EXTENSIONS
     53 AC_SYS_LARGEFILE
     54 AC_FUNC_ALLOCA
     55 
     56 AC_HEADER_MAJOR
     57 AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
     58 
     59 # Initialize libtool
     60 LT_PREREQ([2.2])
     61 LT_INIT([disable-static])
     62 
     63 
     64 
     65 AC_SUBST(PTHREADSTUBS_CFLAGS)
     66 AC_SUBST(PTHREADSTUBS_LIBS)
     67 
     68 pkgconfigdir=${libdir}/pkgconfig
     69 AC_SUBST(pkgconfigdir)
     70 AC_ARG_ENABLE([udev],
     71               [AS_HELP_STRING([--enable-udev],
     72                               [Enable support for using udev instead of mknod (default: disabled)])],
     73               [UDEV=$enableval], [UDEV=no])
     74 
     75 AC_ARG_ENABLE(libkms,
     76 	      AS_HELP_STRING([--disable-libkms],
     77 	      [Disable KMS mm abstraction library (default: auto, enabled on supported platforms)]),
     78 	      [LIBKMS=$enableval], [LIBKMS=auto])
     79 
     80 AC_ARG_ENABLE(intel,
     81 	      AS_HELP_STRING([--disable-intel],
     82 	      [Enable support for intel's KMS API (default: auto, enabled on x86)]),
     83 	      [INTEL=$enableval], [INTEL=auto])
     84 
     85 AC_ARG_ENABLE(radeon,
     86 	      AS_HELP_STRING([--disable-radeon],
     87 	      [Enable support for radeon's KMS API (default: auto)]),
     88 	      [RADEON=$enableval], [RADEON=auto])
     89 
     90 AC_ARG_ENABLE(amdgpu,
     91 	      AS_HELP_STRING([--disable-amdgpu],
     92 	      [Enable support for amdgpu's KMS API (default: auto)]),
     93 	      [AMDGPU=$enableval], [AMDGPU=auto])
     94 
     95 AC_ARG_ENABLE(nouveau,
     96 	      AS_HELP_STRING([--disable-nouveau],
     97 	      [Enable support for nouveau's KMS API (default: auto)]),
     98 	      [NOUVEAU=$enableval], [NOUVEAU=auto])
     99 
    100 AC_ARG_ENABLE(vmwgfx,
    101 	      AS_HELP_STRING([--disable-vmwgfx],
    102 	      [Enable support for vmwgfx's KMS API (default: yes)]),
    103 	      [VMWGFX=$enableval], [VMWGFX=yes])
    104 
    105 AC_ARG_ENABLE(omap-experimental-api,
    106 	      AS_HELP_STRING([--enable-omap-experimental-api],
    107 	      [Enable support for OMAP's experimental API (default: disabled)]),
    108 	      [OMAP=$enableval], [OMAP=no])
    109 
    110 AC_ARG_ENABLE(exynos-experimental-api,
    111 	      AS_HELP_STRING([--enable-exynos-experimental-api],
    112 	      [Enable support for EXYNOS's experimental API (default: disabled)]),
    113 	      [EXYNOS=$enableval], [EXYNOS=no])
    114 
    115 AC_ARG_ENABLE(freedreno,
    116 	      AS_HELP_STRING([--disable-freedreno],
    117 	      [Enable support for freedreno's KMS API (default: auto, enabled on arm)]),
    118 	      [FREEDRENO=$enableval], [FREEDRENO=auto])
    119 
    120 AC_ARG_ENABLE(freedreno-kgsl,
    121 	      AS_HELP_STRING([--enable-freedreno-kgsl],
    122 	      [Enable support for freedreno's to use downstream android kernel API (default: disabled)]),
    123 	      [FREEDRENO_KGSL=$enableval], [FREEDRENO_KGSL=no])
    124 
    125 AC_ARG_ENABLE(tegra-experimental-api,
    126 	      AS_HELP_STRING([--enable-tegra-experimental-api],
    127 	      [Enable support for Tegra's experimental API (default: disabled)]),
    128 	      [TEGRA=$enableval], [TEGRA=no])
    129 
    130 AC_ARG_ENABLE(rockchip-experimental-api,
    131 	      AS_HELP_STRING([--enable-rockchip-experimental-api],
    132 	      [Enable support for rockchip's experimental API (default: disabled)]),
    133 	      [ROCKCHIP=$enableval], [ROCKCHIP=no])
    134 
    135 AC_ARG_ENABLE(vc4,
    136 	      AS_HELP_STRING([--disable-vc4],
    137 	      [Enable support for vc4's API (default: auto, enabled on arm)]),
    138 	      [VC4=$enableval], [VC4=auto])
    139 
    140 AC_ARG_ENABLE(etnaviv-experimental-api,
    141 	      AS_HELP_STRING([--enable-etnaviv-experimental-api],
    142 	      [Enable support for etnaviv's experimental API (default: disabled)]),
    143 	      [ETNAVIV=$enableval], [ETNAVIV=no])
    144 
    145 AC_ARG_ENABLE(install-test-programs,
    146 		  AS_HELP_STRING([--enable-install-test-programs],
    147 		  [Install test programs (default: no)]),
    148 		  [INSTALL_TESTS=$enableval], [INSTALL_TESTS=no])
    149 
    150 dnl ===========================================================================
    151 dnl check compiler flags
    152 AC_DEFUN([LIBDRM_CC_TRY_FLAG], [
    153   AC_MSG_CHECKING([whether $CC supports $1])
    154 
    155   libdrm_save_CFLAGS="$CFLAGS"
    156   CFLAGS="$CFLAGS $1"
    157 
    158   AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ])], [libdrm_cc_flag=yes], [libdrm_cc_flag=no])
    159   CFLAGS="$libdrm_save_CFLAGS"
    160 
    161   if test "x$libdrm_cc_flag" = "xyes"; then
    162     ifelse([$2], , :, [$2])
    163   else
    164     ifelse([$3], , :, [$3])
    165   fi
    166   AC_MSG_RESULT([$libdrm_cc_flag])
    167 ])
    168 
    169 dnl We use clock_gettime to check for timeouts in drmWaitVBlank
    170 
    171 AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
    172                [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
    173                              [AC_MSG_ERROR([Couldn't find clock_gettime])])])
    174 AC_SUBST([CLOCK_LIB])
    175 
    176 AC_CHECK_FUNCS([open_memstream], [HAVE_OPEN_MEMSTREAM=yes])
    177 
    178 dnl Use lots of warning flags with with gcc and compatible compilers
    179 
    180 dnl Note: if you change the following variable, the cache is automatically
    181 dnl skipped and all flags rechecked.  So there's no need to do anything
    182 dnl else.  If for any reason you need to force a recheck, just change
    183 dnl MAYBE_WARN in an ignorable way (like adding whitespace)
    184 
    185 MAYBE_WARN="-Wall -Wextra \
    186 -Wsign-compare -Werror-implicit-function-declaration \
    187 -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
    188 -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
    189 -Wpacked -Wswitch-enum -Wmissing-format-attribute \
    190 -Wstrict-aliasing=2 -Winit-self \
    191 -Wdeclaration-after-statement -Wold-style-definition \
    192 -Wno-unused-parameter \
    193 -Wno-attributes -Wno-long-long -Winline -Wshadow \
    194 -Wno-missing-field-initializers"
    195 
    196 # invalidate cached value if MAYBE_WARN has changed
    197 if test "x$libdrm_cv_warn_maybe" != "x$MAYBE_WARN"; then
    198 	unset libdrm_cv_warn_cflags
    199 fi
    200 AC_CACHE_CHECK([for supported warning flags], libdrm_cv_warn_cflags, [
    201 	echo
    202 	WARN_CFLAGS=""
    203 
    204 	# Some warning options are not supported by all versions of
    205 	# gcc, so test all desired options against the current
    206 	# compiler.
    207 	#
    208 	# Note that there are some order dependencies
    209 	# here. Specifically, an option that disables a warning will
    210 	# have no net effect if a later option then enables that
    211 	# warnings, (perhaps implicitly). So we put some grouped
    212 	# options (-Wall and -Wextra) up front and the -Wno options
    213 	# last.
    214 
    215 	for W in $MAYBE_WARN; do
    216 		LIBDRM_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
    217 	done
    218 
    219 	libdrm_cv_warn_cflags=$WARN_CFLAGS
    220 	libdrm_cv_warn_maybe=$MAYBE_WARN
    221 
    222 	AC_MSG_CHECKING([which warning flags were supported])])
    223 WARN_CFLAGS="$libdrm_cv_warn_cflags"
    224 
    225 # Check for atomic intrinsics
    226 AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, [
    227 	drm_cv_atomic_primitives="none"
    228 
    229 	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
    230 	int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); }
    231 	int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); }
    232 					  ]],[[]])], [drm_cv_atomic_primitives="Intel"],[])
    233 
    234 	if test "x$drm_cv_atomic_primitives" = "xnone"; then
    235 		AC_CHECK_HEADER([atomic_ops.h], drm_cv_atomic_primitives="libatomic-ops")
    236 	fi
    237 
    238 	# atomic functions defined in <atomic.h> & libc on Solaris
    239 	if test "x$drm_cv_atomic_primitives" = "xnone"; then
    240 		AC_CHECK_FUNC([atomic_cas_uint], drm_cv_atomic_primitives="Solaris")
    241 	fi
    242 ])
    243 
    244 if test "x$drm_cv_atomic_primitives" = xIntel; then
    245 	AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 1,
    246 		[Enable if your compiler supports the Intel __sync_* atomic primitives])
    247 fi
    248 if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then
    249 	AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed])
    250 fi
    251 
    252 dnl Print out the approapriate message considering the value set be the
    253 dnl respective in $1.
    254 dnl $1 - value to be evaluated. Eg. $INTEL, $NOUVEAU, ...
    255 dnl $2 - libdrm shortname. Eg. intel, freedreno, ...
    256 dnl $3 - GPU name/brand. Eg. Intel, NVIDIA Tegra, ...
    257 dnl $4 - Configure switch. Eg. intel, omap-experimental-api, ...
    258 AC_DEFUN([LIBDRM_ATOMICS_NOT_FOUND_MSG], [
    259 	case "x$1" in
    260 		xyes)	AC_MSG_ERROR([libdrm_$2 depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for $3 GPUs by passing --disable-$4 to ./configure]) ;;
    261 		xauto)	AC_MSG_WARN([Disabling $2. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.]) ;;
    262 		*)	;;
    263 	esac
    264 ])
    265 
    266 if test "x$drm_cv_atomic_primitives" = "xnone"; then
    267 	LIBDRM_ATOMICS_NOT_FOUND_MSG($INTEL, intel, Intel, intel)
    268 	INTEL=no
    269 
    270 	LIBDRM_ATOMICS_NOT_FOUND_MSG($RADEON, radeon, Radeon, radeon)
    271 	RADEON=no
    272 
    273 	LIBDRM_ATOMICS_NOT_FOUND_MSG($AMDGPU, amdgpu, AMD, amdgpu)
    274 	AMDGPU=no
    275 
    276 	LIBDRM_ATOMICS_NOT_FOUND_MSG($NOUVEAU, nouveau, NVIDIA, nouveau)
    277 	NOUVEAU=no
    278 
    279 	LIBDRM_ATOMICS_NOT_FOUND_MSG($OMAP, omap, OMAP, omap-experimental-api)
    280 	OMAP=no
    281 
    282 	LIBDRM_ATOMICS_NOT_FOUND_MSG($FREEDRENO, freedreno, Qualcomm Adreno, freedreno)
    283 	FREEDRENO=no
    284 
    285 	LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, tegra-experimental-api)
    286 	TEGRA=no
    287 
    288 	LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, etnaviv-experimental-api)
    289 	ETNAVIV=no
    290 else
    291 	if test "x$INTEL" = xauto; then
    292 		case $host_cpu in
    293 			i?86|x86_64)	INTEL=yes ;;
    294 			*)		INTEL=no ;;
    295 		esac
    296 	fi
    297 	if test "x$RADEON" = xauto; then
    298 		RADEON=yes
    299 	fi
    300 	if test "x$AMDGPU" = xauto; then
    301 		AMDGPU=yes
    302 	fi
    303 	if test "x$NOUVEAU" = xauto; then
    304 		NOUVEAU=yes
    305 	fi
    306 	if test "x$FREEDRENO" = xauto; then
    307 		case $host_cpu in
    308 			arm*|aarch64)	FREEDRENO=yes ;;
    309 			*)		FREEDRENO=no ;;
    310 		esac
    311 	fi
    312 	if test "x$VC4" = xauto; then
    313 		case $host_cpu in
    314 			arm*|aarch64)	VC4=yes ;;
    315 			*)		VC4=no ;;
    316 		esac
    317 	fi
    318 fi
    319 
    320 if test "x$INTEL" != "xno"; then
    321 	PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
    322 fi
    323 AC_SUBST(PCIACCESS_CFLAGS)
    324 AC_SUBST(PCIACCESS_LIBS)
    325 
    326 if test "x$UDEV" = xyes; then
    327 	AC_DEFINE(UDEV, 1, [Have UDEV support])
    328 fi
    329 
    330 AC_CANONICAL_HOST
    331 if test "x$LIBKMS" = xauto ; then
    332 	case $host_os in
    333 		linux*)		LIBKMS="yes" ;;
    334 		freebsd* | kfreebsd*-gnu)
    335 				LIBKMS="yes" ;;
    336 		dragonfly*)	LIBKMS="yes" ;;
    337 		*)		LIBKMS="no" ;;
    338 	esac
    339 fi
    340 
    341 AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes])
    342 
    343 AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
    344 if test "x$INTEL" = xyes; then
    345 	AC_DEFINE(HAVE_INTEL, 1, [Have intel support])
    346 fi
    347 
    348 AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes])
    349 if test "x$VMWGFX" = xyes; then
    350 	AC_DEFINE(HAVE_VMWGFX, 1, [Have vmwgfx kernel headers])
    351 fi
    352 
    353 AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
    354 if test "x$NOUVEAU" = xyes; then
    355 	AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau (nvidia) support])
    356 fi
    357 
    358 AM_CONDITIONAL(HAVE_OMAP, [test "x$OMAP" = xyes])
    359 if test "x$OMAP" = xyes; then
    360 	AC_DEFINE(HAVE_OMAP, 1, [Have OMAP support])
    361 fi
    362 
    363 AM_CONDITIONAL(HAVE_EXYNOS, [test "x$EXYNOS" = xyes])
    364 if test "x$EXYNOS" = xyes; then
    365 	AC_DEFINE(HAVE_EXYNOS, 1, [Have EXYNOS support])
    366 fi
    367 
    368 AM_CONDITIONAL(HAVE_FREEDRENO, [test "x$FREEDRENO" = xyes])
    369 if test "x$FREEDRENO" = xyes; then
    370 	AC_DEFINE(HAVE_FREEDRENO, 1, [Have freedreno support])
    371 fi
    372 
    373 if test "x$FREEDRENO_KGSL" = xyes; then
    374 	if test "x$FREEDRENO" != xyes; then
    375 		AC_MSG_ERROR([Cannot enable freedreno KGSL interface if freedreno is disabled])
    376 	fi
    377 fi
    378 AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes])
    379 if test "x$FREEDRENO_KGSL" = xyes; then
    380 	AC_DEFINE(HAVE_FREEDRENO_KGSL, 1, [Have freedreno support for KGSL kernel interface])
    381 fi
    382 
    383 AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes])
    384 if test "x$RADEON" = xyes; then
    385 	AC_DEFINE(HAVE_RADEON, 1, [Have radeon support])
    386 fi
    387 
    388 if test "x$AMDGPU" != xno; then
    389 	# Detect cunit library
    390 	PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
    391 	# If pkg-config does not find cunit, check it using AC_CHECK_LIB.  We
    392 	# do this because Debian (Ubuntu) lacks pkg-config file for cunit.
    393 	# fixed in 2.1-2.dfsg-3: http://anonscm.debian.org/cgit/collab-maint/cunit.git/commit/?h=debian
    394 	if test "x${have_cunit}" = "xno"; then
    395 		AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no])
    396 		if test "x${have_cunit}" = "xyes"; then
    397 			CUNIT_LIBS="-lcunit"
    398 			CUNIT_CFLAGS=""
    399 			AC_SUBST([CUNIT_LIBS])
    400 			AC_SUBST([CUNIT_CFLAGS])
    401 		fi
    402 	fi
    403 else
    404 	have_cunit=no
    405 fi
    406 AM_CONDITIONAL(HAVE_CUNIT, [test "x$have_cunit" != "xno"])
    407 
    408 AM_CONDITIONAL(HAVE_AMDGPU, [test "x$AMDGPU" = xyes])
    409 if test "x$AMDGPU" = xyes; then
    410 	AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support])
    411 
    412 	AC_DEFINE(HAVE_CUNIT, [test "x$have_cunit" != "xno"], [Enable CUNIT Have amdgpu support])
    413 
    414 	if test "x$have_cunit" = "xno"; then
    415 		AC_MSG_WARN([Could not find cunit library. Disabling amdgpu tests])
    416 	fi
    417 fi
    418 
    419 AM_CONDITIONAL(HAVE_TEGRA, [test "x$TEGRA" = xyes])
    420 if test "x$TEGRA" = xyes; then
    421 	AC_DEFINE(HAVE_TEGRA, 1, [Have Tegra support])
    422 fi
    423 
    424 AM_CONDITIONAL(HAVE_ROCKCHIP, [test "x$ROCKCHIP" = xyes])
    425 if test "x$ROCKCHIP" = xyes; then
    426 	AC_DEFINE(HAVE_ROCKCHIP, 1, [Have ROCKCHIP support])
    427 
    428 AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes])
    429 if test "x$VC4" = xyes; then
    430 	AC_DEFINE(HAVE_VC4, 1, [Have VC4 support])
    431 fi
    432 
    433 AM_CONDITIONAL(HAVE_ETNAVIV, [test "x$ETNAVIV" = xyes])
    434 if test "x$ETNAVIV" = xyes; then
    435 	AC_DEFINE(HAVE_ETNAVIV, 1, [Have etnaviv support])
    436 fi
    437 
    438 AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes])
    439 if test "x$INSTALL_TESTS" = xyes; then
    440 	AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs])
    441 fi
    442 
    443 AC_ARG_ENABLE([cairo-tests],
    444               [AS_HELP_STRING([--enable-cairo-tests],
    445                               [Enable support for Cairo rendering in tests (default: auto)])],
    446               [CAIRO=$enableval], [CAIRO=auto])
    447 if test "x$CAIRO" != xno; then
    448 	PKG_CHECK_MODULES(CAIRO, cairo, [HAVE_CAIRO=yes], [HAVE_CAIRO=no])
    449 fi
    450 AC_MSG_CHECKING([whether to enable Cairo tests])
    451 if test "x$CAIRO" = xauto; then
    452 	CAIRO="$HAVE_CAIRO"
    453 fi
    454 if test "x$CAIRO" = xyes; then
    455 	if ! test "x$HAVE_CAIRO" = xyes; then
    456 		AC_MSG_ERROR([Cairo support required but not present])
    457 	fi
    458 	AC_DEFINE(HAVE_CAIRO, 1, [Have Cairo support])
    459 fi
    460 AC_MSG_RESULT([$CAIRO])
    461 AM_CONDITIONAL(HAVE_CAIRO, [test "x$CAIRO" = xyes])
    462 
    463 # xsltproc for docbook manpages
    464 AC_ARG_ENABLE([manpages],
    465               AS_HELP_STRING([--enable-manpages], [enable manpages @<:@default=auto@:>@]),
    466               [MANS=$enableval], [MANS=auto])
    467 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$XSLTPROC" != "x" -a "x$MANS" != "xno"])
    468 
    469 # check for offline man-pages stylesheet
    470 AC_MSG_CHECKING([for docbook manpages stylesheet])
    471 MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
    472 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
    473                             AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$MANPAGES_STYLESHEET" > /dev/null 2>&1`],
    474                                   [HAVE_MANPAGES_STYLESHEET=yes]))
    475 if test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"; then
    476         AC_SUBST(MANPAGES_STYLESHEET)
    477         AC_MSG_RESULT([yes])
    478 else
    479         AC_MSG_RESULT([no])
    480 fi
    481 AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], [test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"])
    482 
    483 AC_ARG_ENABLE(valgrind,
    484               [AS_HELP_STRING([--enable-valgrind],
    485                              [Build libdrm with  valgrind support (default: auto)])],
    486                              [VALGRIND=$enableval], [VALGRIND=auto])
    487 if test "x$VALGRIND" != xno; then
    488 	PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
    489 fi
    490 AC_MSG_CHECKING([whether to enable Valgrind support])
    491 if test "x$VALGRIND" = xauto; then
    492 	VALGRIND="$have_valgrind"
    493 fi
    494 
    495 if test "x$VALGRIND" = "xyes"; then
    496 	if ! test "x$have_valgrind" = xyes; then
    497 		AC_MSG_ERROR([Valgrind support required but not present])
    498 	fi
    499 	AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
    500 fi
    501 
    502 AC_MSG_RESULT([$VALGRIND])
    503 
    504 AC_ARG_WITH([kernel-source],
    505             [AS_HELP_STRING([--with-kernel-source],
    506               [specify path to linux kernel source])],
    507 	    [kernel_source="$with_kernel_source"])
    508 AC_SUBST(kernel_source)
    509 
    510 AC_MSG_CHECKING([whether $CC supports __attribute__(("hidden"))])
    511 AC_LINK_IFELSE([AC_LANG_PROGRAM([
    512     int foo_hidden( void ) __attribute__((visibility("hidden")));
    513 ])], HAVE_ATTRIBUTE_VISIBILITY="yes"; AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]));
    514 
    515 if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then
    516     AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__(("hidden"))])
    517 fi
    518 
    519 AC_SUBST(WARN_CFLAGS)
    520 AC_CONFIG_FILES([
    521 	Makefile
    522 	libkms/Makefile
    523 	libkms/libkms.pc
    524 	intel/Makefile
    525 	intel/libdrm_intel.pc
    526 	radeon/Makefile
    527 	radeon/libdrm_radeon.pc
    528 	amdgpu/Makefile
    529 	amdgpu/libdrm_amdgpu.pc
    530 	nouveau/Makefile
    531 	nouveau/libdrm_nouveau.pc
    532 	omap/Makefile
    533 	omap/libdrm_omap.pc
    534 	exynos/Makefile
    535 	exynos/libdrm_exynos.pc
    536 	freedreno/Makefile
    537 	freedreno/libdrm_freedreno.pc
    538 	tegra/Makefile
    539 	tegra/libdrm_tegra.pc
    540 	rockchip/Makefile
    541 	rockchip/libdrm_rockchip.pc
    542 	vc4/Makefile
    543 	vc4/libdrm_vc4.pc
    544 	etnaviv/Makefile
    545 	etnaviv/libdrm_etnaviv.pc
    546 	tests/Makefile
    547 	tests/modeprint/Makefile
    548 	tests/modetest/Makefile
    549 	tests/kms/Makefile
    550 	tests/kmstest/Makefile
    551 	tests/proptest/Makefile
    552 	tests/radeon/Makefile
    553 	tests/amdgpu/Makefile
    554 	tests/vbltest/Makefile
    555 	tests/exynos/Makefile
    556 	tests/tegra/Makefile
    557 	tests/nouveau/Makefile
    558 	tests/planetest/Makefile
    559 	tests/etnaviv/Makefile
    560 	tests/util/Makefile
    561 	man/Makefile
    562 	libdrm.pc])
    563 AC_OUTPUT
    564 
    565 echo ""
    566 echo "$PACKAGE_STRING will be compiled with:"
    567 echo ""
    568 echo "  libkms         $LIBKMS"
    569 echo "  Intel API      $INTEL"
    570 echo "  vmwgfx API     $VMWGFX"
    571 echo "  Radeon API     $RADEON"
    572 echo "  AMDGPU API     $AMDGPU"
    573 echo "  Nouveau API    $NOUVEAU"
    574 echo "  OMAP API       $OMAP"
    575 echo "  EXYNOS API     $EXYNOS"
    576 echo "  Freedreno API  $FREEDRENO (kgsl: $FREEDRENO_KGSL)"
    577 echo "  Tegra API      $TEGRA"
    578 echo "  Rockchip API   $ROCKCHIP"
    579 echo "  VC4 API        $VC4"
    580 echo "  Etnaviv API    $ETNAVIV"
    581 echo ""
    582