1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

Simplify network libraries detection with AC_SEARCH_LIBS

AC_SEARCH_LIBS first tries to link without any lib, then tries each
library, and sets $LIBS correctly in any case.

cf.
https://www.flameeyes.eu/autotools-mythbuster/autoconf/finding.html
This commit is contained in:
François Revol 2014-07-22 21:59:31 +02:00
parent 5ddf127f6d
commit 9af3df4e9d

View File

@ -197,17 +197,9 @@ case "$host_os" in
esac
AC_CHECK_FUNC(socket, [], [
AC_CHECK_LIB(socket, socket, [
LIBS="$LIBS -lsocket"
])
])
AC_SEARCH_LIBS([socket], [socket])
AC_CHECK_FUNC(inet_addr, [], [
AC_CHECK_LIB(nsl, inet_addr, [
LIBS="$LIBS -lnsl"
])
])
AC_SEARCH_LIBS([inet_addr], [nsl])
dnl * gcc specific options
if test "x$ac_cv_prog_gcc" = "xyes"; then