From: Lars Op den Kamp Date: Thu, 13 Oct 2011 21:11:33 +0000 (+0200) Subject: cec: only link cec-client against ld. use AC_SEARCH_LIBS instead of AC_CHECK_LIB X-Git-Tag: upstream/2.2.0~1^2~242 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c66708eb84ffe55c0459dd8ef367489b9bf1b3c6;p=deb_libcec.git cec: only link cec-client against ld. use AC_SEARCH_LIBS instead of AC_CHECK_LIB --- diff --git a/configure.ac b/configure.ac index 69c15ec..fd1eb01 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_PROG_LIBTOOL 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*) @@ -14,8 +14,14 @@ case "${host}" in ;; 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" diff --git a/src/testclient/Makefile.am b/src/testclient/Makefile.am index aa23d92..34af79b 100644 --- a/src/testclient/Makefile.am +++ b/src/testclient/Makefile.am @@ -2,4 +2,5 @@ bin_PROGRAMS = cec-client 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