From 44ee416289b08dc454f4d63864314f0ef6c2ba7f Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Fri, 27 Nov 2015 18:19:28 +0000 Subject: expat: Tidy up and correct configure flags Build shared builds for host unless CT_STATIC_TOOLCHAIN. In all other situations, build statically, as before. It is necessary that the static/shared-ness of expat matches that of gettext on Cygwin/MinGW-w64 as they can't be linked together if they don't match, so we follow the same logic. Signed-off-by: Ray Donnelly diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh old mode 100644 new mode 100755 index 304482c..7801d33 --- a/scripts/build/companion_libs/210-expat.sh +++ b/scripts/build/companion_libs/210-expat.sh @@ -22,13 +22,18 @@ if [ "${CT_EXPAT}" = "y" ]; then # Do not need expat for build at this time. do_expat_for_host() { + local -a expat_opts + CT_DoStep INFO "Installing expat for host" CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-host-${CT_HOST}" - do_expat_backend host="${CT_HOST}" \ - prefix="${CT_HOST_COMPLIBS_DIR}" \ - cflags="${CT_CFLAGS_FOR_HOST}" \ - ldflags="${CT_LDFLAGS_FOR_HOST}" + expat_opts+=( "host=${CT_HOST}" ) + expat_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" ) + expat_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) + expat_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" ) + expat_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" ) + + do_expat_backend "${expat_opts[@]}" CT_Popd CT_EndStep @@ -37,12 +42,17 @@ fi if [ "${CT_EXPAT_TARGET}" = "y" ]; then do_expat_for_target() { + local -a expat_opts + 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}" + expat_opts+=( "host=${CT_TARGET}" ) + expat_opts+=( "prefix=/usr" ) + expat_opts+=( "destdir=${CT_SYSROOT_DIR}" ) + expat_opts+=( "static_build=y" ) + + do_expat_backend "${expat_opts[@]}" CT_Popd CT_EndStep @@ -60,11 +70,17 @@ do_expat_backend() { local cflags local ldflags local arg + local -a extra_config for arg in "$@"; do eval "${arg// /\\ }" done + if [ "${static_build}" = "y" ]; then + extra_config+=("--disable-shared") + extra_config+=("--enable-static") + fi + CT_DoLog EXTRA "Configuring expat" CT_DoExecLog CFG \ @@ -74,8 +90,7 @@ do_expat_backend() { --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ - --enable-static \ - --disable-shared + "${extra_config[@]}" CT_DoLog EXTRA "Building expat" CT_DoExecLog ALL ${make} ${JOBSFLAGS} -- cgit v0.10.2-6-g49f6