make/common/shared/Defs-windows.gmk

changeset 406
0a5931be9176
parent 240
f90b3e014e83
     1.1 --- a/make/common/shared/Defs-windows.gmk	Thu Oct 11 16:57:31 2012 -0700
     1.2 +++ b/make/common/shared/Defs-windows.gmk	Tue Oct 23 10:10:39 2012 -0700
     1.3 @@ -91,6 +91,15 @@
     1.4  $(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
     1.5  endef
     1.6  else
     1.7 +ifdef USING_MSYS
     1.8 +DOSPATH_CMD:=$(shell cd $(JDK_TOPDIR) 2> $(DEV_NULL) && pwd)/make/tools/msys_build_scripts/dospath.sh
     1.9 +define FullPath
    1.10 +$(subst \,/,$(shell $(DOSPATH_CMD) $1))
    1.11 +endef
    1.12 +define OptFullPath
    1.13 +$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
    1.14 +endef
    1.15 +else
    1.16  # Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
    1.17  define FullPath
    1.18  $(shell cd $1 2> $(DEV_NULL) && pwd)
    1.19 @@ -99,6 +108,7 @@
    1.20  $(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
    1.21  endef
    1.22  endif
    1.23 +endif
    1.24  
    1.25  # System drive
    1.26  ifdef SYSTEMDRIVE
    1.27 @@ -112,14 +122,21 @@
    1.28  
    1.29  # UNIXCOMMAND_PATH: path to where the most common Unix commands are.
    1.30  #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
    1.31 -ifndef UNIXCOMMAND_PATH
    1.32 -  ifdef ALT_UNIXCOMMAND_PATH
    1.33 +#        With cygwin, use this as is; don't use FullPath on it.
    1.34 +ifdef ALT_UNIXCOMMAND_PATH
    1.35 +  ifdef USING_CYGWIN
    1.36 +    UNIXCOMMAND_PATH       :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH))
    1.37 +  else
    1.38      xALT_UNIXCOMMAND_PATH  :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
    1.39      fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
    1.40      UNIXCOMMAND_PATH       :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
    1.41 +  endif
    1.42 +else
    1.43 +  ifdef USING_CYGWIN
    1.44 +    UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
    1.45    else
    1.46 -    ifdef USING_CYGWIN
    1.47 -      UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
    1.48 +    ifdef USING_MSYS
    1.49 +      UNIXCOMMAND_PATH :=$(call PrefixPath,/bin)
    1.50      else
    1.51        ifdef ROOTDIR
    1.52          xROOTDIR :="$(subst \,/,$(ROOTDIR))"
    1.53 @@ -131,41 +148,35 @@
    1.54        ifneq ($(_rootdir),)
    1.55          UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
    1.56        endif
    1.57 -    endif
    1.58 -  endif
    1.59 -  UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
    1.60 -  export UNIXCOMMAND_PATH
    1.61 +    endif # USING_MSYS
    1.62 +  endif # USING_CYGWIN
    1.63  endif
    1.64 +UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
    1.65 +export UNIXCOMMAND_PATH
    1.66  
    1.67  # Get version of MKS or CYGWIN
    1.68 -ifdef USING_CYGWIN
    1.69 -  ifndef CYGWIN_VER
    1.70 -    _CYGWIN_VER :=$(shell $(UNAME))
    1.71 -    CYGWIN_VER  :=$(call GetVersion,$(_CYGWIN_VER))
    1.72 -    export CYGWIN_VER
    1.73 +ifdef USING_MKS
    1.74 +  _MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
    1.75 +  MKS_VER  :=$(call GetVersion,$(_MKS_VER))
    1.76 +  # At this point, we can re-define FullPath to use DOSNAME_CMD
    1.77 +  CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
    1.78 +  TRY_DOSNAME:=false
    1.79 +  ifeq ($(CHECK_MKS87),same)
    1.80 +    TRY_DOSNAME:=true
    1.81    endif
    1.82 -else # MKS
    1.83 -_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
    1.84 -MKS_VER  :=$(call GetVersion,$(_MKS_VER))
    1.85 -# At this point, we can re-define FullPath to use DOSNAME_CMD
    1.86 -CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
    1.87 -TRY_DOSNAME:=false
    1.88 -ifeq ($(CHECK_MKS87),same)
    1.89 -TRY_DOSNAME:=true
    1.90 -endif
    1.91 -# Newer should be ok
    1.92 -ifeq ($(CHECK_MKS87),newer)
    1.93 -TRY_DOSNAME:=true
    1.94 -endif
    1.95 -ifeq ($(TRY_DOSNAME),true)
    1.96 -ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
    1.97 -_DOSNAME=$(UNIXCOMMAND_PATH)dosname
    1.98 -DOSNAME_CMD:=$(_DOSNAME) -s
    1.99 +  # Newer should be ok
   1.100 +  ifeq ($(CHECK_MKS87),newer)
   1.101 +    TRY_DOSNAME:=true
   1.102 +  endif
   1.103 +  ifeq ($(TRY_DOSNAME),true)
   1.104 +    ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
   1.105 +      _DOSNAME=$(UNIXCOMMAND_PATH)dosname
   1.106 +      DOSNAME_CMD:=$(_DOSNAME) -s
   1.107  define FullPath
   1.108  $(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
   1.109  endef
   1.110 -endif # test dosname -s
   1.111 -endif # TRY_DOSNAME
   1.112 +    endif # test dosname -s
   1.113 +  endif # TRY_DOSNAME
   1.114  endif # MKS
   1.115  
   1.116  # We try to get references to what we need via the default component
   1.117 @@ -240,6 +251,8 @@
   1.118  # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
   1.119  #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
   1.120  ifndef DEVTOOLS_PATH
   1.121 +  # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
   1.122 +  #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
   1.123    ifdef ALT_DEVTOOLS_PATH
   1.124      xALT_DEVTOOLS_PATH  :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
   1.125      fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
   1.126 @@ -248,10 +261,14 @@
   1.127      ifdef USING_CYGWIN
   1.128        DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
   1.129      else
   1.130 -      xDEVTOOLS_PATH  :="$(_system_drive)/utils"
   1.131 -      fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
   1.132 -      DEVTOOLS_PATH  :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
   1.133 -    endif
   1.134 +      ifdef USING_MSYS
   1.135 +        DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
   1.136 +      else
   1.137 +        xDEVTOOLS_PATH  :="$(_system_drive)/utils"
   1.138 +        fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
   1.139 +        DEVTOOLS_PATH  :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
   1.140 +      endif # USING_MSYS
   1.141 +    endif # USING_CYGWIN
   1.142    endif
   1.143    DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
   1.144    export DEVTOOLS_PATH

mercurial