configure.ac 2.71 KB
Newer Older
1
AC_PREREQ(2.60)
Aaron Plattner's avatar
Aaron Plattner committed
2

Aaron Plattner's avatar
Aaron Plattner committed
3
AC_INIT(libvdpau, 1.1, [vdpau@lists.freedesktop.org], libvdpau)
Aaron Plattner's avatar
Aaron Plattner committed
4
5
AM_INIT_AUTOMAKE([dist-bzip2 foreign])

6
AC_CONFIG_HEADERS(config.h)
Aaron Plattner's avatar
Aaron Plattner committed
7

8
9
10
11
# Check for secure_getenv
AC_USE_SYSTEM_EXTENSIONS
AC_CHECK_FUNCS([__secure_getenv secure_getenv])

12
13
14
15
# Disable static libraries by default.  Use --enable-static if you really want
# them.
AC_DISABLE_STATIC

Aaron Plattner's avatar
Aaron Plattner committed
16
17
18
19
20
21
22
23
24
25
# Check for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL

# Checks for dependencies.
PKG_CHECK_MODULES(X11, x11)
AC_SUBST(X11_CFLAGS)
AC_SUBST(X11_LIBS)

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Check for optional dependencies.
AC_ARG_ENABLE(dri2, AS_HELP_STRING([--disable-dri2], [Disable driver name query through DRI2 (default: auto)]), [DRI2=$enableval], [DRI2=auto])
PKG_CHECK_MODULES(dri2proto, dri2proto >= 2.2, [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no])
case "$DRI2,$HAVE_DRI2PROTO" in
    yes,no)
        AC_MSG_ERROR([DRI2 queries require dri2proto >= 2.2])
        ;;
    yes,yes | auto,yes)
        AC_DEFINE(DRI2, 1, [Request driver name from DRI2])
        DRI2=yes
        PKG_CHECK_MODULES(XEXT, xext)
        AC_SUBST([XEXT_CFLAGS])
        AC_SUBST([XEXT_LIBS])
        ;;
esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)

43
44
45
46
47
48
dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
        AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
AC_SUBST([DLOPEN_LIBS])

49
50
51
52
53
54
55
56
# Look for POSIX threads
AC_SEARCH_LIBS([pthread_once], [pthread pthreads c_r], [
    AS_IF([test "$ac_cv_search_pthread_once" != "none required"], [
        PTHREAD_LIBS="$ac_cv_search_pthread_once"
    ])
])
AC_SUBST([PTHREAD_LIBS])

Aaron Plattner's avatar
Aaron Plattner committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Check for Doxygen.
AC_ARG_ENABLE(documentation, AS_HELP_STRING([--disable-documentation], [Disable Doxygen documentation (default: auto)]), [DOCS=$enableval], [DOCS=auto])
if test "x$DOCS" != xno; then
    AC_CHECK_TOOL([DOXYGEN], [doxygen], [no])
    AC_CHECK_TOOL([DOT], [dot], [no])
else
    DOXYGEN=no
    DOT=no
fi
if test "x$DOCS" = xyes; then
    if test "x$DOXYGEN" = xno; then
        AC_ERROR([Documentation enabled but doxygen was not found in your path])
    fi
    if test "x$DOT" = xno; then
        AC_ERROR([Documentation enabled but dot was not found in your path.  Please install graphviz])
    fi
fi
Aaron Plattner's avatar
Aaron Plattner committed
74
AM_CONDITIONAL([ENABLE_DOCS], [test "x$DOXYGEN" != xno -a "x$DOT" != xno])
Aaron Plattner's avatar
Aaron Plattner committed
75
76
AC_SUBST(DOXYGEN)

77
78
79
80
81
82
83
84
# Options
AC_ARG_WITH(module-dir,
            AC_HELP_STRING([--with-module-dir=DIR],
                           [Default module directory [[default=LIBDIR/vdpau]]]),
            [moduledir="$withval"],
            [moduledir="$libdir/vdpau"])
AC_SUBST(moduledir)

85
86
XORG_CHANGELOG

Aaron Plattner's avatar
Aaron Plattner committed
87
AC_OUTPUT([Makefile
Aaron Plattner's avatar
Aaron Plattner committed
88
           doc/Makefile
Aaron Plattner's avatar
Aaron Plattner committed
89
           src/Makefile
Aaron Plattner's avatar
Aaron Plattner committed
90
           test/Makefile
Aaron Plattner's avatar
Aaron Plattner committed
91
92
           trace/Makefile
           vdpau.pc])