includes, configure, /usr/lib vs. /usr/local/lib,
and linux coders
Steve Franks
stevefranks at ieee.org
Fri Oct 31 12:30:48 PDT 2008
On Fri, Oct 31, 2008 at 12:11 PM, Nate Eldredge <neldredge at math.ucsd.edu> wrote:
> On Fri, 31 Oct 2008, Steve Franks wrote:
>
>> I believe someone has told me on this list that the proper way to
>> compile a linux program is to run configure
>> --includedir=/usr/local/include --libdir=/usr/local/lib.
>
> Nitpick: not specifically a Linux program, but a program using a configure
> script generated by GNU's autoconf system. Programs using autoconf may
> run on systems other than Linux (usually do, in fact, since the point of
> autoconf is portability), and many Linux programs don't use autoconf.
>
> And I'll assume that by 'linux' you actually mean FreeBSD, in order for this
> to be on-topic for this list :)
>
>> Is that
>> correct? I've got a bunch of linux weenies trying to tell me their
>> code isn't broken because I'm supposed to have headers where theirs
>> are.
>
> I don't understand this sentence.
>
>> They state that includedir is used by *their* project to locate
>> it's *own* headers, so they never bothered to wire it up in
>> Makefile.in....it gets ignored entirely.
>>
>> I figured I'd better know what I'm talking about before I tell someone
>> they are 'wrong'. Especially as it's usually me ;)
>
> It looks to me like both of you are wrong. :) Looking at the configure that
> comes with wget-1.11.2, running configure --help says
>
> Fine tuning of the installation directories:
> ...
> --libdir=DIR object code libraries [EPREFIX/lib]
> --includedir=DIR C header files [PREFIX/include]
>
> So it looks like --libdir is supposed to specify where libraries are to be
> *installed*, not where they are to be searched for.
>
> Further up in the help we have
>
> --prefix=PREFIX install architecture-independent files in PREFIX
> [/usr/local]
> --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
> [PREFIX]
>
> So libraries would already be installed in /usr/local/lib by default, unless
> you used a --prefix or --exec-prefix option to override that. Similarly for
> include files.
>
> If you need the program being built to search for libraries or include files
> in a certain place (such as /usr/local/include and /usr/local/lib, which are
> not searched by default on FreeBSD), AFAIK the right way to do it is to set
> the LIBRARY_PATH and C_INCLUDE_PATH (or CPLUS_INCLUDE_PATH) environment
> variables.
>
> --
>
> Nate Eldredge
> neldredge at math.ucsd.edu
>
Let's backup. What's the 'right' way to get a bloody linux program
that expects all it's headers in /usr/include to compile on freebsd
where all the headers are in /usr/local/include? That's all I'm
really asking. Specifically, it's looking for libusb & libftdi. If I
just type gmake, it can't find it, but if I manually edit the
Makefiles to add -I/usr/local/include, it can. Obviously, manually
editing the makefiles is *not* the right way to fix it (plus it's
driving me crazy).
Steve
Steve
More information about the freebsd-hackers
mailing list