common/autoconf/basics.m4

Print this page




   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  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
  23 # questions.
  24 #
  25 



  26 AC_DEFUN([ADD_JVM_ARG_IF_OK],
  27 [
  28     # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
  29     # If so, then append $1 to $2
  30     FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn`
  31     FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""`

  32     if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
  33         $2="[$]$2 $1"





  34     fi
  35 ])
  36 
  37 # This will make sure the given variable points to a full and proper
  38 # path. This means:
  39 # 1) There will be no spaces in the path. On posix platforms,
  40 #    spaces in the path will result in an error. On Windows,
  41 #    the path will be rewritten using short-style to be space-free.
  42 # 2) The path will be absolute, and it will be in unix-style (on
  43 #     cygwin).
  44 # $1: The name of the variable to fix
  45 AC_DEFUN([BASIC_FIXUP_PATH],
  46 [
  47   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  48     BASIC_FIXUP_PATH_CYGWIN($1)
  49   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  50     BASIC_FIXUP_PATH_MSYS($1)
  51   else
  52     # We're on a posix platform. Hooray! :)
  53     path="[$]$1"




   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  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
  23 # questions.
  24 #
  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.
  29 AC_DEFUN([ADD_JVM_ARG_IF_OK],
  30 [
  31     $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD
  32     $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD
  33     OUTPUT=`$3 $1 -version 2>&1`
  34     FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
  35     FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
  36     if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
  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
  43     fi
  44 ])
  45 
  46 # This will make sure the given variable points to a full and proper
  47 # path. This means:
  48 # 1) There will be no spaces in the path. On posix platforms,
  49 #    spaces in the path will result in an error. On Windows,
  50 #    the path will be rewritten using short-style to be space-free.
  51 # 2) The path will be absolute, and it will be in unix-style (on
  52 #     cygwin).
  53 # $1: The name of the variable to fix
  54 AC_DEFUN([BASIC_FIXUP_PATH],
  55 [
  56   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  57     BASIC_FIXUP_PATH_CYGWIN($1)
  58   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  59     BASIC_FIXUP_PATH_MSYS($1)
  60   else
  61     # We're on a posix platform. Hooray! :)
  62     path="[$]$1"