1 dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License, or (at your option) any later version.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 AC_DEFUN([CHECK_SOCKETS],[
27 dnl Warren Young <warren@etr-usa.com>
31 echo ---------------------------------------------
33 echo ---------------------------------------------
36 AC_CACHE_CHECK(for libraries containing socket functions,
41 #include <sys/types.h>
42 #include <sys/socket.h>
43 #include <netinet/in.h>
44 #include <arpa/inet.h>
48 int sd = socket(AF_INET, SOCK_STREAM, 0);
51 ac_cv_socket_libs=-lc, ac_cv_socket_libs=no)
53 if test x"$ac_cv_socket_libs" = "xno"
55 CFLAGS="$oCFLAGS -lsocket"
57 #include <sys/types.h>
58 #include <sys/socket.h>
59 #include <netinet/in.h>
60 #include <arpa/inet.h>
64 int sd = socket(AF_INET, SOCK_STREAM, 0);
67 ac_cv_socket_libs=-lsocket, ac_cv_socket_libs=no)
70 if test x"$ac_cv_socket_libs" = "xno"
72 CFLAGS="$oCFLAGS -lsocket -lnsl"
74 #include <sys/types.h>
75 #include <sys/socket.h>
76 #include <netinet/in.h>
77 #include <arpa/inet.h>
81 int sd = socket(AF_INET, SOCK_STREAM, 0);
84 ac_cv_socket_libs="-lsocket -lnsl", ac_cv_socket_libs=no)
90 if test x"$ac_cv_socket_libs" = "xno"
92 AC_MSG_ERROR([Cannot find socket libraries])
93 elif test x"$ac_cv_socket_libs" = "x-lc"
96 CPPFLAGS="-DHAVE_SOCKET $CPPFLAGS"
97 CORBA_IDLCXXFLAGS="-DHAVE_SOCKET $CORBA_IDLCXXFLAGS"
98 CORBA_IDLPYFLAGS="-DHAVE_SOCKET $CORBA_IDLPYFLAGS"
100 SOCKETLIBS="$ac_cv_socket_libs"
101 CPPFLAGS="-DHAVE_SOCKET $CPPFLAGS"
102 CORBA_IDLCXXFLAGS="-DHAVE_SOCKET $CORBA_IDLCXXFLAGS"
103 CORBA_IDLPYFLAGS="-DHAVE_SOCKET $CORBA_IDLPYFLAGS"
107 AC_SUBST(SOCKETFLAGS)