[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uninstalling relocation wrappers

From: Bruno Haible
Subject: Re: uninstalling relocation wrappers
Date: Mon, 14 Jun 2010 02:06:55 +0200
User-agent: KMail/1.9.9

Hi Ben,

> +uninstall-hook: uninstall-relocwrapper
> +uninstall-relocwrapper:
> +     @:
> +else
> +     if test $(RELOCATABLE) = yes; then \
> +         case '$(EXEEXT)' in \
> +             .bin*) ;; \
> +             *) $(MAKE) uninstall EXEEXT=.bin$(EXEEXT) ;; \
> +         esac; \
> +     fi
> +endif

Hmm, I don't like targets that contain empty commands in the default
case (when no relocatability is requested): it looks like bloat. I'm
adding a conditional 'RELOCATABLE_VIA_WRAPPER' that should allow you
to simplify this code.

Btw, in gnulib contributions, please indent shell statements by 2 spaces,
not 4 spaces.

> --- 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:
> +
> address@hidden
> +include build-aux/relocwrapper.am
> address@hidden example

I would prefer to avoid Makefile.am fragments and 'include' statements.
The reason is that here we start to get dependencies on the file layout
of the package.

The automake documentation says:

   There are two forms of `include':

  `include $(srcdir)/file'
       Include a fragment that is found relative to the current source

  `include $(top_srcdir)/file'
       Include a fragment that is found relative to the top source

and your example is not one of these. Then, if the package's configure.ac
invokes AC_CONFIG_AUX_DIR, the string 'build-aux/' needs to be replaced
accordingly. This does not make it easier for the package maintainer.

Instead, I would better see an AC_SUBSTed and AM_SUBST_NOTMAKEd variable
that expands to


if RELOCATABLE_VIA_WRAPPER is false, and to

   uninstall-hook: uninstall-relocwrapper
   uninstall-relocwrapper: ; case '$(EXEEXT)' in .bin*) ;; *) $(MAKE) 
$(AM_MAKEFLAGS) uninstall EXEEXT=.bin$(EXEEXT) ;; esac

if RELOCATABLE_VIA_WRAPPER is true. Unfortunately, I don't see how to
reduce this to a single line; this would make it unnecessary to rely on

Such a variable could be used in any Makefile.am, without thinking about
how to access 'build-aux/'.

Btw, make recursions in automake generated Makefile.ins use
not plain


2010-06-13  Bruno Haible  <address@hidden>

        relocatable: Make it easier to test whether to install wrappers.
        * m4/relocatable.m4 (gl_RELOCATABLE_BODY): New automake conditional

--- m4/relocatable.m4.orig      Mon Jun 14 01:52:11 2010
+++ m4/relocatable.m4   Mon Jun 14 01:52:09 2010
@@ -1,4 +1,4 @@
-# relocatable.m4 serial 15
+# relocatable.m4 serial 16
 dnl Copyright (C) 2003, 2005-2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -36,6 +36,7 @@
+  use_wrapper=no
   if test $RELOCATABLE = yes; then
     # --enable-relocatable implies --disable-rpath
@@ -58,6 +59,7 @@
         RELOCATABLE_LDFLAGS="\"$reloc_ldflags\" \"\$(host)\" 
+        use_wrapper=yes
         dnl Unfortunately we cannot define INSTALL_PROGRAM to a command
         dnl consisting of more than one word - libtool doesn't support this.
         dnl So we abuse the INSTALL_PROGRAM_ENV hook, originally meant for the
@@ -73,6 +75,7 @@
     [test $is_noop = yes || test $use_elf_origin_trick = yes])
+  AM_CONDITIONAL([RELOCATABLE_VIA_WRAPPER], [test $use_wrapper = yes])
   dnl RELOCATABLE_LIBRARY_PATH can be set in configure.ac. Default is empty.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]