Commit aca600aa by Andrew Stubbs Committed by Andrew Stubbs

configure.ac: Add new AC_SUBST for TM_ENDIAN_CONFIG...

2009-04-17  Andrew Stubbs  <ams@codesourcery.com>

	* configure.ac: Add new AC_SUBST for TM_ENDIAN_CONFIG,
	TM_MULTILIB_CONFIG and TM_MULTILIB_EXCEPTIONS_CONFIG.
	(--with-multilib-list): Add default value.
	* configure: Regenerate.
	* Makefile.in (TM_ENDIAN_CONFIG): Define.
	(TM_MULTILIB_CONFIG, TM_MULTILIB_EXCEPTIONS_CONFIG): Define.
	* config.gcc (sh-*-*): Switch to using TM_ENDIAN_CONFIG,
	TM_MULTILIB_CONFIG, and TM_MULTILIB_EXCEPTIONS_CONFIG.
	Don't add default cpu to multilib list unnecessarily, but do enable
	the relevant compiler option..
	Add support for --with-multilib-list=<blank> and
	--with-multilib-list=!<somelib> to supress unwanted multilibs.
	* config/sh/t-sh (DEFAULT_ENDIAN, OTHER_ENDIAN): New variables.
	(MULTILIB_ENDIAN, MULTILIB_CPUS): Delete variables.
	(MULTILIB_OPTIONS): Redefine using OTHER_ENDIAN and
	TM_MULTILIB_CONFIG.
	(MULTILIB_EXCEPTIONS): Add TM_MULTILIB_EXCEPTIONS_CONFIG.
	(MULTILIB_OSDIRNAMES): New variable.
	* config/sh/t-1e: Delete file.
	* config/sh/t-mlib-sh1: Delete file.
	* config/sh/t-mlib-sh2: Delete file.
	* config/sh/t-mlib-sh2a: Delete file.
	* config/sh/t-mlib-sh2a-nofpu: Delete file.
	* config/sh/t-mlib-sh2a-single: Delete file.
	* config/sh/t-mlib-sh2a-single-only: Delete file.
	* config/sh/t-mlib-sh2e: Delete file.
	* config/sh/t-mlib-sh3e: Delete file.
	* config/sh/t-mlib-sh4: Delete file.
	* config/sh/t-mlib-sh4-nofpu: Delete file.
	* config/sh/t-mlib-sh4-single: Delete file.
	* config/sh/t-mlib-sh4-single-only: Delete file.
	* config/sh/t-mlib-sh4a: Delete file.
	* config/sh/t-mlib-sh4a-nofpu: Delete file.
	* config/sh/t-mlib-sh4a-single: Delete file.
	* config/sh/t-mlib-sh4a-single-only: Delete file.
	* config/sh/t-mlib-sh4al: Delete file.
	* config/sh/t-mlib-sh5-32media: Delete file.
	* config/sh/t-mlib-sh5-32media-nofpu: Delete file.
	* config/sh/t-mlib-sh5-64media: Delete file.
	* config/sh/t-mlib-sh5-64media-nofpu: Delete file.
	* config/sh/t-mlib-sh5-compact: Delete file.
	* config/sh/t-mlib-sh5-compact-nofpu: Delete file.
	* config/sh/t-linux: Don't override MULTILIB_EXCEPTIONS.
	* doc/install.texi (Options specification): Add
	--with-multilib-list and --with-endian.

