Skip to content

Commit 32117b9

Browse files
clementFoyerbgoglin
authored andcommitted
Fix name scheme when building with --target
Building with --target may add an unexpected prefix to the binary names. This commit uses the same mecanism to take this prefix in account. Closes #560 Signed-off-by: Clément Foyer <[email protected]>
1 parent 7aa61ef commit 32117b9

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

utils/hwloc/Makefile.am

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright © 2009-2021 Inria. All rights reserved.
22
# Copyright © 2009-2012, 2014, 2016 Université Bordeaux
33
# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved.
4+
# Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved.
45
#
56
# See COPYING in top-level directory.
67

@@ -160,12 +161,16 @@ endif HWLOC_HAVE_LINUX
160161
@ $(SEDMAN) \
161162
> $@ < $<
162163

164+
165+
hwloc_compress_dir_name=`echo "hwloc-compress-dir" | $(SED) -e "$(transform)"`
166+
hwloc_gather_topology_name=`echo "hwloc-gather-topology" | $(SED) -e "$(transform)"`
167+
163168
install-exec-hook:
164-
$(SED) -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-compress-dir > $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp $(DESTDIR)$(bindir)/hwloc-compress-dir
165-
chmod +x $(DESTDIR)$(bindir)/hwloc-compress-dir
169+
$(SED) -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name) > $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name).tmp && mv -f $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name).tmp $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name)
170+
chmod +x $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name)
166171
if HWLOC_HAVE_LINUX
167-
$(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-gather-topology > $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp $(DESTDIR)$(bindir)/hwloc-gather-topology
168-
chmod +x $(DESTDIR)$(bindir)/hwloc-gather-topology
172+
$(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name) > $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name).tmp && mv -f $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name).tmp $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name)
173+
chmod +x $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name)
169174
endif HWLOC_HAVE_LINUX
170175

171176
distclean-local:

utils/lstopo/Makefile.am

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright © 2009-2012, 2014 Université Bordeaux
33
# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved.
44
# Copyright © 2020 Hewlett Packard Enterprise. All rights reserved.
5+
# Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved.
56
#
67
# See COPYING in top-level directory.
78

@@ -89,30 +90,34 @@ SEDMAN = $(SED) -e 's/%PACKAGE_NAME%/@PACKAGE_NAME@/g' \
8990
@ $(SEDMAN) \
9091
> $@ < $<
9192

93+
hwloc_ls_name=`echo "hwloc-ls" | $(SED) -e "$(transform)"`
94+
lstopo_name=`echo "lstopo" | $(SED) -e "$(transform)"`
95+
lstopo_no_graphics_name=`echo "lstopo-no-graphics" | $(SED) -e "$(transform)"`
96+
9297
install-exec-hook:
93-
rm -f $(DESTDIR)$(bindir)/hwloc-ls$(EXEEXT)
94-
cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) hwloc-ls$(EXEEXT)
98+
rm -f $(DESTDIR)$(bindir)/$(hwloc_ls_name)$(EXEEXT)
99+
cd $(DESTDIR)$(bindir) && $(LN_S) $(lstopo_no_graphics_name)$(EXEEXT) $(hwloc_ls_name)$(EXEEXT)
95100
if !HWLOC_HAVE_WINDOWS
96101
if !HWLOC_HAVE_CAIRO
97-
rm -f $(DESTDIR)$(bindir)/lstopo
98-
cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) lstopo$(EXEEXT) || true
102+
rm -f $(DESTDIR)$(bindir)/$(lstopo_name)$(EXEEXT)
103+
cd $(DESTDIR)$(bindir) && $(LN_S) $(lstopo_no_graphics_name)$(EXEEXT) $(lstopo_name)$(EXEEXT) || true
99104
endif
100105
endif
101106

102107
install-data-hook:
103-
rm -f $(DESTDIR)$(man1dir)/hwloc-ls.1
104-
cd $(DESTDIR)$(man1dir) && $(LN_S) lstopo-no-graphics.1 hwloc-ls.1
105-
rm -f $(DESTDIR)$(man1dir)/lstopo.1
106-
cd $(DESTDIR)$(man1dir) && $(LN_S) lstopo-no-graphics.1 lstopo.1
108+
rm -f $(DESTDIR)$(man1dir)/$(hwloc_ls_name).1
109+
cd $(DESTDIR)$(man1dir) && $(LN_S) $(lstopo_no_graphics_name).1 $(hwloc_ls_name).1
110+
rm -f $(DESTDIR)$(man1dir)/$(lstopo_name).1
111+
cd $(DESTDIR)$(man1dir) && $(LN_S) $(lstopo_no_graphics_name).1 $(lstopo_name).1
107112

108113
uninstall-local:
109-
rm -f $(DESTDIR)$(bindir)/hwloc-ls$(EXEEXT)
114+
rm -f $(DESTDIR)$(bindir)/$(hwloc_ls_name)$(EXEEXT)
110115
if !HWLOC_HAVE_WINDOWS
111116
if !HWLOC_HAVE_CAIRO
112-
rm -f $(DESTDIR)$(bindir)/lstopo$(EXEEXT)
117+
rm -f $(DESTDIR)$(bindir)/$(lstopo_name)$(EXEEXT)
113118
endif
114119
endif
115-
rm -f $(DESTDIR)$(man1dir)/hwloc-ls.1 $(DESTDIR)$(man1dir)/lstopo.1
120+
rm -f $(DESTDIR)$(man1dir)/$(hwloc_ls_name).1 $(DESTDIR)$(man1dir)/$(lstopo_name).1
116121

117122
distclean-local:
118123
rm -f $(nodist_man_MANS)

utils/netloc/infiniband/Makefile.am

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright © 2013 University of Wisconsin-La Crosse.
33
# All rights reserved.
44
# Copyright © 2015-2018 Inria. All rights reserved.
5+
# Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved.
56
#
67
# See COPYING in top-level directory.
78
#
@@ -11,9 +12,11 @@ bin_SCRIPTS = \
1112
netloc_ib_gather_raw
1213
CLEANFILES = $(bin_SCRIPTS)
1314

15+
netloc_ib_gather_raw_name=`echo "netloc_ib_gather_raw" | $(SED) -e "$(transform)"`
16+
1417
install-exec-hook:
15-
$(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/netloc_ib_gather_raw > $(DESTDIR)$(bindir)/netloc_ib_gather_raw.tmp && mv -f $(DESTDIR)$(bindir)/netloc_ib_gather_raw.tmp $(DESTDIR)$(bindir)/netloc_ib_gather_raw
16-
chmod +x $(DESTDIR)$(bindir)/netloc_ib_gather_raw
18+
$(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/$(netloc_ib_gather_raw_name) > $(DESTDIR)$(bindir)/$(netloc_ib_gather_raw_name).tmp && mv -f $(DESTDIR)$(bindir)/$(netloc_ib_gather_raw_name).tmp $(DESTDIR)$(bindir)/$(netloc_ib_gather_raw_name)
19+
chmod +x $(DESTDIR)$(bindir)/$(netloc_ib_gather_raw_name)
1720

1821
AM_CPPFLAGS = \
1922
-I$(top_builddir)/include \

0 commit comments

Comments
 (0)