unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Bruno Haible <bruno@clisp.org>
Cc: Guile bug <bug-guile@gnu.org>, Fu-Gangqiang <lispor@163.com>, Mark
Subject: Re: linking with libguile-2.0, rpath
Date: Sun, 20 Feb 2011 11:58:37 +0100	[thread overview]
Message-ID: <m31v330y76.fsf@unquote.localdomain> (raw)
In-Reply-To: <201102191630.16597.bruno@clisp.org> (Bruno Haible's message of "Sat, 19 Feb 2011 16:30:15 +0100")

Hi Bruno,

Thanks for looking into this matter.

On Sat 19 Feb 2011 16:30, Bruno Haible <bruno@clisp.org> writes:

> First of all, the macro GUILE_FLAGS in guile.m4 needs to be extended.
> Find attached a patch that does 3 things:

Thanks!  Applied.

> Second, about the documentation. A command line
>
>   $ gcc -o simple-guile simple-guile.c  `pkg-config --cflags --libs guile-2.0`
>
> cannot work in general, because the list of directories to use in the -rpath
> option(s) comes from pkg-config, but it needs to be presented in a syntax that
> depends on the compiler (think of Solaris, where the option for gcc is
> -Wl,-rpath and the option for cc is -R), and pkg-config does not know about the
> compiler.
>
> That's also the reason why I propose to add this logic to the GUILE_FLAGS macro
> and not to the 'guile-config' program.

I don't know how I was unaware of this for so long; libtool-induced
bliss (!) I guess.

> So, for the documentation, I only see an ad-hoc approach:
>
> # Define a function that transform -L options to rpath options. This definition
> # works with gcc on glibc systems. On other platforms, the details are different.
> $ transform_L_options_to_rpath_options ()
> {
>   sed -e 's/^/ /' | sed -e 's/ -l *[^ ]*//g' -e 's/ -L */ -Wl,-rpath -Wl,/g'
> }
>
> With this, the command line becomes
>
> $ gcc -o simple-guile simple-guile.c
>       `pkg-config --cflags --libs guile-2.0`
>       `pkg-config --libs guile-2.0 | transform_L_options_to_rpath_options`

Food for thought.  Thanks for the suggestion.

Cheers,

Andy
-- 
http://wingolog.org/



      reply	other threads:[~2011-02-20 10:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 12:02 Can not work with libguile-2.0 Fu-Gangqiang
2011-02-17 13:02 ` Hans Aberg
2011-02-17 13:40 ` Fu-Gangqiang
2011-02-17 18:04 ` Mark Harig
2011-02-17 18:23 ` Mark Harig
2011-02-18  8:41   ` Andy Wingo
2011-02-17 19:08 ` Mark Harig
2011-02-18  8:53   ` Andy Wingo
2011-02-18 19:42     ` Mark Harig
2011-02-20 10:13       ` Andy Wingo
2011-02-18  1:39 ` Fu-Gangqiang
2011-02-18  8:34 ` Andy Wingo
2011-02-19 15:30   ` linking with libguile-2.0, rpath Bruno Haible
2011-02-20 10:58     ` Andy Wingo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m31v330y76.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=bruno@clisp.org \
    --cc=bug-guile@gnu.org \
    --cc=lispor@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).