21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 # or visit www.oracle.com if you need additional information or have any |
22 # or visit www.oracle.com if you need additional information or have any |
23 # questions. |
23 # questions. |
24 # |
24 # |
25 |
25 |
|
26 # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) |
|
27 # If so, then append $1 to $2\ |
|
28 # Also set JVM_ARG_OK to true/false depending on outcome. |
26 AC_DEFUN([ADD_JVM_ARG_IF_OK], |
29 AC_DEFUN([ADD_JVM_ARG_IF_OK], |
27 [ |
30 [ |
28 # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) |
31 $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD |
29 # If so, then append $1 to $2 |
32 $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD |
30 FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn` |
33 OUTPUT=`$3 $1 -version 2>&1` |
31 FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""` |
34 FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` |
|
35 FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` |
32 if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then |
36 if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then |
33 $2="[$]$2 $1" |
37 $2="[$]$2 $1" |
|
38 JVM_ARG_OK=true |
|
39 else |
|
40 $ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD |
|
41 $ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD |
|
42 JVM_ARG_OK=false |
34 fi |
43 fi |
35 ]) |
44 ]) |
36 |
45 |
37 # This will make sure the given variable points to a full and proper |
46 # This will make sure the given variable points to a full and proper |
38 # path. This means: |
47 # path. This means: |