This one leaves the library include in LIBS for general use.
Also, the C code where rint() symbol is used is more limited than C++
so we must specify the code language where it will be used correctly.
TODO: have yet to determine if we can drop the host_os windows detection
when using AC_SEARCH_LIBS
fi
AC_CHECK_LIB(regex, main, [REGEXLIB="-lregex"])
-MATHLIB=""
case "$host_os" in
mingw|mingw32)
AC_MSG_NOTICE([Use MSVCRT for math functions.])
;;
*)
- AC_SEARCH_LIBS([rint],[m],[
- case "$ac_cv_search_rint" in
- no*)
- ;;
- *)
- MATHLIB="$ac_cv_search_rint"
- esac ])
+ dnl rint() is only used in old C code for now.
+ AC_LANG_PUSH([C])
+ AC_SEARCH_LIBS([rint],[m])
+ AC_LANG_POP([C])
;;
esac
-AC_SUBST(MATHLIB)
dnl Enable IPv6 support
AC_MSG_CHECKING([whether to enable IPv6])
## NP: libmisc util.cc depends on rint from math library
COMPAT_LIB = \
-L$(top_builddir)/lib -lmiscutil \
- $(top_builddir)/compat/libcompat.la \
- $(MATHLIB)
+ $(top_builddir)/compat/libcompat.la