diff options
author | Ray Donnelly <mingw.android@gmail.com> | 2015-11-27 18:19:28 (GMT) |
---|---|---|
committer | Ray Donnelly <mingw.android@gmail.com> | 2016-01-03 15:52:23 (GMT) |
commit | 44ee416289b08dc454f4d63864314f0ef6c2ba7f (patch) | |
tree | 8af36e1dff941089acd6656fd474467bbd1a9526 /scripts/build | |
parent | b38fddfecd029a5903d16a1cd7ef7373e852bb67 (diff) |
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 <mingw.android@gmail.com>
Diffstat (limited to 'scripts/build')
-rwxr-xr-x[-rw-r--r--] | scripts/build/companion_libs/210-expat.sh | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh index 304482c..7801d33 100644..100755 --- 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} |