--- a/common/autoconf/basics.m4 Wed Jul 05 18:56:23 2017 +0200
+++ b/common/autoconf/basics.m4 Wed May 22 17:26:31 2013 +0200
@@ -23,14 +23,23 @@
# questions.
#
+# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
+# If so, then append $1 to $2\
+# Also set JVM_ARG_OK to true/false depending on outcome.
AC_DEFUN([ADD_JVM_ARG_IF_OK],
[
- # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
- # If so, then append $1 to $2
- FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn`
- FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""`
+ $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD
+ $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD
+ OUTPUT=`$3 $1 -version 2>&1`
+ FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
+ FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
$2="[$]$2 $1"
+ JVM_ARG_OK=true
+ else
+ $ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD
+ $ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD
+ JVM_ARG_OK=false
fi
])