clock_gettime() is also in -lrt so we also need to
check for it.
Use AC_SEARCH_LIBS() instead of our canned combo of
AC_CHECK_FUNC() + AC_CHECK_LIB(). AC_SEARCH_LIBS()
will automatically add the necessary -l flags to the
LIBS variable, so we don't need out AM_CONDITIONAL()
construct either, now.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
AC_SUBST(LIBOPING_PC_LIBS_PRIVATE)
AC_SUBST(LIBOPING_PC_LIBS_PRIVATE)
-nanosleep_needs_rt="no"
-AC_CHECK_FUNCS(nanosleep, [],
- AC_CHECK_LIB(rt, nanosleep,
- [nanosleep_needs_rt="yes"],
- AC_MSG_ERROR(cannot find nanosleep)))
-AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
+AC_SEARCH_LIBS([nanosleep],[rt],[],
+ [AC_MSG_ERROR([cannot find nanosleep])])
+AC_SEARCH_LIBS([clock_gettime],[rt],[],
+ [AC_MSG_ERROR([cannot find clock_gettime])])
with_ncurses="no"
AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses.h, [with_ncurses="yes"], [])
with_ncurses="no"
AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses.h, [with_ncurses="yes"], [])
oping_SOURCES = oping.c
oping_LDADD = liboping.la -lm
oping_SOURCES = oping.c
oping_LDADD = liboping.la -lm
-if BUILD_WITH_LIBRT
-oping_LDADD += -lrt
-endif
if BUILD_WITH_LIBNCURSES
bin_PROGRAMS += noping
if BUILD_WITH_LIBNCURSES
bin_PROGRAMS += noping
noping_SOURCES = oping.c
noping_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_NCURSES=1
noping_LDADD = liboping.la -lm $(NCURSES_LIB)
noping_SOURCES = oping.c
noping_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_NCURSES=1
noping_LDADD = liboping.la -lm $(NCURSES_LIB)
-if BUILD_WITH_LIBRT
-noping_LDADD += -lrt
-endif
endif # BUILD_WITH_LIBNCURSES
install-exec-hook:
endif # BUILD_WITH_LIBNCURSES
install-exec-hook: