diff options
author | François Revol <revol@free.fr> | 2014-07-22 21:59:31 +0200 |
---|---|---|
committer | François Revol <revol@free.fr> | 2014-07-22 21:59:31 +0200 |
commit | 9af3df4e9d1ecfc070fe79d0cd20e035986b33b2 (patch) | |
tree | 51a42c36a3debc8611318a427e9a9a44f08dca6e | |
parent | 5ddf127f6d5e32450ce4db10d756f924cdbc946b (diff) | |
download | irssi-9af3df4e9d1ecfc070fe79d0cd20e035986b33b2.zip |
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
-rw-r--r-- | configure.ac | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 2a7bee0d..360af621 100644 --- a/configure.ac +++ b/configure.ac @@ -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 |