Merge branch 'master' into release
[deb_libcec.git] / configure.ac
... / ...
CommitLineData
1AC_INIT([libcec], 1:5:0)
2AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
3
4AC_PROG_CXX
5AC_PROG_LIBTOOL
6
7has_libudev="yes"
8case "${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 ;;
12 *-apple-darwin*)
13 has_libudev="no";
14 LIBS+="-framework CoreVideo -framework IOKit"
15 ;;
16esac
17
18if test "x$has_libudev" != "xno"; then
19 INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS"
20 AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"])
21 REQUIRES="udev"
22fi
23
24AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing"))
25
26libs_pre_dl=$LIBS
27 AC_SEARCH_LIBS(dlopen, [dl],
28 [test "$ac_cv_search_dlopen" = "none required" || LIBS_DL=$ac_cv_search_dlopen],
29 AC_MSG_ERROR("required library 'dl' is missing"))
30 AC_SUBST([LIBS_DL])
31LIBS=$libs_pre_dl
32
33CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS"
34
35AC_SUBST(REQUIRES)
36AC_CONFIG_FILES([src/lib/libcec.pc])
37AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile src/cec-config/Makefile])