From: Marc Fournier Date: Tue, 1 Nov 2016 10:54:26 +0000 (+0100) Subject: configure.ac: make finding java deterministic X-Git-Tag: collectd-5.5.3~7 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=55ef2778ade050e2924eeb027c98feea103f1585 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 --- 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"