dnl CF_SOCKS version: 8 updated: 2010/05/05 20:27:55
dnl --------
dnl Check for socks library
dnl $1 = the [optional] directory in which the library may be found
AC_DEFUN([CF_SOCKS],[
  CF_ADD_OPTIONAL_PATH($1, [socks library])
  CF_FIND_LINKAGE([
#include <stdio.h>
],[
      Raccept((char *)0)
],
      socks)

  if test "x$cf_cv_find_linkage_socks" = "xyes" ; then
    AC_DEFINE(SOCKS)

    AC_DEFINE(accept,Raccept)
    AC_DEFINE(bind,Rbind)
    AC_DEFINE(connect,Rconnect)
    AC_DEFINE(getpeername,Rgetpeername)
    AC_DEFINE(getsockname,Rgetsockname)
    AC_DEFINE(listen,Rlisten)
    AC_DEFINE(recvfrom,Rrecvfrom)
    AC_DEFINE(select,Rselect)
  else
    AC_MSG_ERROR(cannot link with socks library)
  fi
])dnl
