diff options
author | Fabian Groffen | 2011-01-17 21:14:54 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-20 23:03:01 +0100 |
commit | 60cc9f9404dde852cc00fa05ff03108ac6ec31d8 (patch) | |
tree | cc21398f4ff075f06d8af0168d44fab3b3ef4223 /configure.ac | |
parent | build-sys: check for loff_t, it may not exist (diff) | |
download | kernel-qcow2-util-linux-60cc9f9404dde852cc00fa05ff03108ac6ec31d8.tar.gz kernel-qcow2-util-linux-60cc9f9404dde852cc00fa05ff03108ac6ec31d8.tar.xz kernel-qcow2-util-linux-60cc9f9404dde852cc00fa05ff03108ac6ec31d8.zip |
build-sys: link with socketlibs when necessary
To link an object which references socket functions, you need to link
with -lsocket -lnsl on Solaris.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 5b491f8ef..c38cca43f 100644 --- a/configure.ac +++ b/configure.ac @@ -211,6 +211,17 @@ AC_CHECK_MEMBER(struct sockaddr.sa_len, [#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]) |