[or-cvs] r12945: Handle cross-compilation more sanely: avoid most uses of the (tor/trunk)
nickm at seul.org
nickm at seul.org
Sun Dec 23 18:20:22 UTC 2007
Author: nickm
Date: 2007-12-23 13:20:22 -0500 (Sun, 23 Dec 2007)
New Revision: 12945
Modified:
tor/trunk/
tor/trunk/ChangeLog
tor/trunk/acinclude.m4
tor/trunk/configure.in
Log:
r15646 at tombo: nickm | 2007-12-23 13:17:33 -0500
Handle cross-compilation more sanely: avoid most uses of the (never-defined!) CROSS_COMPILE variable; in the one place where we cannot help it, use the correct cross_compiling.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r15646] on d9e39d38-0f13-419c-a857-e10a0ce2aa0c
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2007-12-23 17:57:07 UTC (rev 12944)
+++ tor/trunk/ChangeLog 2007-12-23 18:20:22 UTC (rev 12945)
@@ -1,3 +1,7 @@
+Changes in version 0.2.0.15-alpha - 2008-01-??
+ o Minor bugfixes:
+ - Fix configure.in logic for cross-compilation.
+
Changes in version 0.2.0.14-alpha - 2007-12-23
o Major bugfixes:
- Fix a crash on startup if you install Tor 0.2.0.13-alpha fresh
Modified: tor/trunk/acinclude.m4
===================================================================
--- tor/trunk/acinclude.m4 2007-12-23 17:57:07 UTC (rev 12944)
+++ tor/trunk/acinclude.m4 2007-12-23 18:20:22 UTC (rev 12945)
@@ -150,7 +150,7 @@
TOR_DEFINE_CODEPATH($tor_cv_library_$1_dir, $1)
-if test -z "$CROSS_COMPILE"; then
+if test "$cross_compiling" != yes; then
AC_CACHE_CHECK([whether we need extra options to link $1],
tor_cv_library_$1_linker_option, [
orig_LDFLAGS="$LDFLAGS"
Modified: tor/trunk/configure.in
===================================================================
--- tor/trunk/configure.in 2007-12-23 17:57:07 UTC (rev 12944)
+++ tor/trunk/configure.in 2007-12-23 18:20:22 UTC (rev 12945)
@@ -405,7 +405,6 @@
#endif
])
-if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [
AC_RUN_IFELSE(AC_LANG_SOURCE([
#ifdef HAVE_SYS_TYPES_H
@@ -418,15 +417,14 @@
#include <time.h>
#endif
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)
+ tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes, tor_cv_time_t_signed=cross)
])
-else
- # Cross-compiling; let's hope the target platform isn't loony.
+
+if test "$tor_cv_time_t_signed" = cross; then
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
+if test "$tor_cv_time_t_signed" != no; then
AC_DEFINE([TIME_T_IS_SIGNED], 1,
[Define to 1 iff time_t is signed])
fi
@@ -442,7 +440,6 @@
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>
@@ -457,20 +454,17 @@
[tor_cv_null_is_zero=no],
[tor_cv_null_is_zero=cross])])
-else
+if test "$tor_cv_null_is_zero" = cross ; then
# 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
+if test "$tor_cv_null_is_zero" != no; then
AC_DEFINE([NULL_REP_IS_ZERO_BYTES], 1,
[Define to 1 iff memset(0) sets pointers to NULL])
fi
# And what happens when we malloc zero?
-
-if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether we can malloc(0) safely.], tor_cv_malloc_zero_works,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[#include <stdlib.h>
@@ -484,10 +478,9 @@
[tor_cv_malloc_zero_works=no],
[tor_cv_malloc_zero_works=cross])])
-else
+if test "$tor_cv_malloc_zero_works" = cross; then
# Cross-compiling; let's hope that the target isn't raving mad.
AC_MSG_NOTICE([Cross-compiling: we'll assume that we need to check malloc() arguments for 0.])
- tor_cv_malloc_zero_works=no
fi
if test "$tor_cv_malloc_zero_works" = yes; then
@@ -496,7 +489,6 @@
fi
# whether we seem to be in a 2s-complement world.
-if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether we are using 2s-complement arithmetic], tor_cv_twos_complement,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[int main () { int problem = ((-99) != (~99)+1);
@@ -505,13 +497,12 @@
[tor_cv_twos_complement=no],
[tor_cv_twos_complement=cross])])
-else
+if test "$tor_cv_twos_complement" = cross ; then
# Cross-compiling; let's hope that the target isn't raving mad.
AC_MSG_NOTICE([Cross-compiling: we'll assume that negative integers are represented with two's complement.])
- tor_cv_twos_complement=yes
fi
-if test "$tor_cv_twos_complement" = yes; then
+if test "$tor_cv_twos_complement" != no ; then
AC_DEFINE([USING_TWOS_COMPLEMENT], 1,
[Define to 1 iff we represent negative integers with two's complement])
fi
More information about the tor-commits
mailing list