## -*- mode: m4 -*- dnl Copyright (c) 1998 N. D. Bellamy dnl Copyright (c) 1999,2000 Dirk Mueller AC_DEFUN([AC_CHECK_SOCKS5], [ AC_MSG_CHECKING(whether to enable SOCKS5 support) WITH_SOCKS5="no" SOCKS_LIBS="" SOCKS_LIBDIR="" SOCKS_INCDIR="" AC_ARG_ENABLE( socks5, [ --enable-socks5 enable SOCKS5 firewall support], WITH_SOCKS5=yes) AC_ARG_WITH( socks5-inc, [ --with-socks5-inc=PATH include path for SOCKS5 headers], socks_incdir="$withval", socks_incdir="no") AC_ARG_WITH( socks5-lib, [ --with-socks5-lib=PATH library path for SOCKS5 libraries], socks_libdir="$withval", socks_libdir="no") if test "$WITH_SOCKS5" = "no"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) WITH_SOCKS5="no" dnl Init if test "$socks_libdir" != "no"; then BACKUP_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -L$socks_libdir" fi if test "$socks_incdir" != "no"; then BACKUP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$socks_incdir" fi SOCKS_LIBS="" SOCKS_INCDIR="" licq_socks_optlen=unknown AC_CHECK_LIB(socks5, SOCKSinit, SOCKS_LIBS="-lsocks5") if test -z "$SOCKS_LIBS"; then AC_CHECK_LIB(socks, SOCKSinit, SOCKS_LIBS="-lsocks") fi if test -n "$SOCKS_LIBS"; then if test "$socks_libdir" != "no"; then SOCKS_LIBDIR="-L$socks_libdir" fi AC_CHECK_HEADER(socks.h, [if test "$socks_incdir" == "no"; then SOCKS_INCDIR="-Wno-implicit" else SOCKS_INCDIR="-I$socks_incdir -Wno-implicit" fi WITH_SOCKS5="yes" ]) if test -n "$SOCKS_INCDIR"; then AC_DEFINE(USE_SOCKS5, 1, [use socks5 support]) AC_MSG_CHECKING(SOCKS getsockopt's optlen type) AC_TRY_COMPILE( [ #include #include ], [ getsockopt(0,0,0,(void *)0,(socklen_t) 0) ], licq_socks_optlen=socklen_t, [AC_TRY_COMPILE( [ #include #include ], [ getsockopt(0,0,0,(void *)0,(int) 0)], licq_socks_optlen=int, licq_socks_optlen=unknown) ] ) AC_MSG_RESULT($licq_socks_optlen) if test $licq_socks_optlen = "int"; then AC_DEFINE(SOCKS5_OPTLEN, int, [getsockopt optlen parameter type]) else if test $licq_socks_optlen = "socklen_t"; then AC_DEFINE(SOCKS5_OPTLEN,socklen_t, [getsockopt optlen parameter type]) fi fi fi fi dnl restore flags if test "$socks_libdir" != "no"; then LDFLAGS="$BACKUP_LDFLAGS" fi if test "$socks_incdir" != "no"; then CPPFLAGS="$BACKUP_CPPFLAGS" fi fi dnl Substitute these even if they're null, so as not to mess up makefiles AC_SUBST(SOCKS_LIBS) AC_SUBST(SOCKS_LIBDIR) AC_SUBST(SOCKS_INCDIR) ]) dnl Check if struct tm contains long int tm_gmtoff AC_DEFUN([LICQ_CHECK_GMTOFF], [AC_CACHE_CHECK(for tm_gmtoff, licq_tm_gmtoff, [ AC_TRY_COMPILE([ #include ], [ long int foo; struct tm bar; foo = bar.tm_gmtoff; ], [ licq_tm_gmtoff=yes ], [ licq_tm_gmtoff=no ]) ]) if test $licq_tm_gmtoff = yes; then AC_DEFINE(USE_GMTOFF, 1, [Define if struct tm has gmtoff]) fi ]) dnl Check if long timezone is somewhere defined (i.e. AIX) AC_DEFUN([LICQ_CHECK_TIMEZONE], [AC_CACHE_CHECK(for extern long timezone, licq_extern_timezone, [ AC_TRY_LINK([ #include ], [ long foo; foo = timezone; ], [ licq_extern_timezone=yes ], [ licq_extern_timezone=no ]) ]) if test $licq_extern_timezone = yes; then AC_DEFINE(USE_TIMEZONE, 1, [Define if global variable timezone exists]) fi ]) AC_DEFUN([LICQ_OLD_CHECK_GPGME], [ AC_MSG_CHECKING(if GPGME support is desired) AC_ARG_ENABLE( gpgme, [ --disable-gpgme disable GPGME support], WITH_GPGME="$enableval", WITH_GPGME="yes") if test "$WITH_GPGME" = "yes"; then AC_MSG_RESULT(yes) AC_CHECK_LIB(gpgme,gpgme_check_version, [ dnl Action if found... LIBS="$LIBS -lgpgme" AC_DEFINE_UNQUOTED(HAVE_LIBGPGME, 1, [Define if GPGME is available]) ], [ dnl Action if not found... WITH_GPGME="no" ]) else AC_MSG_RESULT(no) fi ])