X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=configure.ac;h=17947effcd1ec0423095507bd4366ca8eca862d0;hb=24048d575419fe909fade9110fab48d17370ee6f;hp=49bbc7f077581939dae5325f85b3783e5b7929ce;hpb=ee7a58ce82eb01a99ce2aae5b0e534bfb1c97a43;p=deb_libcec.git diff --git a/configure.ac b/configure.ac index 49bbc7f..17947ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,23 +1,36 @@ -AC_INIT([libcec], 0:6:0) +AC_INIT([libcec], 1:4:0) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AC_PROG_CXX AC_PROG_LIBTOOL +has_libudev="yes" case "${host}" in *-*-linux*) - AC_CHECK_LIB([rt], [main],, AC_MSG_ERROR("required library 'rt' is missing")) - AC_CHECK_LIB([udev], [main],, AC_MSG_ERROR("required library 'udev' is missing")) - REQUIRES="udev" + 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 -AC_CHECK_LIB([pthread], [main],, AC_MSG_ERROR("required library 'pthread' is missing")) +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 -CXXFLAGS="-fPIC -Wall -Wextra $CXXFLAGS" +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])