summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-19 15:02:06 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-19 15:02:06 +0000
commit3ef3fcae5553fd61f27ac96fe175709c300b2e2e (patch)
tree54aa1428c4efa46e06d7f16832059c098f6587d3
parentdf40c2e1ca76337878d6631ecf498be3a2c23e3c (diff)
downloadtor-3ef3fcae5553fd61f27ac96fe175709c300b2e2e.tar.gz
tor-3ef3fcae5553fd61f27ac96fe175709c300b2e2e.zip
r9081@totoro: nickm | 2006-10-19 11:00:51 -0400
Try to detect windows properly when cross-compiling svn:r8755
-rw-r--r--ChangeLog1
-rw-r--r--configure.in22
2 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7e3609b82f..186cf6cee1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,7 @@ Changes in version 0.1.2.3-alpha - 2006-10-??
- Stop triggering asserts if the controller tries to extend hidden
service circuits.
- Correctly set maximum connection limit on Cygwin.
+ - Try to detect windows correctly when cross-compiling.
Changes in version 0.1.2.2-alpha - 2006-10-07
diff --git a/configure.in b/configure.in
index 4774192c50..1ff97916d7 100644
--- a/configure.in
+++ b/configure.in
@@ -122,7 +122,8 @@ AC_SUBST(TORGROUP)
dnl If WIN32 is defined and non-zero, we are building for win32
AC_MSG_CHECKING([for win32])
-AC_TRY_RUN([int main(int c, char **v) {
+AC_RUN_IFELSE([
+int main(int c, char **v) {
#ifdef WIN32
#if WIN32
return 0;
@@ -134,14 +135,29 @@ AC_TRY_RUN([int main(int c, char **v) {
#endif
}],
bwin32=true; AC_MSG_RESULT([yes]),
-bwin32=false; AC_MSG_RESULT([no])
+bwin32=false; AC_MSG_RESULT([no]),
+bwin32=cross; AC_MSG_RESULT([cross])
)
+if test $bwin32 = cross; then
+AC_MSG_CHECKING([for win32 (cross)])
+AC_COMPILE_IFELSE([
+#ifdef WIN32
+int main(int c, char **v) {return 0;}
+#else
+#error
+int main(int c, char **v) {return x(y);}
+#endif
+],
+bwin32=true; AC_MSG_RESULT([yes]),
+bwin32=false; AC_MSG_RESULT([no]))
+fi
+
if test $bwin32 = true; then
AC_DEFINE(MS_WINDOWS, 1, [Define to 1 if we are building for Windows.])
-
fi
+
AC_SEARCH_LIBS(socket, [socket])
AC_SEARCH_LIBS(gethostbyname, [nsl])
AC_SEARCH_LIBS(dlopen, [dl])