common/autoconf/basics.m4

Print this page




  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"
  63     
  64     if test ! -f "$path" && test ! -d "$path"; then
  65       AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
  66     fi
  67 
  68     has_space=`$ECHO "$path" | $GREP " "`
  69     if test "x$has_space" != x; then
  70       AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
  71       AC_MSG_ERROR([Spaces are not allowed in this path.])
  72     fi








  73   fi
  74 ])
  75 
  76 # This will make sure the given variable points to a executable
  77 # with a full and proper path. This means:
  78 # 1) There will be no spaces in the path. On posix platforms,
  79 #    spaces in the path will result in an error. On Windows,
  80 #    the path will be rewritten using short-style to be space-free.
  81 # 2) The path will be absolute, and it will be in unix-style (on
  82 #     cygwin).
  83 # Any arguments given to the executable is preserved.
  84 # If the input variable does not have a directory specification, then
  85 # it need to be in the PATH.
  86 # $1: The name of the variable to fix
  87 AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
  88 [
  89   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  90     BASIC_FIXUP_EXECUTABLE_CYGWIN($1)
  91   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  92     BASIC_FIXUP_EXECUTABLE_MSYS($1)




  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"





  63     has_space=`$ECHO "$path" | $GREP " "`
  64     if test "x$has_space" != x; then
  65       AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
  66       AC_MSG_ERROR([Spaces are not allowed in this path.])
  67     fi
  68 
  69     # Use eval to expand a potential ~
  70     eval path="$path"
  71     if test ! -f "$path" && test ! -d "$path"; then
  72       AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
  73     fi
  74 
  75     $1="`cd "$path"; $THEPWDCMD`" 
  76   fi
  77 ])
  78 
  79 # This will make sure the given variable points to a executable
  80 # with a full and proper path. This means:
  81 # 1) There will be no spaces in the path. On posix platforms,
  82 #    spaces in the path will result in an error. On Windows,
  83 #    the path will be rewritten using short-style to be space-free.
  84 # 2) The path will be absolute, and it will be in unix-style (on
  85 #     cygwin).
  86 # Any arguments given to the executable is preserved.
  87 # If the input variable does not have a directory specification, then
  88 # it need to be in the PATH.
  89 # $1: The name of the variable to fix
  90 AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
  91 [
  92   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  93     BASIC_FIXUP_EXECUTABLE_CYGWIN($1)
  94   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  95     BASIC_FIXUP_EXECUTABLE_MSYS($1)