Add a conditional for the system function.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Tue, 16 Jun 2015 14:41:34 +0000 (16:41 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Tue, 16 Jun 2015 14:51:58 +0000 (16:51 +0200)
It's not available in the iOS WatchOS simulator.

configure.ac
mono/mini/aot-compiler.c
mono/mini/graph.c
mono/mini/helpers.c

index 58e0a50893ccf834e4f44d3a2d4f95c15367ea58..9dc1c37d0228b83fdc2f17f9830b23217db4d0dc 100644 (file)
@@ -2098,6 +2098,7 @@ if test x$host_win32 = xno; then
        AC_CHECK_FUNCS(fstatat mknodat readlinkat)
        AC_CHECK_FUNCS(readv writev preadv pwritev)
        AC_CHECK_FUNCS(setpgid)
+       AC_CHECK_FUNCS(system)
        AC_CHECK_SIZEOF(size_t)
        AC_CHECK_TYPES([blksize_t], [AC_DEFINE(HAVE_BLKSIZE_T)], , 
                [#include <sys/types.h>
index a2f8a8acb0a3c564101cbac73b13a7c391eadcc8..8e4bab4984aaa42d0219decfba810b53429e12d0 100644 (file)
@@ -7281,8 +7281,10 @@ execute_system (const char * command)
        g_free (wstr);
 
        g_free (command);
-#else
+#elif defined (HAVE_SYSTEM)
        status = system (command);
+#else
+       g_assert_not_reached ();
 #endif
 
        return status;
index d9b0adec2f1341ec9f7a076d8c2231d5bef07b97..fed9002320487da1e5088867e4905881ca99a3f9 100644 (file)
@@ -336,10 +336,14 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options)
 
        fclose (fp);
 
+#ifdef HAVE_SYSTEM
        //com = g_strdup_printf ("dot %s -Tpng -o %s.png; eog %s.png", fn, fn, fn);
        com = g_strdup_printf ("dot %s -Tps -o %s.ps;gv %s.ps", fn, fn, fn);
        _i = system (com);
        g_free (com);
+#else
+       g_assert_not_reached ();
+#endif
 }
 
 #endif /* DISABLE_JIT */
index b48962fd08dcd0a4dce94a2abd0b1d07f0729d22..65b234486b1dae91a3f3840b17e770fa1961caf3 100644 (file)
@@ -271,6 +271,7 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id)
        close (i);
 #endif
 
+#ifdef HAVE_SYSTEM
        cmd = g_strdup_printf (ARCH_PREFIX AS_CMD " %s -o %s", as_file, o_file);
        unused = system (cmd); 
        g_free (cmd);
@@ -292,6 +293,9 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id)
        cmd = g_strdup_printf (ARCH_PREFIX DIS_CMD " %s %s", objdump_args, o_file);
        unused = system (cmd);
        g_free (cmd);
+#else
+       g_assert_not_reached ();
+#endif /* HAVE_SYSTEM */
 
 #ifndef HOST_WIN32
        unlink (o_file);