[#include <sys/types.h>
#include <sys/socket.h>])
+SOCKET_LIBS=
+AC_SEARCH_LIBS([gethostbyname], [nsl],
+ [if test x"$ac_cv_search_gethostbyname" != x"none required"; then
+ SOCKET_LIBS="$SOCKET_LIBS -lnsl";
+ fi])
+AC_SEARCH_LIBS([socket], [socket],
+ [if test x"$ac_cv_search_socket" != x"none required"; then
+ SOCKET_LIBS="$SOCKET_LIBS -lsocket";
+ fi])
+AC_SUBST([SOCKET_LIBS])
+
dnl Static compilation
m4_define([UTIL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
AM_CPPFLAGS += -I$(ul_libuuid_srcdir)
noinst_PROGRAMS = tst_uuid
-tst_uuid_LDADD = libuuid.la #$(ul_libuuid_la)
+tst_uuid_LDADD = libuuid.la $(SOCKET_LIBS) #$(ul_libuuid_la)
# includes
uuidincdir = $(includedir)/uuid
libuuid_la_DEPENDENCIES = uuid.sym
+libuuid_la_LIBADD = $(SOCKET_LIBS)
+
libuuid_la_LDFLAGS = -Wl,--version-script=$(ul_libuuid_srcdir)/uuid.sym \
-version-info $(LIBUUID_VERSION_INFO)