From eefc6eb0fe117cd5161bf6e5918f53ff2bb7cab1 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Tue, 5 Aug 2008 12:00:42 +0200 Subject: [PATCH] Detect the required libraries instead of hardcoding them in LDFLAGS Use AC_SEARCH_LIBS to detect the required sockets libraries instead of hardcoding them in LDFLAGS for the Sun Studio compiler. --- configure.ac | 3 ++- libmemcached/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a99c994b..3376f450 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,6 @@ then fi else CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ $CFLAGS" - LDFLAGS="-lsocket -lnsl $LDFLAGS" DTRACEFLAGS="$DTRACEFLAGS" fi @@ -74,4 +73,6 @@ AC_C_CONST AC_HEADER_TIME AC_TYPE_SIZE_T AC_SEARCH_LIBS(getopt_long, gnugetopt) +AC_SEARCH_LIBS(socket, socket) +AC_SEARCH_LIBS(gethostbyname, nsl) AC_OUTPUT(Makefile clients/Makefile tests/Makefile docs/Makefile libmemcached/Makefile support/Makefile support/libmemcached.pc support/libmemcached.spec) diff --git a/libmemcached/Makefile.am b/libmemcached/Makefile.am index b024d9f9..fbb7726a 100644 --- a/libmemcached/Makefile.am +++ b/libmemcached/Makefile.am @@ -1,7 +1,7 @@ EXTRA_DIST = libmemcached_probes.d memcached/README.txt INCLUDES = -I$(top_builddir) -LIBS = +LIBS = @LIBS@ DTRACE = @DTRACE@ DTRACEFLAGS = @DTRACEFLAGS@ -- 2.30.2