AC_LINK_IFELSE(AC_LANG_PROGRAM([$5], [$6]),
[linkable=yes], [linkable=no])
- if test $linkable = yes; then
+ if test "$linkable" = yes; then
tor_$1_any_linkable=yes
# Okay, we can link against it. Can we find the headers?
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([$4], [$6]),
[buildable=yes], [buildable=no])
- if test $buildable = yes; then
+ if test "$buildable" = yes; then
tor_cv_library_$1_dir=$tor_trydir
tor_$1_dir_found=yes
break
fi
done
- if test $tor_$1_dir_found = no; then
- if test $tor_$1_any_linkable = no ; then
+ if test "$tor_$1_dir_found" = no; then
+ if test "$tor_$1_any_linkable" = no ; then
AC_MSG_WARN([Could not find a linkable $1. If you have it installed somewhere unusal, you can specify an explicit path using $7])
TOR_WARN_MISSING_LIB($1, pkg)
AC_MSG_ERROR([Missing libraries; unable to proceed.])
]) dnl end cache check
LIBS="$LIBS $3"
-if test $tor_cv_library_$1_dir != "(system)"; then
+if test "$tor_cv_library_$1_dir" != "(system)"; then
TOR_EXTEND_CODEPATH($tor_cv_library_$1_dir)
fi
AC_CANONICAL_HOST
if test -f /etc/redhat-release ; then
+ if test -f /usr/kerberos/include ; then
CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
+ fi
fi
# Not a no-op; we want to make sure that CPPFLAGS is set before we use
esac
fi
-if test $enable_threads = "yes"; then
+if test "$enable_threads" = "yes"; then
AC_DEFINE(ENABLE_THREADS, 1, [Defined if we will try to use multithreading])
fi
AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings))
AC_PROG_CC
+AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_RANLIB
bwin32=cross; AC_MSG_RESULT([cross])
)
-if test $bwin32 = cross; then
+if test "$bwin32" = cross; then
AC_MSG_CHECKING([for win32 (cross)])
AC_COMPILE_IFELSE([
#ifdef WIN32
bwin32=false; AC_MSG_RESULT([no]))
fi
-if test $bwin32 = true; then
+if test "$bwin32" = true; then
AC_DEFINE(MS_WINDOWS, 1, [Define to 1 if we are building for Windows.])
fi
AM_CONDITIONAL(BUILD_NT_SERVICES, test x$bwin32 = xtrue)
bmipspro=false; AC_MSG_RESULT(no),
bmipspro=true; AC_MSG_RESULT(yes))
-if test $bmipspro = true; then
+if test "$bmipspro" = true; then
CFLAGS="$CFLAGS -c99"
fi
AC_SEARCH_LIBS(dlopen, [dl])
AC_SEARCH_LIBS(inet_aton, [resolv])
-if test $enable_threads = "yes"; then
+if test "$enable_threads" = "yes"; then
AC_SEARCH_LIBS(pthread_create, [pthread])
AC_SEARCH_LIBS(pthread_detach, [pthread])
fi
AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit strlcat strlcpy strtoull ftello getaddrinfo localtime_r gmtime_r memmem strtok_r inet_pton inet_ntop mallinfo)
-if test $enable_threads = "yes"; then
+if test "$enable_threads" = "yes"; then
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNCS(pthread_create)
fi
dnl ------------------------------------------------------
dnl Where do you live, libevent? And how do we call you?
-if test $bwin32 = true; then
+if test "$bwin32" = true; then
TOR_LIB_WS32=-lws2_32
# Some of the cargo-cults recommend -lwsock32 as well, but I don't
# think it's actually necessary.
AC_SUBST(TOR_LIB_WS32)
AC_SUBST(TOR_LIB_GDI)
-dnl This is a disgusting hack so we safely include recent libevent headers.
+dnl We need to do this before we try our disgusting hack below.
+AC_CHECK_HEADERS([sys/types.h])
+
+dnl This is a disgusting hack so we safely include older libevent headers.
AC_CHECK_TYPE(u_int64_t, unsigned long long)
AC_CHECK_TYPE(u_int32_t, unsigned long)
AC_CHECK_TYPE(u_int16_t, unsigned short)
tor_cv_time_t_signed=yes
fi
-if test $tor_cv_time_t_signed = yes; then
+if test "$tor_cv_time_t_signed" = yes; then
AC_DEFINE([TIME_T_IS_SIGNED], 1,
[Define to 1 iff time_t is signed])
fi
tor_cv_null_is_zero=yes
fi
-if test $tor_cv_null_is_zero = yes; then
+if test "$tor_cv_null_is_zero" = yes; then
AC_DEFINE([NULL_REP_IS_ZERO_BYTES], 1,
[Define to 1 iff memset(0) sets pointers to NULL])
fi
tor_cv_malloc_zero_works=no
fi
-if test $tor_cv_malloc_zero_works = yes; then
+if test "$tor_cv_malloc_zero_works" = yes; then
AC_DEFINE([MALLOC_ZERO_WORKS], 1,
[Define to 1 iff malloc(0) returns a pointer])
fi
tor_cv_twos_complement=yes
fi
-if test $tor_cv_twos_complement = yes; then
+if test "$tor_cv_twos_complement" = yes; then
AC_DEFINE([USING_TWOS_COMPLEMENT], 1,
[Define to 1 iff we represent negative integers with two's complement])
fi
tor_cv_have_FUNCTION_macro=yes,
tor_cv_have_FUNCTION_macro=no))
-if test $tor_cv_have_func_macro = 'yes'; then
+if test "$tor_cv_have_func_macro" = 'yes'; then
AC_DEFINE(HAVE_MACRO__func__, 1, [Defined if the compiler supports __func__])
fi
-if test $tor_cv_have_FUNC_macro = 'yes'; then
+if test "$tor_cv_have_FUNC_macro" = 'yes'; then
AC_DEFINE(HAVE_MACRO__FUNC__, 1, [Defined if the compiler supports __FUNC__])
fi
-if test $tor_cv_have_FUNCTION_macro = 'yes'; then
+if test "$tor_cv_have_FUNCTION_macro" = 'yes'; then
AC_DEFINE(HAVE_MACRO__FUNCTION__, 1,
[Defined if the compiler supports __FUNCTION__])
fi
# Set CFLAGS _after_ all the above checks, since our warnings are stricter
# than autoconf's macros like.
-if test $ac_cv_c_compiler_gnu = yes; then
+if test "$ac_cv_c_compiler_gnu" = yes; then
CFLAGS="$CFLAGS -Wall -g -O2"
else
CFLAGS="$CFLAGS -g -O"