automake
[Top][All Lists]
Advanced

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

Re: Finding library procedures in /usr/local/lib/


From: Gerald I. Evenden
Subject: Re: Finding library procedures in /usr/local/lib/
Date: Fri, 3 Apr 2009 12:47:52 -0400
User-agent: KMail/1.9.10

On Friday 03 April 2009 12:17:14 pm John Calcote wrote:
> On 4/3/2009 8:49 AM, Gerald I. Evenden wrote:
> > On Thursday 02 April 2009 5:56:52 pm Peter Johansson wrote:
> >> Hello Gerald,
> >>
> >> Gerald I. Evenden wrote:
> >>> After trying so many options related to libraries I am exhausted.
> >>>
> >>> I have a simple program that needs to link with a shared library
> >>> installed in /usr/local/lib.
> >>>
> >>> When using my own simple Makefile and simply adding "-lproject -lm"
> >>> everything works fine (libproject is the shared library).
> >>
> >> LDADD = "-lm -lproject"
> >>
> >> in your `Makefile.am' should do it.
> >>
> >> Cheers,
> >> Peter
> >
> > Of the suggestions offered, this one worked in the following literal
> > entry into src/Makefile.am:
> >
> > geodesic_LDADD = -lproject -lm
>
> No offense intended to Peter, but this solution works because it simply
> assumes the library exists on the end-user's system. On systems where it
> doesn't exist in the default library paths, the build will fail with a
> linker error. The entire purpose of Autoconf checks is to ensure that
> the environment is actually able to build the project. If this solution
> is acceptable to you, then why even bother with configure? Why not
> simply write a makefile to build your project?
>
> Regards,
> John

I suspect you have a point but my experience has been very frustrating in 
trying to employ the autoconf options.  I tried the AC_SEARCH_LIBS option 
suggested earlier but then the math library failed to be included and all the 
trig functions disappeared.  I have tried other options in configure.ac as 
well but either -lm or -lproject contents disappear.  Obviously, my 
inexperience quite probably contributes to those failures.  I often take a 
fetal position, thumb sucking pose when trying to decypher some of the 
options.

As to whether final linking fails or not, if the damn procedures in libproject 
are not there then the installation fails regardless---there is no 
alternative.

-- 
The whole religious complexion of the modern world is due
to the absence from Jerusalem of a lunatic asylum.
-- Havelock Ellis (1859-1939) British psychologist




reply via email to

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