mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk) don't link against -lrt unless libevent needs it
This commit is contained in:
parent
6fb3660280
commit
206c9f4b95
1 changed files with 11 additions and 2 deletions
13
configure.ac
13
configure.ac
|
@ -161,6 +161,15 @@ AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
|
|||
])
|
||||
|
||||
|
||||
dnl libevent likes to link against librt if possible
|
||||
dnl for clock_gettime() and clock_settime()
|
||||
dnl TODO(libevent2): this can probably be removed after
|
||||
dnl we switch to libevent2, since it will have PKG_CONFIG
|
||||
AC_CHECK_LIB([rt],
|
||||
[clock_gettime],
|
||||
[libevent_extra_libs="-lrt"],
|
||||
[libevent_extra_libs=""])
|
||||
|
||||
dnl build our copy of libevent whether we use it or not,
|
||||
dnl because "make dist" needs its Makefiles to exist, and
|
||||
dnl AM_CONDITIONAL + AC_CONFIG_SUBDIRS don't seem to play nice
|
||||
|
@ -169,7 +178,7 @@ libevent_source=bundled
|
|||
AC_CHECK_LIB([event],[evutil_vsnprintf],
|
||||
[libevent_found=yes],
|
||||
[libevent_found=no],
|
||||
[-levent])
|
||||
[$libevent_extra_libs])
|
||||
AC_CHECK_HEADER([event-config.h],
|
||||
[libevent_headers_found=yes],
|
||||
[libevent_headers_found=no])
|
||||
|
@ -186,7 +195,7 @@ if test "x$libevent_source" = "xbundled"; then
|
|||
LIBEVENT_LIBS="\$(top_builddir)/third-party/libevent/libevent.la"
|
||||
else
|
||||
LIBEVENT_CFLAGS=""
|
||||
LIBEVENT_LIBS="-levent -lrt"
|
||||
LIBEVENT_LIBS="-levent $libevent_extra_libs"
|
||||
fi
|
||||
AC_SUBST(LIBEVENT_CFLAGS)
|
||||
AC_SUBST(LIBEVENT_LIBS)
|
||||
|
|
Loading…
Reference in a new issue