Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Oct 2008 12:30:46 -0700
From:      "Steve Franks" <stevefranks@ieee.org>
To:        "Nate Eldredge" <neldredge@math.ucsd.edu>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: includes, configure, /usr/lib vs. /usr/local/lib, and linux coders
Message-ID:  <539c60b90810311230i11460966la7ff35b0093642ec@mail.gmail.com>
In-Reply-To: <Pine.GSO.4.64.0810311154030.16737@zeno.ucsd.edu>
References:  <539c60b90810311123w2aa94b8akcd0a5d0fe791885a@mail.gmail.com> <Pine.GSO.4.64.0810311154030.16737@zeno.ucsd.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 31, 2008 at 12:11 PM, Nate Eldredge <neldredge@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?539c60b90810311230i11460966la7ff35b0093642ec>