2010-01-12 20:09:30 +00:00
|
|
|
# Wrapper to build the companion tools facilities
|
|
|
|
|
|
|
|
# List all companion tools facilities, and parse their scripts
|
|
|
|
CT_COMP_TOOLS_FACILITY_LIST=
|
|
|
|
for f in "${CT_LIB_DIR}/scripts/build/companion_tools/"*.sh; do
|
|
|
|
_f="$(basename "${f}" .sh)"
|
|
|
|
_f="${_f#???-}"
|
2017-07-07 06:10:40 +00:00
|
|
|
__f="CT_COMP_TOOLS_${_f^^}"
|
2010-01-12 20:09:30 +00:00
|
|
|
if [ "${!__f}" = "y" ]; then
|
2016-11-23 02:10:23 +00:00
|
|
|
CT_DoLog DEBUG "Enabling companion tool '${_f}'"
|
2010-01-12 20:09:30 +00:00
|
|
|
. "${f}"
|
|
|
|
CT_COMP_TOOLS_FACILITY_LIST="${CT_COMP_TOOLS_FACILITY_LIST} ${_f}"
|
|
|
|
else
|
2016-11-23 02:10:23 +00:00
|
|
|
CT_DoLog DEBUG "Disabling companion tool '${_f}'"
|
2010-01-12 20:09:30 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Download the companion tools facilities
|
|
|
|
do_companion_tools_get() {
|
|
|
|
for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
|
|
|
|
do_companion_tools_${f}_get
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# Extract and patch the companion tools facilities
|
|
|
|
do_companion_tools_extract() {
|
|
|
|
for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
|
|
|
|
do_companion_tools_${f}_extract
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2016-11-29 00:55:22 +00:00
|
|
|
# Build the companion tools facilities for build
|
2016-11-23 02:10:23 +00:00
|
|
|
do_companion_tools_for_build() {
|
2010-01-12 20:09:30 +00:00
|
|
|
for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
|
2016-11-23 02:10:23 +00:00
|
|
|
do_companion_tools_${f}_for_build
|
2010-01-12 20:09:30 +00:00
|
|
|
done
|
|
|
|
}
|
2016-11-29 00:55:22 +00:00
|
|
|
|
|
|
|
# Build the companion tools facilities for host
|
|
|
|
do_companion_tools_for_host() {
|
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
Rework configure logic wrt GNU autotools
Rather than requiring them of a certain version, detect if they are present
(and have sufficient version) and select an appropriate companion tool
otherwise. The reason is that, for example, most recent gettext requires
automake 1.15, but the newest available CentOS has 1.13. Hence, the option
to "upgrade your system" does not apply, and the warning comment above
the companion tools is rather scary.
With this approach, it will work out of the box - either by using the host's
tools, or by building them as needed. Note that the user can still change
the setting in the config.
While there, propagate the new version checking macro to awk/bash/host binutils,
and switch from --with-foo=xxx to officially blessed FOO=xxx: the latter
does not require checking for bogus values (i.e., --with-foo, --without-foo)
and AC_PROG_* macros recognize the corresponding settings without further
modifications. For now, I kept --with-foo=, if only to complain and steer
people to the new way. To be cleaned up after a release.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-27 05:05:17 +00:00
|
|
|
# For native/cross, build==host, skip: the tools were built
|
|
|
|
# earlier by do_companion_tools_for_build.
|
2016-11-29 00:55:22 +00:00
|
|
|
native|cross)
|
|
|
|
return
|
|
|
|
;;
|
Rework configure logic wrt GNU autotools
Rather than requiring them of a certain version, detect if they are present
(and have sufficient version) and select an appropriate companion tool
otherwise. The reason is that, for example, most recent gettext requires
automake 1.15, but the newest available CentOS has 1.13. Hence, the option
to "upgrade your system" does not apply, and the warning comment above
the companion tools is rather scary.
With this approach, it will work out of the box - either by using the host's
tools, or by building them as needed. Note that the user can still change
the setting in the config.
While there, propagate the new version checking macro to awk/bash/host binutils,
and switch from --with-foo=xxx to officially blessed FOO=xxx: the latter
does not require checking for bogus values (i.e., --with-foo, --without-foo)
and AC_PROG_* macros recognize the corresponding settings without further
modifications. For now, I kept --with-foo=, if only to complain and steer
people to the new way. To be cleaned up after a release.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-27 05:05:17 +00:00
|
|
|
# For canadian/cross-native, only need to build tools for host
|
|
|
|
# if explicitly requested.
|
2016-11-29 00:55:22 +00:00
|
|
|
canadian|cross-native)
|
|
|
|
if [ -z "${CT_COMP_TOOLS_FOR_HOST}" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
|
|
|
|
do_companion_tools_${f}_for_host
|
|
|
|
done
|
|
|
|
}
|