[Top][All Lists]

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

Re: adding libraries and header file directories

From: Ralf Wildenhues
Subject: Re: adding libraries and header file directories
Date: Mon, 6 Nov 2006 23:42:44 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Jim, Mick,

* Jim Rainville wrote on Mon, Nov 06, 2006 at 02:46:12PM CET:
> This was very helpful. It got me off the ground and now I think I'm
> about 90% there. What I'm struggling with now is circular dependencies
> in libraries. In the old Makefile for this software they dealt with this
> in this fashion:
> -Wl,--start-group <libs> -Wl,--end-group
> With autoconf/automake this won't work because you're supposed to add
> linker flags with the _LDFLAGS macro and when you do that it's not
> positional.

If you're not using Libtool:  just mention the library/libraries twice.
But the real solution is to get rid of the circular dependencies.  It's
not portable to have them.  -Wl,--start-group is limited to GNU binutils
ld, so that's a lot less portable even.

> From: mick [mailto:address@hidden 
> On Sun, 5 Nov 2006 02:36, you wrote:
> >
> > ... -I$(path_to_my_headers) -L$(path_to_my_libraries) element_hal
> > element_sal ...
> I have used:-
> bin_PROGRAMS = gyachi
> gyachi_SOURCES = \
> ...
> INCLUDES = -I/usr/include/gtkhtml-2.0 -I/usr/include/libxml2

AM_CPPFLAGS is a non-anachronistic way of spelling INCLUDES in files.  But you don't want to spell out absolute paths in
such a file like that anyway if you want your program to be portable
(your next user will have gtkhtml 2.1 installed below /opt/foobar, and
libxml below her $HOME).  Libraries like that usually make their flags
known in some way, either an Autoconf macro they ship and you can use,
(the Autoconf Macro Archive has one of those), or e.g., pkg-config.

Otherwise there is of course still the possibility for the user of your
package to
  ./configure \
    CPPFLAGS='-I/usr/include/gtkhtml-2.0 -I/usr/include/libxml2' \
    LDFLAGS='-L/opt/foobar/lib ...'

Hope that helps.


reply via email to

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