Re: About software companion cd

From: Dave Uhring (daveuhring_at_yahoo.com)
Date: 02/28/05


Date: Mon, 28 Feb 2005 09:23:19 -0600

On Mon, 28 Feb 2005 21:54:37 +0700, Thone wrote:

> I just insalled Sofware Companio on Solaris10 x86. The software
> installation path is in /opt/. When I need to compile a program, it asks
> fo `gcc'. I know that gcc is installed then I can check for it and added
> it to the PATH. but it seems that some software require a lot more
> programs and libraries which resided in /opt/. Are there anyway to make
> it a default search path for both libs and programs? Or is it possible
> to install all of them into the default path (like /usr/lib...)

The runtime linker, /lib/ld.so.1, has a default search path of
/lib:/usr/lib. In order to inform the linker of alternate search paths
the header of the binary must contain those paths. This is done at
compile/link time by setting LDFLAGS appropriately.

If a properly constructed GNU configure script is in the sources the
user's environment will be read and LDFLAGS will be set appropriately. In
your ~/.profile or ~/.kshrc or ~/.bashrc

LDFLAGS='-L/opt/sfw/lib -R/opt/sfw/lib -L/usr/openwin/lib \
-R/usr/openwin/lib'
export LDFLAGS

The -L tells the compile time linker, /usr/ccs/bin/ld, where to find the
libraries; the -R tells the runtime linker where to find them.

If you find that you need to set LD_LIBRARY_PATH for *any* reason you have
failed to properly build your binaries.



Relevant Pages

  • Re: Cant find libgcc after building 1.4.1
    ... Add $(LDFLAGS) to SHLIB_EXPFLAGS ... GCC 3.2.3 ...or... ... Kerberos build 'prefix', ... src # export CC ...
    (comp.protocols.kerberos)
  • Ruby 1.8.7 (pl174) "make test" fails (floating point) *only* with default CFLAGS -O2
    ... no maintainer). ... I'm using GCC 4.4.1, DJDEV 2.04, etc. ... LDFLAGS = $(CFLAGS) -L. ...
    (comp.os.msdos.djgpp)
  • Re: arbitrary build cant find libs - right way to do this?
    ... The best way would be to write a port makefile and submit it. ... You don't givec me really enoough for me to go on, but I think really you need to know about 3 options to gcc ... The other two are options to add to the default search path. ... Above, it seems like you are using -l to add an include file path, this is wrong, you should use -I, -l is to specify specific libraries to link in, not a path to search for the libs in. ...
    (freebsd-questions)
  • Re: sys/ paths
    ... The above are perfectly standard #include directives. ... gcc accepts Unix style filename notation. ... I should download anything called Unixlib that isn't part of the ... directory called "sys" that is on the search path (and if that was not ...
    (comp.sys.acorn.programmer)
  • Re: Please help installing GCC on IRIX 6.5
    ... > Refresh my memory, how do I add those to my PATH again? ... you should read the release notes on from freeware ... By default the search path used by your system will not include the ... gcc 3.3 ...
    (comp.sys.sgi.admin)