[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: help linking shared libraries / rpath
From: |
David Byron |
Subject: |
RE: help linking shared libraries / rpath |
Date: |
Fri, 16 Feb 2007 11:59:38 -0800 |
On Friday, February 16, 2007 @ 9:30a, Ralf Wildenhues wrote:
> * David Byron wrote on Fri, Feb 16, 2007 at 06:08:53PM CET:
>
> > I'm getting stumped on how to set rpath.
>
> You can either use Libtool, but you may consider this overkill,
> understandably, or you can use autoconf-lib-link. That is a set
> of macro files and a script config.rpath which will be added to
> your package. It's distributed as part of GNU gettext, or
> alternatively as the havelib module of gnulib:
> <http://www.gnu.org/software/gnulib/MODULES.html#module=havelib>.
This is getting more and more hopeful all the time. I started diving into
the gnulib/havelib stuff and have made good progress, but I'm curious...If I
wanted to use libtool, how would I do it? Put AC_PROG_LIBTOOL in
configure.ac, and then what? Sorry to be dense, but all the info about
lib_LTLIBRARIES, etc. doesn't seem to apply.
Here's where I've gotten with gnulib/havelib in case this is helpful for
others. I also have some questions at the end.
Following the instructions at
http://www.gnu.org/software/gnulib/manual/gnulib.html#Invoking-gnulib_002dto
ol, I tried:
-bash-2.05b$ ~/archive/gnulib/gnulib/gnulib-tool --dry-run --import havelib
Module list with included dependencies:
havelib
File list:
build-aux/config.rpath
lib/dummy.c
m4/gnulib-common.m4
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
(and some recommendations to use gl_* macros in my configure.ac)
Some of this looks like overkill so I just copied the m4/lib-*.m4 into my
project's m4 directory (I already have some of my own macros there). I also
made a build-aux directory in my project and copied config.rpath there.
>From there:
- add AC_CONFIG_AUX_DIR(build-aux) to my configure.ac
- remove config.guess, config.sub, depcomp, install-sh, missing since
autoreconf now puts them in build-aux
- add AC_LIB_LINKFLAGS([xerces-c]) since that's the library I'm concerned
with at the moment
- run autoreconf -fvi
- run configure --with-libxerces-c-prefix=/my/path/to/xerces-c
- Observe the exciting contents of LIBXERCES_C, LIBXERCES_C_PREFIX, and
LTLIBXERCES_C in my generated Makefiles.
- Also observe that CPPFLAGS now includes -I/my/path/to/xerces-c/include
My reflex is that I don't want CPPFLAGS to include the xerces-c path...that
I would prefer AC_LIB_LINKFLAGS just AC_SUBST([INC]NAME) instead of
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME). I can modify the macro to do
that but I'm curious what other people's take is on this issue. I figure
I'll only use the xerces include path when I need it.
I'm pretty sure I just add LIBXERCES_C to the relevant *_LDADD variables in
my Makefile.am's. LIBXERCES_C_PREFIX seems straightforward. I'm less sure
about LTLIBXERCES_C, but I suppose that's because I'm not using libtool.
It's OK to ignore it until then, yes?
Thanks again.
-DB