[Dune] [Dune-Commit] dune-grid r6189 - in trunk: dune/grid/albertagrid dune/grid/albertagrid/test m4

Jö Fahlke jorrit at jorrit.de
Tue Jan 19 18:00:53 CET 2010


Am Tue, 19. Jan 2010, 16:52:09 +0100 schrieb Christian Engwer:
> > Log:
> > Pass the linker path when linking alberta libraries.  Otherwise the
> > albertagrid_?d libraries will be linked against an alberta installed in
> > /usr/lib instead of the one wiven with --with-alberta.
> 
> > Modified: trunk/dune/grid/albertagrid/Makefile.am
> > ===================================================================
> > --- trunk/dune/grid/albertagrid/Makefile.am	2010-01-19 14:47:27 UTC (rev 6188)
> > +++ trunk/dune/grid/albertagrid/Makefile.am	2010-01-19 15:33:37 UTC (rev 6189)
> > @@ -8,15 +8,15 @@
> >  
> >  libalbertagrid_1d_la_SOURCES = $(libalbertagrid_sources)
> >  libalbertagrid_1d_la_CPPFLAGS = $(libalbertagrid_cppflags) -DALBERTA_DIM=1
> > -libalbertagrid_1d_la_LIBADD = $(DUNE_COMMON_LIBS) $(ALBERTA_BASE_LIBS) -lalberta_1d
> > +libalbertagrid_1d_la_LIBADD = $(DUNE_COMMON_LIBS) -L$(ALBERTAROOT)/lib $(ALBERTA_BASE_LIBS) -lalberta_1d
> 
> shouldn't we add the linker option to LDFLAGS? How should the user
> that he still as to add -L$(ALBERTAROOT)/lib?

Citing the automake manual:
======================================================================
   `PROG_LDADD' is inappropriate for passing program-specific linker
flags (except for `-l', `-L', `-dlopen' and `-dlpreopen').  So, use the
`PROG_LDFLAGS' variable for this purpose.
======================================================================

Same goes for _LIBADD, of course.  Essentially any linker option or parameter
that specifies a library or object to link to has to go into LIBS, LDADD,
*_LDADD, or *_LIBADD, while everything else has to go into *_LDFLAGS.

Part of the reason is that different program packages may contain libraries
with the same name -- if the -L option for those packages is in *_LDFLAGS,
then it may happen that the wrong linker path is in effect when the
corresponding -l options are encountered.

> And second question, does this still work with an instaled alberta?

It does -- for an installed Albera we have ALBERTAROOT=/usr.

Jö.

-- 
A mathematician is a device to turn coffee into theorems.
-- Paul Erdös
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20100119/23c66ffe/attachment.sig>


More information about the Dune mailing list