From 1690244664a0a37e8f7834a80312ce3826ae36d4 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 6 Feb 2009 23:27:16 +0000 Subject: [PATCH] Merged r9120 (Merge Makefile.{inplace,install}.am, and simplify installation of libmpiwrap.so) from trunk. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9121 --- Makefile.inplace.am | 16 ------------- Makefile.install.am | 17 ++++++++++++-- Makefile.tool.am | 1 - auxprogs/Makefile.am | 52 +++++++++++++++++-------------------------- coregrind/Makefile.am | 1 - 5 files changed, 35 insertions(+), 52 deletions(-) delete mode 100644 Makefile.inplace.am diff --git a/Makefile.inplace.am b/Makefile.inplace.am deleted file mode 100644 index c524832dde..0000000000 --- a/Makefile.inplace.am +++ /dev/null @@ -1,16 +0,0 @@ -# This is used by coregrind/Makefile.am and Makefile.tool.am for doing -# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir, doing -# some magic renaming as it does. -# There is similar code in Makefile.install.am (which describes how the -# magic sed commands work). - -all-local: - if [ -n "$(noinst_PROGRAMS)" ] ; then \ - for f in $(noinst_PROGRAMS); do \ - name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \ - plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \ - mkdir -p $(inplacedir)/$$plat; \ - rm -f $(inplacedir)/$$plat/$$name; \ - ln -f -s ../../$(subdir)/$$f $(inplacedir)/$$plat/$$name; \ - done ; \ - fi diff --git a/Makefile.install.am b/Makefile.install.am index b2facf1bb3..07840f4601 100644 --- a/Makefile.install.am +++ b/Makefile.install.am @@ -1,8 +1,22 @@ +# This is used by coregrind/Makefile.am and Makefile.tool.am for doing +# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir, doing +# some magic renaming as it does. +# The similar code below explains how the magic sed commands work. +all-local: + if [ -n "$(noinst_PROGRAMS)" ] ; then \ + for f in $(noinst_PROGRAMS); do \ + name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\{0,1\}$$/\2/'`; \ + plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\{0,1\}$$/\1/'`; \ + mkdir -p $(inplacedir)/$$plat; \ + rm -f $(inplacedir)/$$plat/$$name; \ + ln -f -s ../../$(subdir)/$$f $(inplacedir)/$$plat/$$name; \ + done ; \ + fi + # This is used by coregrind/Makefile.am and by /Makefile.am for doing # "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/, # doing some magic renaming as it does. # It needs to be depended on by an 'install-exec-local' rule. -# There is similar code in Makefile.inplace.am. # # Details about the renaming: the loop copies a bunch of files with # names of the form wurble-arch-os to $prefix/lib/valgrind/arch-os/wurble. @@ -14,7 +28,6 @@ # and not in # $prefix/lib/valgrind/omega-x86-linux/exp # or similarly mutant place. - install-exec-local-programs: if [ -n "$(noinst_PROGRAMS)" ] ; then \ for f in $(noinst_PROGRAMS); do \ diff --git a/Makefile.tool.am b/Makefile.tool.am index 8e896f1bd2..85e5cf522e 100644 --- a/Makefile.tool.am +++ b/Makefile.tool.am @@ -3,7 +3,6 @@ SUBDIRS = . tests docs include $(top_srcdir)/Makefile.all.am include $(top_srcdir)/Makefile.flags.am -include $(top_srcdir)/Makefile.inplace.am include $(top_srcdir)/Makefile.install.am diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index d399db537f..48fac83963 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -62,18 +62,18 @@ endif ## noinst_PROGRAMS = if BUILD_MPIWRAP_PRI -noinst_PROGRAMS += libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so -libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so: libmpiwrap.c +noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so: libmpiwrap.c $(MPI_CC) $(HACKY_FLAGS_PRI) \ -I../include \ - -o libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so libmpiwrap.c + -o libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so libmpiwrap.c endif if BUILD_MPIWRAP_SEC -noinst_PROGRAMS += libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so -libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so: libmpiwrap.c +noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so: libmpiwrap.c $(MPI_CC) $(HACKY_FLAGS_SEC) \ -I../include \ - -o libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so libmpiwrap.c + -o libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so libmpiwrap.c endif @@ -85,24 +85,12 @@ endif install-exec-local: if BUILD_MPIWRAP_PRI -# convert (eg) X86_LINUX to x86-linux -# really should use sed here, rather than assume tr is available - pD=`echo @VGCONF_PLATFORM_PRI_CAPS@ | tr A-Z_ a-z-` ; \ - $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \ - rm -f ./libmpiwrap.so; \ - cp ./libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so ./libmpiwrap.so; \ - $(INSTALL_PROGRAM) ./libmpiwrap.so \ - $(DESTDIR)$(valdir)/$$pD; \ - rm -f ./libmpiwrap.so + $(mkinstalldirs) $(DESTDIR)$(valdir)/@VGCONF_ARCH_PRI@-@VGCONF_OS@; \ + $(INSTALL_PROGRAM) ./libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so $(DESTDIR)$(valdir)/@VGCONF_ARCH_PRI@-@VGCONF_OS@/libmpiwrap.so; endif if BUILD_MPIWRAP_SEC - pD=`echo @VGCONF_PLATFORM_SEC_CAPS@ | tr A-Z_ a-z-` ; \ - $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \ - rm -f ./libmpiwrap.so; \ - cp ./libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so ./libmpiwrap.so; \ - $(INSTALL_PROGRAM) ./libmpiwrap.so \ - $(DESTDIR)$(valdir)/$$pD; \ - rm -f ./libmpiwrap.so + $(mkinstalldirs) $(DESTDIR)$(valdir)/@VGCONF_ARCH_PRI@-@VGCONF_OS@; \ + $(INSTALL_PROGRAM) ./libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so $(DESTDIR)$(valdir)/@VGCONF_ARCH_SEC@-@VGCONF_OS@/libmpiwrap.so; endif @@ -110,28 +98,28 @@ endif ## It would seem that using nodist_SOURCES is the right fix, but ## I can't figure out how to do it. ## -#nodist_SOURCES = libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c -#nodist_SOURCES = libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c +#nodist_SOURCES = libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c +#nodist_SOURCES = libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c libmpiwrap-.c: rm -f libmpiwrap-.c touch libmpiwrap-.c -libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c: - rm -f libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c - touch libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c +libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c: + rm -f libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c + touch libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c if VGCONF_HAVE_PLATFORM_SEC_CAPS -libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c: - rm -f libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c - touch libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c +libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c: + rm -f libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c + touch libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c endif ## cleanery clean-local: rm -f libmpiwrap-.c \ - libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c \ - libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c + libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c \ + libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c # #---------------------------------------------------------- diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index d13d40baea..98c6c259f9 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -5,7 +5,6 @@ include $(top_srcdir)/Makefile.all.am include $(top_srcdir)/Makefile.flags.am -include $(top_srcdir)/Makefile.inplace.am include $(top_srcdir)/Makefile.install.am -- 2.47.3