From 0fcb9e106cd2c4ecbaea60141c51cc6d1b5f53bc Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sun, 24 Sep 2006 16:12:49 +0000 Subject: [PATCH] The test for -lnsl, -linet, and -lsocket was only being run on IRIX, rather than run everywhere except IRIX. Rewritten to use AC_SEARCH_LIBS which should avoid problems on IRIX and any other similar platform. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9343 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/configure.in | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/SWIG/configure.in b/SWIG/configure.in index 3dc7139f2..f66b3b81b 100644 --- a/SWIG/configure.in +++ b/SWIG/configure.in @@ -324,20 +324,16 @@ fi AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX -# The following three (nsl,inet,socket) are needed on Sequent; -# the order of checking must be this. Most SVR4 platforms will -# need -lsocket and -lnsl. However on SGI IRIX 5, these exist but -# broken. I see no elegant solution (probably CHECK_LIB should be -# fixed to only add the library if the given entry point is not -# satisfied without it). -case $host in -*-*-irix*) -AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 -AC_CHECK_LIB(inet, gethostbyname, [LIBS="-linet $LIBS"], [], -lnsl) # Sequent -AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets -;; -esac - +dnl The following three libraries (nsl,inet,socket) are needed on Sequent, +dnl and must be checked for in this order since each library depends on the +dnl preceding one. +dnl +dnl Most SVR4 platforms will need -lsocket and -lnsl. However on SGI IRIX 5, +dnl these exist but are broken, so we use AC_SEARCH_LIBS which will only try +dnl the library if the function isn't already available without it. +AC_SEARCH_LIBS(t_open, nsl) # SVR4 +AC_SEARCH_LIBS(gethostbyname, inet) # Sequent +AC_SEARCH_LIBS(socket, socket) # SVR4 sockets AC_CHECK_LIB(swill, swill_init, [SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL"]) AC_SUBST(SWIGLIBS)