Merge pull request #3040 from xmcclure/debugger-step-recursive
[mono.git] / mono / profiler / Makefile.am
index 1dc7a5e64cd6bbea5246e4570f7a0dbb7d321535..41e62a8a1b528645239bdbadc8502e1d9cec55de 100644 (file)
@@ -5,7 +5,6 @@ Z_LIBS=
 endif
 
 AM_CPPFLAGS = \
-       -fexceptions -DMONO_USE_EXC_TABLES      \
        -DSUPPRESSION_DIR=\""$(datadir)/mono-$(API_VER)/mono/profiler"\"        \
        -I$(top_srcdir)         \
        $(GLIB_CFLAGS)
@@ -15,80 +14,80 @@ if !DISABLE_LIBRARIES
 if !DISABLE_PROFILER
 bin_PROGRAMS = mprof-report
 
+if !BITCODE
+prof_shlibs = \
+       libmono-profiler-aot.la \
+       libmono-profiler-iomap.la \
+       libmono-profiler-log.la
+endif
+
 if HAVE_VTUNE
-vtune_lib = libmono-profiler-vtune.la
+vtune_stlibs = libmono-profiler-vtune-static.la
+if !BITCODE
+vtune_shlibs = libmono-profiler-vtune.la
+endif
 endif
 
-lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la libmono-profiler-log-static.la $(vtune_lib)
+lib_LTLIBRARIES = \
+       $(prof_shlibs) \
+       libmono-profiler-aot-static.la \
+       libmono-profiler-iomap-static.la \
+       libmono-profiler-log-static.la \
+       $(vtune_shlibs) \
+       $(vtune_stlibs)
 
 if PLATFORM_DARWIN
-if BITCODE
-libmono_profiler_log_la_LDFLAGS = -no-undefined
-else
-libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
-endif
-endif
-if PLATFORM_ANDROID
-libmono_profiler_log_la_LDFLAGS = -avoid-version
-endif
-endif
-endif
+prof_ldflags = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
 endif
 
-if HAVE_OPROFILE
-# Do something that uses OPROFILE_CFLAGS and OPROFILE_LIBS
+if PLATFORM_ANDROID
+prof_ldflags = -avoid-version
 endif
 
-if SUPPORT_BOEHM
-if DISABLE_EXECUTABLES
-LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA)
-else
-if !SHARED_MONO
-static_libs=   \
-       $(top_builddir)/mono/metadata/libmonoruntime-static.la  \
-       $(top_builddir)/mono/io-layer/libwapi.la        \
-       $(top_builddir)/mono/utils/libmonoutils.la \
-       $(GLIB_LIBS) $(LIBICONV) \
-       $(LIBGC_STATIC_LIBS)
-
-LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA) $(static_libs)
-else
-LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA)
 endif
 endif
-else
-LIBMONO=$(top_builddir)/mono/mini/libmonosgen-$(API_VER).la
 endif
 
+# The log profiler uses eglib functions, so it needs to be linked against
+# libeglib in shared mode, but not in static mode, since that would
+# leads to duplicate symbols when it is linked into an app which
+# also uses eglib (e.g. the runtime). Automake doesn't support this
+# functionality, so create a separate static version of the library.
+
 libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
-libmono_profiler_aot_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
-if BITCODE
-libmono_profiler_aot_la_LDFLAGS = -no-undefined
-endif
+libmono_profiler_aot_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_aot_la_LDFLAGS = $(prof_ldflags)
+libmono_profiler_aot_static_la_SOURCES = mono-profiler-aot.c
+libmono_profiler_aot_static_la_LDFLAGS = -static
+
 libmono_profiler_iomap_la_SOURCES = mono-profiler-iomap.c
-libmono_profiler_iomap_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
-if BITCODE
-libmono_profiler_iomap_la_LDFLAGS = -no-undefined
-endif
+libmono_profiler_iomap_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_iomap_la_LDFLAGS = $(prof_ldflags)
+libmono_profiler_iomap_static_la_SOURCES = mono-profiler-iomap.c
+libmono_profiler_iomap_static_la_LDFLAGS = -static
+
 libmono_profiler_log_la_SOURCES = proflog.c
-libmono_profiler_log_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(Z_LIBS)
+libmono_profiler_log_la_LIBADD = $(GLIB_LIBS) $(Z_LIBS)
+libmono_profiler_log_la_LDFLAGS = $(prof_ldflags)
+libmono_profiler_log_static_la_SOURCES = proflog.c
+libmono_profiler_log_static_la_LDFLAGS = -static
+
 if HAVE_VTUNE
 libmono_profiler_vtune_la_SOURCES = mono-profiler-vtune.c
 libmono_profiler_vtune_la_CFLAGS = $(VTUNE_CFLAGS)
-libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_vtune_la_LDFLAGS = $(prof_ldflags)
+libmono_profiler_vtune_static_la_SOURCES = mono-profiler-vtune.c
+libmono_profiler_vtune_static_la_LDFLAGS = -static
 endif
 
-# The log profile uses eglib functions, so it needs to be linked against
-# libeglib in shared mode, but not in static mode, since that would
-# leads to duplicate symbols when it is linked into an app which
-# also uses eglib (e.g. the runtime). Automake doesn't support this
-# functionality, so create a separate static version of the library.
-libmono_profiler_log_static_la_SOURCES = proflog.c
-libmono_profiler_log_static_la_LDFLAGS = -static
-
 mprof_report_SOURCES = decode.c
 mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
 
+# FIXME fix the profiler tests to work with coop.
+if ENABLE_COOP
+DISABLE_PROFILER_TESTS=1
+endif
 PLOG_TESTS_SRC=test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
        test-heapshot.cs test-traces.cs
 PLOG_TESTS=$(PLOG_TESTS_SRC:.cs=.exe)
@@ -104,7 +103,12 @@ MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162 -now
        $(MCS) -out:$@ $<
 
 testlog: $(PLOG_TESTS)
-       $(with_mono_path) perl $(srcdir)/ptestrunner.pl $(top_builddir)
+       if [ "z$(DISABLE_PROFILER_TESTS)" != z1 ]; then \
+               $(with_mono_path) perl $(srcdir)/ptestrunner.pl $(top_builddir) ; \
+       else \
+               echo "Profiler tests disabled with cooperative GC" ; \
+       fi
+
 
 if NACL_CODEGEN
 check-local:
@@ -115,6 +119,6 @@ endif
 suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
 suppression_DATA = mono-profiler-log.suppression
 
-EXTRA_DIST=utils.c utils.h proflog.h perf_event.h \
+EXTRA_DIST=utils.c utils.h proflog.h \
        $(PLOG_TESTS_SRC) ptestrunner.pl \
        $(suppression_DATA)