Merge branch 'master' into release
[deb_libcec.git] / configure.ac
1 AC_INIT([libcec], 1:6:0)
2 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
3
4 AC_PROG_CXX
5 AC_PROG_LIBTOOL
6
7 has_libudev="yes"
8 case "${host}" in
9 *-*-linux*)
10 PKG_CHECK_MODULES([UDEV],[libudev],,[has_libudev="no"]; AC_MSG_WARN("library 'udev' is missing - adapter detection will not be available"))
11 AC_CHECK_HEADER(lockdev.h,, AC_MSG_ERROR("required library 'liblockdev' is missing"))
12 LIBS+=" -lrt -llockdev"
13 ;;
14 *-apple-darwin*)
15 has_libudev="no";
16 LIBS+="-framework CoreVideo -framework IOKit"
17 ;;
18 *-freebsd*)
19 has_libudev="no"
20 ;;
21 esac
22
23 if test "x$has_libudev" != "xno"; then
24 INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS"
25 AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"])
26 REQUIRES="udev"
27 fi
28
29 AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing"))
30
31 libs_pre_dl=$LIBS
32 AC_SEARCH_LIBS(dlopen, [dl],
33 [test "$ac_cv_search_dlopen" = "none required" || LIBS_DL=$ac_cv_search_dlopen],
34 AC_MSG_ERROR("required library 'dl' is missing"))
35 AC_SUBST([LIBS_DL])
36 LIBS=$libs_pre_dl
37
38 CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS"
39
40 AC_SUBST(REQUIRES)
41 AC_CONFIG_FILES([src/lib/libcec.pc])
42 AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile src/cec-config/Makefile])