From ac7ce3847590bd0983c581ad15c01a27c6637f18 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 6 Nov 2015 22:15:11 -0800 Subject: Convert expat for target into a companion lib. Expat-for-host to be done. Signed-off-by: Alexey Neyman diff --git a/config/companion_libs.in b/config/companion_libs.in index 0b0177c..2847f17 100644 --- a/config/companion_libs.in +++ b/config/companion_libs.in @@ -53,6 +53,11 @@ config LIBELF_NEEDED select LIBELF select COMPLIBS_NEEDED +config EXPAT_NEEDED + bool + select EXPAT + select COMPLIBS_NEEDED + config COMPLIBS bool @@ -101,6 +106,13 @@ config LIBELF config LIBELF_TARGET bool +config EXPAT + bool + select COMPLIBS + +config EXPAT_TARGET + bool + if LIBICONV source "config/companion_libs/libiconv.in" endif @@ -130,9 +142,11 @@ comment "libelf version needed to build for target" depends on !LIBELF source "config/companion_libs/libelf.in" endif - -config FOO - bool +if EXPAT || EXPAT_TARGET +comment "expat version needed to build for target" + depends on !EXPAT +source "config/companion_libs/expat.in" +endif if COMPLIBS diff --git a/config/companion_libs/expat.in b/config/companion_libs/expat.in new file mode 100644 index 0000000..1dff4a7 --- /dev/null +++ b/config/companion_libs/expat.in @@ -0,0 +1,19 @@ +# expat config file + +choice + bool + prompt "expat version" +# Don't remove next line +# CT_INSERT_VERSION_BELOW + +config EXPAT_V_2_1_0 + bool + prompt "2.1.0" + +endchoice + +config EXPAT_VERSION + string +# Don't remove next line +# CT_INSERT_VERSION_STRING_BELOW + default "2.1.0" if EXPAT_V_2_1_0 diff --git a/config/debug/gdb.in.native b/config/debug/gdb.in.native index 8d2159a..4f7e96a 100644 --- a/config/debug/gdb.in.native +++ b/config/debug/gdb.in.native @@ -5,6 +5,7 @@ config GDB_NATIVE prompt "Native gdb" depends on ! BARE_METAL depends on ! BACKEND + select EXPAT_TARGET help Build and install a native gdb for the target, to run on the target. diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh index 9c6c4c6..7ff6102 100755 --- a/scripts/addToolVersion.sh +++ b/scripts/addToolVersion.sh @@ -18,7 +18,7 @@ doHelp() { 'tool' in one of: gcc, binutils, glibc, uClibc, newlib, linux, gdb, dmalloc, duma, strace, ltrace, libelf, gmp, mpfr, ppl, cloog, mpc, - mingw-w64 + mingw-w64, expat Valid options for all tools: --stable, -s, +x (default) @@ -191,6 +191,7 @@ while [ $# -gt 0 ]; do --cloog) EXP=; OBS=; cat=CLOOG; tool=cloog; tool_prefix=companion_libs; dot2suffix=;; --mpc) EXP=; OBS=; cat=MPC; tool=mpc; tool_prefix=companion_libs; dot2suffix=;; --libelf) EXP=; OBS=; cat=LIBELF; tool=libelf; tool_prefix=companion_libs; dot2suffix=;; + --expat) EXP=; OBS=; cat=EXPAT; tool=expat; tool_prefix=companion_libs; dot2suffix=;; # Tools options: -x|--experimental|+s) EXP=1;; diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh new file mode 100644 index 0000000..212bf98 --- /dev/null +++ b/scripts/build/companion_libs/210-expat.sh @@ -0,0 +1,67 @@ +# Build script for expat + +do_expat_get() { :; } +do_expat_extract() { :; } +do_expat_for_build() { :; } +do_expat_for_host() { :; } +do_expat_for_target() { :; } + +if [ "${CT_EXPAT_TARGET}" = "y" -o "${CT_EXPAT}" = "y" ]; then + +do_expat_get() { + CT_GetFile "expat-${CT_EXPAT_VERSION}" .tar.gz \ + http://downloads.sourceforge.net/project/expat/expat/${CT_EXPAT_VERSION} +} + +do_expat_extract() { + CT_Extract "expat-${CT_EXPAT_VERSION}" + CT_Patch "expat" "${CT_EXPAT_VERSION}" +} + +if [ "${CT_EXPAT_TARGET}" = "y" ]; then +do_expat_for_target() { + CT_DoStep INFO "Installing expat for target" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-target-${CT_TARGET}" + + do_expat_backend host="${CT_TARGET}" \ + prefix="/usr" \ + destdir="${CT_SYSROOT_DIR}" + + CT_Popd + CT_EndStep +} +fi + +# Build libexpat +# Parameter : description : type : default +# host : machine to run on : tuple : (none) +# prefix : prefix to install into : dir : (none) +# destdir : install destination : dir : (none) +do_expat_backend() { + local host + local prefix + local cflags + local ldflags + local arg + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + CT_DoLog EXTRA "Configuring expat" + + CT_DoExecLog CFG \ + "${CT_SRC_DIR}/expat-${CT_EXPAT_VERSION}/configure" \ + --build=${CT_BUILD} \ + --host=${host} \ + --prefix="${prefix}" \ + --enable-static \ + --disable-shared + + CT_DoLog EXTRA "Building expat" + CT_DoExecLog ALL make ${JOBSFLAGS} + CT_DoLog EXTRA "Installing expat" + CT_DoExecLog ALL make install INSTALL_ROOT="${destdir}" +} + +fi diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 984aea3..0977923 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -6,13 +6,9 @@ # config options for this. CT_DEBUG_GDB_NCURSES_VERSION="5.9" -# Ditto for the expat library -CT_DEBUG_GDB_EXPAT_VERSION="2.1.0" - do_debug_gdb_parts() { need_gdb_src= need_ncurses_src= - need_expat_src= if [ "${CT_GDB_CROSS}" = y ]; then need_gdb_src=y @@ -28,7 +24,6 @@ do_debug_gdb_parts() { if [ "${CT_MINGW32}" != "y" ]; then need_ncurses_src=y fi - need_expat_src=y fi } @@ -70,11 +65,6 @@ do_debug_gdb_get() { {http,ftp,https}://ftp.gnu.org/pub/gnu/ncurses \ ftp://invisible-island.net/ncurses fi - - if [ "${need_expat_src}" = "y" ]; then - CT_GetFile "expat-${CT_DEBUG_GDB_EXPAT_VERSION}" .tar.gz \ - http://downloads.sourceforge.net/project/expat/expat/${CT_DEBUG_GDB_EXPAT_VERSION} - fi } do_debug_gdb_extract() { @@ -96,11 +86,6 @@ do_debug_gdb_extract() { CT_Patch "ncurses" "${CT_DEBUG_GDB_NCURSES_VERSION}" fi - if [ "${need_expat_src}" = "y" ]; then - CT_Extract "expat-${CT_DEBUG_GDB_EXPAT_VERSION}" - CT_Patch "expat" "${CT_DEBUG_GDB_EXPAT_VERSION}" - fi - if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then CT_ConfigureXtensa "gdb" "${CT_GDB_VERSION}" fi @@ -234,16 +219,7 @@ do_debug_gdb_build() { gdb_native_CFLAGS+=("-L${CT_BUILD_DIR}/static-target/lib") fi # need_ncurses_src - # Build libexpat - CT_DoLog EXTRA "Building static target expat" - CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-target-${CT_TARGET}" - do_gdb_expat_backend host="${CT_TARGET}" \ - prefix="${CT_BUILD_DIR}/static-target" \ - cflags="" \ - ldflags="" - CT_Popd native_extra_config+=("--with-expat") - native_extra_config+=("--with-libexpat-prefix=${CT_BUILD_DIR}/static-target") CT_DoLog EXTRA "Configuring native gdb" @@ -442,32 +418,3 @@ do_gdb_ncurses_backend() { CT_Popd } - -# Build libexpat -# Parameter : description : type : default -# host : machine to run on : tuple : (none) -# prefix : prefix to install into : dir : (none) -# cflags : cflags to use : string : (empty) -# ldflags : ldflags to use : string : (empty) -do_gdb_expat_backend() { - local host - local prefix - local cflags - local ldflags - local arg - - for arg in "$@"; do - eval "${arg// /\\ }" - done - - CT_DoExecLog CFG \ - "${CT_SRC_DIR}/expat-${CT_DEBUG_GDB_EXPAT_VERSION}/configure" \ - --build=${CT_BUILD} \ - --host=${host} \ - --prefix="${prefix}" \ - --enable-static \ - --disable-shared - - CT_DoExecLog ALL make ${JOBSFLAGS} - CT_DoExecLog ALL make install -} diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index 76609f2..9ac7c02 100755 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -63,12 +63,14 @@ dump_single_sample() { -o -n "${CT_CLOOG}" \ -o -n "${CT_MPC}" \ -o -n "${CT_LIBELF}" \ + -o -n "${CT_EXPAT}" \ -o -n "${CT_GMP_TARGET}" \ -o -n "${CT_MPFR_TARGET}" \ -o -n "${CT_PPL_TARGET}" \ -o -n "${CT_CLOOG_TARGET}" \ -o -n "${CT_MPC_TARGET}" \ -o -n "${CT_LIBELF_TARGET}" \ + -o -n "${CT_EXPAT_TARGET}" \ ]; then printf " %-*s :" ${width} "Companion libs" complibs=1 @@ -79,6 +81,7 @@ dump_single_sample() { [ -z "${CT_CLOOG}" -a -z "${CT_CLOOG_TARGET}" ] || printf " cloog-ppl-%s" "${CT_CLOOG_VERSION}" [ -z "${CT_MPC}" -a -z "${CT_MPC_TARGET}" ] || printf " mpc-%s" "${CT_MPC_VERSION}" [ -z "${CT_LIBELF}" -a -z "${CT_LIBELF_TARGET}" ] || printf " libelf-%s" "${CT_LIBELF_VERSION}" + [ -z "${CT_EXPAT}" -a -z "${CT_EXPAT_TARGET}" ] || printf " expat-%s" "${CT_EXPAT_VERSION}" [ -z "${complibs}" ] || printf "\n" printf " %-*s : %s\n" ${width} "binutils" "binutils-${CT_BINUTILS_VERSION}" printf " %-*s :" ${width} "C compilers" -- cgit v0.10.2-6-g49f6