Re: Library path for compiling/linking
On Mon, Jun 16, 2008 at 12:42:53PM +0200, Joerg Sonnenberger wrote: On Mon, Jun 16, 2008 at 03:25:56AM -0500, Vincent wrote: Does anybody know how to add library search paths to the environment for compiling on Dragonfly without having to specify paths with -L on the command line? It is not possible without hacking GCC itself or overriding the spec file. Essentially, don't do this. Joerg Thanks Joerg. Hmm. I also tried export LIBRARY_PATH=/usr/pkg/lib. That did not work either, even though the manual on *gcc* says LIBRARY_PATH The value of LIBRARY_PATH is a colon-separated list of directories, much like PATH. When configured as a native compiler, GCC tries the directories thus specified when searching for special linker files, if it can't find them using GCC_EXEC_PREFIX. Linking using GCC also uses these directories when searching for ordinary libraries for the -l option (but directories specified with -L come first). Previously, setting the library path in the environment has allowed a lot of packages to compile without special configure options on systems such as NetBSD. Is this deliberately disabled for GCC on Dragonfly? Or is it something that is temporarily broken?
Re: Library path for compiling/linking
On Tue, Jun 17, 2008 at 01:39:59AM -0500, Vincent wrote: Previously, setting the library path in the environment has allowed a lot of packages to compile without special configure options on systems such as NetBSD. Is this deliberately disabled for GCC on Dragonfly? Or is it something that is temporarily broken? Never used that and all I tried failed very badly when I needed it. Consider using a wrapper script for cc/c++ instead. Joerg
Library path for compiling/linking
Does anybody know how to add library search paths to the environment for compiling on Dragonfly without having to specify paths with -L on the command line? This works fine $ cc -Wall -g -o testrun -L/usr/pkg/lib -lxslt testrun.c but without -L it fails $ cc -Wall -g -o testrun -lxslt testrun.c /usr/libexec/binutils217/elf/ld: cannot find -lxslt I have LD_LIBRARY_PATH set. $ env | grep LD_LIB LD_LIBRARY_PATH=/usr/local/lib:/usr/pkg/lib LD_LIBRARY_PATH worked for me before on NetBSD and, if I remember correctly, Linux and FreeBSD as well. It is still the same variable that the man page for ld on Dragonfly still says to use. The man page for ld also says The linker uses the following search paths to locate required shared libraries. 8. For a native linker on an ELF system, if the file /etc/ld.so.conf exists, the list of directories found in that file. Which, on Dragonfly, appears to actually be /etc/ld-elf.so.conf. Adding paths to this file seems to work for runtime linking, but not compile time.