Commit | Line | Data |
---|---|---|
6ea2515b LOK |
1 | AC_PREREQ(2.59) |
2 | AC_INIT([libcec], [1:7:0], [http://libcec.pulse-eight.com/]) | |
abbca718 LOK |
3 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
4 | ||
5 | AC_PROG_CXX | |
6 | AC_PROG_LIBTOOL | |
7 | ||
6ea2515b LOK |
8 | # search for pthread, required by all targets |
9 | AC_SEARCH_LIBS([pthread_create],[pthread],, | |
10 | AC_MSG_ERROR("required library 'pthread' is missing")) | |
11 | ||
12 | # search for dlopen, required by all targets | |
13 | AC_SEARCH_LIBS([dlopen], [dl], | |
14 | [test "$ac_cv_search_dlopen" = "none required" || LIBS_DL=$ac_cv_search_dlopen], | |
15 | AC_MSG_ERROR("required library 'dl' is missing")) | |
16 | ||
17 | ||
18 | # platform specific libs, required by all targets | |
19 | case "${host}" in | |
20 | *-*-linux*) | |
21 | LIBS+=" -lrt" | |
22 | ;; | |
23 | *-apple-darwin*) | |
ebefc26c | 24 | LIBS+="-framework CoreVideo -framework IOKit" |
6ea2515b LOK |
25 | ;; |
26 | *-freebsd*) | |
27 | ;; | |
28 | esac | |
29 | ||
30 | libs_client=$LIBS | |
31 | ||
32 | # search for udev and lockdev, only required by libCEC | |
42c02563 | 33 | has_libudev="yes" |
3e703e8e | 34 | case "${host}" in |
35 | *-*-linux*) | |
6ea2515b LOK |
36 | PKG_CHECK_MODULES([UDEV],[libudev],, |
37 | [has_libudev="no"]; AC_MSG_WARN("library 'udev' is missing - adapter detection will not be available")) | |
38 | ||
39 | AC_CHECK_HEADER(lockdev.h,, | |
40 | AC_MSG_ERROR("required library 'liblockdev' is missing")) | |
41 | ||
42 | LIBS+=" -llockdev" | |
3e703e8e | 43 | ;; |
44 | *-apple-darwin*) | |
42c02563 | 45 | has_libudev="no"; |
3e703e8e | 46 | ;; |
5458fd77 F |
47 | *-freebsd*) |
48 | has_libudev="no" | |
49 | ;; | |
3e703e8e | 50 | esac |
51 | ||
6ea2515b | 52 | # mark udev as available if it was found, so we can include adapter autodetection code |
42c02563 LOK |
53 | if test "x$has_libudev" != "xno"; then |
54 | INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS" | |
55 | AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]) | |
56 | REQUIRES="udev" | |
57 | fi | |
58 | ||
6ea2515b LOK |
59 | LIBS_LIBCEC=$LIBS |
60 | LIBS=$libs_client | |
abbca718 | 61 | |
0bb46307 | 62 | CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS" |
7eb13cca | 63 | |
6ea2515b LOK |
64 | AC_SUBST([REQUIRES]) |
65 | AC_SUBST([LIBS]) | |
66 | AC_SUBST([LIBS_LIBCEC]) | |
abbca718 | 67 | AC_CONFIG_FILES([src/lib/libcec.pc]) |
39b1216c | 68 | AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile src/cec-config/Makefile]) |