From: Lubomir Sedlacik Date: Sat, 9 Nov 2002 17:38:19 +0000 (+0000) Subject: fix SOCKS[45] handling when only --with-socks[5] is provided X-Git-Tag: silc.server.0.9.6~65 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=5283152fa871d118774481bda33f730667b81ea2 fix SOCKS[45] handling when only --with-socks[5] is provided --- diff --git a/configure.in.pre b/configure.in.pre index bb35b80e..d7017464 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -442,6 +442,8 @@ AC_SUBST(PIDFILE) # SOCKS4 support checking # +SAVELIBS="$LIBS" +SAVECFLAGS="$CFLAGS" AC_MSG_CHECKING(whether to support SOCKS4) AC_ARG_WITH(socks4, [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]], @@ -450,6 +452,11 @@ AC_ARG_WITH(socks4, no) AC_MSG_RESULT(no) ;; + yes) + AC_MSG_RESULT(yes) + socks=4 + LIBS="-lsocks $LIBS" + ;; *) AC_MSG_RESULT(yes) socks=4 @@ -466,21 +473,26 @@ AC_ARG_WITH(socks4, fi LIBS="$withval $LIBS" - AC_TRY_LINK([], - [ - Rconnect(); - ], [], - [ - AC_MSG_ERROR(Could not find SOCKS4 library.) - ]) ;; esac + + AC_TRY_LINK([], + [ + Rconnect(); + ], [], + [ + AC_MSG_ERROR(Could not find SOCKS4 library.) + CFLAGS="$SAVECFLAGS" + LIBS="$SAVELIBS" + ]) ], AC_MSG_RESULT(no) ) # SOCKS5 support checking # +SAVELIBS="$LIBS" +SAVECFLAGS="$CFLAGS" AC_MSG_CHECKING(whether to support SOCKS5) AC_ARG_WITH(socks5, [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]], @@ -489,6 +501,11 @@ AC_ARG_WITH(socks5, no) AC_MSG_RESULT(no) ;; + yes) + AC_MSG_RESULT(yes) + socks=5 + LIBS="-lsocks5 $LIBS" + ;; *) AC_MSG_RESULT(yes) socks=5 @@ -505,15 +522,18 @@ AC_ARG_WITH(socks5, fi LIBS="$withval $LIBS" - AC_TRY_LINK([], - [ - SOCKSconnect(); - ], [], - [ - AC_MSG_ERROR(Could not find SOCKS5 library.) - ]) ;; esac + + AC_TRY_LINK([], + [ + SOCKSconnect(); + ], [], + [ + AC_MSG_ERROR(Could not find SOCKS5 library.) + CFLAGS="$SAVECFLAGS" + LIBS="$SAVELIBS" + ]) ], AC_MSG_RESULT(no) )