[or-cvs] r8755: Try to detect windows properly when cross-compiling (tor/trunk)

nickm at seul.org nickm at seul.org
Thu Oct 19 15:02:07 UTC 2006


Author: nickm
Date: 2006-10-19 11:02:06 -0400 (Thu, 19 Oct 2006)
New Revision: 8755

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/configure.in
Log:
 r9081 at totoro:  nickm | 2006-10-19 11:00:51 -0400
 Try to detect windows properly when cross-compiling



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9081] on 96637b51-b116-0410-a10e-9941ebb49b64

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-10-19 15:02:02 UTC (rev 8754)
+++ tor/trunk/ChangeLog	2006-10-19 15:02:06 UTC (rev 8755)
@@ -33,6 +33,7 @@
     - 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

Modified: tor/trunk/configure.in
===================================================================
--- tor/trunk/configure.in	2006-10-19 15:02:02 UTC (rev 8754)
+++ tor/trunk/configure.in	2006-10-19 15:02:06 UTC (rev 8755)
@@ -122,7 +122,8 @@
 
 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 @@
 #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])



More information about the tor-commits mailing list