diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 86 |
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 | ||
21 | AC_PREREQ([2.63]) | 21 | AC_PREREQ([2.63]) |
22 | AC_INIT([libdrm], | 22 | AC_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]) | |||
28 | AC_CONFIG_SRCDIR([Makefile.am]) | 28 | AC_CONFIG_SRCDIR([Makefile.am]) |
29 | AC_CONFIG_MACRO_DIR([m4]) | 29 | AC_CONFIG_MACRO_DIR([m4]) |
30 | AC_CONFIG_AUX_DIR([build-aux]) | 30 | AC_CONFIG_AUX_DIR([build-aux]) |
31 | PKG_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 |
33 | m4_ifndef([XORG_MACROS_VERSION], | 34 | m4_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 |
45 | AC_PROG_CC | 46 | AC_PROG_CC |
46 | AC_PROG_CC_C99 | 47 | AC_PROG_CC_C99 |
48 | AC_PROG_NM | ||
47 | 49 | ||
48 | if test "x$ac_cv_prog_cc_c99" = xno; then | 50 | if 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 | |||
53 | AC_SYS_LARGEFILE | 55 | AC_SYS_LARGEFILE |
54 | AC_FUNC_ALLOCA | 56 | AC_FUNC_ALLOCA |
55 | 57 | ||
58 | save_CFLAGS="$CFLAGS" | ||
59 | export CFLAGS="$CFLAGS -Werror" | ||
56 | AC_HEADER_MAJOR | 60 | AC_HEADER_MAJOR |
61 | CFLAGS="$save_CFLAGS" | ||
62 | |||
57 | AC_CHECK_HEADERS([sys/sysctl.h sys/select.h]) | 63 | AC_CHECK_HEADERS([sys/sysctl.h sys/select.h]) |
58 | 64 | ||
59 | # Initialize libtool | 65 | # Initialize libtool |
60 | LT_PREREQ([2.2]) | 66 | LT_PREREQ([2.2]) |
61 | LT_INIT([disable-static]) | 67 | LT_INIT([disable-static]) |
62 | 68 | ||
63 | 69 | dnl pthread-stubs is mandatory on some BSD platforms, due to the nature of the | |
64 | 70 | dnl project. Even then there's a notable issue as described in the project README | |
65 | AC_SUBST(PTHREADSTUBS_CFLAGS) | 71 | case "$host_os" in |
66 | AC_SUBST(PTHREADSTUBS_LIBS) | 72 | linux* | cygwin* | darwin* | solaris* | *-gnu* | gnu* | openbsd*) |
73 | pthread_stubs_possible="no" | ||
74 | ;; | ||
75 | * ) | ||
76 | pthread_stubs_possible="yes" | ||
77 | ;; | ||
78 | esac | ||
79 | |||
80 | if 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) | ||
84 | fi | ||
67 | 85 | ||
68 | pkgconfigdir=${libdir}/pkgconfig | 86 | pkgconfigdir=${libdir}/pkgconfig |
69 | AC_SUBST(pkgconfigdir) | 87 | AC_SUBST(pkgconfigdir) |
88 | libdrmdatadir=${datadir}/libdrm | ||
89 | AC_SUBST(libdrmdatadir) | ||
90 | |||
70 | AC_ARG_ENABLE([udev], | 91 | AC_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])])]) |
174 | AC_SUBST([CLOCK_LIB]) | 195 | AC_SUBST([CLOCK_LIB]) |
175 | 196 | ||
176 | AC_CHECK_FUNCS([open_memstream], [HAVE_OPEN_MEMSTREAM=yes]) | 197 | AC_CHECK_FUNCS([open_memstream], |
198 | [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 1, [Have open_memstream()])], | ||
199 | [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 0)]) | ||
177 | 200 | ||
178 | dnl Use lots of warning flags with with gcc and compatible compilers | 201 | dnl 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 | |||
182 | dnl else. If for any reason you need to force a recheck, just change | 205 | 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) | 206 | dnl MAYBE_WARN in an ignorable way (like adding whitespace) |
184 | 207 | ||
185 | MAYBE_WARN="-Wall -Wextra \ | 208 | MAYBE_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, [ | |||
244 | if test "x$drm_cv_atomic_primitives" = xIntel; then | 267 | if 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]) |
270 | else | ||
271 | AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 0) | ||
247 | fi | 272 | fi |
248 | if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then | 273 | 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]) | 274 | AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed]) |
275 | else | ||
276 | AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 0) | ||
250 | fi | 277 | fi |
251 | 278 | ||
252 | dnl Print out the approapriate message considering the value set be the | 279 | dnl Print out the approapriate message considering the value set be the |
@@ -325,6 +352,8 @@ AC_SUBST(PCIACCESS_LIBS) | |||
325 | 352 | ||
326 | if test "x$UDEV" = xyes; then | 353 | if test "x$UDEV" = xyes; then |
327 | AC_DEFINE(UDEV, 1, [Have UDEV support]) | 354 | AC_DEFINE(UDEV, 1, [Have UDEV support]) |
355 | else | ||
356 | AC_DEFINE(UDEV, 0) | ||
328 | fi | 357 | fi |
329 | 358 | ||
330 | AC_CANONICAL_HOST | 359 | AC_CANONICAL_HOST |
@@ -343,32 +372,34 @@ AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes]) | |||
343 | AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) | 372 | AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) |
344 | if test "x$INTEL" = xyes; then | 373 | if test "x$INTEL" = xyes; then |
345 | AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) | 374 | AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) |
375 | else | ||
376 | AC_DEFINE(HAVE_INTEL, 0) | ||
346 | fi | 377 | fi |
347 | 378 | ||
348 | AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes]) | 379 | AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes]) |
349 | if test "x$VMWGFX" = xyes; then | 380 | if 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]) |
382 | else | ||
383 | AC_DEFINE(HAVE_VMWGFX, 0) | ||
351 | fi | 384 | fi |
352 | 385 | ||
353 | AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) | 386 | AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) |
354 | if test "x$NOUVEAU" = xyes; then | 387 | if 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]) |
389 | else | ||
390 | AC_DEFINE(HAVE_NOUVEAU, 0) | ||
356 | fi | 391 | fi |
357 | 392 | ||
358 | AM_CONDITIONAL(HAVE_OMAP, [test "x$OMAP" = xyes]) | 393 | 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 | 394 | ||
363 | AM_CONDITIONAL(HAVE_EXYNOS, [test "x$EXYNOS" = xyes]) | 395 | AM_CONDITIONAL(HAVE_EXYNOS, [test "x$EXYNOS" = xyes]) |
364 | if test "x$EXYNOS" = xyes; then | 396 | if test "x$EXYNOS" = xyes; then |
365 | AC_DEFINE(HAVE_EXYNOS, 1, [Have EXYNOS support]) | 397 | AC_DEFINE(HAVE_EXYNOS, 1, [Have EXYNOS support]) |
398 | else | ||
399 | AC_DEFINE(HAVE_EXYNOS, 0) | ||
366 | fi | 400 | fi |
367 | 401 | ||
368 | AM_CONDITIONAL(HAVE_FREEDRENO, [test "x$FREEDRENO" = xyes]) | 402 | 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 | 403 | ||
373 | if test "x$FREEDRENO_KGSL" = xyes; then | 404 | if 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 | |||
378 | AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes]) | 409 | AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes]) |
379 | if test "x$FREEDRENO_KGSL" = xyes; then | 410 | if 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]) |
412 | else | ||
413 | AC_DEFINE(HAVE_FREEDRENO_KGSL, 0) | ||
381 | fi | 414 | fi |
382 | 415 | ||
383 | AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes]) | 416 | AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes]) |
384 | if test "x$RADEON" = xyes; then | 417 | if test "x$RADEON" = xyes; then |
385 | AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) | 418 | AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) |
419 | else | ||
420 | AC_DEFINE(HAVE_RADEON, 0) | ||
386 | fi | 421 | fi |
387 | 422 | ||
388 | if test "x$AMDGPU" != xno; then | 423 | if test "x$AMDGPU" != xno; then |
@@ -409,36 +444,30 @@ AM_CONDITIONAL(HAVE_AMDGPU, [test "x$AMDGPU" = xyes]) | |||
409 | if test "x$AMDGPU" = xyes; then | 444 | if 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 |
450 | else | ||
451 | AC_DEFINE(HAVE_AMDGPU, 0) | ||
417 | fi | 452 | fi |
418 | 453 | ||
419 | AM_CONDITIONAL(HAVE_TEGRA, [test "x$TEGRA" = xyes]) | 454 | 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 | 455 | ||
424 | AM_CONDITIONAL(HAVE_ROCKCHIP, [test "x$ROCKCHIP" = xyes]) | 456 | AM_CONDITIONAL(HAVE_ROCKCHIP, [test "x$ROCKCHIP" = xyes]) |
425 | if test "x$ROCKCHIP" = xyes; then | 457 | if test "x$ROCKCHIP" = xyes; then |
426 | AC_DEFINE(HAVE_ROCKCHIP, 1, [Have ROCKCHIP support]) | 458 | AC_DEFINE(HAVE_ROCKCHIP, 1, [Have ROCKCHIP support]) |
459 | fi | ||
427 | 460 | ||
428 | AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) | 461 | AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) |
429 | if test "x$VC4" = xyes; then | 462 | if test "x$VC4" = xyes; then |
430 | AC_DEFINE(HAVE_VC4, 1, [Have VC4 support]) | 463 | AC_DEFINE(HAVE_VC4, 1, [Have VC4 support]) |
464 | else | ||
465 | AC_DEFINE(HAVE_VC4, 0) | ||
431 | fi | 466 | fi |
432 | 467 | ||
433 | AM_CONDITIONAL(HAVE_ETNAVIV, [test "x$ETNAVIV" = xyes]) | 468 | 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 | 469 | ||
438 | AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes]) | 470 | 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 | 471 | ||
443 | AC_ARG_ENABLE([cairo-tests], | 472 | AC_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]) |
488 | else | ||
489 | AC_DEFINE(HAVE_CAIRO, 0) | ||
459 | fi | 490 | fi |
460 | AC_MSG_RESULT([$CAIRO]) | 491 | AC_MSG_RESULT([$CAIRO]) |
461 | AM_CONDITIONAL(HAVE_CAIRO, [test "x$CAIRO" = xyes]) | 492 | AM_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]) |
531 | else | ||
532 | AC_DEFINE([HAVE_VALGRIND], 0) | ||
500 | fi | 533 | fi |
501 | 534 | ||
502 | AC_MSG_RESULT([$VALGRIND]) | 535 | AC_MSG_RESULT([$VALGRIND]) |
@@ -514,11 +547,16 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([ | |||
514 | 547 | ||
515 | if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then | 548 | if 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"))]) |
550 | else | ||
551 | AC_DEFINE(HAVE_VISIBILITY, 0) | ||
517 | fi | 552 | fi |
518 | 553 | ||
554 | CFLAGS="$CFLAGS -include config.h" | ||
555 | |||
519 | AC_SUBST(WARN_CFLAGS) | 556 | AC_SUBST(WARN_CFLAGS) |
520 | AC_CONFIG_FILES([ | 557 | AC_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 |