enable darwin support
authordavilla <davilla@4pi.com>
Sun, 9 Oct 2011 02:31:09 +0000 (22:31 -0400)
committerdavilla <davilla@4pi.com>
Sun, 9 Oct 2011 02:31:09 +0000 (22:31 -0400)
configure.ac
src/lib/Makefile.am
src/lib/libcec.pc.in

index 2034c08dd0320fbb16fbdf6e274247b11484d1d9..c3a5a08d7f4efdc239c5dfd9fd039a4a095ae9a5 100644 (file)
@@ -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])
index 3522cb5644e1563d976e13734a4239bbb20e59c2..7a0f6a39db2355a7184666b35ef0354962768407 100644 (file)
@@ -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@
index 058a9de8ff23036dee48a00e906a13c1c214b8ec..d0a6e7bdf5ac7cf1384937d83df19f7a9e1c54e8 100644 (file)
@@ -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}