make/autoconf/basics.m4
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54490 bf07e140c49c
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   203       $1="$2:[$]$1"
   203       $1="$2:[$]$1"
   204     fi
   204     fi
   205   fi
   205   fi
   206 ])
   206 ])
   207 
   207 
       
   208 ################################################################################
       
   209 # This will make a path absolute. Assumes it's already a unix path. Also
       
   210 # resolves ~ to homedir.
       
   211 AC_DEFUN([BASIC_ABSOLUTE_PATH],
       
   212 [
       
   213   if test "x[$]$1" != x; then
       
   214     new_path="[$]$1"
       
   215 
       
   216     # Use eval to expand a potential ~. This technique does not work if there
       
   217     # are spaces in the path (which is valid at this point on Windows), so only
       
   218     # try to apply it if there is an actual ~ first in the path.
       
   219     if [ [[ "$new_path" = "~"* ]] ]; then
       
   220       eval new_path="$new_path"
       
   221       if test ! -f "$new_path" && test ! -d "$new_path"; then
       
   222         AC_MSG_ERROR([The new_path of $1, which resolves as "$new_path", is not found.])
       
   223       fi
       
   224     fi
       
   225 
       
   226     if test -d "$new_path"; then
       
   227       $1="`cd "$new_path"; $THEPWDCMD -L`"
       
   228     else
       
   229       dir="`$DIRNAME "$new_path"`"
       
   230       base="`$BASENAME "$new_path"`"
       
   231       $1="`cd "$dir"; $THEPWDCMD -L`/$base"
       
   232     fi
       
   233   fi
       
   234 ])
       
   235 
   208 ###############################################################################
   236 ###############################################################################
   209 # This will make sure the given variable points to a full and proper
   237 # This will make sure the given variable points to a full and proper
   210 # path. This means:
   238 # path. This means:
   211 # 1) There will be no spaces in the path. On unix platforms,
   239 # 1) There will be no spaces in the path. On unix platforms,
   212 #    spaces in the path will result in an error. On Windows,
   240 #    spaces in the path will result in an error. On Windows,
   215 #     cygwin).
   243 #     cygwin).
   216 # $1: The name of the variable to fix
   244 # $1: The name of the variable to fix
   217 AC_DEFUN([BASIC_FIXUP_PATH],
   245 AC_DEFUN([BASIC_FIXUP_PATH],
   218 [
   246 [
   219   # Only process if variable expands to non-empty
   247   # Only process if variable expands to non-empty
   220 
       
   221   if test "x[$]$1" != x; then
   248   if test "x[$]$1" != x; then
   222     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   249     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   223       BASIC_FIXUP_PATH_CYGWIN($1)
   250       BASIC_FIXUP_PATH_CYGWIN($1)
   224     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   251     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   225       BASIC_FIXUP_PATH_MSYS($1)
   252       BASIC_FIXUP_PATH_MSYS($1)
   232       if test "x$has_space" != x; then
   259       if test "x$has_space" != x; then
   233         AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
   260         AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
   234         AC_MSG_ERROR([Spaces are not allowed in this path.])
   261         AC_MSG_ERROR([Spaces are not allowed in this path.])
   235       fi
   262       fi
   236 
   263 
   237       # Use eval to expand a potential ~
   264       BASIC_ABSOLUTE_PATH(path)
   238       eval path="$path"
   265       $1="$path"
   239       if test ! -f "$path" && test ! -d "$path"; then
       
   240         AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
       
   241       fi
       
   242 
       
   243       if test -d "$path"; then
       
   244         $1="`cd "$path"; $THEPWDCMD -L`"
       
   245       else
       
   246         dir="`$DIRNAME "$path"`"
       
   247         base="`$BASENAME "$path"`"
       
   248         $1="`cd "$dir"; $THEPWDCMD -L`/$base"
       
   249       fi
       
   250     fi
   266     fi
   251   fi
   267   fi
   252 ])
   268 ])
   253 
   269 
   254 ###############################################################################
   270 ###############################################################################
   409   # AUTOCONF might be set in the environment by the user. Preserve for "make reconfigure".
   425   # AUTOCONF might be set in the environment by the user. Preserve for "make reconfigure".
   410   AC_SUBST(AUTOCONF)
   426   AC_SUBST(AUTOCONF)
   411   # Save the path variable before it gets changed
   427   # Save the path variable before it gets changed
   412   ORIGINAL_PATH="$PATH"
   428   ORIGINAL_PATH="$PATH"
   413   AC_SUBST(ORIGINAL_PATH)
   429   AC_SUBST(ORIGINAL_PATH)
   414   DATE_WHEN_CONFIGURED=`LANG=C date`
   430   DATE_WHEN_CONFIGURED=`date`
   415   AC_SUBST(DATE_WHEN_CONFIGURED)
   431   AC_SUBST(DATE_WHEN_CONFIGURED)
   416   AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
   432   AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
   417 ])
   433 ])
   418 
   434 
   419 ###############################################################################
   435 ###############################################################################
   471 
   487 
   472       # First remove it from the list of overridden variables, so we can test
   488       # First remove it from the list of overridden variables, so we can test
   473       # for unknown variables in the end.
   489       # for unknown variables in the end.
   474       CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
   490       CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
   475 
   491 
       
   492       tool_override=[$]$1
       
   493       AC_MSG_NOTICE([User supplied override $1="$tool_override"])
       
   494 
   476       # Check if we try to supply an empty value
   495       # Check if we try to supply an empty value
   477       if test "x[$]$1" = x; then
   496       if test "x$tool_override" = x; then
   478         AC_MSG_NOTICE([Setting user supplied tool $1= (no value)])
       
   479         AC_MSG_CHECKING([for $1])
   497         AC_MSG_CHECKING([for $1])
   480         AC_MSG_RESULT([disabled])
   498         AC_MSG_RESULT([disabled])
   481       else
   499       else
       
   500         # Split up override in command part and argument part
       
   501         tool_and_args=($tool_override)
       
   502         [ tool_command=${tool_and_args[0]} ]
       
   503         [ unset 'tool_and_args[0]' ]
       
   504         [ tool_args=${tool_and_args[@]} ]
       
   505 
   482         # Check if the provided tool contains a complete path.
   506         # Check if the provided tool contains a complete path.
   483         tool_specified="[$]$1"
   507         tool_basename="${tool_command##*/}"
   484         tool_basename="${tool_specified##*/}"
   508         if test "x$tool_basename" = "x$tool_command"; then
   485         if test "x$tool_basename" = "x$tool_specified"; then
       
   486           # A command without a complete path is provided, search $PATH.
   509           # A command without a complete path is provided, search $PATH.
   487           AC_MSG_NOTICE([Will search for user supplied tool $1=$tool_basename])
   510           AC_MSG_NOTICE([Will search for user supplied tool "$tool_basename"])
   488           AC_PATH_PROG($1, $tool_basename)
   511           AC_PATH_PROG($1, $tool_basename)
   489           if test "x[$]$1" = x; then
   512           if test "x[$]$1" = x; then
   490             AC_MSG_ERROR([User supplied tool $tool_basename could not be found])
   513             AC_MSG_ERROR([User supplied tool $1="$tool_basename" could not be found])
   491           fi
   514           fi
   492         else
   515         else
   493           # Otherwise we believe it is a complete path. Use it as it is.
   516           # Otherwise we believe it is a complete path. Use it as it is.
   494           AC_MSG_NOTICE([Will use user supplied tool $1=$tool_specified])
   517           AC_MSG_NOTICE([Will use user supplied tool "$tool_command"])
   495           AC_MSG_CHECKING([for $1])
   518           AC_MSG_CHECKING([for $tool_command])
   496           if test ! -x "$tool_specified"; then
   519           if test ! -x "$tool_command"; then
   497             AC_MSG_RESULT([not found])
   520             AC_MSG_RESULT([not found])
   498             AC_MSG_ERROR([User supplied tool $1=$tool_specified does not exist or is not executable])
   521             AC_MSG_ERROR([User supplied tool $1="$tool_command" does not exist or is not executable])
   499           fi
   522           fi
   500           AC_MSG_RESULT([$tool_specified])
   523            $1="$tool_command"
       
   524           AC_MSG_RESULT([found])
       
   525         fi
       
   526         if test "x$tool_args" != x; then
       
   527           # If we got arguments, re-append them to the command after the fixup.
       
   528           $1="[$]$1 $tool_args"
   501         fi
   529         fi
   502       fi
   530       fi
   503     fi
   531     fi
   504     $3
   532     $3
   505   fi
   533   fi
  1132     TAR_TYPE="bsd"
  1160     TAR_TYPE="bsd"
  1133   elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
  1161   elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
  1134     TAR_TYPE="bsd"
  1162     TAR_TYPE="bsd"
  1135   elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
  1163   elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
  1136     TAR_TYPE="solaris"
  1164     TAR_TYPE="solaris"
       
  1165   elif test "x$OPENJDK_BUILD_OS" = "xaix"; then
       
  1166     TAR_TYPE="aix"
  1137   fi
  1167   fi
  1138   AC_MSG_CHECKING([what type of tar was found])
  1168   AC_MSG_CHECKING([what type of tar was found])
  1139   AC_MSG_RESULT([$TAR_TYPE])
  1169   AC_MSG_RESULT([$TAR_TYPE])
  1140 
  1170 
  1141   TAR_CREATE_FILE_PARAM=""
  1171   TAR_CREATE_FILE_PARAM=""
  1145     TAR_SUPPORTS_TRANSFORM="true"
  1175     TAR_SUPPORTS_TRANSFORM="true"
  1146     if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
  1176     if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
  1147       # When using gnu tar for Solaris targets, need to use compatibility mode
  1177       # When using gnu tar for Solaris targets, need to use compatibility mode
  1148       TAR_CREATE_EXTRA_PARAM="--format=ustar"
  1178       TAR_CREATE_EXTRA_PARAM="--format=ustar"
  1149     fi
  1179     fi
       
  1180   elif test "x$TAR_TYPE" = "aix"; then
       
  1181     # -L InputList of aix tar: name of file listing the files and directories
       
  1182     # that need to be   archived or extracted
       
  1183     TAR_INCLUDE_PARAM="L"
       
  1184     TAR_SUPPORTS_TRANSFORM="false"
  1150   else
  1185   else
  1151     TAR_INCLUDE_PARAM="I"
  1186     TAR_INCLUDE_PARAM="I"
  1152     TAR_SUPPORTS_TRANSFORM="false"
  1187     TAR_SUPPORTS_TRANSFORM="false"
  1153   fi
  1188   fi
  1154   AC_SUBST(TAR_TYPE)
  1189   AC_SUBST(TAR_TYPE)