# SOCKS4 support checking
#
-SAVELIBS="$LIBS"
-SAVECFLAGS="$CFLAGS"
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
AC_MSG_CHECKING(whether to support SOCKS4)
AC_ARG_WITH(socks4,
[[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
no)
AC_MSG_RESULT(no)
;;
- yes)
- AC_MSG_RESULT(yes)
- socks=4
- LIBS="-lsocks $LIBS"
- ;;
*)
AC_MSG_RESULT(yes)
socks=4
if test -d "$withval/include"; then
CFLAGS="$CFLAGS -I$withval/include"
- else
- CFLAGS="$CFLAGS -I$withval"
fi
if test -d "$withval/lib"; then
- withval="-L$withval/lib -lsocks"
- else
- withval="-L$withval -lsocks"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
fi
- LIBS="$withval $LIBS"
+ LIBS="-lsocks $LIBS"
;;
esac
], [],
[
AC_MSG_ERROR(Could not find SOCKS4 library.)
- CFLAGS="$SAVECFLAGS"
- LIBS="$SAVELIBS"
+ LIBS="$SAVE_LIBS"
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
])
],
AC_MSG_RESULT(no)
# SOCKS5 support checking
#
-SAVELIBS="$LIBS"
-SAVECFLAGS="$CFLAGS"
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
AC_MSG_CHECKING(whether to support SOCKS5)
AC_ARG_WITH(socks5,
[[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
no)
AC_MSG_RESULT(no)
;;
- yes)
- AC_MSG_RESULT(yes)
- socks=5
- LIBS="-lsocks5 $LIBS"
- ;;
*)
AC_MSG_RESULT(yes)
socks=5
if test -d "$withval/include"; then
CFLAGS="$CFLAGS -I$withval/include"
- else
- CFLAGS="$CFLAGS -I$withval"
fi
if test -d "$withval/lib"; then
- withval="-L$withval/lib -lsocks5"
- else
- withval="-L$withval -lsocks5"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
fi
- LIBS="$withval $LIBS"
+ LIBS="-lsocks5 $LIBS"
;;
esac
], [],
[
AC_MSG_ERROR(Could not find SOCKS5 library.)
- CFLAGS="$SAVECFLAGS"
- LIBS="$SAVELIBS"
+ LIBS="$SAVE_LIBS"
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
])
],
AC_MSG_RESULT(no)
# source tree.
#
mp_gmp=false
-SAVELIBS="$LIBS"
-SAVECFLAGS="$CFLAGS"
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
AC_MSG_CHECKING(whether to search for GMP)
AC_ARG_WITH(gmp,
[[ --with-gmp[=DIR] use GMP instead of MPI [search in DIR/lib and DIR/include]]],
no)
AC_MSG_RESULT(no)
;;
- yes)
- AC_MSG_RESULT(yes)
- LIBS="-lgmp $LIBS"
- ;;
*)
AC_MSG_RESULT(yes)
if test -d "$withval/include"; then
CFLAGS="$CFLAGS -I$withval/include"
- else
- CFLAGS="$CFLAGS -I$withval"
fi
if test -d "$withval/lib"; then
- withval="-L$withval/lib -lgmp"
- else
- withval="-L$withval -lgmp"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
fi
- LIBS="$withval $LIBS"
+ LIBS="-lgmp $LIBS"
;;
esac
AC_MSG_RESULT(Using GMP as a MP library.)
],
[
- LIBS="$SAVELIBS"
- CFLAGS="$SAVECFLAGS"
+ LIBS="$SAVE_LIBS"
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
])
],
AC_MSG_RESULT(no)
#
check_iconv=true
has_iconv=false
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+SAVE_CPPFLAGS="$CPPFLAGS"
AC_MSG_CHECKING(whether to implicit search for libiconv)
AC_ARG_WITH(iconv,
[[ --with-iconv[=DIR] use libiconv [search in DIR/include and DIR/lib]]],
],
[
echo "no"
+ LIBS="$SAVE_LIBS"
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ CPPFLAGS="$SAVE_CPPFLAGS"
])
])
fi
if test x$check_iconv = xtrue; then
# search for iconv library..
- SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LIBS="$LIBS"
SAVE_CFLAGS="$CFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
+ SAVE_CPPFLAGS="$CPPFLAGS"
for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
if test x$has_iconv = xfalse; then
AC_MSG_RESULT(searching in $dir...)
-
- CPPFLAGS="$SAVE_CPPFLAGS"
- CFLAGS="$SAVE_CFLAGS"
- LDFLAGS="$SAVE_LDFLAGS"
-
+
if test -d $dir/include; then
CPPFLAGS="$CPPFLAGS -I$dir/include"
CFLAGS="$CFLAGS -I$dir/include"
[
echo "no"
has_iconv=false
+
+ LIBS="$SAVE_LIBS"
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ CPPFLAGS="$SAVE_CPPFLAGS"
])
+ ],
+ [
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ CPPFLAGS="$SAVE_CPPFLAGS"
])
fi
done
])
if test x$check_threads = xtrue; then
+ SAVE_LIBS="$LIBS"
+ SAVE_CFLAGS="$CFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+ SAVE_CPPFLAGS="$CPPFLAGS"
+
AC_MSG_RESULT(yes)
AC_CHECK_HEADERS(pthread.h,
[
- SAVE_LIBS="$LIBS"
LIBS="$LIBS -lpthread"
AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
[
case "${target}" in
*-*-freebsd*)
LIBS="$SAVE_LIBS -pthread"
- AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true)
+ AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
+ ;;
+ *)
+ LIBS="$SAVE_LIBS"
;;
esac
])
],
[
# search for pthread library..
- SAVE_CPPFLAGS="$CPPFLAGS"
- SAVE_CFLAGS="$CFLAGS"
- SAVE_LDFLAGS="$LDFLAGS"
-
for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
if test x$has_threads = xfalse; then
AC_MSG_RESULT(searching in $dir...)
- CPPFLAGS="$SAVE_CPPFLAGS"
- CFLAGS="$SAVE_CFLAGS"
- LDFLAGS="$SAVE_LDFLAGS"
-
if test -d $dir/include; then
CPPFLAGS="$CPPFLAGS -I$dir/include"
CFLAGS="$CFLAGS -I$dir/include"
[
LIBS="$LIBS -lpthread"
AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
- has_threads=false)
+ [
+ has_threads=false
+
+ LIBS="$SAVE_LIBS"
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ ])
+ ],
+ [
+ CFLAGS="$SAVE_CFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ CPPFLAGS="$SAVE_CPPFLAGS"
])
fi
done
fi
echo " SIM support ...................: $sim_support"
echo " IPv6 support ..................: $summary_ipv6"
-echo " Assmebler optimizations .......: $summary_asm"
+echo " Assembler optimizations .......: $summary_asm"
mp="MPI"
if test x$mp_gmp = xtrue; then