Skip to content

Commit

Permalink
Add ln
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Applencourt committed Sep 11, 2023
1 parent cf3cffa commit 041dda1
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 2 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions cuda/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions hip/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions m4/m4_ac_prog_ln.m4
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>, 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
])

5 changes: 4 additions & 1 deletion omp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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) $< > $@
Expand Down
4 changes: 4 additions & 0 deletions opencl/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion utils/babeltrace_thapi.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
10 changes: 10 additions & 0 deletions xprof/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ze/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 041dda1

Please sign in to comment.