1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

(trunk) don't link against -lrt unless libevent needs it

This commit is contained in:
Charles Kerr 2009-07-14 18:55:15 +00:00
parent 6fb3660280
commit 206c9f4b95

View file

@ -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)