X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fbabeltrace%2Fbuild.sh;h=12900c74fe0e07c66ce6c649e9dd85fa31df4ec6;hb=52be573959303e1d3ca63565eecdba39adb7635c;hp=0c3e6e77dcfd0962cda780d360eb771d1434403f;hpb=c9243fd7ec550ffb681c41bd33387b5c2ae7c323;p=lttng-ci.git diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh index 0c3e6e7..12900c7 100755 --- a/scripts/babeltrace/build.sh +++ b/scripts/babeltrace/build.sh @@ -70,6 +70,25 @@ verne() { [ "$res" -ne "0" ] } +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 @@ -121,9 +140,6 @@ PREFIX="/build" LIBDIR="lib" LIBDIR_ARCH="$LIBDIR" -# Force the normal Python install layout without 'local' on Debian / Ubuntu -export DEB_PYTHON_INSTALL_LAYOUT="deb" - # RHEL and SLES both use lib64 but don't bother shipping a default autoconf # site config that matches this. if [[ ( -f /etc/redhat-release || -f /etc/products.d/SLES.prod || -f /etc/yocto-release ) ]]; then @@ -182,6 +198,7 @@ macos*) export TAR=tar export NPROC="getconf _NPROCESSORS_ONLN" export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" + export CFLAGS="$CFLAGS -Wno-\#pragma-messages" # Fix warnings with clang14 export CPPFLAGS="-I/opt/local/include" export LDFLAGS="-L/opt/local/lib" export PYTHON="python3" @@ -210,8 +227,16 @@ freebsd*) ;; esac +# Some warning flags are very dumb in GCC 4.8 on SLES12 / EL7, disable them +# even if they are available. +if [[ $platform = sles12sp5* ]] || [[ $platform = el7* ]]; then + CFLAGS="$CFLAGS -Wno-missing-field-initializers -Wno-shadow" + CXXFLAGS="$CXXFLAGS -Wno-missing-field-initializers -Wno-shadow" +fi + # Print build env details print_header "Build environment details" +print_hardware || true print_os || true print_tooling || true @@ -321,7 +346,7 @@ oot) print_header "Build: Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure @@ -336,7 +361,7 @@ dist) $MAKE dist # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Extract the distribution tar in the build directory, @@ -351,14 +376,14 @@ oot-dist) print_header "Build: Distribution Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Run configure out of tree and generate the tar file "$SRCDIR/configure" || failed_configure $MAKE dist - dist_srcdir="$(mktemp -d)" + dist_srcdir="$(mktemp_compat -d)" cd "$dist_srcdir" # Extract the distribution tar in the new source directory, @@ -366,7 +391,7 @@ oot-dist) $TAR xvf "$builddir"/*.tar.* --strip 1 # Create and enter a second temporary build directory - builddir="$(mktemp -d)" + builddir="$(mktemp_compat -d)" cd "$builddir" # Run configure from the extracted distribution tar,