diff options
author | Alexey Neyman <stilor@att.net> | 2015-11-07 06:15:11 (GMT) |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2015-11-13 18:28:44 (GMT) |
commit | ac7ce3847590bd0983c581ad15c01a27c6637f18 (patch) | |
tree | 7f717ea85dc9ef3b1117b4040edce4cb032d555a /scripts/build | |
parent | 6f7e6b9969681cb3f85464066fa819fa90060783 (diff) |
Convert expat for target into a companion lib.
Expat-for-host to be done.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build')
-rw-r--r-- | scripts/build/companion_libs/210-expat.sh | 67 | ||||
-rw-r--r-- | scripts/build/debug/300-gdb.sh | 53 |
2 files changed, 67 insertions, 53 deletions
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 -} |