From 3e703e8e17c390223c8818536180951b4c4f9b2b Mon Sep 17 00:00:00 2001 From: davilla Date: Sat, 8 Oct 2011 22:31:09 -0400 Subject: [PATCH] enable darwin support --- configure.ac | 14 ++++++++++++-- src/lib/Makefile.am | 2 +- src/lib/libcec.pc.in | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) 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} -- 2.34.1