This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Compiling GCC with -rpath
- To: gcc-help at gcc dot gnu dot org
- Subject: Compiling GCC with -rpath
- From: Mike Pelley <mike at solidum dot com>
- Date: Thu, 23 Aug 2001 10:50:07 -0400
- Organization: Solidum Systems Corp.
I'm trying to compile GCC (c,c++,java) with -rpath and -L flags to link
against the proper runtime libraries. My thought was to set
CFLAGS="-L${LIB_DIR}/lib -Wl,-rpath,${LIB_DIR}/lib"
ldd shows me that these flags create executables that are linking
against the proper libraries and they work well. However, I noticed my
gcj is incorrectly linked against /lib libraries. I figured this was
because it was c++ code, so CFLAGS wouldn't apply. No problem, just set
CPPFLAGS="-L${LIB_DIR}/lib -Wl,-rpath,${LIB_DIR}/lib".
However, a lot of the compile lines include both CFLAGS and CPPFLAGS and
the make dies if the flags are included twice. How can I have these
flags applied against each dynamically linked executable only once?
Thanks! Mike.