* [libiconv PATCH 1 of 3] complibs/libiconv: add libiconv support
@ 2011-11-23 12:08 Zhenqiang Chen
0 siblings, 0 replies; only message in thread
From: Zhenqiang Chen @ 2011-11-23 12:08 UTC (permalink / raw)
To: yann.morin.1998; +Cc: crossgcc
# HG changeset patch
# User Zhenqiang Chen <zhenqiang.chen@linaro.org>
# Date 1322039284 -28800
# Node ID cae5f04044f4b6a2caa14da4568c80af4d257580
# Parent 2f4e3c312b659422e4a9950f13a0fc507b97c1fd
complibs/libiconv: add libiconv as a companion library
Use our own version to remove dependence on system libiconv.
Some host system might not have libiconv.
Learn more about libiconv requirement for gcc and gdb:
http://gcc.gnu.org/ml/gcc-help/2011-01/msg00083.html
http://sourceware.org/gdb/onlinedocs/gdb/Requirements.html
Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>
diff --git a/config/companion_libs.in b/config/companion_libs.in
--- a/config/companion_libs.in
+++ b/config/companion_libs.in
@@ -37,6 +37,9 @@
select LIBELF
select COMPLIBS_NEEDED
+config LIBICONV_NEEDED
+ bool
+
config COMPLIBS
bool
diff --git a/config/toolchain.in b/config/toolchain.in
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -180,6 +180,7 @@
config CANADIAN
bool
prompt "Canadian (EXPERIMENTAL)"
+ select LIBICONV_NEEDED
depends on EXPERIMENTAL
help
Build a canadian-toolchain.
diff --git a/scripts/build/companion_libs/libiconv.sh b/scripts/build/companion_libs/libiconv.sh
new file mode 100644
--- /dev/null
+++ b/scripts/build/companion_libs/libiconv.sh
@@ -0,0 +1,51 @@
+# This file adds the functions to build the LIBICONV library
+# Copyright 2011 Linaro Limited
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+do_libiconv_get() { :; }
+do_libiconv_extract() { :; }
+do_libiconv() { :; }
+
+if [ "${CT_LIBICONV_NEEDED}" = "y" ]; then
+
+# hard code
+CT_LIBICONV_VERSION="1.14"
+
+do_libiconv_get() {
+ CT_GetFile "libiconv-${CT_LIBICONV_VERSION}" \
+ http://ftp.gnu.org/pub/gnu/libiconv
+}
+
+do_libiconv_extract() {
+ CT_Extract "libiconv-${CT_LIBICONV_VERSION}"
+ CT_Patch "libiconv" "${CT_LIBICONV_VERSION}"
+}
+
+do_libiconv() {
+ mkdir -p "${CT_BUILD_DIR}/build-libiconv"
+ cd "${CT_BUILD_DIR}/build-libiconv"
+
+ CT_DoStep INFO "Installing libiconv"
+
+ CT_DoLog EXTRA "Configuring libiconv"
+
+ CT_DoExecLog CFG \
+ CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ CXXFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ "${CT_SRC_DIR}/libiconv-${CT_LIBICONV_VERSION}/configure" \
+ --build=${CT_BUILD} \
+ --host=${CT_HOST} \
+ --prefix="${CT_COMPLIBS_DIR}" \
+ --disable-shared \
+ --enable-static
+
+ CT_DoLog EXTRA "Building libiconv"
+ CT_DoExecLog ALL make ${JOBSFLAGS}
+
+ CT_DoLog EXTRA "Installing libiconv"
+ CT_DoExecLog ALL make install
+
+ CT_EndStep
+}
+
+fi # CT_LIBCONV_NEEDED
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -120,6 +120,7 @@
. "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/sstrip.sh"
+. "${CT_LIB_DIR}/scripts/build/companion_libs/libiconv.sh"
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
. "${CT_LIB_DIR}/scripts/build/cc/${CT_CC}.sh"
. "${CT_LIB_DIR}/scripts/build/debug.sh"
@@ -530,6 +531,7 @@
do_binutils_get
do_elf2flt_get
do_sstrip_get
+ do_libiconv_get
do_cc_get
do_libc_get
do_debug_get
@@ -560,6 +562,7 @@
do_binutils_extract
do_elf2flt_extract
do_sstrip_extract
+ do_libiconv_extract
do_cc_extract
do_libc_extract
do_debug_extract
diff --git a/steps.mk b/steps.mk
--- a/steps.mk
+++ b/steps.mk
@@ -26,6 +26,7 @@
binutils \
elf2flt \
sstrip \
+ libiconv \
cc_core_pass_1 \
kernel_headers \
libc_start_files \
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-11-23 12:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-23 12:08 [libiconv PATCH 1 of 3] complibs/libiconv: add libiconv support Zhenqiang Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).