This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Adjust compiler flags for multilibbed target libraries
On Jul 24, 2000, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Jul 22, 2000, Alexandre Oliva <aoliva@redhat.com> wrote:
>> When configuring/building target libraries, we used not to adjust
>> search paths so that target libraries would find headers or libraries
>> of the same multilib variant. This patch fixes this problem.
> Here's a simpler, revised patch. I had forgotten the arguments to
> expr should start with some letter to make sure they're not
> interpreted as switches.
Recent research :-) has demonstrated that `expr' is not as portable as
I had been told :-(
Here's a revised patch that uses `echo' instead of `expr', despite the
potential problem of `echo' interpreting backslashes as escape
sequences. Let's just hope we never get backslashes in these
pathnames.
Ok to install?
Index: ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config-ml.in: Adjust multilib search paths to the
appropriate multilib tree.
Index: config-ml.in
===================================================================
RCS file: /cvs/gcc/egcs/config-ml.in,v
retrieving revision 1.11
diff -u -r1.11 config-ml.in
--- config-ml.in 2000/07/24 04:29:33 1.11
+++ config-ml.in 2000/08/01 04:16:26
@@ -753,7 +753,38 @@
break
fi
done
- ml_config_env='CC="${CC} $flags"'
+ ml_config_env='CC="${CC_} $flags" CXX="${CXX_} $flags"'
+
+ if [ "${with_target_subdir}" = "." ]; then
+ CC_=$CC
+ CXX_=$CXX
+ else
+ popdir=`echo ${ML_POPDIR} | sed 's,.,.,g'`
+ CC_=
+ for arg in ${CC}; do
+ case $arg in
+ -[BIL]"${ML_POPDIR}"/*)
+ CC_="${CC_} "`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir}\\(.*\\)/\1/p"` ;;
+ "${ML_POPDIR}"/*)
+ CC_="${CC_} "`echo "X${arg}" | sed -n "s/X\\(${popdir}\\).*/\\1/p""`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir}\\(.*\\)/\\1/p"` ;;
+ *)
+ CC_="${CC_} ${arg}" ;;
+ esac
+ done
+
+ CXX_=
+ for arg in ${CXX}; do
+ case $arg in
+ -[BIL]"${ML_POPDIR}"/*)
+ CXX_="${CXX_} "`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir}\\(.*\\)/\\1/p"` ;;
+ "${ML_POPDIR}"/*)
+ CXX_="${CXX_} "`echo "X${arg}" | sed -n "s/X\\(${popdir}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir}\\(.*\\)/\\1/p"` ;;
+ *)
+ CXX_="${CXX_} ${arg}" ;;
+ esac
+ done
+
+ fi
if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me