diff options
author | Alexey Neyman <stilor@att.net> | 2019-03-17 18:37:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-17 18:37:43 (GMT) |
commit | 89ba62fb1daad737cdb33c3b1ef69092beeaab0b (patch) | |
tree | 34ea6400ccf438cd9de5d42afe636fde0a011f50 /scripts/build/companion_tools/510-bison.sh | |
parent | c4126d9397353a74ca5aff602dd2c0c527e1dd07 (diff) | |
parent | e4475c33df8702ec780f24ac482d5d9c2fc72d6d (diff) |
Merge pull request #1163 from stilor/docker-fixescrosstool-ng-1.24.0-rc3
Fix build on CentOS6/7
Diffstat (limited to 'scripts/build/companion_tools/510-bison.sh')
-rw-r--r-- | scripts/build/companion_tools/510-bison.sh | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/scripts/build/companion_tools/510-bison.sh b/scripts/build/companion_tools/510-bison.sh new file mode 100644 index 0000000..9379ea8 --- /dev/null +++ b/scripts/build/companion_tools/510-bison.sh @@ -0,0 +1,66 @@ +# Build script for bison + +do_companion_tools_bison_get() +{ + CT_Fetch BISON +} + +do_companion_tools_bison_extract() +{ + CT_ExtractPatch BISON +} + +do_companion_tools_bison_for_build() +{ + CT_DoStep INFO "Installing bison for build" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-bison-build" + do_bison_backend \ + host=${CT_BUILD} \ + prefix="${CT_BUILD_COMPTOOLS_DIR}" \ + cflags="${CT_CFLAGS_FOR_BUILD}" \ + ldflags="${CT_LDFLAGS_FOR_BUILD}" + CT_Popd + CT_EndStep +} + +do_companion_tools_bison_for_host() +{ + CT_DoStep INFO "Installing bison for host" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-bison-host" + do_bison_backend \ + host=${CT_HOST} \ + prefix="${CT_PREFIX_DIR}" \ + cflags="${CT_CFLAGS_FOR_HOST}" \ + ldflags="${CT_LDFLAGS_FOR_HOST}" + CT_Popd + CT_EndStep +} + +do_bison_backend() +{ + local host + local prefix + local cflags + local ldflags + local -a extra_config + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + CT_DoLog EXTRA "Configuring bison" + CT_DoExecLog CFG \ + CFLAGS="${cflags}" \ + LDFLAGS="${ldflags}" \ + ${CONFIG_SHELL} \ + "${CT_SRC_DIR}/bison/configure" \ + --host="${host}" \ + --prefix="${prefix}" \ + "${extra_config[@]}" + + CT_DoLog EXTRA "Building bison" + CT_DoExecLog ALL make + + CT_DoLog EXTRA "Installing bison" + CT_DoExecLog ALL make install +} |