Skip to content

Commit

Permalink
Link against socket and nsl libs when building on SunOS
Browse files Browse the repository at this point in the history
On OpenIndiana (SunOS) functions such as bind, socket, listen
require -lnsl -lsocket to be given to linker.
  • Loading branch information
lanurmi authored and stephane committed Jul 17, 2024
1 parent 9fb0283 commit 05d9134
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ AC_CANONICAL_HOST
os_win32="false"
os_cygwin="false"
os_qnx="false"
os_sunos="false"
case "${host_os}" in
*mingw32*)
os_win32="true"
Expand All @@ -68,6 +69,9 @@ case "${host_os}" in
;;
*cygwin*)
os_cygwin="true"
;;
*solaris*)
os_sunos="true"
;;
esac
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "true")
Expand Down Expand Up @@ -133,6 +137,11 @@ if test "$os_cygwin" = "false"; then
fi
fi

if test "$os_sunos" = "true"; then
LIBS="$LIBS -lnsl -lsocket"
AC_SUBST(LIBS)
fi

# Check for RS485 support (Linux kernel version 2.6.28+)
AC_CHECK_DECLS([TIOCSRS485], [], [], [[#include <sys/ioctl.h>]])
# Check for RTS flags
Expand Down

0 comments on commit 05d9134

Please sign in to comment.