This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: configure.in patch to support building newlib natively on x86 Linux
DJ Delorie wrote:
>>! case "$host" in
>>! i[3456]86-pc-linux*)
>>
>
>Why are you checking host here, instead of target? It shouldn't
>matter, but it looks funny to be checking $host to set target flags.
>
>Also, you can avoid replicating the default case if you do this
>instead:
>
> case "${target}-${is_cross_compiler}" in
> i[3456]86-pc-linux*-no)
>
>>! FLAGS_FOR_TARGET=`echo $FLAGS_FOR_TARGET | sed -e 's/-nostdinc/ /'`
>>
>
>That won't work if $FLAGS_FOR_TARGET starts with '-', which is likely.
>Echo will think it's an option for echo itself. You also don't take
>into account flags like -nostdinc++. How about this?
>
> FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
>
Thanks for the feedback!
Here's the second attempt (again, against 3.0.2):
*** configure.in.old Mon Aug 13 12:14:49 2001
--- configure.in Mon Dec 10 16:31:46 2001
***************
*** 1425,1434 ****
fi
fi
! # If we're building newlib, use its generic headers last, but search
! # for any libc-related directories first (so make it the last -B
! # switch).
! FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/
-isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem
$$s/newlib/libc/include'
;;
esac
;;
--- 1425,1444 ----
fi
fi
! case "${target}-${is_cross_compiler}" in
! i[3456]86-pc-linux*-no)
! # Here host == target, so we don't need to build gcc,
! # so we don't want to discard standard headers.
! FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/
-nostdinc / /'`
! FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/'
! ;;
! *)
! # If we're building newlib, use its generic headers last, but search
! # for any libc-related directories first (so make it the last -B
! # switch).
! FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET'
-B$$r/$(TARGET_SUBDIR)/newlib/ -isystem
$$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
! ;;
! esac
;;
esac
;;