ansible: Install log4j from upstream release on SLES12SP5
[lttng-ci.git] / scripts / lttng-tools / build.sh
index 6b88a1d278cf6f9a1ebfd95840cd7df8e5f88b37..bb2b6b59e085e603b5c399c335469c299753468c 100755 (executable)
@@ -63,6 +63,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
 
@@ -281,6 +300,10 @@ if [ -d "$WORKSPACE/src/lttng-modules" ]; then
     $MAKE -j"$($NPROC)" V=1
     $MAKE modules_install V=1
     depmod
+
+    if [[ -f /etc/products.d/SLES.prod ]] ; then
+        echo 'allow_unsupported_modules 1' > /etc/modprobe.d/10-unsupported-modules.conf
+    fi
 fi
 
 # Print build env details
@@ -355,6 +378,11 @@ relayd-only)
     print_header "Conf: Relayd only"
 
     CONF_OPTS+=("--disable-bin-lttng" "--disable-bin-lttng-consumerd" "--disable-bin-lttng-crash" "--disable-bin-lttng-sessiond" "--disable-extras" "--disable-man-pages" "--without-lttng-ust")
+
+    # A config option for lib-lttng-ctl was added in 2.14
+    if vergte "$PACKAGE_VERSION" "2.14"; then
+        CONF_OPTS+=("--disable-lib-lttng-ctl")
+    fi
     ;;
 
 debug-rcu)
@@ -390,7 +418,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
@@ -406,7 +434,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,
@@ -421,14 +449,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" "${DIST_CONF_OPTS[@]}" || 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,
@@ -436,7 +464,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,
This page took 0.024101 seconds and 4 git commands to generate.