Skip to content

Commit 05d9134

Browse files
lanurmistephane
authored andcommitted
Link against socket and nsl libs when building on SunOS
On OpenIndiana (SunOS) functions such as bind, socket, listen require -lnsl -lsocket to be given to linker.
1 parent 9fb0283 commit 05d9134

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

configure.ac

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ AC_CANONICAL_HOST
5959
os_win32="false"
6060
os_cygwin="false"
6161
os_qnx="false"
62+
os_sunos="false"
6263
case "${host_os}" in
6364
*mingw32*)
6465
os_win32="true"
@@ -68,6 +69,9 @@ case "${host_os}" in
6869
;;
6970
*cygwin*)
7071
os_cygwin="true"
72+
;;
73+
*solaris*)
74+
os_sunos="true"
7175
;;
7276
esac
7377
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "true")
@@ -133,6 +137,11 @@ if test "$os_cygwin" = "false"; then
133137
fi
134138
fi
135139

140+
if test "$os_sunos" = "true"; then
141+
LIBS="$LIBS -lnsl -lsocket"
142+
AC_SUBST(LIBS)
143+
fi
144+
136145
# Check for RS485 support (Linux kernel version 2.6.28+)
137146
AC_CHECK_DECLS([TIOCSRS485], [], [], [[#include <sys/ioctl.h>]])
138147
# Check for RTS flags

0 commit comments

Comments
 (0)