Skip to content

Commit

Permalink
Only add -lrt if librt exists and has symbols.
Browse files Browse the repository at this point in the history
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 866da37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 866da37

Please sign in to comment.