* check if dlopen() is in libc first, then in libdl

* check if clock_gettime() is in libc first, then in librt

some systems have these functions in libc, or in a specific lib.
This allows to correctly set dlopen_libs and rt_libs variables.



SVN revision: 55821
This commit is contained in:
Vincent Torri 2011-01-03 08:16:55 +00:00
parent 588c29451b
commit 00d864e8a6
1 changed files with 12 additions and 5 deletions

View File

@ -405,11 +405,18 @@ case "$host_os" in
dlopen_libs="-ldl"
;;
*)
AC_CHECK_LIB([dl], [dlopen], [dlopen_libs=-ldl])
AC_SEARCH_LIBS([clock_gettime], [rt],
[
rt_libs=-lrt
AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])
AC_CHECK_LIB([c], [dlopen],
[],
[AC_CHECK_LIB([dl], [dlopen],
[dlopen_libs=-ldl])
])
AC_CHECK_LIB([c], [clock_gettime],
[AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])],
[AC_CHECK_LIB([rt], [clock_gettime],
[
rt_libs=-lrt
AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])
])
])
;;
esac