Permalink
Browse files

2009-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>

	So long PLATFORM_WIN32. Welcome HOST_WIN32 and TARGET_WIN32.

	* runtime/Makefile.am:
	* scripts/Makefile.am:
	* mono/dis/Makefile.am:
	* mono/metadata/domain.c:
	* mono/metadata/security.c:
	* mono/metadata/assembly.c:
	* mono/metadata/coree.c:
	* mono/metadata/coree.h:
	* mono/metadata/threadpool.c:
	* mono/metadata/class-internals.h:
	* mono/metadata/Makefile.am:
	* mono/metadata/gc.c:
	* mono/metadata/class.c:
	* mono/metadata/appdomain.c:
	* mono/metadata/image.c:
	* mono/metadata/threads.c:
	* mono/metadata/metadata-internals.h:
	* mono/metadata/monitor.c:
	* mono/metadata/attach.c:
	* mono/metadata/marshal.c:
	* mono/metadata/threads-types.h:
	* mono/metadata/mono-config.c:
	* mono/metadata/boehm-gc.c:
	* mono/metadata/rand.c:
	* mono/metadata/icall.c:
	* mono/metadata/reflection.c:
	* mono/metadata/socket-io.c:
	* mono/io-layer/socket-wrappers.h:
	* mono/io-layer/io-layer.h:
	* mono/io-layer/Makefile.am:
	* mono/monograph/Makefile.am:
	* mono/mini/method-to-ir.c:
	* mono/mini/debugger-agent.c:
	* mono/mini/mini-exceptions.c:
	* mono/mini/Makefile.am:
	* mono/mini/aot-runtime.c:
	* mono/mini/image-writer.c:
	* mono/mini/mini-windows.c:
	* mono/mini/aot-compiler.c:
	* mono/mini/dwarfwriter.c:
	* mono/mini/mini-ppc.c:
	* mono/mini/mini-ppc.h:
	* mono/utils/mono-time.c:
	* mono/utils/mono-membar.h:
	* mono/utils/mono-poll.h:
	* mono/tests/Makefile.am:
	* mono/interpreter/Makefile.am:
	* configure.in:
	* support/Makefile.am:


svn path=/trunk/mono/; revision=146644
  • Loading branch information...
1 parent b077622 commit 795b738e43c346ffb1e183c2c3184c3512b74cca @gonzalop gonzalop committed Nov 20, 2009
Showing with 285 additions and 233 deletions.
  1. +26 −22 configure.in
  2. +1 −1 mono/dis/Makefile.am
  3. +1 −1 mono/interpreter/Makefile.am
  4. +1 −1 mono/io-layer/Makefile.am
  5. +1 −1 mono/io-layer/io-layer.h
  6. +2 −2 mono/io-layer/socket-wrappers.h
  7. +1 −1 mono/metadata/Makefile.am
  8. +5 −6 mono/metadata/appdomain.c
  9. +6 −6 mono/metadata/assembly.c
  10. +1 −1 mono/metadata/attach.c
  11. +2 −2 mono/metadata/boehm-gc.c
  12. +1 −1 mono/metadata/class-internals.h
  13. +3 −2 mono/metadata/class.c
  14. +2 −2 mono/metadata/coree.c
  15. +2 −2 mono/metadata/coree.h
  16. +1 −1 mono/metadata/domain.c
  17. +1 −1 mono/metadata/gc.c
  18. +22 −23 mono/metadata/icall.c
  19. +13 −13 mono/metadata/image.c
  20. +5 −3 mono/metadata/marshal.c
  21. +1 −1 mono/metadata/metadata-internals.h
  22. +2 −2 mono/metadata/monitor.c
  23. +7 −7 mono/metadata/mono-config.c
  24. +2 −2 mono/metadata/rand.c
  25. +24 −20 mono/metadata/reflection.c
  26. +25 −25 mono/metadata/security.c
  27. +6 −6 mono/metadata/socket-io.c
  28. +7 −7 mono/metadata/threadpool.c
  29. +1 −1 mono/metadata/threads-types.h
  30. +16 −16 mono/metadata/threads.c
  31. +5 −5 mono/mini/Makefile.am
  32. +28 −7 mono/mini/aot-compiler.c
  33. +6 −6 mono/mini/aot-runtime.c
  34. +1 −6 mono/mini/debugger-agent.c
  35. +1 −1 mono/mini/dwarfwriter.c
  36. +10 −12 mono/mini/image-writer.c
  37. +2 −2 mono/mini/method-to-ir.c
  38. +2 −2 mono/mini/mini-exceptions.c
  39. +5 −2 mono/mini/mini-ppc.c
  40. +11 −1 mono/mini/mini-ppc.h
  41. +4 −0 mono/mini/mini-windows.c
  42. +1 −1 mono/monograph/Makefile.am
  43. +3 −3 mono/tests/Makefile.am
  44. +12 −0 mono/utils/mono-membar.h
  45. +1 −1 mono/utils/mono-poll.h
  46. +1 −1 mono/utils/mono-time.c
  47. +1 −1 runtime/Makefile.am
  48. +1 −1 scripts/Makefile.am
  49. +2 −2 support/Makefile.am
