[Top][All Lists]

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

Re: linking with libguile-2.0, rpath

From: Andy Wingo
Subject: Re: linking with libguile-2.0, rpath
Date: Sun, 20 Feb 2011 11:58:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Bruno,

Thanks for looking into this matter.

On Sat 19 Feb 2011 16:30, Bruno Haible <address@hidden> 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.



reply via email to

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