From-SVN: r146278
parent 105ab5db
2009-04-17 Andrew Stubbs <ams@codesourcery.com>
* configure.ac: Add new AC_SUBST for TM_ENDIAN_CONFIG,
TM_MULTILIB_CONFIG and TM_MULTILIB_EXCEPTIONS_CONFIG.
(--with-multilib-list): Add default value.
* configure: Regenerate.
* Makefile.in (TM_ENDIAN_CONFIG): Define.
(TM_MULTILIB_CONFIG, TM_MULTILIB_EXCEPTIONS_CONFIG): Define.
* config.gcc (sh-*-*): Switch to using TM_ENDIAN_CONFIG,
TM_MULTILIB_CONFIG, and TM_MULTILIB_EXCEPTIONS_CONFIG.
Don't add default cpu to multilib list unnecessarily, but do enable
the relevant compiler option..
Add support for --with-multilib-list=<blank> and
--with-multilib-list=!<somelib> to supress unwanted multilibs.
* config/sh/t-sh (DEFAULT_ENDIAN, OTHER_ENDIAN): New variables.
(MULTILIB_ENDIAN, MULTILIB_CPUS): Delete variables.
(MULTILIB_OPTIONS): Redefine using OTHER_ENDIAN and
TM_MULTILIB_CONFIG.
(MULTILIB_EXCEPTIONS): Add TM_MULTILIB_EXCEPTIONS_CONFIG.
(MULTILIB_OSDIRNAMES): New variable.
* config/sh/t-1e: Delete file.
* config/sh/t-mlib-sh1: Delete file.
* config/sh/t-mlib-sh2: Delete file.
* config/sh/t-mlib-sh2a: Delete file.
* config/sh/t-mlib-sh2a-nofpu: Delete file.
* config/sh/t-mlib-sh2a-single: Delete file.
* config/sh/t-mlib-sh2a-single-only: Delete file.
* config/sh/t-mlib-sh2e: Delete file.
* config/sh/t-mlib-sh3e: Delete file.
* config/sh/t-mlib-sh4: Delete file.
* config/sh/t-mlib-sh4-nofpu: Delete file.
* config/sh/t-mlib-sh4-single: Delete file.
* config/sh/t-mlib-sh4-single-only: Delete file.
* config/sh/t-mlib-sh4a: Delete file.
* config/sh/t-mlib-sh4a-nofpu: Delete file.
* config/sh/t-mlib-sh4a-single: Delete file.
* config/sh/t-mlib-sh4a-single-only: Delete file.
* config/sh/t-mlib-sh4al: Delete file.
* config/sh/t-mlib-sh5-32media: Delete file.
* config/sh/t-mlib-sh5-32media-nofpu: Delete file.
* config/sh/t-mlib-sh5-64media: Delete file.
* config/sh/t-mlib-sh5-64media-nofpu: Delete file.
* config/sh/t-mlib-sh5-compact: Delete file.
* config/sh/t-mlib-sh5-compact-nofpu: Delete file.
* config/sh/t-linux: Don't override MULTILIB_EXCEPTIONS.
* doc/install.texi (Options specification): Add
--with-multilib-list and --with-endian.
2009-04-17 Rafael Avila de Espindola <espindola@google.com>
* Makefile.in (REVISION_s): Always include quotes. Change ifdef to use
......
......@@ -403,6 +403,9 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
xmake_file=@xmake_file@
tmake_file=@tmake_file@
TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
out_file=$(srcdir)/config/@out_file@
out_object_file=@out_object_file@
md_file=$(srcdir)/config/@md_file@
......
......@@ -1989,9 +1989,14 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
*) with_endian=big,little ;;
esac
fi
# TM_ENDIAN_CONFIG is used by t-sh to determine multilibs.
# First word : the default endian.
# Second word: the secondary endian (optional).
case ${with_endian} in
big|little) tmake_file="${tmake_file} sh/t-1e" ;;
big,little|little,big) ;;
big) TM_ENDIAN_CONFIG=mb ;;
little) TM_ENDIAN_CONFIG=ml ;;
big,little) TM_ENDIAN_CONFIG="mb ml" ;;
little,big) TM_ENDIAN_CONFIG="ml mb" ;;
*) echo "with_endian=${with_endian} not supported."; exit 1 ;;
esac
case ${with_endian} in
......@@ -2101,7 +2106,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
*) echo "with_cpu=$with_cpu not supported"; exit 1 ;;
esac
sh_multilibs=${with_multilib_list}
if test x${sh_multilibs} = x ; then
if test "$sh_multilibs" = "default" ; then
case ${target} in
sh64-superh-linux* | \
sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
......@@ -2117,25 +2122,32 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
fi
target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
sh_multilibs=`echo $sh_multilibs,$sh_cpu_default | sed -e 's/[ ,/][ ,]*/ /g' -e 's/ $//' -e 's/^m/sh/' -e 's/ m/ sh/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^sh/m/i' -e 's/ sh/ m/gi' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
for sh_multilib in ${sh_multilibs}; do
case ${sh_multilib} in
sh1 | sh2 | sh2e | sh3 | sh3e | \
sh4 | sh4-single | sh4-single-only | sh4-nofpu | sh4-300 |\
sh4a | sh4a-single | sh4a-single-only | sh4a-nofpu | sh4al | \
sh2a | sh2a-single | sh2a-single-only | sh2a-nofpu | \
sh5-64media | sh5-64media-nofpu | \
sh5-32media | sh5-32media-nofpu | \
sh5-compact | sh5-compact-nofpu)
tmake_file="${tmake_file} sh/t-mlib-${sh_multilib}"
tm_defines="$tm_defines SUPPORT_`echo $sh_multilib|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
m1 | m2 | m2e | m3 | m3e | \
m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
m2a | m2a-single | m2a-single-only | m2a-nofpu | \
m5-64media | m5-64media-nofpu | \
m5-32media | m5-32media-nofpu | \
m5-compact | m5-compact-nofpu)
# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
# It is passed to MULTIILIB_OPTIONS verbatim.
TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
;;
\!*) # TM_MULTILIB_EXCEPTIONS_CONFIG is used by t-sh
# It is passed the MULTILIB_EXCEPTIONS verbatim.
TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} `echo $sh_multilib | sed 's/^!//'`" ;;
*)
echo "with_multilib_list=${sh_multilib} not supported."
exit 1
;;
esac
done
TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
if test x${enable_incomplete_targets} = xyes ; then
tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1"
fi
......
......@@ -4,6 +4,5 @@ LIB2FUNCS_EXTRA= $(srcdir)/config/sh/linux-atomic.asm
MULTILIB_DIRNAMES=
MULTILIB_MATCHES =
MULTILIB_EXCEPTIONS=
EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
ML_sh2a_single_only=m2a-single-only/
ML_sh4_single_only=m4-single-only/
ML_sh4a_single_only=m4a-single-only/
ML_sh5_32media_nofpu=m5-32media-nofpu/
ML_sh5_64media_nofpu=m5-64media-nofpu/
ML_sh5_compact_nofpu=m5-compact-nofpu/
......@@ -27,10 +27,10 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#endif' >> fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
MULTILIB_ENDIAN = ml/mb
MULTILIB_CPUS= $(ML_sh1)$(ML_sh2a)$(ML_sh2a_nofpu)$(ML_sh2a_single_only)$(ML_sh2a_single)$(ML_sh2e)$(ML_sh2)$(ML_sh3e)$(ML_sh3)$(ML_sh4_nofpu)$(ML_sh4_single_only)$(ML_sh4_single)$(ML_sh4)$(ML_sh4a_nofpu)$(ML_sh4a_single_only)$(ML_sh4a_single)$(ML_sh4a)$(ML_sh5_32media)$(ML_sh5_32media_nofpu)$(ML_sh5_compact)$(ML_sh5_compact_nofpu)$(ML_sh5_64media)$(ML_sh5_64media_nofpu)
DEFAULT_ENDIAN = $(word 1,$(TM_ENDIAN_CONFIG))
OTHER_ENDIAN = $(word 2,$(TM_ENDIAN_CONFIG))
MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) $(MULTILIB_CPUS:/=)
MULTILIB_OPTIONS= $(OTHER_ENDIAN) $(TM_MULTILIB_CONFIG)
MULTILIB_DIRNAMES=
# The separate entries for m2a-nofpu and m2a-single-only with
......@@ -58,7 +58,34 @@ MULTILIB_MATCHES = $(shell \
done)
# SH1 only supports big endian.
MULTILIB_EXCEPTIONS = ml/m1 ml/m2a*
MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
MULTILIB_OSDIRNAMES = \
$(OTHER_ENDIAN)=!$(OTHER_ENDIAN) \
m1=!m1 $(OTHER_ENDIAN)/m1=!$(OTHER_ENDIAN)/m1 \
m2a=!m2a $(OTHER_ENDIAN)/m2a=!$(OTHER_ENDIAN)/m2a \
m2a-nofpu=!m2a-nofpu $(OTHER_ENDIAN)/m2a-nofpu=!$(OTHER_ENDIAN)/m2a-nofpu \
m2a-single-only=!m2a-single-only $(OTHER_ENDIAN)/m2a-single-only=!$(OTHER_ENDIAN)/m2a-single-only \
m2a-single=!m2a-single $(OTHER_ENDIAN)/m2a-single=!$(OTHER_ENDIAN)/m2a-single \
m2e=!m2e $(OTHER_ENDIAN)/m2e=!$(OTHER_ENDIAN)/m2e \
m2=!m2 $(OTHER_ENDIAN)/m2=!$(OTHER_ENDIAN)/m2 \
m3e=!m3e $(OTHER_ENDIAN)/m3e=!$(OTHER_ENDIAN)/m3e \
m3=!m3 $(OTHER_ENDIAN)/m3=!$(OTHER_ENDIAN)/m3 \
m4-nofpu=!m4-nofpu $(OTHER_ENDIAN)/m4-nofpu=!$(OTHER_ENDIAN)/m4-nofpu \
m4-single-only=!m4-single-only $(OTHER_ENDIAN)/m4-single-only=!$(OTHER_ENDIAN)/m4-single-only \
m4-single=!m4-single $(OTHER_ENDIAN)/m4-single=!$(OTHER_ENDIAN)/m4-single \
m4=!m4 $(OTHER_ENDIAN)/m4=!$(OTHER_ENDIAN)/m4 \
m4a-nofpu=!m4a-nofpu $(OTHER_ENDIAN)/m4a-nofpu=!$(OTHER_ENDIAN)/m4a-nofpu \
m4a-single-only=!m4a-single-only $(OTHER_ENDIAN)/m4a-single-only=!$(OTHER_ENDIAN)/m4a-single-only \
m4a-single=!m4a-single $(OTHER_ENDIAN)/m4a-single=!$(OTHER_ENDIAN)/m4a-single \
m4a=!m4a $(OTHER_ENDIAN)/m4a=!$(OTHER_ENDIAN)/m4a \
m4al=!m4al $(OTHER_ENDIAN)/m4al=!$(OTHER_ENDIAN)/m4al \
m5-32media=!m5-32media $(OTHER_ENDIAN)/m5-32media=!$(OTHER_ENDIAN)/m5-32media \
m5-32media-nofpu=!m5-32media-nofpu $(OTHER_ENDIAN)/m5-32media-nofpu=!$(OTHER_ENDIAN)/m5-32media-nofpu \
m5-compact=!m5-compact $(OTHER_ENDIAN)/m5-compact=!$(OTHER_ENDIAN)/m5-compact \
m5-compact-nofpu=!m5-compact-nofpu $(OTHER_ENDIAN)/m5-compact-nofpu=!$(OTHER_ENDIAN)/m5-compact-nofpu \
m5-64media=!m5-64media $(OTHER_ENDIAN)/m5-64media=!$(OTHER_ENDIAN)/m5-64media \
m5-64media-nofpu=!m5-64media-nofpu $(OTHER_ENDIAN)/m5-64media-nofpu=!$(OTHER_ENDIAN)/m5-64media-nofpu
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
......
......@@ -810,6 +810,11 @@ AC_SUBST(datarootdir)
AC_SUBST(docdir)
AC_SUBST(htmldir)
AC_ARG_WITH(multilib-list,
[ --with-multilib-list Select multilibs (SH only)],
:,
with_multilib_list=default)
# -------------------------
# Checks for other programs
# -------------------------
......@@ -3879,6 +3884,9 @@ AC_SUBST(check_languages)
AC_SUBST(cpp_install_dir)
AC_SUBST(xmake_file)
AC_SUBST(tmake_file)
AC_SUBST(TM_ENDIAN_CONFIG)
AC_SUBST(TM_MULTILIB_CONFIG)
AC_SUBST(TM_MULTILIB_EXCEPTIONS_CONFIG)
AC_SUBST(extra_gcc_objs)
AC_SUBST(extra_headers_list)
AC_SUBST(extra_objs)
......
......@@ -983,6 +983,57 @@ sysv, aix.
@end table
@item --with-multilib-list=@var{list}
@itemx --without-multilib-list
Specify what multilibs to build.
Currently only implemented for sh*-*-*.
@var{list} is a comma separated list of CPU names. These must be of the
form @code{sh*} or @code{m*} (in which case they match the compiler option
for that processor). The list should not contain any endian options -
these are handled by @option{--with-endian}.
If @var{list} is empty, then there will be no multilibs for extra
processors. The multilib for the secondary endian remains enabled.
As a special case, if an entry in the list starts with a @code{!}
(exclamation point), then it is added to the list of excluded multilibs.
Entries of this sort should be compatible with @samp{MULTILIB_EXCLUDES}
(once the leading @code{!} has been stripped).
If @option{--with-multilib-list} is not given, then a default set of
multilibs is selected based on the value of @option{--target}. This is
usually the complete set of libraries, but some targets imply a more
specialized subset.
Example 1: to configure a compiler for SH4A only, but supporting both
endians, with little endian being the default:
@smallexample
--with-cpu=sh4a --with-endian=little,big --with-multilib-list=
@end smallexample
Example 2: to configure a compiler for both SH4A and SH4AL-DSP, but with
only little endian SH4AL:
@smallexample
--with-cpu=sh4a --with-endian=little,big --with-multilib-list=sh4al,!mb/m4al
@end smallexample
@item --with-endian=@var{endians}
Specify what endians to use.
Currently only implemented for sh*-*-*.
@var{endians} may be one of the following:
@table @code
@item big
Use big endian exclusively.
@item little
Use little endian exclusively.
@item big,little
Use big endian by default. Provide a multilib for little endian.
@item little,big
Use little endian by default. Provide a multilib for big endian.
@end table
@item --enable-threads
Specify that the target
supports threads. This affects the Objective-C compiler and runtime
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment