Merge pull request #3591 from directhex/mono_libdir_fallback
[mono.git] / mono / profiler / Makefile.am
index b215a3091c3c87d3da5aee213d6421f9fc3ac585..4f6c4acb204fc26e059d4c7c08d3e4c6315c8938 100644 (file)
@@ -14,34 +14,29 @@ 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
@@ -58,6 +53,8 @@ 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
@@ -65,33 +62,33 @@ 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_SOURCES = mono-profiler-log.c
+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_SOURCES = mono-profiler-log.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) $(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
 endif
 
-mprof_report_SOURCES = decode.c
+mprof_report_SOURCES = mprof-report.c
 mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
 
 PLOG_TESTS_SRC=test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
@@ -113,6 +110,7 @@ testlog: $(PLOG_TESTS)
 
 check-local: $(check_targets)
 
-EXTRA_DIST=utils.c utils.h proflog.h \
-       $(PLOG_TESTS_SRC) ptestrunner.pl \
+EXTRA_DIST=mono-profiler-log.h \
+       $(PLOG_TESTS_SRC) \
+       ptestrunner.pl \
        $(suppression_DATA)