Hi Simon, The sockets module knows how to find the sockets library on Windows and Solaris. Here's a patch that adds support for Haiku (needs to link with -lnetwork) and BeOS (needs to link with -lnet).
OK to apply? 2008-11-15 Bruno Haible <[EMAIL PROTECTED]> * m4/sockets.m4 (gl_SOCKETS): After trying -lsocket, try also -lnetwork and -lnet. Needed for Haiku and BeOS. *** m4/sockets.m4.orig 2008-11-16 04:48:40.000000000 +0100 --- m4/sockets.m4 2008-11-15 16:07:43.000000000 +0100 *************** *** 1,4 **** ! # sockets.m4 serial 2 dnl Copyright (C) 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, --- 1,4 ---- ! # sockets.m4 serial 3 dnl Copyright (C) 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, *************** *** 32,39 **** else dnl Unix API. dnl Solaris has most socket functions in libsocket. ! AC_CACHE_CHECK([whether setsockopt requires -lsocket], [gl_cv_lib_socket], [ ! gl_cv_lib_socket=no AC_TRY_LINK([extern #ifdef __cplusplus "C" --- 32,41 ---- else dnl Unix API. dnl Solaris has most socket functions in libsocket. ! dnl Haiku has most socket functions in libnetwork. ! dnl BeOS has most socket functions in libnet. ! AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [ ! gl_cv_lib_socket= AC_TRY_LINK([extern #ifdef __cplusplus "C" *************** *** 41,58 **** char setsockopt();], [setsockopt();], [], [gl_save_LIBS="$LIBS" ! LIBS="$LIBS -lsocket" AC_TRY_LINK([extern #ifdef __cplusplus "C" #endif char setsockopt();], [setsockopt();], ! [gl_cv_lib_socket=yes]) LIBS="$gl_save_LIBS" ]) ]) ! if test $gl_cv_lib_socket = yes; then ! LIBSOCKET='-lsocket' fi fi AC_SUBST([LIBSOCKET]) --- 43,81 ---- char setsockopt();], [setsockopt();], [], [gl_save_LIBS="$LIBS" ! LIBS="$gl_save_LIBS -lsocket" AC_TRY_LINK([extern #ifdef __cplusplus "C" #endif char setsockopt();], [setsockopt();], ! [gl_cv_lib_socket="-lsocket"]) ! if test -z "$gl_cv_lib_socket"; then ! LIBS="$gl_save_LIBS -lnetwork" ! AC_TRY_LINK([extern ! #ifdef __cplusplus ! "C" ! #endif ! char setsockopt();], [setsockopt();], ! [gl_cv_lib_socket="-lnetwork"]) ! if test -z "$gl_cv_lib_socket"; then ! LIBS="$gl_save_LIBS -lnet" ! AC_TRY_LINK([extern ! #ifdef __cplusplus ! "C" ! #endif ! char setsockopt();], [setsockopt();], ! [gl_cv_lib_socket="-lnet"]) ! fi ! fi LIBS="$gl_save_LIBS" ]) + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi ]) ! if test "$gl_cv_lib_socket" != "none needed"; then ! LIBSOCKET="$gl_cv_lib_socket" fi fi AC_SUBST([LIBSOCKET])