From 55ef2778ade050e2924eeb027c98feea103f1585 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Tue, 1 Nov 2016 11:54:26 +0100 Subject: [PATCH] configure.ac: make finding java deterministic The sort order of the `find` command proves to be dependent on external factors, which makes `./configure` pick different java versions on different systems, making the whole build non-reproducible (see https://reproducible-builds.org/ for more details). Adding a call to `sort`, with the locale forced, fixes this issue. Fixes: #1523 --- configure.ac | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index d214d57a..c07687d2 100644 --- a/configure.ac +++ b/configure.ac @@ -2259,7 +2259,7 @@ then if test -d "$with_java_home" then AC_MSG_CHECKING([for jni.h]) - TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` + TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then AC_MSG_RESULT([found in $TMPVAR]) @@ -2269,7 +2269,7 @@ then fi AC_MSG_CHECKING([for jni_md.h]) - TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` + TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then AC_MSG_RESULT([found in $TMPVAR]) @@ -2279,7 +2279,7 @@ then fi AC_MSG_CHECKING([for libjvm.so]) - TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` + TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then AC_MSG_RESULT([found in $TMPVAR]) @@ -2291,7 +2291,7 @@ then if test "x$JAVAC" = "x" then AC_MSG_CHECKING([for javac]) - TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1` + TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then JAVAC="$TMPVAR" @@ -2303,7 +2303,7 @@ then if test "x$JAR" = "x" then AC_MSG_CHECKING([for jar]) - TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1` + TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then JAR="$TMPVAR" -- 2.11.0