summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/binutils.sh14
-rw-r--r--scripts/build/cc_core_gcc.sh138
-rw-r--r--scripts/build/debug/dmalloc.sh2
-rw-r--r--scripts/build/libc_glibc.sh217
-rw-r--r--scripts/build/libc_uClibc.sh5
-rw-r--r--scripts/build/libfloat.sh6
6 files changed, 326 insertions, 56 deletions
diff --git a/scripts/build/binutils.sh b/scripts/build/binutils.sh
index 3dec3ca..7615963 100644
--- a/scripts/build/binutils.sh
+++ b/scripts/build/binutils.sh
@@ -39,14 +39,18 @@ do_binutils() {
CT_DoLog EXTRA "Installing binutils"
make install 2>&1 |CT_DoLog ALL
- # Make those new tools available to the core C compiler to come:
+ # Make those new tools available to the core C compilers to come:
# Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
# well. Create that (libfloat is one such sucker).
- mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin"
- mkdir -p "${CT_CC_CORE_PREFIX_DIR}/bin"
+ mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
+ mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
+ mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
+ mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
for t in ar as ld strip; do
- ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
- ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
+ ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
+ ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
+ ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
+ ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
done |CT_DoLog ALL
CT_EndStep
diff --git a/scripts/build/cc_core_gcc.sh b/scripts/build/cc_core_gcc.sh
index af6b744..20f1240 100644
--- a/scripts/build/cc_core_gcc.sh
+++ b/scripts/build/cc_core_gcc.sh
@@ -21,27 +21,47 @@ do_cc_core_extract() {
CT_ExtractAndPatch "${CT_CC_CORE_FILE}"
}
-# Build core gcc
-do_cc_core() {
- mkdir -p "${CT_BUILD_DIR}/build-cc-core"
- cd "${CT_BUILD_DIR}/build-cc-core"
+# Core gcc pass 1
+do_cc_core_pass_1() {
+ # In case we're NPTL, build the static core gcc;
+ # in any other case, do nothing.
+ case "${CT_THREADS}" in
+ nptl) do_cc_core_static;;
+ *) ;;
+ esac
+}
+
+# Core gcc pass 2
+do_cc_core_pass_2() {
+ # In case we're NPTL, build the shared core gcc,
+ # in any other case, build the static core gcc.
+ case "${CT_THREADS}" in
+ nptl) do_cc_core_shared;;
+ *) do_cc_core_static;;
+ esac
+}
+
+# Build static core gcc
+do_cc_core_static() {
+ mkdir -p "${CT_BUILD_DIR}/build-cc-core-static"
+ cd "${CT_BUILD_DIR}/build-cc-core-static"
- CT_DoStep INFO "Installing core C compiler"
+ CT_DoStep INFO "Installing static core C compiler"
CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
- mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include"
- cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
+ mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include"
+ cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
- CT_DoLog EXTRA "Configuring core C compiler"
+ CT_DoLog EXTRA "Configuring static core C compiler"
extra_config=""
[ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
[ -n "${CT_ARCH_ABI}" ] && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
+ [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
[ -n "${CT_ARCH_CPU}" ] && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
[ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
- [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
[ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
- [ "${CT_CC_CXA_ATEXIT}" == "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
+ [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
@@ -49,9 +69,9 @@ do_cc_core() {
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
"${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure" \
${CT_CANADIAN_OPT} \
- --target=${CT_TARGET} \
--host=${CT_HOST} \
- --prefix="${CT_CC_CORE_PREFIX_DIR}" \
+ --target=${CT_TARGET} \
+ --prefix="${CT_CC_CORE_STATIC_PREFIX_DIR}" \
--with-local-prefix="${CT_SYSROOT_DIR}" \
--disable-multilib \
--with-newlib \
@@ -69,12 +89,102 @@ do_cc_core() {
make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
fi
- CT_DoLog EXTRA "Building core C compiler"
+ CT_DoLog EXTRA "Building static core C compiler"
make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
- CT_DoLog EXTRA "Installing core C compiler"
+ CT_DoLog EXTRA "Installing static core C compiler"
make install-gcc 2>&1 |CT_DoLog ALL
CT_EndStep
}
+# Build shared core gcc
+do_cc_core_shared() {
+ mkdir -p "${CT_BUILD_DIR}/build-cc-core-shared"
+ cd "${CT_BUILD_DIR}/build-cc-core-shared"
+
+ CT_DoStep INFO "Installing shared core C compiler"
+
+ CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
+ mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include"
+ cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
+
+ CT_DoLog EXTRA "Configuring shared core C compiler"
+
+ extra_config=""
+ [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
+ [ -n "${CT_ARCH_ABI}" ] && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
+ [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
+ [ -n "${CT_ARCH_CPU}" ] && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
+ [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
+ [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
+ [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
+
+ CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
+
+ CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure" \
+ ${CT_CANADIAN_OPT} \
+ --target=${CT_TARGET} \
+ --host=${CT_HOST} \
+ --prefix="${CT_CC_CORE_SHARED_PREFIX_DIR}" \
+ --with-local-prefix="${CT_SYSROOT_DIR}" \
+ --disable-multilib \
+ ${CC_CORE_SYSROOT_ARG} \
+ ${extra_config} \
+ --disable-nls \
+ --enable-symvers=gnu \
+ --enable-languages=c \
+ --enable-shared \
+ ${CT_CC_CORE_EXTRA_CONFIG} 2>&1 |CT_DoLog ALL
+
+ # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
+ # gcc/config/t-libunwind so -lc is removed from the link for
+ # libgcc_s.so, as we do not have a target -lc yet.
+ # This is not as ugly as it appears to be ;-) All symbols get resolved
+ # during the glibc build, and we provide a proper libgcc_s.so for the
+ # cross toolchain during the final gcc build.
+ #
+ # As we cannot modify the source tree, nor override SHLIB_LC itself
+ # during configure or make, we have to edit the resultant
+ # gcc/libgcc.mk itself to remove -lc from the link.
+ # This causes us to have to jump through some hoops...
+ #
+ # To produce libgcc.mk to edit we firstly require libiberty.a,
+ # so we configure then build it.
+ # Next we have to configure gcc, create libgcc.mk then edit it...
+ # So much easier if we just edit the source tree, but hey...
+ if [ ! -f "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/gcc/BASE-VER" ]; then
+ make configure-libiberty
+ make -C libiberty libiberty.a
+ make configure-gcc
+ make configure-libcpp
+ make all-libcpp
+ else
+ make configure-gcc
+ make configure-libcpp
+ make configure-build-libiberty
+ make all-libcpp
+ make all-build-libiberty
+ fi 2>&1 |CT_DoLog ALL
+ # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
+ if [ -d "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/libdecnumber" ]; then
+ make configure-libdecnumber
+ make -C libdecnumber libdecnumber.a
+ fi 2>&1 |CT_DoLog ALL
+ make -C gcc libgcc.mk 2>&1 |CT_DoLog ALL
+ sed -r -i -e 's@-lc@@g' gcc/libgcc.mk
+
+ if [ "${CT_CANADIAN}" = "y" ]; then
+ CT_DoLog EXTRA "Building libiberty"
+ make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
+ fi
+
+ CT_DoLog EXTRA "Building shared core C compiler"
+ make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
+
+ CT_DoLog EXTRA "Installing shared core C compiler"
+ make install-gcc 2>&1 |CT_DoLog ALL
+
+ CT_EndStep
+}
diff --git a/scripts/build/debug/dmalloc.sh b/scripts/build/debug/dmalloc.sh
index e9bc0da..075035c 100644
--- a/scripts/build/debug/dmalloc.sh
+++ b/scripts/build/debug/dmalloc.sh
@@ -22,7 +22,7 @@ do_debug_dmalloc_build() {
y) extra_config="${extra_config} --enable-cxx";;
*) extra_config="${extra_config} --disable-cxx";;
esac
- case "${CT_LIBC_THREADS_NONE}" in
+ case "${CT_THREADS_NONE}" in
y) extra_config="${extra_config} --disable-threads";;
*) extra_config="${extra_config} --enable-threads";;
esac
diff --git a/scripts/build/libc_glibc.sh b/scripts/build/libc_glibc.sh
index 41be59a..36f1ba2 100644
--- a/scripts/build/libc_glibc.sh
+++ b/scripts/build/libc_glibc.sh
@@ -11,10 +11,13 @@ do_libc_get() {
# C library addons
addons_list=`echo "${CT_LIBC_ADDONS_LIST}" |sed -r -e 's/,/ /g; s/ $//g;'`
+ case "${CT_THREADS}" in
+ linuxthreads) addons_list="${addons_list} linuxthreads";;
+ esac
+ [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list} ports"
for addon in ${addons_list}; do
CT_GetFile "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" ftp://ftp.gnu.org/gnu/glibc
done
- [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && CT_GetFile "${CT_LIBC}-ports-${CT_LIBC_VERSION}" ftp://ftp.gnu.org/gnu/glibc
return 0
}
@@ -25,10 +28,13 @@ do_libc_extract() {
# C library addons
addons_list=`echo "${CT_LIBC_ADDONS_LIST}" |sed -r -e 's/,/ /g; s/ $//g;'`
+ case "${CT_THREADS}" in
+ linuxthreads) addons_list="${addons_list} linuxthreads";;
+ esac
+ [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list} ports"
for addon in ${addons_list}; do
CT_ExtractAndPatch "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
done
- [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && CT_ExtractAndPatch "${CT_LIBC}-ports-${CT_LIBC_VERSION}"
return 0
}
@@ -68,21 +74,27 @@ do_libc_headers() {
# 'a version of binutils that supports .machine "altivec" is needed'.
# We also need to use the ports addon if specified
- addons=
- [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons="${CT_LIBC}-ports-${CT_LIBC_VERSION}"
+ addons_list=
+ case "${CT_LIBC_ADDONS},${CT_LIBC_GLIBC_USE_PORTS}" in
+ y,y) addons_list="${CT_LIBC_ADDONS_LIST},ports";;
+ y,) addons_list="${CT_LIBC_ADDONS_LIST}";;
+ ,y) addons_list="ports";;
+ *) addons_list="";;
+ esac
+ addons_config="--enable-add-ons=`echo ${addons_list} |sed -r -e 's/,+/,/g; s/^,+//; s/,+$//;'`"
libc_cv_ppc_machine=yes \
CC=${CT_CC_NATIVE} \
"${CT_SRC_DIR}/${CT_LIBC_FILE}/configure" \
- --build="${CT_BUILD}" \
+ --build="${CT_UNIQ_BUILD}" \
--host="${CT_TARGET}" \
--prefix=/usr \
--with-headers="${CT_HEADERS_DIR}" \
--without-cvs \
--disable-sanity-checks \
--enable-hacker-mode \
- --enable-add-ons="${addons}" \
- --without-nptl 2>&1 |CT_DoLog ALL
+ --without-nptl \
+ ${addons_config} 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Installing C library headers"
@@ -133,15 +145,40 @@ do_libc_headers() {
# but it breaks arm, see http://sourceware.org/ml/crossgcc/2006-01/msg00091.html
[ "${CT_ARCH}" != "arm" ] && cp misc/syscall-list.h "${CT_HEADERS_DIR}/bits/syscall.h" || true
+ # Those headers are to be manually copied so gcc can build properly
+ pthread_h=
+ pthreadtypes_h=
+ case "${CT_THREADS}" in
+ nptl)
+ # NOTE: for some archs, the pathes are different, but they are not
+ # supported by ct-ng right now. See original crosstool when they are.
+ pthread_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_THREADS}/sysdeps/pthread/pthread.h"
+ pthreadtypes_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/nptl/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/bits/pthreadtypes.h"
+ ;;
+ linuxthreads)
+ pthread_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_THREADS}/sysdeps/pthread/pthread.h"
+ pthreadtypes_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
+ ;;
+ esac
+ if [ -n "${pthread_h}" ]; then
+ cp -v "${pthread_h}" "${CT_HEADERS_DIR}/pthread.h" 2>&1 |CT_DoLog ALL
+ fi
+ if [ -n "${pthreadtypes_h}" ]; then
+ cp -v "${pthreadtypes_h}" "${CT_HEADERS_DIR}/bits/pthreadtypes.h" 2>&1 |CT_DoLog ALL
+ fi
+
CT_EndStep
}
-# This function builds and install the full glibc
-do_libc() {
- CT_DoStep INFO "Installing C library"
+# Build and install start files
+do_libc_start_files() {
+ # Needed only in the NPTL case. Otherwise, return.
+ [ "${CT_THREADS}" = "nptl" ] || return 0
- mkdir -p "${CT_BUILD_DIR}/build-libc"
- cd "${CT_BUILD_DIR}/build-libc"
+ CT_DoStep INFO "Installing C library start files"
+
+ mkdir -p "${CT_BUILD_DIR}/build-libc-startfiles"
+ cd "${CT_BUILD_DIR}/build-libc-startfiles"
CT_DoLog EXTRA "Configuring C library"
@@ -153,31 +190,32 @@ do_libc() {
esac
case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
*-tls*) ;;
- *) extra_config="${extra_config} --without-tls"
- esac
- case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
- *-__thread*) ;;
- *) extra_config="${extra_config} --without-__thread"
+ *) extra_config="${extra_config} --with-tls"
esac
case "${CT_SHARED_LIBS}" in
y) extra_config="${extra_config} --enable-shared";;
*) extra_config="${extra_config} --disable-shared";;
esac
case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
- *--with-fp*) ;;
- *--without-fp*) ;;
- *) case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
+ *--with-fp*) ;;
+ *--without-fp*) ;;
+ *) case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
y,) extra_config="${extra_config} --with-fp";;
,y) extra_config="${extra_config} --without-fp";;
esac;;
esac
+ # Obviously, we want threads, as we come here only for NPTL
+ extra_config="${extra_config} --with-__thread"
+ addons_list=
case "${CT_LIBC_ADDONS},${CT_LIBC_GLIBC_USE_PORTS}" in
- y,y) addons_config="--enable-add-ons=${CT_LIBC_ADDONS_LIST},${CT_LIBC}-ports-${CT_LIBC_VERSION}";;
- y,) addons_config="--enable-add-ons=${CT_LIBC_ADDONS_LIST}";;
- ,y) addons_config="--enable-add-ons=${CT_LIBC}-ports-${CT_LIBC_VERSION}";;
- *) addons_config="";;
+ y,y) addons_list="nptl,${CT_LIBC_ADDONS_LIST},ports";;
+ y,) addons_list="nptl,${CT_LIBC_ADDONS_LIST}";;
+ ,y) addons_list="nptl,ports";;
+ *) addons_list="nptl";;
esac
+ addons_config="--enable-add-ons=`echo ${addons_list} |sed -r -e 's/,+/,/g; s/^,+//; s/,+$//;'`"
+ extra_config="${extra_config} ${addons_config}"
# Add some default CC args
extra_cc_args="${CT_CFLAGS_FOR_HOST}"
@@ -190,7 +228,114 @@ do_libc() {
esac;;
esac
- CT_DoLog DEBUG "Configuring with addons : \"${addons_config}\""
+ CT_DoLog DEBUG "Configuring with addons : \"${addons_list}\""
+ CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
+ CT_DoLog DEBUG "Extra CC args passed: \"${extra_cc_args}\""
+
+ # sh3 and sh4 really need to set configparms as of gcc-3.4/glibc-2.3.2
+ # note: this is awkward, doesn't work well if you need more than one line in configparms
+ echo ${CT_LIBC_GLIBC_CONFIGPARMS} > configparms
+
+ echo "libc_cv_forced_unwind=yes" > config.cache
+ echo "libc_cv_c_cleanup=yes" >> config.cache
+
+ # Please see the comment for the configure step in do_libc().
+
+ BUILD_CC=${CT_CC_NATIVE} \
+ CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \
+ CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
+ AR=${CT_TARGET}-ar \
+ RANLIB=${CT_TARGET}-ranlib \
+ "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure" \
+ --prefix=/usr \
+ --build="${CT_UNIQ_BUILD}" \
+ --host=${CT_TARGET} \
+ --without-cvs \
+ --disable-profile \
+ --disable-debug \
+ --without-gd \
+ --with-headers="${CT_HEADERS_DIR}" \
+ --cache-file=config.cache \
+ ${extra_config} \
+ ${CT_LIBC_GLIBC_EXTRA_CONFIG} 2>&1 |CT_DoLog ALL
+
+
+ #TODO: should check whether slibdir has been set in configparms to */lib64
+ # and copy the startfiles into the appropriate libdir.
+ make csu/subdir_lib 2>&1 |CT_DoLog ALL
+
+ if [ "${CT_USE_SYSROOT}" = "y" ]; then
+ cp -fp csu/crt[1in].o "${CT_SYSROOT_DIR}/usr/lib/"
+ else
+ cp -fp csu/crt[1in].o "${CT_SYSROOT_DIR}/lib/"
+ fi
+
+ CT_EndStep
+}
+
+# This function builds and install the full glibc
+do_libc() {
+ CT_DoStep INFO "Installing C library"
+
+ mkdir -p "${CT_BUILD_DIR}/build-libc"
+ cd "${CT_BUILD_DIR}/build-libc"
+
+ CT_DoLog EXTRA "Configuring C library"
+
+ # Add some default glibc config options if not given by user.
+ # We don't need to be conditional on wether the user did set different
+ # values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config
+
+ extra_config="--enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
+
+ case "${CT_THREADS}" in
+ nptl) extra_config="${extra_config} --with-__thread --with-tls";;
+ linuxthreads) extra_config="${extra_config} --with-__thread --without-tls --without-nptl";;
+ none) extra_config="${extra_config} --without-__thread --without-nptl"
+ case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
+ *-tls*) ;;
+ *) extra_config="${extra_config} --without-tls";;
+ esac
+ ;;
+ esac
+
+ case "${CT_SHARED_LIBS}" in
+ y) extra_config="${extra_config} --enable-shared";;
+ *) extra_config="${extra_config} --disable-shared";;
+ esac
+
+ case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
+ y,) extra_config="${extra_config} --with-fp";;
+ ,y) extra_config="${extra_config} --without-fp";;
+ esac
+
+ addons_list=
+ case "${CT_LIBC_ADDONS},${CT_LIBC_GLIBC_USE_PORTS}" in
+ y,y) addons_list="${CT_LIBC_ADDONS_LIST},ports";;
+ y,) addons_list="${CT_LIBC_ADDONS_LIST}";;
+ ,y) addons_list="ports";;
+ *) addons_list="";;
+ esac
+ case "${CT_THREADS}" in
+ none) ;;
+ *) addons_list="${addons_list},${CT_THREADS}";;
+ esac
+ case "${addons_list}" in
+ "") ;;
+ *) addons_config="--enable-add-ons=`echo ${addons_list} |sed -r -e 's/,+/,/g; s/^,+//g; s/,+$//;'`";;
+ esac
+ extra_config="${extra_config} ${addons_config}"
+
+ # Add some default CC args
+ if [ "${CT_USE_PIPES}" = "y" ]; then
+ extra_cc_args="-pipe"
+ fi
+ case "${CT_ARCH_BE},${CT_ARCH_LE}" in
+ y,) extra_cc_args="${extra_cc_args} -mbig-endian";;
+ ,y) extra_cc_args="${extra_cc_args} -mlittle-endian";;
+ esac
+
+ CT_DoLog DEBUG "Configuring with addons : \"${addons_list}\""
CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
CT_DoLog DEBUG "Extra CC args passed: \"${extra_cc_args}\""
@@ -201,11 +346,10 @@ do_libc() {
# For glibc 2.3.4 and later we need to set some autoconf cache
# variables, because nptl/sysdeps/pthread/configure.in does not
# work when cross-compiling.
- if test -d ${GLIBC_DIR}/nptl; then
- libc_cv_forced_unwind=yes
- libc_cv_c_cleanup=yes
- export libc_cv_forced_unwind libc_cv_c_cleanup
- fi
+ if [ "${CT_THREADS}" = "nptl" ]; then
+ echo libc_cv_forced_unwind=yes
+ echo libc_cv_c_cleanup=yes
+ fi >config.cache
# Configure with --prefix the way we want it on the target...
# There are a whole lot of settings here. You'll probably want
@@ -216,19 +360,26 @@ do_libc() {
# Set BUILD_CC, or you won't be able to build datafiles
# Set --build, else glibc-2.3.2 will think you're not cross-compiling, and try to run the test programs
+ # OK. I'm fed up with those folks telling me what I should do.
+ # I don't configure nptl? Well, maybe that's purposedly because
+ # I don't want nptl! --disable-sanity-checks will shut up those
+ # silly messages. GNU folks again, he?
+
BUILD_CC=${CT_CC_NATIVE} \
CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \
- CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
+ CC="${CT_TARGET}-gcc ${extra_cc_args} ${CT_LIBC_EXTRA_CC_ARGS}" \
AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \
"${CT_SRC_DIR}/${CT_LIBC_FILE}/configure" \
--prefix=/usr \
- --build=${CT_BUILD} --host=${CT_TARGET} \
+ --build=${CT_UNIQ_BUILD} \
+ --host=${CT_TARGET} \
--without-cvs \
- --without-nptl \
--disable-profile \
--disable-debug \
--without-gd \
+ --disable-sanity-checks \
+ --cache-file=config.cache \
--with-headers="${CT_HEADERS_DIR}" \
${addons_config} \
${extra_config} \
diff --git a/scripts/build/libc_uClibc.sh b/scripts/build/libc_uClibc.sh
index a8fb9be..632db69 100644
--- a/scripts/build/libc_uClibc.sh
+++ b/scripts/build/libc_uClibc.sh
@@ -79,6 +79,11 @@ do_libc_headers() {
CT_EndStep
}
+# Build and install start files
+do_libc_start_files() {
+ :
+}
+
# This function build and install the full uClibc
do_libc() {
CT_DoStep INFO "Installing C library"
diff --git a/scripts/build/libfloat.sh b/scripts/build/libfloat.sh
index b557404..147d046 100644
--- a/scripts/build/libfloat.sh
+++ b/scripts/build/libfloat.sh
@@ -40,11 +40,11 @@ do_libfloat() {
make clean 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Building library"
- make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL
+ make CROSS_COMPILE="${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Installing library"
- make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" \
- DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
+ make CROSS_COMPILE="${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-" \
+ DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
CT_Popd