aclocal.m4
资源名称:socks5.zip [点击查看]
上传用户:sddyfurun
上传日期:2007-01-04
资源大小:525k
文件大小:11k
源码类别:
代理服务器
开发平台:
Unix_Linux
- dnl try to find an ansi compiler.
- AC_DEFUN(AC_PROG_ANSI_CC, [
- if test -n "$CC"; then use_env_cc="yes"; fi
- AC_CHECK_PROG(CC, gcc2, gcc2)
- dnl We want to put the -g -O stuff from AC_PROG_CC in CDEBUG_FLAGS, not CFLAGS, so
- dnl store the old ones...then switch back
- OCFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC
- CDEBUG_FLAGS="$CFLAGS"
- CFLAGS="$OCFLAGS"
- savedcc="$CC"
- OS=`uname -s`
- OSVER=`uname -r`
- if test "$OS" = "SunOS"; then
- case $OSVER in
- 5.5*)
- AC_DEFINE(USE_SYSTEM_SEMAPHORE)
- esac
- fi
- if test "$GCC" = "yes"; then
- CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__"
- elif test "$OS" = "HP-UX" -a "$use_env_cc" != "yes"; then
- CFLAGS="-Ae"
- AC_TRY_COMPILE([void foo(int bar){}],,s5_have_ansi_cc="yes",s5_have_ansi_cc="no")
- if test "$s5_have_ansi_cc" = "no"; then
- CFLAGS=""
- unset CC
- unset ac_cv_prog_CC #unset cached CC
- AC_CHECK_PROG(CC, c89, c89, $savedcc)
- if test "$CC" = "c89" ; then CFLAGS="-D_HPUX_SOURCE"; fi
- fi
- elif test "$OS" = "SunOS" -a "$use_env_cc" != "yes"; then
- AC_TRY_COMPILE([void foo(int bar){}],,s5_have_ansi_cc="yes",s5_have_ansi_cc="no")
- if test "$s5_have_ansi_cc" = "no"; then
- unset CC
- unset ac_cv_prog_CC #unset cached CC
- AC_CHECK_PROG(CC, acc, acc, $savedcc)
- if test "$CC" = "acc" ; then CFLAGS=""; fi
- fi
- fi
- if test "$savedcc" != "$CC"; then AC_MSG_RESULT(resetting CC to $CC); fi
- AC_TRY_COMPILE([void foo(int bar){}],,AC_DEFINE(HAVE_FUNC_PROTOTYPE), AC_MSG_WARN(--> no ANSI C compiler found!n))
- ])dnl
- AC_DEFUN(AC_KERBEROS5, [
- AC_ARG_WITH(krb5, --with-krb5 Turn on Kerberos 5, [KRB5="$withval"], [KRB5="no"])
- if test "$KRB5" != "no"; then
- echo
- AC_MSG_CHECKING(Kerberos 5)
- AC_CACHE_VAL(r_cv_krb5_home, [
- if test "$KRB5" = "yes" -o "$KRB5" = ""; then
- r_cv_krb5_home=`egrep ^klogin /etc/inetd.conf|awk '{print [$]6;}'|awk -F/ '{ORS="/";for(i=1;i<=NF-2;i++) print $i;}'`
- else
- r_cv_krb5_home=$KRB5
- fi])dnl
- if test "$KRB5" = "" -a "$r_cv_krb5_home" != "" -a ! -d $r_cv_krb5_home/include/krb5; then
- r_cv_krb5_home=""
- fi
- KRB5_HOME=$r_cv_krb5_home
- if test "$KRB5_HOME" != ""; then
- AC_MSG_RESULT("$KRB5_HOME")
- elif test "$KRB5" != ""; then
- AC_MSG_RESULT("default")
- else
- AC_MSG_RESULT("no")
- fi
- if test "$KRB5" != "" -o "$KRB5_HOME" != ""; then
- if test "$KRB5_HOME" != ""; then
- [CFLAGS="$CFLAGS -I$KRB5_HOME/include"]
- [LDFLAGS="$LDFLAGS -L$KRB5_HOME/lib"]
- fi
- AC_CHECK_LIB(db, main)
- dnl check whether db has been found
- if test "$ac_cv_lib_db_main" = "no"; then
- AC_CHECK_LIB(ndbm,main)
- fi
- AC_CHECK_LIB(isode, main)
- AC_CHECK_LIB(com_err, main)
- AC_CHECK_LIB(crypto, main)
- AC_CHECK_LIB(krb5, main)
- AC_CHECK_LIB(gssapi_krb5, main)
- fi
- fi
- ])dnl
- AC_DEFUN(AC_MAKE_SHAREDLIB, [
- SHLIB_LD="ld"
- SHLIB_LIB=""
- SHLIB_LFLAGS="-shared"
- SHLIB_CFLAGS="-r"
- SHLIB_OFLAGS="-o "
- if test "$exec_prefix" != "NONE"; then
- SHLIB_DIR=$exec_prefix/lib
- elif test "$prefix" != "NONE"; then
- SHLIB_DIR=$prefix/lib
- else
- SHLIB_DIR=/usr/local/lib
- fi
- PRELOADS="echo Shared libraries not supported; exit; :"
- PRELOADA=""
- AC_MSG_CHECKING(shared library support)
- if test "$ac_cv_func_dlopen" = "yes" -o "$ac_cv_func_shl_load" = "yes"; then
- if test "$with_plugins" = "yes"; then
- PLUGIN_LIBS="libs5auth_u.so libs5auth_k.so libs5auth_c.so libs5filter_p.so"
- else
- SHARED_LIBSOCKS5_CFLAGS="-DFOR_SHARED_LIBRARY -DIN_LIBRARY"
- fi
- dnl can't socksify HP 9.* applications even it has shl_load()
- if test "$ac_cv_func_dlopen" = "yes"; then SHLIB_LIB="libsocks5_sh.so"; fi
- case `uname -rs` in
- UNIX_SV*|UNIX_System_V*)
- SHLIB_LFLAGS="-G"
- ;;
- FreeBSD*|NetBSD*)
- SHLIB_LFLAGS="-Bshareable"
- SHLIB_CFLAGS="-fpic"
- PRELOADS="LD_PRELOAD"
- ;;
- SunOS*4.*)
- SHLIB_CFLAGS="-P"
- SHLIB_LFLAGS="-dp -assert pure-text -assert nodefinitions"
- PRELOADS="LD_PRELOAD"
- ;;
- SunOS*5.*)
- SHLIB_LD="cc"
- SHLIB_CFLAGS="-KPIC"
- SHLIB_LFLAGS="-G"
- SHLIB_OFLAGS="-W0,-y-o -W0,-y"
- PRELOADS="LD_PRELOAD"
- ;;
- IRIX*5.*|IRIX*6.*)
- SHLIB_CFLAGS="-KPIC"
- PRELOADS="_RLD_LIST"
- PRELOADA=":DEFAULT"
- ;;
- BSD/OS*)
- SHLIB_LIB=
- ;;
- OSF1*)
- PRELOADS="_RLD_LIST"
- PRELOADA=":DEFAULT"
- ;;
- AIX*)
- SHLIB_LIB=""
- ;;
- *)
- PRELOADS="LD_PRELOAD"
- ;;
- esac
- if test "$GCC" = "yes" ; then
- SHLIB_CFLAGS="-fpic"
- case `uname -rs` in
- SunOS*4.*)
- DLLIBS="-lc"
- ;;
- SunOS*5.*)
- SHLIB_LD="gcc"
- SHLIB_OFLAGS="-o "
- SHLIB_LFLAGS="-shared"
- ;;
- UNIX_SV*|UNIX_System_V*)
- SHLIB_CFLAGS=
- ;;
- FreeBSD*|NetBSD*)
- ;;
- *)
- SHLIB_LD="gcc"
- SHLIB_LFLAGS="-shared"
- esac
- fi
- dnl I don't think this works, -r should produce the svr3.2
- dnl shared libs, not the svr4 ones that we want...
- if test `uname -s` = "FreeBSD"; then
- SHLIB_CFLAGS="-fpic -r"
- fi
- AC_MSG_RESULT("lflags: $SHLIB_LFLAGS cflags: $SHLIB_CFLAGS")
- else
- AC_MSG_RESULT(no)
- fi
- dnl server and client should include the objects which are not to be plugins
- if test "$PLUGIN_LIBS" = "" ; then
- AUTHS="upwd.o gss.o"
- FILTERS="packet.o"
- SERVER_PLUGIN_OBJS="$AUTHS $FILTERS"
- CLIENT_PLUGIN_OBJS="$AUTHS"
- fi
- SHLIB_LIBS="$SHLIB_LIBS $LIBS"
- if test "`uname`" = "Linux"; then
- SHLIB_LIBS="$SHLIB_LIBS -lc"
- fi
- AC_SUBST(DLLIBS)
- AC_SUBST(SHLIB_LD)
- AC_SUBST(SHLIB_DIR)
- AC_SUBST(SHLIB_LIB)
- AC_SUBST(SHLIB_CFLAGS)
- AC_SUBST(SHLIB_OFLAGS)
- AC_SUBST(SERVER_PLUGIN_OBJS)
- AC_SUBST(CLIENT_PLUGIN_OBJS)
- AC_SUBST(SHARED_LIBSOCKS5_CFLAGS)
- AC_SUBST(PLUGIN_LIBS)
- AC_SUBST(PRELOADS)
- AC_SUBST(PRELOADA)
- ])dnl
- AC_DEFUN(AC_CHECK_SHLIB, [
- ac_safe=`echo "$1" | tr './ 55' '___'`
- AC_MSG_CHECKING(for shared $1)
- AC_CACHE_VAL(r_cv_name_$ac_safe, [
- case `uname -rs` in
- IRIX*5.*)
- dnl 1 versioned number takes precedence over unversioned...
- dnl 2 /usr/lib, lib
- if test -n "`ls /usr/lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`ls /usr/lib/$ac_safe.so.* | sort -r | head -1`"
- elif test -n "`ls /lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`ls /lib/$ac_safe.so.* | sort -r | head -1`"
- elif test -f /usr/lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/usr/lib/$ac_safe.so"
- elif test -f /lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/lib/$ac_safe.so"
- fi
- ;;
- OSF1*)
- dnl 1 no versioning
- dnl 2 /usr/shlib, /usr/lib, /lib
- if test -f /usr/shlib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/usr/shlib/$ac_safe.so"
- elif test -f /usr/lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/usr/lib/$ac_safe.so"
- elif test -f /lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/lib/$ac_safe.so"
- fi
- ;;
- Linux*)
- dnl 1 versioned (w/o maj/min), versioned, unversioned
- dnl 2 /lib, /usr/lib
- dnl no path
- if test -n "`ls /lib/$ac_safe.so.? 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`cd /lib; ls $ac_safe.so.? | sort -r | head -1`"
- elif test -n "`ls /usr/lib/$ac_safe.so.? 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`cd /usr/lib; ls $ac_safe.so.* | sort -r | head -1`"
- elif test -n "`ls /lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`cd /lib; ls $ac_safe.so.* | sort -r | head -1`"
- elif test -n "`ls /usr/lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`cd /usr/lib; ls $ac_safe.so.* | sort -r | head -1`"
- elif test -f /lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/lib/$ac_safe.so"
- elif test -f /usr/lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/usr/lib/$ac_safe.so"
- fi
- ;;
- SunOS*)
- dnl 1 unversioned takes precedence over versioned
- dnl 2 /usr/lib /lib
- if test -f /usr/lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/usr/lib/$ac_safe.so"
- elif test -n "`ls /usr/lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`ls /usr/lib/$ac_safe.so.* | sort -r | head -1`"
- elif test -f /lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/lib/$ac_safe.so"
- elif test -n "`ls /lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`ls /lib/$ac_safe.so.* | sort -r | head -1`"
- fi
- ;;
- dgux*)
- dnl 1 /usr/dglib
- dnl 2 versioned, unversioned
- if test -f /usr/dglib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/usr/dglib/$ac_safe.so"
- elif test -n "`ls /usr/dglib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`ls /usr/dglib/$ac_safe.so.* | sort -r | head -1`"
- fi
- ;;
- *)
- dnl 1 unversioned number takes precedence over versioned...
- dnl 2 /lib, /usr/lib
- if test -f /lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/lib/$ac_safe.so"
- elif test -n "`ls /lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`ls /lib/$ac_safe.so.* | sort -r | head -1`"
- elif test -f /usr/lib/$ac_safe.so; then
- eval "r_cv_name_$ac_safe=/usr/lib/$ac_safe.so"
- elif test -n "`ls /usr/lib/$ac_safe.so.* 2>/dev/null | sort -r | head -1`"; then
- eval "r_cv_name_$ac_safe=`ls /usr/lib/$ac_safe.so.* | sort -r | head -1`"
- fi
- ;;
- esac
- ])dnl
- ac_result=`eval echo '$r_cv_name_'$ac_safe`
- if test "$ac_result" != ""; then
- AC_MSG_RESULT($ac_result)
- ifelse([$2], , :, [$2])dnl
- else
- AC_MSG_RESULT(no)
- ifelse([$3], , , [$3])dnl
- fi
- ])dnl
- AC_DEFUN(AC_CHECK_SHLIBS, [
- for r_lib_name in $1
- do
- AC_CHECK_SHLIB($r_lib_name, [
- changequote(, )dnl
- r_fixed=`echo $r_lib_name | tr '[a-z]./ 55' '[A-Z]___'`_NAME
- changequote([, ])dnl
- AC_DEFINE_UNQUOTED($r_fixed, "$ac_result") $2], $3)dnl
- done
- ])
- AC_DEFUN(AC_IDENT, [
- AC_ARG_WITH(ident, --with-ident Turn on ident verification, [IDENT="$withval"], [IDENT="no"])
- if test "$IDENT" != "no"; then
- if test "$IDENT" != "yes"; then
- [CFLAGS="$CFLAGS -I$IDENT/include"]
- [LDFLAGS="$LDFLAGS -L$IDENT/lib -lident"]
- fi
- S5_CHECK_HEADERS(ident.h, $IDENT)
- AC_CHECK_LIB(ident, main, [AC_DEFINE(HAVE_LIBIDENT) SERVER_LIBS="$SERVER_LIBS -lident"])
- fi
- ])
- dnl Check if struct sockaddr_un has sun_len
- AC_DEFUN(AC_SOCKADDR_SUN_LEN,[
- AC_MSG_CHECKING(whether sockaddr_un has sun_len)
- AC_CACHE_VAL(sc_cv_sockaddr_sun_len,
- [AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/un.h>],
- [struct sockaddr_un s_un; s_un.sun_len=0;],
- sc_cv_sockaddr_sun_len=yes, sc_cv_sockaddr_sun_len=no)])
- if test "$sc_cv_sockaddr_sun_len" = "yes"; then AC_DEFINE(HAVE_SOCKADDR_SUN_LEN) fi
- AC_MSG_RESULT($sc_cv_sockaddr_sun_len)
- ])
- AC_DEFUN(AC_CC_EXPORT_SYMBOL, [
- if test "$with_plugins" = "yes" ; then
- case `uname -rs` in
- AIX*)
- SHLIB_LIBS="$SHLIB_LIBS -L../lib -ls5util"
- ;;
- HP-UX*)
- EXPORT_LDFLAGS="-Wl,-E"
- ;;
- Linux*)
- EXPORT_LDFLAGS="-export-dynamic"
- ;;
- OSF1*)
- EXPORT_LDFLAGS="-Wl,-non_hidden"
- SHLIB_LFLAGS="$SHLIB_LFLAGS -Wl,-warning_unresolved"
- esac
- fi
- ])
- dnl check headers by temporarily appending an include directory
- AC_DEFUN(S5_CHECK_HEADERS, [
- SAVED_CPPFLAGS="$CPPFLAGS"
- if test "$2" != ""; then
- CPPFLAGS="$CPPFLAGS -I$2/include"
- fi
- AC_CHECK_HEADERS($1)
- CPPFLAGS="$SAVED_CPPFLAGS"
- ])