jdk/make/common/shared/Platform.gmk
changeset 8201 9e6915af34ba
parent 5627 e636ac7a63a4
child 8592 c22d2d0a1ff6
child 8796 604a43386301
equal deleted inserted replaced
8052:7da3f5f30855 8201:9e6915af34ba
    70 #     LIBARCH32                   solaris only: sparc or i386
    70 #     LIBARCH32                   solaris only: sparc or i386
    71 #     LIBARCH64                   solaris only: sparcv9 or amd64
    71 #     LIBARCH64                   solaris only: sparcv9 or amd64
    72 #     USING_CYGWIN                windows only: true or false
    72 #     USING_CYGWIN                windows only: true or false
    73 #     ISHIELD_TEMP_MIN            windows only: minimum disk space in temp area
    73 #     ISHIELD_TEMP_MIN            windows only: minimum disk space in temp area
    74 
    74 
    75 SYSTEM_UNAME := $(shell uname)
    75 # Only run uname once in this make session.
       
    76 ifndef SYSTEM_UNAME
       
    77   SYSTEM_UNAME := $(shell uname)
       
    78   export SYSTEM_UNAME
       
    79 endif
    76 
    80 
    77 #
    81 #
    78 # Prune out all known SCM (Source Code Management) directories
    82 # Prune out all known SCM (Source Code Management) directories
    79 # so they will not be included when copying directory trees
    83 # so they will not be included when copying directory trees
    80 # or packaging up .jar files, etc.  This applies to all workspaces.
    84 # or packaging up .jar files, etc.  This applies to all workspaces.
   220 endif
   224 endif
   221 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
   225 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
   222   PLATFORM = windows
   226   PLATFORM = windows
   223   USING_CYGWIN = true
   227   USING_CYGWIN = true
   224   export USING_CYGWIN
   228   export USING_CYGWIN
       
   229   CYGPATH_CMD=cygpath -a -s -m
       
   230   # Only run "cygpath /" once in this make session.
       
   231   ifndef CYGWIN_HOME
       
   232     CYGWIN_HOME := $(shell $(CYGPATH_CMD) /)
       
   233     export CYGWIN_HOME
       
   234   endif
   225 endif
   235 endif
   226 
   236 
   227 # Platform settings specific to Windows
   237 # Platform settings specific to Windows
   228 ifeq ($(PLATFORM), windows)
   238 ifeq ($(PLATFORM), windows)
   229   # Windows builds default to the appropriate for the underlaying
   239   # Windows builds default to the appropriate for the underlaying
   233   # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
   243   # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
   234   #  return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
   244   #  return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
   235   #  And sometimes PROCESSOR_IDENTIFIER is not defined at all
   245   #  And sometimes PROCESSOR_IDENTIFIER is not defined at all
   236   #  (in some restricted shells), so we use uname if we have to.
   246   #  (in some restricted shells), so we use uname if we have to.
   237   ifeq ($(PROCESSOR_IDENTIFIER),)
   247   ifeq ($(PROCESSOR_IDENTIFIER),)
   238     PROC_ARCH:=$(shell uname -m)
   248     # Only run uname -m once in this make session.
       
   249     ifndef SYSTEM_UNAME_M
       
   250       SYSTEM_UNAME_M := $(shell uname -m)
       
   251       export SYSTEM_UNAME_M
       
   252     endif
       
   253     PROC_ARCH:=$(SYSTEM_UNAME_M)
   239   else
   254   else
   240     PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
   255     PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
   241   endif
   256   endif
   242   # Cover all the possibilities, MKS uname, CYGWIN uname, PROCESSOR_IDENTIFIER
   257   # Cover all the possibilities, MKS uname, CYGWIN uname, PROCESSOR_IDENTIFIER
   243   #    Get: X86, X64, or IA64
   258   #    Get: X86, X64, or IA64