Initial FreeBSD support
[deb_libcec.git] / configure.ac
index e961c1b2e6e1837a92d929d74749a8d04b91dd2b..209ecf6e070ebeb575ae9a2dc77745515f86bb73 100644 (file)
@@ -1,19 +1,29 @@
-AC_INIT([libcec], 1:2:0)
+AC_INIT([libcec], 1:5:0)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 
 AC_PROG_CXX
 AC_PROG_LIBTOOL
 
+has_libudev="yes"
 case "${host}" in
   *-*-linux*)
-    AC_SEARCH_LIBS([udev_new], [udev],, AC_MSG_ERROR("required library 'udev' is missing"))
-    REQUIRES="udev"
+    PKG_CHECK_MODULES([UDEV],[libudev],,[has_libudev="no";AC_MSG_WARN("library 'udev' is missing - adapter detection will not be available")])
     ;;
   *-apple-darwin*)
+    has_libudev="no";
     LIBS+="-framework CoreVideo -framework IOKit"
     ;;
+  *-freebsd*)
+    has_libudev="no"
+    ;;
 esac
 
+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_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing"))
 
 libs_pre_dl=$LIBS
@@ -23,8 +33,8 @@ libs_pre_dl=$LIBS
   AC_SUBST([LIBS_DL])
 LIBS=$libs_pre_dl
 
-CXXFLAGS="-fPIC -Wall -Wextra $CXXFLAGS"
+CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS"
 
 AC_SUBST(REQUIRES)
 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])