case "${host}" in
*-*-linux*)
- AC_CHECK_LIB([udev], [main],, AC_MSG_ERROR("required library 'udev' is missing"))
+ AC_SEARCH_LIBS([udev_new], [udev],, AC_MSG_ERROR("required library 'udev' is missing"))
REQUIRES="udev"
;;
*-apple-darwin*)
;;
esac
-AC_CHECK_LIB([pthread], [main],, AC_MSG_ERROR("required library 'pthread' is missing"))
-AC_CHECK_LIB([dl], [main],, AC_MSG_ERROR("required library 'dl' is missing"))
+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"
cec_client_SOURCES = main.cpp \
../lib/platform/threads.cpp
-cec_client_CPPFLAGS = -I@abs_top_srcdir@/include
\ No newline at end of file
+cec_client_CPPFLAGS = -I@abs_top_srcdir@/include
+cec_client_LDFLAGS = @LIBS_DL@
\ No newline at end of file