Re: Accounting for -rpath when libtool isn't helping

Roumen Petrov <[email protected]>
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
Hi Paul,

Paul "LeoNerd" Evans wrote:
> [SNIP]
> Alternatively, am I looking at this from the wrong direction? Maybe the
> problem is that the exporting library isn't providing -Wl,-rpath in
> its .pc file, to assist anyone else who wasn't using libtool to link it
> (such as is the case here).
No , I don't think that this is valuable.


> With that in mind, I now generate those if required, in the little
> shell fragment I use to create the .pc file:
>
> #!/bin/sh
>
> LIBS='-L${libdir} -ltickit'
> CFLAGS='-I${includedir}'
>
> case "$LIBDIR" in
>    /usr/lib) ;;
>    /usr/local/lib) ;;
>    *)
>      LIBS="$LIBS -Wl,-rpath -Wl,$LIBDIR"
>      ;;
> esac
>
> cat <<EOF
> libdir=$LIBDIR
> includedir=$INCDIR
>
> Name: tickit
> Description: Terminal Interface Construction KIT
> Version: 0.2
> Libs: $LIBS
> Cflags: $CFLAGS
> EOF
>

Like you perl (first email) and shell (above) scripts libtool do similar 
to decide when to add "runpath" linker flag. Libtool parses 
/etc/ld.so.conf and "build-in default paths" and if a library path is 
not in list adds "runpath" flag.

On most platform you control this via variable 
lt_cv_sys_lib_dlsearch_path_spec. Pattern *_cv_* mean that this is a 
"autoconf cache variable" and "lt" is custom namespace prefix.

Add $HOME/lib to list to avoid -rpath flag.


For some autoconf builds with use of libtool you could force -rpath if 
needed - add those options to LDFLAGS ( see ./configure --help) .


Regards,
Roumen Petrov


_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.