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