Detect the required libraries instead of hardcoding them in LDFLAGS
authorTrond Norbye <trond.norbye@sun.com>
Tue, 5 Aug 2008 10:00:42 +0000 (12:00 +0200)
committerTrond Norbye <trond.norbye@sun.com>
Tue, 5 Aug 2008 10:00:42 +0000 (12:00 +0200)
Use AC_SEARCH_LIBS to detect the required sockets libraries instead of
hardcoding them in LDFLAGS for the Sun Studio compiler.

configure.ac
libmemcached/Makefile.am

index a99c994b10490218d367566b78bdaf6edf0d143a..3376f4503c0c73df8eb921810ef6cec560e09f2f 100644 (file)
@@ -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)
index b024d9f9e64eafb9446262dc33de4aeed879f59e..fbb7726a7aa6dea0a3836ac73930df923ed40498 100644 (file)
@@ -1,7 +1,7 @@
 EXTRA_DIST = libmemcached_probes.d memcached/README.txt
 
 INCLUDES = -I$(top_builddir)
-LIBS =
+LIBS = @LIBS@
 
 DTRACE =                @DTRACE@
 DTRACEFLAGS =           @DTRACEFLAGS@