Permalink
Browse files

Only add -lrt if librt exists and has symbols.

On Mac OS X, librt does not exist at all. On Linux/amd64, it is
typically empty. Use AC_CHECK_LIB to add librt only when needed.
  • Loading branch information...
bsiegert committed Aug 9, 2016
1 parent d3dc97d commit 866da37b4a543cbc31d0ae7fc27dbd906b6d82dd
Showing with 4 additions and 1 deletion.
  1. +4 −1 configure.ac
View
@@ -65,7 +65,10 @@ if test "$spellcheck" = yes; then
fi
# Add explicit linking flags
GUI_LIBS="$GUI_LIBS -pthread -lm -lz -lrt"
GUI_LIBS="$GUI_LIBS -pthread -lm -lz"
AC_CHECK_LIB(rt, clock_gettime, [
GUI_LIBS="$GUI_LIBS -lrt"
])
# Checks for header files.
AC_CHECK_HEADERS([libintl.h locale.h netdb.h stdlib.h string.h sys/socket.h sys/time.h unistd.h fcntl.h])

0 comments on commit 866da37

Please sign in to comment.