1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00

Detect clock_gettime properly

my implementation of AC_SEARCH_LIBS macro was incorrect. This should hopefully fix it.
This commit is contained in:
Pavel Labath 2012-07-20 18:09:35 +02:00
parent 8bae807f68
commit 2fcd9c74a8
2 changed files with 15 additions and 14 deletions

View File

@ -128,18 +128,19 @@ macro(AC_SEARCH_LIBS FUNCTION_NAME INCLUDES TARGET_VAR)
check_symbol_exists(${FUNCTION_NAME} ${INCLUDES} AC_SEARCH_LIBS_TMP)
if(${AC_SEARCH_LIBS_TMP})
set(${TARGET_VAR} "" CACHE INTERNAL "Library containing ${FUNCTION_NAME}")
return()
endif(${AC_SEARCH_LIBS_TMP})
else(${AC_SEARCH_LIBS_TMP})
foreach(LIB ${ARGN})
unset(AC_SEARCH_LIBS_TMP CACHE)
unset(AC_SEARCH_LIBS_FOUND CACHE)
find_library(AC_SEARCH_LIBS_TMP ${LIB})
check_library_exists(${LIB} ${FUNCTION_NAME} ${AC_SEARCH_LIBS_TMP} AC_SEARCH_LIBS_FOUND)
check_library_exists(${LIB} ${FUNCTION_NAME} ${AC_SEARCH_LIBS_TMP}
AC_SEARCH_LIBS_FOUND)
if(${AC_SEARCH_LIBS_FOUND})
set(${TARGET_VAR} ${AC_SEARCH_LIBS_TMP} CACHE INTERNAL "Library containing ${FUNCTION_NAME}")
set(${TARGET_VAR} ${AC_SEARCH_LIBS_TMP} CACHE INTERNAL
"Library containing ${FUNCTION_NAME}")
break()
endif(${AC_SEARCH_LIBS_FOUND})
endforeach(LIB)
endif(${AC_SEARCH_LIBS_TMP})
endif("${TARGET_VAR}" MATCHES "^${TARGET_VAR}$")
endmacro(AC_SEARCH_LIBS)

View File

@ -39,9 +39,9 @@ check_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC)
check_symbol_exists(statfs64 "sys/statfs.h" HAVE_STATFS64)
AC_SEARCH_LIBS(clock_gettime "time.h" CLOCK_GETTIME_LIB "rt")
if(NOT CLOCK_GETTIME_LIB)
if(NOT DEFINED CLOCK_GETTIME_LIB)
message(FATAL_ERROR "clock_gettime not found.")
endif(NOT CLOCK_GETTIME_LIB)
endif(NOT DEFINED CLOCK_GETTIME_LIB)
set(conky_libs ${conky_libs} ${CLOCK_GETTIME_LIB})
# standard path to search for includes