View
@@ -75,14 +75,17 @@ case "$host" in
;;
esac
+host_win32=no
+target_win32=no
case "$host" in
*-*-mingw*|*-*-cygwin*)
- platform_win32=yes
- AC_DEFINE(PLATFORM_WIN32,1,[Host Platform is Win32])
- AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
+ AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
+ host_win32=yes
if test "x$cross_compiling" = "xno"; then
+ target_win32=yes
+ AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
CC="gcc -mno-cygwin -g"
CXX="g++ -mno-cygwin -g"
# So libgc configure gets -mno-cygwin
@@ -104,7 +107,7 @@ case "$host" in
libgc_configure_args="$libgc_configure_args --enable-win32-dllmain=yes"
;;
*-*-*netbsd*)
- platform_win32=no
+ host_win32=no
CPPFLAGS="$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE"
libmono_cflags="-D_REENTRANT"
LDFLAGS="$LDFLAGS -pthread"
@@ -117,7 +120,7 @@ case "$host" in
use_sigposix=yes
;;
*-*-*freebsd*)
- platform_win32=no
+ host_win32=no
if test "x$PTHREAD_CFLAGS" = "x"; then
CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
libmono_cflags=
@@ -146,7 +149,7 @@ case "$host" in
use_sigposix=yes
;;
*-*-*openbsd*)
- platform_win32=no
+ host_win32=no
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD"
libmono_cflags="-D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -pthread"
@@ -158,7 +161,7 @@ case "$host" in
use_sigposix=yes
;;
*-*-linux*)
- platform_win32=no
+ host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
@@ -171,7 +174,7 @@ case "$host" in
use_sigposix=yes
;;
*-*-hpux*)
- platform_win32=no
+ host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
# +ESdbgasm only valid on bundled cc on RISC
# silently ignored for ia64
@@ -190,7 +193,7 @@ case "$host" in
use_sigposix=yes
;;
*-*-solaris*)
- platform_win32=no
+ host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS"
need_link_unlink=yes
libmono_cflags="-D_REENTRANT"
@@ -202,7 +205,7 @@ case "$host" in
;;
*-*-darwin*)
parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
- platform_win32=no
+ host_win32=no
platform_darwin=yes
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
CPPFLAGS="$CPPFLAGS -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent"
@@ -238,7 +241,7 @@ case "$host" in
;;
*)
AC_MSG_WARN([*** Please add $host to configure.in checks!])
- platform_win32=no
+ host_win32=no
libdl="-ldl"
;;
esac
@@ -248,7 +251,8 @@ if test x$need_link_unlink = xyes; then
AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
fi
-AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
+AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
+AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
@@ -290,7 +294,7 @@ AC_SUBST(HOST_CC)
AC_SUBST(BUILD_EXEEXT)
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
-AM_CONDITIONAL(USE_BATCH_FILES, [test x$platform_win32 = xyes -a x$cross_compiling = xyes])
+AM_CONDITIONAL(USE_BATCH_FILES, [test x$host_win32 = xyes -a x$cross_compiling = xyes])
# Set STDC_HEADERS
AC_HEADER_STDC
@@ -542,7 +546,7 @@ AC_SUBST(BUILD_GLIB_CFLAGS)
AC_SUBST(BUILD_GLIB_LIBS)
AC_SUBST(eglib_dir)
-if test x$cross_compiling$platform_win32 = xnoyes; then
+if test x$cross_compiling$host_win32 = xnoyes; then
AC_MSG_CHECKING(for cygwin glib2-dev package)
if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
AC_MSG_RESULT(found)
@@ -579,7 +583,7 @@ if test "x$enable_static" = "xno"; then
with_static_mono=no
fi
-if test "x$platform_win32" = "xyes"; then
+if test "x$host_win32" = "xyes"; then
# Boehm GC requires the runtime to be in its own dll
with_static_mono=no
fi
@@ -871,7 +875,7 @@ AC_TRY_COMPILE([
AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays])
])
-if test x$platform_win32 = xno; then
+if test x$target_win32 = xno; then
dnl hires monotonic clock support
AC_SEARCH_LIBS(clock_gettime, rt)
@@ -1765,12 +1769,12 @@ else
AC_MSG_RESULT(has been disabled)
fi
-if test "x$platform_win32" = "xyes"; then
+if test "x$host_win32" = "xyes"; then
AC_DEFINE(HAVE_CRYPT_RNG)
fi
if test "x$ac_cv_have_dev_random" = "xno" \
- && test "x$platform_win32" = "xno"; then
+ && test "x$host_win32" = "xno"; then
AC_MSG_WARN([[
***
*** A system-provided entropy source was not found on this system.
@@ -2449,7 +2453,7 @@ fi
AC_SUBST(mono_runtime)
mono_cfg_root=$mono_build_root/runtime
-if test x$platform_win32 = xyes; then
+if test x$host_win32 = xyes; then
if test "x$cross_compiling" = "xno"; then
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
else
@@ -2640,7 +2644,7 @@ msvc/Makefile
po/Makefile
])
-if test x$platform_win32 = xyes; then
+if test x$host_win32 = xyes; then
# Get rid of 'cyg' prefixes in library names
sed -e "s/\/cyg\//\/\//" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
# libtool seems to inherit -mno-cygwin from our CFLAGS, and uses it to compile its executable
@@ -2696,7 +2700,7 @@ fi
echo "PLATFORM = darwin" >> $srcdir/$mcsdir/build/config.make
fi
- if test x$TARGET = xAMD64 -a x$platform_win32 = xno -a "x$AOT_SUPPORTED" = "xyes"; then
+ if test x$TARGET = xAMD64 -a x$host_win32 = xno -a "x$AOT_SUPPORTED" = "xyes"; then
echo "ENABLE_AOT = 1" >> $srcdir/$mcsdir/build/config.make
fi
@@ -2748,7 +2752,7 @@ echo "
$disabled
"
-if test x$with_static_mono = xno -a "x$platform_win32" != "xyes"; then
+if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexpected bugs)
fi
View
@@ -1,6 +1,6 @@
INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
-if PLATFORM_WIN32
+if HOST_WIN32
export HOST_CC
endif
@@ -3,7 +3,7 @@ INCLUDES = \
$(LIBGC_CFLAGS) \
$(GLIB_CFLAGS)
-if PLATFORM_WIN32
+if HOST_WIN32
export HOST_CC
# The mingw math.h has "extern inline" functions that dont appear in libs, so
# optimisation is required to actually inline them
@@ -121,7 +121,7 @@ WINDOWS_SRC = \
HPPA_SRC = \
hppa_atomic.S
-if PLATFORM_WIN32
+if HOST_WIN32
libwapi_la_SOURCES = $(WINDOWS_SRC)
libwapiinclude_HEADERS = $(WINDOWS_H)
else
View
@@ -45,6 +45,6 @@
#else /* EVERYONE ELSE */
#include "mono/io-layer/wapi.h"
#include "mono/io-layer/uglify.h"
-#endif /* PLATFORM_WIN32 */
+#endif /* HOST_WIN32 */
#endif /* _MONO_IOLAYER_IOLAYER_H_ */
@@ -20,7 +20,7 @@
#define socklen_t int
#endif
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
#define _wapi_accept accept
#define _wapi_bind bind
#define _wapi_connect connect
@@ -87,5 +87,5 @@ extern int _wapi_FD_ISSET(guint32 handle, fd_set *set);
extern void _wapi_FD_SET(guint32 handle, fd_set *set);
#endif
-#endif /* PLATFORM_WIN32 */
+#endif /* HOST_WIN32 */
@@ -1,4 +1,4 @@
-if PLATFORM_WIN32
+if HOST_WIN32
win32_sources = \
console-win32.c
View
@@ -58,8 +58,7 @@
#include <mono/utils/mono-stdlib.h>
#include <mono/utils/mono-io-portability.h>
#include <mono/utils/mono-error-internals.h>
-
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
#include <direct.h>
#endif
@@ -326,7 +325,7 @@ mono_runtime_cleanup (MonoDomain *domain)
mono_monitor_cleanup ();
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
_wapi_cleanup ();
#endif
}
@@ -1065,7 +1064,7 @@ set_domain_search_path (MonoDomain *domain)
* The issue was reported in bug #81446
*/
-#ifndef PLATFORM_WIN32
+#ifndef TARGET_WIN32
gint slen;
slen = strlen (search_path);
@@ -1250,7 +1249,7 @@ get_shadow_assembly_location_base (MonoDomain *domain, MonoError *error)
cache_path = mono_string_to_utf8_checked (setup->cache_path, error);
if (!mono_error_ok (error))
return NULL;
-#ifndef PLATFORM_WIN32
+#ifndef TARGET_WIN32
{
gint i;
for (i = strlen (cache_path) - 1; i >= 0; i--)
@@ -1310,7 +1309,7 @@ get_shadow_assembly_location (const char *filename, MonoError *error)
static gboolean
ensure_directory_exists (const char *filename)
{
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
gchar *dir_utf8 = g_path_get_dirname (filename);
gunichar2 *p;
gunichar2 *dir_utf16 = NULL;
View
@@ -32,7 +32,7 @@
#include <mono/metadata/reflection.h>
#include <mono/metadata/coree.h>
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -479,7 +479,7 @@ mono_set_dirs (const char *assembly_dir, const char *config_dir)
mono_set_config_dir (config_dir);
}
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
static char *
compute_base (char *path)
@@ -538,7 +538,7 @@ set_dirs (char *exe)
g_free (mono);
}
-#endif /* PLATFORM_WIN32 */
+#endif /* HOST_WIN32 */
/**
* mono_set_rootdir:
@@ -549,7 +549,7 @@ set_dirs (char *exe)
void
mono_set_rootdir (void)
{
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
gchar *bindir, *installdir, *root, *name, *config;
name = mono_get_module_file_name ((HMODULE) &__ImageBase);
@@ -1442,7 +1442,7 @@ mono_assembly_load_from_full (MonoImage *image, const char*fname,
return NULL;
}
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
{
gchar *tmp_fn;
int i;
@@ -1522,7 +1522,7 @@ mono_assembly_load_from_full (MonoImage *image, const char*fname,
loaded_assemblies = g_list_prepend (loaded_assemblies, ass);
mono_assemblies_unlock ();
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
if (image->is_module_handle)
mono_image_fixup_vtable (image);
#endif
View
@@ -10,7 +10,7 @@
#include <config.h>
#include <glib.h>
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
#define DISABLE_ATTACH
#endif
#ifndef DISABLE_ATTACH
View
@@ -222,7 +222,7 @@ mono_gc_register_thread (void *baseptr)
#else
if (mono_gc_is_gc_thread())
return TRUE;
-#if defined(USE_INCLUDED_LIBGC) && !defined(PLATFORM_WIN32)
+#if defined(USE_INCLUDED_LIBGC) && !defined(HOST_WIN32)
return GC_thread_register_foreign (baseptr);
#else
return FALSE;
@@ -302,7 +302,7 @@ mono_gc_register_root (char *start, size_t size, void *descr)
void
mono_gc_deregister_root (char* addr)
{
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
/* FIXME: libgc doesn't define this work win32 for some reason */
/* FIXME: No size info */
GC_remove_roots (addr, addr + sizeof (gpointer) + 1);
@@ -440,7 +440,7 @@ struct MonoVTable {
guint32 imt_collisions_bitmap;
MonoRuntimeGenericContext *runtime_generic_context;
/* do not add any fields after vtable, the structure is dynamically extended */
- gpointer vtable [MONO_ZERO_LEN_ARRAY];
+ gpointer vtable [MONO_ZERO_LEN_ARRAY];
};
#define MONO_SIZEOF_VTABLE (sizeof (MonoVTable) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
Oops, something went wrong.

0 comments on commit 795b738

Please sign in to comment.