X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mono%2Futils%2Fmono-hwcap.c;h=38c032696bb3052623064683ec599073fe63b2c6;hb=8a23cf5c1e29d8f5dc36607092c2688a98f6d4dc;hp=d62be0b5ff537fc60a82cd6aea053fb54ea4e4ef;hpb=a3272f7b44e4a4d4616a78892a2bae47f3f1ad23;p=mono.git diff --git a/mono/utils/mono-hwcap.c b/mono/utils/mono-hwcap.c index d62be0b5ff5..38c032696bb 100644 --- a/mono/utils/mono-hwcap.c +++ b/mono/utils/mono-hwcap.c @@ -18,6 +18,9 @@ * Copyright 2011-2013 Xamarin Inc */ +#include +#include + #include "mono/utils/mono-hwcap.h" static gboolean hwcap_inited = FALSE; @@ -25,8 +28,25 @@ static gboolean hwcap_inited = FALSE; void mono_hwcap_init (void) { + const char *verbose = g_getenv ("MONO_VERBOSE_HWCAP"); + const char *conservative = g_getenv ("MONO_CONSERVATIVE_HWCAP"); + if (hwcap_inited) return; - mono_hwcap_arch_init (); +#ifdef MONO_CROSS_COMPILE + /* + * If we're cross-compiling, we want to be as + * conservative as possible so that we produce + * code that's portable. Default to that. + */ + if (!conservative) + conservative = "1"; +#endif + + if (!conservative || strncmp (conservative, "1", 1)) + mono_hwcap_arch_init (); + + if (verbose && !strncmp (verbose, "1", 1)) + mono_hwcap_print (stdout); }