diff --git a/configure.ac b/configure.ac index 8977fa0c..9953a6e3 100644 --- a/configure.ac +++ b/configure.ac @@ -18,6 +18,7 @@ AM_PROG_AR LT_INIT([disable-static]) # Checks for programs. +AC_PROG_LN AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_CXX diff --git a/cuda/Makefile.am b/cuda/Makefile.am index 3bf8a07a..dc2ffa1b 100644 --- a/cuda/Makefile.am +++ b/cuda/Makefile.am @@ -292,12 +292,17 @@ install-exec-hook: $(LN_S) -f $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so $(LN_S) -f $(DESTDIR)$(libdir)/libTracerCUDA.so.1.0.0 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 $(LN_S) -f $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so + $(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2 + $(LN) -f $(DESTDIR)$(libdir)/libCUDAInterval.so $(DESTDIR)$(pkglibdir)/bt2/libCUDAInterval.so + uninstall-hook: $(RM) -f $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so $(RM) -f $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so -rmdir $(DESTDIR)$(pkglibdir)/cudart -rmdir $(DESTDIR)$(pkglibdir)/cuda + $(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libCUDAInterval.so + -rmdir $(DESTDIR)$(pkglibdir)/bt2 tmplibdir = $(libdir)/tmp tmplib_LTLIBRARIES = libBabeltraceCUDA.la diff --git a/hip/Makefile.am b/hip/Makefile.am index 5df50ddb..cb706126 100644 --- a/hip/Makefile.am +++ b/hip/Makefile.am @@ -288,10 +288,15 @@ install-exec-hook: $(MKDIR_P) $(DESTDIR)$(pkglibdir)/hip $(LN_S) -f $(DESTDIR)$(libdir)/libTracerHIP.so.5.4.50400 $(DESTDIR)$(pkglibdir)/hip/libamdhip64.so.5 $(LN_S) -f $(DESTDIR)$(pkglibdir)/hip/libamdhip64.so.5 $(DESTDIR)$(pkglibdir)/hip/libamdhip64.so + $(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2 + $(LN) -f $(DESTDIR)$(libdir)/libHIPInterval.so $(DESTDIR)$(pkglibdir)/bt2/libHIPInterval.so + uninstall-hook: $(RM) -f $(DESTDIR)$(pkglibdir)/hip/libamdhip64.so.5 $(DESTDIR)$(pkglibdir)/hip/libamdhip64.so -rmdir $(DESTDIR)$(pkglibdir)/hip + $(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libHIPInterval.so + -rmdir $(DESTDIR)$(pkglibdir)/bt2 tmplibdir = $(libdir)/tmp tmplib_LTLIBRARIES = libBabeltraceHIP.la diff --git a/m4/m4_ac_prog_ln.m4 b/m4/m4_ac_prog_ln.m4 new file mode 100644 index 00000000..d809e7cc --- /dev/null +++ b/m4/m4_ac_prog_ln.m4 @@ -0,0 +1,27 @@ +# https://opensource.apple.com/source/zsh/zsh-34/zsh/aclocal.m4 +# Local additions to Autoconf macros. +# Copyright (C) 1992, 1994 Free Software Foundation, Inc. +# Francois Pinard , 1992. + +AC_DEFUN([AC_PROG_LN], +[AC_MSG_CHECKING(whether ln works) +AC_CACHE_VAL(ac_cv_prog_LN, +[rm -f conftestdata conftestlink +echo > conftestdata +if ln conftestdata conftestlink 2>/dev/null +then + rm -f conftestdata conftestlink + ac_cv_prog_LN="ln" +else + rm -f conftestdata + ac_cv_prog_LN="cp" +fi])dnl +LN="$ac_cv_prog_LN" +if test "$ac_cv_prog_LN" = "ln"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +AC_SUBST(LN)dnl +]) + diff --git a/omp/Makefile.am b/omp/Makefile.am index f527efcd..285c6825 100644 --- a/omp/Makefile.am +++ b/omp/Makefile.am @@ -137,11 +137,14 @@ libTracerOMPT_la_LIBADD = libompttracepoints.la install-exec-hook: $(MKDIR_P) $(DESTDIR)$(pkglibdir)/ompt $(LN_S) -f $(DESTDIR)$(libdir)/libTracerOMPT.so $(DESTDIR)$(pkglibdir)/ompt/libompt.so + $(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2 + $(LN) -f $(DESTDIR)$(libdir)/libOMPInterval.so $(DESTDIR)$(pkglibdir)/bt2/libOMPInterval.so uninstall-hook: $(RM) -f $(DESTDIR)$(pkglibdir)/ompt/libompt.so -rmdir $(DESTDIR)$(pkglibdir)/ompt - + $(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libOMPInterval.so + -rmdir $(DESTDIR)$(pkglibdir)/bt2 babeltrace_ompinterval_callbacks.cpp: $(srcdir)/gen_ompinterval_callbacks.rb $(srcdir)/ompinterval_callbacks.cpp.erb omp_babeltrace_model.yaml SRC_DIR=$(srcdir) $(RUBY) $< > $@ diff --git a/opencl/Makefile.am b/opencl/Makefile.am index ae235e8a..a0d8a338 100644 --- a/opencl/Makefile.am +++ b/opencl/Makefile.am @@ -171,10 +171,14 @@ install-exec-hook: $(MKDIR_P) $(DESTDIR)$(pkglibdir)/opencl $(LN_S) -f $(DESTDIR)$(libdir)/libTracerOpenCL.so.1.0.0 $(DESTDIR)$(pkglibdir)/opencl/libOpenCL.so.1 $(LN_S) -f $(DESTDIR)$(pkglibdir)/opencl/libOpenCL.so.1 $(DESTDIR)$(pkglibdir)/opencl/libOpenCL.so + $(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2 + $(LN) -f $(DESTDIR)$(libdir)/libCLInterval.so $(DESTDIR)$(pkglibdir)/bt2/libCLInterval.so uninstall-hook: $(RM) -f $(DESTDIR)$(pkglibdir)/opencl/libOpenCL.so.1 $(DESTDIR)$(pkglibdir)/opencl/libOpenCL.so -rmdir $(DESTDIR)$(pkglibdir)/opencl + $(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libCLInterval.so + -rmdir $(DESTDIR)$(pkglibdir)/bt2 # Cannot use check_LTLIBRARIES because we need the shared version of those # Thanks Vincent Danjean diff --git a/utils/babeltrace_thapi.in b/utils/babeltrace_thapi.in index 794978e4..f3a99928 100755 --- a/utils/babeltrace_thapi.in +++ b/utils/babeltrace_thapi.in @@ -139,7 +139,7 @@ def get_components(names) } # THAPI components - thapi_plugins = BT2::BTPlugin.find_all_from_dir(File.join('@prefix@', 'lib')) + thapi_plugins = BT2::BTPlugin.find_all_from_dir(File.join('@prefix@', 'lib', '@PACKAGE@', 'bt2')) thapi_plugins.map do |pg| pg.source_component_classes.each { |c| components_classes["source.#{pg.name}.#{c.name}"] = c } pg.filter_component_classes.each { |c| components_classes["filter.#{pg.name}.#{c.name}"] = c } diff --git a/xprof/Makefile.am b/xprof/Makefile.am index 6ea7fb25..90438e9c 100644 --- a/xprof/Makefile.am +++ b/xprof/Makefile.am @@ -116,6 +116,16 @@ libXAggreg_la_CFLAGS = -Wall -Wextra -Wno-unused-parameter $(WERROR) -fno-fast-m libXAggreg_la_CXXFLAGS = -std=c++17 -Wall -Wextra -Wno-unused-parameter $(WERROR) -fno-fast-math $(BABELTRACE2_CFLAGS) libXAggreg_la_LDFLAGS = $(BABELTRACE2_LIBS) -avoid-version -module +install-exec-hook: + $(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2 + $(LN) -f $(DESTDIR)$(libdir)/libXAggreg.so $(DESTDIR)$(pkglibdir)/bt2/libXAggreg.so + $(LN) -f $(DESTDIR)$(libdir)/libXTimeline.so $(DESTDIR)$(pkglibdir)/bt2/libXTimeline.so + $(LN) -f $(DESTDIR)$(libdir)/libXTally.so $(DESTDIR)$(pkglibdir)/bt2/libXTally.so + +uninstall-hook: + $(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libXAggreg.so $(DESTDIR)$(pkglibdir)/bt2/libXTimeline.so $(DESTDIR)$(pkglibdir)/bt2/libXTally.so + -rmdir $(DESTDIR)$(pkglibdir)/bt2 + # Cannot use check_LTLIBRARIES because we need the shared version of those # Thanks Vincent Danjean # noinst_LTLIBRARIES would be the correct thing but then libtool diff --git a/ze/Makefile.am b/ze/Makefile.am index a114df5a..4150042f 100644 --- a/ze/Makefile.am +++ b/ze/Makefile.am @@ -171,10 +171,14 @@ install-exec-hook: $(MKDIR_P) $(DESTDIR)$(pkglibdir)/ze $(LN_S) -f $(DESTDIR)$(libdir)/libTracerZE.so.0.0.0 $(DESTDIR)$(pkglibdir)/ze/libze_loader.so.1 $(LN_S) -f $(DESTDIR)$(pkglibdir)/ze/libze_loader.so.1 $(DESTDIR)$(pkglibdir)/ze/libze_loader.so + $(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2 + $(LN) -f $(DESTDIR)$(libdir)/libZEInterval.so $(DESTDIR)$(pkglibdir)/bt2/libZEInterval.so uninstall-hook: $(RM) -f $(DESTDIR)$(pkglibdir)/ze/libze_loader.so.1 $(DESTDIR)$(pkglibdir)/ze/libze_loader.so -rmdir $(DESTDIR)$(pkglibdir)/ze + $(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libZEInterval.so + -rmdir $(DESTDIR)$(pkglibdir)/bt2 tmplibdir = $(libdir)/tmp tmplib_LTLIBRARIES = libBabeltraceZE.la