bumped to lib version 1.0.0 and follow the proper versioning guideline from now on :-)
[deb_libcec.git] / configure.ac
index bd97334aa8a1ab87a63aaa7c9c1ea4154a3803e2..e1468648632302caee8433777ca8e76c7c69710f 100644 (file)
@@ -1,12 +1,30 @@
-AC_INIT([libcec], 0:4:0)
+AC_INIT([libcec], 1:0:0)
 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"))
-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"))
+case "${host}" in
+  *-*-linux*)
+    AC_SEARCH_LIBS([udev_new], [udev],, AC_MSG_ERROR("required library 'udev' is missing"))
+    REQUIRES="udev"
+    ;;
+  *-apple-darwin*)
+    LIBS+="-framework CoreVideo -framework IOKit"
+    ;;
+esac
 
+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 $CXXFLAGS"
+
+AC_SUBST(REQUIRES)
 AC_CONFIG_FILES([src/lib/libcec.pc])
 AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile])