jdk/test/Makefile
changeset 5149 efce9634bfc0
parent 4991 38f33163acce
child 5506 202f599c92aa
child 5600 8ca34998a6b3
--- a/jdk/test/Makefile	Thu Mar 11 16:17:57 2010 +0000
+++ b/jdk/test/Makefile	Fri Mar 12 09:03:02 2010 -0800
@@ -70,6 +70,10 @@
 ifeq ($(UNAME_S), Linux)
   OS_NAME     = linux
   OS_ARCH    := $(shell $(UNAME) -m)
+  # Check for unknown arch, try uname -p if uname -m says unknown
+  ifeq ($(OS_ARCH),unknown)
+    OS_ARCH    := $(shell $(UNAME) -p)
+  endif
   OS_VERSION := $(shell $(UNAME) -r)
 endif
 ifndef OS_NAME
@@ -93,16 +97,26 @@
 # Only want major and minor numbers from os version
 OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
 
-# Try and use names i586, x64, and ia64 consistently  
-OS_ARCH:=$(subst X64,x64,$(OS_ARCH))
-OS_ARCH:=$(subst AMD64,x64,$(OS_ARCH))
-OS_ARCH:=$(subst amd64,x64,$(OS_ARCH))
-OS_ARCH:=$(subst x86_64,x64,$(OS_ARCH))
-OS_ARCH:=$(subst EM64T,x64,$(OS_ARCH))
-OS_ARCH:=$(subst em64t,x64,$(OS_ARCH))
-OS_ARCH:=$(subst intel64,x64,$(OS_ARCH))
-OS_ARCH:=$(subst Intel64,x64,$(OS_ARCH))
-OS_ARCH:=$(subst INTEL64,x64,$(OS_ARCH))
+# Name to use for x86_64 arch (historically amd64, but should change someday)
+OS_ARCH_X64_NAME:=amd64
+#OS_ARCH_X64_NAME:=x64
+
+# Alternate arch names (in case this arch is known by a second name)
+#   PROBLEM_LISTS may use either name.
+OS_ARCH2-amd64:=x64
+#OS_ARCH2-x64:=amd64
+
+# Try and use the arch names consistently
+OS_ARCH:=$(subst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(subst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
 OS_ARCH:=$(subst IA64,ia64,$(OS_ARCH))
 OS_ARCH:=$(subst X86,i586,$(OS_ARCH))
 OS_ARCH:=$(subst x86,i586,$(OS_ARCH))
@@ -110,17 +124,32 @@
 OS_ARCH:=$(subst i486,i586,$(OS_ARCH))
 OS_ARCH:=$(subst i686,i586,$(OS_ARCH))
 
-# Check for ARCH_DATA_MODEL, adjust OS_ARCH accordingly
+# Default  ARCH_DATA_MODEL settings
+ARCH_DATA_MODEL-i586 = 32
+ARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64
+ARCH_DATA_MODEL-ia64 = 64
+ARCH_DATA_MODEL-sparc = 32
+ARCH_DATA_MODEL-sparcv9 = 64
+
+# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
+ifndef ARCH_DATA_MODEL
+  ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH))
+endif
 ifndef ARCH_DATA_MODEL
   ARCH_DATA_MODEL=32
 endif
+
+# Platform directory name
+PLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
+
+# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
 ARCH_DATA_MODEL_ERROR= \
-  ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(OS_NAME)-$(ARCH)
+  ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
 ifeq ($(ARCH_DATA_MODEL),64)
-  ifeq ($(OS_NAME)-$(OS_ARCH),solaris-i586)
-    OS_ARCH=x64
+  ifeq ($(PLATFORM_OS),solaris-i586)
+    OS_ARCH=$(OS_ARCH_X64_NAME)
   endif
-  ifeq ($(OS_NAME)-$(OS_ARCH),solaris-sparc)
+  ifeq ($(PLATFORM_OS),solaris-sparc)
     OS_ARCH=sparcv9
   endif
   ifeq ($(OS_ARCH),i586)
@@ -131,7 +160,7 @@
   endif
 else
   ifeq ($(ARCH_DATA_MODEL),32)
-    ifeq ($(OS_ARCH),x64)
+    ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
       x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
     endif
     ifeq ($(OS_ARCH),ia64)
@@ -145,6 +174,12 @@
   endif
 endif
 
+# Alternate OS_ARCH name (defaults to OS_ARCH)
+OS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
+ifeq ($(OS_ARCH2),)
+  OS_ARCH2:=$(OS_ARCH)
+endif
+
 # Root of this test area (important to use full paths in some places)
 TEST_ROOT := $(shell $(PWD))
 
@@ -152,21 +187,21 @@
 ifdef ALT_OUTPUTDIR
   ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
 else
-  ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(OS_NAME)-$(OS_ARCH)
+  ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
 endif
-ABS_BUILD_ROOT = $(ABS_OUTPUTDIR)
-ABS_TEST_OUTPUT_DIR := $(ABS_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
+ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
+ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
 
 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
 ifndef PRODUCT_HOME
   # Try to use j2sdk-image if it exists
-  ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
-  PRODUCT_HOME :=                       \
-    $(shell                             \
-      if [ -d $(ABS_JDK_IMAGE) ] ; then \
-         $(ECHO) "$(ABS_JDK_IMAGE)";    \
-       else                             \
-         $(ECHO) "$(ABS_BUILD_ROOT)";   \
+  ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
+  PRODUCT_HOME :=                       		\
+    $(shell                             		\
+      if [ -d $(ABS_JDK_IMAGE) ] ; then 		\
+         $(ECHO) "$(ABS_JDK_IMAGE)";    		\
+       else                             		\
+         $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)";		\
        fi)
   PRODUCT_HOME := $(PRODUCT_HOME)
 endif
@@ -325,8 +360,10 @@
 	@$(RM) $@ $@.temp1 $@.temp2
 	@(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all'          ) ;\
 	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH)'   ) ;\
+	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)'  ) ;\
 	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
 	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)'      ) ;\
+	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)'     ) ;\
           ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all'             ) ;\
           ($(ECHO) "#") ;\
         ) | $(SED) -e 's@^[\ ]*@@' \