ld and libraries troubles (newbie).
Joshua Oreman
oremanj at webserver.get-linux.org
Mon Jul 7 18:48:56 PDT 2003
On Tue, Jul 08, 2003 at 01:55:21AM +0100 or thereabouts, lewiz wrote:
> On Mon, Jul 07, 2003 at 05:51:47PM -0700, Joshua Oreman wrote:
> > > For some reason it does not find libexpat (ld: cannot find -lexpat),
> > > which is available in /usr/local/lib. I created a symlink to /usr/lib
> > > and it worked, but then failed when make got to libintl.a (in
> > > /usr/local). I've done my best to read the Porter's Handbook
> > > (especially the chapter on Dependencies) but this has been of little
> > > help. Any pointers in the right direction would be greatly appreciated!
> >
> > DON'T depend on symlinking libraries, since when the port installs the
> > end user might not have those symlinks.
>
> Hehe, I know. Sorry, I didn't make it clear that was a temporary
> work-around.
>
> > Add -L/usr/local/lib to the link line in the Makefile. Make a patch
> > to do this.
>
> Is that the only way to solve this issue? I was expecting there to be
> some option for the port Makefile?
The port makefile can't just add stuff to the software's Makefiles.
If the software has a "good" makefile, then either of these (in the port
Makefile, in order of preference) should work:
LDFLAGS+= -L/usr/local/lib
-or-
LIBS+= -L/usr/local/lib
-or-
CFLAGS+= -L/usr/local/lib
CXXFLAGS+= -L/usr/local/lib
If that doesn't work, then yes, you have to edit the software's Makefile.
-- Josh
>
> Thanks very much,
>
> -lewiz.
>
> --
> Chism's Law of Completion:
> The amount of time required to complete a government project is
> precisely equal to the length of time already spent on it.
> ------------------------------------------------------------------------
> -| msn:purple at lewiz.net | jab:lewiz at jabber.org | url:http://lewiz.net |-
More information about the freebsd-ports
mailing list