Merge.
1.1 --- a/scripts/build/libc/uClibc.sh Fri Jan 01 19:03:48 2010 +0100
1.2 +++ b/scripts/build/libc/uClibc.sh Fri Jan 01 19:04:16 2010 +0100
1.3 @@ -187,61 +187,66 @@
1.4 rm -f "${munge_file}"
1.5 touch "${munge_file}"
1.6
1.7 + # Do it all in a sub-shell, it's easier to redirect output
1.8 + (
1.9 +
1.10 # Hack our target in the config file.
1.11 # Also remove stripping: its the responsibility of the
1.12 # firmware builder to strip or not.
1.13 - cat >>"${munge_file}" <<-ENDSED
1.14 -s/^(TARGET_.*)=y$/# \\1 is not set/
1.15 -s/^# TARGET_${CT_KERNEL_ARCH} is not set/TARGET_${CT_KERNEL_ARCH}=y/
1.16 -s/^TARGET_ARCH=".*"/TARGET_ARCH="${CT_KERNEL_ARCH}"/
1.17 -s/.*(DOSTRIP).*/# \\1 is not set/
1.18 -ENDSED
1.19 + cat <<-ENDSED
1.20 + s/^(TARGET_.*)=y$/# \\1 is not set/
1.21 + s/^# TARGET_${CT_KERNEL_ARCH} is not set/TARGET_${CT_KERNEL_ARCH}=y/
1.22 + s/^TARGET_ARCH=".*"/TARGET_ARCH="${CT_KERNEL_ARCH}"/
1.23 + s/.*(DOSTRIP).*/# \\1 is not set/
1.24 + ENDSED
1.25
1.26 # Ah. We may one day need architecture-specific handler here...
1.27 - # Hack the ARM {E,O}ABI into the config file
1.28 - if [ "${CT_ARCH_ARM_EABI}" = "y" ]; then
1.29 - cat >>"${munge_file}" <<-ENDSED
1.30 -s/.*(CONFIG_ARM_OABI).*/# \\1 is not set/
1.31 -s/.*(CONFIG_ARM_EABI).*/\\1=y/
1.32 -ENDSED
1.33 - else
1.34 - cat >>"${munge_file}" <<-ENDSED
1.35 -s/.*(CONFIG_ARM_OABI).*/\\1=y/
1.36 -s/.*(CONFIG_ARM_EABI).*/# \\1 is not set/
1.37 -ENDSED
1.38 + if [ "${CT_ARCH}" = "arm" ]; then
1.39 + # Hack the ARM {E,O}ABI into the config file
1.40 + if [ "${CT_ARCH_ARM_EABI}" = "y" ]; then
1.41 + cat <<-ENDSED
1.42 + s/.*(CONFIG_ARM_OABI).*/# \\1 is not set/
1.43 + s/.*(CONFIG_ARM_EABI).*/\\1=y/
1.44 + ENDSED
1.45 + else
1.46 + cat <<-ENDSED
1.47 + s/.*(CONFIG_ARM_OABI).*/\\1=y/
1.48 + s/.*(CONFIG_ARM_EABI).*/# \\1 is not set/
1.49 + ENDSED
1.50 + fi
1.51 fi
1.52
1.53 # Accomodate for old and new uClibc versions, where the
1.54 # way to select between big/little endian has changed
1.55 case "${CT_ARCH_BE},${CT_ARCH_LE}" in
1.56 - y,) cat >>"${munge_file}" <<-ENDSED
1.57 -s/.*(ARCH_LITTLE_ENDIAN).*/# \\1 is not set/
1.58 -s/.*(ARCH_BIG_ENDIAN).*/\\1=y/
1.59 -s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/# \\1 is not set/
1.60 -s/.*(ARCH_WANTS_BIG_ENDIAN).*/\\1=y/
1.61 -ENDSED
1.62 + y,) cat <<-ENDSED
1.63 + s/.*(ARCH_LITTLE_ENDIAN).*/# \\1 is not set/
1.64 + s/.*(ARCH_BIG_ENDIAN).*/\\1=y/
1.65 + s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/# \\1 is not set/
1.66 + s/.*(ARCH_WANTS_BIG_ENDIAN).*/\\1=y/
1.67 + ENDSED
1.68 ;;
1.69 - ,y) cat >>"${munge_file}" <<-ENDSED
1.70 -s/.*(ARCH_LITTLE_ENDIAN).*/\\1=y/
1.71 -s/.*(ARCH_BIG_ENDIAN).*/# \\1 is not set/
1.72 -s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/\\1=y/
1.73 -s/.*(ARCH_WANTS_BIG_ENDIAN).*/# \\1 is not set/
1.74 -ENDSED
1.75 + ,y) cat <<-ENDSED
1.76 + s/.*(ARCH_LITTLE_ENDIAN).*/\\1=y/
1.77 + s/.*(ARCH_BIG_ENDIAN).*/# \\1 is not set/
1.78 + s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/\\1=y/
1.79 + s/.*(ARCH_WANTS_BIG_ENDIAN).*/# \\1 is not set/
1.80 + ENDSED
1.81 ;;
1.82 esac
1.83
1.84 # Accomodate for old and new uClibc version, where the
1.85 # way to select between hard/soft float has changed
1.86 case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
1.87 - y,) cat >>"${munge_file}" <<-ENDSED
1.88 -s/^[^_]*(HAS_FPU).*/\\1=y/
1.89 -s/.*(UCLIBC_HAS_FPU).*/\\1=y/
1.90 -ENDSED
1.91 + y,) cat <<-ENDSED
1.92 + s/^[^_]*(HAS_FPU).*/\\1=y/
1.93 + s/.*(UCLIBC_HAS_FPU).*/\\1=y/
1.94 + ENDSED
1.95 ;;
1.96 - ,y) cat >>"${munge_file}" <<-ENDSED
1.97 -s/^[^_]*(HAS_FPU).*/\\# \\1 is not set/
1.98 -s/.*(UCLIBC_HAS_FPU).*/# \\1 is not set/
1.99 -ENDSED
1.100 + ,y) cat <<-ENDSED
1.101 + s/^[^_]*(HAS_FPU).*/\\# \\1 is not set/
1.102 + s/.*(UCLIBC_HAS_FPU).*/# \\1 is not set/
1.103 + ENDSED
1.104 ;;
1.105 esac
1.106
1.107 @@ -254,28 +259,28 @@
1.108 # CROSS_COMPILER_PREFIX is left as is, as the CROSS parameter is forced on the command line
1.109 # DEVEL_PREFIX is left as '/usr/' because it is post-pended to $PREFIX, wich is the correct value of ${PREFIX}/${TARGET}
1.110 # Some (old) versions of uClibc use KERNEL_SOURCE (which is _wrong_), and
1.111 - # newer versions use KERNEL_HEADERS (which is right). See:
1.112 - cat >>"${munge_file}" <<-ENDSED
1.113 -s/^DEVEL_PREFIX=".*"/DEVEL_PREFIX="\\/usr\\/"/
1.114 -s/^RUNTIME_PREFIX=".*"/RUNTIME_PREFIX="\\/"/
1.115 -s/^SHARED_LIB_LOADER_PREFIX=.*/SHARED_LIB_LOADER_PREFIX="\\/lib\\/"/
1.116 -s/^KERNEL_SOURCE=".*"/KERNEL_SOURCE="${quoted_kernel_source}"/
1.117 -s/^KERNEL_HEADERS=".*"/KERNEL_HEADERS="${quoted_headers_dir}"/
1.118 -s/^UCLIBC_DOWNLOAD_PREGENERATED_LOCALE=y/\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE is not set/
1.119 -ENDSED
1.120 + # newer versions use KERNEL_HEADERS (which is right).
1.121 + cat <<-ENDSED
1.122 + s/^DEVEL_PREFIX=".*"/DEVEL_PREFIX="\\/usr\\/"/
1.123 + s/^RUNTIME_PREFIX=".*"/RUNTIME_PREFIX="\\/"/
1.124 + s/^SHARED_LIB_LOADER_PREFIX=.*/SHARED_LIB_LOADER_PREFIX="\\/lib\\/"/
1.125 + s/^KERNEL_SOURCE=".*"/KERNEL_SOURCE="${quoted_kernel_source}"/
1.126 + s/^KERNEL_HEADERS=".*"/KERNEL_HEADERS="${quoted_headers_dir}"/
1.127 + s/^UCLIBC_DOWNLOAD_PREGENERATED_LOCALE=y/\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE is not set/
1.128 + ENDSED
1.129
1.130 if [ "${CT_USE_PIPES}" = "y" ]; then
1.131 if grep UCLIBC_EXTRA_CFLAGS extra/Configs/Config.in >/dev/null 2>&1; then
1.132 # Good, there is special provision for such things as -pipe!
1.133 - cat >>"${munge_file}" <<-ENDSED
1.134 -s/^(UCLIBC_EXTRA_CFLAGS=".*)"$/\\1 -pipe"/
1.135 -ENDSED
1.136 + cat <<-ENDSED
1.137 + s/^(UCLIBC_EXTRA_CFLAGS=".*)"$/\\1 -pipe"/
1.138 + ENDSED
1.139 else
1.140 # Hack our -pipe into WARNINGS, which will be internally incorporated to
1.141 # CFLAGS. This a dirty hack, but yet needed
1.142 - cat >> "${munge_file}" <<-ENDSED
1.143 -s/^(WARNINGS=".*)"$/\\1 -pipe"/
1.144 -ENDSED
1.145 + cat <<-ENDSED
1.146 + s/^(WARNINGS=".*)"$/\\1 -pipe"/
1.147 + ENDSED
1.148 fi
1.149 fi
1.150
1.151 @@ -287,70 +292,76 @@
1.152 # pregenerated locales is not compatible with crosstool; besides,
1.153 # crosstool downloads them as part of getandpatch.sh.
1.154 if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ] ; then
1.155 - cat >>"${munge_file}" <<-ENDSED
1.156 -s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\nUCLIBC_PREGENERATED_LOCALE_DATA=y\\n\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\n\\# UCLIBC_HAS_XLOCALE is not
1.157 -ENDSED
1.158 + cat <<-ENDSED
1.159 + s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\
1.160 + UCLIBC_PREGENERATED_LOCALE_DATA=y\\
1.161 + # UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\
1.162 + # UCLIBC_HAS_XLOCALE is not set/
1.163 + ENDSED
1.164 fi
1.165
1.166 # WCHAR support
1.167 if [ "${CT_LIBC_UCLIBC_WCHAR}" = "y" ] ; then
1.168 - cat >>"${munge_file}" <<-ENDSED
1.169 -s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=y/
1.170 -ENDSED
1.171 + cat <<-ENDSED
1.172 + s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=y/
1.173 + ENDSED
1.174 else
1.175 - cat >>"${munge_file}" <<-ENDSED
1.176 -s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=n/
1.177 -ENDSED
1.178 + cat <<-ENDSED
1.179 + s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=n/
1.180 + ENDSED
1.181 fi
1.182
1.183 # Force on options needed for C++ if we'll be making a C++ compiler.
1.184 # I'm not sure locales are a requirement for doing C++... Are they?
1.185 if [ "${CT_CC_LANG_CXX}" = "y" ]; then
1.186 - cat >>"${munge_file}" <<-ENDSED
1.187 -s/^# DO_C99_MATH is not set/DO_C99_MATH=y/
1.188 -s/^# UCLIBC_CTOR_DTOR is not set/UCLIBC_CTOR_DTOR=y/
1.189 -#s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\nUCLIBC_PREGENERATED_LOCALE_DATA=y\\n\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\n\\# UCLIBC_HAS_XLOCALE is not set/
1.190 -s/^# UCLIBC_HAS_GNU_GETOPT is not set/UCLIBC_HAS_GNU_GETOPT=y/
1.191 -ENDSED
1.192 + cat <<-ENDSED
1.193 + s/^# DO_C99_MATH is not set/DO_C99_MATH=y/
1.194 + s/^# UCLIBC_CTOR_DTOR is not set/UCLIBC_CTOR_DTOR=y/
1.195 + s/^# UCLIBC_HAS_GNU_GETOPT is not set/UCLIBC_HAS_GNU_GETOPT=y/
1.196 + ENDSED
1.197 fi
1.198
1.199 # Always build the libpthread_db
1.200 - cat >>"${munge_file}" <<-ENDSED
1.201 -s/^# PTHREADS_DEBUG_SUPPORT is not set.*/PTHREADS_DEBUG_SUPPORT=y/
1.202 -ENDSED
1.203 + cat <<-ENDSED
1.204 + s/^# PTHREADS_DEBUG_SUPPORT is not set.*/PTHREADS_DEBUG_SUPPORT=y/
1.205 + ENDSED
1.206
1.207 # Force on debug options if asked for
1.208 case "${CT_LIBC_UCLIBC_DEBUG_LEVEL}" in
1.209 0)
1.210 - cat >>"${munge_file}" <<-ENDSED
1.211 -s/^DODEBUG=y/# DODEBUG is not set/
1.212 -s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
1.213 -s/^DOASSERTS=y/# DOASSERTS is not set/
1.214 -s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
1.215 -s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
1.216 -s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
1.217 -ENDSED
1.218 + cat <<-ENDSED
1.219 + s/^DODEBUG=y/# DODEBUG is not set/
1.220 + s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
1.221 + s/^DOASSERTS=y/# DOASSERTS is not set/
1.222 + s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
1.223 + s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
1.224 + s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
1.225 + ENDSED
1.226 ;;
1.227 1)
1.228 - cat >>"${munge_file}" <<-ENDSED
1.229 -s/^# DODEBUG is not set.*/DODEBUG=y/
1.230 -s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
1.231 -s/^DOASSERTS=y/# DOASSERTS is not set/
1.232 -s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
1.233 -s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
1.234 -s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
1.235 -ENDSED
1.236 + cat <<-ENDSED
1.237 + s/^# DODEBUG is not set.*/DODEBUG=y/
1.238 + s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
1.239 + s/^DOASSERTS=y/# DOASSERTS is not set/
1.240 + s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
1.241 + s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
1.242 + s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
1.243 + ENDSED
1.244 ;;
1.245 2)
1.246 - cat >>"${munge_file}" <<-ENDSED
1.247 -s/^# DODEBUG is not set.*/DODEBUG=y/
1.248 -s/^# DODEBUG_PT is not set.*/DODEBUG_PT=y/
1.249 -s/^# DOASSERTS is not set.*/DOASSERTS=y/
1.250 -s/^# SUPPORT_LD_DEBUG is not set.*/SUPPORT_LD_DEBUG=y/
1.251 -s/^# SUPPORT_LD_DEBUG_EARLY is not set.*/SUPPORT_LD_DEBUG_EARLY=y/
1.252 -s/^# UCLIBC_MALLOC_DEBUGGING is not set/UCLIBC_MALLOC_DEBUGGING=y/
1.253 -ENDSED
1.254 + cat <<-ENDSED
1.255 + s/^# DODEBUG is not set.*/DODEBUG=y/
1.256 + s/^# DODEBUG_PT is not set.*/DODEBUG_PT=y/
1.257 + s/^# DOASSERTS is not set.*/DOASSERTS=y/
1.258 + s/^# SUPPORT_LD_DEBUG is not set.*/SUPPORT_LD_DEBUG=y/
1.259 + s/^# SUPPORT_LD_DEBUG_EARLY is not set.*/SUPPORT_LD_DEBUG_EARLY=y/
1.260 + s/^# UCLIBC_MALLOC_DEBUGGING is not set/UCLIBC_MALLOC_DEBUGGING=y/
1.261 + ENDSED
1.262 ;;
1.263 esac
1.264 +
1.265 + # And now, this is the end
1.266 + ) >>"${munge_file}"
1.267 +
1.268 sed -r -f "${munge_file}" "${src_config_file}" >"${dst_config_file}"
1.269 }
2.1 --- a/scripts/functions Fri Jan 01 19:03:48 2010 +0100
2.2 +++ b/scripts/functions Fri Jan 01 19:04:16 2010 +0100
2.3 @@ -356,7 +356,7 @@
2.4 # so that the CT-NG's ouput is 'live'.
2.5 CT_DoExecLog ALL aria2c -l - -s ${CT_DOWNLOAD_MAX_CHUNKS} -m 3 -t ${CT_CONNECT_TIMEOUT} -p "$1" \
2.6 || CT_DoExecLog ALL aria2c -l - -s ${CT_DOWNLOAD_MAX_CHUNKS} -m 3 -t ${CT_CONNECT_TIMEOUT} "$1" \
2.7 - || true
2.8 + || rm -f "${1##*/}"
2.9 }
2.10
2.11 # OK, just look if we have them...