unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Makefile: specify libnotmuch.so location with -rpath
@ 2010-04-25 15:38 Chris Wilson
  2010-04-25 15:59 ` Adrien Bustany
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2010-04-25 15:38 UTC (permalink / raw)
  To: notmuch

In order to handle installation into user directories, it is convenient
to encode the library location into the search path for the notmuch
executable. This is achieved for the GNU linker with the -rpath
argument.
---
 Makefile.local |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 5bb570b..77d2c45 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -31,7 +31,7 @@ GPG_FILE=$(SHA1_FILE).asc
 # Smash together user's values with our extra values
 FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
-FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch
+FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Wl,-rpath=$(prefix)/lib -Llib -lnotmuch
 FINAL_NOTMUCH_LINKER = CC
 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
-- 
1.7.0.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Makefile: specify libnotmuch.so location with -rpath
  2010-04-25 15:38 [PATCH] Makefile: specify libnotmuch.so location with -rpath Chris Wilson
@ 2010-04-25 15:59 ` Adrien Bustany
  2010-04-26 14:29   ` Carl Worth
  0 siblings, 1 reply; 4+ messages in thread
From: Adrien Bustany @ 2010-04-25 15:59 UTC (permalink / raw)
  To: Chris Wilson; +Cc: notmuch

On Sun, 25 Apr 2010 16:38:40 +0100, Chris Wilson
<chris@chris-wilson.co.uk> wrote:
> In order to handle installation into user directories, it is convenient
> to encode the library location into the search path for the notmuch
> executable. This is achieved for the GNU linker with the -rpath
> argument.
> ---
>  Makefile.local |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/Makefile.local b/Makefile.local
> index 5bb570b..77d2c45 100644
> --- a/Makefile.local
> +++ b/Makefile.local
> @@ -31,7 +31,7 @@ GPG_FILE=$(SHA1_FILE).asc
>  # Smash together user's values with our extra values
>  FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS)
>  $(CONFIGURE_CFLAGS) $(extra_cflags)
>  FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS)
>  $(extra_cflags) $(extra_cxxflags)
> -FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch
> +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Wl,-rpath=$(prefix)/lib -Llib
> -lnotmuch
>  FINAL_NOTMUCH_LINKER = CC
>  ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
>  FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)

Hello Chris,

I know that many distros (among them Fedora, see
https://fedoraproject.org/wiki/Packaging/Guidelines#Beware_of_Rpath )
discourage the use of rpath. Do you think it could be an option set at
configure time (set rpath or not) ?

Cheers

Adrien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Makefile: specify libnotmuch.so location with -rpath
@ 2010-04-25 16:00 Adrien Bustany
  0 siblings, 0 replies; 4+ messages in thread
From: Adrien Bustany @ 2010-04-25 16:00 UTC (permalink / raw)
  To: notmuch

On Sun, 25 Apr 2010 16:38:40 +0100, Chris Wilson
<chris@chris-wilson.co.uk> wrote:
> In order to handle installation into user directories, it is convenient
> to encode the library location into the search path for the notmuch
> executable. This is achieved for the GNU linker with the -rpath
> argument.
> ---
>  Makefile.local |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/Makefile.local b/Makefile.local
> index 5bb570b..77d2c45 100644
> --- a/Makefile.local
> +++ b/Makefile.local
> @@ -31,7 +31,7 @@ GPG_FILE=$(SHA1_FILE).asc
>  # Smash together user's values with our extra values
>  FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS)
>  $(CONFIGURE_CFLAGS) $(extra_cflags)
>  FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS)
>  $(extra_cflags) $(extra_cxxflags)
> -FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch
> +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Wl,-rpath=$(prefix)/lib -Llib
> -lnotmuch
>  FINAL_NOTMUCH_LINKER = CC
>  ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
>  FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)

Hello Chris,

I know that many distros (among them Fedora, see
https://fedoraproject.org/wiki/Packaging/Guidelines#Beware_of_Rpath )
discourage the use of rpath. Do you think it could be an option set at
configure time (set rpath or not) ?

Cheers

Adrien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Makefile: specify libnotmuch.so location with -rpath
  2010-04-25 15:59 ` Adrien Bustany
@ 2010-04-26 14:29   ` Carl Worth
  0 siblings, 0 replies; 4+ messages in thread
From: Carl Worth @ 2010-04-26 14:29 UTC (permalink / raw)
  To: Adrien Bustany, Chris Wilson; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]


On Sun, 25 Apr 2010 17:59:35 +0200, Adrien Bustany <madcat@mymadcat.com> wrote:
> On Sun, 25 Apr 2010 16:38:40 +0100, Chris Wilson
> <chris@chris-wilson.co.uk> wrote:
> > In order to handle installation into user directories, it is convenient
> > to encode the library location into the search path for the notmuch
> > executable. This is achieved for the GNU linker with the -rpath
> > argument.
> 
> I know that many distros (among them Fedora, see
> https://fedoraproject.org/wiki/Packaging/Guidelines#Beware_of_Rpath )
> discourage the use of rpath. Do you think it could be an option set at
> configure time (set rpath or not) ?

Right. Debian doesn't want this either.

Some of what I've wanted to do in "make install" to help with this:

  * Figure out the right way to run "ldconfig" from "make install"

  * Test if the runtime linker will be able to find the library, and if
    not print a message about setting LD_LIBRARY_PATH (or
    DYLD_LIBRARY_PATH).

Setting rpath with the option to prevent this might be possible too. But
we can't do this unconditionally.

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-26 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-25 15:38 [PATCH] Makefile: specify libnotmuch.so location with -rpath Chris Wilson
2010-04-25 15:59 ` Adrien Bustany
2010-04-26 14:29   ` Carl Worth
  -- strict thread matches above, loose matches on Subject: below --
2010-04-25 16:00 Adrien Bustany

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).