From: davilla Date: Sun, 9 Oct 2011 02:31:09 +0000 (-0400) Subject: enable darwin support X-Git-Tag: upstream/2.2.0~1^2~260 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3e703e8e17c390223c8818536180951b4c4f9b2b;p=deb_libcec.git enable darwin support --- diff --git a/configure.ac b/configure.ac index 2034c08..c3a5a08 100644 --- a/configure.ac +++ b/configure.ac @@ -4,11 +4,21 @@ 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")) +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" + ;; + *-apple-darwin*) + LIBS+="-framework CoreVideo -framework IOKit" + ;; +esac + 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")) CXXFLAGS="-fPIC -Wall -Wextra $CXXFLAGS" +AC_SUBST(REQUIRES) AC_CONFIG_FILES([src/lib/libcec.pc]) AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile]) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 3522cb5..7a0f6a3 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -30,4 +30,4 @@ libcec_la_SOURCES = AdapterCommunication.cpp \ platform/threads.cpp \ platform/threads.h -libcec_la_LDFLAGS = -lrt -lpthread -ludev -version-info @VERSION@ +libcec_la_LDFLAGS = @LIBS@ -version-info @VERSION@ diff --git a/src/lib/libcec.pc.in b/src/lib/libcec.pc.in index 058a9de..d0a6e7b 100644 --- a/src/lib/libcec.pc.in +++ b/src/lib/libcec.pc.in @@ -7,6 +7,6 @@ Name: libcec Description: CEC interface library URL: http://www.pulse-eight.com/ Version: @VERSION@ -Requires: udev +Requires: @REQUIRES@ Libs: -L${libdir} -lcec Cflags: -I${includedir}