From: Monty Taylor Date: Wed, 20 May 2009 18:34:42 +0000 (-0700) Subject: Only link libm with things that need libm. X-Git-Tag: 0.30~3^2~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=90d27aff47a3e3dc4c1d2450cbb8588e0b9546d2;p=awesomized%2Flibmemcached Only link libm with things that need libm. --- diff --git a/configure.ac b/configure.ac index 7c541b24..103c3346 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,20 @@ AC_TYPE_SIZE_T AC_SEARCH_LIBS(getopt_long, gnugetopt) AC_SEARCH_LIBS(socket, socket) AC_SEARCH_LIBS(gethostbyname, nsl) + +save_LIBS="$LIBS" +LIBS="$LIBS -lm" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include + ]],[[ + float f= floorf((float) 1.0); + ]], + [LIBM="-lm"],[LIBM=""])]) + +AC_SUBST(LIBM) +LIBS="$save_LIBS" AC_SEARCH_LIBS(floorf, m) diff --git a/libmemcached/Makefile.am b/libmemcached/Makefile.am index ebb31be5..be314700 100644 --- a/libmemcached/Makefile.am +++ b/libmemcached/Makefile.am @@ -73,7 +73,7 @@ endif DEFS += -DMEMCACHED_INTERNAL libmemcached_la_DEPENDENCIES = @DTRACE_OBJ@ -libmemcached_la_LIBADD = @DTRACE_OBJ@ +libmemcached_la_LIBADD = @DTRACE_OBJ@ $(LIBM) libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION) $(LD_VERSION_SCRIPT) $(LIBM) dtrace_probes.h: libmemcached_probes.d