Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2002 12:23:27 +0930
From:      Greg 'groggy' Lehey <grog@FreeBSD.org>
To:        Peter Wemm <peter@wemm.org>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: Why don't we search /usr/local/lib and /usr/local/include by default?
Message-ID:  <20020529122327.C82424@wantadilla.lemis.com>
In-Reply-To: <20020529012544.14816380A@overcee.wemm.org>
References:  <20020529093009.C31668@wantadilla.lemis.com> <20020529012544.14816380A@overcee.wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, 28 May 2002 at 18:25:44 -0700, Peter Wemm wrote:
> "Greg 'groggy' Lehey" wrote:
>> On Tuesday, 28 May 2002 at  8:42:48 -0700, David O'Brien wrote:
>>> On Tue, May 28, 2002 at 02:34:44PM +0930, Greg 'groggy' Lehey wrote:
>>>> I've just had a question from some friends in the Linux space about
>>>> why we install additional libraries in /usr/local/lib and their header
>>>> files in /usr/local/include, but gcc by default only searches
>>>> /usr/local/libexec and /usr/local/lib for libraries and /usr/include
>>>
>>> The system GCC searching any part of /usr/local is a bug.  It is not
>>> [ports] PREFIX clean.
>>
>> So how would you recommend we solve the issue?
>
> Err, what issue?  gcc does not search /usr/local anywhere.

Correct.  As obrien observed, I mean to say 

> gcc by default only searches /usr/libexec and /usr/lib for
> libraries...

>>> The system GCC searching any part of /usr/local is a bug.  It is not
>>> [ports] PREFIX clean.
>
> peter@daintree[6:22pm]/tmp-106> ls -l /usr/local/include/jerror.h
> -r--r--r--  1 root  wheel  13936 May 28 16:52 /usr/local/include/jerror.h
> peter@daintree[6:22pm]/tmp-107> cc -c foo.c
> foo.c:1:20: jerror.h: No such file or directory
> peter@daintree[6:22pm]/tmp-108> grep jerror foo.c
> #include <jerror.h>
>
> and
>
> eter@daintree[6:23pm]/tmp-113> ls -l /usr/local/lib | grep libxml
> -rw-r--r--  1 root  wheel   523838 Apr 17 04:23 libxml.a
> lrwxr-xr-x  1 root  wheel       11 May 21 19:08 libxml.so@ -> libxml.so.5
> -rwxr-xr-x  1 root  wheel   495202 Apr 17 04:23 libxml.so.5*
> peter@daintree[6:23pm]/tmp-114> cc -o foo foo.c -lxml
> /usr/libexec/elf/ld: cannot find -lxml
>
> Yes, /usr/local/lib is on my ldconfig path.

Right, but ldconfig is used only at run time.  gcc -v shows (not
surprisingly) that the /usr/local hierarchy is ignored.

> peter@daintree[6:24pm]/tmp-120> ldconfig -r | head -2
> /var/run/ld-elf.so.hints:
>         search directories: /usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib
>
> This is working exactly as designed.  Your email suggests you found a bug
> in the implementation of this..  Or are you complaining about the design
> itself?

I'm complaining about the implementation.  Since the Ports Collection
installs by default in /usr/local, it seems reasonable to at least put
these directories at the end of the search paths for header files and
libraries.

>>> (you have typos above about /usr/local/libexec don't you?)
>>
>> Yes, sorry.

This is where you put obrien's reference to my typos.

Greg
--
See complete headers for address and phone numbers

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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