Thanks Ian,
You are right. I source a script file (/etc/profile.d/xorg.sh listed below)
to define those variables.
1. Starting from a clean environment, before sourcing xorg.sh, gcc behaves
normally even with the 'specs' directory around.
pc3:~$ ls -ld specs
drwx--x--x 2 rlemieux users 2048 2010-05-25 07:52 specs
pc3:~$ set|grep LIBRARY_PATH
LD_LIBRARY_PATH=/opt/gcc/lib:
SCHEME_LIBRARY_PATH=/usr/local/lib/slib/
and none of LPATH or GCC_EXEC_PREFIX defined.
pc3:~$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/opt/gcc-4.4.1
Thread model: posix
gcc version 4.4.1 (GCC)
2. After I source xorg.sh, I get the problem. Indeed I define LIBRARY_PATH in
xorg.sh. However I add no path from the gcc tree in that process.
. /etc/profile.d/xorg.sh
pc3:~$ set|grep LIBRARY_PATH
LD_LIBRARY_PATH=/usr/X11/lib:/opt/gcc/lib:
LIBRARY_PATH=/usr/X11/lib:
SCHEME_LIBRARY_PATH=/usr/local/lib/slib/
and none of LPATH or GCC_EXEC_PREFIX defined.
pc3:~$ gcc -v
Reading specs from ./specs
gcc: ./specs: Is a directory
pc3:~$ echo $?
1
the content of /usr/X11/lib at this point looks like
pc3:~$ ls /usr/X11/lib
libXau.a libXau.so.6 libXdmcp.la libXdmcp.so.6.0.0
libXau.la libXau.so.6.0.0 libXdmcp.so pkgconfig
libXau.so libXdmcp.a libXdmcp.so.6 X11
3. The file I source is,
pc3:~$ cat /etc/profile.d/xorg.sh
#!/bin/sh
prefix=/usr/X11
export XORG_PREFIX="$prefix"
export XORG_CONFFLAGS="--prefix=$XORG_PREFIX --sysconfdir=/etc \
--mandir=$XORG_PREFIX/share/man --localstatedir=/var"
export PATH="$prefix/bin:$PATH"
export CPATH="$prefix/include:$CPATH"
#export CPLUS_INCLUDE_PATH="$prefix/include:$CPLUS_INCLUDE_PATH"
#export INFOPATH="$prefix/share/info:$INFOPATH"
export LIBRARY_PATH="$prefix/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$prefix/lib:$LD_LIBRARY_PATH"
export MANPATH="$prefix/man:$MANPATH"
#export webdir="$MANPATH/web"
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
#export CLASSPATH="$prefix/share/jar:$CLASSPATH"
I can see that I get into the problem because I define LIBRARY_PATH
but I still don't see how setting a path outside the gcc tree can
change the behavior of gcc.
Richard
Ian Lance Taylor wrote:
Richard Lemieux <rlemieu@xxxxxxxxxxxxx> writes:
pc3:~$ mkdir specs
pc3:~$ gcc -v
Reading specs from ./specs
gcc: ./specs: Is a directory
That is odd. gcc should not normally look in the current directory
for specs. Do you have LIBRARY_PATH or LPATH or GCC_EXEC_PREFIX set
in the environment when you run gcc?
Ian