X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=configure.ac;h=3098d003fcf7889fa6758095f2a07c8f61a841c0;hb=9d0dd77c941cd0336908d6b3920b3f1c5660ed04;hp=124c013c0ee7cf69a752d9ad508fb0982da108ef;hpb=5a1e87c8d9a1d8a6b8dbf8b7d1738395fdb6b856;p=deb_libcec.git diff --git a/configure.ac b/configure.ac index 124c013..3098d00 100644 --- a/configure.ac +++ b/configure.ac @@ -1,35 +1,68 @@ -AC_INIT([libcec], 0:8:0) +AC_PREREQ(2.59) +AC_INIT([libcec], [1:7:0], [http://libcec.pulse-eight.com/]) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AC_PROG_CXX AC_PROG_LIBTOOL +# search for pthread, required by all targets +AC_SEARCH_LIBS([pthread_create],[pthread],, + AC_MSG_ERROR("required library 'pthread' is missing")) + +# search for dlopen, required by all targets +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")) + + +# platform specific libs, required by all targets case "${host}" in *-*-linux*) - AC_SEARCH_LIBS([udev_new], [udev],, AC_MSG_ERROR("required library 'udev' is missing")) - REQUIRES="udev" + LIBS+=" -lrt" ;; *-apple-darwin*) - LIBS+="-framework CoreVideo -framework IOKit" + ;; + *-freebsd*) ;; esac -AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing")) +libs_client=$LIBS + +# search for udev and lockdev, only required by libCEC +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")) + + AC_CHECK_HEADER(lockdev.h,, + AC_MSG_ERROR("required library 'liblockdev' is missing")) + + LIBS+=" -llockdev" + ;; + *-apple-darwin*) + has_libudev="no"; + LIBS+="-framework CoreVideo -framework IOKit" + ;; + *-freebsd*) + has_libudev="no" + ;; +esac -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 +# mark udev as available if it was found, so we can include adapter autodetection code +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_LANG_PUSH([C++]) -AC_CHECK_HEADERS([boost/shared_ptr.hpp], [], - [AC_MSG_ERROR(You need the Boost libraries.)]) -AC_LANG_POP([C++]) +LIBS_LIBCEC=$LIBS +LIBS=$libs_client -CXXFLAGS="-fPIC -Wall -Wextra $CXXFLAGS" +CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS" -AC_SUBST(REQUIRES) +AC_SUBST([REQUIRES]) +AC_SUBST([LIBS]) +AC_SUBST([LIBS_LIBCEC]) AC_CONFIG_FILES([src/lib/libcec.pc]) -AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile]) +AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile src/cec-config/Makefile])