Detect math library properly based on rint synbol we need.
On Solaris at least "main" symbol does not exist.
fi
AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
+MATHLIB=""
case "$host_os" in
mingw|mingw32)
AC_MSG_NOTICE([Use MSVCRT for math functions.])
;;
*)
- AC_CHECK_LIB(m, main)
+ AC_SEARCH_LIBS([rint],[m],[
+ case "$ac_cv_search_rint" in
+ no*)
+ ;;
+ *)
+ MATHLIB="$ac_cv_search_rint"
+ esac ])
;;
esac
+AC_SUBST(MATHLIB)
dnl Enable IPv6 support
AC_MSG_CHECKING([whether to enable IPv6])
$(OBJS): $(top_srcdir)/include/version.h $(top_builddir)/include/autoconf.h
## Because compatibility is almost universal. And the link order is important.
+## NP: libmisc util.cc depends on rint from math library
COMPAT_LIB = \
-L$(top_builddir)/lib -lmiscutil \
- $(top_builddir)/compat/libcompat.la
+ $(top_builddir)/compat/libcompat.la \
+ $(MATHLIB)