GMP and MPFR are no longer a sub-component of gcc (config-wise).

Build and install GMP and MPFR for the target.
Use the target GMP and MPFR to build the native gdb.
Have separate extra_config for cross gdb, native gdb and gdbserver.
Check native GMP and MPFR in //.

 /trunk/scripts/build/debug/300-gdb.sh |   27    19     8     0 ++++++++++++++++-------
 /trunk/scripts/build/gmp.sh           |   47    39     8     0 ++++++++++++++++++++++++++++++++-------
 /trunk/scripts/build/mpfr.sh          |   49    40     9     0 +++++++++++++++++++++++++++++++++--------
 /trunk/steps.mk                       |    2     2     0     0 ++
 /trunk/config/cc/gcc.in               |   18     1    17     0 +--------------
 /trunk/config/debug/gdb.in            |    6     1     5     0 +----
 /trunk/config/config.in               |    1     1     0     0 +
 /trunk/config/gmp_mpfr.in             |   34    34     0     0 ++++++++++++++++++++++++++++
 8 files changed, 137 insertions(+), 47 deletions(-)
This commit is contained in:
Yann E. MORIN" 2008-06-20 15:16:43 +00:00
parent aec9074b72
commit 1b00a301bd
8 changed files with 137 additions and 47 deletions

View File

@ -120,7 +120,7 @@ config CC_VERSION
config CC_GCC_4_3_or_later config CC_GCC_4_3_or_later
bool bool
default n default n
select CC_GCC_GMP_MPFR select GMP_MPFR
config CC_CXA_ATEXIT config CC_CXA_ATEXIT
bool bool
@ -166,19 +166,3 @@ config CC_BUGURL
default "" default ""
help help
Specify the URL that users should visit if they wish to report a bug. Specify the URL that users should visit if they wish to report a bug.
menuconfig CC_GCC_GMP_MPFR
bool
prompt "GMP and MPFR"
help
Recent gcc needs both GMP and MPFR to build some frontends.
Say 'Y' here if you want to build those two libraries specifically
for crosstool-NG.
Saying 'Y' is highly recommended if building gcc-4.3 or higher.
if CC_GCC_GMP_MPFR
source config/cc/gmp.in
source config/cc/mpfr.in
endif

View File

@ -2,6 +2,7 @@ source config/global.in
source config/target.in source config/target.in
source config/toolchain.in source config/toolchain.in
source config/kernel.in source config/kernel.in
source config/gmp_mpfr.in
source config/binutils.in source config/binutils.in
source config/cc.in source config/cc.in
source config/libc.in source config/libc.in

View File

@ -33,6 +33,7 @@ config GDB_NATIVE
bool bool
prompt "Native gdb" prompt "Native gdb"
default n default n
select GMP_MPFR_TARGET if GMP_MPFR
help help
Build and install a native gdb for the target, to run on the target. Build and install a native gdb for the target, to run on the target.
@ -123,10 +124,6 @@ choice
bool bool
prompt "ncurses version" prompt "ncurses version"
config NCURSES_V_4_2
bool
prompt "4.2"
config NCURSES_V_5_6 config NCURSES_V_5_6
bool bool
prompt "5.6" prompt "5.6"
@ -135,7 +132,6 @@ endchoice
config NCURSES_VERSION config NCURSES_VERSION
string string
default "4.2" if NCURSES_V_4_2
default "5.6" if NCURSES_V_5_6 default "5.6" if NCURSES_V_5_6
endif # GDB_NATIVE --> ncurses endif # GDB_NATIVE --> ncurses

34
config/gmp_mpfr.in Normal file
View File

@ -0,0 +1,34 @@
# GMP and MPFR libraries config options
menu "GMP and MPFR"
config GMP_MPFR
bool
prompt "GMP and MPFR"
help
Recent gcc needs both GMP and MPFR to build some frontends.
Say 'Y' here if you want to build those two libraries specifically
for crosstool-NG.
The packages that can use GMP and MPFR are:
- binutils
- gcc
- gdb
config GMP_MPFR_TARGET
bool
prompt "Build libraries for the target"
depends on GMP_MPFR
default n
help
Also build libraries for the target. This can be usefull if you want
to later build a compiler that will run on the target, or if you want
to run gdb natively on the target.
if GMP_MPFR
source config/cc/gmp.in
source config/cc/mpfr.in
endif
endmenu

View File

