Ben Pfaff <b...@cs.stanford.edu> writes: > "make distuninstallcheck" noticed a weakness in the recipes that > relocatable-maint.texi recommends for relocatable programs: "make > uninstall" does not remove the ".bin" programs that install-reloc > creates on some systems.
Here's my solution written up as a proper commit. It works OK for PSPP. Comments? (Is build-aux the correct directory for a user-includable Makefile.am fragment?) --8<--------------------------cut here-------------------------->8-- >From 3b80f8c1c771264e1db78586775f37dc5caf6cab Mon Sep 17 00:00:00 2001 From: Ben Pfaff <b...@cs.stanford.edu> Date: Wed, 9 Jun 2010 21:50:04 -0700 Subject: [PATCH] Provide means to uninstall ".bin" files installed by relocwrapper. * build-aux/relocwrapper.am: New file. * doc/relocatable-maint.texi: Explain how to use relocwrapper.am. * modules/relocatable-prog-wrapper: Add relocwrapper.am to file list. --- ChangeLog | 8 ++++++++ build-aux/relocwrapper.am | 19 +++++++++++++++++++ doc/relocatable-maint.texi | 8 ++++++++ modules/relocatable-prog-wrapper | 1 + 4 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 build-aux/relocwrapper.am diff --git a/ChangeLog b/ChangeLog index 71803c7..ef2c386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,12 @@ 2010-06-09 Ben Pfaff <b...@cs.stanford.edu> + + Provide means to uninstall ".bin" files installed by relocwrapper. + * build-aux/relocwrapper.am: New file. + * doc/relocatable-maint.texi: Explain how to use relocwrapper.am. + * modules/relocatable-prog-wrapper: Add relocwrapper.am to file + list. + +2010-06-09 Ben Pfaff <b...@cs.stanford.edu> Bruno Haible <br...@clisp.org> Add "Extending Gnulib" chapter to manual. diff --git a/build-aux/relocwrapper.am b/build-aux/relocwrapper.am new file mode 100644 index 0000000..2cba347 --- /dev/null +++ b/build-aux/relocwrapper.am @@ -0,0 +1,19 @@ +## Include this file into a top-level Makefile.am to ensure that "make +## uninstall" removes ".bin" files installed by install-reloc when +## --enable-relocatable is used on a platform that does not support +## relocation in the dynamic linker. See doc/relocatable-maint.texi +## in the Gnulib source tree for more information. + +uninstall-hook: uninstall-relocwrapper +uninstall-relocwrapper: +if RELOCATABLE_VIA_LD + @: +else + if test $(RELOCATABLE) = yes; then \ + case '$(EXEEXT)' in \ + .bin*) ;; \ + *) $(MAKE) uninstall EXEEXT=.bin$(EXEEXT) ;; \ + esac; \ + fi +endif +.PHONY: uninstall-relocwrapper diff --git a/doc/relocatable-maint.texi b/doc/relocatable-maint.texi index 58160cf..f497b60 100644 --- a/doc/relocatable-maint.texi +++ b/doc/relocatable-maint.texi @@ -145,6 +145,14 @@ foo_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)` endif @end example +Also, only in the @file{Makefile.am} at the top level of your source +tree, add the following. Replace @samp{build-aux}, if necessary, by +the directory where @file{gnulib-tool} places auxiliary build tools: + +...@example +include build-aux/relocwrapper.am +...@end example + @item You may also need to add a couple of variable assignments to your @file{configure.ac}. diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper index de77830..8376165 100644 --- a/modules/relocatable-prog-wrapper +++ b/modules/relocatable-prog-wrapper @@ -4,6 +4,7 @@ that depend on shared libraries installed with the same installation prefix. Files: build-aux/install-reloc +build-aux/relocwrapper.am lib/relocwrapper.c lib/progname.h lib/progname.c -- 1.7.1 -- Ben Pfaff http://benpfaff.org