X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fliburcu%2Fbuild.sh;h=d7ae0d1641d75edf6c52d0a8935f4d681cca79bc;hb=4955549e270f70e6403bb44fb16016dade5e18c7;hp=b1dcb012e67db5043f27d81a60521d4e49da4180;hpb=2c34ea1488ea3241038be5ef41a099ea14d42041;p=lttng-ci.git diff --git a/scripts/liburcu/build.sh b/scripts/liburcu/build.sh index b1dcb01..d7ae0d1 100755 --- a/scripts/liburcu/build.sh +++ b/scripts/liburcu/build.sh @@ -61,6 +61,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 @@ -198,6 +217,7 @@ esac # Print build env details print_header "Build environment details" +print_hardware || true print_os || true print_tooling || true @@ -243,6 +263,12 @@ debug-rcu) fi ;; +atomic-builtins) + print_header "Conf: Enable the use of compiler atomic builtins." + + CONF_OPTS+=("--enable-compiler-atomic-builtins") + ;; + *) print_header "Conf: Standard" ;; @@ -261,7 +287,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 @@ -276,7 +302,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, @@ -291,14 +317,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, @@ -306,7 +332,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,