dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS dnl dnl This library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Lesser General Public dnl License as published by the Free Software Foundation; either dnl version 2.1 of the License, or (at your option) any later version. dnl dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with this library; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com dnl AC_DEFUN([CHECK_SOCKETS],[ dnl Author dnl Warren Young dnl M4 Source Code echo echo --------------------------------------------- echo testing sockets echo --------------------------------------------- echo AC_CACHE_CHECK(for libraries containing socket functions, ac_cv_socket_libs, [ oCFLAGS=$CFLAGS AC_TRY_LINK([ #include #include #include #include ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs=-lc, ac_cv_socket_libs=no) if test x"$ac_cv_socket_libs" = "xno" then CFLAGS="$oCFLAGS -lsocket" AC_TRY_LINK([ #include #include #include #include ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs=-lsocket, ac_cv_socket_libs=no) fi if test x"$ac_cv_socket_libs" = "xno" then CFLAGS="$oCFLAGS -lsocket -lnsl" AC_TRY_LINK([ #include #include #include #include ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs="-lsocket -lnsl", ac_cv_socket_libs=no) fi CFLAGS=$oCFLAGS ]) if test x"$ac_cv_socket_libs" = "xno" then AC_MSG_ERROR([Cannot find socket libraries]) elif test x"$ac_cv_socket_libs" = "x-lc" then SOCKETLIBS="" CPPFLAGS="-DHAVE_SOCKET $CPPFLAGS" CORBA_IDLCXXFLAGS="-DHAVE_SOCKET $CORBA_IDLCXXFLAGS" CORBA_IDLPYFLAGS="-DHAVE_SOCKET $CORBA_IDLPYFLAGS" else SOCKETLIBS="$ac_cv_socket_libs" CPPFLAGS="-DHAVE_SOCKET $CPPFLAGS" CORBA_IDLCXXFLAGS="-DHAVE_SOCKET $CORBA_IDLCXXFLAGS" CORBA_IDLPYFLAGS="-DHAVE_SOCKET $CORBA_IDLPYFLAGS" fi AC_SUBST(SOCKETLIBS) AC_SUBST(SOCKETFLAGS) ]) dnl CHECK_SOCKET