corba/make/common/shared/Defs-windows.gmk
changeset 14095 ab1fb3836ddb
parent 7672 aec650969dd5
equal deleted inserted replaced
14066:cdaa6122185f 14095:ab1fb3836ddb
    89 endef
    89 endef
    90 define OptFullPath
    90 define OptFullPath
    91 $(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
    91 $(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
    92 endef
    92 endef
    93 else
    93 else
       
    94 ifdef USING_MSYS
       
    95 DOSPATH_CMD:=$(shell cd $(JDK_TOPDIR) 2> $(DEV_NULL) && pwd)/make/tools/msys_build_scripts/dospath.sh
       
    96 define FullPath
       
    97 $(subst \,/,$(shell $(DOSPATH_CMD) $1))
       
    98 endef
       
    99 define OptFullPath
       
   100 $(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
       
   101 endef
       
   102 else
    94 # Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
   103 # Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
    95 define FullPath
   104 define FullPath
    96 $(shell cd $1 2> $(DEV_NULL) && pwd)
   105 $(shell cd $1 2> $(DEV_NULL) && pwd)
    97 endef
   106 endef
    98 define OptFullPath
   107 define OptFullPath
    99 $(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
   108 $(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
   100 endef
   109 endef
   101 endif
   110 endif
       
   111 endif
   102 
   112 
   103 # System drive
   113 # System drive
   104 ifdef SYSTEMDRIVE
   114 ifdef SYSTEMDRIVE
   105   _system_drive =$(SYSTEMDRIVE)
   115   _system_drive =$(SYSTEMDRIVE)
   106 else
   116 else
   110 endif
   120 endif
   111 _system_drive:=$(call CheckValue,_system_drive,C:)
   121 _system_drive:=$(call CheckValue,_system_drive,C:)
   112 
   122 
   113 # UNIXCOMMAND_PATH: path to where the most common Unix commands are.
   123 # UNIXCOMMAND_PATH: path to where the most common Unix commands are.
   114 #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
   124 #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
   115 ifndef UNIXCOMMAND_PATH
   125 #        With cygwin, use this as is; don't use FullPath on it.
   116   ifdef ALT_UNIXCOMMAND_PATH
   126 ifdef ALT_UNIXCOMMAND_PATH
       
   127   ifdef USING_CYGWIN
       
   128     UNIXCOMMAND_PATH       :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH))
       
   129   else
   117     xALT_UNIXCOMMAND_PATH  :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
   130     xALT_UNIXCOMMAND_PATH  :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
   118     fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
   131     fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
   119     UNIXCOMMAND_PATH       :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
   132     UNIXCOMMAND_PATH       :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
   120   else
   133   endif
   121     ifdef USING_CYGWIN
   134 else
   122       UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
   135   ifdef USING_CYGWIN
       
   136     UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
       
   137   else
       
   138     ifdef USING_MSYS
       
   139       UNIXCOMMAND_PATH :=$(call PrefixPath,/bin)
   123     else
   140     else
   124       ifdef ROOTDIR
   141       ifdef ROOTDIR
   125         xROOTDIR :="$(subst \,/,$(ROOTDIR))"
   142         xROOTDIR :="$(subst \,/,$(ROOTDIR))"
   126         _rootdir :=$(call FullPath,$(xROOTDIR))
   143         _rootdir :=$(call FullPath,$(xROOTDIR))
   127       else
   144       else
   129         _rootdir :=$(call FullPath,$(xROOTDIR))
   146         _rootdir :=$(call FullPath,$(xROOTDIR))
   130       endif
   147       endif
   131       ifneq ($(_rootdir),)
   148       ifneq ($(_rootdir),)
   132         UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
   149         UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
   133       endif
   150       endif
   134     endif
   151     endif # USING_MSYS
   135   endif
   152   endif # USING_CYGWIN
   136   UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
   153 endif
   137   export UNIXCOMMAND_PATH
   154 UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
   138 endif
   155 export UNIXCOMMAND_PATH
   139 
   156 
   140 # Get version of MKS or CYGWIN
   157 # Get version of MKS or CYGWIN
   141 ifdef USING_CYGWIN
   158 ifdef USING_MKS
   142   ifndef CYGWIN_VER
   159   _MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
   143     _CYGWIN_VER :=$(shell $(UNAME))
   160   MKS_VER  :=$(call GetVersion,$(_MKS_VER))
   144     CYGWIN_VER  :=$(call GetVersion,$(_CYGWIN_VER))
   161   # At this point, we can re-define FullPath to use DOSNAME_CMD
   145     export CYGWIN_VER
   162   CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
   146   endif
   163   TRY_DOSNAME:=false
   147 else # MKS
   164   ifeq ($(CHECK_MKS87),same)
   148 _MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
   165     TRY_DOSNAME:=true
   149 MKS_VER  :=$(call GetVersion,$(_MKS_VER))
   166   endif
   150 # At this point, we can re-define FullPath to use DOSNAME_CMD
   167   # Newer should be ok
   151 CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
   168   ifeq ($(CHECK_MKS87),newer)
   152 TRY_DOSNAME:=false
   169     TRY_DOSNAME:=true
   153 ifeq ($(CHECK_MKS87),same)
   170   endif
   154 TRY_DOSNAME:=true
   171   ifeq ($(TRY_DOSNAME),true)
   155 endif
   172     ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
   156 # Newer should be ok
   173       _DOSNAME=$(UNIXCOMMAND_PATH)dosname
   157 ifeq ($(CHECK_MKS87),newer)
   174       DOSNAME_CMD:=$(_DOSNAME) -s
   158 TRY_DOSNAME:=true
       
   159 endif
       
   160 ifeq ($(TRY_DOSNAME),true)
       
   161 ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
       
   162 _DOSNAME=$(UNIXCOMMAND_PATH)dosname
       
   163 DOSNAME_CMD:=$(_DOSNAME) -s
       
   164 define FullPath
   175 define FullPath
   165 $(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
   176 $(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
   166 endef
   177 endef
   167 endif # test dosname -s
   178     endif # test dosname -s
   168 endif # TRY_DOSNAME
   179   endif # TRY_DOSNAME
   169 endif # MKS
   180 endif # MKS
   170 
   181 
   171 # We try to get references to what we need via the default component
   182 # We try to get references to what we need via the default component
   172 #    environment variables, or what was used historically.
   183 #    environment variables, or what was used historically.
   173 
   184 
   238 endif
   249 endif
   239 
   250 
   240 # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
   251 # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
   241 #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
   252 #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
   242 ifndef DEVTOOLS_PATH
   253 ifndef DEVTOOLS_PATH
       
   254   # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
       
   255   #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
   243   ifdef ALT_DEVTOOLS_PATH
   256   ifdef ALT_DEVTOOLS_PATH
   244     xALT_DEVTOOLS_PATH  :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
   257     xALT_DEVTOOLS_PATH  :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
   245     fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
   258     fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
   246     DEVTOOLS_PATH       :=$(call PrefixPath,$(fxALT_DEVTOOLS_PATH))
   259     DEVTOOLS_PATH       :=$(call PrefixPath,$(fxALT_DEVTOOLS_PATH))
   247   else
   260   else
   248     ifdef USING_CYGWIN
   261     ifdef USING_CYGWIN
   249       DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
   262       DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
   250     else
   263     else
   251       xDEVTOOLS_PATH  :="$(_system_drive)/utils"
   264       ifdef USING_MSYS
   252       fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
   265         DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
   253       DEVTOOLS_PATH  :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
   266       else
   254     endif
   267         xDEVTOOLS_PATH  :="$(_system_drive)/utils"
       
   268         fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
       
   269         DEVTOOLS_PATH  :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
       
   270       endif # USING_MSYS
       
   271     endif # USING_CYGWIN
   255   endif
   272   endif
   256   DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
   273   DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
   257   export DEVTOOLS_PATH
   274   export DEVTOOLS_PATH
   258 endif
   275 endif
   259 
   276