]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Better fix for math library.
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 15 Mar 2010 11:09:55 +0000 (00:09 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 15 Mar 2010 11:09:55 +0000 (00:09 +1300)
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

configure.in
src/Common.am

index 82f0ff9a0f0cacfa5855e71b9a30b71b7d3341ba..c3fdc0ffc117e5c40b0c5f1ef7e223f7dc94ee96 100644 (file)
@@ -2973,22 +2973,17 @@ dnl end rip
   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])
index f7bdff495a749ddb43986d0cf557e9c14ad50877..b7d410bb7bd1330fd60e2878e6e215636bdd39b3 100644 (file)
@@ -32,5 +32,4 @@ $(OBJS): $(top_srcdir)/include/version.h $(top_builddir)/include/autoconf.h
 ## 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