1 dnl Copyright (C) 2007-2008 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.
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
22 AC_DEFUN([CHECK_SOCKETS],[
26 dnl Warren Young <warren@etr-usa.com>
30 echo ---------------------------------------------
32 echo ---------------------------------------------
35 AC_CACHE_CHECK(for libraries containing socket functions,
40 #include <sys/types.h>
41 #include <sys/socket.h>
42 #include <netinet/in.h>
43 #include <arpa/inet.h>
47 int sd = socket(AF_INET, SOCK_STREAM, 0);
50 ac_cv_socket_libs=-lc, ac_cv_socket_libs=no)
52 if test x"$ac_cv_socket_libs" = "xno"
54 CFLAGS="$oCFLAGS -lsocket"
56 #include <sys/types.h>
57 #include <sys/socket.h>
58 #include <netinet/in.h>
59 #include <arpa/inet.h>
63 int sd = socket(AF_INET, SOCK_STREAM, 0);
66 ac_cv_socket_libs=-lsocket, ac_cv_socket_libs=no)
69 if test x"$ac_cv_socket_libs" = "xno"
71 CFLAGS="$oCFLAGS -lsocket -lnsl"
73 #include <sys/types.h>
74 #include <sys/socket.h>
75 #include <netinet/in.h>
76 #include <arpa/inet.h>
80 int sd = socket(AF_INET, SOCK_STREAM, 0);
83 ac_cv_socket_libs="-lsocket -lnsl", ac_cv_socket_libs=no)
89 if test x"$ac_cv_socket_libs" = "xno"
91 AC_MSG_ERROR([Cannot find socket libraries])
92 elif test x"$ac_cv_socket_libs" = "x-lc"
95 CPPFLAGS="-DHAVE_SOCKET $CPPFLAGS"
96 CORBA_IDLCXXFLAGS="-DHAVE_SOCKET $CORBA_IDLCXXFLAGS"
97 CORBA_IDLPYFLAGS="-DHAVE_SOCKET $CORBA_IDLPYFLAGS"
99 SOCKETLIBS="$ac_cv_socket_libs"
100 CPPFLAGS="-DHAVE_SOCKET $CPPFLAGS"
101 CORBA_IDLCXXFLAGS="-DHAVE_SOCKET $CORBA_IDLCXXFLAGS"
102 CORBA_IDLPYFLAGS="-DHAVE_SOCKET $CORBA_IDLPYFLAGS"
106 AC_SUBST(SOCKETFLAGS)