aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-05-23 08:38:18 +0000
committerNick Mathewson <nickm@torproject.org>2006-05-23 08:38:18 +0000
commitc1054ffe92236a2f4eb7ee69b2822c2ac443ba3f (patch)
treeec093115872a0f4eb5e575ca7b62cefe9a753979 /configure.in
parent89a8411acec388612c71a0268752cbc0d5f958d4 (diff)
downloadtor-c1054ffe92236a2f4eb7ee69b2822c2ac443ba3f.tar
tor-c1054ffe92236a2f4eb7ee69b2822c2ac443ba3f.tar.gz
Patch from Michael Mohr to fix cross-compilation. Backport candidate. Tweaked to use sensible defaults for NULL_REP_IS_ZERO_BYTES and TIME_T_IS_SIGNED.
svn:r6474
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 6027a61b1..aa666a73f 100644
--- a/configure.in
+++ b/configure.in
@@ -169,6 +169,7 @@ if test $ac_cv_libevent_dir != "(system)"; then
fi
fi
+if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether we need extra options to link libevent],
ac_cv_libevent_linker_option, [
saved_LDFLAGS="$LDFLAGS"
@@ -200,6 +201,7 @@ AC_CACHE_CHECK([whether we need extra options to link libevent],
if test $ac_cv_libevent_linker_option != '(none)' ; then
LDFLAGS="$ac_cv_libevent_linker_option $LDFLAGS"
fi
+fi
dnl ------------------------------------------------------
dnl Where do you live, openssl? And how do we call you?
@@ -266,6 +268,8 @@ if test "$ac_cv_openssl_dir" != "(system)"; then
fi
fi
+if test -z $CROSS_COMPILE
+then
AC_CACHE_CHECK([whether we need extra options to link OpenSSL],
ac_cv_openssl_linker_option, [
saved_LDFLAGS="$LDFLAGS"
@@ -325,6 +329,7 @@ return (OPENSSL_VERSION_NUMBER == SSLeay()) == 0;
if test "$ac_cv_openssl_linker_option" != '(none)' ; then
LDFLAGS="$ac_cv_openssl_linker_option $LDFLAGS"
fi
+fi
dnl Make sure to enable support for large off_t if avalable.
@@ -377,11 +382,18 @@ AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(__int64)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(time_t)
+
+if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [
AC_TRY_RUN([
int main(int c, char**v) { if (((time_t)-1)<0) return 1; else return 0; }],
tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes)
])
+else
+ # Cross-compiling; let's hope the target platform isn't loony.
+ AC_MSG_NOTICE([Cross compiling: assuming that time_t is signed.])
+ tor_cv_time_t_signed=yes
+fi
if test $tor_cv_time_t_signed = yes; then
AC_DEFINE([TIME_T_IS_SIGNED], 1,
@@ -399,6 +411,7 @@ AC_CHECK_SIZEOF(socklen_t, , [AC_INCLUDES_DEFAULT()
AC_CHECK_SIZEOF(cell_t)
# Now make sure that NULL can be represented as zero bytes.
+if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether memset(0) sets pointers to NULL], tor_cv_null_is_zero,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[#include <stdlib.h>
@@ -413,6 +426,12 @@ return memcmp(&p1,&p2,sizeof(char*))?1:0; }]])],
[tor_cv_null_is_zero=no],
[tor_cv_null_is_zero=cross])])
+else
+ # Cross-compiling; let's hope that the target isn't raving mad.
+ AC_MSG_NOTICE([Cross-compiling: we'll assume that NULL is represented as a sequence of 0-valued bytes.])
+ tor_cv_null_is_zero=yes
+fi
+
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])