aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac86
1 files changed, 62 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac
index 1da9d86b..98a350c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
20 20
21AC_PREREQ([2.63]) 21AC_PREREQ([2.63])
22AC_INIT([libdrm], 22AC_INIT([libdrm],
23 [2.4.75], 23 [2.4.91],
24 [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], 24 [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
25 [libdrm]) 25 [libdrm])
26 26
@@ -28,6 +28,7 @@ AC_CONFIG_HEADERS([config.h])
28AC_CONFIG_SRCDIR([Makefile.am]) 28AC_CONFIG_SRCDIR([Makefile.am])
29AC_CONFIG_MACRO_DIR([m4]) 29AC_CONFIG_MACRO_DIR([m4])
30AC_CONFIG_AUX_DIR([build-aux]) 30AC_CONFIG_AUX_DIR([build-aux])
31PKG_PROG_PKG_CONFIG
31 32
32# Require xorg-macros minimum of 1.12 for XORG_WITH_XSLTPROC 33# Require xorg-macros minimum of 1.12 for XORG_WITH_XSLTPROC
33m4_ifndef([XORG_MACROS_VERSION], 34m4_ifndef([XORG_MACROS_VERSION],
@@ -44,6 +45,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
44# Check for programs 45# Check for programs
45AC_PROG_CC 46AC_PROG_CC
46AC_PROG_CC_C99 47AC_PROG_CC_C99
48AC_PROG_NM
47 49
48if test "x$ac_cv_prog_cc_c99" = xno; then 50if test "x$ac_cv_prog_cc_c99" = xno; then
49 AC_MSG_ERROR([Building libdrm requires C99 enabled compiler]) 51 AC_MSG_ERROR([Building libdrm requires C99 enabled compiler])
@@ -53,20 +55,39 @@ AC_USE_SYSTEM_EXTENSIONS
53AC_SYS_LARGEFILE 55AC_SYS_LARGEFILE
54AC_FUNC_ALLOCA 56AC_FUNC_ALLOCA
55 57
58save_CFLAGS="$CFLAGS"
59export CFLAGS="$CFLAGS -Werror"
56AC_HEADER_MAJOR 60AC_HEADER_MAJOR
61CFLAGS="$save_CFLAGS"
62
57AC_CHECK_HEADERS([sys/sysctl.h sys/select.h]) 63AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
58 64
59# Initialize libtool 65# Initialize libtool
60LT_PREREQ([2.2]) 66LT_PREREQ([2.2])
61LT_INIT([disable-static]) 67LT_INIT([disable-static])
62 68
63 69dnl pthread-stubs is mandatory on some BSD platforms, due to the nature of the
64 70dnl project. Even then there's a notable issue as described in the project README
65AC_SUBST(PTHREADSTUBS_CFLAGS) 71case "$host_os" in
66AC_SUBST(PTHREADSTUBS_LIBS) 72linux* | cygwin* | darwin* | solaris* | *-gnu* | gnu* | openbsd*)
73 pthread_stubs_possible="no"
74 ;;
75* )
76 pthread_stubs_possible="yes"
77 ;;
78esac
79
80if test "x$pthread_stubs_possible" = xyes; then
81 PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs >= 0.4)
82 AC_SUBST(PTHREADSTUBS_CFLAGS)
83 AC_SUBST(PTHREADSTUBS_LIBS)
84fi
67 85
68pkgconfigdir=${libdir}/pkgconfig 86pkgconfigdir=${libdir}/pkgconfig
69AC_SUBST(pkgconfigdir) 87AC_SUBST(pkgconfigdir)
88libdrmdatadir=${datadir}/libdrm
89AC_SUBST(libdrmdatadir)
90
70AC_ARG_ENABLE([udev], 91AC_ARG_ENABLE([udev],
71 [AS_HELP_STRING([--enable-udev], 92 [AS_HELP_STRING([--enable-udev],
72 [Enable support for using udev instead of mknod (default: disabled)])], 93 [Enable support for using udev instead of mknod (default: disabled)])],
@@ -173,7 +194,9 @@ AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
173 [AC_MSG_ERROR([Couldn't find clock_gettime])])]) 194 [AC_MSG_ERROR([Couldn't find clock_gettime])])])
174AC_SUBST([CLOCK_LIB]) 195AC_SUBST([CLOCK_LIB])
175 196
176AC_CHECK_FUNCS([open_memstream], [HAVE_OPEN_MEMSTREAM=yes]) 197AC_CHECK_FUNCS([open_memstream],
198 [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 1, [Have open_memstream()])],
199 [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 0)])
177 200
178dnl Use lots of warning flags with with gcc and compatible compilers 201dnl Use lots of warning flags with with gcc and compatible compilers
179 202
@@ -182,7 +205,7 @@ dnl skipped and all flags rechecked. So there's no need to do anything
182dnl else. If for any reason you need to force a recheck, just change 205dnl else. If for any reason you need to force a recheck, just change
183dnl MAYBE_WARN in an ignorable way (like adding whitespace) 206dnl MAYBE_WARN in an ignorable way (like adding whitespace)
184 207
185MAYBE_WARN="-Wall -Wextra \ 208MAYBE_WARN="-Wall -Wextra -Werror=undef \
186-Wsign-compare -Werror-implicit-function-declaration \ 209-Wsign-compare -Werror-implicit-function-declaration \
187-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \ 210-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
188-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ 211-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
@@ -244,9 +267,13 @@ AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, [
244if test "x$drm_cv_atomic_primitives" = xIntel; then 267if test "x$drm_cv_atomic_primitives" = xIntel; then
245 AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 1, 268 AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 1,
246 [Enable if your compiler supports the Intel __sync_* atomic primitives]) 269 [Enable if your compiler supports the Intel __sync_* atomic primitives])
270else
271 AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 0)
247fi 272fi
248if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then 273if 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]) 274 AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed])
275else
276 AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 0)
250fi 277fi
251 278
252dnl Print out the approapriate message considering the value set be the 279dnl Print out the approapriate message considering the value set be the
@@ -325,6 +352,8 @@ AC_SUBST(PCIACCESS_LIBS)
325 352
326if test "x$UDEV" = xyes; then 353if test "x$UDEV" = xyes; then
327 AC_DEFINE(UDEV, 1, [Have UDEV support]) 354 AC_DEFINE(UDEV, 1, [Have UDEV support])
355else
356 AC_DEFINE(UDEV, 0)
328fi 357fi
329 358
330AC_CANONICAL_HOST 359AC_CANONICAL_HOST
@@ -343,32 +372,34 @@ AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes])
343AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) 372AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
344if test "x$INTEL" = xyes; then 373if test "x$INTEL" = xyes; then
345 AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) 374 AC_DEFINE(HAVE_INTEL, 1, [Have intel support])
375else
376 AC_DEFINE(HAVE_INTEL, 0)
346fi 377fi
347 378
348AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes]) 379AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes])
349if test "x$VMWGFX" = xyes; then 380if test "x$VMWGFX" = xyes; then
350 AC_DEFINE(HAVE_VMWGFX, 1, [Have vmwgfx kernel headers]) 381 AC_DEFINE(HAVE_VMWGFX, 1, [Have vmwgfx kernel headers])
382else
383 AC_DEFINE(HAVE_VMWGFX, 0)
351fi 384fi
352 385
353AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) 386AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
354if test "x$NOUVEAU" = xyes; then 387if test "x$NOUVEAU" = xyes; then
355 AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau (nvidia) support]) 388 AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau (nvidia) support])
389else
390 AC_DEFINE(HAVE_NOUVEAU, 0)
356fi 391fi
357 392
358AM_CONDITIONAL(HAVE_OMAP, [test "x$OMAP" = xyes]) 393AM_CONDITIONAL(HAVE_OMAP, [test "x$OMAP" = xyes])
359if test "x$OMAP" = xyes; then
360 AC_DEFINE(HAVE_OMAP, 1, [Have OMAP support])
361fi
362 394
363AM_CONDITIONAL(HAVE_EXYNOS, [test "x$EXYNOS" = xyes]) 395AM_CONDITIONAL(HAVE_EXYNOS, [test "x$EXYNOS" = xyes])
364if test "x$EXYNOS" = xyes; then 396if test "x$EXYNOS" = xyes; then
365 AC_DEFINE(HAVE_EXYNOS, 1, [Have EXYNOS support]) 397 AC_DEFINE(HAVE_EXYNOS, 1, [Have EXYNOS support])
398else
399 AC_DEFINE(HAVE_EXYNOS, 0)
366fi 400fi
367 401
368AM_CONDITIONAL(HAVE_FREEDRENO, [test "x$FREEDRENO" = xyes]) 402AM_CONDITIONAL(HAVE_FREEDRENO, [test "x$FREEDRENO" = xyes])
369if test "x$FREEDRENO" = xyes; then
370 AC_DEFINE(HAVE_FREEDRENO, 1, [Have freedreno support])
371fi
372 403
373if test "x$FREEDRENO_KGSL" = xyes; then 404if test "x$FREEDRENO_KGSL" = xyes; then
374 if test "x$FREEDRENO" != xyes; then 405 if test "x$FREEDRENO" != xyes; then
@@ -378,11 +409,15 @@ fi
378AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes]) 409AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes])
379if test "x$FREEDRENO_KGSL" = xyes; then 410if test "x$FREEDRENO_KGSL" = xyes; then
380 AC_DEFINE(HAVE_FREEDRENO_KGSL, 1, [Have freedreno support for KGSL kernel interface]) 411 AC_DEFINE(HAVE_FREEDRENO_KGSL, 1, [Have freedreno support for KGSL kernel interface])
412else
413 AC_DEFINE(HAVE_FREEDRENO_KGSL, 0)
381fi 414fi
382 415
383AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes]) 416AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes])
384if test "x$RADEON" = xyes; then 417if test "x$RADEON" = xyes; then
385 AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) 418 AC_DEFINE(HAVE_RADEON, 1, [Have radeon support])
419else
420 AC_DEFINE(HAVE_RADEON, 0)
386fi 421fi
387 422
388if test "x$AMDGPU" != xno; then 423if test "x$AMDGPU" != xno; then
@@ -409,36 +444,30 @@ AM_CONDITIONAL(HAVE_AMDGPU, [test "x$AMDGPU" = xyes])
409if test "x$AMDGPU" = xyes; then 444if test "x$AMDGPU" = xyes; then
410 AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support]) 445 AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support])
411 446
412 AC_DEFINE(HAVE_CUNIT, [test "x$have_cunit" != "xno"], [Enable CUNIT Have amdgpu support])
413
414 if test "x$have_cunit" = "xno"; then 447 if test "x$have_cunit" = "xno"; then
415 AC_MSG_WARN([Could not find cunit library. Disabling amdgpu tests]) 448 AC_MSG_WARN([Could not find cunit library. Disabling amdgpu tests])
416 fi 449 fi
450else
451 AC_DEFINE(HAVE_AMDGPU, 0)
417fi 452fi
418 453
419AM_CONDITIONAL(HAVE_TEGRA, [test "x$TEGRA" = xyes]) 454AM_CONDITIONAL(HAVE_TEGRA, [test "x$TEGRA" = xyes])
420if test "x$TEGRA" = xyes; then
421 AC_DEFINE(HAVE_TEGRA, 1, [Have Tegra support])
422fi
423 455
424AM_CONDITIONAL(HAVE_ROCKCHIP, [test "x$ROCKCHIP" = xyes]) 456AM_CONDITIONAL(HAVE_ROCKCHIP, [test "x$ROCKCHIP" = xyes])
425if test "x$ROCKCHIP" = xyes; then 457if test "x$ROCKCHIP" = xyes; then
426 AC_DEFINE(HAVE_ROCKCHIP, 1, [Have ROCKCHIP support]) 458 AC_DEFINE(HAVE_ROCKCHIP, 1, [Have ROCKCHIP support])
459fi
427 460
428AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) 461AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes])
429if test "x$VC4" = xyes; then 462if test "x$VC4" = xyes; then
430 AC_DEFINE(HAVE_VC4, 1, [Have VC4 support]) 463 AC_DEFINE(HAVE_VC4, 1, [Have VC4 support])
464else
465 AC_DEFINE(HAVE_VC4, 0)
431fi 466fi
432 467
433AM_CONDITIONAL(HAVE_ETNAVIV, [test "x$ETNAVIV" = xyes]) 468AM_CONDITIONAL(HAVE_ETNAVIV, [test "x$ETNAVIV" = xyes])
434if test "x$ETNAVIV" = xyes; then
435 AC_DEFINE(HAVE_ETNAVIV, 1, [Have etnaviv support])
436fi
437 469
438AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes]) 470AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes])
439if test "x$INSTALL_TESTS" = xyes; then
440 AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs])
441fi
442 471
443AC_ARG_ENABLE([cairo-tests], 472AC_ARG_ENABLE([cairo-tests],
444 [AS_HELP_STRING([--enable-cairo-tests], 473 [AS_HELP_STRING([--enable-cairo-tests],
@@ -456,6 +485,8 @@ if test "x$CAIRO" = xyes; then
456 AC_MSG_ERROR([Cairo support required but not present]) 485 AC_MSG_ERROR([Cairo support required but not present])
457 fi 486 fi
458 AC_DEFINE(HAVE_CAIRO, 1, [Have Cairo support]) 487 AC_DEFINE(HAVE_CAIRO, 1, [Have Cairo support])
488else
489 AC_DEFINE(HAVE_CAIRO, 0)
459fi 490fi
460AC_MSG_RESULT([$CAIRO]) 491AC_MSG_RESULT([$CAIRO])
461AM_CONDITIONAL(HAVE_CAIRO, [test "x$CAIRO" = xyes]) 492AM_CONDITIONAL(HAVE_CAIRO, [test "x$CAIRO" = xyes])
@@ -497,6 +528,8 @@ if test "x$VALGRIND" = "xyes"; then
497 AC_MSG_ERROR([Valgrind support required but not present]) 528 AC_MSG_ERROR([Valgrind support required but not present])
498 fi 529 fi
499 AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings]) 530 AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
531else
532 AC_DEFINE([HAVE_VALGRIND], 0)
500fi 533fi
501 534
502AC_MSG_RESULT([$VALGRIND]) 535AC_MSG_RESULT([$VALGRIND])
@@ -514,11 +547,16 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
514 547
515if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then 548if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then
516 AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__(("hidden"))]) 549 AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__(("hidden"))])
550else
551 AC_DEFINE(HAVE_VISIBILITY, 0)
517fi 552fi
518 553
554CFLAGS="$CFLAGS -include config.h"
555
519AC_SUBST(WARN_CFLAGS) 556AC_SUBST(WARN_CFLAGS)
520AC_CONFIG_FILES([ 557AC_CONFIG_FILES([
521 Makefile 558 Makefile
559 data/Makefile
522 libkms/Makefile 560 libkms/Makefile
523 libkms/libkms.pc 561 libkms/libkms.pc
524 intel/Makefile 562 intel/Makefile