[profiler] Actually link against libmono where necessary (#3232)
[mono.git] / mono / profiler / Makefile.am
index 41e62a8a1b528645239bdbadc8502e1d9cec55de..3d7eb62e4004b07a10c4644c3086e9eedf21b66a 100644 (file)
@@ -14,40 +14,47 @@ 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_stlibs = libmono-profiler-vtune-static.la
-if !BITCODE
-vtune_shlibs = libmono-profiler-vtune.la
-endif
+vtune_libs = libmono-profiler-vtune.la libmono-profiler-vtune-static.la
 endif
 
 lib_LTLIBRARIES = \
-       $(prof_shlibs) \
+       libmono-profiler-aot.la \
        libmono-profiler-aot-static.la \
+       libmono-profiler-iomap.la \
        libmono-profiler-iomap-static.la \
+       libmono-profiler-log.la \
        libmono-profiler-log-static.la \
-       $(vtune_shlibs) \
-       $(vtune_stlibs)
+       $(vtune_libs)
+
+suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
+suppression_DATA = mono-profiler-log.suppression
 
 if PLATFORM_DARWIN
+if BITCODE
+prof_ldflags = -no-undefined
+else
 prof_ldflags = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
 endif
+endif
 
 if PLATFORM_ANDROID
 prof_ldflags = -avoid-version
 endif
 
+# FIXME fix the profiler tests to work with coop.
+if !ENABLE_COOP
+if !NACL_CODEGEN
+check_targets = testlog
+endif
+endif
+
 endif
 endif
 endif
 
+monodir=$(top_builddir)
+
 # 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
@@ -55,19 +62,19 @@ endif
 # functionality, so create a separate static version of the library.
 
 libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
-libmono_profiler_aot_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_aot_la_LIBADD =  $(monodir)/mono/mini/$(LIBMONO_LA) $(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 = $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_iomap_la_LIBADD = $(monodir)/mono/mini/$(LIBMONO_LA) $(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 = $(GLIB_LIBS) $(Z_LIBS)
+libmono_profiler_log_la_LIBADD = $(monodir)/mono/mini/$(LIBMONO_LA) $(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
@@ -75,7 +82,7 @@ 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) $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(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
@@ -84,10 +91,6 @@ endif
 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)
@@ -103,21 +106,9 @@ MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162 -now
        $(MCS) -out:$@ $<
 
 testlog: $(PLOG_TESTS)
-       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
+       $(with_mono_path) perl $(srcdir)/ptestrunner.pl $(top_builddir)
 
-
-if NACL_CODEGEN
-check-local:
-else
-check-local: testlog
-endif
-
-suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
-suppression_DATA = mono-profiler-log.suppression
+check-local: $(check_targets)
 
 EXTRA_DIST=utils.c utils.h proflog.h \
        $(PLOG_TESTS_SRC) ptestrunner.pl \