build: correct library detection logic

This commit is contained in:
Danny Robson 2016-02-26 12:13:46 +11:00
parent ac897e91ea
commit cf5e897ca7

View File

@ -49,17 +49,18 @@ AC_FUNC_MMAP
AC_CHECK_HEADERS([execinfo.h], [break;], [have_execinfo_h=true]) AC_CHECK_HEADERS([execinfo.h], [break;], [have_execinfo_h=true])
AM_CONDITIONAL([HAVE_EXECINFO_H], [test "x$have_execinfo_h" = "xtrue"]) AM_CONDITIONAL([HAVE_EXECINFO_H], [test "x$have_execinfo_h" = "xtrue"])
AC_SEARCH_LIBS([clock_gettime], [rt], [], [
AC_MSG_ERROR([unable to find the clock library])
])
AC_SEARCH_LIBS([clock_gettime], [rt]) AC_SEARCH_LIBS([cos], [m], [], [
AS_IF([test "x$ac_cv_search_clock_gettime" == "x-*"], [ AC_MSG_ERROR([unable to find the maths library])
AX_APPEND_LINK_FLAGS([$ac_cv_search_clock_gettime], [], [-Werror])
]) ])
## Use dynamic loader if present (for util::library) ## Use dynamic loader if present (for util::library)
AS_IF( AS_IF([test "x${host_os}" != "xmingw32"],[
[test "x${host_os}" != "xmingw32"], AC_SEARCH_LIBS([dlopen], [dl])
[AC_SEARCH_LIBS([dlopen], [dl])] ])
)
############################################################################### ###############################################################################
@ -98,7 +99,9 @@ AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS) AC_SUBST(ZLIB_LIBS)
AC_CHECK_TOOL([ADDR2LINE], [addr2line], [:]) AC_CHECK_TOOL([ADDR2LINE], [addr2line], [:])
AS_IF([test "x$ADDR2LINE" != "x:"], [AC_DEFINE_UNQUOTED([ADDR2LINE], ["$ADDR2LINE"], [addr2line tool name])]) AS_IF([test "x$ADDR2LINE" != "x:"], [
AC_DEFINE_UNQUOTED([ADDR2LINE], ["$ADDR2LINE"], [addr2line tool name])
])
############################################################################### ###############################################################################
## Performance and build optimisations ## Performance and build optimisations