@ -51,12 +51,13 @@ do_debug_gdb_build() {
mkdir -p "${CT_BUILD_DIR}/build-gdb-cross" mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
cd "${CT_BUILD_DIR}/build-gdb-cross" cd "${CT_BUILD_DIR}/build-gdb-cross"
cross_extra_config="${extra_config}"
if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then
extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}" cross_extra_config="${cross_extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
fi fi
case "${CT_THREADS}" in case "${CT_THREADS}" in
none) extra_config="${extra_config} --disable-threads";; none) cross_extra_config="${cross_extra_config} --disable-threads";;
*) extra_config="${extra_config} --enable-threads";; *) cross_extra_config="${cross_extra_config} --enable-threads";;
esac esac
CC_for_gdb= CC_for_gdb=
@ -66,6 +67,8 @@ do_debug_gdb_build() {
LD_for_gdb="ld -static" LD_for_gdb="ld -static"
fi fi
CT_DoLog DEBUG "Extra config passed: '${cross_extra_config# }'"
CC="${CC_for_gdb}" \ CC="${CC_for_gdb}" \
LD="${LD_for_gdb}" \ LD="${LD_for_gdb}" \
"${gdb_src_dir}/configure" \ "${gdb_src_dir}/configure" \
@ -74,7 +77,7 @@ do_debug_gdb_build() {
--target=${CT_TARGET} \ --target=${CT_TARGET} \
--prefix="${CT_PREFIX_DIR}" \ --prefix="${CT_PREFIX_DIR}" \
--with-build-sysroot="${CT_SYSROOT_DIR}" \ --with-build-sysroot="${CT_SYSROOT_DIR}" \
${extra_config} 2>&1 |CT_DoLog ALL ${cross_extra_config} 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Building cross-gdb" CT_DoLog EXTRA "Building cross-gdb"
make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
@ -123,10 +126,14 @@ do_debug_gdb_build() {
mkdir -p "${CT_BUILD_DIR}/build-gdb-native" mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
cd "${CT_BUILD_DIR}/build-gdb-native" cd "${CT_BUILD_DIR}/build-gdb-native"
native_extra_config="${extra_config}"
case "${CT_THREADS}" in case "${CT_THREADS}" in
none) extra_config="${extra_config} --disable-threads";; none) native_extra_config="${native_extra_config} --disable-threads";;
*) extra_config="${extra_config} --enable-threads";; *) native_extra_config="${native_extra_config} --enable-threads";;
esac esac
if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
native_extra_config="${native_extra_config} --with-gmp=${CT_SYSROOT_DIR}/usr --with-mpfr=${CT_SYSROOT_DIR}/usr"
fi
CC_for_gdb= CC_for_gdb=
LD_for_gdb= LD_for_gdb=
@ -137,6 +144,8 @@ do_debug_gdb_build() {
export ac_cv_func_strncmp_works=yes export ac_cv_func_strncmp_works=yes
CT_DoLog DEBUG "Extra config passed: '${native_extra_config# }'"
CC="${CC_for_gdb}" \ CC="${CC_for_gdb}" \
LD="${LD_for_gdb}" \ LD="${LD_for_gdb}" \
"${gdb_src_dir}/configure" \ "${gdb_src_dir}/configure" \
@ -153,7 +162,7 @@ do_debug_gdb_build() {
--disable-werror \ --disable-werror \
--without-included-gettext \ --without-included-gettext \
--without-develop \ --without-develop \
${extra_config} 2>&1 |CT_DoLog ALL ${native_extra_config} 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Building native gdb" CT_DoLog EXTRA "Building native gdb"
make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
@ -186,6 +195,8 @@ do_debug_gdb_build() {
gdbserver_LDFLAGS=-static gdbserver_LDFLAGS=-static
fi fi
gdbserver_extra_config="${extra_config}"
LDFLAGS="${gdbserver_LDFLAGS}" \ LDFLAGS="${gdbserver_LDFLAGS}" \
"${gdb_src_dir}/gdb/gdbserver/configure" \ "${gdb_src_dir}/gdb/gdbserver/configure" \
--build=${CT_BUILD} \ --build=${CT_BUILD} \
@ -203,7 +214,7 @@ do_debug_gdb_build() {
--without-x \ --without-x \
--without-included-gettext \ --without-included-gettext \
--without-develop \ --without-develop \
${extra_config} 2>&1 |CT_DoLog ALL ${gdbserver_extra_config} 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Building gdbserver" CT_DoLog EXTRA "Building gdbserver"
make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL

View File

@ -2,9 +2,17 @@
# Copyright 2008 Yann E. MORIN # Copyright 2008 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package # Licensed under the GPL v2. See COPYING in the root of this package
if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then do_print_filename() { :; }
do_gmp_get() { :; }
do_gmp_extract() { :; }
do_gmp() { :; }
do_gmp_target() { :; }
# Overide functions depending on configuration
if [ "${CT_GMP_MPFR}" = "y" ]; then
do_print_filename() { do_print_filename() {
[ "${CT_GMP_MPFR}" = "y" ] || return 0
echo "gmp-${CT_GMP_VERSION}" echo "gmp-${CT_GMP_VERSION}"
} }
@ -38,7 +46,7 @@ do_gmp() {
if [ "${CT_GMP_CHECK}" = "y" ]; then if [ "${CT_GMP_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking GMP" CT_DoLog EXTRA "Checking GMP"
make -s check 2>&1 |CT_DoLog ALL make ${PARALLELMFLAGS} -s check 2>&1 |CT_DoLog ALL
fi fi
CT_DoLog EXTRA "Installing GMP" CT_DoLog EXTRA "Installing GMP"
@ -47,11 +55,34 @@ do_gmp() {
CT_EndStep CT_EndStep
} }
else # Mo GMP if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
do_print_filename() { :; } do_gmp_target() {
do_gmp_get() { :; } mkdir -p "${CT_BUILD_DIR}/build-gmp-target"
do_gmp_extract() { :; } cd "${CT_BUILD_DIR}/build-gmp-target"
do_gmp() { :; }
fi CT_DoStep INFO "Installing GMP for the target"
CT_DoLog EXTRA "Configuring GMP"
CFLAGS="${CT_CFLAGS_FOR_TARGET}" \
"${CT_SRC_DIR}/${CT_GMP_FILE}/configure" \
--build=${CT_BUILD} \
--host=${CT_TARGET} \
--prefix=/usr \
--disable-shared --enable-static \
--enable-fft --enable-mpbsd 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Building GMP"
make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
# Not possible to check MPFR while X-compiling
CT_DoLog EXTRA "Installing GMP"
make DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
CT_EndStep
}
fi # CT_GMP_MPFR_TARGET == y
fi # CT_GMP_MPFR == y

View File

@ -2,10 +2,17 @@
# Copyright 2008 Yann E. MORIN # Copyright 2008 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package # Licensed under the GPL v2. See COPYING in the root of this package
if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then do_print_filename() { :; }
do_mpfr_get() { :; }
do_mpfr_extract() { :; }
do_mpfr() { :; }
do_mpfr_target() { :; }
# Overide function depending on configuration
if [ "${CT_GMP_MPFR}" = "y" ]; then
do_print_filename() { do_print_filename() {
[ "${CT_CC_GCC_GMP_MPFR}" = "y" ] || return 0 [ "${CT_GMP_MPFR}" = "y" ] || return 0
echo "mpfr-${CT_MPFR_VERSION}" echo "mpfr-${CT_MPFR_VERSION}"
} }
@ -57,7 +64,7 @@ do_mpfr() {
if [ "${CT_MPFR_CHECK}" = "y" ]; then if [ "${CT_MPFR_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking MPFR" CT_DoLog EXTRA "Checking MPFR"
make -s check 2>&1 |CT_DoLog ALL make ${PARALLELMFLAGS} -s check 2>&1 |CT_DoLog ALL
fi fi
CT_DoLog EXTRA "Installing MPFR" CT_DoLog EXTRA "Installing MPFR"
@ -66,11 +73,35 @@ do_mpfr() {
CT_EndStep CT_EndStep
} }
else # No MPFR if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
do_print_filename() { :; } do_mpfr_target() {
do_mpfr_get() { :; } mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
do_mpfr_extract() { :; } cd "${CT_BUILD_DIR}/build-mpfr-target"
do_mpfr() { :; }
fi CT_DoStep INFO "Installing MPFR for the target"
CT_DoLog EXTRA "Configuring MPFR"
CFLAGS="${CT_CFLAGS_FOR_TARGET}" \
"${CT_SRC_DIR}/${CT_MPFR_FILE}/configure" \
--build=${CT_BUILD} \
--host=${CT_TARGET} \
--prefix=/usr \
--enable-thread-safe \
--disable-shared --enable-static \
--with-gmp="${CT_SYSROOT_DIR}/usr" 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Building MPFR"
make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
# Not possible to check MPFR while X-compiling
CT_DoLog EXTRA "Installing MPFR"
make DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
CT_EndStep
}
fi # CT_GMP_MPFR_TARGET == y
fi # CT_GMP_MPFR == y

View File

@ -15,6 +15,8 @@ CT_STEPS := libc_check_config \
cc \ cc \
libc_finish \ libc_finish \
binutils_target \ binutils_target \
gmp_target \
mpfr_target \
tools \ tools \
debug \ debug \