X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=configure.ac;h=17947effcd1ec0423095507bd4366ca8eca862d0;hb=b5f787b969b7e0517321ebbfe069ac65c330982e;hp=dffe00b64805765160ae9fb5262c1fa2db1e5ea7;hpb=7eb13cca43e722f2bfd20064daf580ea65411cf5;p=deb_libcec.git diff --git a/configure.ac b/configure.ac index dffe00b..17947ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,14 +1,37 @@ -AC_INIT([libcec], 0:4:0) +AC_INIT([libcec], 1:4:0) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AC_PROG_CXX AC_PROG_LIBTOOL -AC_CHECK_LIB([rt], [main],, AC_MSG_ERROR("required library 'rt' is missing")) -AC_CHECK_LIB([pthread], [main],, AC_MSG_ERROR("required library 'pthread' is missing")) -AC_CHECK_LIB([udev], [main],, AC_MSG_ERROR("required library 'udev' is missing")) +has_libudev="yes" +case "${host}" in + *-*-linux*) + PKG_CHECK_MODULES([UDEV],[libudev],,[has_libudev="no";AC_MSG_WARN("library 'udev' is missing - adapter detection will not be available")]) + ;; + *-apple-darwin*) + has_libudev="no"; + LIBS+="-framework CoreVideo -framework IOKit" + ;; +esac -CXXFLAGS="-fPIC -Wall -Wextra $CXXFLAGS" +if test "x$has_libudev" != "xno"; then + INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS" + AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]) + REQUIRES="udev" +fi +AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing")) + +libs_pre_dl=$LIBS + AC_SEARCH_LIBS(dlopen, [dl], + [test "$ac_cv_search_dlopen" = "none required" || LIBS_DL=$ac_cv_search_dlopen], + AC_MSG_ERROR("required library 'dl' is missing")) + AC_SUBST([LIBS_DL]) +LIBS=$libs_pre_dl + +CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS" + +AC_SUBST(REQUIRES) AC_CONFIG_FILES([src/lib/libcec.pc]) AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile])