X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fbinutils-gdb%2Fbuild.sh;h=3d7c561a477f60e75105289a7c2f9ca803a8fe5a;hb=52be573959303e1d3ca63565eecdba39adb7635c;hp=94bded9d9d0962cae4f434cde9ea7190111b9bdd;hpb=f8743131d1055dff62c315373c9623b23fc9a44a;p=lttng-ci.git diff --git a/scripts/binutils-gdb/build.sh b/scripts/binutils-gdb/build.sh index 94bded9..3d7c561 100755 --- a/scripts/binutils-gdb/build.sh +++ b/scripts/binutils-gdb/build.sh @@ -17,6 +17,44 @@ set -exu +mktemp_compat() { + case "$platform" in + macos*) + # On MacOSX, mktemp doesn't respect TMPDIR in the same way as many + # other systems. Use the final positional argument to force the + # tempfile or tempdir to be created inside $TMPDIR, which must + # already exist. + if [ -n "${TMPDIR}" ] ; then + mktemp "${@}" "${TMPDIR}/tmp.XXXXXXXXXX" + else + mktemp "${@}" + fi + ;; + *) + mktemp "${@}" + ;; + esac +} + +print_header() { + set +x + + local message=" $1 " + local message_len + local padding_len + + message_len="${#message}" + padding_len=$(( (80 - (message_len)) / 2 )) + + printf '\n'; printf -- '#%.0s' {1..80}; printf '\n' + printf -- '-%.0s' {1..80}; printf '\n' + printf -- '#%.0s' $(seq 1 $padding_len); printf '%s' "$message"; printf -- '#%.0s' $(seq 1 $padding_len); printf '\n' + printf -- '-%.0s' {1..80}; printf '\n' + printf -- '#%.0s' {1..80}; printf '\n\n' + + set -x +} + failed_configure() { # Assume we are in the configured build directory echo "#################### BEGIN config.log ####################" @@ -200,6 +238,8 @@ macos-*) esac # Print build env details +print_header "Build environment details" +print_hardware || true print_os || true print_tooling || true @@ -262,7 +302,7 @@ case "$build" in echo "Out of tree build" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure